From aece48b253b2e0b814bbdf5ee3d474e8cf697122 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 18 十二月 2025 16:39:48 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml                               |   65 ++++++++++
 north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue               |  141 +++++++++++++++++++++--
 north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java       |   58 +++++++++
 north-glass-erp/src/main/java/com/example/erp/controller/pp/GlassOptimizeController.java          |    4 
 north-glass-erp/src/main/resources/mapper/pp/Report.xml                                           |   13 +
 north-glass-erp/northglass-erp/src/views/sd/basicData/SearchProcessAttributeConfig.vue            |    6 +
 north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java |   18 +++
 north-glass-erp/northglass-erp/src/views/mm/stockReport/FinishedProductInventoryReport.vue        |    9 
 north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java                  |    7 +
 north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedOperateLogMapper.java             |    9 +
 north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml                             |    2 
 11 files changed, 301 insertions(+), 31 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/mm/stockReport/FinishedProductInventoryReport.vue b/north-glass-erp/northglass-erp/src/views/mm/stockReport/FinishedProductInventoryReport.vue
index 2fc7af0..6d2e7c4 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/stockReport/FinishedProductInventoryReport.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/stockReport/FinishedProductInventoryReport.vue
@@ -1,13 +1,14 @@
 <script setup>
 
-import BasicTable from "@/components/BasicTable.vue"
+import BasicTable from "@/components/BrokenReportTemplate.vue"
 import request from "@/utils/request"
 import { ref} from "vue"
 import { useI18n } from 'vue-i18n'
+import companyInfo from "@/stores/sd/companyInfo";
 
 //璇█鑾峰彇
 const { t } = useI18n()
