自动化立体仓库 - WMS系统
skyouc
2 天以前 2aa5cec3577cf0f935f074cd8283af669a07f54c
出入库测试修改
4个文件已修改
196 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/orderPakout/out.js 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/wrkMast/wrkMast.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -1483,7 +1483,6 @@
        LocMast locMasts = locMastService.selectOne(new EntityWrapper<LocMast>()
                .in("loc_no", locs)
                .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
                .eq("dev_no", basDevice.getDevNo())
                .orderAsc(Arrays.asList("loc_no"))
                .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
@@ -1494,9 +1493,8 @@
        List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locMasts.getLocNo(),1);
        //TODO 1. 获取入库站点, 目标库位  3. 将出库明细添加至入库明细
        Integer staNo = staNos.stream().findFirst().get();
        WrkMast wrkMast = new WrkMast();
        if (Objects.isNull(wrkMast.getWrkCode())) {
        if (Objects.isNull(outMast.getWrkCode())) {
            throw new CoolException("数据错误,上级任务编码为空!!");
        }
        String wrkCode;
@@ -1507,6 +1505,7 @@
        } else {
            throw new CoolException("数据错误,上级任务编码错误!!");
        }
        WrkMast wrkMast = new WrkMast();
        // 生成工作档
        wrkMast.setWrkNo(workNo);
        wrkMast.setWrkCode(wrkCode);
@@ -1550,7 +1549,7 @@
        } else {
            throw new CoolException(locMasts.getLocNo() + "目标库位已被占用");
        }
        List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrkNo", outMast.getWrkNo()));
        List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", outMast.getWrkNo()));
        if (Objects.isNull(wrkDetls) || wrkDetls.isEmpty()) {
            throw new CoolException("任务明细为空!!");
        }
src/main/resources/mapper/LocDetlMapper.xml
@@ -27,7 +27,7 @@
        <result column="item_num" property="itemNum" />
        <result column="safe_qty" property="safeQty" />
        <result column="weight" property="weight" />
        <result column="man_length" property="manLength" />
<!--        <result column="man_length" property="manLength" />-->
        <result column="volume" property="volume" />
        <result column="three_code" property="threeCode" />
        <result column="supp" property="supp" />
@@ -124,17 +124,17 @@
            <when test="batch != null and batch != ''">
                and a.batch = #{batch}
            </when>
            <otherwise>
                and (a.batch IS NULL OR a.batch = '')
            </otherwise>
<!--            <otherwise>-->
<!--                and (a.batch IS NULL OR a.batch = '')-->
<!--            </otherwise>-->
        </choose>
        <choose>
            <when test="brand != null and brand != ''">
                and a.brand = #{brand}
            </when>
            <otherwise>
                and (a.brand IS NULL OR a.brand = '')
            </otherwise>
<!--            <otherwise>-->
<!--                and (a.brand IS NULL OR a.brand = '')-->
<!--            </otherwise>-->
        </choose>
        <choose>
            <when test="standby1 != null and standby1 != ''">
@@ -148,41 +148,41 @@
            <when test="standby2 != null and standby2 != ''">
                and a.standby2 = #{standby2}
            </when>
            <otherwise>
                and (a.standby2 IS NULL OR a.standby2 = '')
            </otherwise>
<!--            <otherwise>-->
<!--                and (a.standby2 IS NULL OR a.standby2 = '')-->
<!--            </otherwise>-->
        </choose>
        <choose>
            <when test="standby3 != null and standby3 != ''">
                and a.standby3 = #{standby3}
            </when>
            <otherwise>
                and (a.standby3 IS NULL OR a.standby3 = '')
            </otherwise>
<!--            <otherwise>-->
<!--                and (a.standby3 IS NULL OR a.standby3 = '')-->
<!--            </otherwise>-->
        </choose>
        <choose>
            <when test="boxType1 != null and boxType1 != ''">
                and a.box_type1 = #{boxType1}
            </when>
            <otherwise>
                and (a.box_type1 IS NULL OR a.box_type1 = '')
            </otherwise>
<!--            <otherwise>-->
<!--                and (a.box_type1 IS NULL OR a.box_type1 = '')-->
<!--            </otherwise>-->
        </choose>
        <choose>
            <when test="boxType2 != null and boxType2 != ''">
                and a.box_type2 = #{boxType2}
            </when>
            <otherwise>
                and (a.box_type2 IS NULL OR a.box_type2 = '')
            </otherwise>
