From f60327c377097f67ed42c349bda2a54c3147b7be Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期四, 07 三月 2024 16:35:45 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/target/classes/mapper/pp/WordOrder.xml                                          |   12 
 north-glass-erp/target/classes/mapper/pp/FolwCard.xml                                           |   61 ++
 north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml                                 |    6 
 north-glass-erp/target/classes/mapper/pp/ReportingWork.xml                                      |  130 ++++++-
 north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java                     |   37 +
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml                                       |   61 ++
 north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue                |   44 ++
 north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderProcessDetail.java                 |    1 
 north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml                                      |   12 
 north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java         |    9 
 north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue                 |   18 
 north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml                             |    6 
 north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java                      |   18 
 north-glass-erp/northglass-erp/src/views/pp/processCard/ProcessCard.vue                         |    6 
 north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkDetailMapper.java          |    1 
 north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue                      |   57 +-
 north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml                               |   22 
 north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java                   |    5 
 north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java          |   40 +
 north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java              |   53 ++
 north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java                    |   12 
 north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java |   23 +
 north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java       |   39 ++
 north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java                  |   26 
 north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml                           |   22 
 north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java                |    6 
 north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue                   |   38 +
 north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java            |   12 
 north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml                                  |  130 ++++++-
 north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java                   |   84 +++-
 30 files changed, 724 insertions(+), 267 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
index 0317b1d..f2b006e 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -167,12 +167,12 @@
     {type: 'checkbox', fixed: "left", title: '閫夋嫨'},
     {field: 'orderNumber', title: '璁㈠簭', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
     {field: 'shape', title: '褰㈢姸', showOverflow: "ellipsis", filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
-    {field: 'width', title: '瀹�', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
-    {field: 'height', title: '楂�', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
-    {field: 'baiscQuantity', title: '寰呭垎鏁伴噺', showOverflow: "ellipsis"},
-    {field: 'computeGrossArea', title: '寰呭垎闈㈢Н'},
-    {field: 'totalThickness', title: '鎬诲帤搴�'},
-    {field: 'thickness', title: '鐜荤拑鍘氬害'},
+    {field: 'width', title: '瀹�', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged,width:'60px'},
+    {field: 'height', title: '楂�', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged,width:'60px'},
+    {field: 'baiscQuantity', title: '寰呭垎鏁伴噺', showOverflow: "ellipsis",width:'60px'},
+    {field: 'computeGrossArea', title: '寰呭垎闈㈢Н',width:'60px'},
+    {field: 'totalThickness', title: '鎬诲帤搴�',width:'80px'},
+    {field: 'thickness', title: '鐜荤拑鍘氬害',width:'60px'},
     {field: 'weight', title: '閲嶉噺'}
   ],//琛ㄥご鎸夐挳
 
@@ -247,7 +247,7 @@
       slots: {filter: 'num1_filter'}
       ,filterMethod:filterChanged
     },
-    {field: 'landingSequence', title: '钀芥灦椤哄簭', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
+    {field: 'landingSequence', title: '灏忕墖椤哄簭', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
     {field: 'shape', title: '褰㈢姸', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged},
     {field: 'width', title: '瀹�', showOverflow: "ellipsis"},
     {field: 'height', title: '楂�'},
@@ -475,12 +475,11 @@
               if (res.code == 200) {
                 ElMessage.success("淇濆瓨鎴愬姛")
                 //router.push('/main/processCard/SplittingDetails?orderId=${orderId}')
-                router.push({path: '/main/processCard/SplittingDetails', query: {orderId: orderId}})
+                  router.push({path: '/main/processCard/AddProcessCard', query: {orderId: orderId,productionId:productionId,random:Math.random()}})
 
                 //location.reload();
               } else {
                 ElMessage.warning(res.msg)
-                router.push("/login")
               }
             })
 
@@ -497,10 +496,10 @@
 </script>
 
 <template>
-  <div>
+  <div style="width: 100%;height: 100%">
 
-    <div class="common-layout" style="height: 100%">
-      <div class="header">
+    <div class="common-layout" style="width: 100%;height: 100%">
+      <div class="header" style="height: 5%;width: 100%">
 
         <el-button
             style="float: left"
@@ -517,8 +516,8 @@
 
         </div>
       </div>
-      <el-container height="600px">
-        <el-aside width="44%" >
+      <el-container style="height: 100%;width: 100%">
+        <el-aside style="width: 44%;height: 100%" >
           <vxe-grid
               max-height="100%"
               class="mytable-scrollbar"
@@ -560,22 +559,27 @@
 
         </el-aside>
 
-        <el-main width="12%" style="">
-          <span>閫変腑鏁伴噺:<el-input type="number" v-model="checkedNum"></el-input></span><br>
-          <el-button type="primary" @click="addRight"> 鈫�</el-button>
-          <br>
-          <br>
-          <el-button type="primary" @click="addLeft"> 鈫�</el-button>
-          <br>
-          <br>
-          <el-button @click="createProcessCard" type="primary">寤虹珛娴佺▼鍗�</el-button>
-        </el-main>
+        <div width="12%">
+          <el-main  style="">
+            <span>閫変腑鏁伴噺:<el-input type="number" v-model="checkedNum"></el-input></span><br>
+            <el-button type="primary" @click="addRight"> 鈫�</el-button>
+            <br>
+            <br>
+            <el-button type="primary" @click="addLeft"> 鈫�</el-button>
+            <br>
+            <br>
+            <el-button @click="createProcessCard" type="primary">寤虹珛娴佺▼鍗�</el-button>
+          </el-main>
+        </div>
+
 
 <!--        鍙充晶-->
-        <el-aside width="45%" height="500px" style="">
+        <div style="height: 100%;width: 100%">
+
+        <el-aside style="width: 100%;height: 100%">
           <vxe-grid
 
-              max-height="97%"
+              max-height="100%"
               class="mytable-scrollbar"
               ref="xGrid"
               v-bind="gridOptions"
@@ -605,6 +609,7 @@
             </template>
           </vxe-grid>
         </el-aside>
+        </div>
       </el-container>
     </div>
   </div>
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProcessCard.vue
index 08c3379..a52acb8 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProcessCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProcessCard.vue
@@ -4,10 +4,10 @@
 import request from "@/utils/request";
 import deepClone from "@/utils/deepClone";
 import {ElMessage} from "element-plus";
-import {useRouter} from "vue-router";
+import {useRouter,useRoute,onBeforeRouteUpdate} from "vue-router";
 import  GlassType from '@/components/basic/product/GlassType.vue'
 
-
+const route = useRoute()
 const router = useRouter()
 let indexFlag=$ref(1)
 function changeRouter(index){
@@ -27,7 +27,7 @@
     </div>
 
     <div id="main-body">
-      <router-view  />
+      <router-view :key="route.fullPath"  />
     </div>
   </div>
 </template>
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
index c1ab4c8..bdc6117 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -149,6 +149,8 @@
 
 //鐐瑰嚮鏃舵煡璇�
 const getWorkOrder = () => {
+  let startTime = form.date1[0]
+  let endTime = form.date1[1]
   let selectProcesses = value.value
   let selectState = stateValue.value
   let inputVal = form.orderId
@@ -169,13 +171,15 @@
         //绂佺敤鍒犻櫎銆佷繚瀛樻寜閽�
         gridOptions.toolbarConfig.buttons[0].disabled = true
         gridOptions.toolbarConfig.buttons[1].disabled = true
+        //鍚敤淇濆瓨
+        gridOptions.toolbarConfig.buttons[2].disabled = false
       } else {
         ElMessage.warning(res.msg)
       }
     })
   } else if (inputVal != null && selectState == 1) {
 
-    //鏍规嵁璁㈠崟鍙锋煡璇㈡湭鎺掍骇鏁版嵁
+    //鏍规嵁宸ュ簭鏌ヨ鏈帓浜ф暟鎹�
     request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
       if (res.code == 200) {
         pageTotal.value = res.data.total
@@ -184,12 +188,15 @@
         //绂佺敤鍒犻櫎銆佷繚瀛樻寜閽�
         gridOptions.toolbarConfig.buttons[0].disabled = true
         gridOptions.toolbarConfig.buttons[1].disabled = true
+        //鍚敤淇濆瓨
+        gridOptions.toolbarConfig.buttons[2].disabled = false
       } else {
         ElMessage.warning(res.msg)
       }
     })
   } else if (inputVal == null && selectState == 2) {
     //鏍规嵁鏃堕棿鏌ヨ宸叉帓浜ф暟鎹�
+    console.log(startTime, endTime, selectProcesses, selectState)
     request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
       if (res.code == 200) {
         pageTotal.value = res.data.total
@@ -395,10 +402,13 @@
             }
             const type = await VXETable.modal.confirm('鎮ㄧ‘瀹氳鍒犻櫎璇ユ暟鎹�?')
             if (type === 'confirm') {
-              //淇濆瓨鎺掍骇鏁版嵁
-              request.post("/productionScheduling/deleteScheduling").then((res) => {
+              let schedulingData = ref({
+                scheduling: selectRecords,
+              })
+
+              request.post("/productionScheduling/deleteScheduling",schedulingData.value).then((res) => {
                 if (res.code == 200) {
-                  ElMessage.success("淇濆瓨鎴愬姛")
+                  ElMessage.success("鍒犻櫎鎴愬姛")
                   location.reload();
                 } else {
                   ElMessage.warning(res.msg)
@@ -407,9 +417,33 @@
               })
             }
           }
-
+          return;
         }
+        case 'review': {
+          const $table = xGrid.value
+          const selectRecords = $table.getCheckboxRecords()
+          if ($table) {
+            if (selectRecords.length == 0) {
+              ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
+              return;
+            }
+            let schedulingData = ref({
+              scheduling: selectRecords,
+              userName: username//瀹℃牳浜�
+            })
+            request.post("/productionScheduling/examineScheduling",schedulingData.value).then((res) => {
+              if (res.code == 200) {
+                ElMessage.success("瀹℃牳鎴愬姛")
+                location.reload();
+              } else {
+                ElMessage.warning(res.msg)
 
+              }
+            })
+
+          }
+          return;
+        }
       }
     }
   },
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
index 908da1b..e480707 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -119,12 +119,18 @@
 form.date1=getNowTime()
 let startTime = form.date1[0]
 let endTime = form.date1[1]
-
+let total = reactive({
+  pageTotal : 0,
+  dataTotal : 0,
+  pageSize : 100
+})
 //绗竴娆″姞杞芥暟鎹�
 
