From 696fd55ecc1243bce1d421d95cb9fba4b0a598b1 Mon Sep 17 00:00:00 2001
From: yyt <306727702@qq.com>
Date: 星期三, 22 五月 2024 18:43:41 +0800
Subject: [PATCH] 380新产品,优化

---
 jcdm-main/src/main/resources/mapper/da/passingStationCollection/DaPassingStationCollectionMapper.xml   |    1 
 jcdm-ui/package.json                                                                                   |    1 
 jcdm-ui/src/views/main/om/productionOrde/index.vue                                                     |   10 +-
 jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java                                      |    2 
 jcdm-ui/src/api/main/om/productionOrde/productionOrde.js                                               |    7 ++
 jcdm-ui/src/views/main/kb/BalanceShaft/index.vue                                                       |    7 ++
 jcdm-ui/src/views/main/kb/crankshaft/index.vue                                                         |   43 ++++++++++++-
 jcdm-main/src/main/resources/mapper/da/paramCollection/DaParamCollectionMapper.xml                     |    1 
 jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java |   80 ++++++++++++++------------
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java                             |    3 +
 10 files changed, 106 insertions(+), 49 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
index cd3e7fe..77c10e9 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
@@ -81,18 +81,18 @@
     /**
      * 鑾峰彇鐢熶骇宸ュ崟璇︾粏淇℃伅
      */
-//    @PreAuthorize("@ss.hasPermi('om:productionOrde:query')")
-//    @GetMapping(value = "/{id}")
-//    public AjaxResult getInfo(@PathVariable("id") Long id)
-//    {
-//        return success(omProductionOrdeInfoService.selectOmProductionOrdeInfoById(id));
-//    }
+    @PreAuthorize("@ss.hasPermi('om:productionOrde:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(omProductionOrdeInfoService.selectOmProductionOrdeInfoById(id));
+    }
 
     /**
      * 鑾峰彇鐢熶骇宸ュ崟璇︾粏淇℃伅
      */
     @PreAuthorize("@ss.hasPermi('om:productionOrde:query')")
