|
|
@ -179,10 +179,10 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
ScmApplyInbound inboundVehicle = new ScmApplyInbound(); |
|
|
|
BeanUtil.copyProperties(dto, inboundVehicle); |
|
|
|
inboundVehicle.setSid(UUID.randomUUID().toString()); |
|
|
|
String userSid = dto.getUserSid(); |
|
|
|
/*String userSid = dto.getUserSid(); |
|
|
|
ResultBean<String> pathSidByUserSid = sysStaffOrgFeign.getPathSidByUserSid(userSid); |
|
|
|
String createOrgSid = pathSidByUserSid.getData(); |
|
|
|
inboundVehicle.setUseOrgSid(createOrgSid); |
|
|
|
inboundVehicle.setUseOrgSid(createOrgSid);*/ |
|
|
|
save(inboundVehicle); |
|
|
|
// 保存车辆列表
|
|
|
|
//scmApplyInboundVehicleService.saveApplyInboundVehicleList(vehicleList, inboundVehicle.getSid(), inboundVehicle.getModelSid());
|
|
|
@ -356,10 +356,27 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = orgByStaffSid.getData().getOrgSidPath(); |
|
|
|
String busSid = dto.getSid(); |
|
|
|
List<ScmApplyInboundVehicleDto> vehicleList = dto.getVehicleList(); |
|
|
|
if (StringUtils.isBlank(busSid)) { |
|
|
|
Map<String, Object> variables = BeanUtil.beanToMap(dto); |
|
|
|
ResultBean resultBean = saveOrUpdateApplyInBound(dto);//insert
|
|
|
|
String businessSid = resultBean.getData().toString(); |
|
|
|
ScmApplyInbound scmApplyInbound = fetchBySid(businessSid); |
|
|
|
List<ScmApplyInboundVehicleDto> scmApplyInboundVehicleDtos1 = new ArrayList<>(); |
|
|
|
ScmApplyInboundDto scmApplyInboundDto = new ScmApplyInboundDto(); |
|
|
|
for (ScmApplyInboundVehicleDto scmApplyInboundVehicleDto : vehicleList) { |
|
|
|
String vinNo = scmApplyInboundVehicleDto.getVinNo(); |
|
|
|
if (StringUtils.isBlank(vinNo)){ |
|
|
|
scmApplyInboundVehicleService.deleteBySid(scmApplyInboundVehicleDto.getSid()); |
|
|
|
BeanUtil.copyProperties(scmApplyInbound,scmApplyInboundDto); |
|
|
|
scmApplyInboundDto.setSid(null); |
|
|
|
scmApplyInboundVehicleDtos1.add(scmApplyInboundVehicleDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (scmApplyInboundVehicleDtos1.size() > 0){ |
|
|
|
scmApplyInboundDto.setVehicleList(scmApplyInboundVehicleDtos1); |
|
|
|
saveOrUpdateApplyInBound(scmApplyInboundDto); |
|
|
|
} |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(dto, bv); |
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
@ -378,6 +395,27 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
|
|
|
|
private synchronized ResultBean submitBusinessData(SubmitScmApplyInboundDto dto, String businessSid, String orgSidPath) { |
|
|
|
Map<String, Object> variables = BeanUtil.beanToMap(dto); |
|
|
|
ScmApplyInbound scmApplyInbound = fetchBySid(businessSid); |
|
|
|
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(scmApplyInbound,scmApplyInboundDto); |
|
|
|
scmApplyInboundDto.setSid(null); |
|
|
|
scmApplyInboundVehicleDtos1.add(scmApplyInboundVehicleDto); |
|
|
|
}else { |
|
|
|
scmApplyInboundVehicleDtos2.add(scmApplyInboundVehicleDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (scmApplyInboundVehicleDtos1.size() > 0){ |
|
|
|
scmApplyInboundDto.setVehicleList(scmApplyInboundVehicleDtos1); |
|
|
|
scmApplyInboundDto.setNum(String.valueOf(scmApplyInboundVehicleDtos1.size())); |
|
|
|
saveOrUpdateApplyInBound(scmApplyInboundDto); |
|
|
|
} |
|
|
|
ScmApplyInbound entity = this.fetchBySid(dto.getSid()); |
|
|
|
String businessTaskid = entity.getTaskId(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
@ -390,12 +428,14 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
bv.setModelId(ProcDefEnum.RECORDAPPLICATION.getProDefId()); |
|
|
|
bv.setInstanceId(entity.getProcInsId()); |
|
|
|
if (StringUtils.isBlank(businessTaskid) && StringUtils.isBlank(dto.getTaskId())) { |
|
|
|
dto.setVehicleList(scmApplyInboundVehicleDtos2); |
|
|
|
saveOrUpdateApplyInBound(dto); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean1 = flowableFeign.startProcess(bv); |
|
|
|
UpdateFlowFieldVo uff = resultBean1.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(uff)); |
|
|
|
return resultBean1; |
|
|
|
} else if (StringUtils.isNotBlank(businessTaskid) && businessTaskid.equals(dto.getTaskId())) {//只有数据一致的时候才能进行下一步
|
|
|
|
dto.setVehicleList(scmApplyInboundVehicleDtos2); |
|
|
|
saveOrUpdateApplyInBound(dto); |
|
|
|
bv.setTaskDefKey(entity.getTaskDefKey()); |
|
|
|
bv.setComment(StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|
|
|