Sfoglia il codice sorgente

添加押运员、编辑押运员

guoyong 4 anni fa
parent
commit
be8635e36a

+ 6 - 6
src/main/java/com/aoyang/tms/controller/TruckEscortController.java

@@ -127,13 +127,13 @@ public class TruckEscortController {
         param.setUpdateDate(LocalDateTime.now());
 
         if (param.getTruckId() != null) {
-            TruckEscortListParam truckEscortListParam = new TruckEscortListParam();
-            truckEscortListParam.setTruckId(param.getTruckId());
-            log.info("添加车辆押运员,调用/tms/truck_escort/update,truckEscortListParam参数:{}", JSON.toJSONString(truckEscortListParam));
-            List<TruckEscort> list = truckEscortService.list(truckEscortListParam);
-            log.info("添加车辆押运员,调用/tms/truck_escort/update,结果list:{}", JSON.toJSONString(list));
+            TruckEscort truckEscortParam = new TruckEscort();
+            truckEscortParam.setTruckId(param.getTruckId());
+            log.info("添加车辆押运员,调用/tms/truck_escort/update,truckEscortParam:{}", JSON.toJSONString(truckEscortParam));
+            TruckEscort truckEscort = truckEscortService.findTruckEscort(truckEscortParam);
+            log.info("添加车辆押运员,调用/tms/truck_escort/update,结果truckEscort:{}", JSON.toJSONString(truckEscort));
 
-            if (list != null && list.size() > 0) {
+            if (!truckEscort.getEscortId().equals(param.getEscortId())) {
                 return new Result<>(ErrCodeEnum.ONLY_ONE_ESCORT.getCode(), ErrCodeEnum.ONLY_ONE_ESCORT.getMessage());
 
             }