|
|
@ -65,6 +65,8 @@ import com.yxt.anrui.scm.api.scmvehiclegression.flowable.GetNodeVo; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegression.flowable.ScmCarTransferTaskQuery; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegression.flowable.SubmitCarTransferDto; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegressionveh.ScmVehicleGressionVeh; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegressionveh.ScmVehicleGressionVehDto; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegressionveh.ScmVehicleGressionVehVo; |
|
|
|
import com.yxt.anrui.scm.biz.scmexitpermit.ScmExitPermitService; |
|
|
|
import com.yxt.anrui.scm.biz.scmfile.ScmFileService; |
|
|
|
import com.yxt.anrui.scm.biz.scmvehiclegressionveh.ScmVehicleGressionVehService; |
|
|
@ -370,7 +372,8 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean saveCarTransferInfo(AppScmVehicleGressionDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (dto.getVins() == null) { |
|
|
|
List<ScmVehicleGressionVehDto> scmVehicleGressionVehDtos = dto.getScmVehicleGressionVehs(); |
|
|
|
if (scmVehicleGressionVehDtos == null) { |
|
|
|
return rb.setMsg("请选择车架号!"); |
|
|
|
} |
|
|
|
if (dto.getLocationSid().equals(dto.getTargetLocationSid())) { |
|
|
@ -384,6 +387,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
} |
|
|
|
String s1 = ""; |
|
|
|
String type = "04"; |
|
|
|
String vinNo = ""; |
|
|
|
String userSid = dto.getUserSid(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(userSid).getData(); |
|
|
|
AppUserOrgInfoVo data = sysUserFeign.getUserOrgInfoByUserSid(userSid).getData(); |
|
|
@ -403,47 +407,17 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
// Map<String, String> stringStringMap = generateBillNo(userSid);
|
|
|
|
String billNo = getApplyCode(dto); |
|
|
|
scmVehicleGression.setApplicantNo(billNo); |
|
|
|
// if ("1".equals(dto.getProCardStateKey())) {
|
|
|
|
// scmVehicleGression.setTemporaryCard(dto.getTemporaryCard());
|
|
|
|
// } else if ("0".equals(dto.getProCardStateKey())) {
|
|
|
|
// scmVehicleGression.setTemporaryCard("");
|
|
|
|
// }
|
|
|
|
// if ("1".equals(dto.getInsuranceStateKey())) { // 如果保单状态为否 不保存保单照片
|
|
|
|
// List<String> factoryImage = dto.getPolicyImage();
|
|
|
|
// if (factoryImage.size() <= 0) {
|
|
|
|
// return rb.setMsg("保单照片不能为空");
|
|
|
|
// }
|
|
|
|
// scmFileService.deleteByLinkSidAndType(scmVehicleGression.getSid(), type);
|
|
|
|
// for (String s : factoryImage) {
|
|
|
|
// if (s.contains(fileUploadComponent.getUrlPrefix())) {
|
|
|
|
// s1 = s.replace(fileUploadComponent.getUrlPrefix(), "");
|
|
|
|
// }
|
|
|
|
// ScmFile scmFile = new ScmFile();
|
|
|
|
// scmFile.setAttachType(type);
|
|
|
|
// scmFile.setFileName("保单照片");
|
|
|
|
// scmFile.setFilePath(s1);
|
|
|
|
// scmFile.setLinkSid(scmVehicleGression.getSid());
|
|
|
|
// scmFileService.save(scmFile);
|
|
|
|
// }
|
|
|
|
// } else if ("0".equals(dto.getInsuranceStateKey())) {
|
|
|
|
// scmFileService.deleteByLinkSidAndType(scmVehicleGression.getSid(), type);
|
|
|
|
// }
|
|
|
|
save(scmVehicleGression); |
|
|
|
//存放车架号
|
|
|
|
List<String> vins = dto.getVins(); |
|
|
|
if (vins != null) { |
|
|
|
for (String vin : vins) { |
|
|
|
ScmVehicleGressionVeh scmVehicleGressionVeh = new ScmVehicleGressionVeh(); |
|
|
|
scmVehicleGressionVeh.setMainSid(scmVehicleGression.getSid()); |
|
|
|
scmVehicleGressionVeh.setVehVin(vin); |
|
|
|
BaseVehicleVo baseVehicleVo = baseVehicleFeign.selVehicleByVinNo(vin).getData(); |
|
|
|
scmVehicleGressionVeh.setVehSid(baseVehicleVo.getSid()); |
|
|
|
scmVehicleGressionVeh.setSettlementStatus(baseVehicleVo.getSettlementStatus()); |
|
|
|
scmVehicleGressionVeh.setSettlementStatusValue(baseVehicleVo.getSettlementStatusValue()); |
|
|
|
scmVehicleGressionVeh.setTemporaryCardNo(dto.getTemporaryCard()); |
|
|
|
scmVehicleGressionVehService.save(scmVehicleGressionVeh); |
|
|
|
} |
|
|
|
for (ScmVehicleGressionVehDto scmVehicleGressionVehDto : scmVehicleGressionVehDtos) { |
|
|
|
ScmVehicleGressionVeh scmVehicleGressionVeh = new ScmVehicleGressionVeh(); |
|
|
|
BeanUtil.copyProperties(scmVehicleGressionVehDto, scmVehicleGressionVeh, "sid"); |
|
|
|
vinNo = scmVehicleGressionVehDto.getVehVin(); |
|
|
|
BaseVehicleVo baseVehicleVo = baseVehicleFeign.selVehicleByVinNo(vinNo).getData(); |
|
|
|
scmVehicleGressionVeh.setVehSid(baseVehicleVo.getSid()); |
|
|
|
scmVehicleGressionVeh.setMainSid(scmVehicleGression.getSid()); |
|
|
|
scmVehicleGressionVehService.save(scmVehicleGressionVeh); |
|
|
|
} |
|
|
|
save(scmVehicleGression); |
|
|
|
} else { |
|
|
|
scmVehicleGression = fetchBySid(dto.getSid()); |
|
|
|
if (scmVehicleGression == null) { |
|
|
@ -452,19 +426,15 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
BeanUtil.copyProperties(dto, scmVehicleGression, "sid"); |
|
|
|
updateById(scmVehicleGression); |
|
|
|
scmVehicleGressionVehService.deleteByMainSid(scmVehicleGression.getSid()); |
|
|
|
List<String> vins = dto.getVins(); |
|
|
|
if (vins != null) { |
|
|
|
for (String vin : vins) { |
|
|
|
ScmVehicleGressionVeh scmVehicleGressionVeh = new ScmVehicleGressionVeh(); |
|
|
|
scmVehicleGressionVeh.setMainSid(scmVehicleGression.getSid()); |
|
|
|
scmVehicleGressionVeh.setVehVin(vin); |
|
|
|
BaseVehicleVo baseVehicleVo = baseVehicleFeign.selVehicleByVinNo(vin).getData(); |
|
|
|
scmVehicleGressionVeh.setVehSid(baseVehicleVo.getSid()); |
|
|
|
scmVehicleGressionVeh.setSettlementStatus(baseVehicleVo.getSettlementStatus()); |
|
|
|
scmVehicleGressionVeh.setSettlementStatusValue(baseVehicleVo.getSettlementStatusValue()); |
|
|
|
scmVehicleGressionVeh.setTemporaryCardNo(dto.getTemporaryCard()); |
|
|
|
scmVehicleGressionVehService.save(scmVehicleGressionVeh); |
|
|
|
} |
|
|
|
//存放车架号
|
|
|
|
for (ScmVehicleGressionVehDto scmVehicleGressionVehDto : scmVehicleGressionVehDtos) { |
|
|
|
ScmVehicleGressionVeh scmVehicleGressionVeh = new ScmVehicleGressionVeh(); |
|
|
|
BeanUtil.copyProperties(scmVehicleGressionVehDto, scmVehicleGressionVeh, "sid"); |
|
|
|
vinNo = scmVehicleGressionVehDto.getVehVin(); |
|
|
|
BaseVehicleVo baseVehicleVo = baseVehicleFeign.selVehicleByVinNo(vinNo).getData(); |
|
|
|
scmVehicleGressionVeh.setVehSid(baseVehicleVo.getSid()); |
|
|
|
scmVehicleGressionVeh.setMainSid(scmVehicleGression.getSid()); |
|
|
|
scmVehicleGressionVehService.save(scmVehicleGressionVeh); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(scmVehicleGression.getSid()).setMsg("保存成功"); |
|
|
@ -485,8 +455,10 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
AppUserOrgInfoVo data = sysUserFeign.getUserOrgInfoByUserSid(userSid).getData(); |
|
|
|
SysStaffinfoVo data1 = sysUserFeign.getSysUserByMobile(data.getStaffSid()).getData(); |
|
|
|
AppScmVehicleGressionInfoVo vo = baseMapper.getCarTransferInfo(sid, useOrgSid); |
|
|
|
List<String> vins = scmVehicleGressionVehService.fetchVoByMainSid(sid); |
|
|
|
vo.setVins(vins); |
|
|
|
// List<String> vins = scmVehicleGressionVehService.fetchVoByMainSid(sid);
|
|
|
|
// vo.setVins(vins);
|
|
|
|
List<ScmVehicleGressionVehVo> scmVehicleGressionVehVos = scmVehicleGressionVehService.selectInfoVoByMainSid(sid); |
|
|
|
vo.setScmVehicleGressionVehs(scmVehicleGressionVehVos); |
|
|
|
vo.setApplicantName(data1.getName()); |
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
String format = simpleDateFormat.format(new Date()); |
|
|
@ -517,6 +489,8 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
List<String> policyImage = new ArrayList<>(); |
|
|
|
List<String> image = new ArrayList<>(); |
|
|
|
AppScmVehicleGressionDetailsVo vo = baseMapper.getCarTransfer(sid); |
|
|
|
List<ScmVehicleGressionVehVo> scmVehicleGressionVehVos = scmVehicleGressionVehService.selectInfoVoByMainSid(sid); |
|
|
|
vo.setScmVehicleGressionVehs(scmVehicleGressionVehVos); |
|
|
|
if ("1".equals(vo.getInsuranceStateKey())) { |
|
|
|
vo.setInsuranceShow(true); |
|
|
|
} |
|
|
@ -718,15 +692,18 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
List<String> vins = dto.getVins(); |
|
|
|
for (String vin : vins) { |
|
|
|
List<String> sids = scmVehicleGressionVehService.fetchVoByVins(vin); |
|
|
|
for (String sid : sids) { |
|
|
|
List<ScmVehicleGressionVo> scmVehicleGressionVos = baseMapper.getlastTimeEqual(sid, dto.getTargetLocationSid()); |
|
|
|
if (scmVehicleGressionVos.size() > 0) { |
|
|
|
if (StringUtils.isNotBlank(scmVehicleGressionVos.get(0).getNodeState())) { |
|
|
|
if (scmVehicleGressionVos.get(0).getNodeState().contains("已办结") || !(scmVehicleGressionVos.get(0).getNodeState().contains("终止")) || !(scmVehicleGressionVos.get(0).getNodeState().contains("申请"))) { |
|
|
|
return rb.setMsg("该申请中" + vin + "已存在,请勿重复提交!"); |
|
|
|
//存放车架号
|
|
|
|
if (r == 1) { |
|
|
|
List<ScmVehicleGressionVehDto> scmVehicleGressionVehDtos = dto.getScmVehicleGressionVehs(); |
|
|
|
for (ScmVehicleGressionVehDto scmVehicleGressionVehDto : scmVehicleGressionVehDtos) { |
|
|
|
List<String> sids = scmVehicleGressionVehService.fetchVoByVins(scmVehicleGressionVehDto.getVehVin()); |
|
|
|
for (String sid : sids) { |
|
|
|
List<ScmVehicleGressionVo> scmVehicleGressionVos = baseMapper.getlastTimeEqual(sid, dto.getTargetLocationSid()); |
|
|
|
if (scmVehicleGressionVos.size() > 0) { |
|
|
|
if (StringUtils.isNotBlank(scmVehicleGressionVos.get(0).getNodeState())) { |
|
|
|
if (scmVehicleGressionVos.get(0).getNodeState().contains("已办结") || !(scmVehicleGressionVos.get(0).getNodeState().contains("终止")) || !(scmVehicleGressionVos.get(0).getNodeState().contains("申请"))) { |
|
|
|
return rb.setMsg("该申请中" + scmVehicleGressionVehDto.getVehVin() + "已存在,请勿重复提交!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -771,7 +748,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
//流程定义id
|
|
|
|
bv.setModelId(ProcDefEnum.SCMCARTRANSFER.getProDefId()); |
|
|
|
//调出方负责人
|
|
|
|
// bv.setNextNodeUserSids(dto.getPersonUserSid());
|
|
|
|
bv.setNextNodeUserSids(dto.getPersonUserSid()); |
|
|
|
if (r == 1) { |
|
|
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
@ -888,7 +865,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
messageFlowableQuery.setMsgTitle("供应链"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
|
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
//推送车辆台账数据
|
|
|
|
VehicleGression vehicleGression = new VehicleGression(); |
|
|
|
List<String> list = scmVehicleGressionVehService.fetchVoByMainSid(scmVehicleGression.getSid()); |
|
|
@ -1166,13 +1143,24 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
temporaryExitPermitInfo.setOrgName(sysOrganization.getName()); |
|
|
|
temporaryExitPermitInfo.setDate(new Date()); |
|
|
|
temporaryExitPermitInfo.setContractNo("—"); |
|
|
|
if(StringUtils.isNotBlank(scmVehicleGression.getVehicleSid())){ |
|
|
|
BaseVehicleSelectVo data = baseVehicleFeign.details(scmVehicleGression.getVehicleSid()).getData(); |
|
|
|
ExiCarConfigDetailVo exiCarConfigDetailVo = baseVehicleFeign.selectExiCarConfig(data.getModelSid(), data.getModelConfigSid(), data.getVehModelConfigSid()).getData(); |
|
|
|
temporaryExitPermitInfo.setModelName(exiCarConfigDetailVo.getVehicleAlias() + exiCarConfigDetailVo.getCarColor()); |
|
|
|
} |
|
|
|
temporaryExitPermitInfo.setNum("1"); |
|
|
|
temporaryExitPermitInfo.setVinNo(scmVehicleGression.getVinNo()); |
|
|
|
String vin = ""; |
|
|
|
String modelName = ""; |
|
|
|
List<String> list = scmVehicleGressionVehService.fetchVoByMainSid(sid); |
|
|
|
if (list.size() > 0) { |
|
|
|
for (String s : list) { |
|
|
|
vin = s + "," + vin; |
|
|
|
List<String> vinSids = scmVehicleGressionVehService.fetchVoByVinSids(s); |
|
|
|
for (String vinSid : vinSids) { |
|
|
|
BaseVehicleSelectVo data = baseVehicleFeign.details(vinSid).getData(); |
|
|
|
ExiCarConfigDetailVo exiCarConfigDetailVo = baseVehicleFeign.selectExiCarConfig(data.getModelSid(), data.getModelConfigSid(), data.getVehModelConfigSid()).getData(); |
|
|
|
String model = exiCarConfigDetailVo.getVehicleAlias() + exiCarConfigDetailVo.getCarColor(); |
|
|
|
modelName = model + "," + modelName; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
temporaryExitPermitInfo.setVinNo(vin); |
|
|
|
temporaryExitPermitInfo.setModelName(modelName); |
|
|
|
temporaryExitPermitInfo.setReason("存放地点变更"); |
|
|
|
temporaryExitPermitInfo.setCreatName(scmVehicleGression.getOperator()); |
|
|
|
temporaryExitPermitInfo.setCarryCarName("—"); |
|
|
|