chengsc
2 天以前 aec8fb5f857231f10dc4a58fc86ecdac2b5d6250
添加拆托功能
7个文件已修改
854 ■■■■■ 已修改文件
Pda/View/HouseDataSetting/SkuDismantling.html 250 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelDto/PdaDto/PdaCheckDto.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelVm/PdaVm/PdaCrVm.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs 277 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/PdaCrController.cs 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/UpApiController.cs 213 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/HouseDataSetting/SkuDismantling.html
@@ -378,7 +378,7 @@
                synData(IP + "/PdaCr/GetBoxInfo", param, 'post', function (res) {
                    if (res.code == 0) { //成功 
                        $("#boxNo").focus();//光标默认选中
                        $("#palletNo3").focus();//光标默认选中
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
@@ -431,14 +431,7 @@
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }); return;
                    }
                    if ($('#boxQty').val() == "") {
                        layer.msg("箱内数量为空,不能拣货", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                        return;
                    }
                }
                
@@ -463,9 +456,8 @@
                    "BoxNo": $('#boxNo').val(),
                    "palletNoNew": $('#palletNo3').val(),
                }
                sendData(IP + "/PdaSo/SoSetPinPick", param, 'post', function (res) {
                    //console.log(res);
                sendData(IP + "/PdaCr/UpPalletByBox", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        layer.msg(res.msg, {
                            icon: 1,
@@ -509,29 +501,14 @@
            //数量标签-------------------------------------------------------------------------------
            function clear21() {
                $('#outModel2').val("");//出库口
                $('#standard2').val("");//规格
                $('#pickQty2').val("");//待拣数量
                $('#pickedQty2').val("");//已拣数量
            }
            function clear22() {
                //物料批次
                $("#skuLotNo2").empty()
                $("#skuLotNo2").append('<option value =>' + '</option>');
                form.render('select');
            }
            function clear23() {
                $("#planQty2").val("");  //计划数量
                $("#finishQty2").val("");//完成数量
            }
            function clear24() {
                $('#boxNo2').val("");//箱码
                $('#boxQty2').val("");//箱内数量
            }
            //当托盘条码输入框文本改变时,检查一下托盘状态 
            $("#palletNo2").on('input', function () {
                if ($("#palletNo2").val() == "" || $("#palletNo2").val().length < 8) {
@@ -542,61 +519,21 @@
                }
                checkPalletState2()
            })
            //检查托盘状态
            //检查托盘状态
            function checkPalletState2() {
                var param = {
                    "PalletNo": $("#palletNo2").val()
                }
                synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) {
                    if (res.code == 0) { //成功 
                        updateBillList2();
                        console.log($('#bar2').val())
                        if ($('#bar2').val() == "") {
                            console.log(1)
                            clear21();
                            return;
                        } else {
                            console.log(2)
                            updateSkuLotNoList2();
                            updateQtyList2();
                            getBar2();
                            // GetDataInfo();
                        }
                        $("#palletNo4").focus();
                        updateSkuLotNoList2();
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //初始化渲染 出库单
            function updateBillList2() {
                $("#bar2").empty()
                $("#bar2").append('<option value =>' + '</option>');
                form.render('select');
                var param = {
                    PalletNo: $("#palletNo2").val(),
                };
                synData(IP + "/PdaSo/GetRunSoNoticeList", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        console.log(res.data);
                        for (var i = 0; i < res.data.length; i++) {
                            if (i == 0) {
                                $("#bar2").append('<option value =' + res.data[i] + ' selected>' + res.data[i] + '</option>');
                            } else {
                                $("#bar2").append('<option value =' + res.data[i] + '>' + res.data[i] + '</option>');
                            }
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        });
                    }
                });
            }
@@ -606,26 +543,27 @@
                clear22();
                var param = {
                    PalletNo: $("#palletNo2").val(),
                    SoNo: $("#bar2").val(),
                };
                synData(IP + "/PdaSo/GetSoSkuLotNoListByPallet", param, 'post', function (res) {
                synData(IP + "/PdaCr/GetSelectSkuLotNo", param, 'post', function (res) {
                    console.log(res);
                    if (res.code == 0) { //成功
                        for (var i = 0; i < res.data.length; i++) {
                            if (i == 0) {
                                $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + ' selected>' + res.data[i].SkuName);
                                if (res.data[i].LotNo != null) {
                                    $("#skuLotNo2").append(" - " + res.data[i].LotNo);
                                }
                                $("#skuLotNo2").append('</option>');
                                $("#skuLotNo2").append('<option value =' + res.data[i].DetailId + ' selected>' + res.data[i].SkuName+' - '  + res.data[i].LotNo+'</option>');
                                //$("#skuLotNo2").append(' - '  + res.data[i].LotNo+'</option>');
                                // if (res.data[i].LotNo != null) {
                                //     console.log(res.data[i].LotNo);
                                //     $("#skuLotNo2").append(' - '  + res.data[i].LotNo);
                                // }
                                //$("#skuLotNo2").append('</option>');
                            } else {
                                $("#skuLotNo2").append('<option value =' + res.data[i].SoDetailId + '>' + res.data[i].SkuName);
                                if (res.data[i].LotNo != null) {
                                    $("#skuLotNo2").append(" - " + res.data[i].LotNo);
                                }
                                $("#skuLotNo2").append('</option>');
                                $("#skuLotNo2").append('<option value =' + res.data[i].DetailId + '>' + res.data[i].SkuName+' - '  + res.data[i].LotNo+'</option>');
                                // if (res.data[i].LotNo != null) {
                                //     $("#skuLotNo2").append(' - ' + res.data[i].LotNo);
                                // }
                                // $("#skuLotNo2").append('</option>');
                            }
                        }
                        form.render('select');
@@ -639,130 +577,10 @@
                });
            }
            //初始化渲单据的计划数量和完成数量
            function updateQtyList2() {
                clear23();
                console.log("AA");
                var param = {
                    SoDetailId: $("#skuLotNo2").val(),
                };
                synData(IP + "/PdaSo/GetPlanAndFinishQty", param, 'post', function (res) {
                    console.log(res);
                    console.log(res.data);
                    if (res.code == 0) { //成功
                        $("#planQty2").val(res.data.PlanQty)
                        $("#finishQty2").val(res.data.FinishQty)
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //根据单据获取出库口、规格、待检数量、已拣数量
            function getBar2() {
                clear21();
                var param = {
                    PalletNo: $("#palletNo2").val(),
                    SoDetailId: $("#skuLotNo2").val(),
                }
                synData(IP + "/PdaSo/GetOutlets", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        let data = res.data
                        console.log(res.data);
                        $('#outModel2').val(res.data.OutModel);
                        $('#standard2').val(res.data.Standard);
                        $('#pickQty2').val(res.data.PickQty - res.data.PickedQty);
                        $('#pickedQty2').val(res.data.PickedQty);
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //获取托盘物料名细
            function GetDataInfo() {
                let param2 = {
                    "SoDetailId": $("#skuLotNo2").val(),
                    "PalletNo": $("#palletNo2").val(),
                }
                console.log(param2);
                synData(IP + "/PdaSo/GetAllotPlnInfo", param2, 'post', function (res) {
                    if (res.code == 0) {
                        tableData2 = deepCopy(res.data)
                        refreshTable2(tableData2)
                    } else {
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //渲染表格数据
            function refreshTable2(list) {
                //先清空一下信息列表
                let trs = $("#tableBoxList2 tr")
                let len = trs.length
                //console.log("tr 数量 + " + trs.length)
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
                console.log(list != null);
                console.log(list);
                if (list != null && list.length > 0) { //成功
                    var arrTrs = new Array()
                    let idx = 0
                    for (var i in list) {
                        // list[i].BoxCode
                        var tr = $("#boxCell2").eq(0).clone();
                        tr.appendTo("#tableBoxList2");
                        // tr.attr('id', list[i].BoxCode)
                        idx++;
                        tr.attr('index', idx)
                        // tr.find("td[name='skuNo']").attr('style', 'max-width:90px;');
                        // tr.find("td[name='skuName']").attr('style', 'max-width:120px;');
                        tr.find("td[name='SkuNo']").html(list[i].BoxNo);
                        tr.find("td[name='Qty']").html(list[i].Qty);
                        tr.find("td[name='pickedQty']").html(list[i].PickedQty);
                        tr.show();
                        arrTrs[i] = tr
                    }
                    setPages(1, list.length)
                    canPickBox = true
                } else { //不成功
                    layer.msg("无数据", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () { });
                    // $("#boxNum").val(0)
                    setPages(1, 0)
                }
            }
            //单拣货(确认按钮)
            form.on('submit(formPickScatter2)', function (data) {
                if ($('#bar2').val() == "") {
                    layer.msg("请选择出库单", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }); return;
                }
                if ($('#skuLotNo2').val() == "") {
                    layer.msg("请选择物料-批次", {
                        icon: 2,
@@ -781,8 +599,7 @@
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }); return;
                }
                let pickedQty = parseInt($('#pickedQty2').val()) //已拣数量
                let pickQty = parseInt($('#pickQty2').val())  //拣货数量
                let pickQty = parseFloat($('#pickQty2').val())  //拣货数量
                if (pickQty <= 0) {
                    layer.msg("拣货数量需大于0", {
                        icon: 2,
@@ -808,24 +625,21 @@
            //确认拣货 
            function reqPickScatter2() {
                var param = {
                    "SoNo": $("#bar2").val(),
                    "SoDetailId": $("#skuLotNo2").val(),
                    "DetailId": $("#skuLotNo2").val(),
                    "PalletNo": $('#palletNo2').val(),
                    "PickQty": $('#pickQty2').val(),
                    "Qty": parseFloat($('#pickQty2').val()),
                    "PalletNoNew": $('#palletNo4').val(),
                }
                sendData(IP + "/PdaSo/SoSetQtyPinPick", param, 'post', function (res) {
                    //console.log(res);
                sendData(IP + "/PdaCr/UpPalletByQty", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            canPickBox = true//回调
                            updateQtyList2();
                            getBar2();
                            GetDataInfo();
                            checkPalletState2();
                            $('#pickQty2').val('')
                        });
                    } else { //不成功
                        layer.msg(res.msg, {
Wms/Model/ModelDto/PdaDto/PdaCheckDto.cs
@@ -14,4 +14,12 @@
        public string SkuName { get; set; }
        public string LotNo { get; set; }
    }
    public class SelectSkuLotNo
    {
        public string DetailId { get; set; }
        public string SkuNo { get; set; }
        public string SkuName { get; set; }
        public string LotNo { get; set; }
    }
}
Wms/Model/ModelVm/PdaVm/PdaCrVm.cs
@@ -88,4 +88,14 @@
        public string PalletNo { get; set; } 
    }
    public class PdaUpPalletVm
    {
        public string PalletNo { get; set; }
        public string PalletNoNew { get; set; }
        public string BoxNo { get; set; }
        public decimal Qty { get; set; }
        public string DetailId { get; set; }
    }
}
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -1444,12 +1444,15 @@
        #region 物料拆托 (标签、数量)
        /// <summary>
        /// 查询箱信息
        /// </summary>
        /// <param name="boxNo"></param>
        /// <param name="pallNo"></param>
        public void GetBoxInfo(string boxNo,string pallNo)
        {
            try
            {
                var boxInfo = Db.Queryable<DataBoxInfo>().Where(m=>m.IsDel == "0" && m.BoxNo == boxNo).ToList();
                if (!string.IsNullOrWhiteSpace(pallNo))
                {
@@ -1459,8 +1462,274 @@
                {
                    throw new Exception("标签信息错误,请联系管理员");
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        public void UpPalletByBox(string boxNo,string pallet,string palletNew,int userId)
        {
            try
            {
                Db.BeginTran();
                if (string.IsNullOrWhiteSpace(boxNo) || string.IsNullOrWhiteSpace(pallet) || string.IsNullOrWhiteSpace(palletNew))
                {
                    throw new Exception("参数错误,托盘、新托盘、箱码均不能为空");
                }
                var boxInfoList = Db.Queryable<DataBoxInfo>().Where(m=>m.IsDel == "0" && m.BoxNo == boxNo).ToList();
                if (boxInfoList.Count != 1)
                {
                    throw new Exception("标签信息数量不是1条");
                }
                var boxInfo = boxInfoList.First();
                var detail1 = Db.Queryable<DataStockDetail>().First(m=>m.IsDel == "0" && m.PalletNo == pallet && m.Id == boxInfo.StockDetailId );
                if (detail1 == null)
                {
                    throw new Exception("未查询到托盘和箱码的库存明细");
                }
                var palletInfoNew = Db.Queryable<SysPallets>().First(m => m.IsDel == "0" && m.PalletNo == palletNew);
                if (palletInfoNew == null)
                {
                    throw new Exception("未查询到新托盘信息");
                }
                var detailNewBl = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.PalletNo == palletNew && (m.SkuNo != boxInfo.SkuNo || m.LotNo != boxInfo.LotNo));
                if (detailNewBl!=null)
                {
                    throw new Exception("新托盘上已有其他物料箱信息");
                }
                //添加/更新库存托盘信息
                var detailNew1 = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.PalletNo == palletNew && m.SkuNo == boxInfo.SkuNo && m.LotNo == boxInfo.LotNo);
                var newId = 0;
                if (detailNew1 == null)//add
                {
                    var detailNew = new DataStockDetail();
                    detailNew.SkuNo = detail1.SkuNo;
                    detailNew.SkuName = detail1.SkuName;
                    detailNew.LotNo = detail1.LotNo;
                    detailNew.LotText = detail1.LotText;
                    detailNew.SupplierLot = detail1.SupplierLot;
                    detailNew.SupplierNo = detail1.SupplierNo;
                    detailNew.SupplierName = detail1.SupplierName;
                    detailNew.Standard = detail1.Standard;
                    detailNew.Qty = boxInfo.Qty;
                    detailNew.LockQty = 0;
                    detailNew.FrozenQty = 0;
                    detailNew.InspectQty = 0;
                    detailNew.ASNNo = "";
                    detailNew.PalletNo = palletNew;
                    detailNew.ProductionTime = detail1.ProductionTime;
                    detailNew.ExpirationTime = detail1.ExpirationTime;
                    detailNew.PalletTags = "0";
                    detailNew.CompleteTime = DateTime.Now;
                    detailNew.Status = "0";
                    detailNew.InspectMark = detail1.InspectMark;
                    detailNew.BitPalletMark = "1";
                    detailNew.InspectStatus = detail1.InspectStatus;
                    detailNew.PackagNo = detail1.PackagNo;
                    detailNew.IsBale = detail1.IsBale;
                    detailNew.IsBelt = detail1.IsBelt;
                    detailNew.IsDel = "0";
                    detailNew.CreateTime = DateTime.Now;
                    detailNew.CreateUser = 0;
                    newId = Db.Insertable(detailNew).ExecuteReturnIdentity();
                }
                else //update
                {
                    detailNew1.Qty += boxInfo.Qty;
                    detailNew1.PalletNo = palletNew;
                    Db.Updateable(detailNew1).ExecuteCommand();
                    newId = detailNew1.Id;
                }
                //更新托盘状态
                palletInfoNew.Status = "1";
                Db.Updateable(palletInfoNew).ExecuteCommand();
                //更改原托盘信息
                detail1.Qty -= boxInfo.Qty;
                detail1.BitPalletMark = "1";
                if (detail1.Qty <= 0)
                {
                    //更新原托盘状态
                    var palletInfo = Db.Queryable<SysPallets>().First(m => m.IsDel == "0" && m.PalletNo == pallet);
                    palletInfo.Status = "0";
                    Db.Updateable(palletInfo).ExecuteCommand();
                    Db.Deleteable(detail1).ExecuteCommand();
                }
                else
                {
                    Db.Updateable(detail1).ExecuteCommand();
                }
                //更新库存箱信息
                boxInfo.StockDetailId = newId;
                boxInfo.BindNo = 0;
                boxInfo.PalletNo = palletNew;
                Db.Updateable(boxInfo).ExecuteCommand();
                //添加操作日志
                new OperationCrServer().AddLogOperationCr("库内作业", "操作日志", boxNo, "编辑", $"物料拆托:箱码:{boxNo}换托,原托盘{pallet},新托盘{palletNew}", userId);
                Db.CommitTran();
            }
            catch (Exception e)
            {
                Db.RollbackTran();
                throw new Exception(e.Message);
            }
        }
        //数量页签-----------------------------------------------------------------------------------------------------------------------------------------
        /// <summary>
        /// 根据托盘获取托盘上的物料批次信息
        /// </summary>
        /// <param name="palletNo"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public List<SelectSkuLotNo> GetSelectSkuLotNo(string palletNo)
        {
            try
            {
                var data = new List<SelectSkuLotNo>();
                var detailList = Db.Queryable<DataStockDetail>().Where(m=>m.IsDel == "0" && m.PalletNo == palletNo).ToList();
                foreach (var item in detailList)
                {
                    if (data.Count(m=>m.DetailId == item.Id.ToString()) == 0)
                    {
                        data.Add(new SelectSkuLotNo()
                        {
                            SkuNo = item.SkuNo,
                            SkuName = item.SkuName,
                            LotNo = item.LotNo,
                            DetailId = item.Id.ToString(),
                        });
                    }
                }
                return data;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        /// <summary>
        /// 拆托-数量
        /// </summary>
        /// <param name="palletNo"></param>
        /// <param name="palletNoNew"></param>
        /// <param name="detailId"></param>
        /// <param name="qty"></param>
        /// <param name="userId"></param>
        /// <exception cref="Exception"></exception>
        public void UpPalletByQty(string palletNo,string palletNoNew,string detailId,decimal qty,int userId)
        {
            try
            {
                Db.BeginTran();
                if (string.IsNullOrWhiteSpace(detailId) || string.IsNullOrWhiteSpace(palletNo) || string.IsNullOrWhiteSpace(palletNoNew))
                {
                    throw new Exception("参数错误,托盘、新托盘、物料批次均不能为空");
                }
                if (qty<=0)
                {
                    throw new Exception("参数数量不能为小等0");
                }
                 var detailId2 = int.Parse(detailId);
                var detail1 = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.PalletNo == palletNo && m.Id == detailId2);
                if (detail1 == null)
                {
                    throw new Exception("未查询到托盘库存明细");
                }
                var palletInfoNew = Db.Queryable<SysPallets>().First(m => m.IsDel == "0" && m.PalletNo == palletNoNew);
                if (palletInfoNew == null)
                {
                    throw new Exception("未查询到新托盘信息");
                }
                //添加/更新库存托盘信息
                var detailNew1 = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.PalletNo == palletNoNew && m.SkuNo == detail1.SkuNo && m.LotNo == detail1.LotNo);
                var newId = 0;
                if (detailNew1 == null)//add
                {
                    var detailNew = new DataStockDetail();
                    detailNew.SkuNo = detail1.SkuNo;
                    detailNew.SkuName = detail1.SkuName;
                    detailNew.LotNo = detail1.LotNo;
                    detailNew.LotText = detail1.LotText;
                    detailNew.SupplierLot = detail1.SupplierLot;
                    detailNew.SupplierNo = detail1.SupplierNo;
                    detailNew.SupplierName = detail1.SupplierName;
                    detailNew.Standard = detail1.Standard;
                    detailNew.Qty = qty;
                    detailNew.LockQty = 0;
                    detailNew.FrozenQty = 0;
                    detailNew.InspectQty = 0;
                    detailNew.ASNNo = "";
                    detailNew.PalletNo = palletNoNew;
                    detailNew.ProductionTime = detail1.ProductionTime;
                    detailNew.ExpirationTime = detail1.ExpirationTime;
                    detailNew.PalletTags = "0";
                    detailNew.CompleteTime = DateTime.Now;
                    detailNew.Status = "0";
                    detailNew.InspectMark = detail1.InspectMark;
                    detailNew.BitPalletMark = "1";
                    detailNew.InspectStatus = detail1.InspectStatus;
                    detailNew.PackagNo = detail1.PackagNo;
                    detailNew.IsBale = detail1.IsBale;
                    detailNew.IsBelt = detail1.IsBelt;
                    detailNew.IsDel = "0";
                    detailNew.CreateTime = DateTime.Now;
                    detailNew.CreateUser = 0;
                    newId = Db.Insertable(detailNew).ExecuteReturnIdentity();
                }
                else //update
                {
                    detailNew1.Qty += qty;
                    detailNew1.PalletNo = palletNoNew;
                    Db.Updateable(detailNew1).ExecuteCommand();
                    newId = detailNew1.Id;
                }
                //更新托盘状态
                palletInfoNew.Status = "1";
                Db.Updateable(palletInfoNew).ExecuteCommand();
                //更改原托盘信息
                detail1.Qty -= qty;
                detail1.BitPalletMark = "1";
                if (detail1.Qty <= 0)
                {
                    //更新原托盘状态
                    var palletInfo = Db.Queryable<SysPallets>().First(m => m.IsDel == "0" && m.PalletNo == palletNo);
                    palletInfo.Status = "0";
                    Db.Updateable(palletInfo).ExecuteCommand();
                    Db.Deleteable(detail1).ExecuteCommand();
                }
                else
                {
                    Db.Updateable(detail1).ExecuteCommand();
                }
                //添加操作日志
                new OperationCrServer().AddLogOperationCr("库内作业", "操作日志", palletNo, "编辑", $"物料拆托:{detail1.SkuName}物料换托,原托盘{palletNo},新托盘{palletNoNew}", userId);
                Db.CommitTran();
            }
            catch (Exception e)
            {
Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs
@@ -174,6 +174,17 @@
        #endregion
        #region 托盘拆托换托
        void GetBoxInfo(string boxNo, string pallNo);
        void UpPalletByBox(string boxNo, string pallet, string palletNew, int userId);
        List<SelectSkuLotNo> GetSelectSkuLotNo(string palletNo);
        void UpPalletByQty(string palletNo, string palletNoNew, string detailId, decimal qty, int userId);
        #endregion
    }
}
Wms/Wms/Controllers/PdaCrController.cs
@@ -368,5 +368,90 @@
        #endregion
        #region 物料拆托
        /// <summary>
        /// 查询箱信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetBoxInfo(PdaUpPalletVm model)
        {
            try
            {
                _pdaCrSvc.GetBoxInfo(model.BoxNo, model.PalletNo);
                return Ok(new { data = "", code = 0, msg = "成功" });
            }
            catch (Exception e)
            {
                return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" });
            }
        }
        /// <summary>
        /// 物料拆托
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult UpPalletByBox(PdaUpPalletVm model)
        {
            try
            {
                _pdaCrSvc.UpPalletByBox(model.BoxNo, model.PalletNo,model.PalletNoNew,_userManager.UserId);
                return Ok(new { data = "", code = 0, msg = "成功" });
            }
            catch (Exception e)
            {
                return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" });
            }
        }
        /// <summary>
        /// 根据托盘获取托盘上的物料批次信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetSelectSkuLotNo(PdaUpPalletVm model)
        {
            try
            {
                var list = _pdaCrSvc.GetSelectSkuLotNo(model.PalletNo);
                return Ok(new { data = list, code = 0, msg = "成功" });
            }
            catch (Exception e)
            {
                return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" });
            }
        }
        /// <summary>
        /// 物料拆托 - 数量页签
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult UpPalletByQty(PdaUpPalletVm model)
        {
            try
            {
                _pdaCrSvc.UpPalletByQty(model.PalletNo, model.PalletNoNew, model.DetailId,model.Qty, _userManager.UserId);
                return Ok(new { data = "", code = 0, msg = "成功" });
            }
            catch (Exception e)
            {
                return Ok(new { data = "", code = 1, msg = $"异常:{e.Message}" });
            }
        }
        #endregion
    }
}
Wms/Wms/Controllers/UpApiController.cs
@@ -26,6 +26,8 @@
using WMS.IBLL.IPdaServer;
using WMS.BLL.BllQualityServer;
using WMS.IBLL;
using ZXing.QrCode.Internal;
using System.Xml.Linq;
namespace Wms.Controllers
{
@@ -55,6 +57,119 @@
            _pdaAsnServer = pdaAsnServer;
            _http = http;
        }
        #endregion
        #region JC34
        /// <summary>
        /// 物料下发
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult CreateSku(object model)
        {
            try
            {
                return Ok(new { result = true, code = "1" ,message = "success" });
            }
            catch (Exception e)
            {
                return Ok(new { result = false, code = "400", message = e.Message });
            }
        }
        /// <summary>
        /// 客户信息接收
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult CreateCustomer(object model)
        {
            try
            {
                return Ok(new { result = true, code = "1", message = "success" });
            }
            catch (Exception e)
            {
                return Ok(new { result = false, code = "400", message = e.Message });
            }
        }
        /// <summary>
        /// 入库单接收
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult CreateAsn(object model)
        {
            try
            {
                return Ok(new { result = true, code = "1", message = "success" });
            }
            catch (Exception e)
            {
                return Ok(new { result = false, code = "400", message = e.Message });
            }
        }
        /// <summary>
        /// 出库单接收
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult CreateSo(object model)
        {
            try
            {
                return Ok(new { result = true, code = "1", message = "success" });
            }
            catch (Exception e)
            {
                return Ok(new { result = false, code = "400", message = e.Message });
            }
        }
        /// <summary>
        /// 库存质量状态接收
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult UpQuality(object model)
        {
            try
            {
            //    var sd = JsonConvert.SerializeObject(model);
            //    var sd2 = JsonConvert.DeserializeObject<BoxPalletBindVm>(sd);
                return Ok(new { result = true, code = "1", message = "success" });
            }
            catch (Exception e)
            {
                return Ok(new { result = false, code = "400", message = e.Message });
            }
        }
        #endregion
        #region 调用上游系统接口
@@ -354,59 +469,59 @@
            }
        }
        /// <summary>
        /// 入库单据下发
        /// </summary>
        /// <param name="model">入库单信息</param>
        /// <returns></returns>
        [Authorize]
        [HttpPost]
        public IActionResult CreateAsn(AsnInfo model)
        {
            var result = new ErpModel { Success = -1, Message = "" };
            try
            {
                var claimsIdentity = this.User.Identity as ClaimsIdentity;
                if (claimsIdentity == null)
                {
                    throw new Exception("未获取到用户信息");
                }
                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
                if (string.IsNullOrWhiteSpace(UserId))
                {
                    throw new Exception("未获取到用户信息");
                }
        ///// <summary>
        ///// 入库单据下发
        ///// </summary>
        ///// <param name="model">入库单信息</param>
        ///// <returns></returns>
        //[Authorize]
        //[HttpPost]
        //public IActionResult CreateAsn(AsnInfo model)
        //{
        //    var result = new ErpModel { Success = -1, Message = "" };
        //    try
        //    {
        //        var claimsIdentity = this.User.Identity as ClaimsIdentity;
        //        if (claimsIdentity == null)
        //        {
        //            throw new Exception("未获取到用户信息");
        //        }
        //        string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
        //        if (string.IsNullOrWhiteSpace(UserId))
        //        {
        //            throw new Exception("未获取到用户信息");
        //        }
                result = _arrivalNoticeSvc.CreateAsn(model);
        //        result = _arrivalNoticeSvc.CreateAsn(model);
                return Ok(result);
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                return Ok(result);
            }
        }
        //        return Ok(result);
        //    }
        //    catch (Exception e)
        //    {
        //        result.Message = e.Message;
        //        return Ok(result);
        //    }
        //}
        /// <summary>
        /// 出库单下发接口
        /// </summary>
        /// <param name="model">出库单信息</param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult CreateSo(SoInfo model)
        {
            try
            {
                SoResInfo result = _exNoticeSvc.ErpAddExportNotice(model);
                return Ok(result);
        ///// <summary>
        ///// 出库单下发接口
        ///// </summary>
        ///// <param name="model">出库单信息</param>
        ///// <returns></returns>
        //[HttpPost]
        //public IActionResult CreateSo(SoInfo model)
        //{
        //    try
        //    {
        //        SoResInfo result = _exNoticeSvc.ErpAddExportNotice(model);
        //        return Ok(result);
            }
            catch (Exception e)
            {
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
        }
        //    }
        //    catch (Exception e)
        //    {
        //        return Ok(new ErpModel { Success = -1, Message = e.Message });
        //    }
        //}
        /// <summary>
        /// 车间叫料