Merge branch 'master' into Liudl
| | |
| | | sendData(IP + "/PdaAsn/GetBindBoxInfos", param, 'post', function (res) { |
| | | BoxLevelVal = "0"; |
| | | if (res.code == 0) { //成功 |
| | | //判断是否为零箱BitBoxMark |
| | | if (res.data[0].BitBoxMark == '1') { |
| | | getFMBoxinfo(); |
| | | } else { |
| | | 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 { |
| | | 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); |
| | | } |
| | | } |
| | | } else { //不成功 |
| | | //箱码不存在,调用赋码接口获取箱信息 |
| | | getFMBoxinfo(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | function getFMBoxinfo(){ |
| | | var param = { |
| | | "BoxNo": $("#BOXCODE").val(), |
| | | } |
| | | sendData(IP + "/UpApi/GetFMBindBoxInfos", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功//根据对接接口定义各字段判断条件 |
| | | var bl = false; |
| | | if (res.data.length == 0) { |
| | | layer.msg("未查询到此箱物料信息,请核实!", { |
| | |
| | | } else { |
| | | $("#BoxQty").val(res.data[0].Qty); |
| | | } |
| | | |
| | | } else { //不成功 |
| | | } else { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | <img src="/assets/fengexian.png"> |
| | | </div> |
| | | |
| | | <div class="layout-tbl-paging" id="" style="display: none;"> |
| | | <div class="layout-tbl-paging" id="" > |
| | | |
| | | <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding=""> |
| | | <tr> |
| | | <th lang>托盘码</th> |
| | | <th lang>物料号</th> |
| | | <th lang>物料名称</th> |
| | | <th lang>批次号</th> |
| | | <th lang>库位地址</th> |
| | | |
| | | </tr> |
| | | <tr id="boxCell" style="display: none"> |
| | | <!-- <td name="PalletNo">托盘码</td> --> |
| | | <td name="PalletNo">托盘码</td> |
| | | <td name="SkuNo">物料号</td> |
| | | <td name="SkuName">物料名称</td> |
| | | <td name="LotNo">批次号</td> |
| | | <td name="LocatNo">库位地址</td> |
| | | <!-- <td name="del"> |
| | | <div id="" class="tbl-btn-del" lang> |
| | | 删除 |
| | |
| | | } |
| | | GetBoxInfo(); |
| | | }); |
| | | |
| | | $("#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() { |
| | | 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>'); |
| | | form.render('select'); |
| | | |
| | | var param = { |
| | | PalletNo: $("#PalletNo").val(), |
| | | Type: "1", |
| | | }; |
| | | synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) { |
| | | console.log(res); |
| | | |
| | | if (res.code == 0) { //成功 |
| | | console.log(res.data); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (i == 0) { |
| | | $("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>'); |
| | | } else { |
| | | $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); |
| | | var PalletNo = $("#PalletNo").val(); |
| | | if(PalletNo.length != 8){ //下拉框获取平库出库单 |
| | | 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'); |
| | | form.render('select'); |
| | | |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | }); |
| | | 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秒) |
| | | }); |
| | | } |
| | | }); |
| | | }else{//根据托盘号获取出库单 |
| | | var param = { |
| | | PalletNo: $("#PalletNo").val(), |
| | | Type: "1", |
| | | }; |
| | | synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) { |
| | | console.log(res); |
| | | |
| | | if (res.code == 0) { //成功 |
| | | console.log(res.data); |
| | | for (var i = 0; i < res.data.length; i++) { |
| | | if (i == 0) { |
| | | $("#bar").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>'); |
| | | } else { |
| | | $("#bar").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>'); |
| | | } |
| | | } |
| | | form.render('select'); |
| | | |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //获取托盘物料名细 |
| | |
| | | var arrTrs = new Array() |
| | | let idx = 0 |
| | | for (var i in list) { |
| | | console.log("list[i].LocatN:"+list[i].LocatNo); |
| | | // list[i].BoxCode |
| | | var tr = $("#boxCell").eq(0).clone(); |
| | | tr.appendTo("#tableBoxList"); |
| | | // tr.attr('id', list[i].BoxCode) |
| | | idx++; |
| | | tr.attr('index', idx) |
| | | // tr.find("td[name='PalletNo']").html(list[i].PalletNo); |
| | | tr.find("td[name='PalletNo']").html(list[i].PalletNo); |
| | | tr.find("td[name='SkuNo']").html(list[i].SkuNo); |
| | | tr.find("td[name='SkuName']").html(list[i].SkuName); |
| | | tr.find("td[name='LotNo']").html(list[i].LotNo); |
| | | tr.find("td[name='LocatNo']").html(list[i].LocatNo); |
| | | // var code = list[i].BoxCode |
| | | // //console.log("code is "+code) |
| | | |
| | |
| | | { |
| | | public string BoxNo { get; set; } // 箱码/支码 |
| | | public decimal? Qty { get; set; } // 箱内数量 |
| | | public string PalletNo { get; set; } |
| | | public string SkuNo { get; set; } // 物料编码 |
| | | public string SkuName { get; set; } // 物料名称 |
| | | public string LotNo { get; set; } // 批次 |
| | | public string LocatNo { get; set; } |
| | | public decimal? PickedQty { get; set; } // 箱内已拣数量 |
| | | } |
| | | public class DetailIdSkuLotNo |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public List<BoxInfoDto> GetBoxInfoList(BoxInfoVm model, out int count) |
| | | { |
| | | try |
| | |
| | | BoxNo, |
| | | SkuNo, |
| | | SkuName, |
| | | LotNo, |
| | | 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; "; |
| | | GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; |
| | | var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); |
| | | |
| | | if (models == null) |
| | | if (models.Count == 0 ) |
| | | { |
| | | throw new Exception("箱码信息不存在!"); |
| | | } |
| | |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据箱码向追溯系统请求标签箱码信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public List<BoxInfoDto> GetFMBindBoxInfos(string boxno) |
| | | { |
| | | try |
| | | { |
| | | #region 箱码请求接口,正式系统放开 |
| | | /*var jsonData = JsonConvert.SerializeObject(boxno); |
| | | |
| | | var response = HttpHelper.DoPost(url, jsonData, "箱码信息请求", "FM"); |
| | | |
| | | var obj = JsonConvert.DeserializeObject<ErpModel>(response);//解析返回数据 |
| | | if (obj.Success != 0) |
| | | { |
| | | throw new Exception("请求失败" + obj.Message); |
| | | }*/ |
| | | #endregion |
| | | string sqlString = $@"SELECT |
| | | ASNNo, |
| | | BoxNo, |
| | | SkuNo, |
| | | SkuName, |
| | | LotNo, |
| | | BitBoxMark, |
| | | SUM(Qty) as Qty |
| | | FROM BllBoxInfo |
| | | WHERE IsDel = '0' |
| | | AND Status='0' |
| | | AND BoxNo = '{boxno}' |
| | | GROUP BY ASNNo,BoxNo,SkuNo,SkuName,LotNo,BitBoxMark; "; |
| | | var models = Db.Ado.SqlQuery<BoxInfoDto>(sqlString); // response |
| | | |
| | | if (models.Count == 0) |
| | | { |
| | | throw new Exception("箱码信息不存在!"); |
| | | } |
| | | |
| | | return models; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | // 根据单据号获取单据明细列表 |
| | | public List<ArrivalNoticeDetailDto> GetBindArrivalNoticeDetails(ArrivalNoticeVm model) |
| | | { |
| | |
| | | return allotList2; |
| | | } |
| | | |
| | | //获取托盘中含有的执行中的单据 |
| | | public async Task<List<string>> GetRunNoticeList(string type) |
| | | { |
| | | if (type == "1")//平库出库获取单据 |
| | | { |
| | | var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "1" || m.Status =="0")).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync(); |
| | | return allotList; |
| | | } |
| | | //获取状态为待拣货或者部分拣货的出库单 |
| | | var allotList2 = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3")).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync(); |
| | | |
| | | //var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToList(); |
| | | //获取出库单据不为待拣货 执行完毕 订单关闭 等待执行的单据 |
| | | //var export = Db.Queryable<BllExportNotice>().Where(a => a.IsDel == "0" && a.Status == "1" || a.Status == "2" || a.Status == "3").Select(a => a.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToList(); |
| | | |
| | | return allotList2; |
| | | } |
| | | |
| | | //获取出库托盘上的物料批次(根据托盘码) |
| | | public async Task<List<DetailIdSkuLotNo>> GetSoSkuLotNoListByPallet(string palletNo, string soNo) |
| | | { |
| | |
| | | //获取平库托盘信息 |
| | | public async Task<List<BoxInfo>> GetPingKuInfoByPallet(string soNo, string palletNo) |
| | | { |
| | | var info = Db.Queryable<BllExportAllot>().Where(m => m.SONo == soNo && m.PalletNo == palletNo && m.IsDel == "0"); |
| | | |
| | | var info = Db.Queryable<BllExportAllot>() |
| | | .LeftJoin<DataStockDetail>((a, b) => a.PalletNo == b.PalletNo) |
| | | .Where(a=>a.IsDel == "0" && (a.Status == "0"||a.Status =="1") && a.SONo == soNo) |
| | | .GroupBy((a,b) => new { a.SkuNo, a.SkuName, a.LotNo, a.PalletNo,b.LocatNo }).Select((a,b) => new BoxInfo() |
| | | { |
| | | PalletNo = a.PalletNo, |
| | | SkuNo = a.SkuNo, |
| | | SkuName = a.SkuName, |
| | | LotNo = a.LotNo, |
| | | LocatNo = b.LocatNo |
| | | }).ToListAsync(); |
| | | var data = await info; |
| | | |
| | | /*var a = info.First().LocatNo; |
| | | |
| | | if (await info.CountAsync() == 0) |
| | | { |
| | | throw Oops.Bah("未查询到托盘分配下发的信息"); |
| | | } |
| | | |
| | | var data = await info.GroupBy(m => new { m.SkuNo, m.SkuName, m.LotNo }).Select(m => new BoxInfo() |
| | | var data = await info.GroupBy(a => new { a.SkuNo, a.SkuName, a.LotNo,a.PalletNo }).Select(a => new BoxInfo() |
| | | { |
| | | SkuNo = m.SkuNo, |
| | | SkuName = m.SkuName, |
| | | LotNo = m.LotNo |
| | | }).ToListAsync(); |
| | | PalletNo = a.PalletNo, |
| | | SkuNo = a.SkuNo, |
| | | SkuName = a.SkuName, |
| | | LotNo = a.LotNo |
| | | }).ToListAsync();*/ |
| | | |
| | | return data; |
| | | } |
| | |
| | | //验证是否存在选中时间 不存在则赋值今日时间 |
| | | if (string.IsNullOrEmpty(StartDate)) |
| | | { |
| | | StartDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ff"); |
| | | StartDate = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | } |
| | | |
| | | //根据时间获取对应日期的库存信息 |
| | |
| | | try |
| | | { |
| | | string str = "select* from SysMaterials where SkuNo in (select a.SkuNo from BllArrivalNoticeDetail a " + |
| | | "inner join BllExportNoticeDetail b on a.SkuNo = b.SkuNo"; |
| | | "left join BllExportNoticeDetail b on a.SkuNo = b.SkuNo"; |
| | | |
| | | //判断开始时间是否为空 |
| | | if (!string.IsNullOrWhiteSpace(StartTime)) |
| | |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public string LotNo {get;set;} |
| | | /// <summary> |
| | | /// Desc:储位地址 |
| | | /// Default: |
| | | /// Nullable:True |
| | | /// </summary> |
| | | public string LocatNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Desc:批次描述 |
| | |
| | | //平库确认入库 |
| | | void ConfirmInStock(PalletBindVm model); |
| | | |
| | | //根据箱码向追溯系统请求箱信息 |
| | | List<BoxInfoDto> GetFMBindBoxInfos(string boxno); |
| | | |
| | | #region JC23取样业务接口 |
| | | |
| | | /// <summary> |
| | |
| | | Task<List<string>> GetRunSoNoticeList(string palletNo, string type); |
| | | |
| | | /// <summary> |
| | | /// 获取执行中的出库单 |
| | | /// </summary> |
| | | /// <param name="type">类型 区分是否是平库出库获取单据</param> |
| | | /// <returns></returns> |
| | | Task<List<string>> GetRunNoticeList(string type); |
| | | |
| | | /// <summary> |
| | | /// 获取出库托盘上的物料批次(根据托盘码) |
| | | /// </summary> |
| | | /// <param name="palletNo">托盘码</param> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取单据列表 |
| | | /// 根据托盘号获取单据列表 |
| | | /// </summary> |
| | | /// <param name="model">PalletNo:托盘号</param> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取PDA平库出库单据列表 |
| | | /// </summary> |
| | | /// <param name="type"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<List<string>> GetRunNoticeList(PdaSoVm model) |
| | | { |
| | | return await _pdaSoSvc.GetRunNoticeList(model.Type); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取物料-批次信息 |
| | | /// </summary> |
| | | /// <param name="model">PalletNo:托盘码、SoNo:单据号</param> |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using System.Runtime.CompilerServices; |
| | | using System.Threading.Tasks; |
| | | using WMS.BLL.BllPdaServer; |
| | | using WMS.IBLL.IPdaServer; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | private readonly IArrivalNoticeServer _arrivalNoticeSvc; |
| | | private readonly IStockCheckServer _stockCheckSvc;//盘点单Svc |
| | | private readonly IProcurePlanServer _procurePlanSvc;//采购单Svs |
| | | public UpApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IArrivalNoticeServer arrivalNoticeServer, IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc) |
| | | private readonly IPdaAsnServer _pdaAsnServer;// PDA |
| | | public UpApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IArrivalNoticeServer arrivalNoticeServer, IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc, IPdaAsnServer pdaAsnServer) |
| | | { |
| | | _config = setting.Value; |
| | | _exNoticeSvc = exNoticeSvc; |
| | | _arrivalNoticeSvc = arrivalNoticeServer; |
| | | _stockCheckSvc = stockCheckSvc; |
| | | _procurePlanSvc = procurePlanSvc; |
| | | _pdaAsnServer = pdaAsnServer; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //箱码信息 手持组托用 (扫箱码向追溯要信息) |
| | | // |
| | | /// <summary> |
| | | /// 箱码信息 手持组托用 (扫箱码向追溯要信息) |
| | | /// </summary> |
| | | /// <param name="model">BoxNo:箱号</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetFMBindBoxInfos(string BoxNo) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrWhiteSpace(BoxNo)) |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前请求箱码信息" }); |
| | | } |
| | | var models = _pdaAsnServer.GetFMBindBoxInfos(BoxNo); |
| | | |
| | | return Ok(new { code = 0, msg = "标签箱码信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | |
| | | }, |
| | | "Quartz": { |
| | | "dbProviderName": "SqlServer", |
| | | "connectionString": "Server=.;Database=QRTZ;User ID=sa;Password=sql2019;Integrated Security=False;" |
| | | "connectionString": "Server=192.168.62.200;Database=QRTZ;User ID=sa;Password=sql2019;Integrated Security=False;" |
| | | } |
| | | |
| | | |