-request.post(`/processCard/flowCard/${startTime}/${endTime}`, filterData.value).then((res) => {
+request.post(`/processCard/flowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => {
 
   if (res.code == 200) {
+    total.dataTotal = res.data.total.total*1
+    total.pageTotal= res.data.total.pageTotal
     pageTotal.value = res.data.total
     produceList = produceList.value.concat(deepClone(res.data.data))
     xGrid.value.reloadData(produceList)
@@ -149,6 +155,13 @@
       ElMessage.warning(res.msg)
     }
   })
+}
+
+//椤佃剼璺宠浆
+const handlePageChange = ({ currentPage, pageSize }) => {
+  pageNum.value=currentPage
+  total.pageTotal    = pageSize
+  selectOrderList()
 }
 
 /*浣跨敤绛涢�夛紝鍚庣鑾峰彇鏁版嵁*/
@@ -255,15 +268,14 @@
   ],//table body瀹為檯鏁版嵁
   //鑴氶儴姹傚拰
   footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
-    let footList=['鎬绘暟閲�','鎬婚潰绉�','鍒嗙鏁�']
     return[
       columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
           return '鍚堣:'
         }
-        if (footList.includes(column.field)) {
-          return sumNum(data, column.field)
-        }
+        // if (props.tableProp.footList.includes(column.field)) {
+        //   return sumNum(data, column.field)
+        // }
         return ''
       })
     ]
@@ -333,7 +345,19 @@
           </div>
         </div>
       </template>
-
+      <template #pager>
+        <!--浣跨敤 pager 鎻掓Ы-->
+        <!--        'PrevJump','NextJump', -->
+        <vxe-pager
+            @page-change="handlePageChange"
+            :layouts="[  'PrevPage', 'Jump','PageCount', 'NextPage',  'Total']"
+            v-model:current-page="pageNum"
+            v-model:page-size="total.pageSize"
+            v-model:pager-count="total.pageTotal"
+            :total="total.dataTotal"
+        >
+        </vxe-pager>
+      </template>
 
     </vxe-grid>
   </div>
diff --git a/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue b/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
index ee7099a..f4fbfe0 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -16,7 +16,7 @@
 //瀹氫箟琛ㄥご鏁版嵁
 const titleUploadData = ref({
   //娴佺▼鍗″彿
-  processId: 'NG24030501A01/2',
+  processId: 'NG24030701B01/1',
   //閿�鍞崟鍙�
   orderId: '',
   //鐢熶骇鍗曞彿
@@ -229,11 +229,10 @@
           const regex = /^[0-9]\d*$/
           const brokenNum =
               (row.breakageQuantity === undefined || row.breakageQuantity===null) ? 0 : row.breakageQuantity
-
           if (row.completedQuantity && !regex.test(row.completedQuantity)) {
-            return new Error('璇疯緭鍏ユ暣鏁帮紝骞朵笖澶т簬-1')
-          }else if(row.completedQuantity+brokenNum>row.quantity){
-            return new Error((`${row.completedQuantity}+$(brokenNum)>${row.quantity}`))
+            return new Error('璇疯緭鍏ユ暣鏁帮紝骞朵笖澶т簬绛変簬0')
+          }else if((row.completedQuantity*1+brokenNum*1)>row.quantity*1){
+            return new Error((`${row.completedQuantity}+${brokenNum}>${row.quantity}`))
           }
 
         }
@@ -524,12 +523,12 @@
   titleUploadData.value.creator = user.user.userName
   titleUploadData.value.creatorId = user.user.userId
   const requestDetailData = xGrid.value.getTableData().fullData.filter((row) => {
-    const a = (row.completedQuantity !== undefined && row.completedQuantity !== null && row.completedQuantity !== '')
-    const b = (row.breakageQuantity !== undefined && row.breakageQuantity !== null && row.breakageQuantity !== '')
+    const a = (row.completedQuantity !== undefined && row.completedQuantity !== null && row.completedQuantity !== '' && row.completedQuantity*1!==0)
+    const b = (row.breakageQuantity !== undefined && row.breakageQuantity !== null && row.breakageQuantity !== '' && row.breakageQuantity*1!==0)
     return (a || b)
   })
   if(requestDetailData.length === 0){
-    ElMessage.warning('璇峰~鍐欒嚦灏戜竴鏉℃崯鑰楁暟鍜屽畬宸ユ暟')
+    ElMessage.warning('璇峰~鍐欒嚦灏戜竴鏉℃崯鑰楁暟鍜屽畬宸ユ暟澶т簬0')
     return false
   }
 
@@ -537,11 +536,12 @@
     title:titleUploadData.value,
     detail:xGrid.value.getTableData().fullData
   }
-  console.log(xGrid.value.getTableData().fullData)
   request.post(`/reportingWork/saveReportingWork`,requestData).then(res =>{
     if (res.code == 200){
       ElMessage.success("鎶ュ伐鎴愬姛")
       router.push({path:'/main/reportingWorks/AddReportingWork',query:{random:Math.random()}})
+    }else{
+      ElMessage.error(res.msg)
     }
   }).catch(err =>{
     ElMessage.error(err.message)
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
index d3f27fd..cd4b6dd 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -8,6 +8,8 @@
 import com.example.erp.entity.sd.OrderGlassDetail;
 import com.example.erp.exception.ServiceException;
 import com.example.erp.service.pp.FlowCardService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -15,24 +17,29 @@
 import java.util.Map;
 
 @RestController
+@Api(value="娴佺▼鍗ontroller",tags={"娴佺▼鍗℃搷浣滄帴鍙�"})
 @RequestMapping("/processCard")
 public class ProcessCardController {
     @Autowired
     FlowCardService flowCardService;
 
     //娴佺▼鍗$鐞嗘煡璇�
-    @PostMapping  ("/flowCard/{selectTime1}/{selectTime2}")
-    public Result DateProcess(
+    @ApiOperation("娴佺▼鍗$鐞嗘煡璇㈡帴鍙�")
+    @PostMapping  ("/flowCard/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}")
+    public Result dateProcess(
+            @PathVariable Integer pageNum,
+            @PathVariable Integer pageSize,
             @PathVariable Date selectTime1,
             @PathVariable Date selectTime2,
             @RequestBody FlowCard  flowCard){
-        return Result.seccess(flowCardService.selectProcessCard(selectTime1,selectTime2,flowCard));
+        return Result.seccess(flowCardService.selectProcessCard(pageNum,pageSize,selectTime1,selectTime2,flowCard));
         
     }
 
     //鍒嗘灦鏌ヨ
+    @ApiOperation("鍒嗘灦鏌ヨ鎺ュ彛")
     @PostMapping  ("/selectAddProcess/{selectTime1}/{selectTime2}")
-    public Result SelectAddProcess(
+    public Result selectAddProcess(
             @PathVariable Date selectTime1,
             @PathVariable Date selectTime2,
             @RequestBody FlowCard  flowCard){
@@ -41,23 +48,25 @@
     }
 
     //鍒嗘灦鏄庣粏鏌ヨ
+    @ApiOperation("鍒嗘灦鏄庣粏鏌ヨ鎺ュ彛")
     @PostMapping  ("/detailsSelect/{orderId}")
 
-    public Result DetailsSelect(
+    public Result detailsSelect(
             @PathVariable String orderId,
             @RequestBody FlowCard flowCard){
-        return Result.seccess(flowCardService.DetailsSelectSv(orderId,flowCard));
+        return Result.seccess(flowCardService.detailsSelectSv(orderId,flowCard));
 
     }
 
 
     //鍒犻櫎宸ュ崟
+    @ApiOperation("鍒犻櫎宸ュ崟鎺ュ彛")
     @PostMapping("/deleteFlowCard/{orderId}/{processId}")
     public Result deleteOrderWork(
             @PathVariable String orderId,
             @PathVariable String processId
     ){
-        if(flowCardService.DeleteFlowCardSv(orderId,processId)){
+        if(flowCardService.deleteFlowCardSv(orderId,processId)){
             return Result.seccess();
         }else {
             throw new ServiceException(Constants.Code_500,"鍒犻櫎澶辫触");
@@ -66,11 +75,12 @@
     }
 
     //淇敼鎺掔増鐘舵��
+    @ApiOperation("淇敼鎺掔増鐘舵�佹帴鍙�")
     @PostMapping("/updateLayoutStatus/{processId}")
     public Result updateLayoutStatus(
             @PathVariable String processId
     ){
-        if(flowCardService.UpdateLayoutStatusSv(processId)){
+        if(flowCardService.updateLayoutStatusSv(processId)){
             return Result.seccess();
         }else {
             throw new ServiceException(Constants.Code_500,"淇敼澶辫触");
@@ -79,19 +89,21 @@
     }
 
     //鍒嗘灦鏂板鏄庣粏鏌ヨ
+    @ApiOperation("鍒嗘灦鏄庣粏鏂板鎺ュ彛")
     @PostMapping  ("/selectNoCard/{orderId}/{productionId}")
     public Result SelectNoCard(
             @PathVariable String orderId,
             @PathVariable String productionId,
             @RequestBody FlowCard flowCard){
-        return Result.seccess(flowCardService.SelectNoCardSv(orderId,productionId,flowCard));
+        return Result.seccess(flowCardService.selectNoCardSv(orderId,productionId,flowCard));
 
     }
 
     //娣诲姞娴佺▼鍗�
+    @ApiOperation("娴佺▼鍗″垱寤烘帴鍙�")
     @PostMapping("/addFlowCard")
     public Result AddOrderWork( @RequestBody Map<String,Object> object){
-        if(flowCardService.AddFlowCardSv(object)){
+        if(flowCardService.addFlowCardSv(object)){
             return Result.seccess();
         }else {
             throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触");
@@ -99,7 +111,8 @@
         }
     }
 
-    //鏌ヨ绗竴娆℃帓鐗堟暟鎹�
+    //鏌ヨ绗竴娆℃帓浜ф暟鎹�
+    @ApiOperation("鎺掍骇鐣岄潰鍔犺浇鏌ヨ鎺ュ彛")
     @PostMapping  ("/selectLastScheduling/{selectTime1}/{selectTime2}")
     public Result selectLastScheduling(
             @PathVariable String selectTime1,
@@ -108,7 +121,8 @@
         return Result.seccess(flowCardService.selectLastScheduling(selectTime1,selectTime2,flowCard));
 
     }
-    //鏌ヨ鎺掔増鏁版嵁
+    //鏌ヨ鎺掍骇鏁版嵁
+    @ApiOperation("鎺掍骇鐐瑰嚮鎸夐挳鏌ヨ鎺ュ彛")
     @PostMapping  ("/selectScheduling/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}")
     public Result selectScheduling(
             @PathVariable String selectTime1,
@@ -117,7 +131,7 @@
             @PathVariable String processes,
             @PathVariable Integer state,
             @RequestBody FlowCard flowCard){
-        return Result.seccess(flowCardService.SelectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,flowCard));
+        return Result.seccess(flowCardService.selectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,flowCard));
 
     }
 
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java
index 97f42d3..787be26 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java
@@ -41,14 +41,14 @@
 
     //鐐瑰嚮鏌ヨ鎺掔増鏁版嵁锛堝甫璁㈠崟鍙锋煡璇級
     @PostMapping  ("/selectSchedulingNot/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}")
-    public Result SelectSchedulingNot(
+    public Result selectSchedulingNot(
             @PathVariable String selectTime1,
             @PathVariable String selectTime2,
             @PathVariable String orderId,
             @PathVariable String processes,
             @PathVariable Integer state,
             @RequestBody ProductionScheduling productionScheduling){
-        return Result.seccess(productionSchedulingService.SelectSchedulingNotSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling));
+        return Result.seccess(productionSchedulingService.selectSchedulingNotSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling));
 
     }
 
@@ -64,14 +64,25 @@
         }
     }
 
-    //娣诲姞鎺掍骇鏁版嵁
+    //鍒犻櫎鎺掍骇鏁版嵁
     @PostMapping("/deleteScheduling")
-    public Result DeleteScheduling( @RequestBody Map<String,Object>  object){
+    public Result deleteScheduling( @RequestBody Map<String,Object>  object) throws Exception{
 
-        if(productionSchedulingService.AddSchedulingSv(object)){
+        if(productionSchedulingService.deleteSchedulingSv(object)){
             return Result.seccess();
         }else {
-            throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触");
+            throw new ServiceException(Constants.Code_500,"鍒犻櫎澶辫触");
+
+        }
+    }
+
+    @PostMapping("/examineScheduling")
+    public Result ExamineScheduling( @RequestBody Map<String,Object>  object){
+
+        if(productionSchedulingService.ExamineSchedulingSv(object)){
+            return Result.seccess();
+        }else {
+            throw new ServiceException(Constants.Code_500,"瀹℃牳澶辫触");
 
         }
     }
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java
index 1c9e1ca..f3c2a1b 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java
@@ -20,7 +20,7 @@
 
     //鏌ヨ宸ュ崟
     @PostMapping  ("/orderGlassDetail/{selectTime1}/{selectTime2}/{state}")
-    public Result DateWork(
+    public Result dateWork(
             @PathVariable Date selectTime1,
             @PathVariable Date selectTime2,
             @PathVariable Integer state,
@@ -31,19 +31,19 @@
     //杞敓浜ц鍗曟煡璇�
     @PostMapping  ("/addWork/{orderId}")
 
-    public Result AddWork(
+    public Result addWork(
             @PathVariable String orderId,
             @RequestBody OrderDetail orderDetail){
-        return Result.seccess(workOrderService.AddDateWork(orderId,orderDetail));
+        return Result.seccess(workOrderService.addDateWork(orderId,orderDetail));
 
     }
 
 
     //娣诲姞宸ュ崟
     @PostMapping("/addOrderWork")
-    public Result AddOrderWork( @RequestBody Map<String,Object>  object){
+    public Result addOrderWork( @RequestBody Map<String,Object>  object){
 
-        if(workOrderService.AddOrderWorkSv(object)){
+        if(workOrderService.addOrderWorkSv(object)){
             return Result.seccess();
         }else {
             throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触");
@@ -57,7 +57,7 @@
             @PathVariable String orderId,
             @PathVariable String productName
     ){
-        if(workOrderService.DeleteOrderWorkSv(orderId,productName)){
+        if(workOrderService.deleteOrderWorkSv(orderId,productName)){
             return Result.seccess();
         }else {
             throw new ServiceException(Constants.Code_500,"鍒犻櫎澶辫触");
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java
index e2f059f..6c36b81 100644
--- a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java
@@ -3,11 +3,13 @@
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 import java.time.LocalDate;
 
 @Data
+@TableName("sd.order_glass_detail")
 public class OrderGlassDetail {
     @TableId(type = IdType.AUTO)
 
@@ -30,10 +32,11 @@
     private Integer group;
     private LocalDate productionTime;
     private LocalDate createTime;
-//    @TableField(select = false)
+   @TableField(select = false,exist = false)
     private  Order order;
     //@TableField(select = false)
 //   @ManyToOne(fetch = FetchType.LAZY)
+    @TableField(select = false,exist = false)
     private  OrderDetail orderDetail;
 
 
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderProcessDetail.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderProcessDetail.java
index 1ac96a6..f048918 100644
--- a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderProcessDetail.java
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderProcessDetail.java
@@ -12,6 +12,7 @@
 
     private Long id;
     private String orderId;
+    private String processId;
     private String orderNumber;
     private Integer technologyNumber;
     private String process;
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
index 209b033..e6fe65c 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -13,45 +13,50 @@
 @Mapper
 public interface FlowCardMapper {
     //娴佺▼鍗$鐞嗘煡璇�
-    List<FlowCard> selectFlowCard(Date selectTime1, Date selectTime2,FlowCard flowCard);
+    List<FlowCard> selectFlowCard(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, FlowCard flowCard);
+
+    //鍒嗛〉鏌ヨ
+    Map<String, Integer> getPageTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, FlowCard flowCard);
 
     //鍒嗘灦鏁版嵁鏌ヨ
     List<FlowCard> selectFlowCardMp(Date selectTime1, Date selectTime2, FlowCard flowCard);
 
     //鍒嗘灦鏄庣粏鏌ヨ
-    List<FlowCard> DetailsSelectMp(String orderId, FlowCard flowCard);
+    List<FlowCard> detailsSelectMp(String orderId, FlowCard flowCard);
 
     //鍒犻櫎娴佺▼鍗�
-    Boolean DeleteFlowCardMp(String orderId, String processId);
+    Boolean deleteFlowCardMp(String orderId, String processId);
 
     //鍒嗘灦鏂板鏄庣粏鏌ヨ
-    List<Map<String,String>> SelectNoCardMp(String orderId, String productionId, FlowCard flowCard);
+    List<Map<String, String>> selectNoCardMp(String orderId, String productionId, FlowCard flowCard);
 
     //淇敼鎺掔増鐘舵��
-    Boolean UpdateLayoutStatusMp(String processId);
+    Boolean updateLayoutStatusMp(String processId);
 
-    Integer SelectLayoutStatus(String processId);
+    Integer selectLayoutStatus(String processId);
 
     //鏌ヨ鎶ュ伐琛ㄥ唴鏄惁瀛樺湪瀵瑰簲娴佺▼鍗$殑鏁版嵁
-    Integer ReportingWorkCount(String processId);
+    Integer reportingWorkCount(String processId);
 
     //鎻掑叆Flow_card琛�
-    Boolean AddFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName,Integer layer);
+    Boolean addFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName, Integer layer);
 
-    Boolean UpdateFlowState(String productionId, Integer orderNumber);
+    Boolean updateFlowState(String productionId, Integer orderNumber);
 
-    Integer SelectFlowCount(String productionId);
+    Integer selectFlowCount(String productionId);
 
 
-    Boolean UpdateProcessingCard(String productionId, int state);
+    Boolean updateProcessingCard(String productionId, int state);
 
-    Boolean UpdateDeleteState(String orderId, String processId);
+    Boolean updateDeleteState(String orderId, String processId);
 
-    List<FlowCard> SelectOkSchedulingMp(String selectTime1, String selectTime2, String orderId,String processes, FlowCard flowCard);
+    List<FlowCard> selectOkSchedulingMp(String selectTime1, String selectTime2, String orderId, String processes, FlowCard flowCard);
 
-    List<FlowCard> SelectNoSchedulingMp(String selectTime1, String selectTime2, String orderId,String processes, FlowCard flowCard);
+    List<FlowCard> selectNoSchedulingMp(String selectTime1, String selectTime2, String orderId, String processes, FlowCard flowCard);
 
-    List<Map<String,String>> selectLastSchedulingMp(String selectTime1, String selectTime2, FlowCard flowCard);
+    List<Map<String, String>> selectLastSchedulingMp(String selectTime1, String selectTime2, FlowCard flowCard);
 
-    Integer SelectLayer(String productionId, Integer orderNumber);
+    Integer selectLayer(String productionId, Integer orderNumber);
+
+
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java
index f5e0531..7d79bbf 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ProductionSchedulingMapper.java
@@ -1,5 +1,6 @@
 package com.example.erp.mapper.pp;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.example.erp.entity.pp.ProductionScheduling;
 import org.apache.ibatis.annotations.Mapper;
 
@@ -9,7 +10,7 @@
 import java.util.Map;
 
 @Mapper
-public interface ProductionSchedulingMapper {
+public interface ProductionSchedulingMapper extends BaseMapper<ProductionScheduling> {
 
 
     List<Map<String,String>> SelectOkSchedulingMp(String selectTime1, String selectTime2,String orderId,String processes, ProductionScheduling productionScheduling);
@@ -18,9 +19,13 @@
 
     List<Map<String,String>> selectLastSchedulingMp(String selectTime1, String selectTime2, ProductionScheduling productionScheduling);
 
-    List<Map<String,String>> SelectSchedulingNotMp(String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling);
+    List<Map<String,String>> selectSchedulingNotMp(String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling);
 
     Integer selectMaxId();
 
     Boolean insertSelective(String schedulingId, String orderId, String orderNumber, String processes, Integer schedulingQuantity, LocalDate scheduledStartTime, LocalDate planEndTime, String notes);
+
+    Boolean ExamineSchedulingMp(String schedulingId, String userName);
+
+    Boolean deleteSchedulingMp(String schedulingId);
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkDetailMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkDetailMapper.java
index 63ac97f..b7671f2 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkDetailMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkDetailMapper.java
@@ -25,4 +25,5 @@
     List<ReportingWorkDetail> reworkDataManage2(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize,
                                                @Param("sDate") String startTime,@Param("eDate") String endTime,ReportingWorkDetail reportingWorkDetail);
 
+
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
index a893ed4..89418ed 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
@@ -26,7 +26,7 @@
 
     List<Map<String,String>> SelectTechnologicalNumMp(String processIdStr, String technologyStr,String process);
 
-    List<Map<String,String>> SelectReworlDetailMp(String processIdStr, String technologyStr, String previousProcess);
+    List<Map<String,String>> SelectReworlDetailMp(String processIdStr, String technologyStr, String process);
 
     List<Map<String,String>> SelectProcessMp();
 
@@ -41,4 +41,8 @@
     List<Map<String,BasicDataProduce>>  selectBasicNameByType(String type);
 
     Integer selectMaxReportingWorkId();
+
+    int selectGlassProcessNum(String orderNumber, String technologyNumber, String processId, String thisProcess);
+
+    int selectFlowCardNum(String orderNumber, String technologyNumber, String processId, String thisProcess);
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java
index 9ea6256..a6b07e5 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java
@@ -21,20 +21,20 @@
     List<OrderDetail> addWordOrder(String orderId, OrderDetail orderDetail);
 
     //杞伐鍗�
-    Boolean AddOrderWorkMp(String productIdVl,
+    Boolean addOrderWorkMp(String productIdVl,
                            @Param("orderId") String orderId,
                            @Param("productId") Integer productId,
                            @Param("productName") String productName,
                            String userName);
     //鏌ヨ瀵瑰簲璁㈠崟鍙疯搴�
-    Integer SelectOrderNumber(String productIdVl);
+    Integer selectOrderNumber(String productIdVl);
 
     //鍒犻櫎宸ュ崟,灏嗗搴斾骇鍝佺敓浜ц鍗曞彿鏀逛负null
-    Boolean DeleteOrderWorkMp(String orderId, String productName);
+    Boolean deleteOrderWorkMp(String orderId, String productName);
 
-    Integer SelectWorkCount(String orderId);
+    Integer selectWorkCount(String orderId);
 
-    Boolean UpdateWorkType(String orderId, Integer state);
+    Boolean updateWorkType(String orderId, Integer state);
 
-    Integer SelectYesWorkCount(String orderId);
+    Integer selectYesWorkCount(String orderId);
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
index aba88e0..4329b82 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -4,11 +4,15 @@
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.example.erp.entity.pp.FlowCard;
 import com.example.erp.entity.sd.Order;
 import com.example.erp.entity.sd.OrderDetail;
 import com.example.erp.entity.sd.OrderGlassDetail;
+import com.example.erp.entity.sd.OrderProcessDetail;
 import com.example.erp.mapper.pp.FlowCardMapper;
+import com.example.erp.mapper.sd.OrderGlassDetailMapper;
+import com.example.erp.mapper.sd.OrderProcessDetailMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -17,17 +21,30 @@
 import java.util.List;
 import java.util.Map;
 
+import static com.example.erp.service.sd.OrderService.getOrderProcessDetails;
+
 @Service
 @DS("pp")
 public class FlowCardService {
-    @Autowired
+    final
     FlowCardMapper flowCardMapper;
+    final
+    OrderGlassDetailMapper orderGlassDetailMapper;
+    final
+    OrderProcessDetailMapper orderProcessDetailMapper;
+
+    public FlowCardService(FlowCardMapper flowCardMapper, OrderGlassDetailMapper orderGlassDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper) {
+        this.flowCardMapper = flowCardMapper;
+        this.orderGlassDetailMapper = orderGlassDetailMapper;
+        this.orderProcessDetailMapper = orderProcessDetailMapper;
+    }
 
     //娴佺▼鍗$鐞嗘煡璇�
-    public Map<String, Object> selectProcessCard(Date selectTime1, Date selectTime2, FlowCard flowCard) {
+    public Map<String, Object> selectProcessCard(Integer pageNum, Integer pageSize,Date selectTime1, Date selectTime2, FlowCard flowCard) {
+        Integer offset = (pageNum-1)*pageSize;
         Map<String, Object> map = new HashMap<>();
-        //System.out.println(flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard));
-        map.put("data", flowCardMapper.selectFlowCard(selectTime1, selectTime2, flowCard));
+        map.put("data", flowCardMapper.selectFlowCard(offset, pageSize,selectTime1, selectTime2, flowCard));
+        map.put("total",flowCardMapper.getPageTotal(offset, pageSize, selectTime1, selectTime2, flowCard));
         return map;
     }
 
@@ -39,23 +56,23 @@
     }
 
     //鍒嗘灦鏄庣粏鏌ヨ
-    public Map<String, Object> DetailsSelectSv(String orderId, FlowCard flowCard) {
+    public Map<String, Object> detailsSelectSv(String orderId, FlowCard flowCard) {
         Map<String, Object> map = new HashMap<>();
-        map.put("data", flowCardMapper.DetailsSelectMp(orderId, flowCard));
+        map.put("data", flowCardMapper.detailsSelectMp(orderId, flowCard));
         return map;
     }
 
     //鍒犻櫎娴佺▼鍗�
-    public Boolean DeleteFlowCardSv(String orderId, String processId) {
+    public Boolean deleteFlowCardSv(String orderId, String processId) {
         if (!orderId.isEmpty() && !processId.isEmpty()) {
-            Integer count = flowCardMapper.ReportingWorkCount(processId);
+            Integer count = flowCardMapper.reportingWorkCount(processId);
             if (count == 0) {
                 //淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬佷负1,鏈叏閮ㄥ垎鏋跺畬鎴�
-                flowCardMapper.UpdateProcessingCard(orderId, 1);
+                flowCardMapper.updateProcessingCard(orderId, 1);
                 //淇敼鍒嗘灦鐘舵��
-                flowCardMapper.UpdateDeleteState(orderId, processId);
+                flowCardMapper.updateDeleteState(orderId, processId);
                 //鍒犻櫎鍒嗘灦鏄庣粏
-                flowCardMapper.DeleteFlowCardMp(orderId, processId);
+                flowCardMapper.deleteFlowCardMp(orderId, processId);
                 return true;
             } else {
                 return false;
@@ -67,20 +84,20 @@
     }
 
     //鍒嗘灦鏂板鏄庣粏鏌ヨ
-    public Map<String, Object> SelectNoCardSv(String orderId, String productionId, FlowCard flowCard) {
+    public Map<String, Object> selectNoCardSv(String orderId, String productionId, FlowCard flowCard) {
         Map<String, Object> map = new HashMap<>();
-        map.put("data", flowCardMapper.SelectNoCardMp(orderId, productionId, flowCard));
+        map.put("data", flowCardMapper.selectNoCardMp(orderId, productionId, flowCard));
         return map;
     }
 
 
     //淇敼鎺掔増鐘舵��
-    public Boolean UpdateLayoutStatusSv(String processId) {
+    public Boolean updateLayoutStatusSv(String processId) {
 
         if (!processId.isEmpty()) {
-            Integer Status = flowCardMapper.SelectLayoutStatus(processId);
+            Integer Status = flowCardMapper.selectLayoutStatus(processId);
             if (Status == 1) {
-                flowCardMapper.UpdateLayoutStatusMp(processId);
+                flowCardMapper.updateLayoutStatusMp(processId);
             } else {
                 return false;
             }
@@ -92,7 +109,7 @@
     }
 
     //淇濆瓨娴佺▼鍗℃暟鎹�
-    public Boolean AddFlowCardSv(Map<String, Object> object) {
+    public Boolean addFlowCardSv(Map<String, Object> object) {
         String userName = "";
         if (object.get("userName") != null) {
             userName = object.get("userName").toString();
@@ -107,34 +124,49 @@
         if (!FlowCardList.isEmpty()) {
             for (FlowCard flowCard : FlowCardList) {
                 //鏌ヨ姣忎釜搴忓彿鐨勫眰鏁�
-                Integer layer = flowCardMapper.SelectLayer(productionId, flowCard.getOrderNumber());
+                Integer layer = flowCardMapper.selectLayer(productionId, flowCard.getOrderNumber());
                 //娣诲姞娴佺▼鍗℃暟鎹�
-                flowCardMapper.AddFlowCardMp(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getLandingSequence(), flowCard.getQuantity(), productionId, userName,layer);
+                flowCardMapper.addFlowCardMp(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getLandingSequence(), flowCard.getQuantity(), productionId, userName,layer);
                 //淇敼鍒嗘灦鐘舵�侊紝灏嗙姸鎬佹敼涓�1
-                flowCardMapper.UpdateFlowState(productionId, flowCard.getOrderNumber());
+                flowCardMapper.updateFlowState(productionId, flowCard.getOrderNumber());
                 //鏌ヨ璇ヨ鍗曟湭鍒嗘灦鏁伴噺
-                Integer FlowCount = flowCardMapper.SelectFlowCount(productionId);
+                Integer FlowCount = flowCardMapper.selectFlowCount(productionId);
                 if (FlowCount == 0) {
                     //淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬佷负2
-                    flowCardMapper.UpdateProcessingCard(productionId, 2);
+                    flowCardMapper.updateProcessingCard(productionId, 2);
                 } else {
                     //淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬佷负1,鏈叏閮ㄥ垎鏋跺畬鎴�
-                    flowCardMapper.UpdateProcessingCard(productionId, 1);
+                    flowCardMapper.updateProcessingCard(productionId, 1);
                 }
+                //鏌ヨ璁㈠崟灏忕墖琛ㄨ幏鍙栧伐鑹轰紶鍏ュ皬鐗囧伐鑹鸿〃
+                List<OrderGlassDetail> orderGlassDetailList =
+                        orderGlassDetailMapper.selectList(
+                                new QueryWrapper<OrderGlassDetail>()
+                                .eq("order_id", flowCard.getProcessId().substring(0,10))
+                                .eq("order_number", flowCard.getOrderNumber())
+                        );
+                List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList);
+                orderProcessDetailList.forEach(
+                        orderGlassDetail ->orderGlassDetail.setProcessId(flowCard.getProcessId()));
+
+
+                //璧嬪�艰鍗曞伐鑹鸿〃
+                orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);
             }
+
             return true;
         } else {
             return false;
         }
     }
 
-    public Map<String, Object> SelectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, FlowCard flowCard) {
+    public Map<String, Object> selectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, FlowCard flowCard) {
         Map<String, Object> map = new HashMap<>();
         if (state==2){//宸叉帓浜�
-            map.put("data", flowCardMapper.SelectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard));
+            map.put("data", flowCardMapper.selectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard));
 
         }else if (state==1){//鏈帓浜�
-            map.put("data", flowCardMapper.SelectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard));
+            map.put("data", flowCardMapper.selectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard));
 
         }
 
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 fb541a0..c055460 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,6 +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;
@@ -53,9 +54,9 @@
     }
 
     //甯﹁鍗曞彿鏌ヨ
-    public Map<String, Object> SelectSchedulingNotSv(String selectTime1, String selectTime2, String orderId, String processes, Integer state, ProductionScheduling productionScheduling) {
+    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));
+        map.put("data", productionSchedulingMapper.selectSchedulingNotMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
         return map;
     }
 
@@ -92,4 +93,38 @@
         }
 
     }
+
+    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);
+        if (!Scheduling.isEmpty()) {
+            for (ProductionScheduling productionScheduling : Scheduling) {
+                productionSchedulingMapper.deleteSchedulingMp(productionScheduling.getSchedulingId());
+                // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
+            }
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
+
+    public boolean ExamineSchedulingSv(Map<String, Object> object) {
+        String userName = "";
+        if (object.get("userName") != null) {
+            userName = object.get("userName").toString();
+        }
+        List<ProductionScheduling> schedulinglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("scheduling")), ProductionScheduling.class);
+
+        if (!schedulinglist.isEmpty()) {
+            for (ProductionScheduling productionScheduling : schedulinglist) {
+                productionSchedulingMapper.ExamineSchedulingMp(productionScheduling.getSchedulingId(),userName);
+                // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
+            }
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
index 65d8dc1..eb184ae 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -4,12 +4,14 @@
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
+import com.example.erp.common.Constants;
 import com.example.erp.entity.pp.DamageDetails;
 import com.example.erp.entity.pp.ReportingWork;
 import com.example.erp.entity.pp.ReportingWorkDetail;
 import com.example.erp.entity.sd.Order;
 import com.example.erp.entity.sd.OrderDetail;
 import com.example.erp.entity.sd.OrderProcessDetail;
+import com.example.erp.exception.ServiceException;
 import com.example.erp.mapper.pp.BasicDateProduceMapper;
 import com.example.erp.mapper.pp.DamageDetailsMapper;
 import com.example.erp.mapper.pp.ReportingWorkDetailMapper;
@@ -114,7 +116,7 @@
         }
         else {
             //涓嶆槸绗竴閬撳伐搴忥紝鏌ヨ鎶ュ伐鏁版嵁
-            map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr,technologyStr,previousProcess));
+            map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr,technologyStr,process));
         }
 
         // 绗竴閬撳伐搴忥紙娴佺▼鍗℃暟+琛ョ墖鏁伴噺-瀹屽伐鏁�-娆$牬鏁�-杩斿伐鏈畬鎴愭暟-绂佺敤鏁伴噺锛�
@@ -142,7 +144,7 @@
     }
 
     //鎶ュ伐鏂板
-    @Transactional
+    @Transactional(rollbackFor = Exception.class)
     public boolean SaveReportingWorkSv(Map<String, Object> reportingWorkMap) {
         //鎺ユ敹瑙f瀽涓婚檮琛ㄤ俊鎭�
         JSONObject reportingWorkJson = new JSONObject(reportingWorkMap);
@@ -173,19 +175,62 @@
                     damageDetailsMapper.insert(damageDetail);
                 });
             }
-            //System.out.println(reportingWorkDetail);
+            //鏌ヨ娴佺▼鍗″伐鑹烘祦绋�
+            String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(reportingWork.getProcessId());
+
+            int index = technologicalProcess.indexOf("-");
+            //鑾峰彇宸ヨ壓娴佺▼绗竴涓伐搴�
+            String interceptProcess = technologicalProcess.substring(0, index);
+
+            //鍒ゆ柇褰撳墠宸ュ簭鏄惁涓虹涓�閬撳伐搴忓伐搴忥紝浣跨敤娴佺▼鍗¤〃鏁伴噺鎴栬�呭皬鐗囨祦绋嬭〃涓婂伐搴忔暟閲�
+            int processNum = 0;
+            if (interceptProcess.equals(reportingWork.getThisProcess())) {
+                processNum = reportingWorkMapper.selectFlowCardNum(
+                        reportingWorkDetail.getOrderNumber(),
+                        reportingWorkDetail.getTechnologyNumber(),
+                        reportingWork.getProcessId(),
+                        reportingWork.getThisProcess()
+                );
+            }else{
+                processNum = reportingWorkMapper.selectGlassProcessNum(
+                        reportingWorkDetail.getOrderNumber(),
+                        reportingWorkDetail.getTechnologyNumber(),
+                        reportingWork.getProcessId(),
+                        reportingWork.getThisProcess()
+                );
+            }
+
+
+            //鍒ゆ柇鏄惁澶т簬褰撳墠鏁伴噺骞朵笖鎶涘嚭寮傚父
+            if(processNum<(reportingWorkDetail.getBreakageQuantity()+reportingWorkDetail.getCompletedQuantity())){
+//                System.out.println(processNum);
+//                System.out.println(reportingWorkDetail.getBreakageQuantity());
+//                System.out.println(reportingWorkDetail.getCompletedQuantity());
+                throw new ServiceException(Constants.Code_600,"褰撳墠宸ュ簭鏁伴噺澶т簬娴佺▼鍗¤〃鏁伴噺");
+            }
+
+
+
+
+
             OrderProcessDetail orderProcessDetail = new OrderProcessDetail();
             orderProcessDetail.setBrokenNum(reportingWorkDetail.getBreakageQuantity());
             orderProcessDetail.setReportingWorkNum(reportingWorkDetail.getCompletedQuantity());
             orderProcessDetail.setReportingWorkNumCount(reportingWorkDetail.getCompletedQuantity());
 
+
+
+
+
+
             //鏍规嵁璁㈠崟id锛岃鍗曞簭鍙凤紝浠ュ強灏忕墖搴忓彿 鏇存柊灏忕墖娴佺▼鐨勫畬宸ユ暟閲忎互鍙婂埡鐮存暟閲�
             LambdaUpdateWrapper<OrderProcessDetail> updateWrapper = new LambdaUpdateWrapper<>();
             updateWrapper.eq(OrderProcessDetail::getOrderNumber, reportingWorkDetail.getOrderNumber())
+                    .eq(OrderProcessDetail::getProcessId, reportingWork.getProcessId().substring(0,13))
                     .eq(OrderProcessDetail::getOrderId, reportingWork.getOrderId())
                     .eq(OrderProcessDetail::getProcess, reportingWork.getThisProcess())
                     .eq(OrderProcessDetail::getTechnologyNumber, reportingWorkDetail.getTechnologyNumber())
-                    .setSql("reporting_work_num_count =reporting_work_num_count +"+orderProcessDetail.getReportingWorkNumCount())
+                    .setSql("reporting_work_num_count =reporting_work_num_count +"+orderProcessDetail.getReportingWorkNum())
                     .setSql("reporting_work_num =reporting_work_num +"+orderProcessDetail.getReportingWorkNum())
                     .setSql("broken_num =broken_num +"+orderProcessDetail.getBrokenNum());
 
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java
index 123dd80..cee1cc8 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java
@@ -34,14 +34,14 @@
         return map;
     }
 
-    public Map<String, Object> AddDateWork(String orderId, OrderDetail orderDetail) {
+    public Map<String, Object> addDateWork(String orderId, OrderDetail orderDetail) {
         Map<String, Object> map = new HashMap<>();
 
         map.put("data", workOrderMapper.addWordOrder(orderId, orderDetail));
         return map;
     }
 
-    public Boolean AddOrderWorkSv(Map<String, Object> object) {
+    public Boolean addOrderWorkSv(Map<String, Object> object) {
         String userName = "";
         if (object.get("userName") != null) {
             userName = object.get("userName").toString();
@@ -65,7 +65,7 @@
                     productIdVl = orderID + letters;
                     //鏌ヨ鐢熸垚鐨勭敓浜ц鍗曞彿鏄惁瀛樺湪
 
-                    Integer workCount = workOrderMapper.SelectOrderNumber(productIdVl);
+                    Integer workCount = workOrderMapper.selectOrderNumber(productIdVl);
                     if (workCount < 1 ) {
                         break;
                     }
@@ -73,16 +73,16 @@
                 }
 
                 //娣诲姞鐢熶骇璁㈠崟
-                workOrderMapper.AddOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(), userName);
+                workOrderMapper.addOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(), userName);
                 Integer State = 2;
                 Integer States = 1;
                 //鏌ヨ璇ヨ鍗曟湭杞敓浜ц鍗曠殑鏉℃暟
-                Integer NoWorkCount = workOrderMapper.SelectWorkCount(orderDetail.getOrderId());
+                Integer NoWorkCount = workOrderMapper.selectWorkCount(orderDetail.getOrderId());
                 if (NoWorkCount == 0) {
                     //鏉℃暟涓�0淇敼杞敓浜ц鍗曠姸鎬佷负2锛屽惁鍒欎负1
-                    workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), State);
+                    workOrderMapper.updateWorkType(orderDetail.getOrderId(), State);
                 } else {
-                    workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), States);
+                    workOrderMapper.updateWorkType(orderDetail.getOrderId(), States);
                 }
             }
 
@@ -93,17 +93,17 @@
 
     }
 
-    public Boolean DeleteOrderWorkSv(String orderId, String productName) {
+    public Boolean deleteOrderWorkSv(String orderId, String productName) {
         if (!orderId.isEmpty() && !productName.isEmpty()) {
-            workOrderMapper.DeleteOrderWorkMp(orderId, productName);
+            workOrderMapper.deleteOrderWorkMp(orderId, productName);
             Integer State = 0;
             Integer States = 1;
-            Integer NoWorkCount = workOrderMapper.SelectWorkCount(orderId);
-            Integer YesWorkCount = workOrderMapper.SelectYesWorkCount(orderId);
+            Integer NoWorkCount = workOrderMapper.selectWorkCount(orderId);
+            Integer YesWorkCount = workOrderMapper.selectYesWorkCount(orderId);
             if (NoWorkCount ==YesWorkCount) {
-                workOrderMapper.UpdateWorkType(orderId, State);
+                workOrderMapper.updateWorkType(orderId, State);
             } else {
-                workOrderMapper.UpdateWorkType(orderId, States);
+                workOrderMapper.updateWorkType(orderId, States);
             }
             return true;
         } else {
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
index 6037cbc..26a2178 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -98,7 +98,7 @@
         //鍒犻櫎璁㈠崟灏忕墖琛�
         orderGlassDetailMapper.delete(new LambdaQueryWrapper<OrderGlassDetail>().eq(OrderGlassDetail::getOrderId, order.getOrderId()));
         //鍒犻櫎璁㈠崟宸ヨ壓琛�
-        orderProcessDetailMapper.delete(new LambdaQueryWrapper<OrderProcessDetail>().eq(OrderProcessDetail::getOrderId, order.getOrderId()));
+       // orderProcessDetailMapper.delete(new LambdaQueryWrapper<OrderProcessDetail>().eq(OrderProcessDetail::getOrderId, order.getOrderId()));
         insertOtherDetail(order.getOrderId(),OrderDetails);
     }
 
@@ -119,13 +119,13 @@
         //寰�灏忕墖琛ㄤ紶鍏ヤ骇鍝佹暟鎹�
         orderGlassDetailMapper.insertOrderGlassDetail(orderId);
         //鏌ヨ璁㈠崟灏忕墖琛ㄨ幏鍙栧伐鑹轰紶鍏ュ皬鐗囧伐鑹鸿〃
-        List<OrderGlassDetail> orderGlassDetails = orderGlassDetailMapper.selectOrderGlassDetail(orderId);
-        List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetails);
+        //List<OrderGlassDetail> orderGlassDetails = orderGlassDetailMapper.selectOrderGlassDetail(orderId);
+        /*List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetails);
         //璧嬪�艰鍗曞伐鑹鸿〃
-        orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);
+        orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);*/
     }
 
-    private static List<OrderProcessDetail> getOrderProcessDetails(List<OrderGlassDetail> orderGlassDetails) {
+    public static List<OrderProcessDetail> getOrderProcessDetails(List<OrderGlassDetail> orderGlassDetails) {
         List<OrderProcessDetail> orderProcessDetailList = new ArrayList<>();
         for (OrderGlassDetail orderGlassDetail : orderGlassDetails) {
             String[] processList = orderGlassDetail.getProcess().split("->");
@@ -200,10 +200,10 @@
             orderGlassDetailMapper.updateSizeAndProcess(orderGlassDetails);
             orderProcessDetailMapper.delete(new QueryWrapper<OrderProcessDetail>().eq("order_id",id));
             //鏌ヨ璁㈠崟灏忕墖琛ㄨ幏鍙栧伐鑹轰紶鍏ュ皬鐗囧伐鑹鸿〃
-            List<OrderGlassDetail> orderGlassDetailList = orderGlassDetailMapper.selectOrderGlassDetail(id);
-            List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList);
-            //璧嬪�艰鍗曞伐鑹鸿〃
-            orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);
+            //List<OrderGlassDetail> orderGlassDetailList = orderGlassDetailMapper.selectOrderGlassDetail(id);
+//            List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList);
+//            //璧嬪�艰鍗曞伐鑹鸿〃
+//            orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);
         }
 
         return orderMapper.reviewProcessById(id,status);
diff --git a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
index 9d82870..b840f47 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -81,7 +81,38 @@
                     </if>
 
 
-        group by a.process_Id;
+        group by a.process_Id
+        ORDER BY a.id desc
+        limit #{offset},#{pageSize};
+    </select>
+
+
+    <select id="getPageTotal">
+        select
+        CEILING(count(a.process_Id)/#{pageSize}) as 'pageTotal',
+        count(distinct a.process_Id) as 'total'
+        from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
+        left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
+        where a.create_time between #{selectTime1} and #{selectTime2}
+        <if test="flowCard.orderId != null and flowCard.orderId != ''">
+            and a.order_id regexp #{flowCard.orderId}
+        </if>
+        <if test="flowCard.productionId != null and flowCard.productionId != ''">
+            and a.process_Id regexp #{flowCard.productionId}
+        </if>
+        <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
+            and c.product_id regexp #{flowCard.orderDetail.productId}
+        </if>
+        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
+            and c.product_name regexp #{flowCard.orderDetail.productName}
+        </if>
+
+        <if test="flowCard.order.project != null and flowCard.order.project!= ''">
+            and b.project regexp #{flowCard.order.project}
+        </if>
+
+
+        limit #{offset},#{pageSize};
     </select>
 
     <!--鍒嗘灦鏌ヨ-->
@@ -132,7 +163,7 @@
     </select>
 
 <!--    鍒嗘灦鏄庣粏鏌ヨ-->
-    <select id="DetailsSelectMp" resultMap="flowCardMap">
+    <select id="detailsSelectMp" resultMap="flowCardMap">
         select od.order_id,
         ogd.production_id,
         od.product_id,
@@ -159,7 +190,7 @@
     </select>
 
     <!--    鏇存柊鍒嗘灦鐘舵��-->
-    <update id="UpdateDeleteState">
+    <update id="updateDeleteState">
         update
             sd.order_glass_detail as ogd left join flow_card as fc
                 on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number
@@ -169,14 +200,14 @@
     </update>
 
     <!--    鍒犻櫎娴佺▼鍗�-->
-    <update id="DeleteFlowCardMp">
+    <update id="deleteFlowCardMp">
         delete from flow_card as fc where fc.process_id=#{processId}
     </update>
 
     <!--    鍒嗘灦鏂板鏄庣粏鏌ヨ-->
 
     <!--resultMap="flowCardMap"-->
-    <select id="SelectNoCardMp" >
+    <select id="selectNoCardMp" >
 
         select
         od.order_number,
@@ -203,14 +234,14 @@
     </select>
 
     <!--淇敼鎺掔増鐘舵��-->
-    <update id="UpdateLayoutStatusMp">
+    <update id="updateLayoutStatusMp">
         update flow_card as fc
         set fc.layout_status=2
         where fc.process_id = #{processId}
     </update>
 
 <!--    鏌ヨ瀵瑰簲娴佺▼鍗″彿鎺掔増鐘舵��-->
-    <select id="SelectLayoutStatus">
+    <select id="selectLayoutStatus">
         select fc.layout_status
         from flow_card as fc
         where fc.process_id = #{processId}
@@ -218,13 +249,13 @@
     </select>
 
 <!--    鏌ヨ鎶ュ伐琛ㄥ唴鏄惁鏈夊搴旀祦绋嬪崱-->
-    <select id="ReportingWorkCount">
+    <select id="reportingWorkCount">
         select COUNT(rw.process_id)
         from reporting_work as rw
         where rw.process_id = #{processId}
     </select>
 <!--    鎻掑叆Flow_card琛�-->
-    <insert id="AddFlowCardMp">
+    <insert id="addFlowCardMp">
         insert into
             flow_card (
             order_id,
@@ -260,27 +291,27 @@
     </insert>
 
 <!--    鏇存柊鍒嗘灦鐘舵��-->
-    <update id="UpdateFlowState">
+    <update id="updateFlowState">
         update sd.order_glass_detail as ogd
         set ogd.splitting_status=1
         where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
     </update>
 <!--    鏌ヨ鏈垎鏋剁殑鏉℃暟-->
-    <select id="SelectFlowCount">
+    <select id="selectFlowCount">
         select COUNT(*)
         from sd.order_glass_detail as ogd
         where ogd.order_id = left(#{productionId},10)
           and ogd.splitting_status = 0
     </select>
 <!--   淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬�-->
-    <update id="UpdateProcessingCard">
+    <update id="updateProcessingCard">
         update sd.`order` as o
         set o.processing_card=#{state}
         where o.order_id=left(#{productionId},10)
     </update>
 
 <!--    鏌ヨ宸叉帓鐗堟暟鎹�-->
-    <select id="SelectOkSchedulingMp">
+    <select id="selectOkSchedulingMp">
         select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
                round(od.width*od.height*od.quantity/1000000,2),
                (od.quantity-IFNULL(ps.scheduling_quantity,0)),
@@ -294,7 +325,7 @@
 
     </select>
 <!--    鏌ヨ鏈帓鐗堟暟鎹�-->
-    <select id="SelectNoSchedulingMp">
+    <select id="selectNoSchedulingMp">
 
     </select>
 <!--    棣栨鏌ヨ鎺掔増鏁版嵁-->
@@ -312,7 +343,7 @@
     </select>
 
 <!--   鏌ヨ瀵瑰簲搴忓彿鐨勫眰鏁�-->
-    <select id="SelectLayer">
+    <select id="selectLayer">
         select COUNT(ogd.order_number)
         from sd.order_glass_detail as ogd
         where ogd.production_id = #{productionId}
diff --git a/north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml b/north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml
index 2d8c76a..50467cc 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml
@@ -8,6 +8,7 @@
         <result column="scheduling_quantity" property="schedulingQuantity"/>
         <result column="order_number" property="orderNumber"/>
         <result column="scheduling_id" property="schedulingId"/>
+        <result column="order_id" property="orderId"/>
         <!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
         <association property="order" javaType="com.example.erp.entity.sd.Order">
             <result column="project" property="project"/>
@@ -60,14 +61,13 @@
             left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
         where  ps.scheduling_id IS NOT NULL
            and od.create_time between #{selectTime1} and #{selectTime2}
-
           and position(#{processes} in ps.processes)
           and position(#{orderId} in ps.order_id)
 
     </select>
 
     <!--    鏌ヨ宸叉帓浜у甫璁㈠崟缂栧彿鐨勬暟鎹�-->
-    <select id="SelectSchedulingNotMp">
+    <select id="selectSchedulingNotMp">
         select date(ps.scheduled_start_time) as scheduled_start_time,
         date(ps.plan_end_time) as plan_end_time,
         od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
@@ -108,14 +108,15 @@
     <select id="selectLastSchedulingMp">
         select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
                round(od.width*od.height*od.quantity/1000000,2) as area,
-               (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
-               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
-               IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
-               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
+               (od.quantity-IFNULL(sum(ps.scheduling_quantity),0)) as pendingProductionQuantity,
+               round(od.width*od.height*(od.quantity-IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as pendingProductionArea,
+               IFNULL(sum(ps.scheduling_quantity),0) as productionScheduledQuantity,
+               round(od.width*od.height*(IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as productionScheduledArea,
                od.product_name,od.shape
         from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
                                    left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
         where od.create_time between #{selectTime1} and #{selectTime2} and od.quantity-IFNULL(ps.scheduling_quantity,0)>0
+        group by od.order_id,od.order_number
     </select>
 
     <select id="selectMaxId">
@@ -151,4 +152,13 @@
                now()
               )
     </insert>
+
+    <update id="ExamineSchedulingMp">
+        update production_scheduling set review_status=1,reviewer=#{userName} where
+        scheduling_id=#{schedulingId}
+    </update>
+
+    <delete id="deleteSchedulingMp">
+        delete from production_scheduling where scheduling_id=#{schedulingId}
+    </delete>
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
index cb8f1ed..2ce4438 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -80,7 +80,7 @@
             ogd.child_width,
             ogd.child_height,
             od.shape,
-            fc.quantity -odpd.reporting_work_num as quantity,
+            fc.quantity -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity,
             odpd.reporting_work_num_count as completed,
             odpd.broken_num as onceBroken
         FROM
@@ -97,6 +97,14 @@
             ON  odpd.order_id = fc.order_id
             AND odpd.order_number = fc.order_number
             AND odpd.technology_number = fc.technology_number
+            and  odpd.process_id = fc.process_id
+        left join
+                (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
+                   from patch_log
+                   group by reporting_work_id,order_sort,technology_number) as c
+            on c.process_id = fc.process_id
+            and c.order_sort = fc.order_number
+            and c.technology_number = fc.technology_number
         WHERE
             fc.process_id = #{processIdStr}
           AND fc.technology_number = #{technologyStr}
@@ -106,32 +114,46 @@
 
 <!--    闈炵涓�閬撳伐搴忔姤宸ユ槑缁嗘煡璇�-->
     <select id="SelectReworlDetailMp">
-        SELECT fc.order_number,
-               ogd.glass_child,
-               ogd.technology_number,
-               ogd.glass_address,
-               fc.quantity as quantity_card,
-               ogd.child_width,
-               ogd.child_height,
-               od.shape,
-               reporting_work_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) as quantity
-        FROM sd.order_detail as od
-                 left join sd.order_glass_detail as ogd
-                           on od.order_id = ogd.order_id and od.order_number = ogd.order_number
-                 left join sd.order_process_detail as opd
-                           on opd.order_id = ogd.order_id and opd.order_number = ogd.order_number and
-                              opd.technology_number = ogd.technology_number
-
-                 left join flow_card as fc on opd.order_id = fc.order_id and opd.order_number = fc.order_number and
-                                              opd.technology_number = fc.technology_number
-                 left join reporting_work as rw on rw.order_id=fc.order_id and
-                                                   rw.production_id=fc.production_id and rw.process_id=fc.process_id and rw.this_process = #{previousProcess}
-                 left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id and
-                                                           rwd.order_number=fc.order_number and rwd.technology_number=fc.technology_number
-        where fc.process_id = #{processIdStr}
-          and opd.process = #{previousProcess}
-          and position(ogd.technology_number in #{technologyStr})
-
+        SELECT
+            fc.order_number,
+            ogd.glass_child,
+            ogd.technology_number,
+            ogd.glass_address,
+            fc.quantity AS quantity_card,
+            ogd.child_width,
+            ogd.child_height,
+            od.shape,
+            odpds.reporting_work_num -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity,
+            odpd.reporting_work_num_count as completed,
+            odpd.broken_num as onceBroken
+        FROM
+            sd.order_detail AS od
+        LEFT JOIN sd.order_glass_detail AS ogd
+                ON od.order_id = ogd.order_id
+                AND od.order_number = ogd.order_number
+        LEFT JOIN flow_card AS fc
+                ON fc.order_id = ogd.order_id
+                and fc.production_id=ogd.production_id
+                AND fc.order_number = ogd.order_number
+                AND fc.technology_number = ogd.technology_number
+        left join sd.order_process_detail as odpd
+                ON  odpd.order_id = fc.order_id
+                AND odpd.order_number = fc.order_number
+                AND odpd.technology_number = fc.technology_number
+                and odpd.process_id = fc.process_id
+        left join sd.order_process_detail as odpds
+                ON  odpds.id = odpd.id-1
+        left join
+            (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
+             from patch_log
+             group by reporting_work_id,order_sort,technology_number) as c
+            on c.process_id = fc.process_id
+            and c.order_sort = fc.order_number
+            and c.technology_number = fc.technology_number
+        WHERE
+            fc.process_id = #{processIdStr}
+          AND fc.technology_number = #{technologyStr}
+          AND odpd.process = #{process}
         order by fc.order_number
     </select>
 
@@ -210,4 +232,58 @@
         order by id desc,reporting_work_id	desc limit  1
     </select>
 
+    <!--    鏌ヨ娴佺▼鍗″伐搴忔姤宸ュ彲鎶ユ暟閲�-->
+    <select id="selectReportingWorkNum">
+
+    </select>
+    <select id="selectGlassProcessNum" resultType="java.lang.Integer">
+        select
+              d.reporting_work_num-b.reporting_work_num-b.broken_num+ifnull(c.patchNumSum,0)
+        from flow_card as a
+        left join sd.order_process_detail as b
+        on
+            b.order_number = a.order_number
+            and b.technology_number = a.technology_number
+            and b.order_id = SUBSTR(#{processId} from 1 for 10)
+            and b.process = #{thisProcess}
+            and b.process_id = a.process_id
+        left join sd.order_process_detail as d
+            on d.id=b.id-1
+        left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
+                   from patch_log
+                   group by reporting_work_id,order_sort,technology_number) as c
+        on
+            c.process_id = a.process_id
+            and c.order_sort = a.order_number
+            and c.technology_number = a.technology_number
+
+        where
+            a.process_id=SUBSTR(#{processId} from 1 for 13)
+            and a.order_number = #{orderNumber}
+            and a.technology_number = #{technologyNumber}
+    </select>
+    <select id="selectFlowCardNum" resultType="java.lang.Integer">
+        select
+                    a.quantity-b.reporting_work_num-b.broken_num+ifnull(c.patchNumSum,0)
+        from flow_card as a
+                 left join sd.order_process_detail as b
+                           on
+                                       b.order_number = a.order_number
+                                   and b.technology_number = a.technology_number
+                                   and b.order_id = SUBSTR(#{processId} from 1 for 10)
+                                   and b.process = #{thisProcess}
+                                   and b.process_id = a.process_id
+                 left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
+                            from patch_log
+                            group by reporting_work_id,order_sort,technology_number) as c
+                           on
+                                       c.process_id = a.process_id
+                                   and c.order_sort = a.order_number
+                                   and c.technology_number = a.technology_number
+
+        where
+            a.process_id=SUBSTR(#{processId} from 1 for 13)
+          and a.order_number = #{orderNumber}
+          and a.technology_number = #{technologyNumber}
+    </select>
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
index ab55593..471389d 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
@@ -132,13 +132,13 @@
         ;
     </select>
 
-    <select id="SelectOrderNumber" >
+    <select id="selectOrderNumber" >
         select ifnull(count(ogd.production_id),0)
         from sd.order_glass_detail as ogd
         where ogd.production_id = #{productIdVl}
     </select>
 
-    <update id="AddOrderWorkMp" >
+    <update id="addOrderWorkMp" >
         update sd.order_detail as od left join sd.order_glass_detail as ogd
             on od.order_id = ogd.order_id and od.order_number = ogd.order_number
 
@@ -152,7 +152,7 @@
     </update>
 
 <!--    鍒犻櫎宸ュ崟-->
-    <update id="DeleteOrderWorkMp">
+    <update id="deleteOrderWorkMp">
         update sd.order_detail as od left join sd.order_glass_detail as ogd
             on od.order_id = ogd.order_id and od.order_number = ogd.order_number
         set ogd.production_id=null,
@@ -162,20 +162,20 @@
           and od.product_name = #{productName}
     </update>
 
-    <select id="SelectWorkCount">
+    <select id="selectWorkCount">
         select COUNT(distinct order_number)
         from order_glass_detail
         where ISNULL(production_id)
           and order_id = #{orderId}
     </select>
 
-    <select id="SelectYesWorkCount">
+    <select id="selectYesWorkCount">
         select COUNT(distinct order_number)
         from order_glass_detail
         where  order_id = #{orderId}
     </select>
 
-    <update id="UpdateWorkType">
+    <update id="updateWorkType">
         update sd.order as o set o.production_order=#{state} where o.order_id=#{orderId}
     </update>
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml
index 2cc5ab6..9983811 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetail.xml
@@ -10,7 +10,8 @@
                 order_id,
                 order_number,
                 technology_number,
-                process
+                process,
+                process_id
             )
         values
         <foreach collection ="processDetailList" item="processDetail" separator =",">
@@ -18,7 +19,8 @@
              #{processDetail.orderId},
              #{processDetail.orderNumber},
              #{processDetail.technologyNumber},
-             #{processDetail.process}
+             #{processDetail.process},
+              #{processDetail.processId}
              )
         </foreach>
 
diff --git a/north-glass-erp/target/classes/mapper/pp/FolwCard.xml b/north-glass-erp/target/classes/mapper/pp/FolwCard.xml
index 9d82870..b840f47 100644
--- a/north-glass-erp/target/classes/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/target/classes/mapper/pp/FolwCard.xml
@@ -81,7 +81,38 @@
                     </if>
 
 
-        group by a.process_Id;
+        group by a.process_Id
+        ORDER BY a.id desc
+        limit #{offset},#{pageSize};
+    </select>
+
+
+    <select id="getPageTotal">
+        select
+        CEILING(count(a.process_Id)/#{pageSize}) as 'pageTotal',
+        count(distinct a.process_Id) as 'total'
+        from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
+        left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
+        where a.create_time between #{selectTime1} and #{selectTime2}
+        <if test="flowCard.orderId != null and flowCard.orderId != ''">
+            and a.order_id regexp #{flowCard.orderId}
+        </if>
+        <if test="flowCard.productionId != null and flowCard.productionId != ''">
+            and a.process_Id regexp #{flowCard.productionId}
+        </if>
+        <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
+            and c.product_id regexp #{flowCard.orderDetail.productId}
+        </if>
+        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
+            and c.product_name regexp #{flowCard.orderDetail.productName}
+        </if>
+
+        <if test="flowCard.order.project != null and flowCard.order.project!= ''">
+            and b.project regexp #{flowCard.order.project}
+        </if>
+
+
+        limit #{offset},#{pageSize};
     </select>
 
     <!--鍒嗘灦鏌ヨ-->
@@ -132,7 +163,7 @@
     </select>
 
 <!--    鍒嗘灦鏄庣粏鏌ヨ-->
-    <select id="DetailsSelectMp" resultMap="flowCardMap">
+    <select id="detailsSelectMp" resultMap="flowCardMap">
         select od.order_id,
         ogd.production_id,
         od.product_id,
@@ -159,7 +190,7 @@
     </select>
 
     <!--    鏇存柊鍒嗘灦鐘舵��-->
-    <update id="UpdateDeleteState">
+    <update id="updateDeleteState">
         update
             sd.order_glass_detail as ogd left join flow_card as fc
                 on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number
@@ -169,14 +200,14 @@
     </update>
 
     <!--    鍒犻櫎娴佺▼鍗�-->
-    <update id="DeleteFlowCardMp">
+    <update id="deleteFlowCardMp">
         delete from flow_card as fc where fc.process_id=#{processId}
     </update>
 
     <!--    鍒嗘灦鏂板鏄庣粏鏌ヨ-->
 
     <!--resultMap="flowCardMap"-->
-    <select id="SelectNoCardMp" >
+    <select id="selectNoCardMp" >
 
         select
         od.order_number,
@@ -203,14 +234,14 @@
     </select>
 
     <!--淇敼鎺掔増鐘舵��-->
-    <update id="UpdateLayoutStatusMp">
+    <update id="updateLayoutStatusMp">
         update flow_card as fc
         set fc.layout_status=2
         where fc.process_id = #{processId}
     </update>
 
 <!--    鏌ヨ瀵瑰簲娴佺▼鍗″彿鎺掔増鐘舵��-->
-    <select id="SelectLayoutStatus">
+    <select id="selectLayoutStatus">
         select fc.layout_status
         from flow_card as fc
         where fc.process_id = #{processId}
@@ -218,13 +249,13 @@
     </select>
 
 <!--    鏌ヨ鎶ュ伐琛ㄥ唴鏄惁鏈夊搴旀祦绋嬪崱-->
-    <select id="ReportingWorkCount">
+    <select id="reportingWorkCount">
         select COUNT(rw.process_id)
         from reporting_work as rw
         where rw.process_id = #{processId}
     </select>
 <!--    鎻掑叆Flow_card琛�-->
-    <insert id="AddFlowCardMp">
+    <insert id="addFlowCardMp">
         insert into
             flow_card (
             order_id,
@@ -260,27 +291,27 @@
     </insert>
 
 <!--    鏇存柊鍒嗘灦鐘舵��-->
-    <update id="UpdateFlowState">
+    <update id="updateFlowState">
         update sd.order_glass_detail as ogd
         set ogd.splitting_status=1
         where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
     </update>
 <!--    鏌ヨ鏈垎鏋剁殑鏉℃暟-->
-    <select id="SelectFlowCount">
+    <select id="selectFlowCount">
         select COUNT(*)
         from sd.order_glass_detail as ogd
         where ogd.order_id = left(#{productionId},10)
           and ogd.splitting_status = 0
     </select>
 <!--   淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬�-->
-    <update id="UpdateProcessingCard">
+    <update id="updateProcessingCard">
         update sd.`order` as o
         set o.processing_card=#{state}
         where o.order_id=left(#{productionId},10)
     </update>
 
 <!--    鏌ヨ宸叉帓鐗堟暟鎹�-->
-    <select id="SelectOkSchedulingMp">
+    <select id="selectOkSchedulingMp">
         select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
                round(od.width*od.height*od.quantity/1000000,2),
                (od.quantity-IFNULL(ps.scheduling_quantity,0)),
@@ -294,7 +325,7 @@
 
     </select>
 <!--    鏌ヨ鏈帓鐗堟暟鎹�-->
-    <select id="SelectNoSchedulingMp">
+    <select id="selectNoSchedulingMp">
 
     </select>
 <!--    棣栨鏌ヨ鎺掔増鏁版嵁-->
@@ -312,7 +343,7 @@
     </select>
 
 <!--   鏌ヨ瀵瑰簲搴忓彿鐨勫眰鏁�-->
-    <select id="SelectLayer">
+    <select id="selectLayer">
         select COUNT(ogd.order_number)
         from sd.order_glass_detail as ogd
         where ogd.production_id = #{productionId}
diff --git a/north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml b/north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml
index 2d8c76a..50467cc 100644
--- a/north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml
+++ b/north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml
@@ -8,6 +8,7 @@
         <result column="scheduling_quantity" property="schedulingQuantity"/>
         <result column="order_number" property="orderNumber"/>
         <result column="scheduling_id" property="schedulingId"/>
+        <result column="order_id" property="orderId"/>
         <!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
         <association property="order" javaType="com.example.erp.entity.sd.Order">
             <result column="project" property="project"/>
@@ -60,14 +61,13 @@
             left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
         where  ps.scheduling_id IS NOT NULL
            and od.create_time between #{selectTime1} and #{selectTime2}
-
           and position(#{processes} in ps.processes)
           and position(#{orderId} in ps.order_id)
 
     </select>
 
     <!--    鏌ヨ宸叉帓浜у甫璁㈠崟缂栧彿鐨勬暟鎹�-->
-    <select id="SelectSchedulingNotMp">
+    <select id="selectSchedulingNotMp">
         select date(ps.scheduled_start_time) as scheduled_start_time,
         date(ps.plan_end_time) as plan_end_time,
         od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
@@ -108,14 +108,15 @@
     <select id="selectLastSchedulingMp">
         select od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
                round(od.width*od.height*od.quantity/1000000,2) as area,
-               (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
-               round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
-               IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
-               round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
+               (od.quantity-IFNULL(sum(ps.scheduling_quantity),0)) as pendingProductionQuantity,
+               round(od.width*od.height*(od.quantity-IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as pendingProductionArea,
+               IFNULL(sum(ps.scheduling_quantity),0) as productionScheduledQuantity,
+               round(od.width*od.height*(IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as productionScheduledArea,
                od.product_name,od.shape
         from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
                                    left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
         where od.create_time between #{selectTime1} and #{selectTime2} and od.quantity-IFNULL(ps.scheduling_quantity,0)>0
+        group by od.order_id,od.order_number
     </select>
 
     <select id="selectMaxId">
@@ -151,4 +152,13 @@
                now()
               )
     </insert>
+
+    <update id="ExamineSchedulingMp">
+        update production_scheduling set review_status=1,reviewer=#{userName} where
+        scheduling_id=#{schedulingId}
+    </update>
+
+    <delete id="deleteSchedulingMp">
+        delete from production_scheduling where scheduling_id=#{schedulingId}
+    </delete>
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/target/classes/mapper/pp/ReportingWork.xml b/north-glass-erp/target/classes/mapper/pp/ReportingWork.xml
index cb8f1ed..2ce4438 100644
--- a/north-glass-erp/target/classes/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/target/classes/mapper/pp/ReportingWork.xml
@@ -80,7 +80,7 @@
             ogd.child_width,
             ogd.child_height,
             od.shape,
-            fc.quantity -odpd.reporting_work_num as quantity,
+            fc.quantity -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity,
             odpd.reporting_work_num_count as completed,
             odpd.broken_num as onceBroken
         FROM
@@ -97,6 +97,14 @@
             ON  odpd.order_id = fc.order_id
             AND odpd.order_number = fc.order_number
             AND odpd.technology_number = fc.technology_number
+            and  odpd.process_id = fc.process_id
+        left join
+                (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
+                   from patch_log
+                   group by reporting_work_id,order_sort,technology_number) as c
+            on c.process_id = fc.process_id
+            and c.order_sort = fc.order_number
+            and c.technology_number = fc.technology_number
         WHERE
             fc.process_id = #{processIdStr}
           AND fc.technology_number = #{technologyStr}
@@ -106,32 +114,46 @@
 
 <!--    闈炵涓�閬撳伐搴忔姤宸ユ槑缁嗘煡璇�-->
     <select id="SelectReworlDetailMp">
-        SELECT fc.order_number,
-               ogd.glass_child,
-               ogd.technology_number,
-               ogd.glass_address,
-               fc.quantity as quantity_card,
-               ogd.child_width,
-               ogd.child_height,
-               od.shape,
-               reporting_work_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) as quantity
-        FROM sd.order_detail as od
-                 left join sd.order_glass_detail as ogd
-                           on od.order_id = ogd.order_id and od.order_number = ogd.order_number
-                 left join sd.order_process_detail as opd
-                           on opd.order_id = ogd.order_id and opd.order_number = ogd.order_number and
-                              opd.technology_number = ogd.technology_number
-
-                 left join flow_card as fc on opd.order_id = fc.order_id and opd.order_number = fc.order_number and
-                                              opd.technology_number = fc.technology_number
-                 left join reporting_work as rw on rw.order_id=fc.order_id and
-                                                   rw.production_id=fc.production_id and rw.process_id=fc.process_id and rw.this_process = #{previousProcess}
-                 left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id and
-                                                           rwd.order_number=fc.order_number and rwd.technology_number=fc.technology_number
-        where fc.process_id = #{processIdStr}
-          and opd.process = #{previousProcess}
-          and position(ogd.technology_number in #{technologyStr})
-
+        SELECT
+            fc.order_number,
+            ogd.glass_child,
+            ogd.technology_number,
+            ogd.glass_address,
+            fc.quantity AS quantity_card,
+            ogd.child_width,
+            ogd.child_height,
+            od.shape,
+            odpds.reporting_work_num -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity,
+            odpd.reporting_work_num_count as completed,
+            odpd.broken_num as onceBroken
+        FROM
+            sd.order_detail AS od
+        LEFT JOIN sd.order_glass_detail AS ogd
+                ON od.order_id = ogd.order_id
+                AND od.order_number = ogd.order_number
+        LEFT JOIN flow_card AS fc
+                ON fc.order_id = ogd.order_id
+                and fc.production_id=ogd.production_id
+                AND fc.order_number = ogd.order_number
+                AND fc.technology_number = ogd.technology_number
+        left join sd.order_process_detail as odpd
+                ON  odpd.order_id = fc.order_id
+                AND odpd.order_number = fc.order_number
+                AND odpd.technology_number = fc.technology_number
+                and odpd.process_id = fc.process_id
+        left join sd.order_process_detail as odpds
+                ON  odpds.id = odpd.id-1
+        left join
+            (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
+             from patch_log
+             group by reporting_work_id,order_sort,technology_number) as c
+            on c.process_id = fc.process_id
+            and c.order_sort = fc.order_number
+            and c.technology_number = fc.technology_number
+        WHERE
+            fc.process_id = #{processIdStr}
+          AND fc.technology_number = #{technologyStr}
+          AND odpd.process = #{process}
         order by fc.order_number
     </select>
 
@@ -210,4 +232,58 @@
         order by id desc,reporting_work_id	desc limit  1
     </select>
 
+    <!--    鏌ヨ娴佺▼鍗″伐搴忔姤宸ュ彲鎶ユ暟閲�-->
+    <select id="selectReportingWorkNum">
+
+    </select>
+    <select id="selectGlassProcessNum" resultType="java.lang.Integer">
+        select
+              d.reporting_work_num-b.reporting_work_num-b.broken_num+ifnull(c.patchNumSum,0)
+        from flow_card as a
+        left join sd.order_process_detail as b
+        on
+            b.order_number = a.order_number
+            and b.technology_number = a.technology_number
+            and b.order_id = SUBSTR(#{processId} from 1 for 10)
+            and b.process = #{thisProcess}
+            and b.process_id = a.process_id
+        left join sd.order_process_detail as d
+            on d.id=b.id-1
+        left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
+                   from patch_log
+                   group by reporting_work_id,order_sort,technology_number) as c
+        on
+            c.process_id = a.process_id
+            and c.order_sort = a.order_number
+            and c.technology_number = a.technology_number
+
+        where
+            a.process_id=SUBSTR(#{processId} from 1 for 13)
+            and a.order_number = #{orderNumber}
+            and a.technology_number = #{technologyNumber}
+    </select>
+    <select id="selectFlowCardNum" resultType="java.lang.Integer">
+        select
+                    a.quantity-b.reporting_work_num-b.broken_num+ifnull(c.patchNumSum,0)
+        from flow_card as a
+                 left join sd.order_process_detail as b
+                           on
+                                       b.order_number = a.order_number
+                                   and b.technology_number = a.technology_number
+                                   and b.order_id = SUBSTR(#{processId} from 1 for 10)
+                                   and b.process = #{thisProcess}
+                                   and b.process_id = a.process_id
+                 left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id
+                            from patch_log
+                            group by reporting_work_id,order_sort,technology_number) as c
+                           on
+                                       c.process_id = a.process_id
+                                   and c.order_sort = a.order_number
+                                   and c.technology_number = a.technology_number
+
+        where
+            a.process_id=SUBSTR(#{processId} from 1 for 13)
+          and a.order_number = #{orderNumber}
+          and a.technology_number = #{technologyNumber}
+    </select>
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/target/classes/mapper/pp/WordOrder.xml b/north-glass-erp/target/classes/mapper/pp/WordOrder.xml
index ab55593..471389d 100644
--- a/north-glass-erp/target/classes/mapper/pp/WordOrder.xml
+++ b/north-glass-erp/target/classes/mapper/pp/WordOrder.xml
@@ -132,13 +132,13 @@
         ;
     </select>
 
-    <select id="SelectOrderNumber" >
+    <select id="selectOrderNumber" >
         select ifnull(count(ogd.production_id),0)
         from sd.order_glass_detail as ogd
         where ogd.production_id = #{productIdVl}
     </select>
 
-    <update id="AddOrderWorkMp" >
+    <update id="addOrderWorkMp" >
         update sd.order_detail as od left join sd.order_glass_detail as ogd
             on od.order_id = ogd.order_id and od.order_number = ogd.order_number
 
@@ -152,7 +152,7 @@
     </update>
 
 <!--    鍒犻櫎宸ュ崟-->
-    <update id="DeleteOrderWorkMp">
+    <update id="deleteOrderWorkMp">
         update sd.order_detail as od left join sd.order_glass_detail as ogd
             on od.order_id = ogd.order_id and od.order_number = ogd.order_number
         set ogd.production_id=null,
@@ -162,20 +162,20 @@
           and od.product_name = #{productName}
     </update>
 
-    <select id="SelectWorkCount">
+    <select id="selectWorkCount">
         select COUNT(distinct order_number)
         from order_glass_detail
         where ISNULL(production_id)
           and order_id = #{orderId}
     </select>
 
-    <select id="SelectYesWorkCount">
+    <select id="selectYesWorkCount">
         select COUNT(distinct order_number)
         from order_glass_detail
         where  order_id = #{orderId}
     </select>
 
-    <update id="UpdateWorkType">
+    <update id="updateWorkType">
         update sd.order as o set o.production_order=#{state} where o.order_id=#{orderId}
     </update>
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml b/north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml
index 2cc5ab6..9983811 100644
--- a/north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml
+++ b/north-glass-erp/target/classes/mapper/sd/OrderProcessDetail.xml
@@ -10,7 +10,8 @@
                 order_id,
                 order_number,
                 technology_number,
-                process
+                process,
+                process_id
             )
         values
         <foreach collection ="processDetailList" item="processDetail" separator =",">
@@ -18,7 +19,8 @@
              #{processDetail.orderId},
              #{processDetail.orderNumber},
              #{processDetail.technologyNumber},
-             #{processDetail.process}
+             #{processDetail.process},
+              #{processDetail.processId}
              )
         </foreach>
 

--
Gitblit v1.8.0