From 35188af778496c29dc74254df1e07f777b769620 Mon Sep 17 00:00:00 2001
From: LSH <1>
Date: 星期五, 17 五月 2024 10:15:57 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/rowLastno/rowLastno.js       |  124 ++++++++++++------------
 src/main/resources/mapper/RowLastnoMapper.xml          |    1 
 src/main/java/com/zy/asrs/utils/Utils.java             |   40 +++----
 src/main/webapp/views/rowLastno/rowLastno_detail.html  |   27 +++--
 src/main/java/com/zy/common/web/WcsController.java     |    6 
 src/main/java/com/zy/asrs/entity/RowLastno.java        |   18 +++
 src/main/java/com/zy/common/service/CommonService.java |   47 ++++++++
 7 files changed, 160 insertions(+), 103 deletions(-)

diff --git a/src/main/java/com/zy/asrs/entity/RowLastno.java b/src/main/java/com/zy/asrs/entity/RowLastno.java
index 2fe299f..7acec56 100644
--- a/src/main/java/com/zy/asrs/entity/RowLastno.java
+++ b/src/main/java/com/zy/asrs/entity/RowLastno.java
@@ -135,6 +135,13 @@
     @TableField("sign_type_other_boolean")
     private String signTypeOtherBoolean;
 
+    /**
+     * 鍏跺畠鏍囪绫诲埆锛堟槸鍚﹁緭閫佺嚎浜掗�氾級
+     */
+    @ApiModelProperty(value= "鍏ュ簱绔欑偣闆嗗悎")
+    @TableField("sta_no_list")
+    private String staNoList;
+
     public RowLastno() {}
 
     public RowLastno(String wrkMk,Integer currentRow,Integer sRow,Integer eRow,Integer crnQty,String memo,Long modiUser,Date modiTime,Long appeUser,Date appeTime,Integer limintLoc) {
@@ -162,7 +169,7 @@
 //            null,    // 淇敼鏃堕棿
 //            null,    // 鍒涘缓鑰�
 //            null,    // 娣诲姞鏃堕棿
-//            null    // 
+//            null    //
 //    );
 
     public Integer getWhsType() {
@@ -292,7 +299,6 @@
     public void setLimintLoc(Integer limintLoc) {
         this.limintLoc = limintLoc;
     }
-
     public Integer getsCrnNo() {
         return sCrnNo;
     }
@@ -333,4 +339,12 @@
         this.signTypeOtherBoolean = signTypeOtherBoolean;
     }
 
+    public String getStaNoList() {
+        return staNoList;
+    }
+
+    public void setStaNoList(String StaNoList) {
+        this.staNoList = StaNoList;
+    }
+
 }
diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index a45713b..2109368 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -1,5 +1,6 @@
 package com.zy.asrs.utils;
 
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.core.common.Arith;
 import com.core.common.Cools;
 import com.core.common.SpringUtils;