<!--            <otherwise>-->
<!--                and (a.box_type2 IS NULL OR a.box_type2 = '')-->
<!--            </otherwise>-->
        </choose>
        <choose>
            <when test="boxType3 != null and boxType3 != ''">
                and a.box_type3 = #{boxType3}
            </when>
            <otherwise>
                and (a.box_type3 IS NULL OR a.box_type3 = '')
            </otherwise>
<!--            <otherwise>-->
<!--                and (a.box_type3 IS NULL OR a.box_type3 = '')-->
<!--            </otherwise>-->
        </choose>
    </sql>
    <sql id="batchSeqNew">
src/main/webapp/static/js/orderPakout/out.js
@@ -4,7 +4,7 @@
    base: baseUrl + "/static/layui/lay/modules/"
}).extend({
    notice: 'notice/notice',
}).use(['table','laydate', 'form', 'util', 'admin', 'notice', 'treeTable', 'xmSelect', 'tableMerge', 'tableX'], function(){
}).use(['table', 'laydate', 'form', 'util', 'admin', 'notice', 'treeTable', 'xmSelect', 'tableMerge', 'tableX'], function () {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
@@ -21,7 +21,7 @@
    insTb2 = table.render({
        elem: '#orderDetlTable',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/order/pakout/orderDetl/pakout/list/auth',
        url: baseUrl + '/order/pakout/orderDetl/pakout/list/auth',
        page: true,
        limit: 15,
        limits: [15, 30, 50, 100, 200, 500],
@@ -30,19 +30,19 @@
        where: {order_id: 9999999999},
        cols: [[
            {type: 'checkbox'}
            ,{type: 'numbers', title: '#'}
            ,{field: 'orderNo', align: 'center',title: '单据编号', templet: '#orderNoTpl', width: 160}
            ,{field: 'matnr', align: 'center',title: '商品编码', width: 160}
            ,{field: 'maktx', align: 'center',title: '商品名称', width: 200}
            ,{field: 'standby1', align: 'center',title: '机台号'}
            ,{field: 'specs', align: 'center',title: '规格'}
            , {type: 'numbers', title: '#'}
            , {field: 'orderNo', align: 'center', title: '单据编号', templet: '#orderNoTpl', width: 160}
            , {field: 'matnr', align: 'center', title: '商品编码', width: 160}
            , {field: 'maktx', align: 'center', title: '商品名称', width: 200}
            , {field: 'standby1', align: 'center', title: '机台号'}
            , {field: 'specs', align: 'center', title: '规格'}
            // ,{field: 'anfme', align: 'center',title: '数量'}
            // ,{field: 'qty', align: 'center',title: '作业数量', style: 'font-weight: bold'}
            ,{field: 'enableQty', align: 'center',title: '待出数量', style: 'font-weight: bold'}
            , {field: 'enableQty', align: 'center', title: '待出数量', style: 'font-weight: bold'}
            // ,{field: 'name', align: 'center',title: '名称'}
            // ,{field: 'model', align: 'center',title: '型号'}
            ,{field: 'unit', align: 'center',title: '单位', hide: true}
            ,{field: 'barcode', align: 'center',title: '商品条码', hide: true}
            , {field: 'unit', align: 'center', title: '单位', hide: true}
            , {field: 'barcode', align: 'center', title: '商品条码', hide: true}
            // ,{field: 'supplier', align: 'center',title: '供应商'}
            // ,{field: 'unitPrice', align: 'center',title: '单价'}
            // ,{field: 'itemNum', align: 'center',title: '品项数'}
@@ -54,7 +54,7 @@
            // ,{field: 'updateBy$', align: 'center',title: '修改人员'}
            // ,{field: 'updateTime$', align: 'center',title: '修改时间'}
            // ,{field: 'memo', align: 'center',title: '备注'}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 160}
            , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 160}
        ]],
        request: {
            pageName: 'curr',
@@ -71,11 +71,11 @@
        response: {
            statusCode: 200
        },
        done: function(res, curr, count) {
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
                top.location.href = baseUrl + "/";
            }
            pageCurr=curr;
            pageCurr = curr;
            limit();
        }
    });
@@ -134,20 +134,20 @@
            success: function (res) {
                layer.close(loadIndex);
                var tableCache;
                if (res.code === 200){
                if (res.code === 200) {
                    layer.open({
                        type: 1
                        ,title: false
                        ,closeBtn: false
                        ,offset: '50px'
                        ,area: ['1200px', '700px']
                        ,shade: 0.5
                        ,shadeClose: false
                        ,btn: ['立即出库', '稍后处理']
                        ,btnAlign: 'c'
                        ,moveType: 1 //拖拽模式,0或者1
                        ,content: $('#pakoutPreviewBox').html()
                        ,success: function(layero, index){
                        , title: false
                        , closeBtn: false
                        , offset: '50px'
                        , area: ['1200px', '700px']
                        , shade: 0.5
                        , shadeClose: false
                        , btn: ['立即出库', '稍后处理']
                        , btnAlign: 'c'
                        , moveType: 1 //拖拽模式,0或者1
                        , content: $('#pakoutPreviewBox').html()
                        , success: function (layero, index) {
                            stoPreTabIdx = table.render({
                                elem: '#stoPreTab',
                                data: res.data,
@@ -160,11 +160,35 @@
                                    {field: 'orderNo', title: '单据编号', merge: true, align: 'center'},
                                    {field: 'title', title: '商品', merge: true, align: 'center', width: 350},
                                    {field: 'standby1', title: '机台号', align: 'center'},
                                    {field: 'anfme', title: '数量', align: 'center', width: 90, style: 'font-weight: bold'},
                                    {
                                        field: 'anfme',
                                        title: '数量',
                                        align: 'center',
                                        width: 90,
                                        style: 'font-weight: bold'
                                    },
                                    {field: 'locNo', title: '货位', align: 'center', width: 100, templet: '#locNoTpl'},
                                    {field: 'frozen$', title: '明细', align: 'center', width: 90, templet: '#locFrozen'},
                                    {field: 'frozenLoc$', title: '库位', align: 'center', width: 90, templet: '#locFrozenLoc'},
                                    {field: 'staNos', align: 'center', title: '出库站', merge: ['locNo'], templet: '#tbBasicTbStaNos'},
                                    {
                                        field: 'frozen$',
                                        title: '明细',
                                        align: 'center',
                                        width: 90,
                                        templet: '#locFrozen'
                                    },
                                    {
                                        field: 'frozenLoc$',
                                        title: '库位',
                                        align: 'center',
                                        width: 90,
                                        templet: '#locFrozenLoc'
                                    },
                                    {
                                        field: 'staNos',
                                        align: 'center',
                                        title: '出库站',
                                        merge: ['locNo'],
                                        templet: '#tbBasicTbStaNos'
                                    },
                                    {type: 'checkbox', merge: ['locNo']},
                                ]],
                                done: function (res) {
@@ -175,9 +199,9 @@
                            });
                            // 修改出库站
                            form.on('select(tbBasicTbStaNos)', function (obj) {
                                let index  = obj.othis.parents('tr').attr("data-index");
                                let index = obj.othis.parents('tr').attr("data-index");
                                let data = tableCache[index];
                                for (let i = 0; i<tableCache.length; i++) {
                                for (let i = 0; i < tableCache.length; i++) {
                                    if (tableCache[i].locNo === data.locNo) {
                                        tableCache[i]['staNo'] = Number(obj.elem.value);
                                    }
@@ -194,18 +218,18 @@
                                }
                                modifySta(stoPreTabData);
                            });
                            // 批量修改出库站 - 站点选择
                            function modifySta(stoPreTabData) {
                                // 出库站取交集
                                let staBatchSelectVal = [];
                                for(let i = 0; i<stoPreTabData.length; i++) {
                                for (let i = 0; i < stoPreTabData.length; i++) {
                                    let staNos = stoPreTabData[i].staNos;
                                    if (staNos !== null) {
                                        if (staBatchSelectVal.length === 0) {
                                            staBatchSelectVal = staNos;
                                        } else {
                                            staBatchSelectVal = staBatchSelectVal.filter(val =>
                                                {
                                            staBatchSelectVal = staBatchSelectVal.filter(val => {
                                                    return new Set(staNos).has(val)
                                                }
                                            )
@@ -231,8 +255,8 @@
                                            let loadIdx = layer.load(2);
                                            let batchSta = Number(obj.field.batchSta);
                                            let arr = [];
                                            for (let j = 0; j<stoPreTabData.length; j++) {
                                                for (let i = 0; i<tableCache.length; i++) {
                                            for (let j = 0; j < stoPreTabData.length; j++) {
                                                for (let i = 0; i < tableCache.length; i++) {
                                                    if (tableCache[i].orderNo === stoPreTabData[j].orderNo
                                                        && tableCache[i].matnr === stoPreTabData[j].matnr
                                                        && tableCache[i].locNo === stoPreTabData[j].locNo) {
@@ -249,7 +273,8 @@
                                            arr.forEach(item => {
                                                $('div[lay-id=stoPreTab] tr[data-index="' + item + '"] .layui-select-title').find("input").css("color", "blue");
                                            });
                                            layer.close(loadIdx); layer.close(ddIndex);
                                            layer.close(loadIdx);
                                            layer.close(ddIndex);
                                            return false;
                                        });
                                        // 弹窗不出现滚动条
@@ -260,18 +285,18 @@
                            }
                        }
                        ,yes: function(index, layero){
                        , yes: function (index, layero) {
                            //按钮【立即出库】的回调
                            pakout(tableCache, index);
                        }
                        ,btn2: function(index, layero){
                        , btn2: function (index, layero) {
                            //按钮【稍后处理】的回调
                            layer.close(index)
                            //return false 开启该代码可禁止点击该按钮关闭
                        }
                    });
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/";
                } else {
                    layer.msg(res.msg, {icon: 2})
                }
@@ -305,7 +330,6 @@
    }
    /* 删除订单 */
    function doDelSensor(obj) {
        layer.confirm('确定要删除选中数据吗?', {
@@ -315,18 +339,18 @@
            layer.close(i);
            var loadIndex = layer.load(2);
            $.ajax({
                url: baseUrl+"/sensor/delete/auth",
                url: baseUrl + "/sensor/delete/auth",
                headers: {'token': localStorage.getItem('token')},
                data: {ids: obj.ids},
                method: 'POST',
                success: function (res) {
                    layer.close(loadIndex);
                    if (res.code === 200){
                    if (res.code === 200) {
                        layer.msg(res.msg, {icon: 1});
                        $(".layui-laypage-btn")[0].click();
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    }else {
                    } else if (res.code === 403) {
                        top.location.href = baseUrl + "/";
                    } else {
                        layer.msg(res.msg, {icon: 2});
                    }
                }
@@ -337,10 +361,10 @@
    // 修改状态
    form.on('switch(statusSwitch)', function (obj) {
        var index  = obj.othis.parents('tr').attr("data-index");
        var index = obj.othis.parents('tr').attr("data-index");
        var data = tableData[index];
        data[this.name] = obj.elem.checked?1:0;
        http.post(baseUrl+"/sensor/edit/auth", {id: data.id, status: data[this.name]}, function (res) {
        data[this.name] = obj.elem.checked ? 1 : 0;
        http.post(baseUrl + "/sensor/edit/auth", {id: data.id, status: data[this.name]}, function (res) {
            layer.msg(res.msg, {icon: 1});
        })
    })
@@ -351,7 +375,7 @@
function tableReload(child) {
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function() {
    $.each($('#search-box [name]').serializeArray(), function () {
        searchData[this.name] = this.value;
    });
    (child ? parent.tableIns : tableIns).reload({
@@ -370,14 +394,14 @@
    $.ajax({
        url: baseUrl + "/out/pakout/orderDetlIds/auth",
        headers: {'token': localStorage.getItem('token')},
        data: { orderId : orderId },
        data: {orderId: orderId},
        method: 'POST',
        success: function (res) {
            layer.close(loadIndex);
            if (res.code === 200){
            if (res.code === 200) {
                pakoutPreview(res.data);
            } else if (res.code === 403){
                top.location.href = baseUrl+"/";
            } else if (res.code === 403) {
                top.location.href = baseUrl + "/";
            } else {
                layer.msg(res.msg, {icon: 2});
            }
src/main/webapp/static/js/wrkMast/wrkMast.js
@@ -21,15 +21,16 @@
        cols: [[
            {type: 'checkbox'}
            ,{field: 'wrkNo', align: 'center',title: '工作号',sort: true, width: 95}
            ,{field: 'wrkCode', align: 'center',title: '下发工作号',sort: true, width: 120}
            ,{field: 'ioTime$', align: 'center',title: '工作时间',sort: true, width: 170}
            ,{field: 'wrkSts$', align: 'center',title: '工作状态', width: 120}
            ,{field: 'ioType$', align: 'center',title: '入出库类型', width: 140}
            ,{field: 'ioPri', align: 'center',title: '优先级'}
            ,{field: 'taskType$', align: 'center',title: '任务类型'}
            ,{field: 'barcode', align: 'center',title: '条码', width: 120}
            ,{field: 'crnNo$', align: 'center',title: '堆垛机'}
            ,{field: 'sourceStaNo$', align: 'center',title: '源站'}
            ,{field: 'staNo$', align: 'center',title: '目标站'}
            ,{field: 'crnNo$', align: 'center',title: '堆垛机', width: 95}
            ,{field: 'sourceStaNo$', align: 'center',title: '源站', width: 95}
            ,{field: 'staNo$', align: 'center',title: '目标站', width: 95}
            ,{field: 'sourceLocNo', align: 'center',title: '源库位', width: 120}
            ,{field: 'locNo', align: 'center',title: '目标库位', width: 120}
            ,{field: 'preHave', align: 'center',title: '先入品', hide: true}