王佳豪
2021-05-05 4c4b488961660194d75e910e476ede81e6061b3d
1.立库、平库入库修改功能调整,生产单号列前置
2.erp对接功能微调
7个文件已修改
142 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/LocNormalServiceImpl.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/erp/ErpService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocNormalMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locNormal/locNormalIn.js 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/outStock.js 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/pakStore.js 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locNormal/locNormalIn.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocNormalServiceImpl.java
@@ -64,11 +64,11 @@
                        CPICMO cpicmo = select.get(0);
                        boolean complete = false;
                        if (cpicmo.getFQty() > 0) {
                            if (cpicmo.getFAuxCommitQty() >= cpicmo.getFQty()) {
                            if (cpicmo.getFAuxCommitQty() == cpicmo.getFQty()) {
                                complete = true;
                            }
                        } else {
                            if (cpicmo.getFAuxCommitQty() >= cpicmo.getFAuxQty()) {
                            if (cpicmo.getFAuxCommitQty() == cpicmo.getFAuxQty()) {
                                complete = true;
                            }
                        }
@@ -96,6 +96,36 @@
    @Override
    public void pdaLocNormalIn(List<LocNormal> list) {
        // 平仓入库后更新中间表数据,Fflag_finish改为1,表示平仓入库成功
        if (list.size() > 0) {
            for (Integer i = 0; i < list.size(); i++) {
                if (!Cools.isEmpty(list.get(i).getSupplier())) { // 存在入库单号的才进行erp更新
                    String sql = "update CPICMO set FAuxCommitQty = (FAuxCommitQty + {0,number,#}) where 1=1 and Fnumber = ''{1}'' and FBillNo = ''{2}''";
                    sql = MessageFormat.format(sql, list.get(i).getAnfme(), list.get(i).getMatnr(), list.get(i).getSupplier());
                    if (erpSqlServer.update(sql) > 0) {
                        sql = "select * from CPICMO where 1=1 and Fnumber = ''{0}'' and FBillNo = ''{1}''";
                        sql = MessageFormat.format(sql, list.get(i).getMatnr(), list.get(i).getSupplier());
                        List<CPICMO> select = erpSqlServer.select(sql, CPICMO.class);
                        CPICMO cpicmo = select.get(0);
                        boolean complete = false;
                        if (cpicmo.getFQty() > 0) {
                            if (cpicmo.getFAuxCommitQty() == cpicmo.getFQty()) {
                                complete = true;
                            }
                        } else {
                            if (cpicmo.getFAuxCommitQty() == cpicmo.getFAuxQty()) {
                                complete = true;
                            }
                        }
                        if (complete) {
                            if (!completeCPakIn(list.get(i).getSupplier(), list.get(i).getMatnr())) {
                                log.error("{}平仓入库单标记完成失败", list.get(i).getSupplier());
                            }
                        }
                    }
                }
            }
        }
        baseMapper.pdaLocNormalIn(list);
    }
src/main/java/com/zy/common/service/erp/ErpService.java
@@ -154,11 +154,11 @@
            CPICMO cpicmo = select.get(0);
            boolean complete = false;
            if (cpicmo.getFQty() > 0) {
                if (cpicmo.getFAuxCommitQty() >= cpicmo.getFQty()) {
                if (cpicmo.getFAuxCommitQty() == cpicmo.getFQty()) {
                    complete = true;
                }
            } else {
                if (cpicmo.getFAuxCommitQty() >= cpicmo.getFAuxQty()) {
                if (cpicmo.getFAuxCommitQty() == cpicmo.getFAuxQty()) {
                    complete = true;
                }
            }
src/main/resources/mapper/LocNormalMapper.xml
@@ -47,11 +47,11 @@
    <insert id="locNormalIn">
        BEGIN
        <foreach collection="list" item="item" index="index">
            INSERT INTO asr_loc_normal (matnr, maktx, anfme, altme, lgnum, type, supplier, brand, warehouse, state,
            INSERT INTO asr_loc_normal (matnr, maktx, anfme, altme, lgnum, type, mnemonic, supplier, brand, warehouse, state,
            appe_user, appe_time)
            VALUES (#{item.matnr,jdbcType=VARCHAR}, #{item.maktx,jdbcType=VARCHAR}, #{item.anfme,jdbcType=DECIMAL},
            #{item.altme,jdbcType=VARCHAR},#{item.lgnum, jdbcType=VARCHAR}, #{item.type, jdbcType=VARCHAR},
            #{item.supplier, jdbcType=VARCHAR},#{item.brand, jdbcType=VARCHAR},
            #{item.mnemonic, jdbcType=VARCHAR} ,#{item.supplier, jdbcType=VARCHAR},#{item.brand, jdbcType=VARCHAR},
            #{item.warehouse,jdbcType=VARCHAR}, '1', #{item.appeUser,jdbcType=DECIMAL},
            #{item.appeTime,jdbcType=TIMESTAMP})
        </foreach>
src/main/webapp/static/js/locNormal/locNormalIn.js
@@ -15,12 +15,17 @@
            style: 'color: blue;font-weight: bold'
        }
    ];
    locNormalCols.map(function (item) {
        if (item.field === 'supplier' || item.field === 'mnemonic') {
            item.edit = 'text';
        }
    })
    cols.push.apply(cols, locNormalCols);
    var locNormalColsSelf = [
        {field: 'mnemonic', align: 'center',title: '生产单号', edit: 'text'}
        ,{field: 'matnr', align: 'center',title: '物料编码'}
        ,{field: 'maktx', align: 'center',title: '物料名称', width: 400}
        ,{field: 'lgnum', align: 'center',title: '规格'}
        ,{field: 'type', align: 'center',title: '物料类别'}
        ,{field: 'supplier', align: 'center',title: '通知单号', edit: 'text'}
        ,{field: 'brand', align: 'center',title: '品牌', hide: true}
        ,{field: 'altme', align: 'center',title: '单位', hide: true}
    ];
    cols.push.apply(cols, locNormalColsSelf);
    // cols.push({field: 'matStatus', title: '物料状态', align: 'center', width: 120, templet: '#matStatus'});
    cols.push({fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 80});
    return cols;
@@ -54,6 +59,9 @@
        if (obj.field === 'anfme') {
            updateMatCodeData(obj.data.matnr, Number(obj.value), obj.data.index);
        }
        if (obj.field === 'supplier' || obj.field === 'mnemonic') {
            updateMatCodeData2(obj.data.matnr, obj.value, obj.data.index, obj.field);
        }
    });
    // 监听头工具栏事件
@@ -75,6 +83,10 @@
                    }
                    if (matCodeData[i].anfme === 0) {
                        layer.msg("数量不能为零");
                        return;
                    }
                    if (matCodeData[i].mnemonic == null || matCodeData[i].mnemonic == '' || matCodeData[i].mnemonic == undefined) {
                        layer.msg("请输入生产单号");
                        return;
                    }
                }
