Administrator
2024-02-04 f2c15afd5db47e5ebec1cefd3c17cfb605688187
修改PDA托盘绑定
4个文件已修改
1 文件已重命名
101 ■■■■■ 已修改文件
Pda/View/AsnSetting/productEnterQuantity.html 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelVm/PdaVm/PdaAsnVm.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/PdaAsnController.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/AsnSetting/productEnterQuantity.html
File was renamed from Pda/View/AsnSetting/productEnterQuantity .html
@@ -705,6 +705,7 @@
                    AsnNo: $("#bar").val(),
                    PalletNo: $("#STOCKCODE").val(),
                    AsnDetailId: parseInt($("#goodSelect").val()),
                    LotNo:$("#goodSelect").find("option:selected").text(),
                    BoxNo: $("#BOXCODE").val(),
                    IsContinue: isContinue,
                    TailBoxNo: $("#BOXCODE2").val(),
@@ -851,19 +852,37 @@
                    var param = {
                        AsnNo: $("#bar").val(),
                    };
                    synData(IP + "/PdaAsn/GetArrivalNoticeDetails", param, 'post', function (res) {
                    synData(IP + "/PdaAsn/GetBindArrivalNoticeDetails", param, 'post', function (res) {
                        console.log("出库口:" + JSON.stringify(res))
                        if (res.code == 0) { //成功
                            asnDetails = res.data;
                            for (var i = 0; i < res.data.length; i++) {
                                if(skuNo!='' && skuNo==res.data[i].SkuNo){
                                    if(res.data[i].LotNo=='' || res.data[i].LotNo == null){
                                        $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                        .SkuName +
                                        '</option>');
                                    }else{
                                    $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                        .SkuName + "-" + res.data[i].LotNo +
                                        '</option>');
                                    }
                                }else{
                                    if (i == 0) {
                                        if(res.data[i].LotNo=='' || res.data[i].LotNo == null){
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + ' selected>' + res.data[i]
                                            .SkuName +
                                            '</option>');
                                        }else{
                                        $("#goodSelect").append('<option value =' + res.data[i].Id + ' 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].Id + '>' + res.data[i]
                                            .SkuName +
                                            '</option>');
                                        } else {
                                            $("#goodSelect").append('<option value =' + res.data[i].Id + '>' + res.data[i]
@@ -872,6 +891,7 @@
                                        }
                                }                            
                            }
                            }
                            form.render('select');
                            if (!val) {
Wms/Model/ModelVm/PdaVm/PdaAsnVm.cs
@@ -65,5 +65,9 @@
        /// </summary>           
        public int SkuQty { get; set; }
        /// <summary>
        /// Desc:批次号
        /// </summary>
        public string LotNo { get; set; }
    }
}
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -1667,8 +1667,48 @@
                throw ex;
            }
        }
        // 根据单据号获取单据明细列表
        public List<ArrivalNoticeDetailDto> GetBindArrivalNoticeDetails(ArrivalNoticeVm model)
        {
            string sqlString = string.Empty;
            try
            {
                sqlString = $"select * from BllArrivalNoticeDetail where ASNNo = '{model.ASNNo}' and isdel='0' order by CreateTime;";
                var modelList = Db.Ado.SqlQuery<ArrivalNoticeDetailDto>(sqlString);
                List<ArrivalNoticeDetailDto> noticeList = new List<ArrivalNoticeDetailDto>();
                foreach (var item in modelList)
                {
                    if (string.IsNullOrEmpty(item.LotNo))
                    {
                        noticeList.Add(item);
                    }
                    else
                    {
                        string[] LotNoList = item.LotNo.Split(';');
                        foreach (var item2 in LotNoList)
                        {
                            ArrivalNoticeDetailDto entry = new ArrivalNoticeDetailDto();
                            entry = item;
                            entry.LotNo = item2;
                            noticeList.Add(entry);
                        }
                    }
                }
                return noticeList;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 绑定托盘
        /// </summary>
        /// <param name="model"></param>
        /// <param name="userId"></param>
        /// <param name="origin"></param>
        public void BindPallet(PdaPalletBindVm model, int userId, string origin)
        {
            try
@@ -1686,6 +1726,19 @@
                if (string.IsNullOrEmpty(model.PalletNo))
                {
                    throw new Exception("-1:托盘号不可为空!");
                }
                if (string.IsNullOrEmpty(model.LotNo))
                {
                    throw new Exception("-1:物料批次不可为空!");
                }
                else
                {
                    //从物料名称-批次中取出批次
                    int indexOfDash = model.LotNo.IndexOf("-");
                    if (indexOfDash != -1)
                    {
                        model.LotNo = model.LotNo.Substring(indexOfDash + 1);
                    }
                }
                //判断物料数量是否为0 为0判断箱码信息 不为0继续
                if (model.SkuQty == 0)
@@ -1715,7 +1768,7 @@
                    throw new Exception("未查询到托盘信息,请核实!");
                }
                // 验证入库单明细是否存在
                var detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailId && m.ASNNo == model.AsnNo);
                var detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailId && m.ASNNo == model.AsnNo && m.LotNo.Contains(model.LotNo));
                if (detail == null)
                {
                    throw new Exception("-1:当前物料及批次与单据无关联,请核实!");
@@ -1791,7 +1844,7 @@
                        FullQty = pNum,
                        Status = "0",
                        Type = "0",
                        LotNo = detail.LotNo,
                        LotNo = model.LotNo,
                        LotText = detail.LotText,
                        SupplierLot = "",
                        InspectMark = "0",
@@ -1861,7 +1914,7 @@
                                continue;
                            }
                            //箱内物料批次与单据明细不符合
                            if (box.SkuNo != detail.SkuNo || box.LotNo != detail.LotNo)
                            if (box.SkuNo != detail.SkuNo || box.LotNo != model.LotNo)
                            {
                                throw new Exception($"-1:{box.BoxNo}箱内物料及批次与单据不一致,请核实!");
                            }
Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs
@@ -63,5 +63,8 @@
        // 根据箱码获取标签箱码信息
        List<BoxInfoDto> GetBindBoxInfos(BoxInfoVm model);
        //根据单据号获取单据明细列表
        List<ArrivalNoticeDetailDto> GetBindArrivalNoticeDetails(ArrivalNoticeVm model);
    }
}
Wms/Wms/Controllers/PdaAsnController.cs
@@ -462,7 +462,20 @@
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        [HttpPost]
        public IActionResult GetBindArrivalNoticeDetails(ArrivalNoticeVm model)
        {
            try
            {
                var models = _PdaAsnSvc.GetBindArrivalNoticeDetails(model);
                return Ok(new { code = 0, msg = "入库单明细信息", data = models });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <summary>
        /// 绑定托盘