#
18516761980
2022-05-30 1baeb88125f264fa1949a17a83a2c83182f79499
#
4个文件已修改
178 ■■■■ 已修改文件
src/main/java/com/zy/common/web/WcsController.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/salesOrder/salsesOrder.js 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/salesOrder/salesOrder.html 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/WcsController.java
@@ -43,11 +43,22 @@
        JSONObject jsonObject1 = new JSONObject();
        JSONArray jsonArray = new JSONArray();
        for (InterData interData : list) {
            //查询对应入库通知档信息
            Wrapper wrapper = new EntityWrapper<WaitPakin>().eq("supplier", interData.getFBillNo()).eq("matnr", interData.getFnumber());
            WaitPakin waitPakin = waitPakinService.selectOne(wrapper);
            if ((interData.getIoType() == 1 && interData.getMatType() == 1) || (interData.getIoType() == 2 && interData.getMatType() == 2)) {
            //原材料入庫
            if ((interData.getIoType() == 1 && interData.getMatType() == 1)) {
                //查询对应入库通知档信息
                Wrapper wrapper = new EntityWrapper<WaitPakin>().eq("supplier", interData.getFBillNo()).eq("matnr", interData.getFnumber());
                WaitPakin waitPakin = waitPakinService.selectOne(wrapper);
                if(Cools.isEmpty(waitPakin)){
                    JSONObject object = new JSONObject();
                    object.put("FInterID", interData.getFInterID());
                    object.put("Fnumber", interData.getFnumber());
                    object.put("code", 500);
                    object.put("msg", "单据不存在或单据已被删除");
                    jsonArray.add(object);
                    continue;
                }
                if (Cools.isEmpty(waitPakin)) {
                    JSONObject object = new JSONObject();
                    object.put("FInterID", interData.getFInterID());
@@ -57,8 +68,10 @@
                    jsonArray.add(object);
                    continue;
                }
                //判断是否有出库动作   "N"没有  “Y”有
                if (waitPakin.getIoStatus().equals("N")) {
                //判断是否有入库动作   "N"没有  “Y”有
//                interData.getFQty().compareTo(waitPakin.getAnfme())
                if (waitPakin.getIoStatus().equals("N") && waitPakin.getAnfme() < interData.getFQty().doubleValue() ) {
                    //判断传入的数量是否为0来执行删除或者修改
                    if (interData.getFQty().compareTo(BigDecimal.ZERO) == 0) {
                        waitPakinService.delete(wrapper);
@@ -89,6 +102,68 @@
                }
            }
            //成品入庫
            if (interData.getIoType() == 2 && interData.getMatType() == 2) {
                //查询对应入库通知档信息
                Wrapper wrapper = new EntityWrapper<WaitPakin>().eq("supplier", interData.getFBillNo()).eq("matnr", interData.getFnumber());
                WaitPakin waitPakin = waitPakinService.selectOne(wrapper);
                if(Cools.isEmpty(waitPakin)){
                    JSONObject object = new JSONObject();
                    object.put("FInterID", interData.getFInterID());
                    object.put("Fnumber", interData.getFnumber());
                    object.put("code", 500);
                    object.put("msg", "单据不存在或单据已被删除");
                    jsonArray.add(object);
                    continue;
                }
                if (Cools.isEmpty(waitPakin)) {
                    JSONObject object = new JSONObject();
                    object.put("FInterID", interData.getFInterID());
                    object.put("Fnumber", interData.getFnumber());
                    object.put("code", 500);
                    object.put("msg", "单据不存在或单据已被删除");
                    jsonArray.add(object);
                    continue;
                }
                WaitPakin one = waitPakinService.selectOne(new EntityWrapper<WaitPakin>()
                        .eq("supplier", interData.getFBillNo())
                        .eq("matnr", interData.getFnumber())
                        .isNotNull("zpallet"));
                //判断是否有入库动作   "N"没有  “Y”有
                if (waitPakin.getIoStatus().equals("N") && Cools.isEmpty(one)) {
                    //判断传入的数量是否为0来执行删除或者修改
                    if (interData.getFQty().compareTo(BigDecimal.ZERO) == 0) {
                        waitPakinService.delete(wrapper);
                        JSONObject object = new JSONObject();
                        object.put("Fnumber", interData.getFnumber());
                        object.put("FInterID", interData.getFInterID());
                        object.put("code", 200);
                        object.put("msg", "删除成功");
                        jsonArray.add(object);
                    } else {
                        waitPakin.setAnfme(interData.getFQty().doubleValue());
                        waitPakinService.update(waitPakin, wrapper);
                        JSONObject object = new JSONObject();
                        object.put("Fnumber", interData.getFnumber());
                        object.put("FInterID", interData.getFInterID());
                        object.put("code", 200);
                        object.put("msg", "修改成功");
                        jsonArray.add(object);
                    }
                } else {
                    JSONObject object = new JSONObject();
                    object.put("FInterID", interData.getFInterID());
                    object.put("Fnumber", interData.getFnumber());
                    object.put("code", 500);
                    object.put("msg", "已在入库中,无法取消");
                    jsonArray.add(object);
                }
            }
            //成品出庫
            if (interData.getIoType() == 3) {
                Wrapper wrapper1 = new EntityWrapper<OutStockBillEntry>().eq("FInterID", interData.getFInterID()).and().eq("Fnumber", interData.getFnumber());
                OutStockBillEntry outStockBillEntry = outStockService.selectOne(wrapper1);
@@ -114,6 +189,7 @@
                        jsonArray.add(object);
                    } else {
                        outStockBillEntry.setFAuxQty(interData.getFQty());
                        outStockBillEntry.setFQty(interData.getFQty());
                        outStockService.update(outStockBillEntry, wrapper1);
                        JSONObject object = new JSONObject();
                        object.put("Fnumber", interData.getFnumber());
src/main/resources/application.yml
@@ -45,7 +45,7 @@
erp:
  db:
    driver_class_name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    ur: jdbc:sqlserver://localhost:1433;databasename=xtyasrs_dual
    ur: jdbc:sqlserver://192.168.4.23:1433;databasename=xtyasrs_dual
    #    ur: jdbc:sqlserver://192.168.4.208:1433;databasename=xtyasrs_dual
    username: sa
    password: sa@123
src/main/webapp/static/js/salesOrder/salsesOrder.js
@@ -17,7 +17,10 @@
        , {field: 'inQty', align: 'center', title: '入库数量', width: 110}
        , {field: 'disQty', align: 'center', title: '通知单', width: 110}
        , {field: 'outQty', align: 'center', title: '出库数量', width: 110}
        , {field: 'invoiceQty', align: 'center', title: '开票数量'}
        , {field: 'unInvoiceQty', align: 'center', title: '未开票数量'}
        , {field: 'deliveryDate', align: 'center', title: '交货日期'}
        , {field: 'personName', align: 'center', title: '业务员'}
    );
    return cols;
}
@@ -94,18 +97,13 @@
/* 表格数据重载 */
function tableReload(child) {
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function () {
        if (this.name == 'orderCode') {
            searchData.orderCode = this.value;
        }
    $.each($('#search-box [name]').serializeArray(), function() {
        searchData[this.name] = this.value;
        if (this.name == 'orderTime') {
            searchData.startTime = this.value.substring(0, 10);
            searchData.endTime = this.value.substring(13, this.value.length);
        }
    });
    console.log(searchData);
    (child ? parent.tableIns : tableIns).reload({
        where: searchData,
        page: {
@@ -113,24 +111,61 @@
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl + "/";
                top.location.href = baseUrl+"/";
            }
            pageCurr = curr;
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr - 1
                        curr: pageCurr-1
                    }
                });
                pageCurr -= 1;
            }
            limit(child);
            // 当前分页数据存储
            locNormalList = res.data;
            // limit(child);
        }
    });
}
// function tableReload(child) {
//     var searchData = {};
//     $.each($('#search-box [name]').serializeArray(), function () {
//         if (this.name == 'orderCode') {
//             searchData.orderCode = this.value;
//         }
//         if (this.name == 'orderTime') {
//             searchData.startTime = this.value.substring(0, 10);
//             searchData.endTime = this.value.substring(13, this.value.length);
//         }
//     });
//
//     console.log(searchData);
//
//     (child ? parent.tableIns : tableIns).reload({
//         where: searchData,
//         page: {
//             curr: pageCurr
//         },
//         done: function (res, curr, count) {
//             if (res.code === 403) {
//                 top.location.href = baseUrl + "/";
//             }
//             pageCurr = curr;
//             if (res.data.length === 0 && count !== 0) {
//                 tableIns.reload({
//                     where: searchData,
//                     page: {
//                         curr: pageCurr - 1
//                     }
//                 });
//                 pageCurr -= 1;
//             }
//             // limit(child);
//             // 当前分页数据存储
//             locNormalList = res.data;
//         }
//     });
// }
/* 监听回车事件 */
$('body').keydown(function () {
src/main/webapp/views/salesOrder/salesOrder.html
@@ -50,6 +50,31 @@
                <input class="layui-input" type="text" name="orderCode" placeholder="订单号" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="invCode" placeholder="物料编码" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="invName" placeholder="物料名称" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="invStd" placeholder="规格型号" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="personName" placeholder="业务员" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off">
            </div>
        </div>
        <!-- 日期范围 -->
        <div class="layui-inline" style="width: 300px">