From d690043276ef1b0862d2a841f23dfcde2bb7384d Mon Sep 17 00:00:00 2001 From: Administrator <Administrator@DESKTOP-5BIMHQ3> Date: 星期二, 27 二月 2024 16:02:56 +0800 Subject: [PATCH] Merge branch 'wxw' --- Pda/View/HouseDataSetting/agvTransport.html | 383 +++++++++++++++++++++-------- Wms/Wms/Controllers/PdaCrController.cs | 123 +++++++++ Wms/Model/ModelVm/PdaVm/PdaCrVm.cs | 19 + Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs | 207 +++++++++++++++ Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs | 32 ++ 5 files changed, 659 insertions(+), 105 deletions(-) diff --git a/Pda/View/HouseDataSetting/agvTransport.html b/Pda/View/HouseDataSetting/agvTransport.html index cba3228..5c89e82 100644 --- a/Pda/View/HouseDataSetting/agvTransport.html +++ b/Pda/View/HouseDataSetting/agvTransport.html @@ -140,6 +140,10 @@ <div class="layui-input-block" id="selectRuku"> <select id="Ruku" lay-filter="getRuku" lay-search> <option value=""></option> + <option value="A">A</option> + <option value="B">B</option> + <option value="C">C</option> + <option value="D">D</option> </select> <img src="/assets/down_arraw.png"> </div> @@ -150,7 +154,7 @@ <td style="width: 23%;"></td> <td> <button class="layout-btn layout-btn-red" lang type="button" lay-submit - lay-filter="formBind">鍙皬杞�</button> + lay-filter="formCall">鍙皬杞�</button> </td> <td style="width: 33%;"></td> @@ -168,10 +172,10 @@ <div class="layout-tbl-paging" id=""> <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> <tr> - <th lang style="width: 15%;">缂栫爜</th> - <th lang style="width: 35%;">鍚嶇О</th> + <th lang style="width: 15%;">鐗╂枡缂栫爜</th> + <th lang style="width: 35%;">鐗╂枡鍚嶇О</th> <th lang style="width: 25%;">鎵规</th> - <th lang style="width: 15%;">鏁伴噺</th> + <th lang style="width: 15%;">鐗╂枡鏁伴噺</th> </tr> <tr id="boxCell" style="display: none;"> <td name="code">AG000001</td> @@ -208,11 +212,13 @@ <img src="/assets/down_arraw.png"> </div> </div> - <div id="" class="layui-form-item layout-input"> + <div id="" class="layui-form-item layout-dropdownlist"> <label class="layui-form-label" lang>鎵樼洏鏉$爜锛�</label> - <div class="layui-input-block"> - <input id="STOCKCODE1" type="text" lay-verify="stock" lang langholder - placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" autocomplete="off" class="layui-input"> + <div class="layui-input-block" id="selectPalletNo"> + <select id="PalletNo" lay-filter="getPalletNo" lay-search> + <option value=""></option> + </select> + <img src="/assets/down_arraw.png"> </div> </div> <div id="" class="layui-form-item layout-dropdownlist"> @@ -230,7 +236,7 @@ <td style="width: 23%;"></td> <td> <button class="layout-btn layout-btn-red" lang type="button" lay-submit - lay-filter="formBind">鍙皬杞�</button> + lay-filter="formCall2">鍙皬杞�</button> </td> <td style="width: 33%;"></td> @@ -253,18 +259,12 @@ <th lang style="width: 35%;">鐗╂枡鍚嶇О</th> <th lang style="width: 25%;">鎵规</th> <th lang style="width: 15%;">鐗╂枡鏁伴噺</th> - <th lang style="width: 10%;">鎿嶄綔</th> </tr> <tr id="boxCell" style="display: none;"> <td name="code">AG000001</td> <td name="name">鐤嫍鍚嶇О鍚嶇О鍚嶇О</td> <td name="lotNo">鎵规鍙�</td> <td name="num">30</td> - <td name="del"> - <div id="" class="tbl-btn-del" lang> - 鍒犻櫎 - </div> - </td> </tr> </table> <!-- 鍒嗛〉 --> @@ -323,31 +323,6 @@ }); }); - - //娓呮鏂囨湰妗嗕腑鏁版嵁 - // function clear() { - // if (xianshiyemian == "0") - // { - // $("#BOXCODE").val(""); - // $("#BOXCODE2").val(""); - - // $("#ImportQuantity").val(""); - // $("#Standard").val(""); - // $("#ImportFactQuantity").val(""); - // $("#BoxQty").val(""); - // } - // else if (xianshiyemian == "1") - // { - // $("#BOXCODE").val(""); - // $("#BOXCODE2").val(""); - - // $("#ImportQuantity").val(""); - // $("#Standard").val(""); - // $("#ImportFactQuantity").val(""); - // $("#BoxQty").val(""); - // } - - // } /*鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��*/ @@ -420,6 +395,13 @@ }); return } + if ($("#LocatNo").val() == "") { + layer.msg('璇锋壂鎻忔纭殑鎵樼洏鏉$爜', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return + } var input = $('select[id="Quyu"]').next().find('.layui-select-title input') var val = input.val() //鍏堟洿鏂颁竴涓嬬洰鏍囧尯鍩� @@ -458,6 +440,53 @@ callback(res.data) } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() {}); + } + }); + } + + //鐐瑰嚮鍑哄簱鍗曟嵁涓嬫媺妗嗕簨浠� + $("#selectOutNo").click(function () { + var input = $('select[id="OutNo"]').next().find('.layui-select-title input') + var val = input.val() + //鍏堟洿鏂颁竴涓嬪嚭搴撳崟 + updateBillList(function (data) { + $('select[id="OutNo"]').next().addClass('layui-form-selected') + $('select[id="OutNo"]').next().find('.layui-select-title input').val(val) + }) + }) + + /* 缁戝畾鍑哄簱鍗曚俊鎭� */ + function updateBillList(callback) { + var input = $('select[id="OutNo"]').next().find('.layui-select-title input') + var val = input.val() + $("#OutNo").empty() + $("#OutNo").append('<option value =>' + '</option>'); + form.render('select'); + + var param = { + + }; + sendData(IP + "/PdaCr/GetRunSoNoticeList", param, 'get', function (res) { + if (res.code == 0) { //鎴愬姛 + for (var i = 0; i < res.data.length; i++) { + $("#OutNo").append('<option value =' + res.data[i] + '>' + res.data[i]+ + '</option>'); + } + form.render('select'); + + if (!val) { + $('#OutNo').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') + } else { + var sel = 'dd[lay-value=' + val + ']'; + $('#OutNo').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') + } + + callback(res.data) + } else { //涓嶆垚鍔� // layer.msg(res.msg, { // icon: 2, // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 @@ -465,45 +494,61 @@ } }); } + //閫変腑鍑哄簱鍗曚簨浠� + form.on('select(getOutNo)', function (data) { + $("#PalletNo").empty() + $("#PalletNo").append('<option value =>' + '</option>'); + form.render('select'); - //鐐瑰嚮鍑哄簱鍗曟嵁涓嬫媺妗嗕簨浠� - $("#selectOutNo").click(function () { - if (xianshiyemian == 1) { - var input = $('select[id="OutNo"]').next().find('.layui-select-title input') - var val = input.val() - //鍏堟洿鏂颁竴涓嬪叆搴撳崟 - updateBillList(function (data) { - $('select[id="OutNo"]').next().addClass('layui-form-selected') - $('select[id="OutNo"]').next().find('.layui-select-title input').val(val) - }) + $("#Quyu2").empty() + $("#Quyu2").append('<option value =>' + '</option>'); + form.render('select'); + + refreshTable() + }); + + //鐐瑰嚮鎵樼洏鏉$爜涓嬫媺妗嗕簨浠� + $("#selectPalletNo").click(function () { + if ($("#OutNo").val() == "") { + layer.msg('璇峰厛閫夋嫨鍑哄簱鍗�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return } + var input = $('select[id="PalletNo"]').next().find('.layui-select-title input') + var val = input.val() + + updatePalletNoList(function (data) { + $('select[id="PalletNo"]').next().addClass('layui-form-selected') + $('select[id="PalletNo"]').next().find('.layui-select-title input').val(val) + }) }) - /* 缁戝畾鍏ュ簱鍗曚俊鎭� */ - function updateBillList(callback) { - var input = $('select[id="OutNo"]').next().find('.layui-select-title input') + /* 缁戝畾鍑哄簱鍗曚笅鎵樼洏鏉$爜淇℃伅 */ + function updatePalletNoList(callback) { + var input = $('select[id="PalletNo"]').next().find('.layui-select-title input') var val = input.val() - $("#bar").empty() - $("#bar").append('<option value =>' + '</option>'); + $("#PalletNo").empty() + $("#PalletNo").append('<option value =>' + '</option>'); form.render('select'); var param = { - Type: "0,1,3" + soNo:$("#OutNo").val() }; - sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) { + sendData(IP + "/PdaCr/GetPalletNoListBySoNo", param, 'get', function (res) { if (res.code == 0) { //鎴愬姛 for (var i = 0; i < res.data.length; i++) { - $("#bar").append('<option value =' + res.data[i].ASNNo + '>' + res.data[i] - .ASNNo + + $("#PalletNo").append('<option value =' + res.data[i] + '>' + res.data[i]+ '</option>'); } form.render('select'); if (!val) { - $('#bar').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') + $('#PalletNo').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') } else { var sel = 'dd[lay-value=' + val + ']'; - $('#bar').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') + $('#PalletNo').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') } callback(res.data) @@ -516,6 +561,168 @@ }); } + //閫変腑鎵樼洏浜嬩欢 + form.on('select(getPalletNo)', function (data) { + refreshTable() + + $("#Quyu2").empty() + $("#Quyu2").append('<option value =>' + '</option>'); + form.render('select'); + }); + + //鐐瑰嚮鐩爣鍖哄煙涓嬫媺妗嗕簨浠� + $("#selectQuyu2").click(function () { + if ($("#PalletNo").val() == "") { + layer.msg('璇峰厛閫夋嫨鎵樼洏鏉$爜', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return + } + var input = $('select[id="Quyu2"]').next().find('.layui-select-title input') + var val = input.val() + //鍏堟洿鏂颁竴涓嬬洰鏍囧尯鍩� + updateQuyuList2(function (data) { + $('select[id="Quyu2"]').next().addClass('layui-form-selected') + $('select[id="Quyu2"]').next().find('.layui-select-title input').val(val) + }) + }) + + /* 缁戝畾鐩爣鍖哄煙淇℃伅 */ + function updateQuyuList2(callback) { + var input = $('select[id="Quyu2"]').next().find('.layui-select-title input') + var val = input.val() + $("#Quyu2").empty() + $("#Quyu2").append('<option value =>' + '</option>'); + form.render('select'); + + var param = { + "PalletNo": $("#PalletNo").val() + }; + sendData(IP + "/PdaCr/GetStorageArea", param, 'get', function (res) { + if (res.code == 0) { //鎴愬姛 + for (var i = 0; i < res.data.length; i++) { + $("#Quyu2").append('<option value =' + res.data[i].AreaNo + '>' + res.data[i] + .AreaNo + '-'+res.data[i].AreaName+ + '</option>'); + } + form.render('select'); + + if (!val) { + $('#Quyu2').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') + } else { + var sel = 'dd[lay-value=' + val + ']'; + $('#Quyu2').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') + } + + callback(res.data) + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() {}); + } + }); + } + + //鍛煎彨灏忚溅浜嬩欢 + form.on('submit(formCall)', function (data) { + if (xianshiyemian == 0) { + if ($("#STOCKCODE").val() == "") { + layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if ($("#LocatNo").val() == "") { + layer.msg('璇锋壂鎻忔纭殑鎵樼洏鏉$爜', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if ($("#Quyu").val() != "" && $("#Ruku").val() != "") { + layer.msg('鐩爣鍖哄煙鍜屽叆搴撳彛涓嶈兘鍚屾椂閫夋嫨', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + var param = { + PalletNo: $("#STOCKCODE").val(), + AreaNo: $("#Quyu").val(), + Ruku: $("#Ruku").val() + } + //鍛煎彨灏忚溅 + sendData(IP + "/PdaCr/AgvTransport", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + + }); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + //鍥炶皟 + }); + } + }); + } + else if (xianshiyemian == 1) { + if ($("#OutNo").val() == "") { + layer.msg('璇烽�夋嫨鍑哄簱鍗�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if ($("#PalletNo").val() == "") { + layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + if ($("#Quyu2").val() == "") { + layer.msg('璇烽�夋嫨鐩爣鍖哄煙', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + var param = { + SoNo: $("#OutNo").val(), //鍑哄簱鍗曟嵁 + PalletNo: $("#PalletNo").val(), //鎵樼洏鏉$爜 + AreaNo: $("#Quyu").val()//鐩爣鍖哄煙 + } + //鍛煎彨灏忚溅 + sendData(IP + "/PdaCr/AgvTransport2", param, 'post', function (res) { + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + + }); + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { + //鍥炶皟 + }); + } + }); + } + + return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� + }); + // 娓叉煋绠辩爜淇℃伅 function refreshTable() { @@ -527,13 +734,16 @@ for (i = len - 1; i >= 2; i--) { trs[i].remove(); } + if($("#STOCKCODE").val()==''){ + return; + } var param = { PalletNo: $("#STOCKCODE").val(), IsHuiKu:1 }; // 鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭� - sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) { + sendData(IP + "/PdaCr/GetSkuInfoByPalletNo", param, 'get', function (res) { if (res.code == 0) { //鎴愬姛 var list = res var arrTrs = new Array() @@ -572,15 +782,14 @@ for (i = len - 1; i >= 2; i--) { trs[i].remove(); } - - //璁剧疆鎵樼洏鍙� - $("#palletCode").val($.cookie('stockCode1')) - + if($("#PalletNo").val()==''){ + return; + } var param = { - PalletNo: $.cookie('stockCode1') + PalletNo: $("#PalletNo").val() }; // 鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭� - sendData(IP + "/PdaAsn/GetPalletBindInfo", param, 'post', function (res) { + sendData(IP + "/PdaCr/GetSkuInfoByPalletNo", param, 'get', function (res) { if (res.code == 0) { //鎴愬姛 var list = res var arrTrs = new Array() @@ -596,43 +805,7 @@ tr.find("td[name='code']").html(res.data[i].SkuNo); tr.find("td[name='name']").html(res.data[i].SkuName); tr.find("td[name='lotNo']").html(res.data[i].LotNo); - tr.find("td[name='num']").html(res.data[i].Qty); - tr.find("td[name='del']").click(function () { - var elem = $(this).parent() - // var boxno = elem.attr('boxno') - var BindNo = elem.attr('BindNo') - console.log(res) - var Id = elem.attr('id') - layer.alert("纭畾瑕佷粠鎵樼洏涓婂垹闄よ繖鎵樼墿鏂欏悧锛�<br>" + res.data[0].PalletNo, { - icon: 2, - time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - btn: ['鍒犻櫎', '鍙栨秷'], - yes: function () { - - var param = { - PalletNo: res.data[0].PalletNo, - }; - console.log(Id) - console.log(param) - sendData(IP + "/PdaAsn/DelPalletBind", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { - icon: 1, - time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - elem.remove() - setOrderGoods(); - refreshTable(); - } else { //涓嶆垚鍔� - layer.msg(res.msg, { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }, function () { }); - } - }); - } - }) - }) + tr.find("td[name='num']").html(res.data[i].Qty); tr.show(); arrTrs[i] = tr } diff --git a/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs b/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs index c80fa1e..d0d9661 100644 --- a/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs +++ b/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs @@ -45,4 +45,23 @@ public string BoxNo { get; set; } } + public class PdaAgvTransportVm + { + /// <summary> + /// 鍑哄簱鍗曞彿 + /// </summary> + public string SoNo { get; set; } + /// <summary> + /// 鎵樼洏鏉$爜 + /// </summary> + public string PalletNo { get; set; } + /// <summary> + /// 鐩爣鍖哄煙 + /// </summary> + public string AreaNo { get; set; } + /// <summary> + /// 鍏ュ簱鍙� + /// </summary> + public string Ruku { get; set; } + } } diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs index cda3452..e01b252 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs @@ -8,6 +8,7 @@ using WMS.BLL.LogServer; using WMS.Entity.BllAsnEntity; using WMS.Entity.BllCheckEntity; +using WMS.Entity.BllSoEntity; using WMS.Entity.Context; using WMS.Entity.DataEntity; using WMS.Entity.SysEntity; @@ -656,6 +657,10 @@ { throw new Exception("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); } + if (models.WareHouseNo != "W02") + { + throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!"); + } return models.LocatNo; } catch (Exception ex) @@ -682,6 +687,10 @@ { throw new Exception("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); } + if (models.WareHouseNo != "W02") + { + throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!"); + } var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == models.LocatNo); if (storageLocat == null) { @@ -703,6 +712,204 @@ throw new Exception(ex.Message); } } + /// <summary> + /// 鑾峰彇宸插垎閰嶇殑鍑哄簱鍗曟嵁 + /// </summary> + /// <returns></returns> + public List<string> GetRunSoNoticeList() + { + try + { + var allotList = Db.Queryable<BllExportNotice>().Where(m => m.IsDel == "0" && m.Status == "2").Select(m => m.SONo).Distinct().ToList(); + return allotList; + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + /// <summary> + /// 鏍规嵁鎵樼洏鍙疯幏鍙栨墭鐩樹笂鐗╂枡淇℃伅 + /// </summary> + /// <param name="palletNo"></param> + /// <returns></returns> + public List<DataStockDetail> GetSkuInfoByPalletNo(string palletNo) + { + try + { + if (string.IsNullOrEmpty(palletNo)) + { + throw new Exception("璇锋壂鎻忔墭鐩樻潯鐮侊紒"); + } + var skuInfoList = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).ToList(); + return skuInfoList; + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + /// <summary> + /// 鏍规嵁鍑哄簱鍗曞彿鑾峰彇鍒嗛厤鐨勬墭鐩樹俊鎭� + /// </summary> + /// <param name="soNo"></param> + /// <returns></returns> + public List<string> GetPalletNoListBySoNo(string soNo) + { + try + { + if (string.IsNullOrEmpty(soNo)) + { + throw new Exception("璇烽�夋嫨鍑哄簱鍗曞彿锛�"); + } + var palletNoList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SONo == soNo).Select(m => m.PalletNo).Distinct().ToList(); + return palletNoList; + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + + /// <summary> + /// agv杞繍鍛煎彨灏忚溅-寮�鍙戞湭瀹屾垚寰呯‘璁� + /// </summary> + /// <param name="palletNo"></param> + /// <param name="areaNo"></param> + /// <param name="ruku"></param> + public void AgvTransport(string palletNo, string areaNo, string ruku, int userId) + { + if (string.IsNullOrEmpty(palletNo)) + { + throw new Exception("璇锋壂鎻忔墭鐩樻潯鐮侊紒"); + } + if (string.IsNullOrEmpty(areaNo) && string.IsNullOrEmpty(ruku)) + { + throw new Exception("璇烽�夋嫨鐩爣鍖哄煙鎴栧叆搴撳彛锛�"); + } + try + { + var stockDetail = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo); + if (stockDetail == null) + { + throw new Exception("鎵樼洏搴撳瓨淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + if (string.IsNullOrEmpty(stockDetail.LocatNo)) + { + throw new Exception("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + if (stockDetail.WareHouseNo != "W02") + { + throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!"); + } + var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == stockDetail.LocatNo); + if (storageLocat == null) + { + throw new Exception("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + //寮�鍚簨鍔� + Db.BeginTran(); + //淇敼搴撳瓨鏄庣粏淇℃伅 + stockDetail.WareHouseNo = ""; + stockDetail.RoadwayNo = ""; + stockDetail.AreaNo = ""; + stockDetail.LocatNo = ""; + + Db.Updateable(stockDetail).ExecuteCommand(); + //淇敼鍌ㄤ綅鍦板潃鐘舵�� + storageLocat.Status = "0";//绌哄偍浣� + + Db.Updateable(storageLocat).ExecuteCommand(); + + #region 鍛煎彨灏忚溅浠g爜 + + #endregion + //鎻愪氦浜嬪姟 + Db.CommitTran(); + } + catch (Exception ex) + { + Db.RollbackTran(); + throw new Exception(ex.Message); + } + } + /// <summary> + /// agv杞繍鍛煎彨灏忚溅鍙栬揣-寮�鍙戞湭瀹屾垚寰呯‘璁� + /// </summary> + /// <param name="soNo"></param> + /// <param name="palletNo"></param> + /// <param name="areaNo"></param> + /// <param name="userId"></param> + public void AgvTransport2(string soNo,string palletNo, string areaNo, int userId) + { + if (string.IsNullOrEmpty(soNo)) + { + throw new Exception("璇烽�夋嫨鍑哄簱鍗曟嵁锛�"); + } + if (string.IsNullOrEmpty(palletNo)) + { + throw new Exception("璇锋壂鎻忔墭鐩樻潯鐮侊紒"); + } + if (string.IsNullOrEmpty(areaNo)) + { + throw new Exception("璇烽�夋嫨鐩爣鍖哄煙锛�"); + } + try + { + var notice = Db.Queryable<BllExportNotice>().First(w => w.IsDel == "0" && w.SONo == soNo); + if (notice == null) + { + throw new Exception("鍑哄簱鍗曟嵁淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + var allot = Db.Queryable<BllExportAllot>().First(w => w.IsDel == "0" && w.SONo == soNo && w.PalletNo == palletNo); + if (allot == null) + { + throw new Exception("璇ユ墭鐩樺嚭搴撳垎閰嶄俊鎭笉瀛樺湪,璇锋鏌�!"); + } + var stockDetail = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo); + if (stockDetail == null) + { + throw new Exception("鎵樼洏搴撳瓨淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + if (string.IsNullOrEmpty(stockDetail.LocatNo)) + { + throw new Exception("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + if (stockDetail.WareHouseNo != "W02") + { + throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!"); + } + var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == stockDetail.LocatNo); + if (storageLocat == null) + { + throw new Exception("鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + //寮�鍚簨鍔� + Db.BeginTran(); + //淇敼搴撳瓨鏄庣粏淇℃伅 + stockDetail.WareHouseNo = ""; + stockDetail.RoadwayNo = ""; + stockDetail.AreaNo = ""; + stockDetail.LocatNo = ""; + + Db.Updateable(stockDetail).ExecuteCommand(); + //淇敼鍌ㄤ綅鍦板潃鐘舵�� + storageLocat.Status = "0";//绌哄偍浣� + + Db.Updateable(storageLocat).ExecuteCommand(); + + #region 鍛煎彨灏忚溅浠g爜 + + #endregion + //鎻愪氦浜嬪姟 + Db.CommitTran(); + } + catch (Exception ex) + { + Db.RollbackTran(); + throw new Exception(ex.Message); + } + } #endregion } diff --git a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs index d3eab85..73083ca 100644 --- a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs +++ b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs @@ -104,6 +104,38 @@ /// <param name="palletNo"></param> /// <returns></returns> List<SysStorageArea> GetStorageArea(string palletNo); + /// <summary> + /// 鑾峰彇宸插垎閰嶇殑鍑哄簱鍗曟嵁 + /// </summary> + /// <returns></returns> + List<string> GetRunSoNoticeList(); + /// <summary> + /// 鏍规嵁鎵樼洏鍙疯幏鍙栨墭鐩樹笂鐗╂枡淇℃伅 + /// </summary> + /// <param name="palletNo"></param> + /// <returns></returns> + List<DataStockDetail> GetSkuInfoByPalletNo(string palletNo); + /// <summary> + /// 鏍规嵁鍑哄簱鍗曞彿鑾峰彇鍒嗛厤鐨勬墭鐩樹俊鎭� + /// </summary> + /// <param name="soNo"></param> + /// <returns></returns> + List<string> GetPalletNoListBySoNo(string soNo); + /// <summary> + /// agv杞繍鍛煎彨灏忚溅 + /// </summary> + /// <param name="palletNo"></param> + /// <param name="areaNo"></param> + /// <param name="ruku"></param> + void AgvTransport(string palletNo, string areaNo, string ruku, int userId); + /// <summary> + /// agv杞繍鍛煎彨灏忚溅鍙栬揣 + /// </summary> + /// <param name="soNo"></param> + /// <param name="palletNo"></param> + /// <param name="areaNo"></param> + /// <param name="userId"></param> + void AgvTransport2(string soNo, string palletNo, string areaNo, int userId); #endregion } } diff --git a/Wms/Wms/Controllers/PdaCrController.cs b/Wms/Wms/Controllers/PdaCrController.cs index da4c8d6..8704a51 100644 --- a/Wms/Wms/Controllers/PdaCrController.cs +++ b/Wms/Wms/Controllers/PdaCrController.cs @@ -278,6 +278,129 @@ } } + /// <summary> + /// 鑾峰彇鎵樼洏鎵�鍦ㄦゼ灞傛墍鏈夊尯鍩� + /// </summary> + /// <returns></returns> + [HttpGet] + public IActionResult GetRunSoNoticeList() + { + try + { + List<string> result = _pdaCrSvc.GetRunSoNoticeList(); + + return Ok(new { data = result, code = 0, msg = "鎴愬姛" }); + } + catch (Exception e) + { + return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" }); + } + + } + /// <summary> + /// 鏍规嵁鎵樼洏鍙疯幏鍙栨墭鐩樹笂鐗╂枡淇℃伅 + /// </summary> + /// <param name="palletNo"></param> + /// <returns></returns> + [HttpGet] + public IActionResult GetSkuInfoByPalletNo(string palletNo) + { + try + { + List<DataStockDetail> result = _pdaCrSvc.GetSkuInfoByPalletNo(palletNo); + + return Ok(new { data = result, code = 0, msg = "鎴愬姛" }); + } + catch (Exception e) + { + return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" }); + } + + } + /// <summary> + /// 鏍规嵁鍑哄簱鍗曞彿鑾峰彇鍒嗛厤鐨勬墭鐩樹俊鎭� + /// </summary> + /// <param name="soNo"></param> + /// <returns></returns> + [HttpGet] + public IActionResult GetPalletNoListBySoNo(string soNo) + { + try + { + List<string> result = _pdaCrSvc.GetPalletNoListBySoNo(soNo); + + return Ok(new { data = result, code = 0, msg = "鎴愬姛" }); + } + catch (Exception e) + { + return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" }); + } + + } + /// <summary> + /// agv杞繍鍛煎彨灏忚溅 + /// </summary> + /// <param name="model"></param> + /// <returns></returns> + [HttpPost] + public IActionResult AgvTransport(PdaAgvTransportVm model) + { + try + { + //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D + var claimsIdentity = this.User.Identity as ClaimsIdentity; + if (claimsIdentity == null) + { + return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; + if (string.IsNullOrWhiteSpace(userId)) + { + return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + + var uId = int.Parse(userId); + _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, uId); + + return Ok(new { data = "", code = 0, msg = "鎴愬姛" }); + } + catch (Exception e) + { + return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" }); + } + } + /// <summary> + /// agv杞繍鍛煎彨灏忚溅鍙栬揣 + /// </summary> + /// <param name="model"></param> + /// <returns></returns> + [HttpPost] + public IActionResult AgvTransport2(PdaAgvTransportVm model) + { + try + { + //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D + var claimsIdentity = this.User.Identity as ClaimsIdentity; + if (claimsIdentity == null) + { + return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; + if (string.IsNullOrWhiteSpace(userId)) + { + return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + + var uId = int.Parse(userId); + _pdaCrSvc.AgvTransport2(model.SoNo,model.PalletNo, model.AreaNo, uId); + + return Ok(new { data = "", code = 0, msg = "鎴愬姛" }); + } + catch (Exception e) + { + return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" }); + } + } #endregion } -- Gitblit v1.8.0