From d809ecd16cbb23f5aad86a6844f51ffea0455fe8 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期五, 06 九月 2024 16:53:55 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java |   52 +++++++++++++++++++++++++++++++---------------------
 1 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java
index 28f7922..77ddde2 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java
@@ -4,9 +4,7 @@
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DS;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.example.erp.entity.pp.ProductionScheduling;
-import com.example.erp.entity.sd.OrderDetail;
 import com.example.erp.mapper.pp.ProductionSchedulingMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -24,42 +22,39 @@
     ProductionSchedulingMapper productionSchedulingMapper;
 
     //鏈帓浜ф煡璇�
-    public Map<String, Object> selectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, ProductionScheduling productionScheduling ) {
+    public Map<String, Object> selectSchedulingSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, String orderIds, String processes, Integer state, ProductionScheduling productionScheduling ) {
+
+        Integer offset = (pageNum - 1) * pageSize;
         Map<String, Object> map = new HashMap<>();
-        if(orderId.equals("null")){
-            orderId="";
+        if("null".equals(orderIds)){
+            orderIds="";
         }
-        if (processes.equals("null")){
+        if ("null".equals(processes)){
 
             processes="";
         }
 
         if (state==2){//宸叉帓浜�
-            map.put("data", productionSchedulingMapper.selectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
+            map.put("data", productionSchedulingMapper.selectOkSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling));
+            map.put("total", productionSchedulingMapper.getOkPageTotal(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling));
 
         }else if (state==1){//鏈帓浜�
-            map.put("data", productionSchedulingMapper.selectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
+            map.put("data", productionSchedulingMapper.selectNoSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling));
+            map.put("total", productionSchedulingMapper.getPageTotal(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling));
 
         }
-
         return map;
     }
 
 
     //棣栨鏌ヨ鎺掍骇鏁版嵁
-    public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,ProductionScheduling productionScheduling ) {
+    public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,String processes,String orderId,ProductionScheduling productionScheduling ) {
         Map<String, Object> map = new HashMap<>();
-        map.put("data", productionSchedulingMapper.selectLastSchedulingMp(selectTime1, selectTime2, productionScheduling));
         map.put("process", productionSchedulingMapper.selectProcess());
         return map;
     }
 
-    //甯﹁鍗曞彿鏌ヨ
-    public Map<String, Object> selectSchedulingNotSv(String selectTime1, String selectTime2, String orderId, String processes, Integer state, ProductionScheduling productionScheduling) {
-        Map<String, Object> map = new HashMap<>();
-        map.put("data", productionSchedulingMapper.selectSchedulingNotMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
-        return map;
-    }
+
 
     public Boolean addSchedulingSv(Map<String, Object> object) {
         String userName = "";
@@ -84,10 +79,10 @@
         if (!schedulinglist.isEmpty()) {
             for (ProductionScheduling productionScheduling : schedulinglist) {
                 //鏌ヨ宸叉帓浜у伐搴忔暟閲�
-              Integer num =  productionSchedulingMapper.selectNumberMp(productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes);
+             // Integer num =  productionSchedulingMapper.selectNumberMp(productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes);
 
-               productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes());
-               // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
+             productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderGlassDetail().getOrderId(),productionScheduling.getOrderNumber(),productionScheduling.getTechnologyNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes());
+               // System.out.println(productionScheduling.getOrderId()+"***"+productionScheduling.getOrderGlassDetail().getOrderId()+"--"+productionScheduling.getOrderDetail().getOrderId());
             }
             return true;
         }
@@ -122,7 +117,22 @@
 
         if (!schedulinglist.isEmpty()) {
             for (ProductionScheduling productionScheduling : schedulinglist) {
-                productionSchedulingMapper.examineSchedulingMp(productionScheduling.getSchedulingId(),userName);
+                productionSchedulingMapper.examineSchedulingMp(productionScheduling.getSchedulingId(),userName,productionScheduling.getSchedulingQuantity(),productionScheduling.getNotes());
+                // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
+            }
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+
+    public boolean cancelReviewSchedulingSv(Map<String, Object> object) {
+        List<ProductionScheduling> schedulinglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("scheduling")), ProductionScheduling.class);
+
+        if (!schedulinglist.isEmpty()) {
+            for (ProductionScheduling productionScheduling : schedulinglist) {
+                productionSchedulingMapper.cancelReviewSchedulingMp(productionScheduling.getSchedulingId());
                 // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
             }
             return true;

--
Gitblit v1.8.0