From d567d9d6926abb103f3ab73402134daa6a09ef11 Mon Sep 17 00:00:00 2001 From: chengsc <Demo@DESKTOP-CPA90BF> Date: 星期六, 02 十一月 2024 18:28:13 +0800 Subject: [PATCH] 修改问题 --- HTML/views/QualityControl/QualityInformationFrom.html | 6 Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs | 6 Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs | 113 +++++ Wms/Wms/Controllers/PdaCrController.cs | 37 + Wms/Wms/Tools/ApiUrlConfig.cs | 10 Pda/View/HouseDataSetting/artificialTransport.html | 493 +++++++++++++++++++++++++ Wms/WMS.IBLL/ISysServer/IToken.cs | 8 Wms/Wms/Controllers/PdaAsnController.cs | 4 Wms/Model/ModelDto/BllQualityDto/BllQualityInspectDto.cs | 7 Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs | 6 Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs | 154 ++++--- Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs | 13 Wms/WMS.IBLL/IBllQualityServer/IQualityInspectServer.cs | 8 Wms/Wms/appsettings.json | 2 Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs | 6 Wms/Wms/Controllers/BllQualityController.cs | 37 + HTML/views/QualityControl/QualityInformation.html | 39 ++ Wms/Model/ModelVm/PdaVm/PdaCrVm.cs | 17 Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs | 164 ++++++++ Wms/WMS.Entity/BllQualityEntity/BllQualityInspect.cs | 7 Wms/Model/InterFaceModel/HttpModel.cs | 2 21 files changed, 1,038 insertions(+), 101 deletions(-) diff --git a/HTML/views/QualityControl/QualityInformation.html b/HTML/views/QualityControl/QualityInformation.html index 512e8d0..23675f2 100644 --- a/HTML/views/QualityControl/QualityInformation.html +++ b/HTML/views/QualityControl/QualityInformation.html @@ -96,6 +96,15 @@ </div> + <script type="text/html" id="IsStatus"> + {{# if(d.Status=='0'){ }} + <p>绛夊緟瀹℃牳</p> + {{# } else if(d.Status=='1'){ }} + <p>閫氳繃</p> + {{# } else if(d.Status=='2'){ }} + <p>涓嶉�氳繃</p> + {{# } }} + </script> <script type="text/html" id="IsQualifiedButton"> {{# if(d.IsQualified=='0'){ }} <p>涓嶅悎鏍�</p> @@ -107,6 +116,23 @@ {{# console.log(d.CreateTime); return formatDate(d.CreateTime); }} + </script> + <script type="text/html" id="CaoZuoList"> + {{# function GetBtn(d){ + var html = ''; + console.log(d); + switch (d.Status) { + case "0" : + html += `<a class="layui-btn layui-btn-normal layui-btn-xs editClass" lay-event="edit"> + <i class="layui-icon layui-icon-edit"></i>澶嶆牳</a>`; + break; + default : + break; + } + return html; + } + }} + {{ GetBtn(d) }} </script> </div> @@ -138,6 +164,9 @@ field: 'InspectNo',title: '妫�楠屽彿',align: 'center' }, { + field: 'Status',title: '鐘舵��',align: 'center',templet: '#IsStatus', + }, + { field: 'SkuNo',title: '鐗╂枡缂栫爜',align: 'center' }, { @@ -166,6 +195,9 @@ }, { field: 'CreateTime',title: '鍒涘缓鏃堕棿',align: 'center', templet: '#CreateTimeButton', + }, + { + field: 'caozuo', title: '鎿嶄綔', fixed: 'right', width: 100, align: 'center', toolbar: '#CaoZuoList', "disabled": true }, ]]; var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜 @@ -291,6 +323,7 @@ function setRight() { $(function() { $("#approvalBtn").hide(); + $("#editClass").hide(); }); sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) { if (res.code == 0) { //鎴愬姛 @@ -301,6 +334,12 @@ $("#approvalBtn").show(); }); } + if (res.data[k].MenuName == "澶嶆牳璐ㄦ缁撴灉") + { + $(function() { + $(".editClass").show(); + }); + } } } else { //涓嶆垚鍔� layer.msg('鑾峰彇鏉冮檺淇℃伅澶辫触', { diff --git a/HTML/views/QualityControl/QualityInformationFrom.html b/HTML/views/QualityControl/QualityInformationFrom.html index 82da996..98add69 100644 --- a/HTML/views/QualityControl/QualityInformationFrom.html +++ b/HTML/views/QualityControl/QualityInformationFrom.html @@ -34,16 +34,16 @@ <input type="text" name="SkuNo" placeholder="璇疯緭鍏ョ墿鏂欏彿" lay-verify="required" autocomplete="off" class="layui-input"> </div> </div> - <div class="layui-form-item"> + <!-- <div class="layui-form-item"> <label class="layui-form-label">瀹℃牳鐘舵��</label> <div class="layui-input-block" style="width: 70%;"> <select name="IsQualified" id="IsQualified" lay-verify=""> - <!-- <option value=""></option> --> + <option value=""></option> <option value="0">涓嶅悎鏍�</option> <option value="1" selected>鍚堟牸</option> </select> </div> - </div> + </div> --> <div class="layui-form-item layui-hide"> <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit" value="纭娣诲姞"> </div> diff --git a/Pda/View/HouseDataSetting/artificialTransport.html b/Pda/View/HouseDataSetting/artificialTransport.html new file mode 100644 index 0000000..8d2a959 --- /dev/null +++ b/Pda/View/HouseDataSetting/artificialTransport.html @@ -0,0 +1,493 @@ +<!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>浜哄伐杞繍</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"> + .layui-form-label { + width: 20%; + } + + .layui-input-block { + width: 80%; + margin-left: 20%; + } + + .div-tbl-title { + width: 98%; + margin: auto; + /* background-color: #4476A7; */ + height: 30px; + margin-top: 20px; + } + + .div-tbl-title table { + width: 100%; + height: 30px; + } + + .div-tbl-title td { + width: 50%; + height: 30px; + line-height: 30px; + } + + .div-tbl-title span { + float: left; + width: 60%; + height: 30px; + line-height: 30px; + } + + .div-tbl-title input { + float: left; + width: 40%; + height: 30px; + line-height: 30px; + border: none; + } + + .layout-tbl-paging { + margin-top: 0; + } + + .layout-bill-info { + height: auto; + } + + .btn-ok { + border: none; + color: #FFFFFF; + background-color: #0a93e3; + width: 48%; + height: 36px; + border-radius: 5px; + float: left; + margin: 0 1%; + margin-left: 25%; + } + + .btn-ok:active { + opacity: 0.8; + } + + td { + word-break: break-all; + word-wrap: break-word; + } + </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">浜哄伐杞繍</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="" class="layui-form-item layout-input"> + <label class="layui-form-label" lang>鎵樼洏鏉$爜锛�</label> + <div class="layui-input-block"> + <input id="STOCKCODE" type="text" lay-verify="stock" lang langholder + placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" autocomplete="off" class="layui-input"> + </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" lay-verify="stock" lang langholder placeholder="璧峰鍦扮爜" + autocomplete="off" class="layui-input" readonly> + </div> + </div> + + <div id="" class="layui-form-item layout-input"> + <label class="layui-form-label" lang>鐩爣鍦扮爜锛�</label> + <div class="layui-input-block"> + <input id="EndLocatNo" type="text" lay-verify="stock" lang langholder placeholder="鐩爣鍦扮爜" + autocomplete="off" class="layui-input"> + </div> + </div> + <div id="" class="" style="width: 100%;height: 36px;margin-top: 15px;"> + <button id="btnQuery" class="btn-ok" type="button">杞繍</button> + </div> + </form> + </div> + + <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: 25%;">鎵规</th> + <th lang style="width: 15%;">鐗╂枡鏁伴噺</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> + </tr> + </table> + <!-- 鍒嗛〉 --> + <table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding=""> + <tr> + <td class="page-prev">涓婁竴椤�</td> + <td class="page-num page-num-select">1</td> + <td class="page-num">2</td> + <td class="page-num">3</td> + <td class="page-num">4</td> + <td class="page-num">5</td> + <td class="page-next">涓嬩竴椤�</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/public.js"></script> + <script src="/js/jquery.cookie.js"></script> + <script> + layui.use(['form', 'jquery'], function () { + var form = layui.form; + + //褰撳墠鍒嗛〉 + var curPageIndex = 1; + var tableData = null; + + //----------------------------------------------------------------------------------------------------- + + // 鎵樼洏鐮佹枃鏈敼鍙樻椂瑙﹀彂 + $("#STOCKCODE").on('input', function () { + if ($("#STOCKCODE").val() == "" || $("#STOCKCODE").val().length < 8) { + return; + } + if ($("#STOCKCODE").val().length >= 8) { + $("#STOCKCODE").val($("#STOCKCODE").val().substr(-8)) + } + getPalletLocatNo() + }) + //鎵樼洏鐮佸洖杞︿簨浠� + $("#STOCKCODE").keydown(function (e) { + if (e.keyCode === 13) { + if ($("#STOCKCODE").val() == "") { + layer.msg('璇峰厛鎵弿鎵樼洏鏉$爜', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return + } + getPalletLocatNo() + } + }); + + function getPalletLocatNo() { + + var param = { + "PalletNo": $("#STOCKCODE").val() + } + sendData(IP + "/PdaCr/GetPalletLocatNo", param, 'get', function (res) { + if (res.code == 0) { + $("#LocatNo").val(res.data) + refreshTable() + } else { + $("#LocatNo").val('') + //鍏堟竻绌轰竴涓嬬瀛愬垪琛� + let trs = $("#tableBoxList tr") + let len = trs.length + + for (i = len - 1; i >= 2; i--) { + trs[i].remove(); + } + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + } + }); + } + + $("#btnQuery").click(function () { + 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 ($("#LocatNo").val() == "") { + layer.msg('鐩爣鍦板潃涓嶈兘涓虹┖', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + return; + } + var param = { + PalletNo: $("#STOCKCODE").val(), + LocatNo: $("#LocatNo").val(), + EndLocatNo: $("#EndLocatNo").val() + } + //鍛煎彨灏忚溅 + sendData(IP + "/PdaCr/ArtificialTransport", 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() { + + //鍏堟竻绌轰竴涓嬬瀛愬垪琛� + let trs = $("#tableBoxList tr") + let len = trs.length + + for (i = len - 1; i >= 2; i--) { + trs[i].remove(); + } + if ($("#STOCKCODE").val() == '') { + return; + } + + var param = { + PalletNo: $("#STOCKCODE").val(), + IsHuiKu: 1 + }; + // 鏍规嵁鎵樼洏鍙疯幏鍙栫鐮佷俊鎭� + sendData(IP + "/PdaCr/GetSkuInfoByPalletNo", param, 'get', 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.show(); + arrTrs[i] = tr + } + + + } else { //涓嶆垚鍔� + layer.msg("鏃犳暟鎹�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function () { }); + $("#boxNum").val(0) + } + }); + + } + + //璁剧疆鍒嗛〉 + function setPages(pageIndex, boxNum) { + if (boxNum <= 0) { + //鍒楄〃涓虹┖锛岄殣钘忓垎椤甸〉鐮� + $("#tableBoxPages").hide() + return + } + + let pageNum = Math.floor(boxNum / 10); + if (boxNum % 10 > 0) { + pageNum += 1; + } + //console.log("pageNum is " + pageNum) + + $("#tableBoxPages").find("tr").remove() + let table = $("#tableBoxPages") + $("<tr></tr>").appendTo("#tableBoxPages") + + // let newTr = table.append("<tr></tr>") + // newTr.append("<td class='page-prev'>涓婁竴椤�</td>") + $("<td id='prevPage' class='page-prev'>涓婁竴椤�</td>").appendTo("#tableBoxPages tr") + $("#tableBoxPages tr").eq(0).find("td[id^='prevPage']").click(function () { + onClickPrevPage() + }) + for (i = 1; i < pageNum + 1; i++) { + // newTr.append("<td class='page-num'>"+ i +"</td>") + $("<td class='page-num'>" + i + "</td>").appendTo("#tableBoxPages tr") + } + // newTr.append("<td class='page-next'>涓嬩竴椤�</td>") + $("<td id='nextPage' class='page-next'>涓嬩竴椤�</td>").appendTo("#tableBoxPages tr") + $("#tableBoxPages tr").eq(0).find("td[id^='nextPage']").click(function () { + onClickNextPage() + }) + // pages.show() + $("#tableBoxPages").show() + + setCurPage(1) + } + + //璁剧疆褰撳墠鍒嗛〉 + function setCurPage(pageIndex) { + let totalTrNum = $("#tableBoxList tr").length + if (totalTrNum <= 2) { + //console.log("tableBoxList 涓虹┖ totalTrNum: " + totalTrNum) + //curPageIndex = 1 + return + } + + let pageNum = getBoxPageNum() + if (pageIndex > pageNum) { + //console.log("璁剧疆鐨勯〉鐮佽秴鍑洪〉鏁�, pageIndex : " + pageIndex) + //curPageIndex = 1 + return + } + + let startIndex = (pageIndex - 1) * 10 + 1 + let n = totalTrNum - startIndex + let endIndex = 0 + if (n > 9) { + endIndex = startIndex + 9 + } else { + endIndex = startIndex + n + } + //console.log("startIndex is "+startIndex) + //console.log("endIndex is "+endIndex) + //startIndex =2 + //endIndex = 2 + let trs = $("#tableBoxList tr") + //console.log("琛屾暟 "+trs.length) + let d = 0 + for (let i = 2; i < trs.length; i++) { + //console.log("琛岀储寮� " + trs.eq(i).attr('index')) + let t = trs.eq(i) + d = t.attr('index') + if (d >= startIndex && d <= endIndex) { + //console.log("闇�瑕佹樉绀�") + //鏄剧ず琛� + t.show() + } else { + //闅愯棌琛� + t.hide() + } + } + + curPageIndex = pageIndex + + let ptr = $("#tableBoxPages tr") + for (let i = 1; i < pageNum + 1; i++) { + ptr.eq(0).find("td").eq(i).removeClass("page-num-select") + if (i == curPageIndex) { + ptr.eq(0).find("td").eq(i).addClass("page-num-select") + } + } + //console.log("totalTrNum is " + totalTrNum) + } + + function onClickPrevPage() { + //console.log("涓婁竴椤垫寜閽鐐瑰嚮") + if (curPageIndex == 1) { + return + } + setCurPage(curPageIndex - 1) + } + + function onClickNextPage() { + //console.log("涓嬩竴椤垫寜閽鐐瑰嚮") + let n = getBoxPageNum() + if (curPageIndex == n) { + return + } + setCurPage(curPageIndex + 1) + } + + function getBoxPageNum() { + let num = $("#tableBoxList tr").length + if (num <= 2) { + return 0 + } + + let pageNum = Math.floor(num / 10); + if (num % 10 > 0) { + pageNum += 1; + } + + return pageNum + } + + + $("#menuImg").click(function (e) { + //console.log("menuImg") + e.stopPropagation() + + if ($("#menuList").is(":hidden")) { + $("#menuList").show() + } else { + $("#menuList").hide() + } + }) + $('body').click(function () { + $("#menuList").hide() + }) + + + form.verify({ + stock: [/^[\S]{6}$/, '鎵樼洏鏉$爜蹇呴』涓哄叚浣嶅瓧绗�'] + }); + }) + </script> +</body> + +</html> \ No newline at end of file diff --git a/Wms/Model/InterFaceModel/HttpModel.cs b/Wms/Model/InterFaceModel/HttpModel.cs index 8ae086a..8882911 100644 --- a/Wms/Model/InterFaceModel/HttpModel.cs +++ b/Wms/Model/InterFaceModel/HttpModel.cs @@ -982,7 +982,7 @@ /// <summary> /// 绠卞唴灏忓寘瑁呮暟閲� /// </summary> - public string BoxItemQty { get; set; } + public decimal BoxItemQty { get; set; } /// <summary> /// /// </summary> diff --git a/Wms/Model/ModelDto/BllQualityDto/BllQualityInspectDto.cs b/Wms/Model/ModelDto/BllQualityDto/BllQualityInspectDto.cs index d6fa473..57be7ee 100644 --- a/Wms/Model/ModelDto/BllQualityDto/BllQualityInspectDto.cs +++ b/Wms/Model/ModelDto/BllQualityDto/BllQualityInspectDto.cs @@ -19,6 +19,13 @@ public string ASNNo { get; set; } /// <summary> + /// Desc:鐘舵�� + /// Default: + /// Nullable:True + /// </summary> + public string Status { get; set; } + + /// <summary> /// Desc:鎵规鍙� /// Default: /// Nullable:True diff --git a/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs b/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs index 149bf87..f3ead93 100644 --- a/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs +++ b/Wms/Model/ModelVm/PdaVm/PdaCrVm.cs @@ -69,4 +69,21 @@ /// </summary> public string Ruku { get; set; } } + + public class PdaArtificialTransportVm + { + /// <summary> + /// 鎵樼洏鏉$爜 + /// </summary> + public string PalletNo { get; set; } + /// <summary> + /// 璧峰鍦板潃 + /// </summary> + public string LocatNo { get; set; } + /// <summary> + /// 鐩爣鍦板潃 + /// </summary> + public string EndLocatNo { get; set; } + } + } diff --git a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs index 83bf21a..9ccdc0a 100644 --- a/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs +++ b/Wms/WMS.BLL/BllAsnServer/BllBoxInfoServer.cs @@ -722,7 +722,7 @@ //{ // maxLotNoStr = toDayTime.Substring(2, 6) + "0001"; //} - //maxBoxCode = label.Where(m => m.LotNo == maxLotNoStr).Max(a => a.BoxNo); + maxBoxCode = label.Where(m => m.LotNo == maxLotNoStr).Max(a => a.BoxNo); } } @@ -894,8 +894,8 @@ //{ // maxCodestr2 = toDayTime2.Substring(2, 6) + "0001"; //} - //maxboxcode2 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo);//绠卞彿; - //maxboxcode3 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo3);//鏀彿; + maxboxcode2 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo);//绠卞彿; + maxboxcode3 = label.Where(m => m.LotNo == maxCodestr2).Max(a => a.BoxNo3);//鏀彿; } } diff --git a/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs b/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs index 016a51a..53cd28b 100644 --- a/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs +++ b/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs @@ -1378,8 +1378,12 @@ if (endLocate != null && endLocate.AreaNo == "B12") //鏄惁鏄�3妤肩紦瀛樺尯 鏄細鍒犻櫎搴撳瓨 { + if (string.IsNullOrWhiteSpace(item.SONo)) + { + throw new Exception("褰撳墠鎵樼洏涓嶆槸鎷兼墭鍑哄簱鎵樼洏"); + } //璁板綍鎵樼洏涓婁俊鎭粰MES - + data.Add(new RequertBeiliaoInfoModel() { materiel_no = item.SkuNo, diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs index 7519147..93d6ac8 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs @@ -24,6 +24,7 @@ using System.IO; using System.Security.Cryptography.X509Certificates; using System.Net.WebSockets; +using WMS.BLL.SysServer; namespace WMS.BLL.BllPdaServer { @@ -1794,7 +1795,7 @@ #region 浜у搧缁勬墭 - public void GetBoxInfoByFuMa(string boxNo,string url) + public void GetBoxInfoByFuMa(string boxNo,string url,string fuMaTokenUrl,string levelType) { try { @@ -1865,77 +1866,86 @@ #endregion #region 姝e紡鐗堟湰 + var token = new Token().GetFuMaToken(fuMaTokenUrl); + var getParentVal = levelType == "1" ? "true" : "false"; + var getChildrenVal = levelType == "3" ? "true" : "false"; + Dictionary<string, string> paramDic = new Dictionary<string, string> + { + { "Token", token }, //鍒嗛厤鐨勪护鐗岋紙鍙橀噺锛� + { "Barcode", boxNo },//瑕佹煡璇㈢殑鏉$爜 + { "getParent", getParentVal },//鏄惁鏌ヨ鐖剁爜 + { "getChildren", getChildrenVal } //鏄惁鏌ヨ瀛愮爜 + }; + //绋嬪簭姝e紡鍙戝竷鍚庢斁寮� + var time1 = DateTime.Now;//鍙戦�佹椂闂� .ToString("yyyy-MM-dd HH:mm:ss") + var response = HttpHelper.DoGet(url, "璧嬬爜", "鑾峰彇绠辩爜淇℃伅", paramDic); + var time2 = DateTime.Now;//杩斿洖鏃堕棿 .ToString("yyyy-MM-dd HH:mm:ss") - ////绋嬪簭姝e紡鍙戝竷鍚庢斁寮� - //var time1 = DateTime.Now;//鍙戦�佹椂闂� .ToString("yyyy-MM-dd HH:mm:ss") - ////var response = HttpHelper.DoGet(url, jsonData, "鑾峰彇绠辩爜淇℃伅", "璧嬬爜"); - //var time2 = DateTime.Now;//杩斿洖鏃堕棿 .ToString("yyyy-MM-dd HH:mm:ss") + //瑙f瀽杩斿洖鏁版嵁 + var fuMaModel = JsonConvert.DeserializeObject<FuMaGetBoxModel>(response); + if (fuMaModel.IsSuccess) + { + //璧嬬爜杩斿洖淇℃伅鎴愬姛鐘舵�� + if (fuMaModel.Product == null || fuMaModel.Barcodes.Count == 0) + { + throw new Exception("浜у搧淇℃伅鎴栫鏀俊鎭负绌�"); + } - ////瑙f瀽杩斿洖鏁版嵁 - //var fuMaModel = JsonConvert.DeserializeObject<FuMaGetBoxModel>(response); - //if (fuMaModel.IsSuccess) - //{ - // //璧嬬爜杩斿洖淇℃伅鎴愬姛鐘舵�� - // if (fuMaModel.Product == null || fuMaModel.Barcodes.Count == 0) - // { - // throw new Exception("浜у搧淇℃伅鎴栫鏀俊鎭负绌�"); - // } + foreach (var item in fuMaModel.Barcodes) + { + if (item.Barcode != boxNo) + { + throw new Exception("鑾峰彇淇℃伅涓嶄竴鑷�"); + } - // foreach (var item in fuMaModel.Barcodes) - // { - // if (item.Barcode != boxNo) - // { - // throw new Exception("鑾峰彇淇℃伅涓嶄竴鑷�"); - // } - - // var sku = Db.Queryable<SysMaterials>().First(m => m.IsDel == "0" && m.SkuNo == fuMaModel.Product.ProductCode); - // if (sku == null) - // { - // throw new Exception("鏈煡璇㈠埌绠辩爜涓殑鐗╂枡淇℃伅"); - // } - // //var boxInfo = new BllBoxInfo() - // //{ - // // ASNNo = "", - // // //ASNDetailNo = 0, - // // OrderCode = "", - // // //BindNo = 0, - // // BoxNo = item.BoxNo, - // // BoxNo2 = item.BoxNo2, - // // BoxNo3 = item.Barcode, - // // PalletNo = "", - // // Qty = item.Qty, - // // FullQty = item.FullQty, - // // Status = "0", - // // SkuNo = item.SkuNo, - // // SkuName = sku.SkuName, - // // LotNo = item.LotNo, - // // LotText = item.LotText, - // // SupplierLot = item.SupplierLot, - // // ProductionTime = item.ProductionTime, - // // ExpirationTime = item.ExpirationTime, - // // //CompleteTime = comTime, - // // InspectMark = item.InspectMark, - // // BitBoxMark = item.BitBoxMark, - // // InspectStatus = item.InspectStatus, - // // Origin = "璧嬬爜", - // // Standard = item.Standard, - // // PackageStandard = item.PackageStandard, - // // StoreTime = item.StoreTime, - // // QtyOrd = item.QtyOrd, - // // QtyCount = item.QtyCount, - // // CreateUser = 0, - // // CreateTime = comTime, - // //}; - // //list.Add(boxInfo); - // } - // Db.Insertable(list).ExecuteCommand(); - //} - //else - //{ - // //璧嬬爜杩斿洖淇℃伅澶辫触鐘舵�� - // throw new Exception($"璧嬬爜绯荤粺杩斿洖鐘舵�佸紓甯革細{fuMaModel.Message}"); - //} + var sku = Db.Queryable<SysMaterials>().First(m => m.IsDel == "0" && m.SkuNo == fuMaModel.Product.ProductCode); + if (sku == null) + { + throw new Exception("鏈煡璇㈠埌绠辩爜涓殑鐗╂枡淇℃伅"); + } + var boxInfo = new BllBoxInfo() + { + ASNNo = "", + //ASNDetailNo = 0, + OrderCode = "", + //BindNo = 0, + BoxNo = item.Barcode, + BoxNo2 = item.Barcode, + BoxNo3 = item.Barcode, + PalletNo = "", + Qty = item.BoxItemQty, + FullQty = fuMaModel.BoxItemQty, + Status = "0", + SkuNo = sku.SkuNo, + SkuName = sku.SkuName, + LotNo = item.BatchNo, + //LotText = "", + //SupplierLot = item.SupplierLot, + ProductionTime = DateTime.Parse(item.ProductionDate), + ExpirationTime = DateTime.Parse(item.ExpirationDate), + //CompleteTime = comTime, + InspectMark = "0", + BitBoxMark = item.Status == "闆剁"? "1":"0", + InspectStatus = "0", + Origin = "璧嬬爜", + Standard = fuMaModel.Product.Spec, + PackageStandard = fuMaModel.Product.PackageSpec, + //StoreTime = item.StoreTime, + //QtyOrd = item.QtyOrd, + //QtyCount = item.QtyCount, + CreateUser = 0, + CreateTime = comTime, + }; + list.Add(boxInfo); + } + Db.Insertable(list).ExecuteCommand(); + } + else + { + //璧嬬爜杩斿洖淇℃伅澶辫触鐘舵�� + throw new Exception($"璧嬬爜绯荤粺杩斿洖鐘舵�佸紓甯革細{fuMaModel.Message}"); + } #endregion } @@ -1950,7 +1960,7 @@ /// </summary> /// <param name="model"></param> /// <returns></returns> - public List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model, string url) + public List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model, string url, string fuMaTokenUrl) { try { @@ -1970,7 +1980,7 @@ var count = Db.Queryable<BllBoxInfo>().Count(m => m.IsDel == "0" && m.Status == "0" && m.BoxNo == model.BoxNo); if (count == 0) { - GetBoxInfoByFuMa(model.BoxNo, url); //浠庤祴鐮佺郴缁熻幏鍙栫鐮佷俊鎭� + GetBoxInfoByFuMa(model.BoxNo, url, fuMaTokenUrl,"1"); //浠庤祴鐮佺郴缁熻幏鍙栫鐮佷俊鎭� } } } @@ -2007,7 +2017,7 @@ /// </summary> /// <param name="model"></param> /// <returns></returns> - public List<BoxInfoDto> GetBindBoxInfo2s(BoxInfoVm model, string url) + public List<BoxInfoDto> GetBindBoxInfo2s(BoxInfoVm model, string url, string fuMaTokenUrl) { try { @@ -2073,7 +2083,7 @@ } else { - GetBoxInfoByFuMa(model.BoxNo3, url); //浠庤祴鐮佺郴缁熻幏鍙栫鐮佷俊鎭� + GetBoxInfoByFuMa(model.BoxNo3, url, fuMaTokenUrl,"3"); //浠庤祴鐮佺郴缁熻幏鍙栫鐮佷俊鎭� } } } diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs index 4b30086..1583573 100644 --- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs +++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs @@ -1,15 +1,19 @@ 锘縰sing System; using System.Collections.Generic; using System.Linq; +using System.Security.Policy; using System.Text; +using System.Threading.Tasks; using Model.InterFaceModel; using Model.ModelDto.BllCheckDto; using Model.ModelDto.PdaDto; +using Model.ModelDto.SysDto; using Model.ModelVm; using Newtonsoft.Json; using SqlSugar; using Utility.Tools; using WMS.BLL.LogServer; +using WMS.BLL.SysServer; using WMS.DAL; using WMS.Entity.BllAsnEntity; using WMS.Entity.BllCheckEntity; @@ -1333,6 +1337,166 @@ } #endregion + #region 浜哄伐杞繍 + + //浜哄伐杞繍 + public void ArtificialTransport(string palletNo, string locatNo, string endLocatNo, string mesTokenUrl, string mesUrl,int userId) + { + if (string.IsNullOrEmpty(palletNo)) + { + throw new Exception("璇锋壂鎻忔墭鐩樻潯鐮侊紒"); + } + if (string.IsNullOrEmpty(locatNo)) + { + throw new Exception("璇烽�夋嫨璧峰鍦板潃锛�"); + } + if (string.IsNullOrEmpty(endLocatNo)) + { + throw new Exception("璇疯緭鍏ョ洰鏍囧湴鍧�锛�"); + } + + try + { + #region 鍒ゆ柇淇℃伅 + + var stockDetail = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.PalletNo == palletNo).ToList(); + if (stockDetail.Count == 0) + { + throw new Exception("鎵樼洏涓婄墿鏂欏簱瀛樻槑缁嗕俊鎭笉瀛樺湪,璇锋鏌�!"); + } + + if (string.IsNullOrEmpty(stockDetail.First().LocatNo)) + { + throw new Exception("鎵樼洏鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + if (stockDetail.First().WareHouseNo != "W02") + { + throw new Exception("璇ユ墭鐩樻湭鍦ㄥ钩搴撳唴,璇锋鏌�!"); + } + //璧峰鍌ㄤ綅淇℃伅 + var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == locatNo); + if (storageLocat == null) + { + throw new Exception("璧峰鍦板潃鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + //鐩爣鍌ㄤ綅淇℃伅 + var EndLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == endLocatNo); + if (EndLocat == null) + { + throw new Exception("鐩爣鍦板潃鍌ㄤ綅淇℃伅涓嶅瓨鍦�,璇锋鏌�!"); + } + + #endregion + + //寮�鍚簨鍔� + Db.BeginTran(); + + //闇�鍏堝垽鏂洰鏍囧湴鍧�鍓嶆柟鏄惁鏈夌┖鍌ㄤ綅 + + storageLocat.Status = "0"; //鏇存敼璧峰鍌ㄤ綅 + Db.Updateable(storageLocat).ExecuteCommand(); + EndLocat.Status = "1"; //鏇存敼鐩爣鍌ㄤ綅 + Db.Updateable(storageLocat).ExecuteCommand(); + + var data = new List<RequertBeiliaoInfoModel>(); + + //鏇存敼搴撳瓨鏄庣粏 + foreach (var item in stockDetail) + { + item.LocatNo = EndLocat.LocatNo;//鍌ㄤ綅鏇存敼 + item.WareHouseNo = EndLocat.WareHouseNo;//鎵�灞炰粨搴撴洿鏀� + item.RoadwayNo = EndLocat.RoadwayNo;//鎵�灞炲贩閬撴洿鏀� + item.AreaNo = EndLocat.AreaNo;//鎵�灞炲尯鍩熸洿鏀� + + Db.Updateable(item).ExecuteCommand(); + + if (EndLocat != null && EndLocat.AreaNo == "B12") //鏄惁鏄�3妤肩紦瀛樺尯 鏄細鍒犻櫎搴撳瓨 + { + if (string.IsNullOrWhiteSpace(item.SONo)) + { + throw new Exception("褰撳墠鎵樼洏涓嶆槸鎷兼墭鍑哄簱鎵樼洏"); + } + //璁板綍鎵樼洏涓婁俊鎭粰MES + + data.Add(new RequertBeiliaoInfoModel() + { + materiel_no = item.SkuNo, + materiel_name = item.SkuName, + qty = item.Qty, + batch = item.LotNo, + producttime = item.ProductionTime, + expiry = item.ExpirationTime + + }); + //搴撳瓨绠辩爜鏄庣粏鍒犻櫎 + var boxInfo = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.StockDetailId == item.Id).ToList(); + Db.Deleteable(boxInfo).ExecuteCommand(); + //鍒犻櫎搴撳瓨鎵樼洏淇℃伅 + Db.Deleteable(item).ExecuteCommand(); + //鏇存敼搴撳瓨鎬昏〃 + var stock = Db.Queryable<DataStock>().First(w => w.IsDel == "0" && w.SkuNo == item.SkuNo && w.LotNo == item.LotNo); + stock.LockQty -= (decimal)item.Qty; + stock.Qty -= (decimal)item.Qty; + Db.Updateable(stock).ExecuteCommand(); + //鏇存敼鎵樼洏鐘舵�� + var pallet = Db.Queryable<SysPallets>().First(m => m.IsDel == "0" && m.PalletNo == palletNo); + if (pallet != null) + { + pallet.Status = "0"; + Db.Updateable(pallet).ExecuteCommand(); + } + } + } + + + if (EndLocat != null && EndLocat.AreaNo == "B12") + { + //鑾峰彇浠ょ墝 + var token = new Token().GetMesToken(mesTokenUrl); + Dictionary<string, string> mesDic = new Dictionary<string, string>() + { + {"Authorization",token } + }; + var mesData = new RequertBeiliaoModel() + { + morder_no = stockDetail.First().SONo, + pallet = stockDetail.First().PalletNo, + layer_no = EndLocat.LocatNo, + items = data + }; + var jsonData = JsonConvert.SerializeObject(mesData); + //璋冪敤鎺ュ彛 + var response = HttpHelper.DoPost(mesUrl, jsonData, "澶囨枡瀹屾垚杩愯嚦缂撳瓨鍖哄弽棣堣嚦MES", "MES", mesDic); + + var obj = JsonConvert.DeserializeObject<MesModel>(response);//瑙f瀽杩斿洖鏁版嵁 + if (obj.status != "0") + { + throw new Exception("澶囨枡鍚屾MES澶辫触锛�" + obj.message); + } + + } + + + + //娣诲姞鎿嶄綔鏃ュ織璁板綍 + var k = new OperationCrServer().AddLogOperationCr("PDA妯″潡", "AGV杞繍", palletNo, "绉诲簱", $"PDA鍛煎彨灏忚溅瀵规墭鐩樺彿锛歿palletNo}鍙戣捣杞繍", userId); + + //鎻愪氦浜嬪姟 + Db.CommitTran(); + } + catch (Exception ex) + { + Db.RollbackTran(); + throw new Exception(ex.Message); + } + + + + + } + + #endregion + #region 绠辩爜鏌ヨ /// <summary> /// 绠辩爜鏌ヨ diff --git a/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs b/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs index a446c6b..8c3ef1b 100644 --- a/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs +++ b/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs @@ -32,7 +32,7 @@ /// <returns></returns> public List<BllQualityInspectDto> GetBllQualityList(BllQualityInspect model) { - string str = "select q.Id Id,q.InspectNo InspectNo,q.ASNNo ASNNo,q.LotNo LotNo,q.SupplierLot SupplierLot,q.SkuNo SkuNo,q.SkuName SkuName,q.Standard Standard,q.PassQty PassQty,q.FailQty FailQty,q.Origin Origin,q.InspectTime InspectTime,q.IsOut IsOut,q.IsQualified IsQualified,q.IsDel IsDel,q.CreateTime CreateTime,u.RealName CreateUserName,q.UpdateTime UpdateTime,q.UpdateUser UpdateUserName from BllQualityInspect q left join SysUserInfor u on q.CreateUser = u.id where q.IsDel = @isdel"; + string str = "select q.Id Id,q.InspectNo InspectNo,q.ASNNo ASNNo,q.Status Status,q.LotNo LotNo,q.SupplierLot SupplierLot,q.SkuNo SkuNo,q.SkuName SkuName,q.Standard Standard,q.PassQty PassQty,q.FailQty FailQty,q.Origin Origin,q.InspectTime InspectTime,q.IsOut IsOut,q.IsQualified IsQualified,q.IsDel IsDel,q.CreateTime CreateTime,u.RealName CreateUserName,q.UpdateTime UpdateTime,q.UpdateUser UpdateUserName from BllQualityInspect q left join SysUserInfor u on q.CreateUser = u.id where q.IsDel = @isdel"; ////鍒ゆ柇鍏ュ簱鍗曞彿鏄惁涓虹┖ //if (!string.IsNullOrEmpty(model.ASNNo)) @@ -131,40 +131,123 @@ //if (quality != null) //{ - ////鍒ゆ柇鏄惁涓洪��璐у叆搴撳崟 - //if (isTui == 1) - //{ - // if (quality.ASNNo == model.ASNNo) - // { - // throw new Exception("褰撳墠閫�璐у叆搴撳崟宸插垱寤鸿川妫�淇℃伅锛岃鍕块噸澶嶅垱寤猴紒"); - // } - //} + ////鍒ゆ柇鏄惁涓洪��璐у叆搴撳崟 + //if (isTui == 1) + //{ + // if (quality.ASNNo == model.ASNNo) + // { + // throw new Exception("褰撳墠閫�璐у叆搴撳崟宸插垱寤鸿川妫�淇℃伅锛岃鍕块噸澶嶅垱寤猴紒"); + // } + //} // throw new Exception("褰撳墠鐗╂枡鍜屾壒娆″凡杩涜璐ㄦ锛岃鏍告煡锛�"); //} ////鏌ユ壘鍚屾壒娆� 鍚屽崟鎹� 鍏ュ簱鍗曚俊鎭�� //BllArrivalNoticeDetail arrivalDetail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.ASNNo == model.ASNNo && m.LotNo == model.LotNo); - + model.Status = "0";//瀹℃牳鐘舵�� model.Origin = "WMS"; //鏉ユ簮 model.CreateTime = Db.GetDate(); //鍒涘缓鏃ユ湡 model.SkuNo = sku.SkuNo; //鐗╂枡鍙� model.SkuName = sku.SkuName; //鐗╂枡鍚嶇О - model.PassQty = 0; //鍚堟牸鏁伴噺 - model.FailQty = 0; //涓嶅悎鏍兼暟閲� + //model.PassQty = 0; //鍚堟牸鏁伴噺 + //model.FailQty = 0; //涓嶅悎鏍兼暟閲� model.Standard = sku.Standard; //瑙勬牸 + //model.SupplierLot = arrivalDetail.SupplierLot; //渚涜揣鎵规 + + //鏌ユ壘搴撳瓨鏄庣粏淇℃伅 + //List<DataStockDetail> detail = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.SkuNo == model.SkuNo && m.LotNo == model.LotNo).ToList(); + //if (isTui == 1) + //{ + // detail = detail.Where(m=> m.ASNNo == model.ASNNo).ToList(); + //} + //foreach (var item in detail) + //{ + // List<DataBoxInfo> box = Db.Queryable<DataBoxInfo>().Where(a => a.IsDel == "0" && a.StockDetailId == item.Id && a.SkuNo == model.SkuNo && a.LotNo == model.LotNo).ToList(); + // //鍒ゆ柇鍚堟牸鐘舵�佹槸鍚﹀悎鏍� + // if (model.IsQualified == "1") + // { + // //鍚堟牸 鐩稿悓鎵规搴撳瓨淇℃伅鍏ㄩ儴鏀逛负鍚堟牸鐘舵�� 涓斿悎鏍兼暟閲忓鍔犱负鍚屾壒娆″悓鍗曞彿璇ョ墿鏂欏叏閮ㄦ暟閲忎箣鍜� + // model.PassQty += item.Qty; + // //淇敼搴撳瓨鏄庣粏鍚堟牸鐘舵�� + // item.InspectStatus = "1"; //1鍚堟牸 + // foreach (var b1 in box) + // { + // b1.InspectStatus = "1"; //1鍚堟牸 + // } + // } + // else //涓嶅悎鏍� + // { + // //涓嶅悎鏍� 鐩稿悓鎵规銆佸叆搴撳崟搴撳瓨淇℃伅鍏ㄩ儴鏀逛负涓嶅悎鏍肩墿鏂� 涓斾笉鍚堟牸鏁伴噺澧炲姞涓哄悓鎵规鍚屽崟鍙疯鐗╂枡鍏ㄩ儴鏁伴噺涔嬪拰 + // model.FailQty += item.Qty; + // item.InspectStatus = "2"; //2涓嶅悎鏍� + // foreach (var b1 in box) + // { + // b1.InspectStatus = "2"; //2涓嶅悎鏍� + // } + // } + // Db.Updateable(box).ExecuteCommand(); + // Db.Updateable(item).ExecuteCommand(); + //} + var isquality = Db.Insertable(model).ExecuteCommand(); + + return isquality; + } + + + /// <summary> + /// 璐ㄦ澶嶆牳淇℃伅 + /// </summary> + /// <param name="model">璐ㄦ淇℃伅瀹炰綋妯″瀷</param> + /// <returns></returns> + public int FinshQuality(int id,string type,int userId) + { + //楠岃瘉璐ㄦ鍙锋槸鍚︿负绌� + if (string.IsNullOrEmpty(type)) + { + throw new Exception("鐘舵�佷笉鑳戒负绌猴紒"); + } + var model = Db.Queryable<BllQualityInspect>().First(m=>m.IsDel == "0" && m.Id == id); + if (model == null) + { + throw new Exception("鏈煡璇㈠埌璐ㄦ淇℃伅"); + } + int isTui = 0; + //楠岃瘉鍏ュ簱鍗曞彿鏄惁涓虹┖ + if (!string.IsNullOrEmpty(model.ASNNo)) + { + //鏌ヨ鏄惁涓洪��璐у叆搴撳崟鎹� + var Arrival = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.ASNNo == model.ASNNo && (a.Type == "3" || a.Type == "4")); + if (Arrival == null) + { + throw new Exception("鍙湁鍏ュ簱鍗曟嵁涓洪��璐у叆搴撳崟鍙緭鍏ュ叆搴撳崟鍙凤紝璇锋牳鏌ワ紒"); + } + + //鑾峰彇鍏ュ簱鍗曟槑缁� + var ArrivalDetail = Db.Queryable<BllArrivalNoticeDetail>().First(a => a.IsDel == "0" && a.ASNNo == model.ASNNo && a.LotNo.Contains(model.LotNo) && a.SkuNo == model.SkuNo); + if (ArrivalDetail == null) + { + throw new Exception("杈撳叆鐨勬壒娆℃垨鐗╂枡淇℃伅涓庡叆搴撳崟鎹笉绗︼紝璇锋牳鏌ワ紒"); + } + isTui = 1; + } + + + + model.Status = type; //瑙勬牸 + model.IsQualified = type; //model.SupplierLot = arrivalDetail.SupplierLot; //渚涜揣鎵规 //鏌ユ壘搴撳瓨鏄庣粏淇℃伅 List<DataStockDetail> detail = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.SkuNo == model.SkuNo && m.LotNo == model.LotNo).ToList(); if (isTui == 1) { - detail = detail.Where(m=> m.ASNNo == model.ASNNo).ToList(); + detail = detail.Where(m => m.ASNNo == model.ASNNo).ToList(); } foreach (var item in detail) { List<DataBoxInfo> box = Db.Queryable<DataBoxInfo>().Where(a => a.IsDel == "0" && a.StockDetailId == item.Id && a.SkuNo == model.SkuNo && a.LotNo == model.LotNo).ToList(); //鍒ゆ柇鍚堟牸鐘舵�佹槸鍚﹀悎鏍� - if (model.IsQualified == "1") + if (type == "1") { //鍚堟牸 鐩稿悓鎵规搴撳瓨淇℃伅鍏ㄩ儴鏀逛负鍚堟牸鐘舵�� 涓斿悎鏍兼暟閲忓鍔犱负鍚屾壒娆″悓鍗曞彿璇ョ墿鏂欏叏閮ㄦ暟閲忎箣鍜� model.PassQty += item.Qty; @@ -188,7 +271,7 @@ Db.Updateable(box).ExecuteCommand(); Db.Updateable(item).ExecuteCommand(); } - var isquality = Db.Insertable(model).ExecuteCommand(); + var isquality = Db.Updateable(model).ExecuteCommand(); return isquality; } diff --git a/Wms/WMS.Entity/BllQualityEntity/BllQualityInspect.cs b/Wms/WMS.Entity/BllQualityEntity/BllQualityInspect.cs index 148798b..e8cc2fe 100644 --- a/Wms/WMS.Entity/BllQualityEntity/BllQualityInspect.cs +++ b/Wms/WMS.Entity/BllQualityEntity/BllQualityInspect.cs @@ -26,6 +26,13 @@ public string ASNNo {get;set;} /// <summary> + /// Desc:鐘舵�� 0 绛夊緟瀹℃牳 1 瀹℃牳閫氳繃 2瀹℃牳涓嶉�氳繃 + /// Default: + /// Nullable:True + /// </summary> + public string Status { get; set; } + + /// <summary> /// Desc:鎵规鍙� /// Default: /// Nullable:True diff --git a/Wms/WMS.IBLL/IBllQualityServer/IQualityInspectServer.cs b/Wms/WMS.IBLL/IBllQualityServer/IQualityInspectServer.cs index 5b3e340..ee1a4e7 100644 --- a/Wms/WMS.IBLL/IBllQualityServer/IQualityInspectServer.cs +++ b/Wms/WMS.IBLL/IBllQualityServer/IQualityInspectServer.cs @@ -25,6 +25,14 @@ /// <returns></returns> int InsertQuality(BllQualityInspect model); + /// <summary> + /// 澶嶆牳璐ㄦ缁撴灉 + /// </summary> + /// <param name="id">ID</param> + /// <param name="type">绫诲瀷 1 閫氳繃 2 涓嶉�氳繃</param> + /// <param name="userId">鎿嶄綔浜�</param> + /// <returns></returns> + int FinshQuality(int id, string type, int userId); #endregion } } diff --git a/Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs b/Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs index 2fcd357..0fd4033 100644 --- a/Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs +++ b/Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs @@ -74,12 +74,12 @@ //闆剁鍏ュ簱 void CompleteInStockLing(PdaLingAsnVm model, int userId); - void GetBoxInfoByFuMa(string boxNo, string url); + void GetBoxInfoByFuMa(string boxNo, string url, string fuMaTokenUrl,string levelType); // 鏍规嵁绠辩爜鑾峰彇鏍囩绠辩爜淇℃伅 - List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model, string url); + List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model, string url, string fuMaTokenUrl); // 鏍规嵁绠辩爜鑾峰彇鏍囩鏈�灏忚拷婧爜淇℃伅 - List<BoxInfoDto> GetBindBoxInfo2s(BoxInfoVm model,string url); + List<BoxInfoDto> GetBindBoxInfo2s(BoxInfoVm model,string url, string fuMaTokenUrl); //鏍规嵁鍗曟嵁鍙疯幏鍙栧崟鎹槑缁嗗垪琛� List<ArrivalNoticeDetailDto> GetBindArrivalNoticeDetails(ArrivalNoticeVm model); diff --git a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs index 6963b55..9c14ecc 100644 --- a/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs +++ b/Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs @@ -140,6 +140,19 @@ List<string> AgvTransport2(string soNo, string palletNo, string areaNo, int userId, string url); #endregion + #region 浜哄伐杞繍 + /// <summary> + /// 浜哄伐杞繍 + /// </summary> + /// <param name="palletNo"></param> + /// <param name="locatNo"></param> + /// <param name="endLocatNo"></param> + /// <param name="mesTokenUrl"></param> + /// <param name="mesUrl"></param> + /// <param name="userId"></param> + void ArtificialTransport(string palletNo, string locatNo, string endLocatNo, string mesTokenUrl, string mesUrl, int userId); + #endregion + #region 绠辩爜鏌ヨ /// <summary> /// pda搴撳瓨鏌ヨ diff --git a/Wms/WMS.IBLL/ISysServer/IToken.cs b/Wms/WMS.IBLL/ISysServer/IToken.cs index 040d73a..7360367 100644 --- a/Wms/WMS.IBLL/ISysServer/IToken.cs +++ b/Wms/WMS.IBLL/ISysServer/IToken.cs @@ -12,5 +12,13 @@ /// <param name="url">mes鑾峰彇浠ょ墝璺緞</param> /// <returns>token鍊�</returns> string GetMesToken(string url); + + + /// <summary> + /// 鑾峰彇璧嬬爜鐨則oken浠ょ墝 + /// </summary> + /// <param name="url">璧嬬爜鑾峰彇浠ょ墝璺緞</param> + /// <returns>token鍊�</returns> + string GetFuMaToken(string url); } } diff --git a/Wms/Wms/Controllers/BllQualityController.cs b/Wms/Wms/Controllers/BllQualityController.cs index 25b529b..6176bb4 100644 --- a/Wms/Wms/Controllers/BllQualityController.cs +++ b/Wms/Wms/Controllers/BllQualityController.cs @@ -40,7 +40,7 @@ { var bolls = _qualityServer.GetBllQualityList(model); - return Ok(new { code = 0, msg = "璐ㄦ淇℃伅", data = bolls }); + return Ok(new { code = 0,count = bolls.Count, msg = "璐ㄦ淇℃伅", data = bolls }); } catch (Exception e) { @@ -81,6 +81,41 @@ } } + + + /// <summary> + /// 娣诲姞澶嶆牳淇℃伅 + /// </summary> + /// <param name="model">璐ㄦ淇℃伅瀹炰綋妯″瀷</param> + /// <returns></returns> + [HttpPost] + public IActionResult InsertFuHe(BllQualityInspect 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 = "鏈幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + model.CreateUser = int.Parse(userId); + _qualityServer.InsertQuality(model); + + return Ok(new { code = 0, count = 0, msg = "鐗╂枡璐ㄦ淇℃伅鎿嶄綔鎴愬姛", data = "" }); + } + catch (Exception e) + { + return Ok(new { code = 1, msg = e.Message }); + } + } + + #endregion } } diff --git a/Wms/Wms/Controllers/PdaAsnController.cs b/Wms/Wms/Controllers/PdaAsnController.cs index 977d562..1a909b5 100644 --- a/Wms/Wms/Controllers/PdaAsnController.cs +++ b/Wms/Wms/Controllers/PdaAsnController.cs @@ -528,7 +528,7 @@ { try { - var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.FuMaGetBoxUrl); + var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.FuMaGetBoxUrl, _config.BoxHost + _config.FuMaGetTokenUrl); return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models }); } @@ -548,7 +548,7 @@ { try { - var models = _PdaAsnSvc.GetBindBoxInfo2s(model, _config.BoxHost + _config.FuMaGetBoxUrl); + var models = _PdaAsnSvc.GetBindBoxInfo2s(model, _config.BoxHost + _config.FuMaGetBoxUrl, _config.BoxHost + _config.FuMaGetTokenUrl); return Ok(new { code = 0, msg = "鏍囩绠辩爜淇℃伅", data = models }); } diff --git a/Wms/Wms/Controllers/PdaCrController.cs b/Wms/Wms/Controllers/PdaCrController.cs index ee47568..a668121 100644 --- a/Wms/Wms/Controllers/PdaCrController.cs +++ b/Wms/Wms/Controllers/PdaCrController.cs @@ -416,6 +416,43 @@ } #endregion + #region 浜哄伐杞繍 + + /// <summary> + /// 浜哄伐杞繍 + /// </summary> + /// <param name="model"></param> + /// <returns></returns> + [HttpPost] + public IActionResult ArtificialTransport(PdaArtificialTransportVm 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.ArtificialTransport(model.PalletNo, model.LocatNo, model.EndLocatNo, _config.MesHost + _config.MesGetTokenUrl,_config.MesHost+_config.MesBeiLiaoUrl, uId); + + return Ok(new { data = "", code = 0, msg = "鎴愬姛" }); + } + catch (Exception e) + { + return Ok(new { data = "", code = 1, msg = $"寮傚父锛歿e.Message}" }); + } + } + + #endregion + #region 绠辩爜鏌ヨ /// <summary> /// pda绠辩爜鏌ヨ diff --git a/Wms/Wms/Tools/ApiUrlConfig.cs b/Wms/Wms/Tools/ApiUrlConfig.cs index 74d62d2..28203b5 100644 --- a/Wms/Wms/Tools/ApiUrlConfig.cs +++ b/Wms/Wms/Tools/ApiUrlConfig.cs @@ -26,6 +26,11 @@ /// </summary> public string BoxHost { get; set; } + /// <summary> + /// AGV鐨処P + /// </summary> + public string AgvHost { get; set; } + #region Erp绯荤粺 /// <summary> @@ -73,6 +78,11 @@ /// 鑾峰彇绠辩爜淇℃伅 /// </summary> public string FuMaGetBoxUrl { get; set; } + /// <summary> + /// 鑾峰彇璧嬬爜浠ょ墝璺緞 + /// </summary> + public string FuMaGetTokenUrl { get; set; } + #endregion diff --git a/Wms/Wms/appsettings.json b/Wms/Wms/appsettings.json index 653ce2d..097a659 100644 --- a/Wms/Wms/appsettings.json +++ b/Wms/Wms/appsettings.json @@ -27,6 +27,7 @@ "MesHost": "http://10.110.24.30:8081", //mesIP "WcsHost": "http://10.18.52.10:5005", // "http://localhost:57061", //wcsIPhttp://localhost:57061/ "BoxHost": "http://10.110.24.30:8081", //boxIP + "AgvHost": "http://10.110.24.30:8081", //agvIP // WCS "IssueComApiUrl": "/api/demo/wcsTasks", //涓嬪彂鍛戒护(鍑哄簱銆佺Щ搴�) @@ -45,6 +46,7 @@ "MesGetTokenUrl": "/port/mes/service/system/sign_login", //鑾峰彇浠ょ墝 // 璧嬬爜 "FuMaGetBoxUrl": "/port/mes/service/system/sign_login", //鑾峰彇璧嬬爜绠辩爜淇℃伅 + "FuMaGetTokenUrl": "/port/mes/service/system/sign_login", //鑾峰彇浠ょ墝 // AGV "GenAgvSchedulingTask": "http://IP:PORT/rcms/services/rest/hikRpcService/genAgvSchedulingTask", //鐢熸垚浠诲姟鍗曟帴鍙� -- Gitblit v1.8.0