From e4a393c219c3c48cbf0e4af615b316facb82eb62 Mon Sep 17 00:00:00 2001
From: wujian <14790700720@163.com>
Date: 星期三, 04 九月 2024 09:09:50 +0800
Subject: [PATCH] change-1

---
 jcdm-ui/src/api/main/bs/tileMatchRules/tileMatchRules.js                                           |    8 ++
 jcdm-ui/src/views/main/cfkb/connectingRod/index.vue                                                |    4 
 jcdm-ui/src/views/main/om/productionOrde/index.vue                                                 |   64 ++++++++++++++-------
 jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java |   27 +++++++-
 jcdm-main/src/main/resources/mapper/da/tileMatchMiddleware/DaTileMatchMiddlewareMapper.xml         |   18 +++++
 5 files changed, 92 insertions(+), 29 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java
index 97c2b11..96c7747 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java
@@ -6,6 +6,7 @@
 import javax.servlet.http.HttpServletResponse;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.jcdm.common.core.domain.R;
 import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
 import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
@@ -57,8 +58,7 @@
      */
     @PreAuthorize("@ss.hasPermi('da:tileMatchRules:list')")
     @GetMapping("/list")
-    public TableDataInfo list(DaTileMatchRules daTileMatchRules)
-    {
+    public TableDataInfo list(DaTileMatchRules daTileMatchRules) {
         startPage();
         List<DaTileMatchRules> list = daTileMatchRulesService.selectDaTileMatchRulesList(daTileMatchRules);
         return getDataTable(list);
@@ -67,12 +67,31 @@
     /**
      *  鏇茶酱閰嶇摝
      */
-    @PreAuthorize("@ss.hasPermi('da:tileMatchRules:list')")
     @GetMapping("/list2")
-    public TableDataInfo list2(DaTileMatchRules daTileMatchRules)
+    public TableDataInfo list2(DaTileMatchRules daTileMatchRules) throws Exception
     {
         startPage();
         List<DaTileMatchRules> list = daTileMatchRulesService.selectDaTileMatchRulesList(daTileMatchRules);
+        //杩欓噷鍙栫涓�琛岀殑鏁版嵁鍙戦�侀鑹蹭俊鍙�
+        if (CollUtil.isNotEmpty(list)){
+            DaTileMatchRules daTileMatchRules1 = list.get(0);
+            String tileColor = daTileMatchRules1.getTileColor();
+            //1缁胯壊  2榛戣壊   3绾㈣壊   4钃濊壊
+            Integer colorInt = null;
+            if ("#008000".equals(tileColor)){
+                colorInt = 1;
+            } else if ("#000000".equals(tileColor)){
+                colorInt = 2;
+            } else if ("#FF0000".equals(tileColor)){
+                colorInt = 3;
+            } else if ("#0000FF".equals(tileColor)){
+                colorInt = 4;
+            }
+            if (ObjectUtil.isNotEmpty(colorInt)){
+                ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP055.Color", colorInt);
+                miloService.writeToOpcByte(entity);
+            }
+        }
         return getDataTable(list);
     }
 
diff --git a/jcdm-main/src/main/resources/mapper/da/tileMatchMiddleware/DaTileMatchMiddlewareMapper.xml b/jcdm-main/src/main/resources/mapper/da/tileMatchMiddleware/DaTileMatchMiddlewareMapper.xml
index 2c3253e..6b0a8c2 100644
--- a/jcdm-main/src/main/resources/mapper/da/tileMatchMiddleware/DaTileMatchMiddlewareMapper.xml
+++ b/jcdm-main/src/main/resources/mapper/da/tileMatchMiddleware/DaTileMatchMiddlewareMapper.xml
@@ -12,10 +12,14 @@
         <result property="remarks"    column="remarks"    />
         <result property="connectingrodNo"    column="connectingRod_no"    />
         <result property="cylinder"    column="cylinder"    />
+        <result property="createUser"    column="create_user"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateUser"    column="update_user"    />
+        <result property="updateTime"    column="update_time"    />
     </resultMap>
 
     <sql id="selectDaTileMatchMiddlewareVo">
-        select id, sfc_code, Pallet_no, crankshaft_no, state, remarks, connectingRod_no, cylinder from da_tile_match_middleware
+        select id, sfc_code, Pallet_no, crankshaft_no, state, remarks, connectingRod_no, cylinder, create_user, create_time, update_user, update_time from da_tile_match_middleware
     </sql>
 
     <select id="selectDaTileMatchMiddlewareList" parameterType="DaTileMatchMiddleware" resultMap="DaTileMatchMiddlewareResult">
@@ -47,6 +51,10 @@
             <if test="remarks != null">remarks,</if>
             <if test="connectingrodNo != null">connectingRod_no,</if>
             <if test="cylinder != null">cylinder,</if>
+            <if test="createUser != null">create_user,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateUser != null">update_user,</if>
+            <if test="updateTime != null">update_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -57,6 +65,10 @@
             <if test="remarks != null">#{remarks},</if>
             <if test="connectingrodNo != null">#{connectingrodNo},</if>
             <if test="cylinder != null">#{cylinder},</if>
+            <if test="createUser != null">#{createUser},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateUser != null">#{updateUser},</if>
+            <if test="updateTime != null">#{updateTime},</if>
          </trim>
     </insert>
 
@@ -70,6 +82,10 @@
             <if test="remarks != null">remarks = #{remarks},</if>
             <if test="connectingrodNo != null">connectingRod_no = #{connectingrodNo},</if>
             <if test="cylinder != null">cylinder = #{cylinder},</if>
+            <if test="createUser != null">create_user = #{createUser},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateUser != null">update_user = #{updateUser},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/jcdm-ui/src/api/main/bs/tileMatchRules/tileMatchRules.js b/jcdm-ui/src/api/main/bs/tileMatchRules/tileMatchRules.js
index f01fbc9..e051679 100644
--- a/jcdm-ui/src/api/main/bs/tileMatchRules/tileMatchRules.js
+++ b/jcdm-ui/src/api/main/bs/tileMatchRules/tileMatchRules.js
@@ -9,6 +9,14 @@
   })
 }
 
