|
|
@ -275,13 +275,13 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
} |
|
|
|
// 验证数据库是否重复
|
|
|
|
for (int i = 0; i < vinNoList.size(); i++) { |
|
|
|
int count = scmApplyInboundVehicleService.checkVinNo(vinNoList.get(i), dto.getUseOrgSid(),dto.getSid()); |
|
|
|
int count = scmApplyInboundVehicleService.checkVinNo(vinNoList.get(i), dto.getUseOrgSid(), dto.getSid()); |
|
|
|
BaseVehicle data = baseVehicleFeign.selectByVinNoAndOrgSid(vinNoList.get(i), dto.getUseOrgSid()).getData(); |
|
|
|
if (count > 0) { |
|
|
|
return new ResultBean().setMsg(vinNoList.get(i) + "车架号已经存在"); |
|
|
|
} |
|
|
|
if (data != null) { |
|
|
|
if (StringUtils.isNotBlank(data.getVinNo())){ |
|
|
|
if (StringUtils.isNotBlank(data.getVinNo())) { |
|
|
|
return new ResultBean().setMsg(vinNoList.get(i) + "车架号已经存在"); |
|
|
|
} |
|
|
|
} |
|
|
@ -329,16 +329,16 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
vo.setGuidedPrice(guidedPrice + "/" + manufactorSettlementPrice); |
|
|
|
String updateDate = DateUtil.formatDate(baseVehmodelVo.getModifyTime()); |
|
|
|
String nowDate = DateUtil.formatDate(new Date()); |
|
|
|
if (StringUtils.isBlank(guidedPrice) && StringUtils.isBlank(manufactorSettlementPrice)){ |
|
|
|
if (StringUtils.isBlank(guidedPrice) && StringUtils.isBlank(manufactorSettlementPrice)) { |
|
|
|
vo.setNewUpdateDate(""); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
vo.setNewUpdateDate(DateUtil.formatDate(baseVehmodelVo.getModifyTime())); |
|
|
|
} |
|
|
|
String[] updateDates = updateDate.split("-"); |
|
|
|
String[] nowDates = nowDate.split("-"); |
|
|
|
if (updateDates[0].equals(nowDates[0]) && updateDates[1].equals(nowDates[1])){ |
|
|
|
if (updateDates[0].equals(nowDates[0]) && updateDates[1].equals(nowDates[1])) { |
|
|
|
vo.setIsNow(true); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
vo.setIsNow(false); |
|
|
|
} |
|
|
|
List<ScmApplyInboundVehicleVo> list = scmApplyInboundVehicleService.selectListByAppSid(sid); |
|
|
@ -423,7 +423,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
String guidedPrice = dto.getGuidedPrice(); |
|
|
|
String[] split = guidedPrice.split("/"); |
|
|
|
List<String> stringList = Arrays.asList(split); |
|
|
|
if (stringList.size() < 2){ |
|
|
|
if (stringList.size() < 2) { |
|
|
|
return new ResultBean().fail().setMsg("车型与配置贷款或全款销售指导价未维护,不可提交"); |
|
|
|
} |
|
|
|
List<ScmApplyInboundVehicleDto> vehicleList = dto.getVehicleList(); |
|
|
@ -487,7 +487,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
confirmName = flowTask.getTaskUserInfos().get(0).getAssigneeName(); |
|
|
|
confirmDate = DateUtil.formatDate(flowTask.getFinishTime()); |
|
|
|
break; |
|
|
|
}else if (flowTask.getTaskName().equals("销售支持部经理审批")) { |
|
|
|
} else if (flowTask.getTaskName().equals("销售支持部经理审批")) { |
|
|
|
confirmSid = flowTask.getTaskUserInfos().get(0).getAssigneeSid(); |
|
|
|
confirmName = flowTask.getTaskUserInfos().get(0).getAssigneeName(); |
|
|
|
confirmDate = DateUtil.formatDate(flowTask.getFinishTime()); |
|
|
@ -566,7 +566,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
confirmName = flowTask.getTaskUserInfos().get(0).getAssigneeName(); |
|
|
|
confirmDate = DateUtil.formatDate(flowTask.getFinishTime()); |
|
|
|
break; |
|
|
|
}else if (flowTask.getTaskName().equals("销售支持部经理审批")) { |
|
|
|
} else if (flowTask.getTaskName().equals("销售支持部经理审批")) { |
|
|
|
confirmSid = flowTask.getTaskUserInfos().get(0).getAssigneeSid(); |
|
|
|
confirmName = flowTask.getTaskUserInfos().get(0).getAssigneeName(); |
|
|
|
confirmDate = DateUtil.formatDate(flowTask.getFinishTime()); |
|
|
@ -645,7 +645,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
confirmName = flowTask.getTaskUserInfos().get(0).getAssigneeName(); |
|
|
|
confirmDate = DateUtil.formatDate(flowTask.getFinishTime()); |
|
|
|
break; |
|
|
|
}else if (flowTask.getTaskName().equals("销售支持部经理审批")) { |
|
|
|
} else if (flowTask.getTaskName().equals("销售支持部经理审批")) { |
|
|
|
confirmSid = flowTask.getTaskUserInfos().get(0).getAssigneeSid(); |
|
|
|
confirmName = flowTask.getTaskUserInfos().get(0).getAssigneeName(); |
|
|
|
confirmDate = DateUtil.formatDate(flowTask.getFinishTime()); |
|
|
@ -975,10 +975,10 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
public ResultBean cancal(String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
ScmApplyInbound scmApplyInbound = fetchBySid(sid); |
|
|
|
if("已办结".equals(scmApplyInbound.getNodeState())){ |
|
|
|
if ("已办结".equals(scmApplyInbound.getNodeState())) { |
|
|
|
return rb.setMsg("该数据已审批通过,不允许终止"); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(scmApplyInbound.getTaskId())){ |
|
|
|
if (StringUtils.isNotBlank(scmApplyInbound.getTaskId())) { |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo flowTaskVo = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
flowTaskVo.setTaskId(scmApplyInbound.getTaskId()); |
|
|
|
flowTaskVo.setInstanceId(scmApplyInbound.getProcInsId()); |
|
|
@ -991,10 +991,10 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
updateFlowFiled(map); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
}else{ |
|
|
|
scmApplyInbound.setNodeState("终止"); |
|
|
|
scmApplyInbound.setTaskDefKey("Event_end"); |
|
|
|
baseMapper.updateById(scmApplyInbound); |
|
|
|
} else { |
|
|
|
scmApplyInbound.setNodeState("终止"); |
|
|
|
scmApplyInbound.setTaskDefKey("Event_end"); |
|
|
|
baseMapper.updateById(scmApplyInbound); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
@ -1005,13 +1005,12 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
String guidedPrice = dto.getGuidedPrice(); |
|
|
|
String[] split = guidedPrice.split("/"); |
|
|
|
List<String> stringList = Arrays.asList(split); |
|
|
|
if (stringList.size() < 2){ |
|
|
|
if (stringList.size() < 2) { |
|
|
|
return new ResultBean().fail().setMsg("车型与配置贷款或全款销售指导价未维护,不可确认"); |
|
|
|
} |
|
|
|
List<ScmApplyInboundVehicleDto> vehicleList = dto.getVehicleList(); |
|
|
|
ScmApplyInbound scmApplyInbound1 = fetchBySid(busSid); |
|
|
|
if (StringUtils.isBlank(busSid)) { |
|
|
|
Map<String, Object> variables = BeanUtil.beanToMap(dto); |
|
|
|
ResultBean<String> resultBean = saveOrUpdateApplyInBound(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return ResultBean.fireFail().setMsg(resultBean.getMsg()); |
|
|
@ -1041,6 +1040,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
} |
|
|
|
int i = Integer.parseInt(num) - scmApplyInboundVehicleDtos1.size(); |
|
|
|
baseMapper.updateNumBySid(String.valueOf(i), businessSid); |
|
|
|
baseMapper.updateNodeState(businessSid); |
|
|
|
//数据推送
|
|
|
|
String name = ""; |
|
|
|
String confirmSid = ""; |
|
|
@ -1050,28 +1050,63 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
List<ScmApplyInboundVehicleDto> scmApplyInboundVehicleDtos = scmApplyInboundVehicleService.fetchByMainSid(businessSid); |
|
|
|
ResultBean<List<String>> sids = scmVehicleExamineService.saveEntryCarInspectedInfoBatch(booad, scmApplyInboundVehicleDtos); |
|
|
|
saveItem(sids); |
|
|
|
FlowRecordVo flowRecordVo = flowTaskFeign.businessFlowRecord(booad.getProcInsId()).getData(); |
|
|
|
List<FlowTask> flowList = flowRecordVo.getFlowList(); |
|
|
|
for (FlowTask flowTask : flowList) { |
|
|
|
if (flowTask.getTaskName().equals("账务部审批")) { |
|
|
|
confirmSid = flowTask.getTaskUserInfos().get(0).getAssigneeSid(); |
|
|
|
confirmName = flowTask.getTaskUserInfos().get(0).getAssigneeName(); |
|
|
|
confirmDate = DateUtil.formatDate(flowTask.getFinishTime()); |
|
|
|
break; |
|
|
|
}else if (flowTask.getTaskName().equals("销售支持部经理审批")) { |
|
|
|
confirmSid = flowTask.getTaskUserInfos().get(0).getAssigneeSid(); |
|
|
|
confirmName = flowTask.getTaskUserInfos().get(0).getAssigneeName(); |
|
|
|
confirmDate = DateUtil.formatDate(flowTask.getFinishTime()); |
|
|
|
} |
|
|
|
} |
|
|
|
name = confirmSid + "," + confirmName + "," + confirmDate; |
|
|
|
newBaseVehicleDto(booad, scmApplyInboundVehicleDtos, name); |
|
|
|
//入账审批通关修改采购订单状态 state = 1
|
|
|
|
if (booad.getManPurOrderTypeKey().equals(ManPurOrderType.ManOrderType.PC_ORDER.getCode())) { |
|
|
|
busVehicleOrderFeign.updateState(booad.getVehicleOrderSid()); |
|
|
|
} |
|
|
|
return null; |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
return submitBusinessData(dto, busSid, scmApplyInbound1); |
|
|
|
return confirmRZUpdate(dto, busSid, scmApplyInbound1); |
|
|
|
} |
|
|
|
|
|
|
|
private synchronized ResultBean confirmRZUpdate(SubmitScmApplyInboundDto dto, String businessSid, ScmApplyInbound scmApplyInbound) { |
|
|
|
List<ScmApplyInboundVehicleDto> scmApplyInboundVehicleDtos1 = new ArrayList<>(); |
|
|
|
List<ScmApplyInboundVehicleDto> scmApplyInboundVehicleDtos2 = new ArrayList<>(); |
|
|
|
ScmApplyInboundDto scmApplyInboundDto = new ScmApplyInboundDto(); |
|
|
|
List<ScmApplyInboundVehicleDto> vehicleList = dto.getVehicleList(); |
|
|
|
for (ScmApplyInboundVehicleDto scmApplyInboundVehicleDto : vehicleList) { |
|
|
|
String vinNo = scmApplyInboundVehicleDto.getVinNo(); |
|
|
|
if (StringUtils.isBlank(vinNo)) { |
|
|
|
scmApplyInboundVehicleService.deleteBySid(scmApplyInboundVehicleDto.getSid()); |
|
|
|
BeanUtil.copyProperties(dto, scmApplyInboundDto); |
|
|
|
scmApplyInboundDto.setSid(null); |
|
|
|
scmApplyInboundVehicleDtos1.add(scmApplyInboundVehicleDto); |
|
|
|
} else { |
|
|
|
scmApplyInboundVehicleDtos2.add(scmApplyInboundVehicleDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (scmApplyInboundVehicleDtos1.size() > 0) { |
|
|
|
scmApplyInboundDto.setVehicleList(scmApplyInboundVehicleDtos1); |
|
|
|
scmApplyInboundDto.setNum(String.valueOf(scmApplyInboundVehicleDtos1.size())); |
|
|
|
scmApplyInboundDto.setPcApplicationCode(scmApplyInbound.getPcApplicationCode()); |
|
|
|
saveOrUpdateApplyInBound(scmApplyInboundDto); |
|
|
|
} |
|
|
|
baseMapper.updateNumBySid(String.valueOf(scmApplyInboundVehicleDtos2.size()), businessSid); |
|
|
|
baseMapper.updateNodeState(businessSid); |
|
|
|
dto.setVehicleList(scmApplyInboundVehicleDtos2); |
|
|
|
dto.setNum(String.valueOf(scmApplyInboundVehicleDtos2.size())); |
|
|
|
dto.setNodeState("已办结"); |
|
|
|
ResultBean<String> stringResultBean = saveOrUpdateApplyInBound(dto); |
|
|
|
if (!stringResultBean.getSuccess()) { |
|
|
|
return ResultBean.fireFail().setMsg(stringResultBean.getMsg()); |
|
|
|
} |
|
|
|
//数据推送
|
|
|
|
String name = ""; |
|
|
|
String confirmSid = ""; |
|
|
|
String confirmName = ""; |
|
|
|
String confirmDate = ""; |
|
|
|
ScmApplyInbound booad = fetchBySid(businessSid); |
|
|
|
List<ScmApplyInboundVehicleDto> scmApplyInboundVehicleDtos = scmApplyInboundVehicleService.fetchByMainSid(businessSid); |
|
|
|
ResultBean<List<String>> sids = scmVehicleExamineService.saveEntryCarInspectedInfoBatch(booad, scmApplyInboundVehicleDtos); |
|
|
|
saveItem(sids); |
|
|
|
name = confirmSid + "," + confirmName + "," + confirmDate; |
|
|
|
newBaseVehicleDto(booad, scmApplyInboundVehicleDtos, name); |
|
|
|
//入账审批通关修改采购订单状态 state = 1
|
|
|
|
if (booad.getManPurOrderTypeKey().equals(ManPurOrderType.ManOrderType.PC_ORDER.getCode())) { |
|
|
|
busVehicleOrderFeign.updateState(booad.getVehicleOrderSid()); |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess(); |
|
|
|
} |
|
|
|
} |