| | |
| | | <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%;"> |
| | |
| | | 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 ">正在执行</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 ""; |
| | | } |
| | | } |
| | |
| | | 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秒) |
| | | }); |
| | |
| | | $('#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 { |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 渲染箱码信息 |
| | | // 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) { //成功 |
| | | //判断是否为零箱BitBoxMark |
| | | 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(); |
| | | } |
| | | }); |
| | | |
| | |
| | | "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) { |
New file |
| | |
| | | <!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> |
| | |
| | | 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();}); |
| | |
| | | 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 |
| | | } |
| | |
| | | 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 |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model) |
| | | public List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model,string url) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | 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) |
| | | { |
| | |
| | | /// </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);//解析返回数据 |
| | | if (obj.Success != 0) |
| | | var obj = JsonConvert.DeserializeObject<FumaGetBoxModel>(response);//解析返回数据 |
| | | 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, |
| | |
| | | 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) |
| | | { |
| | |
| | | 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) |
| | | { |
| | | //判断是否大于需要垛数 |
| | |
| | | |
| | | ////解析返回数据 |
| | | 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); |
| | |
| | | catch (Exception e) |
| | | { |
| | | Db.RollbackTran(); |
| | | return e.Message; |
| | | throw new Exception(e.Message); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 向Limes发送请验信息 |
| | | /// </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正在执行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") |
| | | |
| | | ////解析返回数据 |
| | | //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 |
| | | } |
| | | } |
| | |
| | | |
| | | 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",//拣货方式 0机器拆托出 1 人工拣货出 |
| | | //CompleteQty = outCount2, //拆的件数 |
| | | //BoxexQty = outCount, //总件数 |
| | | |
| | | Order = 999, |
| | | Type = PLCTypeEnum.AGV |
| | | |
| | | }); |
| | | taskNoStr = exTask.TaskNo; |
| | | |
| | |
| | | using Model.InterFaceModel; |
| | | using Model.ModelVm; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | 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); |
| | |
| | | // 添加托盘绑定表托盘入库任务号 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; |
| | |
| | | |
| | | 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; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | #region MyRegion |
| | | |
| | | |
| | | /// <summary> |
| | | /// 向Limes发送请验信息 |
| | | /// </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正在执行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") |
| | | |
| | | ////解析返回数据 |
| | | //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 |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// <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> |
| | | /// 删除请验单信息 |
| | |
| | | using Model.InterFaceModel; |
| | | using Model.ModelVm; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | |
| | | { |
| | | public interface IHttpServer |
| | | { |
| | | #region WCS |
| | | |
| | | /// <summary> |
| | | /// 申请储位 (立体库) |
| | |
| | | /// <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 |
| | | } |
| | | } |
| | |
| | | void CompleteInStockLing(PdaLingAsnVm model, int userId); |
| | | |
| | | // 根据箱码获取标签箱码信息 |
| | | List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model); |
| | | List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model,string url); |
| | | |
| | | //根据单据号获取单据明细列表 |
| | | List<ArrivalNoticeDetailDto> GetBindArrivalNoticeDetails(ArrivalNoticeVm model); |
| | |
| | | void ConfirmInStock(PalletBindVm model); |
| | | |
| | | //根据箱码向追溯系统请求箱信息 |
| | | List<BoxInfoDto> GetFMBindBoxInfos(string boxno); |
| | | List<BoxInfoDto> GetFMBindBoxInfos(string boxno,string url); |
| | | |
| | | #region JC23取样业务接口 |
| | | |
| | |
| | | Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListByPallet(string palletNo, string soNo); |
| | | |
| | | /// <summary> |
| | | /// 获取单据明细下拉框显示 |
| | | /// </summary> |
| | | /// <param name="soNo"></param> |
| | | /// <returns></returns> |
| | | Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListBySo(string soNo); |
| | | |
| | | /// <summary> |
| | | /// 获取出库口、规格、待拣及已拣数量(根据出库单明细ID、托盘号) |
| | | /// </summary> |
| | | /// <param name="soDetailId">出库单明细ID</param> |
| | |
| | | using Model.ModelDto.SysDto; |
| | | using static System.Reflection.Metadata.BlobBuilder; |
| | | using WMS.DAL; |
| | | using static System.Net.WebRequestMethods; |
| | | using WMS.IBLL; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | 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; |
| | |
| | | _labelBox = labelBox; |
| | | _procurePlanSvc = procurePlanSvc; |
| | | _palletUpShelfSvc = palletUpShelfSvc; |
| | | |
| | | _http = http; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | { |
| | | 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 = "" }); |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /// <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 = "向Limes请验成功!", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除请验单信息 |
| | |
| | | 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; |
| | |
| | | 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" }); |
| | | } |
| | |
| | | using 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; |
| | |
| | | using System.Security.Claims; |
| | | using Utility; |
| | | using Utility.Tools; |
| | | using Wms.Tools; |
| | | using WMS.BLL.LogServer; |
| | | using WMS.Entity.BllAsnEntity; |
| | | using WMS.Entity.DataEntity; |
| | |
| | | [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; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | var models = _PdaAsnSvc.GetBindBoxInfos(model); |
| | | var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.GetBoxUrl); |
| | | |
| | | return Ok(new { code = 0, msg = "标签箱码信息", data = models }); |
| | | } |
| | |
| | | { |
| | | _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) |
| | |
| | | using Wms.Tools; |
| | | using Utility; |
| | | using System.Security.Cryptography; |
| | | using Model.InterFaceModel; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | /// <param name="model">PalletNo:托盘码、SoNo:单据号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListBySo(PdaSoVm model) |
| | | { |
| | | return await _pdaSoSvc.GetSoSkuLotNoListBySo(model.SoNo); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取物料-批次信息 |
| | | /// </summary> |
| | | /// <param name="model">PalletNo:托盘码、SoNo:单据号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListByPallet(PdaSoVm model) |
| | | { |
| | | return await _pdaSoSvc.GetSoSkuLotNoListByPallet(model.PalletNo, model.SoNo); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取出库口、规格、待拣及已拣数量(根据出库单明细ID、托盘号) |
| | |
| | | /// <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 }); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | using System.Threading.Tasks; |
| | | using WMS.BLL.BllPdaServer; |
| | | using WMS.IBLL.IPdaServer; |
| | | using WMS.BLL.BllQualityServer; |
| | | using WMS.IBLL; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | private readonly IStockCheckServer _stockCheckSvc;//盘点单Svc |
| | | private readonly IProcurePlanServer _procurePlanSvc;//采购单Svs |
| | | 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; |
| | |
| | | _stockCheckSvc = stockCheckSvc; |
| | | _procurePlanSvc = procurePlanSvc; |
| | | _pdaAsnServer = pdaAsnServer; |
| | | _http = http; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | { |
| | | 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 }); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <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 = "向Limes请验成功!", Data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new HttpReturnModel { Success = "1", Message = e.Message }); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 被调上游调用接口 |
| | |
| | | /// </summary> |
| | | public string BoxHost { get; set; } |
| | | |
| | | /// <summary> |
| | | /// limes的IP |
| | | /// </summary> |
| | | public string LimesHost { get; set; } |
| | | |
| | | #region 上游系统 |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public string GetBoxUrl { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 发起质检--limes |
| | | /// </summary> |
| | | public string SendInspection { get; set; } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 下游系统 |
| | | |
| | | /// <summary> |
| | |
| | | "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", //重新下发命令(出库、移库) |
| | |
| | | "DataChangeUrl": "/api/wmsInterface/OutStockTask", //库存变更回传 |
| | | "GetBoxUrl": "/api/wmsInterface/OutStockTask", //获取箱码信息 |
| | | |
| | | "EditLocateUrl": "/api/WCSApi/EditLocatStatus" //同步修改储位信息 |
| | | "EditLocateUrl": "/api/WCSApi/EditLocatStatus", //同步修改储位信息 |
| | | |
| | | "SendInspection": ""//发起质检LIMES |
| | | }, |
| | | "SignConfig": { |
| | | "ERPAppKey": "90170307d4184844ac2a26b431f79980", //ERP验签 |