27个文件已修改
1个文件已添加
1950 ■■■■■ 已修改文件
HTML/js/public.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/SOSetting/ExportNotice.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/StatisticalReport/AdventSlot.html 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/StatisticalReport/BoxInfor.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/HouseDataSetting/agvTransport.html 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/SoSetting/pinTuoOut.html 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/View/SoSetting/productOutCode.html 826 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pda/js/public.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelDto/BllSoDto/ExportNoticeDto.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelDto/DataDto/MateDataStockDto.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelDto/PdaDto/PdaSoDto.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelVm/PdaVm/PdaCrVm.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelVm/PdaVm/PdaSoVm.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/ModelVm/SysVm/PackagVm.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs 195 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs 538 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/DataServer/DataBoxInfoServer.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/HttpServer.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/SysServer/StorageAreaServer.cs 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IHttpServer.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/DownApiController.cs 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/PdaCrController.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/PdaSoController.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/js/public.js
@@ -2,7 +2,7 @@
// var IP = "http://172.16.71.101:8082/";//接口IP
//var IP = "http://localhost:13243/api";
//var IP = "http://localhost:50515/api";  //本地
var IP="https://localhost:5001/api";
var IP="https://localhost:44363/api";
// var IP = "http://localhost:44318/api";
//var IP = "http://192.168.1.6:8017";
//var IP = "http://192.168.1.226:8086";  
HTML/views/SOSetting/ExportNotice.html
@@ -368,7 +368,7 @@
                                                </a>`;
                                    }
                                    
                                    if( (d.Status == '2' || d.Status == '3') && d.Type=='0'){
                                    if( (d.Status == '2' || d.Status == '3')){
                                        html += `<a class="layui-btn layui-btn-normal layui-btn-xs outClass" lay-event="outKu">
                                                    <i class="layui-icon layui-icon-ok"></i>出库
                                                </a>`;
@@ -490,6 +490,7 @@
                { field: 'SONo', title: '出库单号', align: 'center', fixed: 'left', width: 165, "disabled": true },
                { field: 'Type', title: '单据类型', align: 'center', templet: '#templetType' , width: 120,},
                { field: 'Status', title: '执行状态', align: 'center', templet: '#templetStatus', width: 90, },
                { field: 'OrderCode', title: '下发单号', align: 'center', width: 180 },
                { field: 'LogisticsName', title: '承运商', align: 'center', width: 120, },
                { field: 'CustomerName', title: '客户名称', align: 'center', width: 120, },
                { field: 'WareHouseName', title: '仓库', align: 'center', width: 90, },
HTML/views/StatisticalReport/AdventSlot.html
@@ -121,6 +121,13 @@
                            }}
                            {{ GetBtn(d) }}
                        </script>
                        <script type="text/html" id="templetExpirationTime">
                            {{# function GetBtn(d){
                                return formatDate(d.ExpirationTime);
                            }
                        }}
                        {{GetBtn(d)}}
                        </script>
                        <!-- #endregion -->
                    </div>
@@ -277,6 +284,12 @@
                //                 },
                //             },
                //             {
                //                 field: 'ExpirationTime', title: '过期时间', align: 'center',width:150,
                //                 templet: function(d) {
                //                     return formatDate2(d.ExpirationTime);
                //                 },
                //             },
                //             {
                //                 field: 'Status', title: '物料状态', align: 'center',width:100, templet: '#buttonTpl'
                //             },
                //             {
@@ -308,11 +321,13 @@
                            {field: 'LotText',title: '批次描述',  align: 'center', width:100},
                            {field: 'SupplierLot',title: '供货批次', align: 'center', width:100},
                            {field: 'ProductionTime', title: '生产时间', align: 'center',width:150,templet: '#templetProductionTime'},
                            {field: 'ExpirationTime', title: '过期时间', align: 'center',width:150,templet: '#templetExpirationTime'},
                            {field: 'Status', title: '物料状态', align: 'center',width:100, templet: '#buttonTpl'},
                            {field: 'InspectMark', title: '抽检标记', align: 'center',width:100, templet: '#InspectMarkStatus'},
                            {field: 'InspectStatus', title: '质量状态', align: 'center',width:100, templet: '#InspectStatus1'},
                        ]];
                var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码
                console.log(TotalColsSysArr);
                //#endregion
                //获取总量信息
                function refreshTable(SkuNo,SkuName,LotNo,PalletNo,Status,InspectMark,InspectStatus,IsBale,IsBelt) {
HTML/views/StatisticalReport/BoxInfor.html
@@ -407,6 +407,7 @@
                { field: 'BitPalletMark', title: '零托标记', align: 'center', templet: '#BitPalletMarkStatus', width: 100, },
                { field: 'ProductionTime', title: '生产日期', align: 'center', templet: '#templetProductionTime' },
                { field: 'ExpirationTime', title: '过期日期', align: 'center', templet: '#templetExpirationTime' },
                { field: 'OwnerNo', title: '货主编码', align: 'center', width: 100, },
                { field: 'OwnerName', title: '货主名称', align: 'center', width: 100, },
                { field: 'SupplierNo', title: '供应商编码', align: 'center', width: 100, },
Pda/View/HouseDataSetting/agvTransport.html
@@ -138,6 +138,15 @@
                                <img src="/assets/down_arraw.png">
                            </div>
                        </div>
                         <div id="" class="layui-form-item layout-dropdownlist">
                            <label class="layui-form-label" lang>目标储位:</label>
                            <div class="layui-input-block" id="selectLocatNoEnd">
                                <select id="LocatNoEnd" lay-filter="getLocatNoEnd" lay-search>
                                    <option value=""></option>
                                </select>
                                <img src="/assets/down_arraw.png">
                            </div>
                        </div>
                        <div id="" class="layui-form-item layout-dropdownlist">
                            <label class="layui-form-label" lang>入库口:</label>
                            <div class="layui-input-block" id="selectRuku">
@@ -447,6 +456,45 @@
                    }
                });
            }
             //选中出库单事件
             form.on('select(getQuyu)', function (data) {
                  //先更新一下目标区域
                updateLocatNoEndList()
            });
            //点击目标储位下拉框事件
            $("#selectLocatNoEnd").click(function () {
                if ($("#Quyu").val() == "") {
                    layer.msg('请先选择目标区域', {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return
                }
            })
            /* 绑定目标储位信息 */
            function updateLocatNoEndList() {
                $("#LocatNoEnd").empty()
                $("#LocatNoEnd").append('<option value =>' + '</option>');
                form.render('select');
                var param = {
                    "AreaNo": $("#Quyu").val()
                };
                sendData(IP + "/PdaCr/GetLocatByArea", param, 'get', function (res) {
                    if (res.code == 0) { //成功
                        for (var i = 0; i < res.data.length; i++) {
                            $("#LocatNoEnd").append('<option value =' + res.data[i] + '>' + res.data[i]+ '</option>');
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function() {});
                    }
                });
            }
            //点击出库单据下拉框事件
            $("#selectOutNo").click(function () {
@@ -652,6 +700,7 @@
                    var param = {
                        PalletNo: $("#STOCKCODE").val(),
                        AreaNo: $("#Quyu").val(),
                        LocatNoEnd: $("#LocatNoEnd").val(),
                        Ruku: $("#Ruku").val()
                    }
                    //呼叫小车
Pda/View/SoSetting/pinTuoOut.html
@@ -1300,6 +1300,25 @@
                    }
                });
            }
            //下拉单据选中后事件
            form.on('select(getbar2)', function (data) {
                if ($('#palletNo2').val() == "") {
                    layer.msg("请输入托盘条码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    return
                }
                if ($('#bar2').val() == "") {
                    clear21();
                    return
                }
                updateSkuLotNoList2();
                updateQtyList2();
                getBar2();
            });
            //初始化渲染 物料-批次
            function updateSkuLotNoList2() {
Pda/View/SoSetting/productOutCode.html
New file
@@ -0,0 +1,826 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
    <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> -->
    <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; */
        }
        .layout-tbl-submit {
            margin-top: 10px;
        }
        /* .out-scatter-num {
                 background-color: #009688;
            } */
        .out-scatter-num .local-input {
            width: 40%;
            height: 25px;
            float: left;
        }
        .out-scatter-num .local-ok button {
            height: 25px;
            border: 0;
            color: #FFFFFF;
            background-color: #0a93e3;
            border-radius: 3px;
            padding: 2px;
            margin-left: 10px;
            width: 100%;
        }
        .out-scatter-num .layui-input-block {
            width: 100%;
            /* background-color: #009E94; */
            margin-left: 0;
        }
        .out-scatter-num .local-ok {
            width: 20%;
            height: 25px;
            float: left;
        }
        .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;
        }
        .layout-tbl-paging {
            margin-top: 20px;
        }
        .foot-container {
            text-align: center;
        }
        .layout-tab-page {
            height: auto;
        }
        .layui-form-checkbox {
            margin: auto;
            /* padding-left: 2px; */
            /* padding-right: 2px; */
        }
        .div-tbl-title {
            width: 98%;
            margin: auto;
            /* background-color: #4476A7; */
            height: 30px;
        }
        .div-tbl-title table {
            width: 100%;
            height: 30px;
        }
        td {
            word-break: break-all;
            word-wrap: break-word;
        }
        .layui-input-block .layui-input,
        .layui-input-block .layui-textarea {
            padding-left: 0rem;
            font-size: 13px;
        }
        .lableWidth {
            width: 17%;
        }
        .layui-input-block {
            width: 83%;
            margin-left: 17%;
        }
        .layui-form-switch {
            margin-top: 0;
        }
        ul {
            list-style-type: none;
            padding: 0;
        }
        li {
            cursor: pointer;
            background-color: lightgray;
            padding: 10px;
            margin-bottom: 5px;
        }
    </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">成品拣货</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">主页</a></li>
                    <li><a href="../login.html">重新登录</a></li>
                </ul>
            </div>
            <div id="" class="layout-bill-info">
                    <form class="layui-form" action="" style="height: auto;">
                        <div id="layout-bill" class="layui-form-item layout-dropdownlist">
                            <label class="layui-form-label lableWidth">出库单:</label>
                            <div class="layui-input-block" id="selectDiv">
                                <select id="bar" lay-filter="getbar" lay-search>
                                    <option value=""></option>
                                </select>
                                <img src="/assets/down_arraw.png">
                            </div>
                        </div>
                        <div id="layout-skuLotNo" class="layui-form-item layout-dropdownlist">
                            <label class="layui-form-label lableWidth">物料 - 批次:</label>
                            <div class="layui-input-block">
                                <select id="skuLotNo" lay-filter="getSkuLotNo" lay-search>
                                    <option value=""></option>
                                </select>
                                <img src="/assets/down_arraw.png">
                            </div>
                        </div>
                        <div id="" class="layout-tab-page">
                            <table class="tbl-box-sim-info" border="" cellspacing="" cellpadding="">
                                <tr>
                                    <td colspan="3">
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" style="width: 17%;">下发单号:</label>
                                            <div class="layui-input-block" style="width: 83%;margin-left:17%;">
                                                <input id="OrderCode" type="text" lay-verify="" disabled placeholder=""
                                                    class="layui-input">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" style="width: 50%;">计划数量:</label>
                                            <div class="layui-input-block" style="width: 50%;margin-left:50%;">
                                                <input id="planQty" type="text" lay-verify="" disabled placeholder=""
                                                    class="layui-input">
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" style="width: 50%">完成数量:</label>
                                            <div class="layui-input-block" style="width: 50%;margin-left:50%;">
                                                <input id="finishQty" type="text" lay-verify="" disabled placeholder=""
                                                    class="layui-input">
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" style="width: 34%;">出库口:</label>
                                            <div class="layui-input-block" style="width: 66%;margin-left:34%;">
                                                <input id="outModel" type="text" lay-verify="" disabled placeholder=""
                                                    class="layui-input">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" style="width: 17%;">规格:</label>
                                            <div class="layui-input-block" style="width: 83%;margin-left:17%;">
                                                <input id="standard" type="text" lay-verify="" disabled placeholder=""
                                                    class="layui-input">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="layout-pallet" class="layui-form-item layout-input">
                            <label class="layui-form-label lableWidth">托盘条码:</label>
                            <div class="layui-input-block">
                                <input id="palletNo" type="text" lay-verify="stock" placeholder="请扫描托盘条码"
                                    autocomplete="off" class="layui-input" style="height:24px">
                            </div>
                        </div>
                        <div id="" class="layui-form-item layout-input">
                            <label class="layui-form-label" lang>是否整托出库:</label>
                            <div class="layui-input-block">
                                <input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch"
                                    lay-text="是|否" lay-filter="IsZhengTuo">
                            </div>
                        </div>
                        <div id="BoxDIv" class="layout-tab-page">
                            <table class="layout-tab-content" border="" cellspacing="" cellpadding="">
                                <tr>
                                    <td>
                                        <div class="layui-form-item layout-input">
                                            <label class="layui-form-label lableWidth">标签条码:</label>
                                            <div class="layui-input-block">
                                                <input id="boxNo" type="text" placeholder="请扫描标签条码" autocomplete="off"
                                                    class="layui-input">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="" class="layout-tab-page">
                            <table class="layout-tab-content" border="" cellspacing="" cellpadding="">
                                <tr>
                                    <td>
                                        <table class="tbl-box-sim-info" border="" cellspacing="" cellpadding="">
                                            <tr>
                                                <td>
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label lableWidth">待拣数量:</label>
                                                        <div class="layui-input-block">
                                                            <input id="pickQty" type="text" lay-verify="" disabled
                                                                placeholder="" class="layui-input">
                                                        </div>
                                                    </div>
                                                </td>
                                                <td>
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label lableWidth">已扫数量:</label>
                                                        <div class="layui-input-block">
                                                            <input id="scanQty" type="text" lay-verify="" disabled
                                                                placeholder="" class="layui-input">
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <table class="layout-tab-content">
                                <tr>
                                    <td style="width: 33%;"></td>
                                    <td>
                                        <button class="layout-btn layout-btn-red" lang type="button" lay-submit
                                            lay-filter="formPickScatter">拣货</button>
                                    </td>
                                    <td style="width: 33%;"></td>
                                </tr>
                            </table>
                            <div id="" style="text-align: right;margin-top: 10px; display: none;">
                                <div id="" class="cut-line">
                                    <img src="/assets/fengexian.png">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="layout-tbl-paging" id="">
                    <table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
                        <tr id="tableHead">
                            <th style="width: 54%;">标签条码</th>
                            <th style="width: 20%;">数量</th>
                        </tr>
                        <tr id="boxCell" style="display: none;">
                            <td name="boxNo">AG000001</td>
                            <td name="qty">30</td>
                        </tr>
                    </table>
                </div>
        </div>
    </div>
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script src="/layui/layui.js"></script>
    <script src="/js/jquery.cookie.js"></script>
    <script src="/js/public.js"></script>
    <script>
        layui.use(['form', 'jquery'], function () {
            var form = layui.form;
            /* 标签切换代码 */
            var xianshiyemian = 0;
            var boxes = [];
            var scanQty=0;
            //是否整托拣货
            var isContinue = "0";
            var tableData = null
            var tableData2 = null
            var canPickBox = true
            $("#palletNo").focus();//光标默认选中
            function clear1() {
                $("#OrderCode").val("");//下发单号
                $('#outModel').val("");//出库口
                $('#standard').val("");//规格
                $('#pickQty').val("");//待拣数量
            }
            function clear2() {
                //物料批次
                $("#skuLotNo").empty()
                $("#skuLotNo").append('<option value =>' + '</option>');
                form.render('select');
            }
            function clear3() {
                $("#planQty").val("");  //计划数量
                $("#finishQty").val("");//完成数量
            }
            function clear4() {
                $('#boxNo').val("");//箱码
                $('#boxQty').val("");//箱内数量
            }
            //当托盘条码输入框文本改变时,检查一下托盘状态
            $("#palletNo").on('input', function () {
                if ($("#palletNo").val() == "" || $("#palletNo").val().length < 8) {
                    return
                }
                if ($("#palletNo").val().length >= 8) {
                    $("#palletNo").val($("#palletNo").val().substr(-8))
                }
                checkPalletState()
            })
            form.on('switch(IsZhengTuo)', function (obj) {
                if (obj.elem.checked) {
                    var boxNum=0;
                    var param = {
                        "PalletNo": $("#palletNo").val()
                    }
                    synData(IP + "/PdaSo/CheckBoxForPick", param, 'get', function (res) {
                        if (res.code == 0) { //成功
                            boxNum=res.data
                            $('#scanQty').val(boxNum);
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () { });
                            return;
                        }
                    });
                    $('#BoxDIv').attr("style", "display:none")
                    isContinue = "1";
                    refreshTable();
                    boxes = [];
                } else {
                    $('#BoxDIv').attr("style", "display:block")
                    isContinue = "0";
                    $('#scanQty').val(0);
                }
                $('#boxNo').val("");
            });
            //箱码文本框回车事件
            $("#boxNo").blur(function () {
            });
            //当箱码输入框文本改变时
            $("#boxNo").on('input', function () {
                if ($("#boxNo").val() == "" || $("#boxNo").val().length < 20) {
                    return
                }
                if ($("#palletNo").val() == "" || $("#palletNo").val().length < 8) {
                    layer.msg("请先扫描托盘条码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    $("#boxNo").val('')
                    return;
                }
                var box;
                if ($("#boxNo").val().length >= 20) {
                    var boxNum=0;
                    var param = {
                        "PalletNo": $("#palletNo").val(),
                        "BoxNo":$("#boxNo").val()
                    }
                    synData(IP + "/PdaSo/CheckBoxForPick", param, 'get', function (res) {
                        if (res.code == 0) { //成功
                            boxNum=res.data
                            box={BoxNo: $("#boxNo").val(), Qty:boxNum }
                        } else { //不成功
                            layer.msg(res.msg, {
                                icon: 2,
                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                            }, function () { });
                            return;
                        }
                    });
                    var isExist = boxes.some(function(item) {
                        return item.BoxNo === box.BoxNo;
                    });
                    if (isExist) {
                        layer.msg("该条码已扫描!", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            //回调
                        });
                        $("#boxNo").val('')
                        return;
                    }
                    boxes.push(box);
                    tableData = deepCopy(boxes)
                    refreshTable(tableData)
                    $("#boxNo").val('')
                    scanQty=scanQty+boxNum
                    $('#scanQty').val(scanQty);
                }
            })
            //检查托盘状态
            function checkPalletState() {
                var param = {
                    "PalletNo": $("#palletNo").val()
                }
                synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        updateBillList();
                        if ($('#bar').val() == "") {
                            clear1();
                            return;
                        } else {
                            updateSkuLotNoList();
                            updateQtyList();
                            getBar();
                        }
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //下拉单据选中后事件
            form.on('select(getbar)', function (data) {
                if ($('#palletNo').val() == "") {
                    layer.msg("请输入托盘条码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        //回调
                    });
                    return
                }
                if ($('#bar').val() == "") {
                    clear1();
                    clear2();
                    clear3();
                    return
                }
                updateSkuLotNoList();
                updateQtyList();
                getBar();
            });
            //下拉物料批次选中后事件
            form.on('select(getSkuLotNo)', function (data) {
                if ($('#palletNo').val() == "") {
                    layer.msg("请输入托盘条码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }, function () {
                        clear1();
                        clear3();
                    });
                    return
                }
                if ($('#skuLotNo').val() == "") {
                    clear1();
                    clear3();
                    return
                }
                updateQtyList();
                getBar();
            });
            //初始化渲染 出库单
            function updateBillList() {
                $("#bar").empty()
                $("#bar").append('<option value =>' + '</option>');
                form.render('select');
                var param = {
                    PalletNo: $("#palletNo").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) {
                                $("#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秒)
                        });
                    }
                });
            }
            //初始化渲染 物料-批次
            function updateSkuLotNoList() {
                clear2();
                var param = {
                    PalletNo: $("#palletNo").val(),
                    SoNo: $("#bar").val(),
                };
                synData(IP + "/PdaSo/GetSoSkuLotNoListByPallet", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        for (var i = 0; i < res.data.length; i++) {
                            if (i == 0) {
                                $("#skuLotNo").append('<option value =' + res.data[i].SoDetailId + ' selected>' + res.data[i].SkuName + " - " + res.data[i].LotNo + '</option>');
                            } else {
                                $("#skuLotNo").append('<option value =' + res.data[i].SoDetailId + '>' + res.data[i].SkuName + " - " + res.data[i].LotNo + '</option>');
                            }
                        }
                        form.render('select');
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //初始化渲单据的计划数量和完成数量
            function updateQtyList() {
                clear3();
                var param = {
                    SoDetailId: $("#skuLotNo").val(),
                };
                synData(IP + "/PdaSo/GetPlanAndFinishQty", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        console.log(res.data);
                        $("#planQty").val(res.data.PlanQty)
                        $("#finishQty").val(res.data.FinishQty)
                        $("#OrderCode").val(res.data.OrderCode)
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //根据单据获取出库口
            function getBar() {
                clear1();
                var param = {
                    PalletNo: $("#palletNo").val(),
                    SoDetailId: $("#skuLotNo").val(),
                }
                synData(IP + "/PdaSo/GetOutlets", param, 'post', function (res) {
                    if (res.code == 0) { //成功
                        let data = res.data
                        console.log(res.data);
                        $('#outModel').val(res.data.OutModel);
                        $('#standard').val(res.data.Standard);
                        $('#pickQty').val(res.data.PickQty);
                    } else { //不成功
                        if ($("#planQty").val() == $("#finishQty").val()) {
                            return;
                        }
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () { });
                    }
                });
            }
            //渲染表格数据
            function refreshTable(list) {
                //先清空一下信息列表
                let trs = $("#tableBoxList tr")
                let len = trs.length
                for (i = len - 1; i >= 2; i--) {
                    trs[i].remove();
                }
                if (list != null && list.length > 0) { //成功
                    var arrTrs = new Array()
                    let idx = 0
                    for (var i in list) {
                        // 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='boxNo']").html(list[i].BoxNo);
                        tr.find("td[name='qty']").html(list[i].Qty);
                        tr.show();
                        arrTrs[i] = tr
                    }
                    canPickBox = true
                } else { //不成功
                    // layer.msg("无数据", {
                    //     icon: 2,
                    //     time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    // }, function () { });
                    // $("#boxNum").val(0)
                }
            }
            //单拣货(确认按钮)
            form.on('submit(formPickScatter)', function (data) {
                if ($('#bar').val() == "") {
                    layer.msg("请选择出库单", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }); return;
                }
                if ($('#bar').val() == "") {
                    layer.msg("请选择物料-批次", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }); return;
                }
                if ($('#palletNo').val() == "") {
                    layer.msg("请输入托盘码", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }); return;
                }
                if($("#planQty").val()!=$("#scanQty").val()){
                    layer.msg("已扫数量和计划数量不一致!", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    }); return;
                }
                if (isContinue == "0") {
                    if (boxes == null || boxes.length<=0) {
                        layer.msg("请扫描标签码", {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }); return;
                    }
                }
                if (canPickBox == false) {
                    layer.msg("请求未完成,不要重复请求", {
                        icon: 2,
                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                    });
                    return;
                }
                reqPickScatter()
                return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
            });
            //确认拣货
            function reqPickScatter() {
                var boxList=[];
                for(var i=0;i<boxes.length;i++){
                    boxList.push(boxes[i].BoxNo)
                }
                var param = {
                    "SoNo": $("#bar").val(),
                    "SoDetailId": $("#skuLotNo").val(),
                    "PalletNo": $('#palletNo').val(),
                    "BoxNoList": boxList
                }
                sendData(IP + "/PdaSo/SoSetPickCode", param, 'post', function (res) {
                    //console.log(res);
                    if (res.code == 0) { //成功
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            canPickBox = true//回调
                            $("#boxNo").val('');
                            updateQtyList();
                            getBar();
                            refreshTable();
                            boxes = [];
                        });
                    } else { //不成功
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            canPickBox = true;//回调
                        });
                    }
                });
            }
            //----------------------------------------------------------------------------------
            //主页及重新登录
            $("#menuImg").click(function (e) {
                //console.log("menuImg")
                e.stopPropagation()
                if ($("#menuList").is(":hidden")) {
                    $("#menuList").show()
                } else {
                    $("#menuList").hide()
                }
            })
            $('body').click(function () {
                // //console.log("body")
                $("#menuList").hide()
            })
        })
    </script>
</body>
</html>
Pda/js/public.js
@@ -2,7 +2,7 @@
// var IP = "https://localhost:44368";
//var IP = "http://localhost:13243/api";
//var IP = "http://localhost:50515/api";
var IP = "https://localhost:5001/api";
var IP = "https://localhost:44363/api";
//var IP = "http://192.168.1.2:8017/";
// var IP = "http://192.168.10.112/WmsService/";
// var IP = "http://192.168.1.226:8086";
Wms/Model/ModelDto/BllSoDto/ExportNoticeDto.cs
@@ -66,7 +66,10 @@
        /// Desc:承运商物流
        /// </summary>           
        public string LogisticsName { get; set; }
        /// <summary>
        /// 上游系统单号
        /// </summary>
        public string OrderCode { get; set; }
        /// <summary>
        /// 收货地址
Wms/Model/ModelDto/DataDto/MateDataStockDto.cs
@@ -264,6 +264,7 @@
        /// Desc:复检日期
        /// </summary>           
        public DateTime? InspectTime { get; set; }
        public DateTime? ExpirationTime { get; set; }
    }
Wms/Model/ModelDto/PdaDto/PdaSoDto.cs
@@ -13,6 +13,7 @@
        public decimal? PickQty { get; set; }                       // 托盘待拣数量--
        public decimal? PickedQty { get; set; }                       // 托盘已拣数量
        public string SkuNo { get; set; }                           // 物料编号
        public string OrderCode { get; set; } //上游系统单号
    }
    public class BoxInfo
    {
Wms/Model/ModelVm/PdaVm/PdaCrVm.cs
@@ -65,6 +65,10 @@
        /// </summary>
        public string AreaNo { get; set; }
        /// <summary>
        /// 目标储位
        /// </summary>
        public string LocatNoEnd { get; set; }
        /// <summary>
        /// 入库口
        /// </summary>
        public string Ruku { get; set; }
Wms/Model/ModelVm/PdaVm/PdaSoVm.cs
@@ -42,7 +42,7 @@
        /// 出库单明细Id
        /// </summary>
        public string SoDetailId { get; set; }
        /// <summary>
        /// 是否整箱 0整箱 1散盒
        /// </summary>
@@ -59,6 +59,11 @@
        public string BoxNo { get; set; }
        /// <summary>
        /// 箱码集合
        /// </summary>
        public List<string> BoxNoList{ get; set; }
        /// <summary>
        /// 盒码
        /// </summary>
        public string BoxNo2 { get; set; }
Wms/Model/ModelVm/SysVm/PackagVm.cs
@@ -15,7 +15,7 @@
        public string PackagNo { get; set; }
        [Required]
        [MaxLength(20)]
        [MaxLength(100)]
        public string PackagName { get; set; }
        /// <summary>
Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -325,6 +325,14 @@
                            CreateUser = 0,
                            CreateTime = comTime
                        };
                        if (!string.IsNullOrEmpty(detail.Lot1))
                        {
                            sd1.ProductionTime = Convert.ToDateTime(detail.Lot1);//生产日期
                        }
                        if (!string.IsNullOrEmpty(detail.Lot2))
                        {
                            sd1.ExpirationTime = Convert.ToDateTime(detail.Lot2);//到期日期
                        }
                        var palletData = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == sd1.PalletNo && !string.IsNullOrEmpty(w.LocatNo));
                        if (palletData != null)
                        {
@@ -1188,7 +1196,15 @@
                    throw new Exception("未查询到托盘信息,请核实!");
                }
                // 验证入库单明细是否存在
                var detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailId && m.ASNNo == model.AsnNo && m.LotNo.Contains(model.LotNo));
                var detail = new BllArrivalNoticeDetail();
                if (string.IsNullOrEmpty(model.LotNo))
                {
                    detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailId && m.ASNNo == model.AsnNo);
                }
                else
                {
                    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("当前物料及批次与单据无关联,请核实!");
@@ -1327,14 +1343,23 @@
                    throw new Exception("当前托盘含有贴标物料信息,不能组托");
                }
                // 判断库存明细是否已有此托盘信息  
                var sd1 = Db.Queryable<DataStockDetail>()
                    .First(m => m.IsDel == "0" && m.ASNDetailNo == bind.ASNDetailNo && m.PalletNo == model.PalletNo && m.SkuNo == detail.SkuNo && m.LotNo == bind.LotNo);
                var sd1 = new DataStockDetail();
                if (!string.IsNullOrEmpty(bind.LotNo))
                {
                    sd1 = Db.Queryable<DataStockDetail>()
                    .First(m => m.IsDel == "0" && m.PalletNo == model.PalletNo && m.SkuNo == detail.SkuNo && m.LotNo == bind.LotNo);//&& m.ASNDetailNo == bind.ASNDetailNo
                }
                else
                {
                    sd1 = Db.Queryable<DataStockDetail>()
                    .First(m => m.IsDel == "0" && m.PalletNo == model.PalletNo && m.SkuNo == detail.SkuNo);// && m.ASNDetailNo == bind.ASNDetailNo
                }
                var sdId1 = 0;
                if (sd1 != null)
                {
                    sdId1 = sd1.Id;
                    // 库存已存在 更新数据
                    sd1.Qty = bind.Qty;
                    sd1.Qty += bind.Qty;
                    sd1.CompleteTime = comTime;
                    sd1.UpdateUser = userId;
                    sd1.UpdateTime = comTime;
Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -429,60 +429,105 @@
        //}
        public async Task<List<StockDetailWithQtyDto>> GetStockQueryList(string locatNo, string palletNo, string boxNo)
        {
                return await Db.Queryable<DataStockDetail>("a")
                    .InnerJoin<DataBoxInfo>((a, b) => a.LotNo == b.LotNo)
                    .Where((a, b) => a.IsDel == "0")
                    .WhereIF(!string.IsNullOrWhiteSpace(locatNo), (a, b) => a.LocatNo.Contains(locatNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(palletNo), (a, b) => a.PalletNo.Contains(palletNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(boxNo), (a, b) => b.BoxNo.Contains(boxNo))
                    .OrderBy((a, b) => new { a.LotNo, a.LocatNo, a.PalletNo })
                    .Select((a, b) => new StockDetailWithQtyDto
                    {
                        LotNo = a.LotNo,
                        LotText = a.LotText,
                        SupplierLot = a.SupplierLot,
                        OwnerNo = a.OwnerNo,
                        OwnerName = a.OwnerName,
                        SupplierNo = a.SupplierNo,
                        SupplierName = a.SupplierName,
                        SkuNo = a.SkuNo,
                        SkuName = a.SkuName,
                        Standard = a.Standard,
                        Qty = b.Qty,  // DataBoxInfo的Qty字段
                        LockQty = a.LockQty,
                        FrozenQty = a.FrozenQty,
                        InspectQty = a.InspectQty,
                        ASNNo = a.ASNNo,
                        ASNDetailNo = a.ASNDetailNo,
                        SONo = a.SONo,
                        WareHouseNo = a.WareHouseNo,
                        RoadwayNo = a.RoadwayNo,
                        AreaNo = a.AreaNo,
                        LocatNo = a.LocatNo,
                        PalletNo = a.PalletNo,
                        PalletNo2 = a.PalletNo2,
                        PalletNo3 = a.PalletNo3,
                        PalletTags = a.PalletTags,
                        CompleteTime = a.CompleteTime,
                        ProductionTime = a.ProductionTime,
                        ExpirationTime = a.ExpirationTime,
                        Status = a.Status,
                        InspectMark = a.InspectMark,
                        BitPalletMark = a.BitPalletMark,
                        InspectStatus = a.InspectStatus,
                        InspectTime = a.InspectTime,
                        PackagNo = a.PackagNo,
                        IsBale = a.IsBale,
                        IsBelt = a.IsBelt,
                        UDF5 = a.UDF5,
                        IsDel = a.IsDel,
                        CreateTime = a.CreateTime,
                        CreateUser = a.CreateUser,
                        UpdateTime = a.UpdateTime,
                        UpdateUser = a.UpdateUser,
                        Demo = a.Demo
                    })
                    .ToListAsync();
            return await Db.Queryable<DataStockDetail>("a")
                .InnerJoin<DataBoxInfo>((a, b) => a.LotNo == b.LotNo)
                .Where((a, b) => a.IsDel == "0")
                .WhereIF(!string.IsNullOrWhiteSpace(locatNo), (a, b) => a.LocatNo.Contains(locatNo))
                .WhereIF(!string.IsNullOrWhiteSpace(palletNo), (a, b) => a.PalletNo.Contains(palletNo))
                .WhereIF(!string.IsNullOrWhiteSpace(boxNo), (a, b) => b.BoxNo.Contains(boxNo))
                .GroupBy((a, b) => new
                {
                    a.LotNo,
                    a.LotText,
                    a.SupplierLot,
                    a.OwnerNo,
                    a.OwnerName,
                    a.SupplierNo,
                    a.SupplierName,
                    a.SkuNo,
                    a.SkuName,
                    a.Standard,
                    a.LockQty,
                    a.FrozenQty,
                    a.InspectQty,
                    a.ASNNo,
                    a.ASNDetailNo,
                    a.SONo,
                    a.WareHouseNo,
                    a.RoadwayNo,
                    a.AreaNo,
                    a.LocatNo,
                    a.PalletNo,
                    a.PalletNo2,
                    a.PalletNo3,
                    a.PalletTags,
                    a.CompleteTime,
                    a.ProductionTime,
                    a.ExpirationTime,
                    a.Status,
                    a.InspectMark,
                    a.BitPalletMark,
                    a.InspectStatus,
                    a.InspectTime,
                    a.PackagNo,
                    a.IsBale,
                    a.IsBelt,
                    a.UDF5,
                    a.IsDel,
                    a.CreateTime,
                    a.CreateUser,
                    a.UpdateTime,
                    a.UpdateUser,
                    a.Demo
                })
                .OrderBy((a, b) => new { a.LotNo, a.LocatNo, a.PalletNo })
                .Select((a, b) => new StockDetailWithQtyDto
                {
                    LotNo = a.LotNo,
                    LotText = a.LotText,
                    SupplierLot = a.SupplierLot,
                    OwnerNo = a.OwnerNo,
                    OwnerName = a.OwnerName,
                    SupplierNo = a.SupplierNo,
                    SupplierName = a.SupplierName,
                    SkuNo = a.SkuNo,
                    SkuName = a.SkuName,
                    Standard = a.Standard,
                    Qty = SqlFunc.AggregateSum(b.Qty),  // DataBoxInfo的Qty字段
                    LockQty = a.LockQty,
                    FrozenQty = a.FrozenQty,
                    InspectQty = a.InspectQty,
                    ASNNo = a.ASNNo,
                    ASNDetailNo = a.ASNDetailNo,
                    SONo = a.SONo,
                    WareHouseNo = a.WareHouseNo,
                    RoadwayNo = a.RoadwayNo,
                    AreaNo = a.AreaNo,
                    LocatNo = a.LocatNo,
                    PalletNo = a.PalletNo,
                    PalletNo2 = a.PalletNo2,
                    PalletNo3 = a.PalletNo3,
                    PalletTags = a.PalletTags,
                    CompleteTime = a.CompleteTime,
                    ProductionTime = a.ProductionTime,
                    ExpirationTime = a.ExpirationTime,
                    Status = a.Status,
                    InspectMark = a.InspectMark,
                    BitPalletMark = a.BitPalletMark,
                    InspectStatus = a.InspectStatus,
                    InspectTime = a.InspectTime,
                    PackagNo = a.PackagNo,
                    IsBale = a.IsBale,
                    IsBelt = a.IsBelt,
                    UDF5 = a.UDF5,
                    IsDel = a.IsDel,
                    CreateTime = a.CreateTime,
                    CreateUser = a.CreateUser,
                    UpdateTime = a.UpdateTime,
                    UpdateUser = a.UpdateUser,
                    Demo = a.Demo
                })
                .ToListAsync();
        }
        #endregion
@@ -791,7 +836,7 @@
                if (models.WareHouseNo == "W02")
                {
                    storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04" && (w.AreaNo == "B01" || w.AreaNo == "B02")).OrderBy(o => o.AreaNo).ToListAsync();
                    storageArea = await Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.Status == "0" && w.AreaNo != storageLocat.AreaNo && w.WareHouseNo == "W04" && (w.AreaNo == "B01" || w.AreaNo == "B02" || w.AreaNo == "B05")).OrderBy(o => o.AreaNo).ToListAsync();
                }
                else
                {
@@ -800,6 +845,29 @@
                
            }
            return storageArea;
        }
        /// <summary>
        /// 根据区域号获取储位地址集合
        /// </summary>
        /// <param name="areaNo"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public List<string> GetLocatByArea(string areaNo)
        {
            try
            {
                if (string.IsNullOrEmpty(areaNo))
                {
                    throw new Exception("请选择区域");
                }
                var _list = Db.Queryable<SysStorageLocat>().Where(w => w.IsDel == "0" && w.AreaNo == areaNo && w.WareHouseNo == "W04").Select(s => s.LocatNo).ToList();
                return _list;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        /// <summary>
        /// 获取已分配的出库单据
@@ -1011,7 +1079,7 @@
            }
        }*/
        public async Task AgvTransport(string palletNo, string areaNo, string ruku, string url, int userId)
        public async Task AgvTransport(string palletNo, string areaNo,string locatNoEnd, string ruku, string url, int userId)
        {
            try
            {
@@ -1046,7 +1114,14 @@
                    {
                        throw Oops.Bah("所选区域信息不存在,请检查!");
                    }
                    EndLocat = await GetLocat(areaNo);
                    if (!string.IsNullOrEmpty(locatNoEnd))
                    {
                        EndLocat = locatNoEnd;//指定储位地址
                    }
                    else
                    {
                        EndLocat = await GetLocat(areaNo);//系统分配储位地址
                    }
                }
                else
                {
@@ -1061,9 +1136,9 @@
                {
                    throw Oops.Bah("托盘储位信息不存在,请检查!");
                }
                if (stockDetail.WareHouseNo != "W04")
                if (stockDetail.WareHouseNo != "W04" && stockDetail.WareHouseNo != "W02")
                {
                    throw Oops.Bah("该托盘未在平库内,请检查!");
                    throw Oops.Bah("该托盘未在平库或货架库内,请检查!");
                }
                //起始储位信息
@@ -1075,7 +1150,7 @@
                //目标储位信息
                //var storageLocatEnd = new SysStorageLocat();
                var storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0");
                var storageLocatEnd = await Db.Queryable<SysStorageLocat>().FirstAsync(w => w.IsDel == "0" && w.LocatNo == EndLocat && w.Flag == "0" && w.WareHouseNo == "W04" && w.AreaNo == areaNo);
                if (storageLocatEnd == null)
                {
                    throw Oops.Bah("目标储位信息不存在,请检查!");
Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
@@ -23,6 +23,7 @@
using System.Threading.Tasks;
using Utility;
using WMS.BLL.Logic;
using System.Web;
namespace WMS.BLL.BllPdaServer
{
@@ -1851,8 +1852,9 @@
                var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.Status == "1" && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
                return allotList;
            }
            var noticeList = Db.Queryable<BllExportNotice>().Where(w => w.IsDel == "0" && (w.Status == "3" || w.Status == "4")).Select(s => s.SONo).ToList();
            //获取状态为待拣货或者部分拣货的出库单
            var allotList2 = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3" || m.Status == "5") && m.PalletNo == palletNo).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
            var allotList2 = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "2" || m.Status == "3" || m.Status == "5") && m.PalletNo == palletNo && noticeList.Contains(m.SONo)).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();
            //获取出库单据不为待拣货 执行完毕 订单关闭 等待执行的单据
@@ -1963,7 +1965,7 @@
            {
                OutModel = data.OutMode,
                Standard = data.Standard,
                PickQty = data.Qty,
                PickQty = data.Qty - data.CompleteQty,
                PickedQty = data.CompleteQty
            };
            return data2;
@@ -1977,10 +1979,16 @@
            {
                throw Oops.Bah("未查询到出库单的明细");
            }
            var notice = await Db.Queryable<BllExportNotice>().FirstAsync(m => m.SONo == detail.SONo && m.IsDel == "0");
            if (notice == null)
            {
                throw Oops.Bah("未查询到出库单信息");
            }
            var data = new OutPdaInfo()
            {
                PlanQty = detail.Qty,
                FinishQty = detail.CompleteQty
                FinishQty = detail.CompleteQty,
                OrderCode = notice.OrderCode,
            };
            return data;
        }
@@ -2091,6 +2099,52 @@
            }
            return list;
        }
        /// <summary>
        /// 出库拣货获取扫描标签数量
        /// </summary>
        /// <param name="palletNo"></param>
        /// <param name="boxNo"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public decimal CheckBoxForPick(string palletNo ,string boxNo)
        {
            try
            {
                decimal boxNum = 0;
                if (string.IsNullOrEmpty(palletNo))
                {
                    throw new Exception("托盘条码不可为空!");
                }
                if (string.IsNullOrEmpty(boxNo))
                {
                    var boxInfo = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.PalletNo == palletNo).ToList();
                    boxNum = boxInfo.Sum(s => s.Qty);
                }
                else
                {
                    var boxInfo = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.BoxNo == boxNo && w.PalletNo == palletNo).ToList();
                    if (boxInfo.Count <= 0)
                    {
                        boxInfo = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.BoxNo2 == boxNo && w.PalletNo == palletNo).ToList();
                        if (boxInfo.Count <= 0)
                        {
                            boxInfo = Db.Queryable<DataBoxInfo>().Where(w => w.IsDel == "0" && w.BoxNo3 == boxNo && w.PalletNo == palletNo).ToList();
                        }
                    }
                    if (boxInfo == null || boxInfo.Count <= 0)
                    {
                        throw new Exception("标签条码未在该托盘内!");
                    }
                    boxNum = boxInfo.Sum(s => s.Qty);
                }
                return boxNum;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        //获取库内无箱码的托盘分配信息
@@ -2831,6 +2885,11 @@
                    }
                    boxInfos = await boxInfo.ToListAsync();
                    if (boxInfos[0].SkuNo != allot.SkuNo || boxInfos[0].LotNo != allot.LotNo)
                    {
                        throw Oops.Bah("箱码物料批次和选择物料批次不一致!");
                    }
                    var comDetailList = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == allot.Id && m.PalletNo == palletNo).ToList();
                    if (biaoShi == "2") //散支拣货
                    {
@@ -3088,6 +3147,475 @@
                                    wave.UpdateUser = userId;
                                    wave.UpdateTime = DateTime.Now;
                                    await Db.Updateable(wave).ExecuteCommandAsync();
                                }
                            }
                        }
                    }
                }
                //添加操作日志记录
                var k = new OperationSOServer().AddLogOperationSo("PDA模块", "拣货出库", soNo, "拣货", $"在PDA上对出库单号为:{soNo}的托盘码为:{palletNo}的拣货操作", userId);
                Db.CommitTran();
            }
            //catch (AppFriendlyException e)
            //{
            //    Db.RollbackTran();
            //}
            catch (Exception e)
            {
                Db.RollbackTran();
                throw new Exception(e.Message);
            }
        }
        /// <summary>
        /// 成品出库pda拣货-JC34
        /// </summary>
        /// <param name="soNo"></param>
        /// <param name="soDetailId"></param>
        /// <param name="palletNo"></param>
        /// <param name="boxNoList"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        public async Task SoSetPickCode34(string soNo, string soDetailId, string palletNo, List<string> boxNoList, int userId)
        {
            try
            {
                #region 判断
                if (string.IsNullOrWhiteSpace(soNo))
                {
                    throw Oops.Bah("出库单据不能为空");
                }
                if (string.IsNullOrWhiteSpace(soDetailId))
                {
                    throw Oops.Bah("出库物料-批次不能为空");
                }
                if (string.IsNullOrWhiteSpace(palletNo))
                {
                    throw Oops.Bah("托盘码不能为空");
                }
                //开启事务
                Db.BeginTran();
                //出库单
                var notice = await Db.Queryable<BllExportNotice>().FirstAsync(m => m.IsDel == "0" && m.SONo == soNo);
                if (notice == null)
                {
                    throw Oops.Bah("未查询到该出库单的信息");
                }
                if (notice.Status != "3")
                {
                    throw Oops.Bah("出库单的状态不是正在执行,不能拣货");
                }
                //出库单明细
                var noticeDetail = await Db.Queryable<BllExportNoticeDetail>()
                    .FirstAsync(m => m.IsDel == "0" && m.Id == int.Parse(soDetailId));
                if (noticeDetail == null)
                {
                    throw Oops.Bah("未查询到该出库单明细的信息");
                }
                //出库分配信息
                var allot = await Db.Queryable<BllExportAllot>().FirstAsync(m =>
                    m.IsDel == "0" && (m.Status == "2" || m.Status == "3") && m.SONo == soNo &&
                    m.SODetailNo == int.Parse(soDetailId) && m.PalletNo == palletNo);
                if (allot == null)
                {
                    throw Oops.Bah("未查询到该托盘的分配信息");
                }
                //剩余拣货数量(待拣减去已拣)
                var needQty = allot.Qty - allot.CompleteQty;
                //库存明细
                var stockDetail = await Db.Queryable<DataStockDetail>().FirstAsync(m => m.IsDel == "0" && m.Id == allot.StockId);
                if (stockDetail == null)
                {
                    throw Oops.Bah("未查询到该托盘分配的库存明细信息!");
                }
                //库存总表
                var stock = await Db.Queryable<DataStock>().FirstAsync(a => a.IsDel == "0" && a.SkuNo == stockDetail.SkuNo && a.LotNo == stockDetail.LotNo);
                if (stock == null)
                {
                    throw Oops.Bah("未查询到该托盘分配的库存信息!");
                }
                #endregion
                if (boxNoList == null || boxNoList.Count <= 0)//整托拣货
                {
                    List<DataBoxInfo> boxInfos;
                    var boxInfo = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.PalletNo == palletNo && m.SkuNo == stockDetail.SkuNo && m.LotNo == stockDetail.LotNo);//找到托盘上所有箱码
                    boxInfos = await boxInfo.ToListAsync();
                    if (boxInfo.Count() <= 0)
                    {
                        throw Oops.Bah("该托盘上没有可拣货的箱子");
                    }
                    var boxQty = await boxInfo.GroupBy(m => m.PalletNo).Select(m => SqlFunc.AggregateSum(m.Qty)).ToListAsync();
                    if (boxQty[0] > needQty)
                    {
                        throw Oops.Bah("拣货数量不能大于箱内剩余待拣数量");
                    }
                    decimal pickQty = 0;//拣货的数量
                    var comDetailList = await Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == allot.Id && m.PalletNo == palletNo).ToListAsync();
                    var comList = new List<BllCompleteDetail>();
                    foreach (var item in boxInfos)
                    {
                        if (comDetailList.Any(m => m.BoxNo3 == item.BoxNo3) && item.BoxNo3 != null)
                        {
                            throw Oops.Bah($"当前{item.BoxNo}中{item.BoxNo3}已拣货完成,请勿重复拣货");
                        }
                        if (item.SkuNo != allot.SkuNo || item.LotNo != allot.LotNo)
                        {
                            throw Oops.Bah("当前托盘上有其他不同物料批次,拣货失败");
                        }
                        //添加拣货明细
                        var completeDetail = new BllCompleteDetail()
                        {
                            SONo = soNo,
                            SODetailNo = int.Parse(soDetailId),
                            ExportAllotId = allot.Id,
                            StockId = allot.StockId,
                            BoxNo = item.BoxNo,
                            BoxNo2 = item.BoxNo2,
                            BoxNo3 = item.BoxNo3,
                            LotNo = allot.LotNo,
                            LotText = allot.LotText,
                            SupplierLot = allot.SupplierLot,
                            SkuNo = allot.SkuNo,
                            SkuName = allot.SkuName,
                            Standard = allot.Standard,
                            PalletNo = palletNo,
                            CompleteQty = item.Qty,
                            CreateUser = userId
                        };
                        comList.Add(completeDetail);
                        //删除库存箱码明细
                        await Db.Deleteable(item).ExecuteCommandAsync();
                        pickQty += item.Qty;
                    }
                    //添加拣货明细
                    await Db.Insertable(comList).ExecuteCommandAsync();
                    //修改出库分配信息
                    allot.CompleteQty += pickQty;
                    allot.Status = allot.Qty <= allot.CompleteQty ? "5" : "3";
                    allot.UpdateTime = DateTime.Now;
                    await Db.Updateable(allot).ExecuteCommandAsync();
                    //删除库存明细
                    await Db.Deleteable(stockDetail).ExecuteCommandAsync();
                    //删除或修改库存
                    stock.Qty -= pickQty;
                    stock.LockQty -= pickQty;
                    if (stock.LockQty < 0)
                    {
                        stock.LockQty = 0;
                    }
                    if (stock.Qty <= 0)
                    {
                        await Db.Deleteable(stock).ExecuteCommandAsync();
                    }
                    else
                    {
                        await Db.Updateable(stock).ExecuteCommandAsync();
                    }
                    //判断托盘上还有没有其他物料
                    var palletData = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo && w.Id != stockDetail.Id);
                    if (palletData == null)
                    {
                        //改变托盘状态为:未使用
                        var pallet = Db.Queryable<SysPallets>().First(m => m.PalletNo == palletNo && m.IsDel == "0");
                        if (pallet == null)
                        {
                            throw Oops.Bah("未在托盘表中查询到托盘信息");
                        }
                        pallet.Status = "0";
                        await Db.Updateable(pallet).ExecuteCommandAsync();
                    }
                    //修改出库单明细拣货数量
                    noticeDetail.CompleteQty += pickQty;
                    await Db.Updateable(noticeDetail).ExecuteCommandAsync();
                    var num = await Db.Queryable<BllExportNoticeDetail>()
                        .CountAsync(m => m.IsDel == "0" && m.SONo == soNo && m.CompleteQty < m.Qty);
                    if (num <= 0)
                    {
                        notice.Status = "4"; //更改为执行完成
                        //修改出库单信息
                        await Db.Updateable(notice).ExecuteCommandAsync();
                        if (notice.IsWave == "1")
                        {
                            var waveNum = await Db.Queryable<BllExportNotice>().CountAsync(m => m.IsDel == "0" && m.WaveNo == notice.WaveNo && m.Status != "4");
                            if (waveNum == 0)
                            {
                                var wave = await Db.Queryable<BllWaveMage>().FirstAsync(m => m.IsDel == "0" && m.WaveNo == notice.WaveNo);
                                if (wave != null)
                                {
                                    wave.Status = "4";
                                    wave.UpdateUser = userId;
                                    wave.UpdateTime = DateTime.Now;
                                    await Db.Updateable(wave).ExecuteCommandAsync();
                                }
                            }
                        }
                    }
                }
                else
                {
                    foreach (var boxNo in boxNoList)
                    {
                        var biaoShi = "0";//0:整箱拣货、1:整盒拣货、 2:散支拣货
                        List<DataBoxInfo> boxInfos;
                        var boxInfo = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo == boxNo);
                        if (await boxInfo.CountAsync() == 0)
                        {
                            biaoShi = "1";
                            boxInfo = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo2 == boxNo);
                            if (await boxInfo.CountAsync() == 0)
                            {
                                biaoShi = "2";
                                boxInfo = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.BoxNo3 == boxNo);
                                if (await boxInfo.CountAsync() == 0)
                                {
                                    throw Oops.Bah("未查询到该箱码及追溯码的信息");
                                }
                            }
                        }
                        boxInfos = await boxInfo.ToListAsync();
                        if (boxInfos[0].SkuNo != allot.SkuNo || boxInfos[0].LotNo != allot.LotNo)
                        {
                            throw Oops.Bah("箱码物料批次和选择物料批次不一致!");
                        }
                        var comDetailList = Db.Queryable<BllCompleteDetail>().Where(m => m.IsDel == "0" && m.ExportAllotId == allot.Id && m.PalletNo == palletNo).ToList();
                        if (biaoShi == "2") //散支拣货
                        {
                            boxInfos = boxInfos.Where(m => m.BoxNo3 == boxNo).ToList();
                            if (boxInfos.Count() == 0)
                            {
                                throw Oops.Bah("未查询到该箱码及追溯码的信息");
                            }
                            if (boxInfos.Count() > 1)
                            {
                                throw Oops.Bah("该追溯支码的信息大于1条,信息错误,请核实!");
                            }
                            if (boxInfos.Any(m => m.PalletNo != palletNo))
                            {
                                throw Oops.Bah("该托盘与箱码没有绑定关系");
                            }
                            var boxQty = boxInfos.First().Qty;
                            //if (boxQty > needQty)
                            //{
                            //    throw Oops.Bah("拣货数量不能大于剩余待拣数量");
                            //}
                            foreach (var item in boxInfos)
                            {
                                if (comDetailList.Any(m => m.BoxNo3 == item.BoxNo3))
                                {
                                    throw Oops.Bah($"当前{item.BoxNo}中{item.BoxNo3}已拣货完成,请勿重复拣货");
                                }
                            }
                        }
                        else if (biaoShi == "1")//整盒拣货
                        {
                            if (boxInfo.Count() == 0)
                            {
                                throw Oops.Bah("未查询到该盒码的信息");
                            }
                            if (boxInfo.Any(m => m.PalletNo != palletNo))
                            {
                                throw Oops.Bah("该托盘与盒码没有绑定关系");
                            }
                            var boxQty = await boxInfo.GroupBy(m => m.BoxNo2).Select(m => SqlFunc.AggregateSum(m.Qty)).ToListAsync();
                            //if (boxQty[0] > needQty)
                            //{
                            //    throw Oops.Bah("拣货数量不能大于箱内剩余待拣数量");
                            //}
                            foreach (var item in boxInfos)
                            {
                                if (comDetailList.Any(m => m.BoxNo3 == item.BoxNo3))
                                {
                                    throw Oops.Bah($"当前{item.BoxNo}中{item.BoxNo3}已拣货完成,请勿重复拣货");
                                }
                            }
                        }
                        else //整箱拣货
                        {
                            if (boxInfo.Count() == 0)
                            {
                                throw Oops.Bah("未查询到该箱码的信息");
                            }
                            if (boxInfo.Any(m => m.PalletNo != palletNo))
                            {
                                throw Oops.Bah("该托盘与箱码没有绑定关系");
                            }
                            var boxQty = await boxInfo.GroupBy(m => m.BoxNo).Select(m => SqlFunc.AggregateSum(m.Qty)).ToListAsync();
                            //if (boxQty[0] > needQty)
                            //{
                            //    throw Oops.Bah("拣货数量不能大于箱内剩余待拣数量");
                            //}
                            foreach (var item in boxInfos)
                            {
                                if (comDetailList.Any(m => m.BoxNo == item.BoxNo))
                                {
                                    throw Oops.Bah($"当前{item.BoxNo}已拣货完成,请勿重复拣货");
                                }
                            }
                        }
                        decimal pickQty = 0;//拣货的数量
                        var comList = new List<BllCompleteDetail>();
                        foreach (var item in boxInfos)
                        {
                            //添加拣货明细
                            var completeDetail = new BllCompleteDetail()
                            {
                                SONo = soNo,
                                SODetailNo = int.Parse(soDetailId),
                                ExportAllotId = allot.Id,
                                StockId = allot.StockId,
                                BoxNo = item.BoxNo,
                                BoxNo2 = item.BoxNo2,
                                BoxNo3 = item.BoxNo3,
                                LotNo = allot.LotNo,
                                LotText = allot.LotText,
                                SupplierLot = allot.SupplierLot,
                                SkuNo = allot.SkuNo,
                                SkuName = allot.SkuName,
                                Standard = allot.Standard,
                                PalletNo = palletNo,
                                CompleteQty = item.Qty,
                                CreateUser = userId
                            };
                            comList.Add(completeDetail);
                            if (biaoShi != "3")
                            {
                                //删除库存箱码明细
                                await Db.Deleteable(item).ExecuteCommandAsync();
                                pickQty += item.Qty;
                            }
                        }
                        //改变库内箱码是否零箱信息
                        if (biaoShi == "1" || biaoShi == "2")
                        {
                            var boxSurplusList = new List<DataBoxInfo>();
                            if (biaoShi == "1")
                            {
                                boxSurplusList = boxInfo.Where(m => m.BoxNo2 != boxNo).ToList();
                            }
                            else
                            {
                                boxSurplusList = boxInfo.Where(m => m.BoxNo3 != boxNo).ToList();
                            }
                            foreach (var item in boxSurplusList)
                            {
                                item.BitBoxMark = "1";
                                await Db.Updateable(item).ExecuteCommandAsync();
                            }
                        }
                        await Db.Insertable(comList).ExecuteCommandAsync();
                        //修改出库分配信息
                        allot.CompleteQty += pickQty;
                        allot.Status = allot.Qty <= allot.CompleteQty ? "5" : "3";
                        allot.UpdateTime = DateTime.Now;
                        if (allot.Status == "5")
                        {
                            //判断该托盘是否还存在物料 存在改为待回库 待回库完成后改为已完成
                        }
                        await Db.Updateable(allot).ExecuteCommandAsync();
                        //删除或修改库存明细
                        stockDetail.BitPalletMark = "1";//修改为零托标识
                        stockDetail.Qty -= pickQty;
                        stockDetail.LockQty -= pickQty;
                        if (stockDetail.LockQty < 0)
                        {
                            stockDetail.LockQty = 0;
                        }
                        if (stockDetail.Qty == stockDetail.LockQty)
                        {
                            stockDetail.Status = "2";
                        }
                        else if (stockDetail.Qty > stockDetail.LockQty && stockDetail.LockQty > 0)
                        {
                            stockDetail.Status = "1";
                        }
                        else
                        {
                            stockDetail.Status = "0";
                        }
                        if (stockDetail.Qty <= 0)
                        {
                            await Db.Deleteable(stockDetail).ExecuteCommandAsync();
                        }
                        else
                        {
                            await Db.Updateable(stockDetail).ExecuteCommandAsync();
                        }
                        stock.Qty -= pickQty;
                        stock.LockQty -= pickQty;
                        if (stock.LockQty < 0)
                        {
                            stock.LockQty = 0;
                        }
                        if (stock.Qty <= 0)
                        {
                            await Db.Deleteable(stock).ExecuteCommandAsync();
                        }
                        else
                        {
                            await Db.Updateable(stock).ExecuteCommandAsync();
                        }
                        var num2 = await Db.Queryable<DataStockDetail>().CountAsync(m => m.IsDel == "0" && m.PalletNo == palletNo);
                        if (num2 <= 0)
                        {
                            //改变托盘状态
                            var pallet = await Db.Queryable<SysPallets>().FirstAsync(m => m.PalletNo == palletNo && m.IsDel == "0");
                            if (pallet == null)
                            {
                                throw Oops.Bah("未在托盘表中查询到托盘信息");
                            }
                            pallet.Status = "0";
                            await Db.Updateable(pallet).ExecuteCommandAsync();
                        }
                        //修改出库单明细拣货数量
                        noticeDetail.CompleteQty += pickQty;
                        await Db.Updateable(noticeDetail).ExecuteCommandAsync();
                        var num = await Db.Queryable<BllExportNoticeDetail>()
                            .CountAsync(m => m.IsDel == "0" && m.SONo == soNo && m.CompleteQty < m.Qty);
                        if (num <= 0)
                        {
                            notice.Status = "4"; //更改为执行完成
                                                 //修改出库单信息
                            await Db.Updateable(notice).ExecuteCommandAsync();
                            if (notice.IsWave == "1")
                            {
                                var waveNum = await Db.Queryable<BllExportNotice>()
                                    .CountAsync(m => m.IsDel == "0" && m.WaveNo == notice.WaveNo && m.Status != "4");
                                if (waveNum == 0)
                                {
                                    var wave = await Db.Queryable<BllWaveMage>().FirstAsync(m => m.IsDel == "0" && m.WaveNo == notice.WaveNo);
                                    if (wave != null)
                                    {
                                        wave.Status = "4";
                                        wave.UpdateUser = userId;
                                        wave.UpdateTime = DateTime.Now;
                                        await Db.Updateable(wave).ExecuteCommandAsync();
                                    }
                                }
                            }
                        }
@@ -3669,7 +4197,7 @@
            {
                throw Oops.Bah("未获取到对应储位信息,请检查!");
            }
            if (locat.Status != "3")
            if (locat.Status != "1")
            {
                throw Oops.Bah("当前储位不是有物品,请检查!");
            }
@@ -3752,7 +4280,7 @@
                #region 添加出库操作日志记录信息
                //添加操作日志记录
                var k = new OperationSOServer().AddLogOperationSo("出库作业", "拣货明细", soNo, "完成", $"用PDA完成了单据号为{soNo}的平库出库", userId);
                var k = new OperationSOServer().AddLogOperationSo("出库作业", "拣货明细", palletNo, "完成", $"用PDA完成了托盘号为{palletNo}的平库出库", userId);
                #endregion
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -948,6 +948,7 @@
                    WaveNo = a.WaveNo,
                    IsDespatch = a.IsDespatch,
                    Demo = a.Demo,
                    OrderCode = a.OrderCode,
                    CreateUserName = c.RealName,
                    UpdateUserName = c.RealName,
@@ -1067,10 +1068,10 @@
                        inspectStatus = "0,1";
                        break;
                    case "9"://生产领料出库
                        if (house != "W02")
                        {
                            throw new Exception("生产领料出库只能选择原料库");
                        }
                        //if (house != "W02")
                        //{
                        //    throw new Exception("生产领料出库只能选择原料库");
                        //}
                        skuType = "(0,1,3)";
                        inspectStatus = "1";
                        break;
@@ -1187,10 +1188,10 @@
                switch (model.WareHouseNo)
                {
                    case "W01"://成品库
                        if (skuList.Any(m => m.Type != "2"))
                        {
                            throw new Exception("仓库与出库物料不符");
                        }
                        //if (skuList.Any(m => m.Type != "2"))
                        //{
                        //    throw new Exception("仓库与出库物料不符");
                        //}
                        break;
                    case "W02"://原料库
                        if (skuList.Any(m => m.Type == "2"))
@@ -1830,9 +1831,9 @@
                {
                    throw new Exception("未查询到出库单据信息");
                }
                if (notice.Origin != "WMS" || notice.Status != "0")
                if (notice.Status != "0")//notice.Origin != "WMS" ||
                {
                    throw new Exception("参数异常,请检查状态是否未等待执行或来源是否是WMS");
                    throw new Exception("参数异常,请检查状态是否未等待执行");
                }
                //总库存信息
@@ -3338,6 +3339,22 @@
                throw new Exception(e.Message);
            }
        }
        public string GetHouseByPalletNo(string palletNo)
        {
            try
            {
                var datail = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.PalletNo == palletNo);
                if (datail == null)
                {
                    throw new Exception("未查询到托盘信息");
                }
                return datail.WareHouseNo;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        public List<OutCommandDto> IssueOutHouseLk(string soNo, string outMode, int userId, string url, out string str)
        {
Wms/WMS.BLL/DataServer/DataBoxInfoServer.cs
@@ -186,7 +186,7 @@
        public List<AdventBoxInfoDto> GetEmergencyWarning(string skuNo, string skuName, string lotNo, string palletNo, string status, string inspectMark, string inspectStatus)
        {
            string str = @" select d.WareHouseName,d.WareHouseNo,e.RoadwayName,e.RoadwayNo,f.AreaName,f.AreaNo,c.LocatNo,a.PalletNo,
                             a.SkuNo,a.SkuName,SUM(a.Qty) as Qty,a.Standard,a.LotNo,a.SupplierLot,a.ProductionTime,a.Status
                             a.SkuNo,a.SkuName,SUM(a.Qty) as Qty,a.Standard,a.LotNo,a.SupplierLot,a.ProductionTime,a.Status,c.ExpirationTime
                             from DataBoxInfo a
                             left join SysMaterials b on a.SkuNo = b.SkuNo 
                             left join DataStockDetail c on a.StockDetailId = c.Id
@@ -230,7 +230,7 @@
                str += " and a.InspectStatus = @inspectstatus";
            }
            //排序
            str += @" group by d.WareHouseName,d.WareHouseNo,e.RoadwayName,e.RoadwayNo,f.AreaName,f.AreaNo,c.LocatNo,a.PalletNo,a.SkuNo,a.SkuName,a.Standard,a.LotNo,a.SupplierLot,a.ProductionTime,a.Status order by a.SkuNo,a.LotNo ";
            str += @" group by d.WareHouseName,d.WareHouseNo,e.RoadwayName,e.RoadwayNo,f.AreaName,f.AreaNo,c.LocatNo,a.PalletNo,a.SkuNo,a.SkuName,a.Standard,a.LotNo,a.SupplierLot,a.ProductionTime,a.Status,c.ExpirationTime order by a.SkuNo,a.LotNo ";
            List<AdventBoxInfoDto> stockList = Db.Ado.SqlQuery<AdventBoxInfoDto>(str, new
            {
                skuno = skuNo, //物料号
Wms/WMS.BLL/HttpServer.cs
@@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Utility.Tools;
using WMS.BLL.Logic;
using WMS.BLL.LogServer;
@@ -1992,7 +1993,64 @@
                throw new Exception(e.Message);
            }
        }
        /// <summary>
        /// PDA平库下发出库
        /// </summary>
        /// <param name="soNo"></param>
        /// <param name="detailId"></param>
        /// <param name="palletNo"></param>
        /// <param name="userId"></param>
        /// <exception cref="Exception"></exception>
        public void IssueOutHousePk(string soNo, string detailId, string palletNo, int userId)
        {
            try
            {
                var notice = Db.Queryable<BllExportNotice>().First(m => m.SONo == soNo && m.IsDel == "0");
                if (notice == null)
                {
                    throw new Exception($"未找到{soNo}出库单信息");
                }
                var detail=Db.Queryable<DataStockDetail>().First(m => m.PalletNo == palletNo && m.IsDel == "0");
                if (detail.WareHouseNo != "W04")
                {
                    throw new Exception("仓库号错误");
                }
                var intDetailId = int.Parse(detailId);
                if (intDetailId <= 0)
                {
                    throw new Exception("选择的出库单明细参数错误");
                }
                //开启事务
                Db.BeginTran();
                notice.Status = "3";//正在进行
                Db.Updateable(notice).ExecuteCommand();
                //所有要出库的出库分配信息(未下发的信息和待拣货的信息)
                var allot = Db.Queryable<BllExportAllot>().Where(a => a.IsDel == "0" && a.PalletNo == palletNo && a.Status == "0").ToList();
                if (allot == null || allot.Count <= 0) //判断是否有需要下发的出库流水
                {
                    throw new Exception("当前出库单据无需要下发的托盘");
                }
                //出库流水(更改状态)
                foreach (var item in allot)
                {
                    item.Status = "2";
                    Db.Updateable(item).ExecuteCommand();
                }
                //添加操作日志记录
                var k = new OperationSOServer().AddLogOperationSo("PDA模块", "下发出库", soNo, "出库", $"点击出库按钮出库单号为:{soNo}的出库单", userId);
                //提交事务
                Db.CommitTran();
            }
            catch (Exception e)
            {
                //回滚事务
                Db.RollbackTran();
                throw new Exception(e.Message);
            }
        }
        #region MyRegion
Wms/WMS.BLL/SysServer/StorageAreaServer.cs
@@ -155,24 +155,35 @@
                    return str;
                }
                //获取立体库最大编码
                var area = Db.Queryable<SysStorageArea>().Where(a => a.IsDel == "0").OrderByDescending(a=>a.CreateTime).First();
                //验证是否存在区域信息
                if (area == null)
                var area = new SysStorageArea();
                string areaStr = "A";
                if (model.WareHouseNo == "W04")
                {
                    model.AreaNo = "A01";
                    area = Db.Queryable<SysStorageArea>().Where(a => a.IsDel == "0" && a.WareHouseNo == "W04").OrderByDescending(a => a.CreateTime).First();
                    areaStr = "B";
                }
                else
                {
                    var arr = area.AreaNo.Split("A");
                    area = Db.Queryable<SysStorageArea>().Where(a => a.IsDel == "0" && (a.WareHouseNo == "W01" || a.WareHouseNo == "W02")).OrderByDescending(a => a.CreateTime).First();
                }
                //验证是否存在区域信息
                if (area == null)
                {
                    model.AreaNo = $"{areaStr}01";
                }
                else
                {
                    var arr = area.AreaNo.Split(areaStr);
                    int a = int.Parse(arr[1]) + 1;
                    //判断是否小于10
                    if (a < 10)
                    {
                        model.AreaNo = "A0" + (int.Parse(arr[1]) + 1).ToString();
                        model.AreaNo = $"{areaStr}0" + (int.Parse(arr[1]) + 1).ToString();
                    }
                    else
                    {
                        model.AreaNo = "A" + (int.Parse(arr[1]) + 1).ToString();
                        model.AreaNo = $"{areaStr}" + (int.Parse(arr[1]) + 1).ToString();
                    }
                }
Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs
@@ -175,6 +175,8 @@
        /// <returns>出库单的仓库号</returns>
        string GetHouseBySo(string soNo);
        string GetHouseByPalletNo(string palletNo);
        /// <summary>
        /// 下发出库 立库
        /// </summary>
Wms/WMS.IBLL/IHttpServer.cs
@@ -91,6 +91,16 @@
        /// <param name="str"></param>
        /// <returns></returns>
        List<OutCommandDto> IssueOutHouseLk(string soNo, string detailId, string outMode, string palletNo, int userId, string url, out string str);
        /// <summary>
        /// PDA平库下发出库
        /// </summary>
        /// <param name="soNo"></param>
        /// <param name="detailId"></param>
        /// <param name="palletNo"></param>
        /// <param name="userId"></param>
        /// <exception cref="Exception"></exception>
        void IssueOutHousePk(string soNo, string detailId, string palletNo, int userId);
        #endregion
Wms/WMS.IBLL/IPdaServer/IPdaCrServer.cs
@@ -110,6 +110,13 @@
        /// <returns></returns>
        Task<List<SysStorageArea>> GetStorageArea(string palletNo);
        /// <summary>
        /// 根据区域号获取储位地址集合
        /// </summary>
        /// <param name="areaNo"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        List<string> GetLocatByArea(string areaNo);
        /// <summary>
        /// 获取已分配的出库单据
        /// </summary>
        /// <returns></returns>
@@ -133,7 +140,7 @@
        /// <param name="areaNo"></param>
        /// <param name="ruku"></param>
        /// <param name="url"></param>
        Task AgvTransport(string palletNo, string areaNo, string ruku, string url, int userId);
        Task AgvTransport(string palletNo, string areaNo, string locatNoEnd, string ruku, string url, int userId);
        /// <summary>
        /// 呼叫agv转运空托盘
        /// </summary>
Wms/WMS.IBLL/IPdaServer/IPdaSoServer.cs
@@ -122,7 +122,14 @@
        /// <param name="boxNo3">支/袋码</param>
        /// <returns></returns>
        Task<List<BoxInfo>> GetDataComBoxInfo(string soDetailId, string palletNo, string boxNo, string boxNo3);
        /// <summary>
        /// 出库拣货获取扫描标签数量
        /// </summary>
        /// <param name="palletNo"></param>
        /// <param name="boxNo"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        decimal CheckBoxForPick(string palletNo, string boxNo);
        /// <summary>
        /// 获取库内无箱码的托盘分配信息
        /// </summary>
@@ -154,6 +161,17 @@
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        Task SoSetPick34(string soNo, string soDetailId, string palletNo, string boxNo, string pickQty1, int userId);
        /// <summary>
        /// 成品出库pda拣货-JC34
        /// </summary>
        /// <param name="soNo"></param>
        /// <param name="soDetailId"></param>
        /// <param name="palletNo"></param>
        /// <param name="boxNoList"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        Task SoSetPickCode34(string soNo, string soDetailId, string palletNo, List<string> boxNoList, int userId);
        /// <summary>
        /// 出库pda拣货
Wms/Wms/Controllers/DownApiController.cs
@@ -174,23 +174,38 @@
                {
                    return Ok(new HttpReturnModel { Success = "-1", Message = "未获取到当前操作人信息"});
                }
                //验证出库口
                if (string.IsNullOrWhiteSpace(outMode))
                {
                    return Ok(new HttpReturnModel { Success = "-1", Message = "请选择出库地址" });
                }
                var house = _exNoticeSvc.GetHouseBySo(soNo);
                if (house != "W01")
                {
                    house= _exNoticeSvc.GetHouseByPalletNo(palletNo);
                }
                if (house == "W01")
                {
                    //验证出库口
                    if (string.IsNullOrWhiteSpace(outMode))
                    {
                        return Ok(new HttpReturnModel { Success = "-1", Message = "请选择出库地址" });
                    }
                    //var list = _exNoticeSvc.IssueOutHouseMk(soNo, outMode, int.Parse(userId), _config.WcsHost + _config.IssueComApiUrl, out string str);
                    return Ok(new HttpReturnModel { Success = "0", Message = "str", Data = "list" });
                }
                else if (house == "W02")
                {
                    var list = _http.IssueOutHouseLk(soNo,soDetailId, outMode,palletNo, int.Parse(userId), _config.WcsHost + _config.IssueComApiUrl, out string str);
                    //验证出库口
                    if (string.IsNullOrWhiteSpace(outMode))
                    {
                        return Ok(new HttpReturnModel { Success = "-1", Message = "请选择出库地址" });
                    }
                    var list = _http.IssueOutHouseLk(soNo, soDetailId, outMode, palletNo, int.Parse(userId), _config.WcsHost + _config.IssueComApiUrl, out string str);
                    return Ok(new HttpReturnModel { Success = "0", Message = str, Data = list});
                    return Ok(new HttpReturnModel { Success = "0", Message = str, Data = list });
                }
                else if (house == "W04")
                {
                    _http.IssueOutHousePk(soNo, soDetailId, palletNo, int.Parse(userId));
                    return Ok(new HttpReturnModel { Success = "0", Message = "下发成功" });
                }
                else
                {
Wms/Wms/Controllers/PdaCrController.cs
@@ -19,6 +19,7 @@
using Microsoft.Extensions.Options;
using Model.ModelDto.DataDto;
using Model.ModelDto;
using Model.ModelVm.BllSoVm;
namespace Wms.Controllers
{
@@ -237,7 +238,26 @@
        [UnitOfWork]
        public async Task AgvTransport(PdaAgvTransportVm model)
        {
            await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.Ruku, _config.WcsHost+ _config.IssueComApiUrl, _userManager.UserId);
            await _pdaCrSvc.AgvTransport(model.PalletNo, model.AreaNo, model.LocatNoEnd, model.Ruku, _config.WcsHost + _config.IssueComApiUrl, _userManager.UserId);
        }
        /// <summary>
        /// 根据区域号获取储位地址集合
        /// </summary>
        /// <param name="areaNo"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetLocatByArea(string areaNo)
        {
            try
            {
                var _list = _pdaCrSvc.GetLocatByArea(areaNo);
                return Ok(new { code = 0, count = 0, msg = "获取成功", data = _list });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <summary>
        /// 呼叫agv转运空托盘
Wms/Wms/Controllers/PdaSoController.cs
@@ -153,6 +153,27 @@
        }
        /// <summary>
        /// 出库拣货获取扫描标签数量
        /// </summary>
        /// <param name="palletNo"></param>
        /// <param name="boxNo"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult CheckBoxForPick(string palletNo, string boxNo)
        {
            try
            {
                var boxNum = _pdaSoSvc.CheckBoxForPick(palletNo, boxNo);
                return Ok(new { code = 0, msg = "拣货明细信息", data = boxNum });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <summary>
        /// 出库pda拣货
        /// </summary>
        /// <param name="model">SoDetailId:出库单明细ID、PalletNo:托盘码</param> 
@@ -163,6 +184,16 @@
            //await _pdaSoSvc.SoSetPick(model.SoNo, model.SoDetailId, model.PalletNo, model.BoxNo, model.BoxNo3, model.PickQty, _userManager.UserId);
            await _pdaSoSvc.SoSetPick34(model.SoNo, model.SoDetailId, model.PalletNo, model.BoxNo, model.PickQty, _userManager.UserId);
        }
        /// <summary>
        /// 成品出库pda拣货-JC34
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task SoSetPickCode(PdaSoVm model)
        {
            await _pdaSoSvc.SoSetPickCode34(model.SoNo, model.SoDetailId, model.PalletNo, model.BoxNoList, _userManager.UserId);
        }
        /// <summary>
        /// 出库pda拣货