From 350e05dc3d4e08e0a2f9056e512275714d325181 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 10 七月 2024 17:20:31 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java          |    4 
 north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue                     |    2 
 north-glass-erp/northglass-erp/src/lang/zh.js                                               |    3 
 north-glass-erp/src/main/java/com/example/erp/service/userInfo/LogService.java              |   24 ++++
 north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue                   |    4 
 north-glass-erp/src/main/java/com/example/erp/entity/userInfo/Log.java                      |   16 +++
 north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet5.vue                      |   14 +-
 north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java   |    3 
 north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue                   |   37 +++---
 north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/LogMapper.java                |    9 +
 north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet2.vue                      |    2 
 north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue                           |   40 ++++++++
 north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java |   32 ++++--
 north-glass-erp/src/main/resources/application.yml                                          |    5 +
 north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue                    |    8 +
 north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue                      |   20 ++--
 north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue                       |    2 
 north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java               |    7 
 north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml                     |    9 +
 19 files changed, 180 insertions(+), 61 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue
index 5db92a2..5824665 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue
@@ -97,7 +97,7 @@
     <table >
       <thead>
       <tr class="title-s">
-        <th colspan="13">
+        <th colspan="9">
           <h1>
             {{company.companyName}}
           </h1>
@@ -131,7 +131,7 @@
               <tr v-if="index===0">
                 <th style="width: 6%;">搴忓彿</th>
                 <th style="width: 20%;">妤煎眰缂栧彿</th>
-                <th style="width: 20%;" colspan="2">瀹絏楂�</th>
+                <th style="width: 20%;" colspan="1">瀹絏楂�</th>
                 <th style="width: 10%;">鏁伴噺</th>
                 <th style="width: 10%;">闈㈢Н</th>
                 <th style="width: 10%;">鍗曚环</th>
@@ -139,17 +139,18 @@
                 <th style="width: 12%;" colspan="2">鍔犲伐瑕佹眰</th>
               </tr>
 
+
+              </thead>
               <tr>
                 <td style="font-size: 15px;text-align: left" colspan="4">浜у搧鍚嶇О:<span>{{item.DeliveryDetail.orderDetail.productName}}</span></td>
-                <td style="font-size: 15px;text-align: left" colspan="3">瀵规柟鍗曞彿:</td>
+                <td style="font-size: 15px;text-align: left" colspan="2">瀵规柟鍗曞彿:</td>
                 <td style="font-size: 15px;text-align: left" colspan="3">璁㈠崟缂栧彿:<span>{{item.DeliveryDetail.orderDetail.orderId}}</span></td>
               </tr>
-              </thead>
 
               <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1">
                 <td>{{items.order_number}}</td>
                 <td>{{items.buildingNumber}}</td>
-                <td colspan="2" style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td>
+                <td colspan="1" style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td>
                 <td>{{items.quantity}}</td>
                 <td>{{items.area}}</td>
                 <td>{{items.price}}</td>
@@ -157,22 +158,22 @@
                 <td colspan="2">{{items.processingNote}}</td>
               </tr>
               <tr class="day-in" >
-                <td style="font-size: 15px;" colspan="4">灏忚:</td>
+                <td style="font-size: 15px;" colspan="3">灏忚:</td>
                 <td>{{item.DeliveryDetail.quantity}}</td>
                 <td>{{item.DeliveryDetail.area}}</td>
                 <td></td>
                 <td>{{item.DeliveryDetail.money}}</td>
-                <td></td>
+                <td colspan="2"></td>
               </tr>
 
             </template>
             <tr class="day-in">
-              <td style="font-size: 15px;" colspan="4">鍚堣:</td>
+              <td style="font-size: 15px;" colspan="3">鍚堣:</td>
               <td>{{delivery.quantity}}</td>
               <td>{{delivery.area}}</td>
               <td></td>
               <td>{{delivery.money-otherMoneys-delivery.freight}}</td>
