wxw
2 天以前 35d7109801b437fad4514047db521ae358a1b7ca
Merge branch 'wxw'
3个文件已修改
1个文件已添加
305 ■■■■■ 已修改文件
Pda/View/AsnSetting/WarehouseTake.html 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/PdaAsnController.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/AsnSetting/WarehouseTake.html
New file
@@ -0,0 +1,158 @@
<!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-input">
                        <label class="layui-form-label" lang>托盘条码:</label>
                        <div class="layui-input-block">
                            <input id="PalletNo" type="text" lay-verify="stock" lang langholder placeholder="请扫描托盘条码"
                                autocomplete="off" class="layui-input">
                        </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
            //确认入库
            form.on('submit(formBind)', function (data) {
                if (!$("#PalletNo").val()) {
                    layer.msg('请扫描托盘条码', {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                var param = {
                    PalletNo: $("#PalletNo").val()
                }
                sendData(IP + "/PdaAsn/ConfirmTakeOf", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 2500 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            $("#PalletNo").val('')
                            $("#LocatNo").val('')
                        });
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            //回调
                        });
                    }
                });
                return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
            });
            form.verify({
                stock: [/^[\S]{8}$/, '托盘条码必须为六位字符']
            });
            $("#menuImg").click(function (e) {
                e.stopPropagation()
                if ($("#menuList").is(":hidden")) {
                    $("#menuList").show()
                } else {
                    $("#menuList").hide()
                }
            })
            $('body').click(function () {
                // //console.log("body")
                $("#menuList").hide()
            })
        })
    </script>
</body>
</html>
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -29,6 +29,7 @@
using Model.ModelVm.SysVm;
using System.Security.Cryptography.X509Certificates;
using AutoMapper.Configuration.Annotations;
using Utility;
namespace WMS.BLL.BllPdaServer
{
@@ -6515,6 +6516,113 @@
        }
        #endregion
        #region 仓库收货
        /// <summary>
        /// 仓库确认收货
        /// </summary>
        /// <param name="model"></param>
        public void ConfirmTakeOf(string palletNo,int userId)
        {
            try
            {
                #region 验证信息
                if (string.IsNullOrEmpty(palletNo))
                {
                    throw new Exception("托盘条码不能为空!");
                }
                //获取托盘信息
                var pallet = Db.Queryable<SysPallets>().First(w => w.IsDel == "0" && w.PalletNo == palletNo);
                //验证托盘信息是否为空
                if (pallet == null)
                {
                    throw new Exception("托盘信息不存在,请检查!");
                }
                if (pallet.Status == "0")
                {
                    throw new Exception("托盘未使用,请检查!");
                }
                #endregion
                //获取库存明细信息
                var stockDetailList = Db.Queryable<DataStockDetail>().Where(s => s.IsDel == "0" && s.PalletNo == palletNo).ToList();
                //验证库存明细信息是否存在
                if (stockDetailList.Count<=0)
                {
                    throw new Exception("库存明细不存在,请检查库存信息!");
                }
                //开启事务
                Db.BeginTran();
                foreach (var item in stockDetailList)
                {
                    if (item.AreaNo != "B06" && item.AreaNo != "B07" && item.AreaNo != "B09")
                    {
                        throw new Exception("该托盘非线边回库托盘!");
                    }
                    //库存总表
                    var stock = Db.Queryable<DataStock>().First(w => w.IsDel == "0" && w.SkuNo == item.SkuNo && w.LotNo == item.LotNo);
                    if (stock == null)
                    {
                        throw new Exception($"未查询到该托盘上物料编码为:{item.SkuNo}的库存信息!");
                    }
                    var boxInfoList = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.PalletNo == palletNo && w.SkuNo == item.SkuNo && w.LotNo == item.LotNo).ToList();
                    if (boxInfoList.Count > 0)
                    {
                        foreach (var box in boxInfoList)
                        {
                            var bllBox = Db.Queryable<BllBoxInfo>().First(w => w.IsDel == "0" && w.Status != "0");
                            if (bllBox != null)
                            {
                                bllBox.Status = "0";
                                bllBox.ASNDetailNo = null;
                                bllBox.BindNo = null;
                                bllBox.PalletNo = "";
                                //更新箱支明细表
                                Db.Updateable(bllBox).ExecuteCommand();
                            }
                        }
                        //删除库存箱码信息
                        Db.Deleteable(boxInfoList).ExecuteCommand();
                    }
                    //删除或修改库存
                    stock.Qty -= (decimal)item.Qty;
                    if (stock.Qty <= 0)
                    {
                        Db.Deleteable(stock).ExecuteCommand();
                    }
                    else
                    {
                        Db.Updateable(stock).ExecuteCommand();
                    }
                    //删除库存明细
                    Db.Deleteable(item).ExecuteCommand();
                    //判断托盘上还有没有其他物料
                    var palletData = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo && w.Id != item.Id);
                    if (palletData == null)
                    {
                        pallet.Status = "0";
                        Db.Updateable(pallet).ExecuteCommand();
                    }
                }
                new OperationASNServer().AddLogOperationAsn("PDA模块", "仓库收货", palletNo, "完成", $"在PDA上完成托盘码为:{palletNo}的仓库收货操作", userId);
                //提交事务
                Db.CommitTran();
            }
            catch (Exception ex)
            {
                //回滚事务
                Db.RollbackTran();
                throw ex;
            }
        }
        #endregion
        #region JC23取样业务接口
        //获取未组托或已组托的箱码级别
Wms/WMS.IBLL/IPdaServer/IPdaAsnServer.cs
@@ -146,6 +146,12 @@
        //平库确认入库
        void ConfirmInStock(PalletBindVm model);
        /// <summary>
        /// 仓库确认收货
        /// </summary>
        /// <param name="model"></param>
        void ConfirmTakeOf(string palletNo, int userId);
        //根据箱码向追溯系统请求箱信息
        List<BoxInfoDto> GetFMBindBoxInfos(string boxno,string url);
Wms/Wms/Controllers/PdaAsnController.cs
@@ -938,5 +938,38 @@
            }
        }
        #endregion
        #region 仓库收货
        /// <summary>
        /// 仓库确认收货
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult ConfirmTakeOf(PalletBindVm model)
        {
            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("未获取到用户信息");
                }
                _PdaAsnSvc.ConfirmTakeOf(model.PalletNo, int.Parse(UserId));
                return Ok(new { code = 0, msg = "收货成功!" });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        #endregion
    }
}