@@ -163,6 +175,18 @@
        });
    }
    function updateMatCodeData2(matnr, value, index, field) {
        for (var i = 0; i < matCodeData.length; i++) {
            if (matCodeData[i]["matnr"] === matnr && matCodeData[i]["index"] === index) {
                matCodeData[i][field] = value;
            }
        }
        tableIns.reload({
            data: matCodeData,
        });
    }
    // 获取可用入库站点
    function getInBound() {
        // 获取仓库下拉
src/main/webapp/static/js/pakStore/outStock.js
@@ -6,20 +6,20 @@
function getCol() {
    var cols = [];
    cols.push(
        {field: 'fbillNo', merge: true, align: 'center', title: '单据编号'}
        , {field: 'fsourceBillNo', align: 'center', title: '订单单号' }
        , {field: 'fnumber', align: 'center', title: '物料编号'}
        {field: 'fbillNo', merge: true, align: 'center', title: '单据编号', width: 150}
        , {field: 'fsourceBillNo', align: 'center', title: '订单单号', width: 100}
        , {field: 'fnumber', align: 'center', title: '物料编号', width: 140}
        , {field: 'fname', align: 'center', title: '物料名称'}
        , {field: 'fmodel', align: 'center', title: '规格'}
        , {field: 'fentryID', align: 'center', title: '分录号'}
        , {field: 'fmodel', align: 'center', title: '规格', width: 200}
        , {field: 'fentryID', align: 'center', title: '分录号', width: 80}
        , {field: 'forderInterID', align: 'center', title: '单据编号', hide: true}
        , {field: 'fauxQty', align: 'center', title: '数量'}
        , {field: 'fcommitQty', align: 'center', title: '发货数量'}
        , {field: 'fauxPrice', align: 'center', title: '单价'}
        , {field: 'fauxQty', align: 'center', title: '数量', width: 100}
        // , {field: 'fcommitQty', align: 'center', title: '发货数量'}
        , {field: 'fauxPrice', align: 'center', title: '单价', width: 100}
        , {field: 'fdate', align: 'center', title: '日期', hide: true}
        , {field: 'fnote', align: 'center', title: '备注', hide: true}
        , {field: 'fadd', align: 'center', title: '地址', hide: true}
        , {merge: ['fbillNo'], title: '操作', align: 'center', toolbar: '#operate', width: 140}
        , {merge: ['fbillNo'], title: '操作', align: 'center', toolbar: '#operate', width: 160}
    );
    return cols;
}
src/main/webapp/static/js/pakStore/pakStore.js
@@ -14,13 +14,24 @@
            style: 'color: blue;font-weight: bold'
        }
    ];
    matCols.map(function (item) {
        if (item.field === 'str6' || item.field === 'str5') {
            item.edit = 'text';
            item.style = 'color: blue;font-weight: bold';
        }
    })
    cols.push.apply(cols, matCols);
    var matColsSelf = [
        {field: 'str5', align: 'center',title: '生产单号', edit: 'text'}
        ,{field: 'matNo', align: 'center',title: '物料编码'}
        ,{field: 'barcode', align: 'center',title: '条形码', hide: true}
        ,{field: 'matName', align: 'center',title: '物料名称', width: 500}
        ,{field: 'str2', align: 'center',title: '物料类别'}
        ,{field: 'str3', align: 'center',title: '规格型号'}
        ,{field: 'str1', align: 'center',title: '基本单位', hide: true}
        ,{field: 'str4', align: 'center',title: '状态', hide: true}
        ,{field: 'str6', align: 'center',title: '通知单号', edit: 'text'}
        ,{field: 'str7', align: 'center',title: '默认仓库', hide: true}
        ,{field: 'str17', align: 'center',title: '可采购', hide: true}
        ,{field: 'str18', align: 'center',title: '可为子件', hide: true}
        ,{field: 'str21', align: 'center',title: '成本计算方法', hide: true}
        ,{field: 'str22', align: 'center',title: '采购单位', hide: true}
        ,{field: 'str23', align: 'center',title: '销售单位', hide: true}
    ];
    cols.push.apply(cols, matColsSelf);
    cols.push({field: 'matStatus', title: '物料状态', align: 'center', width: 120, templet: '#matStatus'});
    cols.push({fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 80});
    return cols;