-
+const company = companyInfo()
 const childrenData = ref({
   columns:[
     {type: 'seq',fixed:"left", title: t('basicData.Number'), width: '80' },
@@ -30,7 +31,7 @@
     {field: 'staterOperationOrderNumber', width: '150',title: t('productStock.staterOperationOrderNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
     {field: 'endOperationOrderNumber', width: '100',title: t('productStock.endOperationOrderNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
     {field: 'operator', width: '100',title: t('productStock.creator'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'operateTime', width:'140', title: t('productStock.productionDate'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'operateTime', width:'140', title: t('productStock.storageTime'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
     {field: 'processId', width:'140', title: t('processCard.processId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
     {field: 'type', width:'140', title: t('productStock.typeClaim'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
     {field: 'reviewed', width: '100',title: t('productStock.reviewed'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
@@ -40,7 +41,7 @@
   ],//琛ㄦ牸琛ㄥご瀛楁
   data:[],//琛ㄦ牸鏁版嵁
   url :'/finishedGoodsInventory/getSelectFinishedOperateLogReport/鍏ュ簱',
-  exportUrl :'/finishedGoodsInventory/exportFinishedOperateLogReport/鍏ュ簱',
+  exportUrl :`/finishedGoodsInventory/exportFinishedOperateLogReportByDatetime/鍏ュ簱`,
   exportName:t('stockReport.finishedProductInventoryReport'),
   footList:['quantity','area','money','squareMillimeter']
 })
diff --git a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue
index 5a9490e..0612cf5 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/OptimizationRect.vue
@@ -989,36 +989,153 @@
     }
     adjustGrayRectangles(layoutIndex);
   } else {
+    // 鏃嬭浆澶辫触锛屾仮澶嶅師濮嬪昂瀵�
     glassDetail.width = originalState.width;
     glassDetail.height = originalState.height;
-    ElMessage.warning('鏃犳硶鏃嬭浆锛屽瓨鍦ㄩ噸鍙犳垨瓒呭嚭杈圭晫');
+
+    // 灏濊瘯鍚戜笂绉诲姩骞舵棆杞�
+    const upResult = tryMoveAndRotate(layoutIndex, rectIndex, 'up');
+    if (!upResult) {
+      ElMessage.warning('鏃犳硶鏃嬭浆锛屽嵆浣跨Щ鍔ㄥ悗浠嶅瓨鍦ㄩ噸鍙犳垨瓒呭嚭杈圭晫');
+    }
   }
+};
+
+// 杈呭姪鏂规硶锛氬皾璇曠Щ鍔ㄥ苟鏃嬭浆
+const tryMoveAndRotate = (layoutIndex, rectIndex, direction) => {
+  // 淇濆瓨鍘熷鐘舵��
+  const layout = layouts.value[layoutIndex];
+  const glassDetail = layout.glassDetails[rectIndex];
+  const originalPosition = {
+    x: glassDetail.x,
+    y: glassDetail.y,
+    width: glassDetail.width,
+    height: glassDetail.height
+  };
+
+  let success = false;
+
+  if (direction === 'up') {
+    // 灏濊瘯鍚戜笂绉诲姩骞舵棆杞�
+    moveRectAndRotate(layoutIndex, rectIndex, 'down');
+
+    // 妫�鏌ユ槸鍚︽垚鍔�
+    const otherRects = layout.glassDetails.filter(r => !r.isRemain && r !== glassDetail);
+    let hasOverlap = false;
+
+    otherRects.forEach(otherRect => {
+      if (checkOverlap(glassDetail, otherRect)) {
+        hasOverlap = true;
+      }
+    });
+
+    if (!hasOverlap &&
+        glassDetail.x + glassDetail.width <= layout.width &&
+        glassDetail.y + glassDetail.height <= layout.height &&
+        glassDetail.x >= 0 && glassDetail.y >= 0) {
+      success = true;
+      // 濡傛灉鍚戜笂绉诲姩骞舵棆杞垚鍔燂紝鍒欏啀鍚戜笅绉诲姩锛岃鐭╁舰闈犺繎搴曢儴
+      moveRect(layoutIndex, rectIndex, 'up');
+    } else {
+      // 鍚戜笂绉诲姩骞舵棆杞け璐ワ紝鎭㈠鍘熷鐘舵��
+      glassDetail.x = originalPosition.x;
+      glassDetail.y = originalPosition.y;
+      glassDetail.width = originalPosition.width;
+      glassDetail.height = originalPosition.height;
+    }
+  } else if (direction === 'down') {
+    // 灏濊瘯鍚戜笅绉诲姩骞舵棆杞�
+    moveRectAndRotate(layoutIndex, rectIndex, 'up');
+
+    // 妫�鏌ユ槸鍚︽垚鍔�
+    const otherRects = layout.glassDetails.filter(r => !r.isRemain && r !== glassDetail);
+    let hasOverlap = false;
+
+    otherRects.forEach(otherRect => {
+      if (checkOverlap(glassDetail, otherRect)) {
+        hasOverlap = true;
+      }
+    });
+
+    if (!hasOverlap &&
+        glassDetail.x + glassDetail.width <= layout.width &&
+        glassDetail.y + glassDetail.height <= layout.height &&
+        glassDetail.x >= 0 && glassDetail.y >= 0) {
+      success = true;
+      // 濡傛灉鍚戜笅绉诲姩骞舵棆杞垚鍔燂紝鍒欏啀鍚戜笂绉诲姩锛岃鐭╁舰闈犺繎椤堕儴
+      moveRect(layoutIndex, rectIndex, 'down');
+    } else {
+      // 鍚戜笅绉诲姩骞舵棆杞け璐ワ紝鎭㈠鍘熷鐘舵��
+      glassDetail.x = originalPosition.x;
+      glassDetail.y = originalPosition.y;
+      glassDetail.width = originalPosition.width;
+      glassDetail.height = originalPosition.height;
+    }
+  }
+
+  return success;
 };
 
 //绉诲姩鏃嬭浆鏂规硶
 const moveRectAndRotate = (layoutIndex, rectIndex, direction) => {
   const layout = layouts.value[layoutIndex];
   const glassDetail = layout.glassDetails[rectIndex];
-  const grayRects = layout.glassDetails.filter(r => r.isRemain);
 
+  // 鍏堢Щ鍔�
+  moveRect(layoutIndex, rectIndex, direction);
+
+  // 鍐嶆棆杞�
+  const originalState = { ...glassDetail };
   const temp = glassDetail.width;
   glassDetail.width = glassDetail.height;
   glassDetail.height = temp;
 
-  const canPlace = grayRects.some(grayRect => {
-    return grayRect.width >= glassDetail.width && grayRect.height >= glassDetail.height;
+  const otherRects = layout.glassDetails.filter(r => !r.isRemain && r !== glassDetail);
+  let isValidRotation = true;
+
+  otherRects.forEach(otherRect => {
+    if (checkOverlap(glassDetail, otherRect)) {
+      isValidRotation = false;
+    }
   });
 
-  if (!canPlace) {
-    const temp = glassDetail.width;
-    glassDetail.width = glassDetail.height;
-    glassDetail.height = temp;
-    ElMessage.warning('鏃犳硶鏃嬭浆锛屾病鏈夎冻澶熺殑绌洪棿');
-    return;
+  if (glassDetail.x + glassDetail.width > layout.width || glassDetail.y + glassDetail.height > layout.height) {
+    isValidRotation = false;
   }
 
-  adjustGrayRectangles(layoutIndex);
-  moveRect(layoutIndex, rectIndex, direction);
+  if (isValidRotation) {
+    // 鏇存柊glassPoint鍧愭爣锛堝鏋滃瓨鍦級
+    if (glassDetail.glassPoint && Array.isArray(glassDetail.glassPoint)) {
+      const originalPoints = JSON.parse(JSON.stringify(glassDetail.glassPoint));
+      glassDetail.glassPoint.forEach((point, index) => {
+        const relX = originalPoints[index].X - originalState.x;
+        const relY = originalPoints[index].Y - originalState.y;
+        point.X = originalState.x + relY;
+        point.Y = originalState.y + (originalState.width - relX);
+        point.X = parseFloat(point.X.toFixed(2));
+        point.Y = parseFloat(point.Y.toFixed(2));
+      });
+    }
+    adjustGrayRectangles(layoutIndex);
+  } else {
+    // 鏃嬭浆澶辫触锛屾仮澶嶅師濮嬪昂瀵稿拰浣嶇疆
+    glassDetail.width = originalState.width;
+    glassDetail.height = originalState.height;
+    // 鎭㈠绉诲姩鍓嶇殑浣嶇疆
+    moveRect(layoutIndex, rectIndex, getReverseDirection(direction));
+    ElMessage.warning('鏃犳硶鏃嬭浆锛屽瓨鍦ㄩ噸鍙犳垨瓒呭嚭杈圭晫');
+  }
+};
+
+// 鑾峰彇鍙嶅悜鏂瑰悜鐨勮緟鍔╁嚱鏁�
+const getReverseDirection = (direction) => {
+  switch (direction) {
+    case 'up': return 'down';
+    case 'down': return 'up';
+    case 'left': return 'right';
+    case 'right': return 'left';
+    default: return direction;
+  }
 };
 
 //绉诲姩鏂规硶
diff --git a/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchProcessAttributeConfig.vue b/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchProcessAttributeConfig.vue
index bdaa1d6..3a088f1 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchProcessAttributeConfig.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchProcessAttributeConfig.vue
@@ -102,6 +102,12 @@
     if ($grid) {
       switch (code) {
         case 'add': {
+          submit.value.glassLevel = [null,null]
+          submit.value.processType = null
+          submit.value.processName = null
+          submit.value.inputType = null
+          submit.value.id = null
+          rowIndex.value = null
           dialogTableVisible.value = true
           break
         }
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java b/north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java
index a5df64c..6191b4e 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java
@@ -23,6 +23,7 @@
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
 
@@ -169,6 +170,14 @@
         return Result.success(finishedGoodsInventoryService.getSelectFinishedOperateLogReport(type,pageNum,pageSize,selectDate,finishedOperateLog));
     }
 
+    @ApiOperation("鎴愬搧搴撳瓨璁板綍鏌ヨ鎺ュ彛鏃ユ湡鏃堕棿鏌ヨ")
+    @SaCheckPermission("warehouseReport.search")
+    @PostMapping("/getSelectFinishedOperateLogReport/{type}/{pageNum}/{pageSize}/{selectDate}/{reportTime}")
+    public Result getSelectFinishedOperateLogReportByDatetime(@PathVariable String type,@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate,@PathVariable String reportTime, @RequestBody FinishedOperateLog finishedOperateLog){
+        return Result.success(finishedGoodsInventoryService.getSelectFinishedOperateLogReportByDateTime(type,pageNum,pageSize,selectDate,reportTime,finishedOperateLog));
+    }
+
+
     @ApiOperation("鎴愬搧鎶ヨ〃瀵煎嚭")
     @PostMapping("/exportFinishedOperateLogReport/{type}")
     public void exportFinishedOperateLogReport(@PathVariable String type,HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException {
@@ -176,6 +185,15 @@
         DownExcel.download(response, FinishedOperateLogDTO.class, finishedGoodsInventoryService.exportFinishedOperateLogReport(dates,type),"orderReport");
     }
 
+    @ApiOperation("鎴愬搧鎶ヨ〃瀵煎嚭鏃ユ湡鏃堕棿")
+    @PostMapping("/exportFinishedOperateLogReportByDatetime/{type}")
+    public void exportFinishedOperateLogReportByDatetime(
+            @PathVariable String type,HttpServletResponse response,
+            @RequestBody List<String> dates) throws IOException, IllegalAccessException, InstantiationException {
+        //鍙傛暟锛氱浉搴旂殑鏁版嵁锛屽疄浣撶被淇℃伅锛岀浉搴旂殑鏂规硶锛堟暟鎹幏鍙栵級锛岀敓鎴愮殑excel鍚嶅瓧
+        DownExcel.download(response, FinishedOperateLogDTO.class, finishedGoodsInventoryService.exportFinishedOperateLogReportByDatetime(dates,type),"orderReport");
+    }
+
 
     /*璁㈠崟涓�閿叆搴�*/
     @ApiOperation("璁㈠崟涓�閿叆搴�")
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/GlassOptimizeController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/GlassOptimizeController.java
index 0ff4649..3ab6258 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/GlassOptimizeController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/GlassOptimizeController.java
@@ -228,7 +228,7 @@
     }
 
 
-    @PostMapping("/calculate")
+    @PostMapping("/mesCalculate")
     public ResponseEntity<Map<String, Object>> receiveOptimizeRequest(
             @RequestBody Map<String, Object> requestData) {
 
@@ -240,7 +240,7 @@
             response.put("msg", "success");
             response.put("data", "");
 
-            // 寮傛澶勭悊璁$畻浠诲姟
+            // todo 寮傛澶勭悊璁$畻浠诲姟
 //            glassOptimizeService.processExternalOptimizeRequest(requestData);
             System.out.println(requestData);
 
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedOperateLogMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedOperateLogMapper.java
index 5081ca8..8617b71 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedOperateLogMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedOperateLogMapper.java
@@ -80,14 +80,17 @@
 
     List<FinishedOperateLog> getSelectFinishedOperateLogReport(@Param("offset") Integer offset,
                                              @Param("pageSize") Integer pageSize,String startDate, String endDate,
-                                             @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog,String type);
+                                             @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog,String type,
+                                             @Param("dateType")  String dateType);
 
     Map<String,Integer> getSelectFinishedOperateLogReportPageTotal(@Param("offset") Integer offset,
                                                            @Param("pageSize") Integer pageSize,String startDate, String endDate,
-                                                           @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog,String type);
+                                                           @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog,
+                                                                   String type,
+                                                           @Param("dateType") String dateType);
 
     List<FinishedOperateLogDTO> exportFinishedOperateLogReport(List<LocalDate> dates,String type);
-
+    List<FinishedOperateLogDTO> exportFinishedOperateLogReportByDatetime(List<String> dates,String type);
     Boolean insertOrderFinishedOperateLog(@Param("orderDetail") OrderDetail orderDetail,@Param("userName") String userName,
                                           @Param("oddNumber") String oddNumber,@Param("processId") String processId);
 
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 2acd2f1..1e14ce1 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
@@ -12,7 +12,12 @@
 public interface ReportingWorkMapper extends MPJBaseMapper<ReportingWork> {
 
 
-    ReportingWork AddSelectLastWorkMp(String processIdStr, String technologyStr, String previousProcess, String nextProcess, String process, String reportType);
+    ReportingWork AddSelectLastWorkMp(String processIdStr,
+                                      String technologyStr,
+                                      String previousProcess,
+                                      String nextProcess,
+                                      String process,
+                                      String reportType);
 
     List<BasicDataProduce> SelectWorkBasicDeviceMp(String process);
 
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java b/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
index 478ac43..bdeadde 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
@@ -38,6 +38,8 @@
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 
 @Service
@@ -702,8 +704,8 @@
         }
 
         Map<String, Object> map = new HashMap<>();
-        map.put("data", finishedOperateLogMapper.getSelectFinishedOperateLogReport(offset, pageSize,startDate, endDate, finishedOperateLog,type));
-        map.put("total", finishedOperateLogMapper.getSelectFinishedOperateLogReportPageTotal(offset, pageSize,startDate, endDate, finishedOperateLog,type));
+        map.put("data", finishedOperateLogMapper.getSelectFinishedOperateLogReport(offset, pageSize,startDate, endDate, finishedOperateLog,type,"date"));
+        map.put("total", finishedOperateLogMapper.getSelectFinishedOperateLogReportPageTotal(offset, pageSize,startDate, endDate, finishedOperateLog,type,"date"));
         List<String> list = new ArrayList<>();
         list.add(startDate);
         list.add(endDate);
@@ -1463,4 +1465,56 @@
 
         return map;
     }
+
+    public Map<String, Object> getSelectFinishedOperateLogReportByDateTime(String type, Integer pageNum, Integer pageSize, List<String> selectDate, String reportTime, FinishedOperateLog finishedOperateLog) {
+        Integer offset = (pageNum-1)*pageSize;
+        String startDate = toReportTime(LocalDate.now().minusDays(7).toString(), reportTime);
+        String endDate   = toReportTime(LocalDate.now().toString(), reportTime);
+
+        // 濡傛灉鍓嶇浼犱簡鏃堕棿锛屽氨鐢ㄥ墠绔棩鏈� + reportTime
+        if (selectDate != null && selectDate.size() == 2) {
+            if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) {
+                startDate = toReportTime(selectDate.get(0), reportTime);
+            }
+            if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) {
+                endDate = toReportTime(selectDate.get(1), reportTime);
+            }
+        }
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", finishedOperateLogMapper.getSelectFinishedOperateLogReport(offset, pageSize,startDate, endDate, finishedOperateLog,type,"datetime"));
+        map.put("total", finishedOperateLogMapper.getSelectFinishedOperateLogReportPageTotal(offset, pageSize,startDate, endDate, finishedOperateLog,type,"datetime"));
+        List<String> list = new ArrayList<>();
+        list.add(startDate);
+        list.add(endDate);
+        map.put("selectDate",list);
+        return map;
+    }
+
+    private static final DateTimeFormatter DATE_TIME_FMT =
+            DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+    private String toReportTime(String dateStr, String reportTime) {
+        if (dateStr == null || dateStr.isEmpty()) {
+            return null;
+        }
+
+        // 鍙繚鐣� yyyy-MM-dd锛岄槻姝㈠墠绔紶瀹屾暣鏃堕棿瀵艰嚧 parse 寮傚父
+        String onlyDate = dateStr.length() > 10 ? dateStr.substring(0, 10) : dateStr;
+
+
+        String[] parts = reportTime.split(":");
+        int hour   = Integer.parseInt(parts[0]);
+        int minute = parts.length > 1 ? Integer.parseInt(parts[1]) : 0;
+        int second = parts.length > 2 ? Integer.parseInt(parts[2]) : 0;
+
+        LocalDate date = LocalDate.parse(onlyDate);
+        LocalTime time = LocalTime.of(hour, minute, second);
+
+        return LocalDateTime.of(date, time).format(DATE_TIME_FMT);
+    }
+
+    public List<FinishedOperateLogDTO>  exportFinishedOperateLogReportByDatetime(List<String> dates, String type) {
+        return finishedOperateLogMapper.exportFinishedOperateLogReportByDatetime(dates,type);
+    }
 }
diff --git a/north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml b/north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml
index 20752c8..4607863 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/FinishedOperateLog.xml
@@ -518,7 +518,14 @@
         left join sd.`order` o on o.order_id=fol.order_id
         left join sd.product p on p.id=od.product_id
         <where>
-            date(fol.operate_time)>=#{startDate} and date(fol.operate_time) &lt;= #{endDate} and fol.operate_type=#{type}
+            <if test="dateType=='date'">
+                date(fol.operate_time)>=#{startDate} and date(fol.operate_time) &lt;= #{endDate}
+            </if>
+            <if test="dateType=='datetime'">
+                fol.operate_time>=#{startDate} and fol.operate_time &lt;= #{endDate}
+            </if>
+            and fol.operate_type=#{type}
+
             <if test="finishedOperateLog.operateType != null and finishedOperateLog.operateType != ''">
                 and fol.operate_type regexp #{finishedOperateLog.operateType}
             </if>
@@ -599,7 +606,15 @@
         left join sd.`order` o on o.order_id=fol.order_id
         left join sd.product p on p.id=od.product_id
         <where>
-            date(fol.operate_time)>=#{startDate} and date(fol.operate_time) &lt;= #{endDate} and fol.operate_type=#{type}
+            <if test="dateType=='date'">
+                date(fol.operate_time)>=#{startDate} and date(fol.operate_time) &lt;= #{endDate}
+            </if>
+            <if test="dateType=='datetime'">
+                fol.operate_time>=#{startDate} and fol.operate_time &lt;= #{endDate}
+            </if>
+            and fol.operate_type=#{type}
+
+
             <if test="finishedOperateLog.operateType != null and finishedOperateLog.operateType != ''">
                 and fol.operate_type regexp #{finishedOperateLog.operateType}
             </if>
@@ -817,7 +832,51 @@
                  left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
                  left join sd.`order` o on o.order_id=fol.order_id
                  left join sd.product p on p.id=od.product_id
-        where  date(fol.operate_time)>=#{dates[0]} and date(fol.operate_time) &lt;= #{dates[1]} and fol.operate_type=#{type}
+        where
+                date(fol.operate_time)>=#{dates[0]} and date(fol.operate_time) &lt;= #{dates[1]}
+
+          and fol.operate_type=#{type}
+
+    </select>
+
+    <select id="exportFinishedOperateLogReportByDatetime">
+        select fol.id,
+               fol.operation_order_number,
+               fol.order_id,
+               fol.operate_type,
+               fol.process_id,
+               fol.operation_number,
+               fol.quantity,
+               fol.operator,
+               od.product_id,
+               od.product_name,
+               od.width,
+               od.height,
+               fol.stater_operation_order_number,
+               fol.end_operation_order_number,
+               fol.operate_time,
+               fol.`status`,
+               fol.is_state,
+               fol.reviewed,
+               fol.reviewed_time,
+               fol.type,
+               fol.remarks,
+               fol.area,
+               fol.money,
+               o.customer_name,
+               o.project,
+               od.price,
+               o.order_type,
+               p.thickness * fol.area as square_millimeter
+        from (select *
+              from mm.finished_operate_log aa where  aa.status!='宸蹭綔搴�') fol
+                 left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number
+                 left join sd.`order` o on o.order_id=fol.order_id
+                 left join sd.product p on p.id=od.product_id
+        where
+            fol.operate_time>=#{dates[0]} and fol.operate_time &lt;= #{dates[1]}
+
+          and fol.operate_type=#{type}
 
     </select>
 
diff --git a/north-glass-erp/src/main/resources/mapper/pp/Report.xml b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
index 59f0137..c00dc2c 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/Report.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -3460,8 +3460,13 @@
                  SELECT g.*
                       ,GROUP_CONCAT(g.glass_child SEPARATOR '+')  as childName
                  from( SELECT f.*,
-        e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num as quantity,
-        (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num)*f.area as glassArea
+        if((e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity)>0,
+        (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity),
+            0
+            ) as quantity,
+        if((e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity)>0,
+        (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity)  ,
+            0)*f.area as glassArea
                        from (SELECT a.order_id,
                                    if(a.batch!="",CONCAT(a.project,'(',a.batch,')'),a.project) as project,
                                     C.product_id,
@@ -3474,7 +3479,8 @@
                                     b.id,
                                     c.area,
                                     d.glass_child,
-                                    ifnull(cb.patchNumSum,0) as patchNumSum
+                                    ifnull(cb.patchNumSum,0) as patchNumSum,
+                                    fc.termination_quantity
 
                              FROM sd.`order` as a
                                       LEFT JOIN sd.order_process_detail as b
@@ -3536,6 +3542,7 @@
 
 
              ) as h
+        where h.quantity >0
         <choose>
             <when test="optionVal == 1">
                 GROUP BY thisProcess
diff --git a/north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml
index fe2c744..6990e4b 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml
@@ -91,7 +91,7 @@
             process_attribute_config as a
         set a.process_type = #{processAttributeConfig.processType},
             a.process_name = #{processAttributeConfig.processName},
-            a.input_type = #{processAttributeConfig.inputType},
+            a.input_type = #{processAttributeConfig.inputType}
         where a.id = #{processAttributeConfig.id}
     </update>
 

--
Gitblit v1.8.0