|
|
@ -106,16 +106,16 @@ public class BaseVehicleCertificateRest implements BaseVehicleCertificateFeign { |
|
|
|
BaseVehicleCertificate entity = new BaseVehicleCertificate(); |
|
|
|
dto.fillEntity(entity); |
|
|
|
List<String> list = dto.getCertificatePhoto(); |
|
|
|
if (list.size() != 0){ |
|
|
|
if (list.size() != 0) { |
|
|
|
String certificatePhoto = ""; |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
certificatePhoto += list.get(i).replace(fileUploadComponent.getUrlPrefix(), "") + ","; |
|
|
|
} |
|
|
|
entity.setCertificatePhoto(certificatePhoto.substring(0, certificatePhoto.length()-1)); |
|
|
|
entity.setCertificatePhoto(certificatePhoto.substring(0, certificatePhoto.length() - 1)); |
|
|
|
} |
|
|
|
String certificationNo = dto.getCertificationNo(); |
|
|
|
String certificationNo = dto.getCertificationNo(); |
|
|
|
int i1 = baseVehicleCertificateService.checkByCertificationNo(certificationNo); |
|
|
|
if (i1 > 0){ |
|
|
|
if (i1 > 0) { |
|
|
|
return rb.setMsg("该合格证编码已存在"); |
|
|
|
} |
|
|
|
boolean isSave = baseVehicleCertificateService.save(entity); |
|
|
@ -153,13 +153,17 @@ public class BaseVehicleCertificateRest implements BaseVehicleCertificateFeign { |
|
|
|
return rb.fail().setMsg("附件保存失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
int i = baseVehicleCertificateService.updateBySid(dto.toMap(), sid); |
|
|
|
String vinNo = dto.getVinNo(); |
|
|
|
if (vinNo.length() == 17){ |
|
|
|
baseVehicleService.updateVinNoByVehSid(vinNo,baseVehicleCertificate.getVehicleSid()); |
|
|
|
} |
|
|
|
if (i == 0) { |
|
|
|
return rb.fail().setMsg("修改失败"); |
|
|
|
if (vinNo.length() == 17) { |
|
|
|
BaseVehicle baseVehicle = baseVehicleService.fetchBySid(baseVehicleCertificate.getVehicleSid()); |
|
|
|
String vinNo1 = baseVehicle.getVinNo(); |
|
|
|
if (!vinNo.substring(vinNo.length() - 8).equals(vinNo1)) { |
|
|
|
return rb.setMsg("该车架号后八位与车辆台账中车架号不符,无法修改"); |
|
|
|
} |
|
|
|
baseVehicleService.updateVinNoByVehSid(vinNo, baseVehicleCertificate.getVehicleSid()); |
|
|
|
baseVehicleCertificateService.updateBySid(dto.toMap(), sid); |
|
|
|
} else if (vinNo.length() == 8) { |
|
|
|
baseVehicleCertificateService.updateBySid(dto.toMap(), sid); |
|
|
|
} |
|
|
|
return rb.success().setMsg("修改成功"); |
|
|
|
} |
|
|
|