From c5dc821692c0529e3a688af84c647bf80cc49360 Mon Sep 17 00:00:00 2001 From: test <15284381150@163.com> Date: 星期日, 21 九月 2025 10:49:40 +0800 Subject: [PATCH] Merge branch 'master' into djp --- HTML/js/public.js | 2 Pda/View/SoSetting/productOutCode.html | 799 ++++++++++++++++++++++++++++++++++++++ Wms/WMS.BLL/HttpServer.cs | 58 ++ Pda/View/HouseDataSetting/agvTransport.html | 49 ++ Wms/Wms/Controllers/PdaCrController.cs | 22 + Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs | 2 Pda/View/SoSetting/pinTuoOut.html | 19 Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs | 9 HTML/views/StatisticalReport/BoxInfor.html | 1 Pda/js/public.js | 2 Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 33 + Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs | 9 Wms/WMS.IBLL/IHttpServer.cs | 10 Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs | 32 + Wms/Wms/Controllers/PdaSoController.cs | 21 + Wms/Model/ModelVm/PdaVm/PdaCrVm.cs | 4 Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs | 53 ++ Wms/WMS.BLL/SysServer/StorageAreaServer.cs | 25 Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs | 42 + HTML/views/SOSetting/ExportNotice.html | 2 Wms/Wms/Controllers/DownApiController.cs | 29 + 21 files changed, 1,183 insertions(+), 40 deletions(-) diff --git a/HTML/js/public.js b/HTML/js/public.js index 8cca1df..ff31e00 100644 --- a/HTML/js/public.js +++ b/HTML/js/public.js @@ -2,7 +2,7 @@ // var IP = "http://172.16.71.101:8082/";//鎺ュ彛IP //var IP = "http://localhost:13243/api"; //var IP = "http://localhost:50515/api"; //鏈湴 -var IP="https://localhost:5001/api"; +var IP="https://localhost:44363/api"; // var IP = "http://localhost:44318/api"; //var IP = "http://192.168.1.6:8017"; //var IP = "http://192.168.1.226:8086"; diff --git a/HTML/views/SOSetting/ExportNotice.html b/HTML/views/SOSetting/ExportNotice.html index 6c0ee12..778fcfb 100644 --- a/HTML/views/SOSetting/ExportNotice.html +++ b/HTML/views/SOSetting/ExportNotice.html @@ -368,7 +368,7 @@ </a>`; } - if( (d.Status == '2' || d.Status == '3') && d.Type=='0'){ + if( (d.Status == '2' || d.Status == '3')){ html += `<a class="layui-btn layui-btn-normal layui-btn-xs outClass" lay-event="outKu"> <i class="layui-icon layui-icon-ok"></i>鍑哄簱 </a>`; diff --git a/HTML/views/StatisticalReport/BoxInfor.html b/HTML/views/StatisticalReport/BoxInfor.html index 3a9707f..9ab7017 100644 --- a/HTML/views/StatisticalReport/BoxInfor.html +++ b/HTML/views/StatisticalReport/BoxInfor.html @@ -407,6 +407,7 @@ { field: 'BitPalletMark', title: '闆舵墭鏍囪', align: 'center', templet: '#BitPalletMarkStatus', width: 100, }, { field: 'ProductionTime', title: '鐢熶骇鏃ユ湡', align: 'center', templet: '#templetProductionTime' }, + { field: 'ExpirationTime', title: '杩囨湡鏃ユ湡', align: 'center', templet: '#templetExpirationTime' }, { field: 'OwnerNo', title: '璐т富缂栫爜', align: 'center', width: 100, }, { field: 'OwnerName', title: '璐т富鍚嶇О', align: 'center', width: 100, }, { field: 'SupplierNo', title: '渚涘簲鍟嗙紪鐮�', align: 'center', width: 100, }, diff --git a/Pda/View/HouseDataSetting/agvTransport.html b/Pda/View/HouseDataSetting/agvTransport.html index 09a4011..0d7e32e 100644 --- a/Pda/View/HouseDataSetting/agvTransport.html +++ b/Pda/View/HouseDataSetting/agvTransport.html @@ -138,6 +138,15 @@ <img src="/assets/down_arraw.png"> </div> </div> + <div id="" class="layui-form-item layout-dropdownlist"> + <label class="layui-form-label" lang>鐩爣鍌ㄤ綅锛�</label> + <div class="layui-input-block" id="selectLocatNoEnd"> + <select id="LocatNoEnd" lay-filter="getLocatNoEnd" lay-search> + <option value=""></option> + </select> + <img src="/assets/down_arraw.png"> + </div> + </div> <div id="" class="layui-form-item layout-dropdownlist"> <label class="layui-form-label" lang>鍏ュ簱鍙o細</label> <div class="layui-input-block" id="selectRuku"> @@ -447,6 +456,45 @@ } }); } + //閫変腑鍑哄簱鍗曚簨浠� + form.on('select(getQuyu)', function (data) { + //鍏堟洿鏂颁竴涓嬬洰鏍囧尯鍩� + updateLocatNoEndList() + }); + //鐐瑰嚮鐩爣鍌ㄤ綅涓嬫媺妗嗕簨浠� + $("#selectLocatNoEnd").click(function () { + if ($("#Quyu").val() == "") { + layer.msg('璇峰厛閫夋嫨鐩爣鍖哄煙', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return + } + + }) + /* 缁戝畾鐩爣鍌ㄤ綅淇℃伅 */ + function updateLocatNoEndList() { + $("#LocatNoEnd").empty() + $("#LocatNoEnd").append('<option value =>' + '</option>'); + form.render('select'); + + var param = { + "AreaNo": $("#Quyu").val() + }; + sendData(IP + "/PdaCr/GetLocatByArea", param, 'get', function (res) { + if (res.code == 0) { //鎴愬姛 + for (var i = 0; i < res.data.length; i++) { + $("#LocatNoEnd").append('<option value =' + res.data[i] + '>' + res.data[i]+ '</option>'); + } + form.render('select'); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() {}); + } + }); + } //鐐瑰嚮鍑哄簱鍗曟嵁涓嬫媺妗嗕簨浠� $("#selectOutNo").click(function () { @@ -652,6 +700,7 @@ var param = { PalletNo: $("#STOCKCODE").val(), AreaNo: $("#Quyu").val(), + LocatNoEnd: $("#LocatNoEnd").val(), Ruku: $("#Ruku").val() } //鍛煎彨灏忚溅 diff --git a/Pda/View/SoSetting/pinTuoOut.html b/Pda/View/SoSetting/pinTuoOut.html index d58ad03..9f622e5 100644 --- a/Pda/View/SoSetting/pinTuoOut.html +++ b/Pda/View/SoSetting/pinTuoOut.html @@ -1300,6 +1300,25 @@ } }); } + //涓嬫媺鍗曟嵁閫変腑鍚庝簨浠� + form.on('select(getbar2)', function (data) { + if ($('#palletNo2').val() == "") { + layer.msg("璇疯緭鍏ユ墭鐩樻潯鐮�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + //鍥炶皟 + }); + return + } + if ($('#bar2').val() == "") { + clear21(); + return + } + updateSkuLotNoList2(); + updateQtyList2(); + getBar2(); + }); //鍒濆鍖栨覆鏌� 鐗╂枡-鎵规 function updateSkuLotNoList2() { diff --git a/Pda/View/SoSetting/productOutCode.html b/Pda/View/SoSetting/productOutCode.html new file mode 100644 index 0000000..6f6bbee --- /dev/null +++ b/Pda/View/SoSetting/productOutCode.html @@ -0,0 +1,799 @@ +<!DOCTYPE html> +<html> + +<head> + <meta charset="UTF-8" /> + <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" /> + <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> --> + <meta http-equiv="X-UA-Compatible" content="ie=edge" /> + <title>Boxline PDA</title> + + <link rel="stylesheet" href="/layui/css/layui.css" /> + <link rel="stylesheet" href="/css/style.css" /> + <script src="/js/adaptive.js"></script> + + <link rel="stylesheet" href="/css/my.css" /> + <style type="text/css"> + .layout-bill-info { + height: auto; + /* background-color: #009E94; */ + } + + .layout-tbl-submit { + margin-top: 10px; + } + + /* .out-scatter-num { + background-color: #009688; + + } */ + .out-scatter-num .local-input { + width: 40%; + height: 25px; + float: left; + } + + .out-scatter-num .local-ok button { + height: 25px; + border: 0; + color: #FFFFFF; + background-color: #0a93e3; + border-radius: 3px; + padding: 2px; + margin-left: 10px; + width: 100%; + } + + .out-scatter-num .layui-input-block { + width: 100%; + /* background-color: #009E94; */ + margin-left: 0; + } + + .out-scatter-num .local-ok { + width: 20%; + height: 25px; + float: left; + } + + .btn-ok-blue { + border: none; + color: #FFFFFF; + background-color: #0a93e3; + width: 48%; + height: 36px; + border-radius: 5px; + } + + .btn-ok-red { + border: none; + color: #FFFFFF; + background-color: #9f1707; + width: 48%; + height: 36px; + border-radius: 5px; + } + + .btn-ok-blue:active { + opacity: 0.8; + } + + .btn-ok-red:active { + opacity: 0.8; + } + + .layout-tbl-paging { + margin-top: 20px; + } + + .foot-container { + text-align: center; + } + + .layout-tab-page { + height: auto; + } + + .layui-form-checkbox { + margin: auto; + /* padding-left: 2px; */ + /* padding-right: 2px; */ + } + + .div-tbl-title { + width: 98%; + margin: auto; + /* background-color: #4476A7; */ + height: 30px; + } + + .div-tbl-title table { + width: 100%; + height: 30px; + } + + td { + word-break: break-all; + word-wrap: break-word; + } + + .layui-input-block .layui-input, + .layui-input-block .layui-textarea { + padding-left: 0rem; + font-size: 13px; + } + + .lableWidth { + width: 17%; + } + + .layui-input-block { + width: 83%; + margin-left: 17%; + } + + .layui-form-switch { + margin-top: 0; + } + + ul { + list-style-type: none; + padding: 0; + } + + li { + cursor: pointer; + background-color: lightgray; + padding: 10px; + margin-bottom: 5px; + } + </style> + <link rel="stylesheet" href="/css/adapter.css" /> +</head> + +<body> + <div id="" class="main-content"> + <div id="" class="layout-title"> + <table border="" cellspacing="" cellpadding=""> + <tr> + <td class="img-back"><a href="../index.html"><img src="/assets/back.jpg"></a></td> + <td class="title-text">鎴愬搧鎷h揣</td> + <td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg"></td> + </tr> + </table> + </div> + <div id="" class="layout-sub-content"> + <div id="menuList" class="menu"> + <ul class="" style="text-align: center;"> + <li><a href="../index.html">涓婚〉</a></li> + <li><a href="../login.html">閲嶆柊鐧诲綍</a></li> + </ul> + </div> + + + <div id="" class="layout-bill-info"> + <form class="layui-form" action="" style="height: auto;"> + + <div id="layout-bill" class="layui-form-item layout-dropdownlist"> + <label class="layui-form-label lableWidth">鍑哄簱鍗曪細</label> + <div class="layui-input-block" id="selectDiv"> + <select id="bar" lay-filter="getbar" lay-search> + <option value=""></option> + </select> + <img src="/assets/down_arraw.png"> + </div> + </div> + <div id="layout-skuLotNo" class="layui-form-item layout-dropdownlist"> + <label class="layui-form-label lableWidth">鐗╂枡 - 鎵规锛�</label> + <div class="layui-input-block"> + <select id="skuLotNo" lay-filter="getSkuLotNo" lay-search> + <option value=""></option> + </select> + <img src="/assets/down_arraw.png"> + </div> + </div> + <div id="" class="layout-tab-page"> + <table class="tbl-box-sim-info" border="" cellspacing="" cellpadding=""> + <tr> + <td colspan="3"> + <div class="layui-form-item"> + <label class="layui-form-label" style="width: 17%;">SAP鍗曞彿锛�</label> + <div class="layui-input-block" style="width: 83%;margin-left:17%;"> + <input id="OrderCode" type="text" lay-verify="" disabled placeholder="" + class="layui-input"> + </div> + </div> + </td> + + </tr> + <tr> + <td> + <div class="layui-form-item"> + <label class="layui-form-label" style="width: 50%;">璁″垝鏁伴噺锛�</label> + <div class="layui-input-block" style="width: 50%;margin-left:50%;"> + <input id="planQty" type="text" lay-verify="" disabled placeholder="" + class="layui-input"> + </div> + </div> + </td> + <td> + <div class="layui-form-item"> + <label class="layui-form-label" style="width: 50%">瀹屾垚鏁伴噺锛�</label> + <div class="layui-input-block" style="width: 50%;margin-left:50%;"> + <input id="finishQty" type="text" lay-verify="" disabled placeholder="" + class="layui-input"> + </div> + </div> + + </td> + <td> + <div class="layui-form-item"> + <label class="layui-form-label" style="width: 34%;">鍑哄簱鍙o細</label> + <div class="layui-input-block" style="width: 66%;margin-left:34%;"> + <input id="outModel" type="text" lay-verify="" disabled placeholder="" + class="layui-input"> + </div> + </div> + </td> + </tr> + <tr> + <td colspan="3"> + <div class="layui-form-item"> + <label class="layui-form-label" style="width: 17%;">瑙勬牸锛�</label> + <div class="layui-input-block" style="width: 83%;margin-left:17%;"> + <input id="standard" type="text" lay-verify="" disabled placeholder="" + class="layui-input"> + </div> + </div> + </td> + + </tr> + </table> + </div> + + <div id="layout-pallet" class="layui-form-item layout-input"> + <label class="layui-form-label lableWidth">鎵樼洏鏉$爜锛�</label> + <div class="layui-input-block"> + <input id="palletNo" type="text" lay-verify="stock" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" + autocomplete="off" class="layui-input" style="height:24px"> + </div> + </div> + <div id="" class="layui-form-item layout-input"> + <label class="layui-form-label" lang>鏄惁鏁存墭鍑哄簱锛�</label> + <div class="layui-input-block"> + <input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch" + lay-text="鏄瘄鍚�" lay-filter="IsZhengTuo"> + </div> + </div> + <div id="BoxDIv" class="layout-tab-page"> + <table class="layout-tab-content" border="" cellspacing="" cellpadding=""> + <tr> + <td> + <div class="layui-form-item layout-input"> + <label class="layui-form-label lableWidth">鏍囩鏉$爜锛�</label> + <div class="layui-input-block"> + <input id="boxNo" type="text" placeholder="璇锋壂鎻忔爣绛炬潯鐮�" autocomplete="off" + class="layui-input"> + </div> + </div> + </td> + </tr> + </table> + </div> + <div id="" class="layout-tab-page"> + <table class="layout-tab-content" border="" cellspacing="" cellpadding=""> + <tr> + <td> + <table class="tbl-box-sim-info" border="" cellspacing="" cellpadding=""> + <tr> + <td> + <div class="layui-form-item"> + <label class="layui-form-label lableWidth">寰呮嫞鏁伴噺锛�</label> + <div class="layui-input-block"> + <input id="pickQty" type="text" lay-verify="" disabled + placeholder="" class="layui-input"> + </div> + </div> + </td> + <td> + <div class="layui-form-item"> + <label class="layui-form-label lableWidth">宸叉壂鏁伴噺锛�</label> + <div class="layui-input-block"> + <input id="scanQty" type="text" lay-verify="" disabled + placeholder="" class="layui-input"> + </div> + </div> + </td> + + </tr> + </table> + </td> + </tr> + </table> + <table class="layout-tab-content"> + <tr> + <td style="width: 33%;"></td> + <td> + <button class="layout-btn layout-btn-red" lang type="button" lay-submit + lay-filter="formPickScatter">鎷h揣</button> + </td> + <td style="width: 33%;"></td> + + </tr> + </table> + <div id="" style="text-align: right;margin-top: 10px; display: none;"> + <div id="" class="cut-line"> + <img src="/assets/fengexian.png"> + </div> + </div> + </div> + + </form> + </div> + + <div class="layout-tbl-paging" id=""> + <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> + <tr id="tableHead"> + <th style="width: 54%;">鏍囩鏉$爜</th> + <th style="width: 20%;">鏁伴噺</th> + </tr> + <tr id="boxCell" style="display: none;"> + <td name="boxNo">AG000001</td> + <td name="qty">30</td> + </tr> + </table> + + </div> + + </div> + + </div> + + + <script src="/js/jquery-3.5.1.min.js"></script> + <script src="/layui/layui.js"></script> + <script src="/js/jquery.cookie.js"></script> + <script src="/js/public.js"></script> + + <script> + layui.use(['form', 'jquery'], function () { + var form = layui.form; + + /* 鏍囩鍒囨崲浠g爜 */ + + var xianshiyemian = 0; + + + var boxes = []; + var scanQty=0; + //鏄惁鏁存墭鎷h揣 + var isContinue = "0"; + var tableData = null + var tableData2 = null + var canPickBox = true + $("#palletNo").focus();//鍏夋爣榛樿閫変腑 + + function clear1() { + $('#outModel').val("");//鍑哄簱鍙� + $('#standard').val("");//瑙勬牸 + + $('#pickQty').val("");//寰呮嫞鏁伴噺 + } + function clear2() { + //鐗╂枡鎵规 + $("#skuLotNo").empty() + $("#skuLotNo").append('<option value =>' + '</option>'); + form.render('select'); + } + function clear3() { + $("#planQty").val(""); //璁″垝鏁伴噺 + $("#finishQty").val("");//瀹屾垚鏁伴噺 + } + function clear4() { + $('#boxNo').val("");//绠辩爜 + $('#boxQty').val("");//绠卞唴鏁伴噺 + } + //褰撴墭鐩樻潯鐮佽緭鍏ユ鏂囨湰鏀瑰彉鏃�,妫�鏌ヤ竴涓嬫墭鐩樼姸鎬� + $("#palletNo").on('input', function () { + + if ($("#palletNo").val() == "" || $("#palletNo").val().length < 8) { + return + } + if ($("#palletNo").val().length >= 8) { + $("#palletNo").val($("#palletNo").val().substr(-8)) + } + checkPalletState() + }) + + form.on('switch(IsZhengTuo)', function (obj) { + if (obj.elem.checked) { + $('#BoxDIv').attr("style", "display:none") + isContinue = "1"; + } else { + $('#BoxDIv').attr("style", "display:block") + isContinue = "0"; + } + $('#boxNo').val(""); + }); + + //绠辩爜鏂囨湰妗嗗洖杞︿簨浠� + $("#boxNo").blur(function () { + + }); + //褰撶鐮佽緭鍏ユ鏂囨湰鏀瑰彉鏃� + $("#boxNo").on('input', function () { + if ($("#boxNo").val() == "" || $("#boxNo").val().length < 20) { + return + } + if ($("#palletNo").val() == "" || $("#palletNo").val().length < 8) { + layer.msg("璇峰厛鎵弿鎵樼洏鏉$爜", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + //鍥炶皟 + }); + $("#boxNo").val('') + return; + } + var box; + if ($("#boxNo").val().length >= 20) { + var boxNum=0; + var param = { + "PalletNo": $("#palletNo").val(), + "BoxNo":$("#boxNo").val() + } + synData(IP + "/PdaSo/CheckBoxForPick", param, 'get', function (res) { + if (res.code == 0) { //鎴愬姛 + boxNum=res.data + box={BoxNo: $("#boxNo").val(), Qty:boxNum } + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + return; + } + }); + + var isExist = boxes.some(function(item) { + return item.BoxNo === box.BoxNo; + }); + if (isExist) { + layer.msg("璇ユ潯鐮佸凡鎵弿锛�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + //鍥炶皟 + }); + $("#boxNo").val('') + return; + } + boxes.push(box); + tableData = deepCopy(boxes) + refreshTable(tableData) + $("#boxNo").val('') + + scanQty=scanQty+boxNum + $('#scanQty').val(scanQty); + } + }) + + //妫�鏌ユ墭鐩樼姸鎬� + function checkPalletState() { + + var param = { + "PalletNo": $("#palletNo").val() + } + synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) { + + if (res.code == 0) { //鎴愬姛 + updateBillList(); + if ($('#bar').val() == "") { + clear1(); + return; + } else { + updateSkuLotNoList(); + updateQtyList(); + getBar(); + } + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + //涓嬫媺鍗曟嵁閫変腑鍚庝簨浠� + form.on('select(getbar)', function (data) { + if ($('#palletNo').val() == "") { + layer.msg("璇疯緭鍏ユ墭鐩樻潯鐮�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + //鍥炶皟 + }); + return + } + if ($('#bar').val() == "") { + clear1(); + clear2(); + clear3(); + return + } + updateSkuLotNoList(); + updateQtyList(); + getBar(); + }); + //涓嬫媺鐗╂枡鎵规閫変腑鍚庝簨浠� + form.on('select(getSkuLotNo)', function (data) { + if ($('#palletNo').val() == "") { + layer.msg("璇疯緭鍏ユ墭鐩樻潯鐮�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + clear1(); + clear3(); + }); + return + } + if ($('#skuLotNo').val() == "") { + clear1(); + clear3(); + return + } + updateQtyList(); + getBar(); + }); + + //鍒濆鍖栨覆鏌� 鍑哄簱鍗� + function updateBillList() { + + $("#bar").empty() + $("#bar").append('<option value =>' + '</option>'); + form.render('select'); + + var param = { + PalletNo: $("#palletNo").val(), + }; + synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + console.log(res.data); + for (var i = 0; i < res.data.length; i++) { + if (i == 0) { + $("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>'); + } else { + $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); + } + } + form.render('select'); + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + } + }); + } + + //鍒濆鍖栨覆鏌� 鐗╂枡-鎵规 + function updateSkuLotNoList() { + clear2(); + + var param = { + PalletNo: $("#palletNo").val(), + SoNo: $("#bar").val(), + }; + synData(IP + "/PdaSo/GetSoSkuLotNoListByPallet", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + for (var i = 0; i < res.data.length; i++) { + if (i == 0) { + $("#skuLotNo").append('<option value =' + res.data[i].SoDetailId + ' selected>' + res.data[i].SkuName + " - " + res.data[i].LotNo + '</option>'); + + } else { + $("#skuLotNo").append('<option value =' + res.data[i].SoDetailId + '>' + res.data[i].SkuName + " - " + res.data[i].LotNo + '</option>'); + } + } + form.render('select'); + + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + + //鍒濆鍖栨覆鍗曟嵁鐨勮鍒掓暟閲忓拰瀹屾垚鏁伴噺 + function updateQtyList() { + clear3(); + var param = { + SoDetailId: $("#skuLotNo").val(), + }; + synData(IP + "/PdaSo/GetPlanAndFinishQty", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + console.log(res.data); + $("#planQty").val(res.data.PlanQty) + $("#finishQty").val(res.data.FinishQty) + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + + //鏍规嵁鍗曟嵁鑾峰彇鍑哄簱鍙� + function getBar() { + clear1(); + + var param = { + PalletNo: $("#palletNo").val(), + SoDetailId: $("#skuLotNo").val(), + } + synData(IP + "/PdaSo/GetOutlets", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + let data = res.data + console.log(res.data); + $('#outModel').val(res.data.OutModel); + $('#standard').val(res.data.Standard); + + $('#pickQty').val(res.data.PickQty); + } else { //涓嶆垚鍔� + if ($("#planQty").val() == $("#finishQty").val()) { + return; + } + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + + } + + //娓叉煋琛ㄦ牸鏁版嵁 + function refreshTable(list) { + //鍏堟竻绌轰竴涓嬩俊鎭垪琛� + let trs = $("#tableBoxList tr") + let len = trs.length + for (i = len - 1; i >= 2; i--) { + trs[i].remove(); + } + + if (list != null && list.length > 0) { //鎴愬姛 + + var arrTrs = new Array() + let idx = 0 + for (var i in list) { + // list[i].BoxCode + var tr = $("#boxCell").eq(0).clone(); + tr.appendTo("#tableBoxList"); + // tr.attr('id', list[i].BoxCode) + idx++; + tr.attr('index', idx) + tr.find("td[name='boxNo']").html(list[i].BoxNo); + tr.find("td[name='qty']").html(list[i].Qty); + + tr.show(); + arrTrs[i] = tr + } + canPickBox = true + + } else { //涓嶆垚鍔� + layer.msg("鏃犳暟鎹�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + // $("#boxNum").val(0) + } + } + //鍗曟嫞璐э紙纭鎸夐挳锛� + form.on('submit(formPickScatter)', function (data) { + + if ($('#bar').val() == "") { + layer.msg("璇烽�夋嫨鍑哄簱鍗�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#bar').val() == "") { + layer.msg("璇烽�夋嫨鐗╂枡-鎵规", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#palletNo').val() == "") { + layer.msg("璇疯緭鍏ユ墭鐩樼爜", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if (isContinue == "0") { + if ($('#boxNo').val() == "") { + layer.msg("璇疯緭鍏ョ鐮�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); return; + } + if ($('#boxQty').val() == "") { + layer.msg("绠卞唴鏁伴噺涓虹┖锛屼笉鑳芥嫞璐�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + } + if (canPickBox == false) { + + layer.msg("璇锋眰鏈畬鎴愶紝涓嶈閲嶅璇锋眰", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + reqPickScatter() + + return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� + }); + + //纭鎷h揣 + function reqPickScatter() { + var param = { + "SoNo": $("#bar").val(), + "SoDetailId": $("#skuLotNo").val(), + "PalletNo": $('#palletNo').val(), + "BoxNo": $('#boxNo').val() + } + sendData(IP + "/PdaSo/SoSetPick", param, 'post', function (res) { + //console.log(res); + + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + canPickBox = true//鍥炶皟 + $("#boxNo").val(''); + updateQtyList(); + getBar(); + }); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + canPickBox = true;//鍥炶皟 + }); + } + }); + } + + //---------------------------------------------------------------------------------- + //涓婚〉鍙婇噸鏂扮櫥褰� + $("#menuImg").click(function (e) { + //console.log("menuImg") + e.stopPropagation() + + if ($("#menuList").is(":hidden")) { + $("#menuList").show() + } else { + $("#menuList").hide() + } + }) + $('body').click(function () { + // //console.log("body") + $("#menuList").hide() + }) + + }) + </script> +</body> + +</html> \ No newline at end of file diff --git a/Pda/js/public.js b/Pda/js/public.js index 7083b6a..9f55680 100644 --- a/Pda/js/public.js +++ b/Pda/js/public.js @@ -2,7 +2,7 @@ // var IP = "https://localhost:44368"; //var IP = "http://localhost:13243/api"; //var IP = "http://localhost:50515/api"; -var IP = "https://localhost:5001/api"; +var IP = "https://localhost:44363/api"; //var IP = "http://192.168.1.2:8017/"; // var IP = "http://192.168.10.112/WmsService/"; // var IP = "http://192.168.1.226:8086"; diff --git a/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs b/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs index 13e05ca..454a45e 100644 --- a/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs +++ b/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs @@ -65,6 +65,10 @@ /// </summary> public string AreaNo { get; set; } /// <summary> + /// 鐩爣鍌ㄤ綅 + /// </summary> + public string LocatNoEnd { get; set; } + /// <summary> /// 鍏ュ簱鍙� /// </summary> public string Ruku { get; set; } diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs index f854f15..ae98c96 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs @@ -325,6 +325,14 @@ CreateUser = 0, CreateTime = comTime }; + if (!string.IsNullOrEmpty(detail.Lot1)) + { + sd1.ProductionTime = Convert.ToDateTime(detail.Lot1);//鐢熶骇鏃ユ湡 + } + if (!string.IsNullOrEmpty(detail.Lot2)) + { + sd1.ExpirationTime = Convert.ToDateTime(detail.Lot2);//鍒版湡鏃ユ湡 + } var palletData = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == sd1.PalletNo && !string.IsNullOrEmpty(w.LocatNo)); if (palletData != null) { @@ -1188,7 +1196,15 @@ throw new Exception("鏈煡璇㈠埌鎵樼洏淇℃伅锛岃鏍稿疄锛�"); } // 楠岃瘉鍏ュ簱鍗曟槑缁嗘槸鍚﹀瓨鍦� - var detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailId && m.ASNNo == model.AsnNo && m.LotNo.Contains(model.LotNo)); + var detail = new BllArrivalNoticeDetail(); + if (string.IsNullOrEmpty(model.LotNo)) + { + detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailId && m.ASNNo == model.AsnNo); + } + else + { + detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailId && m.ASNNo == model.AsnNo && m.LotNo.Contains(model.LotNo)); + } if (detail == null) { throw new Exception("褰撳墠鐗╂枡鍙婃壒娆′笌鍗曟嵁鏃犲叧鑱旓紝璇锋牳瀹�!"); @@ -1327,14 +1343,23 @@ throw new Exception("褰撳墠鎵樼洏鍚湁璐存爣鐗╂枡淇℃伅锛屼笉鑳界粍鎵�"); } // 鍒ゆ柇搴撳瓨鏄庣粏鏄惁宸叉湁姝ゆ墭鐩樹俊鎭� - var sd1 = Db.Queryable<DataStockDetail>() - .First(m => m.IsDel == "0" && m.ASNDetailNo == bind.ASNDetailNo && m.PalletNo == model.PalletNo && m.SkuNo == detail.SkuNo && m.LotNo == bind.LotNo); + var sd1 = new DataStockDetail(); + if (!string.IsNullOrEmpty(bind.LotNo)) + { + sd1 = Db.Queryable<DataStockDetail>() + .First(m => m.IsDel == "0" && m.PalletNo == model.PalletNo && m.SkuNo == detail.SkuNo && m.LotNo == bind.LotNo);//&& m.ASNDetailNo == bind.ASNDetailNo + } + else + { + sd1 = Db.Queryable<DataStockDetail>() + .First(m => m.IsDel == "0" && m.PalletNo == model.PalletNo && m.SkuNo == detail.SkuNo);// && m.ASNDetailNo == bind.ASNDetailNo + } var sdId1 = 0; if (sd1 != null) { sdId1 = sd1.Id; // 搴撳瓨宸插瓨鍦� 鏇存柊鏁版嵁 - sd1.Qty = bind.Qty; + sd1.Qty += bind.Qty; sd1.CompleteTime = comTime; sd1.UpdateUser = userId; sd1.UpdateTime = comTime; diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs index 2455d1f..57dbec8 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs @@ -836,7 +836,7 @@ if (models.WareHouseNo == "W02") { - storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04" && (w.AreaNo == "B01" || w.AreaNo == "B02")).OrderBy(o => o.AreaNo).ToListAsync(); + storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04" && (w.AreaNo == "B01" || w.AreaNo == "B02" || w.AreaNo == "B05")).OrderBy(o => o.AreaNo).ToListAsync(); } else { @@ -845,6 +845,29 @@ } return storageArea; + } + /// <summary> + /// 鏍规嵁鍖哄煙鍙疯幏鍙栧偍浣嶅湴鍧�闆嗗悎 + /// </summary> + /// <param name="areaNo"></param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public List<string> GetLocatByArea(string areaNo) + { + try + { + if (string.IsNullOrEmpty(areaNo)) + { + throw new Exception("璇烽�夋嫨鍖哄煙"); + } + var _list = Db.Queryable<SysStorageLocat>().Where(w => w.IsDel == "0" && w.AreaNo == areaNo && w.WareHouseNo == "W04").Select(s => s.LocatNo).ToList(); + + return _list; + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } } /// <summary> /// 鑾峰彇宸插垎閰嶇殑鍑哄簱鍗曟嵁 @@ -1056,7 +1079,7 @@ } }*/ - public async Task AgvTransport(string palletNo, string areaNo, string ruku, string url, int userId) + public async Task AgvTransport(string palletNo, string areaNo,string locatNoEnd, string ruku, string url, int userId) { try { @@ -1091,7 +1114,14 @@ { throw Oops.Bah("鎵�閫夊尯鍩熶俊鎭笉瀛樺湪,璇锋鏌�!"); } - EndLocat = await GetLocat(areaNo); + if (!string.IsNullOrEmpty(locatNoEnd)) + { + EndLocat = locatNoEnd;//鎸囧畾鍌ㄤ綅鍦板潃 + } + else + { + EndLocat = await GetLocat(areaNo);//绯荤粺鍒嗛厤鍌ㄤ綅鍦板潃 + } } else { @@ -1106,9 +1136,9 @@ { throw Oops.Bah("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); } - if (stockDetail.WareHouseNo != "W04") + if (stockDetail.WareHouseNo != "W04" && stockDetail.WareHouseNo != "W02") { - throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!"); + throw Oops.Bah("璇ユ墭鐩樻湭鍦ㄥ钩搴撴垨璐ф灦搴撳唴,璇锋鏌�!"); } //璧峰鍌ㄤ綅淇℃伅 @@ -1120,7 +1150,7 @@ //鐩爣鍌ㄤ綅淇℃伅 //var storageLocatEnd = new SysStorageLocat(); - var storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0"); + var storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.WareHouseNo == "W04" && w.AreaNo == areaNo); if (storageLocatEnd == null) { throw Oops.Bah("鐩爣鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); diff --git a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs index d0ca543..79fec1e 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs @@ -23,6 +23,7 @@ using System.Threading.Tasks; using Utility; using WMS.BLL.Logic; +using System.Web; namespace WMS.BLL.BllPdaServer { @@ -2093,6 +2094,49 @@ return list; } + /// <summary> + /// 鍑哄簱鎷h揣鑾峰彇鎵弿鏍囩鏁伴噺 + /// </summary> + /// <param name="palletNo"></param> + /// <param name="boxNo"></param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public decimal CheckBoxForPick(string palletNo ,string boxNo) + { + try + { + decimal boxNum = 0; + if (string.IsNullOrEmpty(palletNo)) + { + throw new Exception("鎵樼洏鏉$爜涓嶅彲涓虹┖!"); + } + if (string.IsNullOrEmpty(boxNo)) + { + throw new Exception("鏍囩鏉$爜涓嶅彲涓虹┖!"); + } + var boxInfo = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.BoxNo == boxNo && w.PalletNo == palletNo).ToList(); + if (boxInfo.Count <= 0) + { + boxInfo = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.BoxNo2 == boxNo && w.PalletNo == palletNo).ToList(); + if (boxInfo.Count <= 0) + { + boxInfo = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.BoxNo3 == boxNo && w.PalletNo == palletNo).ToList(); + } + } + if (boxInfo == null || boxInfo.Count <= 0) + { + throw new Exception("鏍囩鏉$爜鏈湪璇ユ墭鐩樺唴!"); + } + boxNum = boxInfo.Sum(s => s.Qty); + + return boxNum; + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + //鑾峰彇搴撳唴鏃犵鐮佺殑鎵樼洏鍒嗛厤淇℃伅 public async Task<List<BoxInfo>> GetAllotPlnInfo(string soDetailId, string palletNo) { @@ -2830,6 +2874,11 @@ throw Oops.Bah("杩芥函鏉$爜鍜屾嫞璐ф暟閲忎笉鑳藉悓鏃惰緭鍏�"); } boxInfos = await boxInfo.ToListAsync(); + + if (boxInfos[0].SkuNo != allot.SkuNo || boxInfos[0].LotNo != allot.LotNo) + { + throw Oops.Bah("绠辩爜鐗╂枡鎵规鍜岄�夋嫨鐗╂枡鎵规涓嶄竴鑷达紒"); + } var comDetailList = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == allot.Id && m.PalletNo == palletNo).ToList(); if (biaoShi == "2") //鏁f敮鎷h揣 @@ -3669,7 +3718,7 @@ { throw Oops.Bah("鏈幏鍙栧埌瀵瑰簲鍌ㄤ綅淇℃伅锛岃妫�鏌�!"); } - if (locat.Status != "3") + if (locat.Status != "1") { throw Oops.Bah("褰撳墠鍌ㄤ綅涓嶆槸鏈夌墿鍝侊紝璇锋鏌�!"); } @@ -3752,7 +3801,7 @@ #region 娣诲姞鍑哄簱鎿嶄綔鏃ュ織璁板綍淇℃伅 //娣诲姞鎿嶄綔鏃ュ織璁板綍 - var k = new OperationSOServer().AddLogOperationSo("鍑哄簱浣滀笟", "鎷h揣鏄庣粏", soNo, "瀹屾垚", $"鐢≒DA瀹屾垚浜嗗崟鎹彿涓簕soNo}鐨勫钩搴撳嚭搴�", userId); + var k = new OperationSOServer().AddLogOperationSo("鍑哄簱浣滀笟", "鎷h揣鏄庣粏", palletNo, "瀹屾垚", $"鐢≒DA瀹屾垚浜嗘墭鐩樺彿涓簕palletNo}鐨勫钩搴撳嚭搴�", userId); #endregion diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs index 139e9d3..706d873 100644 --- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs +++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs @@ -1067,10 +1067,10 @@ inspectStatus = "0,1"; break; case "9"://鐢熶骇棰嗘枡鍑哄簱 - if (house != "W02") - { - throw new Exception("鐢熶骇棰嗘枡鍑哄簱鍙兘閫夋嫨鍘熸枡搴�"); - } + //if (house != "W02") + //{ + // throw new Exception("鐢熶骇棰嗘枡鍑哄簱鍙兘閫夋嫨鍘熸枡搴�"); + //} skuType = "(0,1,3)"; inspectStatus = "1"; break; @@ -1187,10 +1187,10 @@ switch (model.WareHouseNo) { case "W01"://鎴愬搧搴� - if (skuList.Any(m => m.Type != "2")) - { - throw new Exception("浠撳簱涓庡嚭搴撶墿鏂欎笉绗�"); - } + //if (skuList.Any(m => m.Type != "2")) + //{ + // throw new Exception("浠撳簱涓庡嚭搴撶墿鏂欎笉绗�"); + //} break; case "W02"://鍘熸枡搴� if (skuList.Any(m => m.Type == "2")) @@ -3338,6 +3338,22 @@ throw new Exception(e.Message); } } + public string GetHouseByPalletNo(string palletNo) + { + try + { + var datail = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.PalletNo == palletNo); + if (datail == null) + { + throw new Exception("鏈煡璇㈠埌鎵樼洏淇℃伅"); + } + return datail.WareHouseNo; + } + catch (Exception e) + { + throw new Exception(e.Message); + } + } public List<OutCommandDto> IssueOutHouseLk(string soNo, string outMode, int userId, string url, out string str) { diff --git a/Wms/WMS.BLL/HttpServer.cs b/Wms/WMS.BLL/HttpServer.cs index ba26307..7ca3643 100644 --- a/Wms/WMS.BLL/HttpServer.cs +++ b/Wms/WMS.BLL/HttpServer.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading.Tasks; using Utility.Tools; using WMS.BLL.Logic; using WMS.BLL.LogServer; @@ -1992,7 +1993,64 @@ throw new Exception(e.Message); } } + /// <summary> + /// PDA骞冲簱涓嬪彂鍑哄簱 + /// </summary> + /// <param name="soNo"></param> + /// <param name="detailId"></param> + /// <param name="palletNo"></param> + /// <param name="userId"></param> + /// <exception cref="Exception"></exception> + public void IssueOutHousePk(string soNo, string detailId, string palletNo, int userId) + { + try + { + var notice = Db.Queryable<BllExportNotice>().First(m => m.SONo == soNo && m.IsDel == "0"); + if (notice == null) + { + throw new Exception($"鏈壘鍒皗soNo}鍑哄簱鍗曚俊鎭�"); + } + var detail=Db.Queryable<DataStockDetail>().First(m => m.PalletNo == palletNo && m.IsDel == "0"); + if (detail.WareHouseNo != "W04") + { + throw new Exception("浠撳簱鍙烽敊璇�"); + } + var intDetailId = int.Parse(detailId); + if (intDetailId <= 0) + { + throw new Exception("閫夋嫨鐨勫嚭搴撳崟鏄庣粏鍙傛暟閿欒"); + } + //寮�鍚簨鍔� + Db.BeginTran(); + notice.Status = "3";//姝e湪杩涜 + Db.Updateable(notice).ExecuteCommand(); + + //鎵�鏈夎鍑哄簱鐨勫嚭搴撳垎閰嶄俊鎭�(鏈笅鍙戠殑淇℃伅鍜屽緟鎷h揣鐨勪俊鎭�) + var allot = Db.Queryable<BllExportAllot>().Where(a => a.IsDel == "0" && a.PalletNo == palletNo && a.Status == "0").ToList(); + if (allot == null || allot.Count <= 0) //鍒ゆ柇鏄惁鏈夐渶瑕佷笅鍙戠殑鍑哄簱娴佹按 + { + throw new Exception("褰撳墠鍑哄簱鍗曟嵁鏃犻渶瑕佷笅鍙戠殑鎵樼洏"); + } + //鍑哄簱娴佹按锛堟洿鏀圭姸鎬侊級 + foreach (var item in allot) + { + item.Status = "2"; + Db.Updateable(item).ExecuteCommand(); + } + + //娣诲姞鎿嶄綔鏃ュ織璁板綍 + var k = new OperationSOServer().AddLogOperationSo("PDA妯″潡", "涓嬪彂鍑哄簱", soNo, "鍑哄簱", $"鐐瑰嚮鍑哄簱鎸夐挳鍑哄簱鍗曞彿涓猴細{soNo}鐨勫嚭搴撳崟", userId); + //鎻愪氦浜嬪姟 + Db.CommitTran(); + } + catch (Exception e) + { + //鍥炴粴浜嬪姟 + Db.RollbackTran(); + throw new Exception(e.Message); + } + } #region MyRegion diff --git a/Wms/WMS.BLL/SysServer/StorageAreaServer.cs b/Wms/WMS.BLL/SysServer/StorageAreaServer.cs index aafcdac..31d77b9 100644 --- a/Wms/WMS.BLL/SysServer/StorageAreaServer.cs +++ b/Wms/WMS.BLL/SysServer/StorageAreaServer.cs @@ -155,24 +155,35 @@ return str; } //鑾峰彇绔嬩綋搴撴渶澶х紪鐮� - var area = Db.Queryable<SysStorageArea>().Where(a => a.IsDel == "0").OrderByDescending(a=>a.CreateTime).First(); - //楠岃瘉鏄惁瀛樺湪鍖哄煙淇℃伅 - if (area == null) + var area = new SysStorageArea(); + string areaStr = "A"; + if (model.WareHouseNo == "W04") { - model.AreaNo = "A01"; + area = Db.Queryable<SysStorageArea>().Where(a => a.IsDel == "0" && a.WareHouseNo == "W04").OrderByDescending(a => a.CreateTime).First(); + areaStr = "B"; } else { - var arr = area.AreaNo.Split("A"); + area = Db.Queryable<SysStorageArea>().Where(a => a.IsDel == "0" && (a.WareHouseNo == "W01" || a.WareHouseNo == "W02")).OrderByDescending(a => a.CreateTime).First(); + } + + //楠岃瘉鏄惁瀛樺湪鍖哄煙淇℃伅 + if (area == null) + { + model.AreaNo = $"{areaStr}01"; + } + else + { + var arr = area.AreaNo.Split(areaStr); int a = int.Parse(arr[1]) + 1; //鍒ゆ柇鏄惁灏忎簬10 if (a < 10) { - model.AreaNo = "A0" + (int.Parse(arr[1]) + 1).ToString(); + model.AreaNo = $"{areaStr}0" + (int.Parse(arr[1]) + 1).ToString(); } else { - model.AreaNo = "A" + (int.Parse(arr[1]) + 1).ToString(); + model.AreaNo = $"{areaStr}" + (int.Parse(arr[1]) + 1).ToString(); } } diff --git a/Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs b/Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs index bae1ed5..c2b65d3 100644 --- a/Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs +++ b/Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs @@ -175,6 +175,8 @@ /// <returns>鍑哄簱鍗曠殑浠撳簱鍙�</returns> string GetHouseBySo(string soNo); + string GetHouseByPalletNo(string palletNo); + /// <summary> /// 涓嬪彂鍑哄簱 绔嬪簱 /// </summary> diff --git a/Wms/WMS.IBLL/IHttpServer.cs b/Wms/WMS.IBLL/IHttpServer.cs index d99d8df..1e43ff5 100644 --- a/Wms/WMS.IBLL/IHttpServer.cs +++ b/Wms/WMS.IBLL/IHttpServer.cs @@ -91,6 +91,16 @@ /// <param name="str"></param> /// <returns></returns> List<OutCommandDto> IssueOutHouseLk(string soNo, string detailId, string outMode, string palletNo, int userId, string url, out string str); + + /// <summary> + /// PDA骞冲簱涓嬪彂鍑哄簱 + /// </summary> + /// <param name="soNo"></param> + /// <param name="detailId"></param> + /// <param name="palletNo"></param> + /// <param name="userId"></param> + /// <exception cref="Exception"></exception> + void IssueOutHousePk(string soNo, string detailId, string palletNo, int userId); #endregion diff --git a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs index c4a75c5..ceaee97 100644 --- a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs +++ b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs @@ -110,6 +110,13 @@ /// <returns></returns> Task<List<SysStorageArea>> GetStorageArea(string palletNo); /// <summary> + /// 鏍规嵁鍖哄煙鍙疯幏鍙栧偍浣嶅湴鍧�闆嗗悎 + /// </summary> + /// <param name="areaNo"></param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + List<string> GetLocatByArea(string areaNo); + /// <summary> /// 鑾峰彇宸插垎閰嶇殑鍑哄簱鍗曟嵁 /// </summary> /// <returns></returns> @@ -133,7 +140,7 @@ /// <param name="areaNo"></param> /// <param name="ruku"></param> /// <param name="url"></param> - Task AgvTransport(string palletNo, string areaNo, string ruku, string url, int userId); + Task AgvTransport(string palletNo, string areaNo, string locatNoEnd, string ruku, string url, int userId); /// <summary> /// 鍛煎彨agv杞繍绌烘墭鐩� /// </summary> diff --git a/Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs b/Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs index 0c97f1d..c4f6de7 100644 --- a/Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs +++ b/Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs @@ -122,7 +122,14 @@ /// <param name="boxNo3">鏀�/琚嬬爜</param> /// <returns></returns> Task<List<BoxInfo>> GetDataComBoxInfo(string soDetailId, string palletNo, string boxNo, string boxNo3); - + /// <summary> + /// 鍑哄簱鎷h揣鑾峰彇鎵弿鏍囩鏁伴噺 + /// </summary> + /// <param name="palletNo"></param> + /// <param name="boxNo"></param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + decimal CheckBoxForPick(string palletNo, string boxNo); /// <summary> /// 鑾峰彇搴撳唴鏃犵鐮佺殑鎵樼洏鍒嗛厤淇℃伅 /// </summary> diff --git a/Wms/Wms/Controllers/DownApiController.cs b/Wms/Wms/Controllers/DownApiController.cs index 4fd62ab..8ba268b 100644 --- a/Wms/Wms/Controllers/DownApiController.cs +++ b/Wms/Wms/Controllers/DownApiController.cs @@ -174,23 +174,38 @@ { return Ok(new HttpReturnModel { Success = "-1", Message = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�"}); } - //楠岃瘉鍑哄簱鍙� - if (string.IsNullOrWhiteSpace(outMode)) - { - return Ok(new HttpReturnModel { Success = "-1", Message = "璇烽�夋嫨鍑哄簱鍦板潃" }); - } + var house = _exNoticeSvc.GetHouseBySo(soNo); + if (house != "W01") + { + house= _exNoticeSvc.GetHouseByPalletNo(palletNo); + } if (house == "W01") { + //楠岃瘉鍑哄簱鍙� + if (string.IsNullOrWhiteSpace(outMode)) + { + return Ok(new HttpReturnModel { Success = "-1", Message = "璇烽�夋嫨鍑哄簱鍦板潃" }); + } //var list = _exNoticeSvc.IssueOutHouseMk(soNo, outMode, int.Parse(userId), _config.WcsHost + _config.IssueComApiUrl, out string str); return Ok(new HttpReturnModel { Success = "0", Message = "str", Data = "list" }); } else if (house == "W02") { - var list = _http.IssueOutHouseLk(soNo,soDetailId, outMode,palletNo, int.Parse(userId), _config.WcsHost + _config.IssueComApiUrl, out string str); + //楠岃瘉鍑哄簱鍙� + if (string.IsNullOrWhiteSpace(outMode)) + { + return Ok(new HttpReturnModel { Success = "-1", Message = "璇烽�夋嫨鍑哄簱鍦板潃" }); + } + var list = _http.IssueOutHouseLk(soNo, soDetailId, outMode, palletNo, int.Parse(userId), _config.WcsHost + _config.IssueComApiUrl, out string str); - return Ok(new HttpReturnModel { Success = "0", Message = str, Data = list}); + return Ok(new HttpReturnModel { Success = "0", Message = str, Data = list }); + } + else if (house == "W04") + { + _http.IssueOutHousePk(soNo, soDetailId, palletNo, int.Parse(userId)); + return Ok(new HttpReturnModel { Success = "0", Message = "涓嬪彂鎴愬姛" }); } else { diff --git a/Wms/Wms/Controllers/PdaCrController.cs b/Wms/Wms/Controllers/PdaCrController.cs index ce952b6..130abd6 100644 --- a/Wms/Wms/Controllers/PdaCrController.cs +++ b/Wms/Wms/Controllers/PdaCrController.cs @@ -19,6 +19,7 @@ using Microsoft.Extensions.Options; using Model.ModelDto.DataDto; using Model.ModelDto; +using Model.ModelVm.BllSoVm; namespace Wms.Controllers { @@ -237,7 +238,26 @@ [UnitOfWork] public async Task AgvTransport(PdaAgvTransportVm model) { - await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, _config.WcsHost+ _config.IssueComApiUrl, _userManager.UserId); + await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.LocatNoEnd, model.Ruku, _config.WcsHost + _config.IssueComApiUrl, _userManager.UserId); + } + /// <summary> + /// 鏍规嵁鍖哄煙鍙疯幏鍙栧偍浣嶅湴鍧�闆嗗悎 + /// </summary> + /// <param name="areaNo"></param> + /// <returns></returns> + [HttpGet] + public IActionResult GetLocatByArea(string areaNo) + { + try + { + var _list = _pdaCrSvc.GetLocatByArea(areaNo); + + return Ok(new { code = 0, count = 0, msg = "鑾峰彇鎴愬姛", data = _list }); + } + catch (Exception e) + { + return Ok(new { code = 1, msg = e.Message }); + } } /// <summary> /// 鍛煎彨agv杞繍绌烘墭鐩� diff --git a/Wms/Wms/Controllers/PdaSoController.cs b/Wms/Wms/Controllers/PdaSoController.cs index 037cc83..7842726 100644 --- a/Wms/Wms/Controllers/PdaSoController.cs +++ b/Wms/Wms/Controllers/PdaSoController.cs @@ -153,6 +153,27 @@ } /// <summary> + /// 鍑哄簱鎷h揣鑾峰彇鎵弿鏍囩鏁伴噺 + /// </summary> + /// <param name="palletNo"></param> + /// <param name="boxNo"></param> + /// <returns></returns> + [HttpGet] + public IActionResult CheckBoxForPick(string palletNo, string boxNo) + { + try + { + var boxNum = _pdaSoSvc.CheckBoxForPick(palletNo, boxNo); + + return Ok(new { code = 0, msg = "鎷h揣鏄庣粏淇℃伅", data = boxNum }); + } + catch (Exception e) + { + return Ok(new { code = 1, msg = e.Message }); + } + } + + /// <summary> /// 鍑哄簱pda鎷h揣 /// </summary> /// <param name="model">SoDetailId:鍑哄簱鍗曟槑缁咺D銆丳alletNo:鎵樼洏鐮�</param> -- Gitblit v1.8.0