Prechádzať zdrojové kódy

查询一个周期下的订单列表

guoyong 4 rokov pred
rodič
commit
478530ea25

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

@@ -26,12 +26,21 @@ public interface WorkOrderService extends IService<WorkOrder> {
 
 
     /**
+     * @return
      * @Author guoyong
-     * @Description 查询待执行装卸车运单
-     * @Date  2022/4/25
+     * @Description 根据一个行车周期查下的订单列表
+     * @Date 2022/4/25
      * @Param
+     **/
+    List<WorkOrder> findCycleOrderList(Long cycleId, Integer orderType,Integer status);
+
+    /**
      * @return
-    **/
+     * @Author guoyong
+     * @Description 查询待执行装卸车运单
+     * @Date 2022/4/25
+     * @Param
+     **/
     List<WorkOrder> findTodoOrderList(Long truckId, int orderType);
 
     /**
@@ -41,7 +50,7 @@ public interface WorkOrderService extends IService<WorkOrder> {
      * @Date 2022/4/24
      * @Param
      **/
-    WorkOrder findFirstTodoOrder(Long truckId,int orderType);
+    WorkOrder findFirstTodoOrder(Long truckId, int orderType);
 
     /**
      * @return
@@ -50,7 +59,7 @@ public interface WorkOrderService extends IService<WorkOrder> {
      * @Date 2022/4/24
      * @Param
      **/
-    WorkOrder findWorkingOrder(Long truckId,int orderType);
+    WorkOrder findWorkingOrder(Long truckId, int orderType);
 
     /**
      * @return

+ 14 - 0
src/main/java/com/aoyang/tms/service/impl/WorkOrderServiceImpl.java

@@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.swagger.models.auth.In;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
@@ -55,6 +56,19 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
     private WorkOrderReadinfoService workOrderReadinfoService;
 
     @Override
+    public List<WorkOrder> findCycleOrderList(Long cycleId, Integer orderType, Integer status) {
+        QueryWrapper<WorkOrder> queryWrapper = new QueryWrapper<WorkOrder>();
+        queryWrapper.eq("cycle_id", cycleId);
+        if (orderType != null) {
+            queryWrapper.eq("type", orderType);
+        }
+        if (status != null) {
+            queryWrapper.eq("order_status", status);
+        }
+        return workOrderMapper.selectList(queryWrapper);
+    }
+
+    @Override
     public List<WorkOrder> findTodoOrderList(Long truckId, int orderType) {
         QueryWrapper<WorkOrder> queryWrapper = new QueryWrapper<WorkOrder>();
         queryWrapper.eq("truck_id", truckId);