@@ -226,24 +227,17 @@
 //    }
 
     public static Integer GetWhsType(Integer sourceStaNo) {
-        switch (sourceStaNo){
-            case 104:
-            case 173:
-            case 174:
-            case 175:
-            case 130:
-            case 125:
-                return 5;
-            case 204:
-            case 273:
-            case 274:
-            case 275:
-            case 230:
-            case 225:
-                return 2;
-            default:
-                return 0;
+        RowLastnoService rowLastnoService = SpringUtils.getBean(RowLastnoService.class);
+        List<RowLastno> rowLastnos = rowLastnoService.selectList(new EntityWrapper<RowLastno>());
+        for (RowLastno rowLastno:rowLastnos){
+            String[] staNoList = rowLastno.getStaNoList().split(";");
+            for (String staNo : staNoList){
+                if (staNo.equals(sourceStaNo.toString())){
+                    return rowLastno.getWhsType();
+                }
+            }
         }
+        return 0;
     }
 
     public static boolean BooleanWhsTypeStaIoType(Integer whsType) {  //鏌ヨ鐩镐技鐗╂枡寮�鍏�
@@ -565,12 +559,12 @@
 
 
     /*
-    * 鏈�娣卞簱浣嶆帓鍙� 锛� curRow
-    * 鏈�娴呭簱浣嶆帓鍙� 锛� nearRow
-    * 鏈�娴呭簱浣嶅彿锛岀敤浜庨攣瀹氬垪銆佸眰 锛� nearRow
-    * 鍏ュ簱  true:pakin
-    * 鍑哄簱  false:pakin
-    * */
+     * 鏈�娣卞簱浣嶆帓鍙� 锛� curRow
+     * 鏈�娴呭簱浣嶆帓鍙� 锛� nearRow
+     * 鏈�娴呭簱浣嶅彿锛岀敤浜庨攣瀹氬垪銆佸眰 锛� nearRow
+     * 鍏ュ簱  true:pakin
+     * 鍑哄簱  false:pakin
+     * */
     // 澶栦晶鏂瑰悜鐨勮揣浣�  浼樺厛鍏ュ簱鏂瑰悜 ===>> 鍙嶄箣
     public static List<String> getGroupOutLocCrn(Integer curRow,Integer nearRow,String locNo,boolean pakin){
         List<String> result = new ArrayList<>();
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 090f438..eb95817 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -311,6 +311,7 @@
             }else {
                 staNo = basDevpService.selectById(staDesc.getCrnStn());
                 if (!staNo.getAutoing().equals("Y")) {
+                    log.error("鐩爣绔�"+staDesc.getCrnStn()+"涓嶅彲鐢�");
 //                throw new CoolException("鐩爣绔�"+staDesc.getCrnStn()+"涓嶅彲鐢�");
                     crnNo = 0;
                 }
@@ -328,25 +329,65 @@
 
         // 1.鎸夎鍒欐煡鎵惧簱浣�
         if (Cools.isEmpty(locMast) && crnNo != 0) {
-            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O").orderBy("lev1",true).orderBy("bay1",true));
+            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
+                    .eq("row1", nearRow)
+                    .eq("loc_sts", "O")
+                    .orderBy("lev1",true).orderBy("bay1",true));
             for (LocMast locMast1 : locMasts) {
                 if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
                     continue;
                 }
                 if (Utils.BooleanWhsTypeStaIoType(whsType)){
                     String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
-                    LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc).eq("loc_sts", "O"));
+                    LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
+                            .eq("loc_no", shallowLoc).eq("loc_sts", "O"));
                     if (!Cools.isEmpty(locMast2)) {
                         locMast = locMast2;
                         break;
                     }
-                }else {
+                } else {
                     if (!Cools.isEmpty(locMast1)) {
                         locMast = locMast1;
                         break;
                     }
                 }
             }
+
+            if (Cools.isEmpty(locMast) && Utils.BooleanWhsTypeStaIoType(whsType)){
+                for (LocMast locMast1 : locMasts) {
+                    if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
+                        continue;
+                    }
+                    if (Utils.BooleanWhsTypeStaIoType(whsType)){
+                        String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
+                        LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
+                                .eq("loc_no", shallowLoc).eq("loc_sts", "O"));
+                        if (!Cools.isEmpty(locMast2)) {
+                            locMast = locMast2;
+                            break;
+                        } else {
+                            locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
+                                    .eq("loc_no", shallowLoc).eq("loc_sts", "F"));
+                            if (!Cools.isEmpty(locMast2)) {
+                                locMast = locMast2;
+                                break;
+                            } else {
+                                locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
+                                        .eq("loc_no", shallowLoc).eq("loc_sts", "D"));
+                                if (!Cools.isEmpty(locMast2)) {
+                                    locMast = locMast2;
+                                    break;
+                                }
+                            }
+                        }
+                    } else {
+                        if (!Cools.isEmpty(locMast1)) {
+                            locMast = locMast1;
+                            break;
+                        }
+                    }
+                }
+            }
         }
 
         if (!Cools.isEmpty(locMast) && !basCrnpService.checkSiteError(crnNo, true)) {
diff --git a/src/main/java/com/zy/common/web/WcsController.java b/src/main/java/com/zy/common/web/WcsController.java
index 9c7b173..f42d168 100644
--- a/src/main/java/com/zy/common/web/WcsController.java
+++ b/src/main/java/com/zy/common/web/WcsController.java
@@ -485,9 +485,9 @@
         BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true);
 
         // 妫�绱㈠簱浣�
-        List<KeyValueVo> list = waitPakins.stream().map(item-> new KeyValueVo(item.getMatnr(), item.getBatch())).distinct().collect(Collectors.toList());
-        List<String> matNos = waitPakins.stream().map(WaitPakin::getMatnr).distinct().collect(Collectors.toList());
-        StartupDto dto = commonService.getLocNo(1, 1, devpNo, matNos.get(0),null,null, locTypeDto);
+        List<String> matnrs = waitPakins.stream().map(WaitPakin::getMatnr).distinct().collect(Collectors.toList());
+        List<String> batchs = waitPakins.stream().map(WaitPakin::getBatch).distinct().collect(Collectors.toList());
+        StartupDto dto = commonService.getLocNo(1, 1, devpNo, matnrs.get(0),batchs.get(0),null, locTypeDto);
         int workNo = dto.getWorkNo();
         Date now = new Date();
         // 鐢熸垚宸ヤ綔妗�
diff --git a/src/main/resources/mapper/RowLastnoMapper.xml b/src/main/resources/mapper/RowLastnoMapper.xml
index 18c3461..8dcdf71 100644
--- a/src/main/resources/mapper/RowLastnoMapper.xml
+++ b/src/main/resources/mapper/RowLastnoMapper.xml
@@ -21,6 +21,7 @@
         <result column="sign_type" property="signType" />
         <result column="sign_type_other" property="signTypeOther" />
         <result column="sign_type_other_boolean" property="signTypeOtherBoolean" />
+        <result column="sta_no_list" property="staNoList" />
 
     </resultMap>
 
diff --git a/src/main/webapp/static/js/rowLastno/rowLastno.js b/src/main/webapp/static/js/rowLastno/rowLastno.js
index d55d336..9f91bf6 100644
--- a/src/main/webapp/static/js/rowLastno/rowLastno.js
+++ b/src/main/webapp/static/js/rowLastno/rowLastno.js
@@ -28,6 +28,7 @@
             ,{field: 'sCrnNo', align: 'center',title: '璧峰鍫嗗灈鏈哄彿'}
             ,{field: 'eCrnNo', align: 'center',title: '缁堟鍫嗗灈鏈哄彿'}
             ,{field: 'crnQty', align: 'center',title: '鍫嗗灈鏈烘暟閲�'}
+            ,{field: 'staNoList', align: 'center',title: '绔欑偣闆嗗悎'}
             ,{field: 'memo', align: 'center',title: '澶囨敞'}
             ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳', hide:true}
             ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide:true}
@@ -103,7 +104,7 @@
                     content: 'rowLastno_detail.html',
                     success: function(layero, index){
                         layer.getChildFrame('#data-detail-submit-edit', index).hide();
-                    	clearFormVal(layer.getChildFrame('#detail', index));
+                        clearFormVal(layer.getChildFrame('#detail', index));
                         layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                     }
                 });
@@ -231,35 +232,35 @@
                 if (param === undefined) {
                     layer.msg("鏃犳暟鎹�");
                 } else {
-                   layer.open({
-                       type: 2,
-                       title: '淇敼璇︽儏',
-                       maxmin: true,
-                       area: [top.detailWidth, top.detailHeight],
-                       shadeClose: false,
-                       content: '../user/user_detail.html',
-                       success: function(layero, index){
-                           $.ajax({
-                               url: baseUrl+"/user/"+ param +"/auth",
-                               headers: {'token': localStorage.getItem('token')},
-                               method: 'GET',
-                               success: function (res) {
-                                   if (res.code === 200){
-                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
-                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
-                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
-                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
-                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
-                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
-                                   } else if (res.code === 403){
-                                       parent.location.href = "/";
-                                   }else {
-                                       layer.msg(res.msg)
-                                   }
-                               }
-                           })
-                       }
-                   });
+                    layer.open({
+                        type: 2,
+                        title: '淇敼璇︽儏',
+                        maxmin: true,
+                        area: [top.detailWidth, top.detailHeight],
+                        shadeClose: false,
+                        content: '../user/user_detail.html',
+                        success: function(layero, index){
+                            $.ajax({
+                                url: baseUrl+"/user/"+ param +"/auth",
+                                headers: {'token': localStorage.getItem('token')},
+                                method: 'GET',
+                                success: function (res) {
+                                    if (res.code === 200){
+                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
+                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
+                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
+                                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
+                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
+                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
+                                    } else if (res.code === 403){
+                                        parent.location.href = "/";
+                                    }else {
+                                        layer.msg(res.msg)
+                                    }
+                                }
+                            })
+                        }
+                    });
                 }
                 break;
             case 'appeUser':
