|
|
@ -264,6 +264,8 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
for (AppScmVehicleGressionPageVo record : records) { |
|
|
|
|
|
|
|
List<String> vins = scmVehicleGressionVehService.fetchVoByMainSid(record.getSid()); |
|
|
|
int size = vins.size(); |
|
|
|
record.setVinNum(String.valueOf(size)); |
|
|
|
String vin = StringUtils.join(vins, ","); |
|
|
|
record.setVin(vin); |
|
|
|
|
|
|
@ -395,28 +397,42 @@ 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); |
|
|
|
// 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(); |
|
|
|
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); |
|
|
|
} |
|
|
|
} else if ("0".equals(dto.getInsuranceStateKey())) { |
|
|
|
scmFileService.deleteByLinkSidAndType(scmVehicleGression.getSid(), type); |
|
|
|
} |
|
|
|
updateById(scmVehicleGression); |
|
|
|
|
|
|
|
} |
|
|
|
return rb.success().setData(scmVehicleGression.getSid()).setMsg("保存成功"); |
|
|
|
} |
|
|
@ -468,6 +484,12 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
List<String> policyImage = new ArrayList<>(); |
|
|
|
List<String> image = new ArrayList<>(); |
|
|
|
AppScmVehicleGressionDetailsVo vo = baseMapper.getCarTransfer(sid); |
|
|
|
if ("1".equals(vo.getInsuranceStateKey())) { |
|
|
|
vo.setInsuranceShow(true); |
|
|
|
} |
|
|
|
if ("1".equals(vo.getProCardStateKey())) { |
|
|
|
vo.setProCardShow(true); |
|
|
|
} |
|
|
|
List<String> vins = scmVehicleGressionVehService.fetchVoByMainSid(sid); |
|
|
|
String vin = StringUtils.join(vins, StringUtils.LF); |
|
|
|
vo.setVinNo(vin); |
|
|
@ -525,19 +547,32 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean saveCarTransferSiteImage(AppScmVehicleCarTransferSiteImageDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String type = "05"; |
|
|
|
String s1 = ""; |
|
|
|
scmFileService.deleteByLinkSidAndType(dto.getSid(), type); |
|
|
|
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(), type2); |
|
|
|
List<String> images = dto.getImages(); |
|
|
|
if (images.size() > 0) { |
|
|
|
for (String s : images) { |
|
|
|
if (s.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s1 = s.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
s2 = s.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
ScmFile scmFile = new ScmFile(); |
|
|
|
scmFile.setAttachType(type); |
|
|
|
scmFile.setAttachType(type2); |
|
|
|
scmFile.setFileName("车辆移库现场照片"); |
|
|
|
scmFile.setFilePath(s1); |
|
|
|
scmFile.setFilePath(s2); |
|
|
|
scmFile.setLinkSid(dto.getSid()); |
|
|
|
scmFileService.save(scmFile); |
|
|
|
} |
|
|
@ -545,6 +580,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(dto.getSid()); |
|
|
|
scmVehicleGression.setAddress(dto.getAddress()); |
|
|
|
scmVehicleGression.setLocationCode(dto.getLocationCode()); |
|
|
|
scmVehicleGression.setTemporaryCard(dto.getProCard()); |
|
|
|
updateById(scmVehicleGression); |
|
|
|
return rb.success().setMsg("保存成功"); |
|
|
|
} |
|
|
@ -770,7 +806,8 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
} |
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
VehicleGression vehicleGression = new VehicleGression(); |
|
|
|
vehicleGression.setVin(scmVehicleGression.getVinNo()); |
|
|
|
List<String> list = scmVehicleGressionVehService.fetchVoByMainSid(scmVehicleGression.getSid()); |
|
|
|
vehicleGression.setVin(list); |
|
|
|
vehicleGression.setLocation(scmVehicleGression.getTargetLocationSid()); |
|
|
|
vehicleGression.setLocationName(scmVehicleGression.getTargetLocation()); |
|
|
|
baseVehicleFeign.updateVehicleGressionByVin(vehicleGression); |
|
|
|