-    @GetMapping("/{ids}")
+    @GetMapping("/ids/{ids}")
     public AjaxResult getInfo(@PathVariable Long[] ids)
     {
         return success(omProductionOrdeInfoService.selectOmProductionOrdeInfoByIds(ids));
@@ -115,6 +115,7 @@
     @PostMapping("/orderSchedulingForBoxCode")
     public AjaxResult addOrderSchedulingForBoxCode(@RequestBody OmProductionOrdeInfo omProductionOrdeInfo)
     {
+
         //鑾峰彇褰撳墠鏃堕棿
         LocalDateTime date= LocalDateTime.now();
         //鍒涘缓鏃ユ湡鏃堕棿瀵硅薄鏍煎紡鍖栧櫒锛屾棩鏈熸牸寮忕被浼硷細 2023-05-23 22:18:38
@@ -122,42 +123,45 @@
         //灏嗘椂闂磋浆鍖栦负瀵瑰簲鏍煎紡鐨勫瓧绗︿覆
         String fomateDate=date.format(formatter).toString();
 
-
         Integer startCode = Integer.parseInt(omProductionOrdeInfo.getStartCode());//寮�濮嬬紪鍙�
-        Integer planQty = Math.toIntExact(omProductionOrdeInfo.getPlanQty());//璁″垝鏁伴噺
+
         String dateTimeRule = omProductionOrdeInfo.getDateTimeRule();
 
-        String engineNo = "";
-        if(planQty>0) {
-            for (int i = 0; i < planQty; i++) {
-                engineNo = omProductionOrdeInfo.getTypeZ() + " " + dateTimeRule + StringUtils.leftPad(String.valueOf(startCode), 3, "0");
-                BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
-                bsOrderScheduling.setOrderNo(omProductionOrdeInfo.getWorkOrderNo());
-                bsOrderScheduling.setModel(omProductionOrdeInfo.getTypeZ());
-                bsOrderScheduling.setEngineNo(engineNo);
-                bsOrderScheduling.setProductionStatus("1");
-                bsOrderScheduling.setOperator(getUserName());
-                bsOrderScheduling.setOperateTime(fomateDate);
-                bsOrderScheduling.setProductType(omProductionOrdeInfo.getTypeL());//浜у搧绫诲瀷
-                bsOrderScheduling.setWhetherOrPrint("0");
-                bsOrderSchedulingService.insertBsOrderScheduling(bsOrderScheduling);
-                startCode++;
+        Long[] id=omProductionOrdeInfo.getIdNums();
+        OmProductionOrdeInfo ProductionOrde;
+        for (int a=0;a<id.length;a++){
+            ProductionOrde=omProductionOrdeInfoService.selectOmProductionOrdeInfoById(id[a]);
+            Integer planQty = Math.toIntExact(ProductionOrde.getPlanQty());//璁″垝鏁伴噺
+            String engineNo = "";
+            if(planQty>0) {
+                for (int i = 0; i < planQty; i++) {
+                    engineNo = omProductionOrdeInfo.getTypeZ() + " " + dateTimeRule + StringUtils.leftPad(String.valueOf(startCode), 3, "0");
+                    BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
+                    bsOrderScheduling.setOrderNo(ProductionOrde.getWorkOrderNo());
+                    bsOrderScheduling.setModel(ProductionOrde.getTypeZ());
+                    bsOrderScheduling.setEngineNo(engineNo);
+                    bsOrderScheduling.setProductionStatus("1");
+                    bsOrderScheduling.setOperator(getUserName());
+                    bsOrderScheduling.setOperateTime(fomateDate);
+                    bsOrderScheduling.setProductType(ProductionOrde.getTypeL());//浜у搧绫诲瀷
+                    bsOrderScheduling.setWhetherOrPrint("0");
+                    bsOrderSchedulingService.insertBsOrderScheduling(bsOrderScheduling);
+                    startCode++;
+                }
             }
-
-            //鏂板鏈哄瀷搴忓彿
-            BsModelNumber bsModelNumber = new BsModelNumber();
-            bsModelNumber.setModel(omProductionOrdeInfo.getTypeZ());
-            bsModelNumber.setModelDate(dateTimeRule);
-            bsModelNumber.setMaxnumValue((startCode - 1) + "");
-            bsModelNumber.setSaveTime(fomateDate);
-            bsModelNumber.setLastNumber((startCode - 1) + "");
-            bsModelNumberService.insertBsModelNumber(bsModelNumber);
+            //鏇存柊宸ュ崟鐘舵��
+            ProductionOrde.setOrderStatus("2");
+            omProductionOrdeInfoService.updateOmProductionOrdeInfo(ProductionOrde);
         }
-        //鏇存柊宸ュ崟鐘舵��
-        omProductionOrdeInfo.setOrderStatus("2");
-        return toAjax(omProductionOrdeInfoService.updateOmProductionOrdeInfo(omProductionOrdeInfo));
-
-
+        //鏂板鏈哄瀷搴忓彿
+        BsModelNumber bsModelNumber = new BsModelNumber();
+        bsModelNumber.setModel(omProductionOrdeInfo.getTypeZ());
+        bsModelNumber.setModelDate(dateTimeRule);
+        bsModelNumber.setMaxnumValue((startCode - 1) + "");
+        bsModelNumber.setSaveTime(fomateDate);
+        bsModelNumber.setLastNumber((startCode - 1) + "");
+        bsModelNumberService.insertBsModelNumber(bsModelNumber);
+        return toAjax(1);
     }
 
     /**
diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java
index 65fc450..6f85176 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/CustomRunner.java
@@ -63,7 +63,7 @@
                 bsTechnologyRouteChildInfoService);
 
 
-        miloService.subscriptionFromOpcUa(collect,opcUaSubscription);
+        miloService.subscriptionFromOpcUa(collect,100,opcUaSubscription);
 
     }
 
diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
index 52c5212..d2a7344 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -206,6 +206,9 @@
                         OPCUaSubscription.miloService.writeToOpcUa(entity3);//鍐橲N
                         ReadWriteEntity entity5 = new ReadWriteEntity("CFL4HX.HOP020.PrintCode2", printcode[1]);
                         OPCUaSubscription.miloService.writeToOpcUa(entity5);//鍐橲N
+                        ReadWriteEntity entity6 = new ReadWriteEntity("CFL4HX.HOP020.SNDoor", "1");
+                        logger.info("鍙戝姩鏈哄彿{}锛岃姹傛墦鐮佸唴瀹瑰啓鍏ユ垚鍔燂紝杩斿洖SNDoor淇″彿淇″彿1",SNCode);
+                        miloService.writeToOpcByte(entity6);
                     }
                     System.out.println(entity);
 
diff --git a/jcdm-main/src/main/resources/mapper/da/paramCollection/DaParamCollectionMapper.xml b/jcdm-main/src/main/resources/mapper/da/paramCollection/DaParamCollectionMapper.xml
index 440aa5c..03caf9a 100644
--- a/jcdm-main/src/main/resources/mapper/da/paramCollection/DaParamCollectionMapper.xml
+++ b/jcdm-main/src/main/resources/mapper/da/paramCollection/DaParamCollectionMapper.xml
@@ -49,6 +49,7 @@
             <if test="paramValue != null  and paramValue != ''"> and param_value = #{paramValue}</if>
             <if test="dateConditions != null  and dateConditions != ''"> and collection_time BETWEEN #{startTime} AND #{endTime}</if>
         </where>
+        ORDER BY id DESC
     </select>
     
     <select id="selectDaParamCollectionById" parameterType="Long" resultMap="DaParamCollectionResult">
diff --git a/jcdm-main/src/main/resources/mapper/da/passingStationCollection/DaPassingStationCollectionMapper.xml b/jcdm-main/src/main/resources/mapper/da/passingStationCollection/DaPassingStationCollectionMapper.xml
index bec913f..f4a5e06 100644
--- a/jcdm-main/src/main/resources/mapper/da/passingStationCollection/DaPassingStationCollectionMapper.xml
+++ b/jcdm-main/src/main/resources/mapper/da/passingStationCollection/DaPassingStationCollectionMapper.xml
@@ -48,6 +48,7 @@
             <if test="outRsSign != null "> and out_rs_sign = #{outRsSign}</if>
             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> and outbound_time between #{startTime} and #{endTime}</if>
         </where>
+        ORDER BY id DESC
     </select>
     
     <select id="selectDaPassingStationCollectionById" parameterType="Long" resultMap="DaPassingStationCollectionResult">
diff --git a/jcdm-ui/package.json b/jcdm-ui/package.json
index 89380e7..072f9a6 100644
--- a/jcdm-ui/package.json
+++ b/jcdm-ui/package.json
@@ -73,6 +73,7 @@
     "eslint": "7.15.0",
     "eslint-plugin-vue": "7.2.0",
     "lint-staged": "10.5.3",
+    "qrcodejs2": "^0.0.2",
     "runjs": "4.4.2",
     "sass": "1.32.13",
     "sass-loader": "10.1.1",
diff --git a/jcdm-ui/src/api/main/om/productionOrde/productionOrde.js b/jcdm-ui/src/api/main/om/productionOrde/productionOrde.js
index 5e64466..360afd5 100644
--- a/jcdm-ui/src/api/main/om/productionOrde/productionOrde.js
+++ b/jcdm-ui/src/api/main/om/productionOrde/productionOrde.js
@@ -33,6 +33,13 @@
   })
 }
 
+export function getProductionOrdes(ids) {
+  return request({
+    url: '/om/productionOrde/ids/' + ids,
+    method: 'get'
+  })
+}
+
 // 鏂板璁㈠崟鎺掍骇
 export function addOrderSchedulingForBoxCode(data) {
   return request({
diff --git a/jcdm-ui/src/views/main/kb/BalanceShaft/index.vue b/jcdm-ui/src/views/main/kb/BalanceShaft/index.vue
index cf70f24..00af22c 100644
--- a/jcdm-ui/src/views/main/kb/BalanceShaft/index.vue
+++ b/jcdm-ui/src/views/main/kb/BalanceShaft/index.vue
@@ -1,5 +1,12 @@
 <template>
   <div class="app-container">
+    <el-card   class="box-card"  style="height: 60px" >
+      <template>
+        <div class="container" type="flex" justify="center" style="text-align:center">
+          <el-divider><span style="font-size:30px;color:black"><strong>骞宠 杞存壂鐮佷笂绾�</strong></span></el-divider>
+        </div>
+      </template>
+    </el-card>
     <el-row :gutter="3">
       <el-col :span="6">
         <el-card shadow="always" class="boxSize">
diff --git a/jcdm-ui/src/views/main/kb/crankshaft/index.vue b/jcdm-ui/src/views/main/kb/crankshaft/index.vue
index c29e4b7..82fbb3f 100644
--- a/jcdm-ui/src/views/main/kb/crankshaft/index.vue
+++ b/jcdm-ui/src/views/main/kb/crankshaft/index.vue
@@ -3,11 +3,7 @@
     <el-card   class="box-card"  style="height: 60px" >
       <template>
         <div class="container" type="flex" justify="center" style="text-align:center">
-          <!--          <el-row   type="flex" justify="center" style="text-align:center;height: 12px" >-->
-          <!--            <el-col  type="flex" justify="center"  :span="14" style="text-align:center">-->
-          <el-divider><span style="font-size:30px;color:black"><strong>鏇茶酱鐮佹壂鐮佷笂绾�</strong></span></el-divider>
-          <!--            </el-col>-->
-          <!--          </el-row>-->
+          <el-divider><span style="font-size:30px;color:black"><strong>鏇茶酱鎵爜涓婄嚎</strong></span></el-divider>
         </div>
       </template>
     </el-card>
@@ -67,6 +63,8 @@
                <span   class="el-icon-thumb"   style="font-size:40px;color:black"></span>
                <span style="font-size:45px;color:black"><strong>寮哄埗涓婄嚎</strong></span>
              </el-button>
+<!--             <el-button @click="print">鎵撳嵃</el-button>-->
+<!--             <el-button @click="test1">鐢熸垚浜岀淮鐮�</el-button>-->
            </el-col>
          </el-row>
        </el-card>
@@ -98,6 +96,7 @@
 import {listLineInfo} from "@/api/main/bs/lineInfo/lineInfo";
 import { setSNCode } from "@/api/main/da/opcuaconfig/opcuaconfig";
 import {getIp, listStationConf} from "@/api/main/sc/stationConf";
+import QRCode from "qrcodejs2";
 
 export default {
   components: { },
@@ -213,6 +212,40 @@
     parseQRCode(code) {
       this.form.engineNo = code;
     },
+    // print() {
+      // 鏈〉闈㈢洿鎺ユ墦鍗帮紙鏈塨ug鍗曞瞾鍏堜笉瑕佸垹锛�
+      // let oldStr = window.document.body.innerHTML;
+      // let newStr = document.getElementById('printMe').innerHTML;
+      // document.body.innerHTML = newStr;
+      // window.print();
+      // document.body.innerHTML = oldStr;
+      // return false;
+
+      // 鏂板紑椤甸潰鎵撳嵃
+      //  document.getElementById('canvasWrapper').innerHTML = '';
+    //   let newStr = document.getElementById('printMe').innerHTML;
+    //   let newWin = window.open('', '_blank');
+    //   newWin.document.body.innerHTML = newStr;
+    //   newWin.print();
+    //   return false;
+    // },
+    // test1(){
+    //   document.getElementById('canvasWrapper').innerHTML = ''
+    //   this.$nextTick(() => {
+    //     let qrCode = new QRCode('canvasWrapper',{
+    //       width: 80,
+    //       height: 80,
+    //       padding: 0,
+    //       margin: 0,
+    //       // text: this.packCode,
+    //       text:"88888",
+    //       colorDark: '#000',
+    //       colorLight: '#fff'
+    //     })
+    //   })
+    //   // console.log(this.packCode)
+    //   // this.print()
+    // },
   },
   }
 
diff --git a/jcdm-ui/src/views/main/om/productionOrde/index.vue b/jcdm-ui/src/views/main/om/productionOrde/index.vue
index f3ddc64..08a212b 100644
--- a/jcdm-ui/src/views/main/om/productionOrde/index.vue
+++ b/jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -9,6 +9,9 @@
       <el-form-item label-width="80" label="鐢熶骇璁㈠崟" prop="workOrderNo">
         <el-input v-model="queryParams.workOrderNo" placeholder="璇疯緭鍏ョ敓浜ц鍗�" clearable @keyup.enter.native="handleQuery"/>
       </el-form-item>
+      <el-form-item style="margin-left: 14px" label="浜у搧缂栧彿" prop="productCode">
+        <el-input v-model="queryParams.productCode" placeholder="璇疯緭鍏ヤ骇鍝佺紪鍙�" clearable @keyup.enter.native="handleQuery"/>
+      </el-form-item>
 <!--      <el-form-item label="浜у搧鍚嶇О" prop="productName">-->
 <!--        <el-input v-model="queryParams.productName" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" clearable @keyup.enter.native="handleQuery"/>-->
 <!--      </el-form-item>-->
@@ -28,9 +31,6 @@
       </el-form-item>
     </el-form>
     <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="advancedShowSearch" label-width="68px">
-      <el-form-item style="margin-left: 14px" label="浜у搧缂栧彿" prop="productCode">
-        <el-input v-model="queryParams.productCode" placeholder="璇疯緭鍏ヤ骇鍝佺紪鍙�" clearable @keyup.enter.native="handleQuery"/>
-      </el-form-item>
       <el-form-item label="鏈哄瀷" prop="typeZ">
         <el-input v-model="queryParams.typeZ" placeholder="璇疯緭鍏ユ満鍨�" clearable @keyup.enter.native="handleQuery"/>
       </el-form-item>
@@ -323,7 +323,7 @@
 import { listProductBom } from "@/api/main/bs/ProductBom/ProductBom";
 import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute";
 import ItemSelect  from "@/components/itemSelect/single.vue";
-import {  addOrderSchedulingForBoxCode,getProductionNotice, upDownMove, listProductionOrde, getProductionOrde, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde";
+import {  addOrderSchedulingForBoxCode,getProductionNotice, upDownMove, listProductionOrde, getProductionOrde,getProductionOrdes, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde";
 import {
   listOrderScheduling,
   getOrderScheduling,
@@ -699,7 +699,7 @@
       this.initWorkshop();
       this.reset();
       const id = Row.id || this.ids
-      getProductionOrde(id).then(response => {
+      getProductionOrdes(id).then(response => {
         console.log(response.data)
         console.log(response.data.productCode)
         this.materialQueryParams.materialCode = response.data.productCode;

--
Gitblit v1.9.3