Commit f2c708b7 by 章家宝

fixbug:修复绑定车辆的报告错误提示

1 parent 6a67bf25
......@@ -290,13 +290,14 @@ public class InspectionReportService {
Vehicle vehicle = report.getVehicle();
List<InspectionReport> bindedReports = inspectionReportRepository.findByVehicleAndBindStatusAndDeleteFlag(vehicle, 1, DeleteFlag.NOT_DELETED.getCode());
if (!bindedReports.isEmpty()) {
bindSourceNoList.add(vehicle.getBaseInfo().getSourceNo());
String bindSourceNo = String.format("该车辆(车源号:%s)已绑定另一份报告(报告编号:%s),请先解绑后再执行此操作。", vehicle.getBaseInfo().getSourceNo(), bindedReports.get(0).getReportNo());
bindSourceNoList.add(bindSourceNo);
continue;
}
bindInspectionReport(report, vehicle, operatorId, operatorName, platType);
}
if (!bindSourceNoList.isEmpty()) {
throw new BusinessCodeException(ErrorCodeEnum.VEHICLE_ALREADY_BIND, String.join(",", bindSourceNoList));
throw new BusinessCodeException(ErrorCodeEnum.VEHICLE_ALREADY_BIND, String.join("|", bindSourceNoList));
}
}
private void bindInspectionReport(InspectionReport report, Vehicle vehicle, Long operatorId, String operatorName, Integer platType) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!