@@ -267,36 +268,36 @@
                 if (param === undefined) {
                     layer.msg("鏃犳暟鎹�");
                 } else {
-                   layer.open({
-                       type: 2,
-                       title: '鍒涜鎯�',
-                       maxmin: true,
-                       area: [top.detailWidth, top.detailHeight],
-                       shadeClose: false,
-                       content: '../user/user_detail.html',
-                       success: function(layero, index){
-                           $.ajax({
-                               url: baseUrl+"/user/"+ param +"/auth",
-                               headers: {'token': localStorage.getItem('token')},
-                               method: 'GET',
-                               success: function (res) {
-                                   if (res.code === 200){
-                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
-                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
-                                       layer.getChildFrame('#password,#createTime\\$,#status', index).parent().parent().hide();
-                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
-                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
-                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
-                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
-                                   } else if (res.code === 403){
-                                       parent.location.href = "/";
-                                   }else {
-                                       layer.msg(res.msg)
-                                   }
-                               }
-                           })
-                       }
-                   });
+                    layer.open({
+                        type: 2,
+                        title: '鍒涜鎯�',
+                        maxmin: true,
+                        area: [top.detailWidth, top.detailHeight],
+                        shadeClose: false,
+                        content: '../user/user_detail.html',
+                        success: function(layero, index){
+                            $.ajax({
+                                url: baseUrl+"/user/"+ param +"/auth",
+                                headers: {'token': localStorage.getItem('token')},
+                                method: 'GET',
+                                success: function (res) {
+                                    if (res.code === 200){
+                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
+                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
+                                        layer.getChildFrame('#password,#createTime\\$,#status', index).parent().parent().hide();
+                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
+                                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
+                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
+                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
+                                    } else if (res.code === 403){
+                                        parent.location.href = "/";
+                                    }else {
+                                        layer.msg(res.msg)
+                                    }
+                                }
+                            })
+                        }
+                    });
                 }
                 break;
 
@@ -328,9 +329,10 @@
             currentRow: $('#currentRow').val(),
             sRow: $('#sRow').val(),
             eRow: $('#eRow').val(),
+            crnQty: $('#crnQty').val(),
             sCrnNo: $('#sCrnNo').val(),
             eCrnNo: $('#eCrnNo').val(),
-            crnQty: $('#crnQty').val(),
+            staNoList: $('#staNoList').val(),
             memo: $('#memo').val(),
             modiUser: $('#modiUser').val(),
             modiTime: top.strToDate($('#modiTime\\$').val()),
diff --git a/src/main/webapp/views/rowLastno/rowLastno_detail.html b/src/main/webapp/views/rowLastno/rowLastno_detail.html
index c86c352..9da608b 100644
--- a/src/main/webapp/views/rowLastno/rowLastno_detail.html
+++ b/src/main/webapp/views/rowLastno/rowLastno_detail.html
@@ -15,14 +15,14 @@
 <!-- 璇︽儏 -->
 <div id="data-detail" class="layer_self_wrap">
     <form id="detail" class="layui-form">
-    <!--
-        <div class="layui-inline"  style="display: none">
-            <label class="layui-form-label"><span class="not-null">*</span>缂栥��銆�鍙凤細</label>
-            <div class="layui-input-inline">
-                <input id="id" class="layui-input" type="text" placeholder="缂栧彿">
+        <!--
+            <div class="layui-inline"  style="display: none">
+                <label class="layui-form-label"><span class="not-null">*</span>缂栥��銆�鍙凤細</label>
+                <div class="layui-input-inline">
+                    <input id="id" class="layui-input" type="text" placeholder="缂栧彿">
+                </div>
             </div>
-        </div>
-    -->
+        -->
         <div class="layui-inline"  style="width:31%;">
             <label class="layui-form-label"><span class="not-null">*</span>绫汇��銆�鍒細</label>
             <div class="layui-input-inline">
@@ -54,6 +54,12 @@
             </div>
         </div>
         <div class="layui-inline"  style="width:31%;">
+            <label class="layui-form-label">鍫嗗灈鏈烘暟閲忥細</label>
+            <div class="layui-input-inline">
+                <input id="crnQty" class="layui-input" type="text">
+            </div>
+        </div>
+        <div class="layui-inline"  style="width:31%;">
             <label class="layui-form-label">璧峰鍫嗗灈鏈哄彿锛�</label>
             <div class="layui-input-inline">
                 <input id="sCrnNo" class="layui-input" type="text">
@@ -66,9 +72,9 @@
             </div>
         </div>
         <div class="layui-inline"  style="width:31%;">
-            <label class="layui-form-label">鍫嗗灈鏈烘暟閲忥細</label>
+            <label class="layui-form-label">绔欑偣闆嗗悎锛�;锛夛細</label>
             <div class="layui-input-inline">
-                <input id="crnQty" class="layui-input" type="text">
+                <input id="staNoList" class="layui-input" type="text">
             </div>
         </div>
         <div class="layui-inline"  style="width:31%;">
@@ -140,5 +146,4 @@
 <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
 <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
 <script type="text/javascript" src="../../static/js/rowLastno/rowLastno.js" charset="utf-8"></script>
-</html>
-
+</html>
\ No newline at end of file

--
Gitblit v1.9.1