-              <td></td>
+              <td colspan="2"></td>
             </tr>
             <tr class="day-in">
               <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="4">
@@ -405,9 +406,6 @@
 
 
 <style scoped>
-#child{
-  margin-top: 20px;
-}
 h1,h3{
   left:0;
   right:0;
@@ -420,6 +418,7 @@
 }
 h3{
   font-size: 1.2rem;
+  font-weight: bolder;
 }
 
 
@@ -442,6 +441,13 @@
 .title-s,.title-s th{
   border:0
 }
+
+.hr-border{
+  height: 2px;
+  width: 100%;
+  background-color: black;
+  color: black;
+}
 table {
   border-collapse: collapse;
   width: 100%;
@@ -450,13 +456,6 @@
 td > table {
   margin: 0;
   padding: 0;
-}
-
-.hr-border{
-  height: 2px;
-  width: 100%;
-  background-color: black;
-  color: black;
 }
 @page {
   size: auto;
diff --git a/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue
index 74eb605..70d9be6 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue
@@ -223,9 +223,7 @@
 
 
 <style scoped>
-#child{
-  margin-top: 20px;
-}
+
 h1,h3{
   left:0;
   right:0;
diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet2.vue b/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet2.vue
index bac71f4..4c9d9bc 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet2.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet2.vue
@@ -98,7 +98,7 @@
 
       <tr class="title-s" >
         <th colspan="17">
-          <h3>鐜荤拑鍔犲伐鍗�</h3>
+          <h3>鐜荤拑鍔犲伐鍗�({{data.order.orderType}})</h3>
         </th>
       </tr>
       <tr>
diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue b/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue
index 53fba6d..985ba4c 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue
@@ -133,7 +133,7 @@
     <table style="border-style: none;" >
       <thead>
       <tr class="title-s">
-        <th colspan="13">
+        <th colspan="9">
           <h1>
             {{ company.companyName }}
           </h1>
@@ -171,10 +171,10 @@
               <tr v-if="index===0">
                 <th style="width: 6%;font-weight: bold;">搴�</th>
                 <th style="width: 15%;font-weight: bold;" >妤煎眰缂栧彿</th>
-                <th style="width: 20%;font-weight: bold;" colspan="2">瀹絏楂�</th>
-                <th style="width: 10%;font-weight: bold;">鏁伴噺</th>
-                <th style="width: 10%;font-weight: bold;">闈㈢Н</th>
-                <th style="width: 17%;font-weight: bold;" colspan="3">鍔犲伐瑕佹眰</th>
+                <th style="width: 20%;font-weight: bold;" colspan="3">瀹絏楂�</th>
+                <th style="width: 12%;font-weight: bold;">鏁伴噺</th>
+                <th style="width: 12%;font-weight: bold;">闈㈢Н</th>
+                <th style="width: 17%;font-weight: bold;" colspan="2">鍔犲伐瑕佹眰</th>
               </tr>
 
 
@@ -188,14 +188,14 @@
               <tr class="day-in" v-for="(items, index1) in item.productDetail" :key="index1">
                 <td>{{items.orderNumber}}</td>
                 <td>{{items.buildingNumber}}</td>
-                <td colspan="2" style="font-size: 15px;font-weight: bold;" v-if="items.otherColumns?.S02">{{items.otherColumns?.S02}}</td>
-                <td colspan="2" style="font-size: 15px;font-weight: bold;" v-else>{{items.width}}x{{items.height}}</td>
+                <td colspan="3" style="font-size: 15px;font-weight: bold;" v-if="items.otherColumns?.S02">{{items.otherColumns?.S02}}</td>
+                <td colspan="3" style="font-size: 15px;font-weight: bold;" v-else>{{items.width}}x{{items.height}}</td>
                 <td>{{items.quantity}}</td>
                 <td>{{items.grossArea.toFixed(2)}}</td>
                 <td colspan="2">{{items.processingNote}}</td>
               </tr>
               <tr class="day-in" >
-                <td style="font-size: 15px;font-weight: bold;" colspan="4">灏忚:</td>
+                <td style="font-size: 15px;font-weight: bold;" colspan="5">灏忚:</td>
                 <td>{{getQuantity(item.productDetail)}}</td>
                 <td>{{getArea(item.productDetail)}}</td>
                 <td colspan="2"></td>
@@ -203,10 +203,10 @@
 
             </template>
             <tr class="day-in">
-              <td style="font-size: 15px;font-weight: bold;" colspan="4">鍚堣:</td>
+              <td style="font-size: 15px;font-weight: bold;" colspan="5">鍚堣:</td>
               <td>{{grossNum.quantity}}</td>
               <td>{{grossNum.grossArea}}</td>
-              <td colspan="3"></td>
+              <td colspan="2"></td>
             </tr>
             <tr class="day-in">
               <td style="text-align: left;border-width: 0 0 0 0; border-style: solid; border-color: #d3dce6" colspan="9">
diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet5.vue b/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet5.vue
index d845417..98948e9 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet5.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet5.vue
@@ -140,7 +140,7 @@
     <table style="border-style: none;" >
       <thead>
       <tr class="title-s">
-        <th colspan="13">
+        <th colspan="9">
           <h1>
             {{ company.companyName }}
           </h1>
@@ -178,8 +178,8 @@
               <tr v-if="index===0">
                 <th style="width: 6%;font-weight: bold;">搴�</th>
                 <th style="width: 10%;font-weight: bold;" >妤煎眰缂栧彿</th>
-                <th style="width: 20%;font-weight: bold;" colspan="1">瀹�(寮ч暱)X楂�</th>
-                <th style="width: 20%;font-weight: bold;" colspan="2">鍒囧壊瀹�(寮ч暱)*楂�</th>
+                <th style="width: 15%;font-weight: bold;" colspan="1">瀹�(寮ч暱)X楂�</th>
+                <th style="width: 20%;font-weight: bold;" colspan="1">鍒囧壊瀹�(寮ч暱)*楂�</th>
                 <th style="width: 10%;font-weight: bold;">鏁伴噺</th>
                 <th style="width: 10%;font-weight: bold;">闈㈢Н</th>
                 <th style="width: 10%;font-weight: bold;">鍛ㄩ暱</th>
@@ -204,14 +204,14 @@
                   <td>{{items2.order_number}}/{{items2.technology_number}}</td>
                   <td>{{items2.building_number}}</td>
                   <td colspan="1" style="font-size: 15px;font-weight: bold;" >{{items2.width}}x{{items2.height}}</td>
-                  <td colspan="2" style="font-size: 15px;font-weight: bold;" >{{items2.child_width}}x{{items2.child_height}}/R={{items2.bend_radius}}</td>
+                  <td colspan="1" style="font-size: 15px;font-weight: bold;" >{{items2.child_width}}x{{items2.child_height}}/R={{items2.bend_radius}}</td>
                   <td>{{items2.quantity}}</td>
                   <td>{{items2.gross_area.toFixed(2)}}</td>
                   <td>{{parseFloat(items2.perimeter).toFixed(2)}}</td>
                   <td colspan="2">{{items2.processing_note}}</td>
                 </tr>
                 <tr class="day-in" >
-                  <td style="font-size: 15px;font-weight: bold;" colspan="5">灏忚:</td>
+                  <td style="font-size: 15px;font-weight: bold;" colspan="4">灏忚:</td>
                   <td>{{getQuantity(items.orderGlassDetails)}}</td>
                   <td>{{getArea(items.orderGlassDetails)}}</td>
                   <td>{{getPerimeter(items.orderGlassDetails)}}</td>
@@ -222,11 +222,11 @@
 
             </template>
             <tr class="day-in">
-              <td style="font-size: 15px;font-weight: bold;" colspan="5">鍚堣:</td>
+              <td style="font-size: 15px;font-weight: bold;" colspan="4">鍚堣:</td>
               <td>{{grossNum.quantity}}</td>
               <td>{{grossNum.grossArea}}</td>
               <td>{{grossNum.perimeter}}</td>
-              <td colspan="3"></td>
+              <td colspan="2"></td>
             </tr>
             <tr class="day-in">
               <td style="text-align: left;border-width: 0 0 0 0; border-style: solid; border-color: #d3dce6" colspan="9">
diff --git a/north-glass-erp/northglass-erp/src/lang/zh.js b/north-glass-erp/northglass-erp/src/lang/zh.js
index 0f7ab4f..a8be43c 100644
--- a/north-glass-erp/northglass-erp/src/lang/zh.js
+++ b/north-glass-erp/northglass-erp/src/lang/zh.js
@@ -57,6 +57,9 @@
         print:'鎵撳嵃',
         export:'瀵煎嚭',
         empty:'娓呯┖',
+
+        incrementalAll:'涔嬪悗閫掑',
+        incrementalChecked:'閫変腑閫掑',
         msg:{
             max255:"鏈�澶氳緭鍏�255涓瓧绗�",
             range99999Dec2:
diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue
index f65d83b..a1aef65 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/CreateDelivery.vue
@@ -162,7 +162,7 @@
         titleUploadData.value.paymentTerms = titleSelectJson.value.paymentTerms[0].basicName
         titleUploadData.value.payMethod = titleSelectJson.value.payMethod[0].basicName
         const today = new Date
-        today.setTime(today.getTime() + (15 * 24 * 60 * 60 * 1000))
+        today.setTime(today.getTime() )
         titleUploadData.value.deliveryDate=today.getFullYear() +
             '-' + ("0" + (today.getMonth() + 1)).slice(-2)
             + '-' + ("0" + today.getDate()).slice(-2)
diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
index 058fa8f..44f5408 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectOrderList.vue
@@ -254,7 +254,12 @@
           const projectArray=[];
           for (let i=0;i<selectRecords.length;i++){
             customerIdArray.push(selectRecords[i].customerId)
-            projectArray.push(selectRecords[i].project)
+            if(selectRecords[i].project.trim.length===0){
+              projectArray.push(selectRecords[i].project.trim)
+            }else{
+              projectArray.push(selectRecords[i].project)
+            }
+
             if(i+1===selectRecords.length){
               order_id+=selectRecords[i].orderId
             }else{
@@ -267,6 +272,7 @@
             return
           }
           //鍒ゆ柇鎵�閫夐」鐩槸鍚︾浉鍚�
+          console.log(projectArray)
           if(!isAllEqual(projectArray)){
             ElMessage.warning(t('delivery.pleaseSelectTheSameCustomerProject'))
             return
diff --git a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
index 00bada2..43a9e75 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -107,6 +107,8 @@
           { code: 'copyAll', name: t('basicData.sameAfterwards'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false },
           { code: 'clearChecked', name: t('basicData.clearSelection'), prefixIcon: 'vxe-icon-indicator', visible: true, disabled: false },
           { code: 'computedMoney', name: t('basicData.calculateAmount'), prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: true },
+          { code: 'incrementalAll', name: t('basicData.incrementalAll'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false },
+          { code: 'incrementalChecked', name: t('basicData.incrementalChecked'), prefixIcon: 'vxe-icon-copy', visible: true, disabled: false },
           { code: 'errorArea', name: t('basicData.errorSettlementArea'), prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false },
           { code: 'otherMoney', name: t('basicData.otherAmounts'), prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false },
           { code: 'sizeCheck', name: t('basicData.sizeReview'), prefixIcon: 'vxe-icon-eye-fill', visible: true, disabled: false }
@@ -597,6 +599,43 @@
           sizeCheckVisible.value=true
           break
         }
+        case 'incrementalAll' :{
+          let result = toolbarButtonClickEvent()
+          if(result){
+            const dataList = xGrid.value.getTableData().visibleData
+            const val = getNestedProperty(dataList[result.start],result.cell)
+            let numbers = parseInt(val.match(/(\d+)$/))
+            const string=val.replace(/\d+$/, '')
+            dataList.forEach((item,index) =>{
+              if(index>=result.start ){
+                setNestedValue(item,result.cell,string+numbers)
+                numbers=numbers+1
+              }
+
+            })
+
+          }
+          gridOptions.menuConfig.body.options[0][5].disabled=false
+          break
+        }
+        case 'incrementalChecked' : {
+          let result = toolbarButtonClickEvent()
+          if (result) {
+            const dataList = xGrid.value.getTableData().visibleData
+            const val = getNestedProperty(dataList[result.start], result.cell)
+            let numbers = parseInt(val.match(/(\d+)$/))
+            const string=val.replace(/\d+$/, '')
+            dataList.forEach((item, index) => {
+              if (index >= result.start && index <= result.end) {
+                setNestedValue(item, result.cell, string + numbers)
+                numbers = numbers + 1
+              }
+            })
+
+          }
+          gridOptions.menuConfig.body.options[0][5].disabled = false
+          break
+        }
       }
     }
   },
@@ -1052,6 +1091,7 @@
   lastObj[lastKey] = value;
 }
 
+
 //琛屽崟鍏冩牸淇敼淇敼瑙﹀彂姝や簨浠�
 const editClosedEvent = ({ row, column }) => {
   //鍒ゆ柇淇敼鐩稿簲鐨勬暟鍊间慨鏀归潰绉笌閲戦
diff --git a/north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue b/north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue
index 8f77d77..b42861b 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue
@@ -158,7 +158,7 @@
       request.post(`/product/deleteProductById/${row.id}`).then((res) => {
         if(res.code==200){
           router.push({path:"/main/product/selectProduct",query:{random:Math.random()}})
-          ElMessage.success(t('basicData.deleteSuccess'))
+          ElMessage.success(t('basicData.msg.deleteSuccess'))
         }
       }).catch((err) => {
         if(err==="600")ElMessage.warning(t('product.msg.theProductHasBeenReviewedAndCannotBeDeleted'))
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
index 431e698..9afabf1 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
@@ -31,7 +31,7 @@
         return Result.seccess(productService.defaultDateProduct(pageNum,pageSize,glassType,product));
     }
     @ApiOperation("浜у搧淇濆瓨鎺ュ彛")
-    @SaCheckPermission("selectProduct.add")
+    @SaCheckPermission("createProduct.add")
     @PostMapping("/saveProduct")
     public Result saveProduct(@RequestBody Map<String,Object> product){
         return Result.seccess(productService.saveProduct(product));
@@ -44,7 +44,7 @@
     }
 
     @ApiOperation("浜у搧瀹℃牳鐘舵�佷慨鏀规帴鍙�")
-    @SaCheckPermission("selectProduct.review")
+    @SaCheckPermission("createProduct.review")
     @PostMapping("/updateProductStateById/{id}/{state}")
     public Result updateProductStateById(@PathVariable Integer id,@PathVariable Integer state){
         return Result.seccess(productService.updateProductStateById(id,state));
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/userInfo/Log.java b/north-glass-erp/src/main/java/com/example/erp/entity/userInfo/Log.java
new file mode 100644
index 0000000..e134c7c
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/userInfo/Log.java
@@ -0,0 +1,16 @@
+package com.example.erp.entity.userInfo;
+
+import lombok.Data;
+
+import java.time.LocalDate;
+
+@Data
+public class Log {
+    private String id;
+    private String operatorId;
+    private String operator;
+    private String content;
+    private String function;
+    private LocalDate createTime;
+
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java
index b25418b..dc70753 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java
@@ -35,6 +35,9 @@
     Integer findOrderNumberdcount(@Param("orderId") String orderId,
                                   @Param("orderNumber") Integer orderNumber);
 
+    FinishedGoodsInventory findOrderNumberd(@Param("orderId") String orderId,
+                                  @Param("orderNumber") Integer orderNumber);
+
     Integer finishedGoodsInventorybycount(@Param("orderId") String orderId,
                                   @Param("orderNumber") Integer orderNumber);
 
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/LogMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/LogMapper.java
new file mode 100644
index 0000000..33e3749
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/LogMapper.java
@@ -0,0 +1,9 @@
+package com.example.erp.mapper.userInfo;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.erp.entity.userInfo.Log;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface LogMapper extends BaseMapper<Log> {
+}
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 712dcf6..bf83d60 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
@@ -3,6 +3,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.QueryWrapper;
 import com.example.erp.dto.mm.FinishedOperateLogDTO;
 import com.example.erp.entity.mm.FinishedGoodsInventory;
 import com.example.erp.entity.mm.FinishedOperateLog;
@@ -14,6 +15,7 @@
 import com.example.erp.mapper.mm.FinishedGoodsInventoryMapper;
 import com.example.erp.mapper.mm.FinishedOperateLogMapper;
 import com.example.erp.mapper.sd.OrderDetailMapper;
+import com.example.erp.mapper.sd.OrderMapper;
 import com.example.erp.service.userInfo.SysErrorService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -21,6 +23,7 @@
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import java.sql.SQLException;
+import java.sql.Wrapper;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.util.*;
@@ -37,6 +40,8 @@
     BasicWarehouseTypeMapper basicWarehouseTypeMapper;
     @Autowired
     OrderDetailMapper orderDetailMapper;
+    @Autowired
+    OrderMapper orderMapper;
     @Autowired
     SysErrorService sysErrorService;
 
@@ -688,20 +693,23 @@
         Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
         try {
             String oddNumber= orderNumberSetting("鍏ュ簱");
-            List<OrderDetail> orderDetailList=finishedGoodsInventoryMapper.getSelectOrderDetail(orderId);
-            for (OrderDetail orderDetail:orderDetailList){
-                Integer finishedGoodsInventoryCount = finishedGoodsInventoryMapper.findOrderNumberdcount(orderDetail.getOrderId(),orderDetail.getOrderNumber());
-                System.out.println(finishedGoodsInventoryCount);
-                if(finishedGoodsInventoryCount>0){
-                    //淇敼搴撳瓨琛ㄥ叆搴撴暟閲�
-                    finishedGoodsInventoryMapper.updateOrderInventory(orderDetail);
-                }else{
-                    finishedGoodsInventoryMapper.insertOrderFinishedGoodsInventory(orderDetail);
+            Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",orderId));
+            if(order.getWarehousing()==0){
+                List<OrderDetail> orderDetailList=finishedGoodsInventoryMapper.getSelectOrderDetail(orderId);
+                for (OrderDetail orderDetail:orderDetailList){
+                    FinishedGoodsInventory finishedGoodsInventory = finishedGoodsInventoryMapper.findOrderNumberd(orderDetail.getOrderId(),orderDetail.getOrderNumber());
+                    if(finishedGoodsInventory!=null){
+                        //淇敼搴撳瓨琛ㄥ叆搴撴暟閲�
+                        finishedGoodsInventoryMapper.updateOrderInventory(orderDetail);
+                    }else{
+                        finishedGoodsInventoryMapper.insertOrderFinishedGoodsInventory(orderDetail);
+                    }
+                    finishedOperateLogMapper.insertOrderFinishedOperateLog(orderDetail,userName,oddNumber);
+                    finishedGoodsInventoryMapper.updateIntOrderNumberConut(orderDetail.getOrderId(),orderDetail.getOrderNumber(),Integer.parseInt(orderDetail.getQuantity().toString()));
                 }
-                finishedOperateLogMapper.insertOrderFinishedOperateLog(orderDetail,userName,oddNumber);
-                finishedGoodsInventoryMapper.updateIntOrderNumberConut(orderDetail.getOrderId(),orderDetail.getOrderNumber(),Integer.parseInt(orderDetail.getQuantity().toString()));
+                finishedGoodsInventoryMapper.updateOrderWarehousingState(orderId,2);
             }
-            finishedGoodsInventoryMapper.updateOrderWarehousingState(orderId,2);
+
 
         } catch (Exception e) {
             TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
index 1ada0f3..3cf1515 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
@@ -234,11 +234,12 @@
                     }
                     double deliveryDetailMoney = 0.0;
                     if (calculateType==1){
-                        deliveryDetailMoney=Double.valueOf(String.format("%.2f",orderDetail.getComputeArea()
-                                *orderDetail.getDeliveryDetail().getQuantity()*orderDetail.getPrice()));
+                        deliveryDetailMoney=Double.valueOf(String.format("%.2f",Double.valueOf(
+                                String.format("%.2f", orderDetail.getComputeArea()*orderDetail.getDeliveryDetail().getQuantity())
+                        )*orderDetail.getPrice()));
                     }else if (calculateType==2){
                         deliveryDetailMoney=Double.valueOf(String.format("%.2f",Double.valueOf(
-                                String.format("%.2f", (orderDetail.getComputeArea())*orderDetail.getDeliveryDetail().getQuantity())
+                                String.format("%.2f", orderDetail.getComputeArea()*orderDetail.getDeliveryDetail().getQuantity())
                         )*orderDetail.getPrice()));
                     }else if (calculateType==3){
                         deliveryDetailMoney=Double.valueOf(String.format("%.2f",orderDetail.getPrice() * orderDetail.getDeliveryDetail().getQuantity()));
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/userInfo/LogService.java b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/LogService.java
new file mode 100644
index 0000000..a8c68c7
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/LogService.java
@@ -0,0 +1,24 @@
+package com.example.erp.service.userInfo;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.example.erp.entity.userInfo.Log;
+import com.example.erp.mapper.userInfo.LogMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@DS("log")
+@Service
+public class LogService {
+
+    private final LogMapper logMapper;
+
+
+    public LogService(LogMapper logMapper) {
+        this.logMapper = logMapper;
+    }
+
+
+    public void saveLog(Log log)  {
+        logMapper.insert(log);
+    }
+}
diff --git a/north-glass-erp/src/main/resources/application.yml b/north-glass-erp/src/main/resources/application.yml
index 8c37623..181bfa7 100644
--- a/north-glass-erp/src/main/resources/application.yml
+++ b/north-glass-erp/src/main/resources/application.yml
@@ -30,6 +30,11 @@
           username: root
           password: beibo.123/
           driver-class-name: com.mysql.cj.jdbc.Driver
+        log:
+          url: jdbc:mysql://localhost:3306/erp_log?serverTimezone=GMT%2b8
+          username: root
+          password: beibo.123/
+          driver-class-name: com.mysql.cj.jdbc.Driver
 #mybatis-plus:
 #  configuration:
 #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
diff --git a/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml b/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
index 780b238..7bf5c91 100644
--- a/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
+++ b/north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
@@ -534,6 +534,13 @@
 
     </select>
 
+    <select id="findOrderNumberd" >
+        select *
+        from  mm.`finished_goods_inventory`
+        where order_number = #{orderNumber} and order_id=#{orderId};
+
+    </select>
+
     <select id="finishedGoodsInventorybycount" >
         select quantity_available
         from  mm.`finished_goods_inventory`
@@ -867,7 +874,7 @@
 
     <update id="updateOrderInventory">
         update mm.finished_goods_inventory
-        set inventory=inventory+${orderDetail.quantity},quantity_available=quantity_available+${orderDetail.quantity},
+        set inventory=${orderDetail.quantity},quantity_available=${orderDetail.quantity},
         update_time=now(),area=actual_signal_area*quantity_available
         where order_number=#{orderDetail.orderNumber}  and order_id=#{orderDetail.orderId}
     </update>

--
Gitblit v1.8.0