+export function listTileMatchRules2(query) {
+  return request({
+    url: '/da/tileMatchRules/list2',
+    method: 'get',
+    params: query
+  })
+}
+
 // 鏌ヨ閰嶇摝瑙勫垯璇︾粏
 export function getTileMatchRules(id) {
   return request({
diff --git a/jcdm-ui/src/views/main/cfkb/connectingRod/index.vue b/jcdm-ui/src/views/main/cfkb/connectingRod/index.vue
index 51529f0..32d91b1 100644
--- a/jcdm-ui/src/views/main/cfkb/connectingRod/index.vue
+++ b/jcdm-ui/src/views/main/cfkb/connectingRod/index.vue
@@ -66,7 +66,7 @@
 <script>
 import VueQr from 'vue-qr'
 import {setBarcode} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
-import {listTileMatchRules} from "@/api/main/bs/tileMatchRules/tileMatchRules";
+import {listTileMatchRules2} from "@/api/main/bs/tileMatchRules/tileMatchRules";
 import {listTileMatchMiddleware} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
 import {getSumDataMethod} from "@/api/main/bs/orderScheduling/orderScheduling";
 export default {
@@ -300,7 +300,7 @@
         neckValue: this.queryParams.neckValue,
       }
       console.log('鍙傛暟锛�',queryParams)
-      listTileMatchRules(queryParams).then(response => {
+      listTileMatchRules2(queryParams).then(response => {
         console.log('this.queryParams',this.queryParams);
         console.log('res',response)
         if (response.rows.length>0){
diff --git a/jcdm-ui/src/views/main/om/productionOrde/index.vue b/jcdm-ui/src/views/main/om/productionOrde/index.vue
index c1b0c2c..0a0619e 100644
--- a/jcdm-ui/src/views/main/om/productionOrde/index.vue
+++ b/jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -109,7 +109,7 @@
           plain
           icon="el-icon-edit"
           size="mini"
-          :disabled="single"
+          :disabled="create"
           @click="CreatehandleUpdate"
         >鐢熸垚</el-button>
       </el-col>
@@ -360,6 +360,7 @@
       ids: [],
       // 闈炲崟涓鐢�
       single: true,
+      create: false,
       // 闈炲涓鐢�
       multiple: true,
       move: true,
@@ -676,6 +677,14 @@
       console.log('this.single1111',this.single)
       console.log('selecion',selection)
       this.ids = selection.map(item => item.id)
+      const statusList = selection.map(item => item.orderStatus)
+      console.log('statusList',statusList)
+      console.log('statusList.filter( x => x !== "1").length',statusList.filter( x => x !== "1").length)
+      if (statusList.filter( x => x !== "1").length >0){
+        this.create = true
+      } else {
+        this.create = false
+      }
       if (selection.length >1){
         this.single = false
         this.multiple = true
@@ -721,24 +730,30 @@
       this.titleName = "娣诲姞鐢熶骇璁㈠崟";
     },
     /** 鍚屾鎸夐挳鎿嶄綔 */
-    CreatehandleUpdate(Row) {
-      this.initWorkshop();
-      this.reset();
-      const id = Row.id || this.ids
-      getProductionOrdes(id).then(response => {
-        console.log(response.data)
-        console.log(response.data.productCode)
-        this.materialQueryParams.materialCode = response.data.productCode;
-        listMaterial(this.materialQueryParams).then(response => {
-          this.markNo = response.rows[0].mark
-          this.form.typeL = response.rows[0].typeL;
+    CreatehandleUpdate() {
+      console.log('this.ids',this.ids)
+      if (this.ids.length === 0){
+        this.$message.error('璇峰嬀閫夋暟鎹�');
+      }else {
+        this.initWorkshop();
+        this.reset();
+        const id = this.ids
+        getProductionOrdes(id).then(response => {
+          console.log(response.data)
+          console.log(response.data.productCode)
+          this.materialQueryParams.materialCode = response.data.productCode;
+          listMaterial(this.materialQueryParams).then(response => {
+            this.markNo = response.rows[0].mark
+            this.form.typeL = response.rows[0].typeL;
+          });
+          this.form = response.data;
+          this.form.idNums=id;
+          this.Createopen = true;
+          this.titleName = "鐢熸垚绠变綋鏉$爜";
+          // return Array.from({ length: parseInt(this.actualQty) }, (_, index) => index + 1);
         });
-        this.form = response.data;
-        this.form.idNums=id;
-        this.Createopen = true;
-        this.titleName = "鐢熸垚绠变綋鏉$爜";
-        // return Array.from({ length: parseInt(this.actualQty) }, (_, index) => index + 1);
-      });
+      }
+
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
@@ -832,10 +847,15 @@
       }, `productionOrde_${new Date().getTime()}.xlsx`)
     },
     goToPage() {
-      this.showDetailFlag=true
-      console.log('this.showDetailFlag',this.showDetailFlag)
-      //鏇存柊瀹為檯鐢熶骇鏃ユ湡
-      //updateOrderInfo(this.singleSelect)
+      if (this.ids.length === 0){
+        this.$message.error('璇峰嬀閫夋暟鎹�');
+      }else {
+        this.showDetailFlag=true
+        console.log('this.showDetailFlag',this.showDetailFlag)
+        //鏇存柊瀹為檯鐢熶骇鏃ユ湡
+        //updateOrderInfo(this.singleSelect)
+      }
+
     },
   }
 };

--
Gitblit v1.9.3