@@ -54,6 +65,9 @@
        if (obj.field === 'count') {
            updateMatCodeData(obj.data.matNo, Number(obj.value));
        }
        if (obj.field === 'str5' || obj.field === 'str6') {
            updateMatCodeData2(obj.data.matnr, obj.value, obj.data.index, obj.field);
        }
    });
    // 监听头工具栏事件
@@ -75,6 +89,10 @@
                    }
                    if (matCodeData[i].count === 0) {
                        layer.msg("数量不能为零");
                        return;
                    }
                    if (matCodeData[i].str5 == null || matCodeData[i].str5 == '' || matCodeData[i].str5 == undefined) {
                        layer.msg("请输入生产单号");
                        return;
                    }
                }
@@ -161,6 +179,18 @@
        });
    }
    function updateMatCodeData2(matnr, value, index, field) {
        for (var i = 0; i < matCodeData.length; i++) {
            if (matCodeData[i]["matnr"] === matnr && matCodeData[i]["index"] === index) {
                matCodeData[i][field] = value;
            }
        }
        tableIns.reload({
            data: matCodeData,
        });
    }
    // 获取可用入库站点
    function getInBound() {
        $.ajax({
src/main/webapp/views/locNormal/locNormalIn.html
@@ -95,7 +95,7 @@
                <select id="putSiteSelect" lay-verify="required">
                    <option value="">请选择库区</option>
                </select>
                <!-- 2.启动出库 -->
                <!-- 2.启动入库 -->
                <button class="layui-btn layui-btn-normal layui-btn-lg" id="btn-locIn" lay-event="comb">启动入库</button>
            </div>
        </div>