Browse Source

运力详情

guoyong 4 năm trước cách đây
mục cha
commit
2b272df188

+ 3 - 3
src/main/java/com/aoyang/tms/service/WorkOrderService.java

@@ -41,7 +41,7 @@ public interface WorkOrderService extends IService<WorkOrder> {
      * @Date 2022/4/25
      * @Param
      **/
-    List<WorkOrder> findTodoOrderList(Long truckId, int orderType);
+    List<WorkOrder> findTodoOrderList(Long truckId, Integer orderType);
 
     /**
      * @return
@@ -50,7 +50,7 @@ public interface WorkOrderService extends IService<WorkOrder> {
      * @Date 2022/4/24
      * @Param
      **/
-    WorkOrder findFirstTodoOrder(Long truckId, int orderType);
+    WorkOrder findFirstTodoOrder(Long truckId, Integer orderType);
 
     /**
      * @return
@@ -59,7 +59,7 @@ public interface WorkOrderService extends IService<WorkOrder> {
      * @Date 2022/4/24
      * @Param
      **/
-    WorkOrder findWorkingOrder(Long truckId, int orderType);
+    WorkOrder findWorkingOrder(Long truckId, Integer orderType);
 
     /**
      * @return

+ 7 - 1
src/main/java/com/aoyang/tms/service/impl/CommonServiceImpl.java

@@ -144,11 +144,17 @@ public class CommonServiceImpl implements CommonService {
             workerInfo.setEscortPhone(truckEscort.getMobile());
         }
 
+        //查询正在执行的运单
+        WorkOrder workOrder = workOrderService.findWorkingOrder(truckId, null);
+        if (workOrder != null) {
+            workerInfo.setOrderId(workOrder.getId());
+        }
+
         //查询当前行车周期
         WorkCycle workCycle = workCycleService.findCurrentWorkCycle(truckId);
         if (workCycle != null) {
             workerInfo.setCycleId(workCycle.getId());
-            //完成订单列表
+            //完成订单列表
             List<WorkOrder> list =
                     workOrderService.findCycleOrderList(workCycle.getId(), 1, WorkOrderEnum.COMPLETED.orderStatus());
             if (list != null && list.size() > 0) {

+ 6 - 4
src/main/java/com/aoyang/tms/service/impl/WorkOrderServiceImpl.java

@@ -69,7 +69,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
     }
 
     @Override
-    public List<WorkOrder> findTodoOrderList(Long truckId, int orderType) {
+    public List<WorkOrder> findTodoOrderList(Long truckId, Integer orderType) {
         QueryWrapper<WorkOrder> queryWrapper = new QueryWrapper<WorkOrder>();
         queryWrapper.eq("truck_id", truckId);
         queryWrapper.eq("type", orderType);
@@ -80,7 +80,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
     }
 
     @Override
-    public WorkOrder findFirstTodoOrder(Long truckId, int orderType) {
+    public WorkOrder findFirstTodoOrder(Long truckId, Integer orderType) {
         QueryWrapper<WorkOrder> queryWrapper = new QueryWrapper<WorkOrder>();
         queryWrapper.eq("truck_id", truckId);
         queryWrapper.eq("type", orderType);
@@ -92,10 +92,12 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
     }
 
     @Override
-    public WorkOrder findWorkingOrder(Long truckId, int orderType) {
+    public WorkOrder findWorkingOrder(Long truckId, Integer orderType) {
         QueryWrapper<WorkOrder> queryWrapper = new QueryWrapper<WorkOrder>();
         queryWrapper.eq("truck_id", truckId);
-        queryWrapper.eq("type", orderType);
+        if (orderType != null) {
+            queryWrapper.eq("type", orderType);
+        }
         List<Integer> statusList = new ArrayList<>();
         statusList.add(WorkOrderEnum.GOTO_ZHUANGCHE_SPOT.orderStatus());
         statusList.add(WorkOrderEnum.GOTO_XIECHE_SPOT.orderStatus());