From d5bb894f9be2e0a3b62d475b60b44f2ab138528c Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期四, 12 六月 2025 16:48:35 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java |   69 +++++++++++++++++++++-------------
 1 files changed, 42 insertions(+), 27 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 73eddcd..94449b7 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;
@@ -23,44 +21,42 @@
     @Autowired
     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) {
+
+    public Boolean addSchedulingSv(Map<String, Object> object) {
         String userName = "";
         if (object.get("userName") != null) {
             userName = object.get("userName").toString();
@@ -82,8 +78,7 @@
         List<ProductionScheduling> schedulinglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("scheduling")), ProductionScheduling.class);
         if (!schedulinglist.isEmpty()) {
             for (ProductionScheduling productionScheduling : schedulinglist) {
-               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());
             }
             return true;
         }
@@ -94,14 +89,21 @@
 
     }
 
-    public boolean DeleteSchedulingSv(Map<String, Object> object) throws Exception {
+    public boolean deleteSchedulingSv(Map<String, Object> object) throws Exception {
         JSONObject objJson = new JSONObject(object);
         List<ProductionScheduling> Scheduling = JSONArray.parseArray(JSONObject.toJSONString(objJson.get("scheduling")), ProductionScheduling.class);
-        productionSchedulingMapper.delete(new LambdaQueryWrapper<ProductionScheduling>().eq(ProductionScheduling::getSchedulingId, Scheduling.get(0).getId()));
-        return true;
+        if (!Scheduling.isEmpty()) {
+            for (ProductionScheduling productionScheduling : Scheduling) {
+                productionSchedulingMapper.deleteSchedulingMp(productionScheduling.getSchedulingId());
+            }
+            return true;
+        }
+        else {
+            return false;
+        }
     }
 
-    public boolean ExamineSchedulingSv(Map<String, Object> object) {
+    public boolean examineSchedulingSv(Map<String, Object> object) {
         String userName = "";
         if (object.get("userName") != null) {
             userName = object.get("userName").toString();
@@ -110,8 +112,21 @@
 
         if (!schedulinglist.isEmpty()) {
             for (ProductionScheduling productionScheduling : schedulinglist) {
-                productionSchedulingMapper.ExamineSchedulingMp(productionScheduling.getSchedulingId(),userName);
-                // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
+                productionSchedulingMapper.examineSchedulingMp(productionScheduling.getSchedulingId(),userName,productionScheduling.getSchedulingQuantity(),productionScheduling.getNotes());
+            }
+            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());
             }
             return true;
         }

--
Gitblit v1.8.0