|
|
@ -26,6 +26,7 @@ |
|
|
|
package com.yxt.anrui.scm.biz.scmvehiclegression; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.copier.CopyOptions; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
@ -397,26 +398,6 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
return rb.setMsg("该数据不存在"); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, scmVehicleGression, "sid"); |
|
|
|
// 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);
|
|
|
|
// }
|
|
|
|
updateById(scmVehicleGression); |
|
|
|
scmVehicleGressionVehService.deleteByMainSid(scmVehicleGression.getSid()); |
|
|
|
List<String> vins = dto.getVins(); |
|
|
@ -493,6 +474,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
List<String> vins = scmVehicleGressionVehService.fetchVoByMainSid(sid); |
|
|
|
String vin = StringUtils.join(vins, StringUtils.LF); |
|
|
|
vo.setVinNo(vin); |
|
|
|
vo.setVins(vins); |
|
|
|
List<ScmFile> scmFiles1 = scmFileService.selectByLinkSid(sid, type1); |
|
|
|
if (scmFiles1.size() > 0) { |
|
|
|
for (ScmFile scmFile : scmFiles1) { |
|
|
@ -551,16 +533,21 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
String s2 = ""; |
|
|
|
String type1 = "04"; |
|
|
|
String type2 = "05"; |
|
|
|
if (StringUtils.isNotBlank(dto.getPolicyImages())) { |
|
|
|
scmFileService.deleteByLinkSidAndType(dto.getSid(), type1); |
|
|
|
String policyImages = dto.getPolicyImages(); |
|
|
|
s1 = policyImages.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
ScmFile scmFile = new ScmFile(); |
|
|
|
scmFile.setAttachType(type1); |
|
|
|
scmFile.setFileName("保单照片"); |
|
|
|
scmFile.setFilePath(s1); |
|
|
|
scmFile.setLinkSid(dto.getSid()); |
|
|
|
scmFileService.save(scmFile); |
|
|
|
|
|
|
|
scmFileService.deleteByLinkSidAndType(dto.getSid(), type1); |
|
|
|
List<String> policyImages = dto.getPolicyImages(); |
|
|
|
if (policyImages.size() > 0) { |
|
|
|
for (String policyImage : policyImages) { |
|
|
|
if (policyImage.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s1 = policyImage.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
ScmFile scmFile = new ScmFile(); |
|
|
|
scmFile.setAttachType(type1); |
|
|
|
scmFile.setFileName("保单照片"); |
|
|
|
scmFile.setFilePath(s1); |
|
|
|
scmFile.setLinkSid(dto.getSid()); |
|
|
|
scmFileService.save(scmFile); |
|
|
|
} |
|
|
|
} |
|
|
|
scmFileService.deleteByLinkSidAndType(dto.getSid(), type2); |
|
|
|
List<String> images = dto.getImages(); |
|
|
@ -679,11 +666,17 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
List<ScmVehicleGressionVo> scmVehicleGressionVos = baseMapper.getlastTimeEqual(dto.getVinNo(), 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("该申请已存在,请勿重复提交!"); |
|
|
|
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 + "已存在,请勿重复提交!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|