自动化立体仓库 - WMS系统
*
lsh
22 小时以前 3c992dd950b539f03cdf64898f8bfba65c2313b8
*
7个文件已修改
259 ■■■■ 已修改文件
src/main/java/com/zy/asrs/entity/OrderDetlPakout.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/OrderOutBatchUtil.java 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/orderPakout/order.js 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/orderPakout/order.html 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/orderPakout/out.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/OrderDetlPakout.java
@@ -435,9 +435,11 @@
        if (null == this.status){ return null; }
        switch (this.status){
            case 1:
                return "正常";
                return "未上报";
            case 0:
                return "禁用";
            case 2:
                return "等待上报";
            default:
                return String.valueOf(this.status);
        }
@@ -476,6 +478,8 @@
    }
    public String getQty$(){
        if (this.qty == null) return "";
        if (this.anfme == null) return "无数据";
        if (this.anfme.equals(this.qty)){
            return "已完成";
        }
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -1205,19 +1205,24 @@
    @Transactional
    public R cargoBookingNote(OrderCargoBookingNoteParam param) {
        try{
            List<String[]> OutLocBoxCs = new ArrayList<>();
            List<OrderOutLocBoxCsUtilParam> OutLocBoxCs = new ArrayList<>();
            String orderNo = "ZH" + snowflakeIdWorker.nextId();
            for (OrderCargoBookingNoteParam.Box box : param.getBoxList()){
                for (OrderCargoBookingNoteParam.Box.Roll roll : box.getRollList()){
                    String[] outLocBox = new String[]{box.getBoxNo(),orderNo,param.getCstmrName(),roll.getMemo(),"合格"};
                    OrderOutLocBoxCsUtilParam outLocBox = new OrderOutLocBoxCsUtilParam();
                    outLocBox.setBoxNo(box.getBoxNo());
                    outLocBox.setRoll(roll.getRollNo());
                    outLocBox.setMemo(roll.getMemo());
                    outLocBox.setOrderOneNo(orderNo);
                    outLocBox.setCstmrName(param.getCstmrName());
                    outLocBox.setDanger("合格");
                    OutLocBoxCs.add(outLocBox);
                }
            }
            if (!OutLocBoxCs.isEmpty()){
                OrderOutBatchUtil orderOutBatchUtil = new OrderOutBatchUtil(orderNo,param.getCstmrName(),"","MES下发计划组货单","计划组货单",true,param.getGroupGoodsNo());
                OrderOutBatchUtil orderOutBatchUtil = new OrderOutBatchUtil(orderNo,param.getCstmrName(),"","MES下发计划组货单","计划组货单",false,param.getGroupGoodsNo());
                return orderOutBatchUtil.setOrderOutBatchCargoBookingNote(OutLocBoxCs);
//                return R.ok();
            }
        } catch (Exception e) {
            throw new CoolException("组货单号:"+param.getGroupGoodsNo()+"计划组货单接收失败!!!"+e.getMessage());
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -319,7 +319,7 @@
                    DateUtils.convert(now),    // 单据日期
                    docType.getDocId(),    // 单据类型
                    null,    // 项目编号
                    null,    //
                    param.getGroupGoodsNo(),    //组货单号
                    null,    // 调拨项目编号
                    null,    // 初始票据号
                    null,    // 票据号
@@ -341,7 +341,7 @@
                    null,    // 发货时间
                    null,    // 物流名称
                    null,    // 物流单号
                    1L,    // 订单状态
                    9L,    // 订单状态
                    1,    // 状态
                    userId,    // 添加人员
                    now,    // 添加时间
@@ -360,7 +360,8 @@
                i++;
                Mat mat = matService.selectByMatnr(locDetl.getMatnr());
                if (Cools.isEmpty(mat)) {
                    throw new CoolException(locDetl.getMatnr() + "物料编码检索失败,请先添加商品");
//                    throw new CoolException(locDetl.getMatnr() + "物料编码检索失败,请先添加商品");
                    mat = new Mat();
                }
                OrderDetlPakout orderDetl = new OrderDetlPakout();
                orderDetl.sync(mat);
src/main/java/com/zy/asrs/utils/OrderOutBatchUtil.java
@@ -11,6 +11,7 @@
import com.zy.asrs.entity.param.StockOutParam;
import com.zy.asrs.service.LocDetlService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.MatService;
import com.zy.asrs.service.WorkService;
import com.zy.common.model.LocDto;
import com.zy.common.properties.SlaveProperties;
@@ -78,7 +79,6 @@
    public R setOrderOutBatch() {
        return R.ok();
    }
    public R setOrderOutBatch(List<OrderOutLocBoxCsUtilParam>  OutLocBoxCs) {
        int total = OutLocBoxCs.size();
@@ -239,7 +239,8 @@
        }
        return R.error(requert);
    }
    public R setOrderOutBatchCargoBookingNote(List<String[]> OutLocBoxCs) {
    public R setOrderOutBatchCargoBookingNote(List<OrderOutLocBoxCsUtilParam>  OutLocBoxCs) {
        int total = OutLocBoxCs.size();
        if (!Cools.isEmpty(OutLocBoxCs) && !OutLocBoxCs.isEmpty()) {
            LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class);
@@ -247,77 +248,107 @@
            SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class);
            WorkService workService = SpringUtils.getBean(WorkService.class);
            List<LocDto> locDtos = new ArrayList<>();
            List<String[]> outLocBoxCList = new ArrayList<>();
            List<OrderOutLocBoxCsUtilParam> outLocBoxCList = new ArrayList<>();
            List<String> outLocBoxCNew = new ArrayList<>();
            for (String[] outLocBoxC : OutLocBoxCs) {
            List<String> outLocRollListOld = new ArrayList<>();
            List<String> outLocRollListNew = new ArrayList<>();
            for (OrderOutLocBoxCsUtilParam outLocBoxC : OutLocBoxCs) {
                if (!outLocRollListOld.contains(outLocBoxC.getRoll())) {
                    outLocRollListOld.add(outLocBoxC.getRoll());
                }
            }
            for (OrderOutLocBoxCsUtilParam outLocBoxC : OutLocBoxCs) {
                total--;
                if (!outLocBoxCNew.contains(outLocBoxC[0])) {
                    LocDetl locDetlSou = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", outLocBoxC[0]));
                    if (Cools.isEmpty(locDetlSou)) {
                LocDetl locDetlSou = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", outLocBoxC.getBoxNo()).eq("model",outLocBoxC.getRoll()));
                if (Cools.isEmpty(locDetlSou)) {
                    locDetlSou = new LocDetl();
                    locDetlSou.setBatch(outLocBoxC.getBoxNo());
                    locDetlSou.setModel(outLocBoxC.getRoll());
                    locDetlSou.setLocNo("无库存");
//                    sign = false;
                    errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() + "卷号:" + outLocBoxC.getRoll() + " 未查询到数据!!!《===]";
//                    continue;
                }
                if (signDanger){
                    if (!locDetlSou.getDanger$().equals(outLocBoxC.getDanger())) {
                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " 未查询到数据!!!《===]";
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() + "卷号:" + outLocBoxC.getRoll() +  " ==》出库输入待判状态:" + outLocBoxC.getDanger() + "、库存状态:" + locDetlSou.getDanger$() + "。状态不匹配《===]";
                        continue;
//                        throw new CoolException("箱号:"+outLocBoxC[0]+" 未查询到数据!!!");
                    }
                    if (signDanger){
                        if (!locDetlSou.getDanger$().equals(outLocBoxC[4])) {
                            sign = false;
                            errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " ==》出库输入待判状态:" + outLocBoxC[4] + "、库存状态:" + locDetlSou.getDanger$() + "。状态不匹配《===]";
                            continue;
                        }
                    }
                }
                if (!outLocBoxCNew.contains(outLocBoxC.getBoxNo()) && !locDetlSou.getLocNo().equals("无库存")) {
                    LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlSou.getLocNo()));
                    if (Cools.isEmpty(locMast)) {
                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " 所在库位不满足出库条件!!!未查询到此箱号所在库位" + "《===]";
                        continue;
                    }
                    if (!locMast.getLocSts().equals("F")) {
                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " 所在库位不满足出库条件!!!库位状态不为F!!!库位状态:" + locMast.getLocSts$() + "《===]";
                        continue;
                    }
                    // 目标库位 ===>> 浅库位
                    if (Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) {
                        String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast.getLocNo());
                        LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc));
                        if (!Cools.isEmpty(locMast2)) {
                            if (locMast2.getLocSts().equals("P") || locMast2.getLocSts().equals("R")) {
                                errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC[0] + " 所在库位满足出库条件!!!但是深库位在出库中!!!因此会夹杂在前边订单执行!!!" + "《===]";
//                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() + "卷号:" + outLocBoxC.getRoll() +  " 所在库位不满足出库条件!!!未查询到此箱号所在库位" + "《===]";
//                        continue;
                    } else if (!locMast.getLocSts().equals("F")) {
//                        sign = false;
                        errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() + "卷号:" + outLocBoxC.getRoll() +  " 所在库位不满足出库条件!!!库位状态不为F!!!库位状态:" + locMast.getLocSts$() + "《===]";
//                        continue;
                    } else {
                        // 目标库位 ===>> 浅库位
                        if (Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) {
                            String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast.getLocNo());
                            LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", shallowLoc));
                            if (!Cools.isEmpty(locMast2)) {
                                if (locMast2.getLocSts().equals("P") || locMast2.getLocSts().equals("R")) {
                                    errorMsgOrderLoc = errorMsgOrderLoc + "[===》" + "箱号:" + outLocBoxC.getBoxNo() +  "卷号:" + outLocBoxC.getRoll() + " 所在库位满足出库条件!!!但是相邻库位在出库中!!!因此会夹杂在前边订单执行!!!" + "《===]";
                                }
                            }
                        }
                    }
                    if (sign) {
                        List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                                .eq("loc_no", locDetlSou.getLocNo()).eq("origin", locDetlSou.getOrigin()));
                        for (LocDetl locDetl : locDetls) {
                            total++;
                            String[] locDetlNow = new String[5];
                            locDetlNow[0] = locDetl.getBatch();
                            locDetlNow[1] = outLocBoxC[1];
                            locDetlNow[2] = outLocBoxC[2];
                            locDetlNow[3] = outLocBoxC[3];
                            locDetlNow[4] = outLocBoxC[4];
                            outLocBoxCList.add(locDetlNow);
                            outLocBoxCNew.add(outLocBoxC[0]);
                }
                if (sign && !outLocRollListNew.contains(outLocBoxC.getRoll()) && !locDetlSou.getLocNo().equals("无库存")) {
                    List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
                            .eq("loc_no", locDetlSou.getLocNo()).eq("origin", locDetlSou.getOrigin()));
                    for (LocDetl locDetl : locDetls) {
                        if (!outLocRollListNew.contains(locDetl.getModel())){
                            if (!outLocRollListOld.contains(locDetl.getModel())){
                                total++;
                                OrderOutLocBoxCsUtilParam orderOutLocBoxCsUtilParam = new OrderOutLocBoxCsUtilParam(locDetl.getBatch(),locDetl.getModel(), outLocBoxC);
                                orderOutLocBoxCsUtilParam.setMemo("附带出库");
                                orderOutLocBoxCsUtilParam.setDanger(locDetl.getDanger$());
                                outLocBoxCList.add(orderOutLocBoxCsUtilParam);
                                outLocBoxCNew.add(outLocBoxC.getBoxNo());
                                outLocRollListNew.add(outLocBoxC.getRoll());
                            } else {
                                if (locDetlSou.getBatch().equals(locDetl.getBatch()) && locDetlSou.getModel().equals(locDetl.getModel())) {
                                    total++;
                                    outLocBoxCList.add(outLocBoxC);
                                    outLocBoxCNew.add(outLocBoxC.getBoxNo());
                                    outLocRollListNew.add(outLocBoxC.getRoll());
                                }
                            }
                        }
                    }
                } else if (sign && !outLocRollListNew.contains(outLocBoxC.getRoll()) && locDetlSou.getLocNo().equals("无库存")) {
                    if (!outLocRollListNew.contains(locDetlSou.getModel())){
                        total++;
                        outLocBoxCList.add(outLocBoxC);
                        outLocBoxCNew.add(outLocBoxC.getBoxNo());
                        outLocRollListNew.add(outLocBoxC.getRoll());
                    }
                }
            }
            for (String[] outLocBoxC : outLocBoxCList) {
                LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", outLocBoxC[0]));
            for (OrderOutLocBoxCsUtilParam outLocBoxC : outLocBoxCList) {
                LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", outLocBoxC.getBoxNo()).eq("model", outLocBoxC.getRoll()));
                if (Cools.isEmpty(locDetl)) {
                    total--;
                    continue;
//                    total--;
//                    continue;
                    locDetl = new LocDetl();
                    locDetl.setBatch(outLocBoxC.getBoxNo());
                    locDetl.setModel(outLocBoxC.getRoll());
                    locDetl.setLocNo("无库存");
                }
                if (!Cools.isEmpty(outLocBoxC[3])) {
                    String memo = Cools.isEmpty(locDetl.getMemo()) ? "" : locDetl.getMemo() + ",";
                    locDetl.setMemo(memo + DateUtils.convert(new Date(), DateUtils.yyyyMMdd_C) + "备注:" + outLocBoxC[3]);
                } else if (Cools.isEmpty(locDetl.getMemo())) {
                    locDetl.setMemo(outLocBoxC[3]);
                if (!Cools.isEmpty(outLocBoxC.getMemo())) {
                    if (Cools.isEmpty(locDetl.getMemo())) {
                        locDetl.setMemo(DateUtils.convert(new Date(), DateUtils.yyyyMMdd_C) + "备注:" + outLocBoxC.getMemo());
                    } else {
                        String memo = Cools.isEmpty(locDetl.getMemo()) ? "" : locDetl.getMemo() + ",";
                        locDetl.setMemo(memo + DateUtils.convert(new Date(), DateUtils.yyyyMMdd_C) + "备注:" + outLocBoxC.getMemo());
                    }
                }
                LocDto locDto = new LocDto(locDetl);
                locDtos.add(locDto);
src/main/webapp/static/js/orderPakout/order.js
@@ -48,8 +48,10 @@
        page: true,
        cellMinWidth: 100,
        cols: [[
            {type: 'numbers'},
            {field: 'orderNo', title: '单据编号', templet: '#orderNoTpl'},
            // {type: 'numbers'},
            {field: 'itemName', align: 'center', title: '组货单号'},
            {field: 'cstmrName', align: 'center', title: '客户名称'},
            {field: 'orderNo', title: '流水号', templet: '#orderNoTpl'},
            {field: 'docType$', align: 'center', title: '类型',  minWidth: 160, width: 160},
            {field: 'tkType', align: 'center', title: 'TK',  minWidth: 160, width: 160,hide: true},
            {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160},
@@ -176,6 +178,76 @@
            doDel(data.id);
        } else if (layEvent === 'complete') {//转实际组货单
            doModify(data.id, data.orderNo, 11);
        } else if (layEvent === 'look') {
            var $a = $(obj.tr).find('a[lay-event="look"]');
            var offset = $a.offset();
            var top = offset.top;
            var left = offset.left;
            layer.open({
                type: 1,
                title: false,
                area: '1020px',
                offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
                shade: .01,
                shadeClose: true,
                fixed: false,
                content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
                success: function (layero) {
                    table.render({
                        elem: '#lookSSXMTable',
                        headers: {token: localStorage.getItem('token')},
                        url: baseUrl+'/order/pakout/orderDetl/list/auth',
                        where: {
                            order_id: data.id
                        },
                        page: true,
                        cellMinWidth: 100,
                        cols: [[
                            {type: 'numbers'},
                            {field: 'matnr', title: '规格', width: 160},
                            // {field: 'maktx', title: '商品名称', width: 160},
                            {field: 'batch', align: 'center', title: '箱号', width: 160},
                            {field: 'model', align: 'center',title: '卷号', width: 160},
                            // {field: 'anfme', align: 'center', title: '数量'},
                            // {field: 'workQty', title: '作业数量'},
                            // {field: 'unit', title: '单位'},
                            // {
                            //     field: 'createTime$', title: '创建时间', sort: true, templet: function (d) {
                            //         return util.toDateString(d.createTime);
                            //     },  width: 180
                            // },
                            // {field: 'inQty', title: '已入库量'},
                            // {field: 'color', title: '颜色'},
                            // {field: 'specs', align: 'center', title: '接头'},
                            {field: 'danger$', align: 'center', title: '待判', width: 80},
                            {field: 'manu', title: '货位', align: 'center', width: 100},
                            {field: 'memo', align: 'center', title: '备注'},
                            {field: 'status$', align: 'center', title: '状态', style: 'font-weight: bold'},
                            // {field: 'source$', align: 'center', title: '是否确认', style: 'font-weight: bold'}
                        ]],
                        request: {
                            pageName: 'curr',
                            pageSize: 'limit'
                        },
                        parseData: function (res) {
                            return {
                                'code': res.code,
                                'msg': res.msg,
                                'count': res.data.total,
                                'data': res.data.records
                            }
                        },
                        response: {
                            statusCode: 200
                        },
                        done: function () {
                            $(layero).find('.layui-table-view').css('margin', '0');
                        },
                        size: ''
                    });
                }
            });
        }
    });
src/main/webapp/views/orderPakout/order.html
@@ -54,6 +54,16 @@
                            <input name="order_no" class="layui-input" type="text" placeholder="输入单据编号"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline mr0">
                            <input name="cstmr_name" class="layui-input" type="text" placeholder="输入客户名称"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline mr0">
                            <input name="item_name" class="layui-input" type="text" placeholder="输入组货单号"/>
                        </div>
                    </div>
                    <div class="layui-inline" style="width: 300px">
                        <div class="layui-input-inline">
                            <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px">
@@ -100,7 +110,7 @@
    {{# if (d.settle != 11) { }}
        <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="del">删除</a>
    {{# } }}
    {{# if (d.settle == 0 || d.settle == 1) { }}
    {{# if (d.settle == 10) { }}
        <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="complete">生成实际组货单</a>
    {{# } }}
</script>
src/main/webapp/views/orderPakout/out.html
@@ -176,7 +176,7 @@
    <div class="ew-select-fixed">
        <select class="order-sta-select" lay-filter="tbBasicTbStaNos">
            {{#if (d.staNos!=null) {}}
            {{# for(let i=0; i<d.staNos.length; i++) { }}
            {{# for(let i=0; i < d.staNos.length; i++) { }}
            <option value="{{d.staNos[i]}}">{{d.staNos[i]}}</option>
            {{# } }}
            {{# } }}