From 6167bf4c8fe617d9f9861585042149d48ad15dbb Mon Sep 17 00:00:00 2001 From: chengsc <11752@DESKTOP-DS49RCP> Date: 星期二, 13 五月 2025 17:54:50 +0800 Subject: [PATCH] 修改问题,添加PDA下发出库页面 --- Wms/WMS.BLL/HttpServer.cs | 121 ++++ Wms/Wms/Controllers/UpApiController.cs | 43 + HTML/views/ASNSetting/PalletUpShelf.html | 2 Wms/Wms/Tools/ApiUrlConfig.cs | 12 Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs | 7 Wms/Wms/Controllers/BllAsnController.cs | 11 Pda/View/SoSetting/ExNoticeOut.html | 320 +++++++++++ Wms/Wms/Controllers/PdaAsnController.cs | 10 Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 393 +++++++++++++ Wms/WMS.BLL/BllQualityServer/InspectionRequestServer.cs | 103 --- Pda/View/SoSetting/palletOut.html | 6 Wms/WMS.IBLL/IBllQualityServer/IInspectionRequest.cs | 6 Wms/WMS.IBLL/IHttpServer.cs | 17 Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs | 15 Wms/Wms/appsettings.json | 4 Pda/View/AsnSetting/productEnterQuantity.html | 273 +-------- Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs | 4 Wms/Wms/Controllers/BllQualityController.cs | 33 - Wms/Wms/Controllers/PdaSoController.cs | 26 Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs | 27 HTML/views/ASNSetting/LabelPrint.html | 4 HTML/views/QualityControl/InspectionRequest.html | 8 Wms/Model/InterFaceModel/HttpModel.cs | 124 ++++ Wms/Wms/Controllers/DownApiController.cs | 3 24 files changed, 1,141 insertions(+), 431 deletions(-) diff --git a/HTML/views/ASNSetting/LabelPrint.html b/HTML/views/ASNSetting/LabelPrint.html index 7492276..9f00734 100644 --- a/HTML/views/ASNSetting/LabelPrint.html +++ b/HTML/views/ASNSetting/LabelPrint.html @@ -32,10 +32,10 @@ <button id="btnAdd" class="layui-btn layui-btn-sm" lay-event="Add2"><i class="layui-icon"></i>鐢熸垚鏍囩</button> </div> - <div class="layui-inline"> + <!-- <div class="layui-inline"> <button id="btnPrint" class="layui-btn layui-btn-sm" lay-event="Add"><i class="layui-icon"></i>鎵撳嵃</button> - </div> + </div> --> </div> <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="print" style="width: 100%;height:100%; text-align: right;padding-top: 5px;margin-left: 0%;"> diff --git a/HTML/views/ASNSetting/PalletUpShelf.html b/HTML/views/ASNSetting/PalletUpShelf.html index 517a855..715a19e 100644 --- a/HTML/views/ASNSetting/PalletUpShelf.html +++ b/HTML/views/ASNSetting/PalletUpShelf.html @@ -145,7 +145,7 @@ case "0": return '<button class="layui-btn layui-btn-radius layui-btn-xs">绛夊緟鎵ц</button>'; case "1": return '<button class="layui-btn layui-btn-radius layui-btn-xs layui-btn-danger ">姝e湪鎵ц</button>'; case "2": return '<button class="layui-btn layui-btn-radius layui-btn-xs layui-btn-normal ">鎵ц瀹屾垚</button>'; - case "3": return '<button class="layui-btn layui-btn-radius layui-btn-xs layui-btn-normal ">宸插彇娑�</button>'; + case "4": return '<button class="layui-btn layui-btn-radius layui-btn-xs layui-btn-normal ">宸插彇娑�</button>'; default: return ""; } } diff --git a/HTML/views/QualityControl/InspectionRequest.html b/HTML/views/QualityControl/InspectionRequest.html index bc69a24..30cefc5 100644 --- a/HTML/views/QualityControl/InspectionRequest.html +++ b/HTML/views/QualityControl/InspectionRequest.html @@ -601,16 +601,16 @@ Id: data.id, Code: data.QcNo, }; - sendData(IP + "/BllQuality/SendInspectionRequest", param, 'post', function (res) { - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { + sendData(IP + "/UpApi/SendInspectionRequest", param, 'post', function (res) { + if (res.Success == "0") { //鎴愬姛 + layer.msg(res.Message, { icon: 1, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }, function () { bindInspectionRequest(); }); } else { //涓嶆垚鍔� - layer.msg(res.msg, { + layer.msg(res.Message, { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }); diff --git a/Pda/View/AsnSetting/productEnterQuantity.html b/Pda/View/AsnSetting/productEnterQuantity.html index ba59cc2..4eb6ee8 100644 --- a/Pda/View/AsnSetting/productEnterQuantity.html +++ b/Pda/View/AsnSetting/productEnterQuantity.html @@ -771,7 +771,7 @@ $('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') } else { var sel = 'dd[lay-value=' + val + ']'; - $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') + //$('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') } } else { } @@ -1047,245 +1047,69 @@ }); } - - - - - // 娓叉煋绠辩爜淇℃伅 - // function refreshTable() { - // if (xianshiyemian == 0) { - // //鍏堟竻绌轰竴涓嬬瀛愬垪琛� - // let trs = $("#tableBoxList tr") - // let len = trs.length - - // for (i = len - 1; i >= 2; i--) { - // trs[i].remove(); - // } - - // //璁剧疆鎵樼洏鍙� - // $("#palletCode").val($.cookie('stockCode')) - - // var param = { - // PalletNo: $.cookie('stockCode') - // }; - // // 鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭� - // sendData(IP + "/PdaAsn/GetBoxInfos", param, 'post', function (res) { - // if (res.code == 0) { //鎴愬姛 - // var list = res - // var arrTrs = new Array() - // let idx = 0 - // for (var i in res.data) { - // var tr = $("#boxCell").eq(0).clone(); - // tr.appendTo("#tableBoxList"); - // tr.attr('id', res.data[i].Id) - // tr.attr('boxno', res.data[i].BoxNo) - // tr.attr('BindNo', res.data[i].BindNo) - // idx++; - // tr.attr('index', idx) - // tr.find("td[name='code']").html(res.data[i].BoxNo); - // 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') - // var Id = elem.attr('id') - // layer.alert("纭畾瑕佷粠鎵樼洏涓婂垹闄よ繖涓鐗╂枡鍚楋紵<br>" + boxno, { - // icon: 2, - // time: 0, //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - // btn: ['鍒犻櫎', '鍙栨秷'], - // yes: function () { - - // var param = { - // boxNo: boxno, - // }; - // sendData(IP + "/BllAsn/DelBindBoxInfo", param, 'get', 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.show(); - // arrTrs[i] = tr - // } - // //璁剧疆鍒嗛〉 - // setPages(1, res.data.length) - - // } else { //涓嶆垚鍔� - // layer.msg("鏃犳暟鎹�", { - // icon: 2, - // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - // }, function () { }); - // $("#boxNum").val(0) - // setPages(1, 0) - // } - // }); - // } - // else if (xianshiyemian == 1) { - // //鍏堟竻绌轰竴涓嬬瀛愬垪琛� - // let trs = $("#tableBoxList1 tr") - // let len = trs.length - - // for (i = len - 1; i >= 2; i--) { - // trs[i].remove(); - // } - - // //璁剧疆鎵樼洏鍙� - // $("#palletCode").val($.cookie('stockCode1')) - - // var param = { - // PalletNo: $.cookie('stockCode1') - // }; - // // 鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭� - // sendData(IP + "/PdaAsn/GetPalletBindInfo", param, 'post', function (res) { - // if (res.code == 0) { //鎴愬姛 - // var list = res - // var arrTrs = new Array() - // let idx = 0 - // for (var i in res.data) { - // var tr = $("#boxCell").eq(0).clone(); - // tr.appendTo("#tableBoxList1"); - // tr.attr('id', res.data[i].Id) - // tr.attr('boxno', res.data[i].BoxNo) - // tr.attr('BindNo', res.data[i].BindNo) - // idx++; - // tr.attr('index', idx) - // 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 = { - // Id: parseInt(Id), - // 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.show(); - // arrTrs[i] = tr - // } - - // //璁剧疆鍒嗛〉 - // setPages(1, res.data.length) - - // } else { //涓嶆垚鍔� - // layer.msg("鏃犳暟鎹�", { - // icon: 2, - // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - // }, function () { }); - // $("#boxNum").val(0) - // setPages(1, 0) - // } - // }); - // } - - // } - - //绠卞洖杞︿簨浠� function checkBoxInfo() { var param = { "BoxNo": $("#BOXCODE").val(), + "ASNNo":$("#bar").val() } sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) { - BoxLevelVal = "0"; + + if (res.code == 0) { //鎴愬姛 - //鍒ゆ柇鏄惁涓洪浂绠盉itBoxMark - if (res.data[0].BitBoxMark == '1') { - getFMBoxinfo(); + + var bl = false; + if (res.data.length == 0) { + layer.msg("鏈煡璇㈠埌姝ょ鐗╂枡淇℃伅锛岃鏍稿疄!", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + if (res.data[0].ASNNo != '' && res.data[0].ASNNo != null) { + $("#bar").empty() + $("#bar").append('<option value =>' + '</option>'); + form.render('select'); + + $("#bar").append('<option value =' + res.data[0].ASNNo + ' selected>' + res.data[0].ASNNo + '</option>'); + + updateGoodList(res.data[0].SkuNo) + setOrderGoods(); } else { - var bl = false; - if (res.data.length == 0) { - layer.msg("鏈煡璇㈠埌姝ょ鐗╂枡淇℃伅锛岃鏍稿疄!", { + if (asnDetails == '') { + layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗曟嵁!", { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }); return; } - - if (res.data[0].ASNNo != '' && res.data[0].ASNNo != null) { - $("#bar").empty() - $("#bar").append('<option value =>' + '</option>'); - form.render('select'); - - $("#bar").append('<option value =' + res.data[0].ASNNo + ' selected>' + res.data[0].ASNNo + '</option>'); - - updateGoodList(res.data[0].SkuNo) - setOrderGoods(); - } else { - if (asnDetails == '') { - layer.msg("璇峰厛閫夋嫨鍏ュ簱鍗曟嵁!", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - return; - } - } - asnDetails.forEach(element => { - console.log(element); - - if (element.SkuNo == res.data[0].SkuNo && element.LotNo == res.data[0].LotNo) { - var sel = 'dd[lay-value=' + element.id + ']'; - $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this'); - bl = true; - } - }); - if (!bl) { - layer.msg("姝ょ鐗╂枡涓嶇鍚堣鍏ュ簱鍗曪紝璇锋牳瀹�!", { - icon: 2, - time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 - }); - } else { - $("#BoxQty").val(res.data[0].Qty); - } } + asnDetails.forEach(element => { + console.log(element); + + if (element.SkuNo == res.data[0].SkuNo && element.LotNo == res.data[0].LotNo) { + var sel = 'dd[lay-value=' + element.id + ']'; + $('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this'); + bl = true; + } + }); + if (!bl) { + layer.msg("姝ょ鐗╂枡涓嶇鍚堣鍏ュ簱鍗曪紝璇锋牳瀹�!", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + } else { + $("#BoxQty").val(res.data[0].Qty); + } + } else { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); //绠辩爜涓嶅瓨鍦紝璋冪敤璧嬬爜鎺ュ彛鑾峰彇绠变俊鎭� - getFMBoxinfo(); + //getFMBoxinfo(); } }); @@ -1295,6 +1119,7 @@ "BoxNo": $("#BOXCODE").val(), } sendData(IP + "/UpApi/GetFMBindBoxInfos", param, 'post', function (res) { + console.log(res); if (res.code == 0) { //鎴愬姛//鏍规嵁瀵规帴鎺ュ彛瀹氫箟鍚勫瓧娈靛垽鏂潯浠� var bl = false; if (res.data.length == 0) { diff --git a/Pda/View/SoSetting/ExNoticeOut.html b/Pda/View/SoSetting/ExNoticeOut.html new file mode 100644 index 0000000..8493134 --- /dev/null +++ b/Pda/View/SoSetting/ExNoticeOut.html @@ -0,0 +1,320 @@ +<!DOCTYPE html> +<html> + +<head> + <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" /> + <meta charset="UTF-8" /> + <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=1, user-scalable=no" /> --> + <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665" /> --> + <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; */ + } + + .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; + } + + .foot-container { + text-align: center; + /* background-color: #007DDB; */ + } + </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" lang>涓嬪彂鍑哄簱</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" lang>涓婚〉</a></li> + <!-- <li><a href="productEnterConfirm.html">鍏ュ簱淇℃伅纭</a></li> --> + <li><a href="../login.html" lang>閲嶆柊鐧诲綍</a></li> + </ul> + </div> + + <div id="" class="layout-bill-info"> + <form class="layui-form" action="" style="height: auto;"> + <div id="" class="layui-form-item layout-dropdownlist"> + <label class="layui-form-label" lang>鍑哄簱鍗曪細</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 class="layui-form-item layout-dropdownlist" style="margin-top: 10px;"> + <label class="layui-form-label">鐗╂枡-鎵规锛�</label> + <div class="layui-input-block" id="goodDiv"> + <select id="goodSelect" lay-filter="goodSelect" lay-search> + <option value=""></option> + </select> + <img src="/assets/down_arraw.png"> + </div> + </div> + <!-- <div id="" class="layui-form-item layout-input"> + <label class="layui-form-label" lang>搴撲綅鍦板潃锛�</label> + <div class="layui-input-block"> + <input id="LocatNo" type="text" langholder placeholder="璇锋壂鎻忓簱浣嶆潯鐮�" + autocomplete="off" class="layui-input"> + </div> + </div> --> + <div id="" class="layui-form-item layout-dropdownlist"> + <label class="layui-form-label" lang>鍑哄簱鍦板潃锛�</label> + <div class="layui-input-block"> + <select id="endSelect" lay-filter="endSelect" lay-search> + <option value=""></option> + </select> + <img src="/assets/down_arraw.png"> + </div> + </div> + + </form> + <div id="" style="text-align: center;"> + <button class="btn-ok-blue" type="button" lay-submit lay-filter="formBind">纭鍑哄簱</button> + </div> + </div> + + + </div> + + </div> + <script src="/js/jquery-3.5.1.min.js"></script> + <script src="/layui/layui.js"></script> + <script src="/js/public.js"></script> + <script src="/js/language.js"></script> + <script src="/js/jquery.cookie.js"></script> + <script> + layui.use(['form', 'jquery'], function () { + var form = layui.form + + initLanguage() + setLanguage() + + function clear() { + $("#BOXCODE").val(""); + } + + //閫変腑鍗曟嵁浜嬩欢 + form.on('select(getbar)', function (data) { + + if (data.value == "") { + return; + } + updateGoodList(); + }); + + $("#selectDiv").click(function () { + var input = $('select[id="bar"]').next().find('.layui-select-title input') + var val = input.val() + //鍏堟洿鏂颁竴涓嬪嚭搴撳崟 + updateBillList(function (data) { + $('select[id="bar"]').next().addClass('layui-form-selected') + $('select[id="bar"]').next().find('.layui-select-title input').val(val) + }) + }) + //鍒濆鍖栨覆鏌� 鍑哄簱鍗� + function updateBillList(callback) { + var input = $('select[id="bar"]').next().find('.layui-select-title input') + var val = input.val() + $("#bar").empty() + $("#bar").append('<option value =>' + '</option>'); + var PalletNo = $("#PalletNo").val(); + + var param = { + Type: "1", + }; + synData(IP + "/PdaSo/GetRunNoticeList", param,'post', function (res) { + //console.log(res); + if (res.code == 0) { //鎴愬姛 + for (var i = 0; i < res.data.length; i++) { + $("#bar").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') + } else { + var sel = 'dd[lay-value=' + val + ']'; + $('#bar').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 updateGoodList(data) { + var input = $('select[id="goodSelect"]').next().find('.layui-select-title input') + var val = input.val() + $("#goodSelect").empty() + $("#goodSelect").append('<option value =>' + '</option>'); + + var param = { + SoNo: $("#bar").val(), + }; + synData(IP + "/PdaSo/GetSoSkuLotNoListBySo", param, 'post', function (res) { + console.log(res); + + if (res.code == 0) { //鎴愬姛 + asnDetails = res.data; + + for (var i = 0; i < res.data.length; i++) { + + if (i == 0) { + if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { + $("#goodSelect").append('<option value =' + res.data[i].SoDetailId + '-' + i + ' selected>' + res.data[i] + .SkuName + + '</option>'); + } else { + $("#goodSelect").append('<option value =' + res.data[i].SoDetailId + '-' + i + ' selected>' + res.data[i] + .SkuName + "-" + res.data[i].LotNo + + '</option>'); + } + + } else { + if (res.data[i].LotNo == '' || res.data[i].LotNo == null) { + $("#goodSelect").append('<option value =' + res.data[i].ISoDetailIdd + '-' + i + '>' + res.data[i] + .SkuName + + '</option>'); + } else { + $("#goodSelect").append('<option value =' + res.data[i].SoDetailId + '-' + i + '>' + res.data[i] + .SkuName + "-" + res.data[i].LotNo + + '</option>'); + } + } + + } + form.render('select'); + + if (!val) { + $('#goodSelect').siblings("div.layui-form-select").find('dl').find('.layui-select-tips').addClass('layui-this') + } else { + var sel = 'dd[lay-value=' + val + ']'; + //$('#goodSelect').siblings("div.layui-form-select").find('dl').find(sel).addClass('layui-this') + } + } + else { + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + } + }); + + } + + + form.on('submit(formBind)', function (data) { + + if (!$("#PalletNo").val()) { + layer.msg('璇锋壂鎻忔墭鐩樻潯鐮�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + + var param = { + SoNo: $("#bar").val(), + PalletNo: $("#PalletNo").val(), + } + // sendData(IP + "/PdaSo/PlaneExportSuccess", param, 'get', function (res) { + // if (res.code == 0) { //鎴愬姛 + // layer.msg(res.msg, { + // icon: 1, + // time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function () { + + // clearTable() + // $("#PalletNo").val('') + // }); + // } else { //涓嶆垚鍔� + // layer.msg(res.msg, { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function () { + // //鍥炶皟 + // }); + // } + // }); + return false; //闃绘琛ㄥ崟璺宠浆銆傚鏋滈渶瑕佽〃鍗曡烦杞紝鍘绘帀杩欐鍗冲彲銆� + }); + //------------------------------------------------------------------------------------------------- + + $("#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/View/SoSetting/palletOut.html b/Pda/View/SoSetting/palletOut.html index 2a8cf87..2675d52 100644 --- a/Pda/View/SoSetting/palletOut.html +++ b/Pda/View/SoSetting/palletOut.html @@ -157,13 +157,13 @@ console.log(param) sendData(IP + "/PdaSo/IssuePlnOutHouse", param, 'post', function(res) { console.log("鍑哄簱锛�"+JSON.stringify(res)) - if (res.code == 0) { //鎴愬姛 - layer.msg(res.msg, { + if (res.Success == "0") { //鎴愬姛 + layer.msg(res.Message, { icon: 1, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }, function() {isChongFu = true;clear();}); } else { //涓嶆垚鍔� - layer.msg(res.msg, { + layer.msg(res.Message, { icon: 2, time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 }, function() {isChongFu = true;clear();}); diff --git a/Wms/Model/InterFaceModel/HttpModel.cs b/Wms/Model/InterFaceModel/HttpModel.cs index 7e703c5..4eed61d 100644 --- a/Wms/Model/InterFaceModel/HttpModel.cs +++ b/Wms/Model/InterFaceModel/HttpModel.cs @@ -358,4 +358,128 @@ public string RequestUser { get; set; } } #endregion + + + #region MyRegion + + public class FumaGetBoxModel + { + public string Success { get; set; } + public string Message { get; set; } + public PlnBoxModel Product { get; set; } + } + + public class PlnBoxModel + { + + /// <summary> + /// 涓婃父鍗曟嵁鍙� + /// </summary> + public string OrderNo { get; set; } + /// <summary> + /// 鎵樼洏鍙� + /// </summary> + public string PallNo { get; set; } + /// <summary> + /// 鐗╂枡鍙� + /// </summary> + public string SkuNo { get; set; } + /// <summary> + /// 鐗╂枡鍚嶇О + /// </summary> + public string SkuName { get; set; } + /// <summary> + /// 鎵规鍙� + /// </summary> + public string LotNo { get; set; } + /// <summary> + /// 鎵规鎻忚堪 + /// </summary> + public string LotText { get; set; } + /// <summary> + /// 渚涘簲鍟嗕唬鐮� + /// </summary> + public string Custom { get; set; } + /// <summary> + /// 渚涘簲鍟嗗悕绉� + /// </summary> + public string CustomName { get; set; } + /// <summary> + /// 鐢熶骇鏃ユ湡 + /// </summary> + public string ProductionTime { get; set; } + /// <summary> + /// 杩囨湡鏃ユ湡 + /// </summary> + public string ExpirationTime { get; set; } + /// <summary> + /// 浜х嚎 + /// </summary> + public string Line_No { get; set; } + /// <summary> + /// 鐗╂枡瑙勬牸 + /// </summary> + public string Standard { get; set; } + /// <summary> + /// 鍖呰瑙勬牸 + /// </summary> + public string PackageStandard { get; set; } + /// <summary> + /// 鍖呰鍗曚綅 + /// </summary> + public string PackUnit { get; set; } + /// <summary> + /// 瀛樺偍鏈熻嚦 + /// </summary> + public string StoreTime { get; set; } + + /// <summary> + /// 绠辩爜淇℃伅 + /// </summary> + public List<BoxInfoList> BoxInfoList { get; set; } + } + + public class BoxInfoList + { + /// <summary> + /// 闆剁鏍囪 + /// </summary> + public string BitBoxMark { get; set; } + /// <summary> + /// 绠辨潯鐮� + /// </summary> + public string BoxNo { get; set; } + + /// <summary> + /// 鐩掔爜淇℃伅 + /// </summary> + public List<BoxInfo2List> BoxInfo2List { get; set; } + } + public class BoxInfo2List + { + /// <summary> + /// 鐩掓潯鐮� + /// </summary> + public string BoxNo2 { get; set; } + + /// <summary> + /// 鏀爜淇℃伅 + /// </summary> + public List<BoxInfo3List> BoxInfo3List { get; set; } + } + + public class BoxInfo3List + { + /// <summary> + /// 鏀潯鐮� + /// </summary> + public string BoxNo3 { get; set; } + + /// <summary> + /// 鏁伴噺 + /// </summary> + public decimal Qty { get; set; } + } + + #endregion } diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs index b0f88b6..2027c39 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs @@ -22,6 +22,9 @@ using System.Xml.Schema; using ZXing.OneD; using System.Threading.Tasks; +using System.Security.Policy; +using Newtonsoft.Json; +using Utility.Tools; namespace WMS.BLL.BllPdaServer { @@ -1720,7 +1723,7 @@ /// </summary> /// <param name="model"></param> /// <returns></returns> - public List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model) + public List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model,string url) { try { @@ -1728,27 +1731,307 @@ { throw new Exception("璇锋壂鎻忓绠辨潯鐮�!"); } - string sqlString = $@"SELECT - ASNNo, - BoxNo, - SkuNo, - SkuName, - LotNo, - BitBoxMark, - SUM(Qty) as Qty - FROM BllBoxInfo - WHERE IsDel = '0' - AND Status='0' - AND BoxNo = '{model.BoxNo}' - GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; - var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); - - if (models.Count == 0) + if (string.IsNullOrWhiteSpace(model.ASNNo)) { - throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦�!"); + throw new Exception("璇烽�夋嫨鍏ュ簱鍗曞彿!"); } + var noticeList = Db.Queryable<BllArrivalNotice>().Where(m => m.IsDel == "0" && m.ASNNo == model.ASNNo).ToList(); + if (noticeList.Count != 1) + { + throw new Exception("鍏ュ簱鍗曞彿閲嶅!"); + } + var notice = noticeList.First(); + if (notice.Type == "0") //鎴愬搧鍏ュ簱 + { + string sqlString = $@"SELECT + ASNNo, + BoxNo, + SkuNo, + SkuName, + LotNo, + BitBoxMark, + SUM(Qty) as Qty + FROM BllBoxInfo + WHERE IsDel = '0' + AND Status='0' + AND BoxNo = '{model.BoxNo}' + GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; + var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); - return models; + if (models.Count != 0) + { + return models; + } + else + { + var boxInfo = Db.Queryable<BllBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo == model.BoxNo).ToList(); + + if (boxInfo.Count == 0) + { + models = GetFMBindBoxInfos(model.BoxNo, url); + return models; + } + else + { + if (boxInfo.Count(m => m.Status != "0") > 0) + { + throw new Exception("绠辩爜淇℃伅鐘舵�佷笉鏄瓑寰呮墽琛�"); + } + return models; + } + + + + } + } + else if (notice.Type == "1" || notice.Type == "4") //閲囪喘鍏ュ簱 + { + string sqlString = $@"SELECT + ASNNo, + BoxNo, + SkuNo, + SkuName, + LotNo, + BitBoxMark, + SUM(Qty) as Qty + FROM BllBoxInfo + WHERE IsDel = '0' + AND Status='0' + AND BoxNo = '{model.BoxNo}' + GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; + var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); + + if (models.Count != 0) + { + return models; + } + else + { + throw new Exception("娌℃湁鏌ヨ鍒扮鐮佷俊鎭�"); + } + } + else if (notice.Type == "3") //閫�璐у叆搴� + { + string sqlString = $@"SELECT + ASNNo, + BoxNo, + SkuNo, + SkuName, + LotNo, + BitBoxMark, + SUM(Qty) as Qty + FROM BllBoxInfo + WHERE IsDel = '0' + AND Status='0' + AND BoxNo = '{model.BoxNo}' + GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; + var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); + + if (models.Count != 0) + { + return models; + } + else + { + sqlString = $@"SELECT + ASNNo, + BoxNo, + SkuNo, + SkuName, + LotNo, + BitBoxMark, + SUM(Qty) as Qty + FROM BllBoxInfo + WHERE IsDel = '0' + AND Status='0' + AND BoxNo2 = '{model.BoxNo}' + GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; + models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); + if (models.Count != 0) + { + return models; + } + else + { + sqlString = $@"SELECT + ASNNo, + BoxNo, + SkuNo, + SkuName, + LotNo, + BitBoxMark, + SUM(Qty) as Qty + FROM BllBoxInfo + WHERE IsDel = '0' + AND Status='0' + AND BoxNo3 = '{model.BoxNo}' + GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; + models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); + if (models.Count != 0) + { + return models; + } + } + } + + #region 鑾峰彇鏈�鍚庝竴娆″嚭搴撴嫞璐т腑鐨勭鐮佷俊鎭� + + var comBox = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.BoxNo == model.BoxNo).GroupBy(m => m.ExportAllotId).Select(m => m.ExportAllotId).ToList(); + if (comBox.Count == 0) + { + comBox = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.BoxNo2 == model.BoxNo).GroupBy(m => m.ExportAllotId).Select(m => m.ExportAllotId).ToList(); + if (comBox.Count == 0) + { + comBox = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.BoxNo3 == model.BoxNo).GroupBy(m => m.ExportAllotId).Select(m => m.ExportAllotId).ToList(); + } + } + var i = 0;//寰幆娆℃暟 + DateTime time = DateTime.Now; + var allotId = 0; + foreach (var item in comBox) + { + var comBoxList = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == item).OrderByDescending(m => m.CreateTime).First(); + if (i == 0) + { + time = comBoxList.CreateTime; + allotId = comBoxList.ExportAllotId; + } + else if (comBoxList.CreateTime > time) + { + time = comBoxList.CreateTime; + allotId = comBoxList.ExportAllotId; + } + i++; + } + if (allotId != 0) + { + var addComBox = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == allotId).ToList(); + var addComList = addComBox.GroupBy(m => m.BoxNo).ToList(); + var sku = Db.Queryable<SysMaterials>().First(m => m.SkuNo == addComBox.First().SkuNo); + var pNum = 0; + var bNum = 0; + new Common().GetPackQtyInfo(sku.PackagNo, ref pNum, ref bNum); + var boxList = new List<BllBoxInfo>(); + foreach (var com in addComList) + { + //绠卞唴鎬绘暟鍜� + var qtySum = addComBox.Where(m => m.BoxNo == com.Key).Sum(m => m.CompleteQty); + var bitBox = "1"; + if (qtySum == bNum) + { + bitBox = "0"; + } + foreach (var item in com) + { + if (item.BoxNo != model.BoxNo) + { + if (item.BoxNo2 != model.BoxNo) + { + if (item.BoxNo3 != model.BoxNo) + { + continue; + } + } + } + var boxInfo = new BllBoxInfo() + { + BoxNo = item.BoxNo, + BoxNo2 = item.BoxNo2, + BoxNo3 = item.BoxNo3, + SkuNo = item.SkuNo, + SkuName = item.SkuName, + LotNo = item.LotNo, + LotText = item.LotText, + Qty = (decimal)item.CompleteQty, + FullQty = bNum, + //ProductionTime = , + //ExpirationTime = , + InspectMark = "0", + InspectStatus = "0", + BitBoxMark = bitBox, + Origin = "WMS", + Status = "0", + CreateUser = 0 + }; + boxList.Add(boxInfo); + } + + } + Db.Insertable(boxList).ExecuteCommand(); + + string sqlString2 = $@"SELECT + ASNNo, + BoxNo, + SkuNo, + SkuName, + LotNo, + BitBoxMark, + SUM(Qty) as Qty + FROM BllBoxInfo + WHERE IsDel = '0' + AND Status='0' + AND BoxNo = '{model.BoxNo}' + GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; + var models2 = Db.Ado.SqlQuery<BoxInfoDto>(sqlString2); + + if (models2.Count != 0) + { + return models2; + } + else + { + sqlString2 = $@"SELECT + ASNNo, + BoxNo, + SkuNo, + SkuName, + LotNo, + BitBoxMark, + SUM(Qty) as Qty + FROM BllBoxInfo + WHERE IsDel = '0' + AND Status='0' + AND BoxNo2 = '{model.BoxNo}' + GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; + models2 = Db.Ado.SqlQuery<BoxInfoDto>(sqlString2); + if (models2.Count != 0) + { + return models2; + } + else + { + sqlString2 = $@"SELECT + ASNNo, + BoxNo, + SkuNo, + SkuName, + LotNo, + BitBoxMark, + SUM(Qty) as Qty + FROM BllBoxInfo + WHERE IsDel = '0' + AND Status='0' + AND BoxNo3 = '{model.BoxNo}' + GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; + models2 = Db.Ado.SqlQuery<BoxInfoDto>(sqlString2); + if (models2.Count != 0) + { + return models2; + } + } + } + + + } + + throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦�!"); + #endregion + + } + else + { + throw new Exception("鍗曟嵁绫诲瀷閿欒"); + } } catch (Exception ex) { @@ -1761,21 +2044,83 @@ /// </summary> /// <param name="model"></param> /// <returns></returns> - public List<BoxInfoDto> GetFMBindBoxInfos(string boxno) + public List<BoxInfoDto> GetFMBindBoxInfos(string boxno,string url) { try { #region 绠辩爜璇锋眰鎺ュ彛锛屾寮忕郴缁熸斁寮� - /*var jsonData = JsonConvert.SerializeObject(boxno); + var data = new + { + BoxCode = boxno + }; + var jsonData = JsonConvert.SerializeObject(data); var response = HttpHelper.DoPost(url, jsonData, "绠辩爜淇℃伅璇锋眰", "FM"); - var obj = JsonConvert.DeserializeObject<ErpModel>(response);//瑙f瀽杩斿洖鏁版嵁 - if (obj.Success != 0) + var obj = JsonConvert.DeserializeObject<FumaGetBoxModel>(response);//瑙f瀽杩斿洖鏁版嵁 + if (obj.Success != "0") { throw new Exception("璇锋眰澶辫触" + obj.Message); - }*/ + } #endregion + var sku = Db.Queryable<SysMaterials>().First(m => m.SkuNo == obj.Product.SkuNo); + var pNum = 0;//鎵樼洏鐗╁搧鏁伴噺 + var bNum = 0;//绠辩爜鐗╁搧鏁伴噺 + if (sku == null) + { + throw new Exception($"鏈煡璇㈠埌鐗╂枡{obj.Product.SkuNo}淇℃伅"); + } + new Common().GetPackQtyInfo(sku.PackagNo, ref pNum, ref bNum); + if (pNum == 0 || bNum == 0) + { + throw new Exception($"{sku.SkuNo}鐗╁搧鍖呰鏈壘鍒帮紒"); + } + + var boxList = new List<BllBoxInfo>(); + var comTime = DateTime.Now; + //娣诲姞绠辩爜淇℃伅 + foreach (var box in obj.Product.BoxInfoList) + { + foreach (var box2 in box.BoxInfo2List) + { + foreach (var box3 in box2.BoxInfo3List) + { + var boxInfo = new BllBoxInfo() + { + BoxNo = box.BoxNo, + BoxNo2 = box2.BoxNo2, + BoxNo3 = box3.BoxNo3, + Qty = box3.Qty, + BitBoxMark = box.BitBoxMark, + + ASNNo = "", + //ASNDetailNo = noticeDetail.Id, + OrderCode = "",//notice.OrderCode + //BindNo = bindId, + //PalletNo = model.PallNo, + FullQty = bNum, + Status = "2", + SkuNo = sku.SkuNo, + SkuName = sku.SkuName, + LotNo = obj.Product.LotNo, + LotText = obj.Product.LotText, + ProductionTime = DateTime.Parse(obj.Product.ProductionTime), + ExpirationTime = DateTime.Parse(obj.Product.ExpirationTime), + //CompleteTime = "", + InspectMark = "0", + InspectStatus = "0", + Origin = "璧嬬爜", + CreateTime = comTime, + CreateUser = 0 + }; + boxList.Add(boxInfo); + } + + } + } + Db.Fastest<BllBoxInfo>().BulkCopy(boxList); + + string sqlString = $@"SELECT ASNNo, BoxNo, diff --git a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs index 95cee66..9b50a79 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs @@ -872,6 +872,25 @@ return allotList2; } + + public async Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListBySo(string soNo) + { + if (string.IsNullOrWhiteSpace(soNo))//鍒ゆ柇鎵樼洏鏄惁涓虹┖ + { + throw Oops.Bah("鍗曟嵁涓虹┖锛岃閫夋嫨鍗曟嵁"); + } + //鑾峰彇鐘舵�佷负寰呮嫞璐ф垨鑰呴儴鍒嗘嫞璐х殑鍑哄簱鍗� + var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SONo == soNo && (m.Status == "0" || m.Status == "1")); + + var list = await allotList.GroupBy(m => new { m.SODetailNo, m.SkuNo, m.SkuName, m.LotNo }).Select(m => new DetailIdSkuLotNo() + { + SoDetailId = m.SODetailNo, + SkuName = m.SkuName, + LotNo = m.LotNo, + }).ToListAsync(); + + return list; + } //鑾峰彇鍑哄簱鎵樼洏涓婄殑鐗╂枡鎵规(鏍规嵁鎵樼洏鐮�) public async Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListByPallet(string palletNo, string soNo) { @@ -1772,7 +1791,7 @@ DateTime serverTime = Db.GetDate(); //鑾峰彇搴撳瓨鏄庣粏鏄惁灏忎簬绛変簬璇ュ灈鏁� - var stockDetail = await Db.Queryable<DataStockDetail>().Where(s => s.IsDel == "0" && s.SkuNo == "100099" && s.Status == "0").ToListAsync(); + var stockDetail = await Db.Queryable<DataStockDetail>().Where(s => s.IsDel == "0" && s.SkuNo == "100099" && s.Status == "0" && !string.IsNullOrWhiteSpace(s.WareHouseNo)).ToListAsync(); if (stockDetail.Count > 0) { //鍒ゆ柇鏄惁澶т簬闇�瑕佸灈鏁� @@ -1935,13 +1954,13 @@ ////瑙f瀽杩斿洖鏁版嵁 var wcsModel = JsonConvert.DeserializeObject<WcsModel2>(response); - if (wcsModel.code == 0) + if (wcsModel.code == 200) { //鏇存敼浠诲姟鐨勫彂閫佽繑鍥炴椂闂�// new TaskServer().EditTaskIssueOk(list2, time1, time2); //str += "涓嬪彂鎴愬姛"; } - if (wcsModel.code == -1) + else { new TaskServer().EditTaskIssueNo(list2, time1, time2, wcsModel.message); throw Oops.Bah(wcsModel.message); @@ -1968,7 +1987,7 @@ catch (Exception e) { Db.RollbackTran(); - return e.Message; + throw new Exception(e.Message); } } diff --git a/Wms/WMS.BLL/BllQualityServer/InspectionRequestServer.cs b/Wms/WMS.BLL/BllQualityServer/InspectionRequestServer.cs index 54187e7..1480f41 100644 --- a/Wms/WMS.BLL/BllQualityServer/InspectionRequestServer.cs +++ b/Wms/WMS.BLL/BllQualityServer/InspectionRequestServer.cs @@ -536,109 +536,6 @@ } } - /// <summary> - /// 鍚慙imes鍙戦�佽楠屼俊鎭� - /// </summary> - /// <param name="model">model.Id:璇烽獙鍗曚富閿紱model.Code:鍑哄簱鍙� </param> - /// <param name="userId">鎿嶄綔鐢ㄦ埛</param> - /// <param name="url">Wcs鍦板潃</param> - /// <returns></returns> - public bool SendInspectionRequest(IdVm model, int userId, string url, string userName) - { - try - { - // 鍒ゆ柇璇烽獙鍗曠姸鎬� - var data = Db.Queryable<BllQualityInspectionRequest>() - .Where(m => m.QcNo == model.Code && m.IsDel == "0" && m.Status == "0").ToList().FirstOrDefault(); - if (data == null) - { - throw new Exception("鎿嶄綔澶辫触!璇烽獙鍗曠姸鎬佸彉鏇�."); - } - - // 璁板綍浠诲姟鏃ュ織 - var taskNo = new Common().GetMaxNo("TK"); - var exTask = new LogTask() - { - TaskNo = taskNo, - Sender = "WMS", - Receiver = "Limes", - IsSuccess = 0, //鏄惁涓嬪彂鎴愬姛 0澶辫触 1鎴愬姛 - StartLocat = "", //璧峰浣嶇疆 - PalletNo = "", //鎵樼洏鐮� - IsSend = 1, //鏄惁鍙啀娆′笅鍙� - IsCancel = 1, //鏄惁鍙彇娑� - IsFinish = 1, //鏄惁鍙畬鎴� - Status = "0", //浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚 - OrderType = "5", //0 鍏ュ簱鍗� 1 鍑哄簱鍗� 2 鐩樼偣鍗� 3 绉诲簱鍗� 4 鍙栨牱鍑哄簱鍗� 5 鍏朵粬 - EndLocat = "", //鐩爣浣嶇疆 - Type = "3", //浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟 - Msg = "璇烽獙浠诲姟" - }; - - // 鎻掑叆浠诲姟鏃ュ織 - Db.Insertable(exTask).ExecuteCommand(); - - - // 璋冪敤Limes鎺ュ彛鍙戣捣璇烽獙 - var sendModel = new SendLimesModel() - { - QcNo = data.QcNo, - SkuNo = data.SkuNo, - Qty = data.Qty.ToString(), - LotNo = data.LotNo, - SupplierLot = data.SupplierLot, - RequestUser = userName, // 璇烽獙浜� - }; - var jsonData = JsonConvert.SerializeObject(sendModel); - string response = ""; - - try - { - var time1 = DateTime.Now;//鍙戦�佹椂闂� .ToString("yyyy-MM-dd HH:mm:ss") - //response = HttpHelper.DoPost(url, jsonData, "涓婁紶Limes绯荤粺鍙戣捣璇烽獙", "Limes"); - var time2 = DateTime.Now;//杩斿洖鏃堕棿 .ToString("yyyy-MM-dd HH:mm:ss") - - ////瑙f瀽杩斿洖鏁版嵁 - //var limesModel = JsonConvert.DeserializeObject<LimesModel>(response); - List<string> list1 = new List<string>(); - list1.Add(taskNo); - //if (limesModel.Success == 0) - //{ - //鏇存敼浠诲姟鐨勫彂閫佽繑鍥炴椂闂�// - new TaskServer().EditTaskIssueOk(list1, time1, time2); - - // 鏇存柊璇烽獙鍗曚俊鎭� - data.Status = "1"; - data.SamplingQty = 10;//decimal.Parse(limesModel.SamplingQty); - data.RequestUser = userId; - data.RequestTime = DateTime.Now; - data.UpdateTime = DateTime.Now; - data.UpdateUser = userId; - - Db.Updateable(data).ExecuteCommand(); - //} - //if (limesModel.Success == -1) - //{ - // new TaskServer().EditTaskIssueNo(list1, time1, time2,limesModel.Message); - // throw new Exception(limesModel.Message); - //} - } - catch (Exception ex) - { - throw new Exception(ex.Message); - } - - //娣诲姞鎿嶄綔鏃ュ織璁板綍 - var k = new OperationCrServer() - .AddLogOperationCr("璐ㄩ噺绠$悊", "璐ㄦ璇烽獙", model.Code, "璇烽獙", $"鍚戣川閲忛儴鍒嗗彂璧疯楠�!", userId); - - return true; - } - catch (Exception e) - { - throw new Exception(e.Message); - } - } #endregion } } diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs index 247ff88..a0243b2 100644 --- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs +++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs @@ -3150,18 +3150,17 @@ outDto1.Add(new OutCommandDto() { + TaskNo = exTask.TaskNo, // 浠诲姟鍙� + TaskType = "1",// 浠诲姟绫诲瀷 (鍑哄簱)0鍏� 1鍑� 2绉� + PalletNo = item.PalletNo,//鎵樼洏鍙� StartLocate = locate.LocatNo, // 璧峰浣嶇疆 StartRoadway = locate.RoadwayNo,//鍏跺疄宸烽亾 EndLocate = outModeLocate, // 鐩爣浣嶇疆 - TaskNo = exTask.TaskNo, // 浠诲姟鍙� - TaskType = "1",// 浠诲姟绫诲瀷 (鍑哄簱)0鍏� 1鍑� 2绉� - OutMode = outModeLocate, //鍑哄簱鍙� - Order = 1, - - //UnstackingMode = "unstackingMode2",//鎷h揣鏂瑰紡 0鏈哄櫒鎷嗘墭鍑� 1 浜哄伐鎷h揣鍑� - //CompleteQty = outCount2, //鎷嗙殑浠舵暟 - //BoxexQty = outCount, //鎬讳欢鏁� + + Order = 999, + Type = PLCTypeEnum.AGV + }); taskNoStr = exTask.TaskNo; diff --git a/Wms/WMS.BLL/HttpServer.cs b/Wms/WMS.BLL/HttpServer.cs index 4175a56..4d9c3e5 100644 --- a/Wms/WMS.BLL/HttpServer.cs +++ b/Wms/WMS.BLL/HttpServer.cs @@ -1,4 +1,6 @@ 锘縰sing Model.InterFaceModel; +using Model.ModelVm; +using Newtonsoft.Json; using SqlSugar; using System; using System.Collections.Generic; @@ -8,6 +10,7 @@ using WMS.BLL.LogServer; using WMS.DAL; using WMS.Entity.BllAsnEntity; +using WMS.Entity.BllQualityEntity; using WMS.Entity.BllSoEntity; using WMS.Entity.Context; using WMS.Entity.DataEntity; @@ -80,7 +83,7 @@ } } var upShelfOldList = Db.Queryable<BllPalletUpShelf>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && (m.Status == "0" || m.Status == "1")).ToList(); - if (upShelfOldList != null) //鏌ヨ鍒板叆搴撲俊鎭� + if (upShelfOldList.Count != 0) //鏌ヨ鍒板叆搴撲俊鎭� { var upShelfOld = upShelfOldList.First(); var beingTask = Db.Queryable<LogTask>().First(m => m.IsDel == "0" && m.TaskNo == upShelfOld.TaskNo); @@ -287,8 +290,8 @@ // 娣诲姞鎵樼洏缁戝畾琛ㄦ墭鐩樺叆搴撲换鍔″彿 liudl foreach (DataStockDetail stockModel in stockDetail) { - var bindModel = Db.Queryable<BllPalletBind>().First(m => m.IsDel == "0" && m.Status == "2" - && m.PalletNo == stockModel.PalletNo && m.ASNNo == stockModel.ASNNo && m.ASNDetailNo == stockModel.ASNDetailNo); + var bindModel = Db.Queryable<BllPalletBind>().Where(m => m.IsDel == "0" && m.Status == "2" + && m.PalletNo == stockModel.PalletNo && m.ASNNo == stockModel.ASNNo && m.ASNDetailNo == stockModel.ASNDetailNo).OrderByDescending(m=>m.CreateTime).First(); if (bindModel != null && string.IsNullOrWhiteSpace(bindModel.TaskNo)) { bindModel.TaskNo = taskNo; @@ -590,8 +593,8 @@ foreach (DataStockDetail stockModel in stockDetail) { - var bindModel = Db.Queryable<BllPalletBind>().First(m => m.IsDel == "0" && m.Status == "2" - && m.PalletNo == stockModel.PalletNo && m.ASNNo == stockModel.ASNNo && m.ASNDetailNo == stockModel.ASNDetailNo); + var bindModel = Db.Queryable<BllPalletBind>().Where(m => m.IsDel == "0" && m.Status == "2" + && m.PalletNo == stockModel.PalletNo && m.ASNNo == stockModel.ASNNo && m.ASNDetailNo == stockModel.ASNDetailNo).OrderByDescending(m=>m.CreateTime).First(); if (bindModel != null && string.IsNullOrWhiteSpace(bindModel.TaskNo)) { bindModel.TaskNo = taskNo; @@ -1243,5 +1246,113 @@ } + + #region MyRegion + + + /// <summary> + /// 鍚慙imes鍙戦�佽楠屼俊鎭� + /// </summary> + /// <param name="model">model.Id:璇烽獙鍗曚富閿紱model.Code:鍑哄簱鍙� </param> + /// <param name="userId">鎿嶄綔鐢ㄦ埛</param> + /// <param name="url">Wcs鍦板潃</param> + /// <returns></returns> + public bool SendInspectionRequest(IdVm model, int userId, string url, string userName) + { + try + { + // 鍒ゆ柇璇烽獙鍗曠姸鎬� + var data = Db.Queryable<BllQualityInspectionRequest>() + .Where(m => m.QcNo == model.Code && m.IsDel == "0" && m.Status == "0").ToList().FirstOrDefault(); + if (data == null) + { + throw new Exception("鎿嶄綔澶辫触!璇烽獙鍗曠姸鎬佸彉鏇�."); + } + + // 璁板綍浠诲姟鏃ュ織 + //var taskNo = new Common().GetMaxNo("TK"); + //var exTask = new LogTask() + //{ + // TaskNo = taskNo, + // Sender = "WMS", + // Receiver = "Limes", + // IsSuccess = 0, //鏄惁涓嬪彂鎴愬姛 0澶辫触 1鎴愬姛 + // StartLocat = "", //璧峰浣嶇疆 + // PalletNo = "", //鎵樼洏鐮� + // IsSend = 1, //鏄惁鍙啀娆′笅鍙� + // IsCancel = 1, //鏄惁鍙彇娑� + // IsFinish = 1, //鏄惁鍙畬鎴� + // Status = "0", //浠诲姟鐘舵��0锛氱瓑寰呮墽琛�1姝e湪鎵ц2鎵ц瀹屾垚 + // OrderType = "5", //0 鍏ュ簱鍗� 1 鍑哄簱鍗� 2 鐩樼偣鍗� 3 绉诲簱鍗� 4 鍙栨牱鍑哄簱鍗� 5 鍏朵粬 + // EndLocat = "", //鐩爣浣嶇疆 + // Type = "3", //浠诲姟绫诲瀷 0 鍏ュ簱浠诲姟 1 鍑哄簱浠诲姟 2 绉诲簱浠诲姟 + // Msg = "璇烽獙浠诲姟" + //}; + + //// 鎻掑叆浠诲姟鏃ュ織 + //Db.Insertable(exTask).ExecuteCommand(); + + + // 璋冪敤Limes鎺ュ彛鍙戣捣璇烽獙 + var sendModel = new SendLimesModel() + { + QcNo = data.QcNo, + SkuNo = data.SkuNo, + Qty = data.Qty.ToString(), + LotNo = data.LotNo, + SupplierLot = data.SupplierLot, + RequestUser = userName, // 璇烽獙浜� + }; + var jsonData = JsonConvert.SerializeObject(sendModel); + string response = ""; + + try + { + var time1 = DateTime.Now;//鍙戦�佹椂闂� .ToString("yyyy-MM-dd HH:mm:ss") + //response = HttpHelper.DoPost(url, jsonData, "涓婁紶Limes绯荤粺鍙戣捣璇烽獙", "Limes"); + var time2 = DateTime.Now;//杩斿洖鏃堕棿 .ToString("yyyy-MM-dd HH:mm:ss") + + ////瑙f瀽杩斿洖鏁版嵁 + //var limesModel = JsonConvert.DeserializeObject<LimesModel>(response); + //if (limesModel.Success == 0) + //{ + + + // 鏇存柊璇烽獙鍗曚俊鎭� + data.Status = "1"; + data.SamplingQty = 10;//decimal.Parse(limesModel.SamplingQty); + data.RequestUser = userId; + data.RequestTime = DateTime.Now; + data.UpdateTime = DateTime.Now; + data.UpdateUser = userId; + + Db.Updateable(data).ExecuteCommand(); + //} + //if (limesModel.Success == -1) + //{ + + // throw new Exception(limesModel.Message); + //} + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + + //娣诲姞鎿嶄綔鏃ュ織璁板綍 + var k = new OperationCrServer() + .AddLogOperationCr("璐ㄩ噺绠$悊", "璐ㄦ璇烽獙", model.Code, "璇烽獙", $"鍚戣川閲忛儴鍒嗗彂璧疯楠�!", userId); + + return true; + } + catch (Exception e) + { + throw new Exception(e.Message); + } + } + + #endregion + + } } diff --git a/Wms/WMS.IBLL/IBllQualityServer/IInspectionRequest.cs b/Wms/WMS.IBLL/IBllQualityServer/IInspectionRequest.cs index 1a0b5a0..a0aa97f 100644 --- a/Wms/WMS.IBLL/IBllQualityServer/IInspectionRequest.cs +++ b/Wms/WMS.IBLL/IBllQualityServer/IInspectionRequest.cs @@ -32,12 +32,6 @@ /// <returns></returns> bool DelSamplingDetails(IdVm model,int userId); - /// <summary> - /// 鍙戦�佽楠屽崟淇℃伅 - /// </summary> - /// <param name="model"></param> - /// <returns></returns> - bool SendInspectionRequest(IdVm model, int userId,string url,string userName); /// <summary> /// 鍒犻櫎璇烽獙鍗曚俊鎭� diff --git a/Wms/WMS.IBLL/IHttpServer.cs b/Wms/WMS.IBLL/IHttpServer.cs index a7ba5cf..7fe8239 100644 --- a/Wms/WMS.IBLL/IHttpServer.cs +++ b/Wms/WMS.IBLL/IHttpServer.cs @@ -1,4 +1,5 @@ 锘縰sing Model.InterFaceModel; +using Model.ModelVm; using System; using System.Collections.Generic; using System.Text; @@ -7,6 +8,7 @@ { public interface IHttpServer { + #region WCS /// <summary> /// 鐢宠鍌ㄤ綅 锛堢珛浣撳簱锛� @@ -54,5 +56,20 @@ /// <param name="userId"></param> void MoveSuccess(string taskNo, int userId); + + #endregion + + + + #region Limes + + /// <summary> + /// 鍙戦�佽楠屽崟淇℃伅 + /// </summary> + /// <param name="model"></param> + /// <returns></returns> + bool SendInspectionRequest(IdVm model, int userId, string url, string userName); + + #endregion } } diff --git a/Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs b/Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs index 6ffd44f..4d1624b 100644 --- a/Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs +++ b/Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs @@ -124,7 +124,7 @@ void CompleteInStockLing(PdaLingAsnVm model, int userId); // 鏍规嵁绠辩爜鑾峰彇鏍囩绠辩爜淇℃伅 - List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model); + List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model,string url); //鏍规嵁鍗曟嵁鍙疯幏鍙栧崟鎹槑缁嗗垪琛� List<ArrivalNoticeDetailDto> GetBindArrivalNoticeDetails(ArrivalNoticeVm model); @@ -133,7 +133,7 @@ void ConfirmInStock(PalletBindVm model); //鏍规嵁绠辩爜鍚戣拷婧郴缁熻姹傜淇℃伅 - List<BoxInfoDto> GetFMBindBoxInfos(string boxno); + List<BoxInfoDto> GetFMBindBoxInfos(string boxno,string url); #region JC23鍙栨牱涓氬姟鎺ュ彛 diff --git a/Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs b/Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs index 871c02d..826ff84 100644 --- a/Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs +++ b/Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs @@ -70,6 +70,13 @@ Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListByPallet(string palletNo, string soNo); /// <summary> + /// 鑾峰彇鍗曟嵁鏄庣粏涓嬫媺妗嗘樉绀� + /// </summary> + /// <param name="soNo"></param> + /// <returns></returns> + Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListBySo(string soNo); + + /// <summary> /// 鑾峰彇鍑哄簱鍙c�佽鏍笺�佸緟鎷e強宸叉嫞鏁伴噺锛堟牴鎹嚭搴撳崟鏄庣粏ID銆佹墭鐩樺彿锛� /// </summary> /// <param name="soDetailId">鍑哄簱鍗曟槑缁咺D</param> diff --git a/Wms/Wms/Controllers/BllAsnController.cs b/Wms/Wms/Controllers/BllAsnController.cs index 14488e9..d505a8f 100644 --- a/Wms/Wms/Controllers/BllAsnController.cs +++ b/Wms/Wms/Controllers/BllAsnController.cs @@ -17,6 +17,8 @@ using Model.ModelDto.SysDto; using static System.Reflection.Metadata.BlobBuilder; using WMS.DAL; +using static System.Net.WebRequestMethods; +using WMS.IBLL; namespace Wms.Controllers { @@ -36,10 +38,11 @@ private readonly IBllLabelBoxNoServer _labelBox; // 绠辩爜鏍囩 private readonly IProcurePlanServer _procurePlanSvc; // 绠辩爜鏍囩 private readonly IPalletUpShelfServer _palletUpShelfSvc; // 涓婃灦璁板綍 + private readonly IHttpServer _http; #endregion #region 鏋勯�犲嚱鏁� - public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc, IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc, IOperationASNServer logSvc, IPalletUnbindServer palletUnbind, IAuditLogServer auditLog, IBllLabelBoxNoServer labelBox, IProcurePlanServer procurePlanSvc, IPalletUpShelfServer palletUpShelfSvc) + public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc, IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc, IOperationASNServer logSvc, IPalletUnbindServer palletUnbind, IAuditLogServer auditLog, IBllLabelBoxNoServer labelBox, IProcurePlanServer procurePlanSvc, IPalletUpShelfServer palletUpShelfSvc, IHttpServer http) { _arrivalNoticeSvc = arrivalNoticeSvc; _PalletBindSvc = palletBindSvc; @@ -51,6 +54,8 @@ _labelBox = labelBox; _procurePlanSvc = procurePlanSvc; _palletUpShelfSvc = palletUpShelfSvc; + + _http = http; } #endregion @@ -760,8 +765,8 @@ { return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); } - _PalletBindSvc.ArrivalSuccessBack(taskNo, int.Parse(userId)); - + //_PalletBindSvc.ArrivalSuccessBack(taskNo, int.Parse(userId)); + _http.ArrivalSuccess2(taskNo, int.Parse(userId)); return Ok(new { code = 0, msg = "鎴愬姛瀹屾垚浠诲姟", data = "" }); diff --git a/Wms/Wms/Controllers/BllQualityController.cs b/Wms/Wms/Controllers/BllQualityController.cs index fffe319..61409bf 100644 --- a/Wms/Wms/Controllers/BllQualityController.cs +++ b/Wms/Wms/Controllers/BllQualityController.cs @@ -195,38 +195,7 @@ } } - /// <summary> - /// 鍙戦�佽楠屽崟鎹� - /// </summary> - /// <param name="model">涓婚敭ID</param> - /// <returns></returns> - [HttpPost] - public IActionResult SendInspectionRequest(IdVm model) - { - try - { - 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 userName = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier)?.Value; - - string url = _config.WcsHost + _config.IssueComApiUrl; - var models = _inspectionRequestServer.SendInspectionRequest(model, int.Parse(userId),url,userName); - - return Ok(new { code = 0, count=0, msg = "鍚慙imes璇烽獙鎴愬姛!", data = models }); - } - catch (Exception e) - { - return Ok(new { code = 1, msg = e.Message }); - } - } + /// <summary> /// 鍒犻櫎璇烽獙鍗曚俊鎭� diff --git a/Wms/Wms/Controllers/DownApiController.cs b/Wms/Wms/Controllers/DownApiController.cs index c9ba34d..0bdcc9b 100644 --- a/Wms/Wms/Controllers/DownApiController.cs +++ b/Wms/Wms/Controllers/DownApiController.cs @@ -39,7 +39,7 @@ private readonly ITaskServer _taskSvc;//浠诲姟Svc private readonly IBllTaskSyncServer _taskSyncSvc;//浠诲姟鍚屾Svc private readonly IWaveMageServer _waveSvc;//浠诲姟鍚屾Svc - private readonly IHttpServer _http;//浠诲姟鍚屾Svc + private readonly IHttpServer _http; public DownApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IPalletBindServer asnPalletBindSvc, IStockCheckServer crCheckSvc, ITaskServer taskSvc, IBllTaskSyncServer taskSyncSvc, IWaveMageServer waveSvc,IHttpServer http) { _config = setting.Value; @@ -129,6 +129,7 @@ var house = _exNoticeSvc.GetHouseBySo(soNo); if (house == "W01") { + var list = _exNoticeSvc.IssueOutHouseMk(soNo, outMode, int.Parse(userId), _config.WcsHost + _config.IssueComApiUrl, out string str); return Ok(new { code = 0, msg = "str" }); } diff --git a/Wms/Wms/Controllers/PdaAsnController.cs b/Wms/Wms/Controllers/PdaAsnController.cs index 1522b14..3987256 100644 --- a/Wms/Wms/Controllers/PdaAsnController.cs +++ b/Wms/Wms/Controllers/PdaAsnController.cs @@ -1,6 +1,7 @@ 锘縰sing Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using Model.InterFaceModel; using Model.ModelDto.BllAsnDto; using Model.ModelDto.DataDto; @@ -12,6 +13,7 @@ using System.Security.Claims; using Utility; using Utility.Tools; +using Wms.Tools; using WMS.BLL.LogServer; using WMS.Entity.BllAsnEntity; using WMS.Entity.DataEntity; @@ -24,11 +26,13 @@ [Authorize] public class PdaAsnController : ControllerBase { + private readonly ApiUrlConfig _config; //鎺ュ彛浜や簰璺緞 private readonly IPdaAsnServer _PdaAsnSvc; private readonly UserManager _userManager; - public PdaAsnController(IPdaAsnServer pdaAsnSvc,UserManager userManager) + public PdaAsnController(IOptions<ApiUrlConfig> setting, IPdaAsnServer pdaAsnSvc,UserManager userManager) { + _config = setting.Value; _PdaAsnSvc = pdaAsnSvc; _userManager = userManager; } @@ -178,7 +182,7 @@ { try { - var models = _PdaAsnSvc.GetBindBoxInfos(model); + var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.GetBoxUrl); return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models }); } @@ -254,7 +258,7 @@ { _PdaAsnSvc.SaveAppointLocate(model.PalletNo, model.LocatNo, _userManager.UserId); - return Ok(new HttpReturnModel{ Success = "0", Message = "鏍规嵁鍗曟嵁鑾峰彇鏍囩鏁伴噺" }); + return Ok(new HttpReturnModel{ Success = "0", Message = "鎴愬姛鎸囧畾鍌ㄤ綅" }); } catch (Exception e) diff --git a/Wms/Wms/Controllers/PdaSoController.cs b/Wms/Wms/Controllers/PdaSoController.cs index a20295f..2d6283f 100644 --- a/Wms/Wms/Controllers/PdaSoController.cs +++ b/Wms/Wms/Controllers/PdaSoController.cs @@ -13,6 +13,7 @@ using Wms.Tools; using Utility; using System.Security.Cryptography; +using Model.InterFaceModel; namespace Wms.Controllers { @@ -75,10 +76,22 @@ /// <param name="model">PalletNo:鎵樼洏鐮併�丼oNo:鍗曟嵁鍙�</param> /// <returns></returns> [HttpPost] + public async Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListBySo(PdaSoVm model) + { + return await _pdaSoSvc.GetSoSkuLotNoListBySo(model.SoNo); + } + + /// <summary> + /// 鑾峰彇鐗╂枡-鎵规淇℃伅 + /// </summary> + /// <param name="model">PalletNo:鎵樼洏鐮併�丼oNo:鍗曟嵁鍙�</param> + /// <returns></returns> + [HttpPost] public async Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListByPallet(PdaSoVm model) { return await _pdaSoSvc.GetSoSkuLotNoListByPallet(model.PalletNo, model.SoNo); } + /// <summary> /// 鑾峰彇鍑哄簱鍙c�佽鏍笺�佸緟鎷e強宸叉嫞鏁伴噺锛堟牴鎹嚭搴撳崟鏄庣粏ID銆佹墭鐩樺彿锛� @@ -155,9 +168,18 @@ /// <param name="model">绌烘墭鐩樺嚭搴�</param> /// <returns></returns> [HttpPost] - public async Task<string> IssuePlnOutHouse(OutModePalletVm model) + public async Task<IActionResult> IssuePlnOutHouse(OutModePalletVm model) { - return await _pdaSoSvc.IssuePlnOutHouse(model, _userManager.UserId, _config.WcsHost + _config.IssueComApiUrl); + try + { + await _pdaSoSvc.IssuePlnOutHouse(model, _userManager.UserId, _config.WcsHost + _config.IssueComApiUrl); + return Ok(new HttpReturnModel { Success = "0", Message = "涓嬪彂璇锋眰鎴愬姛" }); + } + catch (Exception e) + { + return Ok(new HttpReturnModel { Success = "1", Message = e.Message }); + } + } diff --git a/Wms/Wms/Controllers/UpApiController.cs b/Wms/Wms/Controllers/UpApiController.cs index eefb118..b8743c0 100644 --- a/Wms/Wms/Controllers/UpApiController.cs +++ b/Wms/Wms/Controllers/UpApiController.cs @@ -24,6 +24,8 @@ using System.Threading.Tasks; using WMS.BLL.BllPdaServer; using WMS.IBLL.IPdaServer; +using WMS.BLL.BllQualityServer; +using WMS.IBLL; namespace Wms.Controllers { @@ -41,7 +43,9 @@ private readonly IStockCheckServer _stockCheckSvc;//鐩樼偣鍗昐vc private readonly IProcurePlanServer _procurePlanSvc;//閲囪喘鍗昐vs private readonly IPdaAsnServer _pdaAsnServer;// PDA - public UpApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IArrivalNoticeServer arrivalNoticeServer, IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc, IPdaAsnServer pdaAsnServer) + private readonly IHttpServer _http; + + public UpApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IArrivalNoticeServer arrivalNoticeServer, IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc, IPdaAsnServer pdaAsnServer, IHttpServer http) { _config = setting.Value; _exNoticeSvc = exNoticeSvc; @@ -49,6 +53,7 @@ _stockCheckSvc = stockCheckSvc; _procurePlanSvc = procurePlanSvc; _pdaAsnServer = pdaAsnServer; + _http = http; } #endregion @@ -268,7 +273,7 @@ { return Ok(new { code = 1, msg = "鏈幏鍙栧埌褰撳墠璇锋眰绠辩爜淇℃伅" }); } - var models = _pdaAsnServer.GetFMBindBoxInfos(BoxNo); + var models = _pdaAsnServer.GetFMBindBoxInfos(BoxNo, _config.BoxHost + _config.GetBoxUrl); return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models }); } @@ -278,6 +283,40 @@ } } + + /// <summary> + /// 鍙戦�佽楠屽崟鎹� + /// </summary> + /// <param name="model">涓婚敭ID</param> + /// <returns></returns> + [HttpPost] + public IActionResult SendInspectionRequest(IdVm model) + { + try + { + 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 userName = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier)?.Value; + + string url = _config.LimesHost + _config.SendInspection; + var models = _http.SendInspectionRequest(model, int.Parse(userId), url, userName); + + return Ok(new HttpReturnModel { Success = "0", Message = "鍚慙imes璇烽獙鎴愬姛!", Data = models }); + } + catch (Exception e) + { + return Ok(new HttpReturnModel { Success = "1", Message = e.Message }); + } + } + #endregion #region 琚皟涓婃父璋冪敤鎺ュ彛 diff --git a/Wms/Wms/Tools/ApiUrlConfig.cs b/Wms/Wms/Tools/ApiUrlConfig.cs index 5157e35..657d61d 100644 --- a/Wms/Wms/Tools/ApiUrlConfig.cs +++ b/Wms/Wms/Tools/ApiUrlConfig.cs @@ -20,6 +20,11 @@ /// </summary> public string BoxHost { get; set; } + /// <summary> + /// limes鐨処P + /// </summary> + public string LimesHost { get; set; } + #region 涓婃父绯荤粺 /// <summary> @@ -42,8 +47,13 @@ /// </summary> public string GetBoxUrl { get; set; } + /// <summary> + /// 鍙戣捣璐ㄦ--limes + /// </summary> + public string SendInspection { get; set; } + #endregion - + #region 涓嬫父绯荤粺 /// <summary> diff --git a/Wms/Wms/appsettings.json b/Wms/Wms/appsettings.json index 715247a..5ab4953 100644 --- a/Wms/Wms/appsettings.json +++ b/Wms/Wms/appsettings.json @@ -26,6 +26,7 @@ "ErpHost": "http://10.110.24.30:8081", //erpIP "WcsHost": "http://10.26.254.34:5005", //wcsIPhttp://localhost:57061/ "BoxHost": "http://10.110.24.30:8081", //boxIP + "LimesHost": "http://10.110.24.30:8081", //LimesIP "IssueComApiUrl": "/api/openApi/wcsTasks", //涓嬪彂鍛戒护(鍑哄簱銆佺Щ搴�) "IssueComApiUrl2": "/api/openApi/wcsTask", //閲嶆柊涓嬪彂鍛戒护(鍑哄簱銆佺Щ搴�) @@ -35,8 +36,9 @@ "DataChangeUrl": "/api/wmsInterface/OutStockTask", //搴撳瓨鍙樻洿鍥炰紶 "GetBoxUrl": "/api/wmsInterface/OutStockTask", //鑾峰彇绠辩爜淇℃伅 - "EditLocateUrl": "/api/WCSApi/EditLocatStatus" //鍚屾淇敼鍌ㄤ綅淇℃伅 + "EditLocateUrl": "/api/WCSApi/EditLocatStatus", //鍚屾淇敼鍌ㄤ綅淇℃伅 + "SendInspection": ""//鍙戣捣璐ㄦLIMES }, "SignConfig": { "ERPAppKey": "90170307d4184844ac2a26b431f79980", //ERP楠岀 -- Gitblit v1.8.0