| | |
| | | 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秒) |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | 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() { |
| | | $("#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 == null && PalletNo == ""){ //下拉框获取平库出库单 |
| | | synData(IP + "/PdaSo/GetSoNoticeList", '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'); |
| | | form.render('select'); |
| | | |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | }); |
| | | } 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秒) |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //获取托盘物料名细 |
| | |
| | | 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" ).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) |
| | | { |
| | |
| | | //平库确认入库 |
| | | 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> |
| | | /// 获取单据列表 |
| | | /// </summary> |
| | | /// <param name=""></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 |
| | | |