自动化立体仓库 - WMS系统
#
whycq
2024-06-11 f0c73d72fe7f939be2d3fdf5fc90889971a67fe5
#
4个文件已修改
156 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/AgvLocMastController.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/OrderController.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/order/order.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/AgvLocMastController.java
@@ -81,6 +81,27 @@
        if (locMast.getLocSts().equals("F") && (oldLocMast.getLocSts().equals("D") || oldLocMast.getLocSts().equals("O"))) {
            return R.error("当前操作已被阻止,请联系管理员");
        }
        int br = 0;
        switch (locMast.getBarcode().substring(0,2)) {
            case "10":
                br = 1;
                break;
            case "20":
                br = 2;
                break;
            case "21":
                br = 4;
                break;
            case "30":
                br = 3;
                break;
            case "40":
                br = 5;
                break;
        }
        if (oldLocMast.getLocType1() != br) {
            return  R.error("货架和库位类型不匹配!");
        }
        Date now = new Date();
        // 有物料时修改为空库位或者空板库位,则删除库存明细
        if (oldLocMast.getLocSts().equals("R") || oldLocMast.getLocSts().equals("F") || oldLocMast.getLocSts().equals("S")) {
src/main/java/com/zy/asrs/controller/OrderController.java
@@ -625,6 +625,7 @@
        Date now = new Date();
        DataFormatter dataFormatter = new DataFormatter();
        for (int i = 1; i < totalRows; i++) {
            Integer proSts = 0;
            Row row = sheet.getRow(i);
            //单据类型
            String docName =  dataFormatter.formatCellValue(row.getCell(0));
@@ -641,6 +642,7 @@
                continue;
            }
            Double anfme = Double.parseDouble(dataFormatter.formatCellValue(row.getCell(5)));
            Mat mat = matService.selectByMatnr(matnr);
            if (null == mat) {
                throw new CoolException(matnr + "商品编码的商品不存在,请重新导入!");
@@ -649,6 +651,26 @@
            //String timeStr = DateUtils.convert(new Date());
            DocType docType = docTypeService.selectOne(new EntityWrapper<DocType>().eq("doc_name", docName));
            // 单据类型为 半成品入库单才有工序
            if (docType.getDocId().intValue() == 32) {
                //工序
                if (Cools.isEmpty(dataFormatter.formatCellValue(row.getCell(6)))) {
                    // 工序为空,默认为无需加工
                    proSts = 3;
                } else {
                    String processSts = dataFormatter.formatCellValue(row.getCell(6));
                    //1: 待加工 2:已加工 3:无需加工
                    if ("待加工".equals(processSts)) {
                        proSts = 1;
                    } else if ("已加工".equals(processSts)) {
                        proSts = 2;
                    } else {
                        proSts = 3;
                    }
                }
            }
            if(docType.getPakin() == 1){
                uuid += "_I";
@@ -719,6 +741,7 @@
                orderDetl.setDeadTime(isocode);
                orderDetl.setStatus(1);
                orderDetl.setQty(0.0D);
                orderDetl.setProcessSts(proSts);
                if (!orderDetlService.insert(orderDetl)) {
                    throw new CoolException("生成单据明细失败,请重新导入!");
                }
@@ -727,6 +750,7 @@
                    throw new CoolException("生成单据明细失败,请重新导入!");
                }
            }
            // 生成调拨单
            if (docType.getDocId().intValue() == 32) {
                String dbUuid = "DB" + uuid;
                Order order2 = orderService.selectByNo(dbUuid);
@@ -801,6 +825,85 @@
                    }
                }
            }
            // 工序为1:待加工 生成加工单
            if (proSts == 1) {
                if (docType.getDocId().intValue() == 32) {
                    String dbUuid = "JG" + uuid;
                    Order order3 = orderService.selectByNo(dbUuid);
                    if (null == order3) {
                        order3 = new Order(
                                String.valueOf(snowflakeIdWorker.nextId()),    // 编号[非空]
                                dbUuid,    // 订单编号
                                null,    // 单据日期
                                35L,    // 单据类型
                                null,    // 项目编号
                                null,    //
                                null,    // 调拨项目编号
                                null,    // 初始票据号
                                null,    // 票据号
                                null,    // 客户编号
                                null,    // 客户
                                null,    // 联系方式
                                null,    // 操作人员
                                null,    // 合计金额
                                null,    // 优惠率
                                null,    // 优惠金额
                                null,    // 销售或采购费用合计
                                null,    // 实付金额
                                null,    // 付款类型
                                null,    // 业务员
                                null,    // 结算天数
                                null,    // 邮费支付类型
                                null,    // 邮费
                                null,    // 付款时间
                                null,    // 发货时间
                                null,    // 物流名称
                                null,    // 物流单号
                                1L,    // 订单状态
                                1,    // 状态
                                userId,    // 添加人员
                                now,    // 添加时间
                                userId,    // 修改人员
                                now,    // 修改时间
                                null    // 备注
                        );
                        if (!orderService.insert(order3)) {
                            throw new CoolException("生成单据主档失败,请重新导入!");
                        }
                    }else {
                        order3.setSettle(order.getSettle() == 1L ? 1L : 2L );
                        orderService.updateById(order3);
                    }
                    OrderDetl orderDetl3 = orderDetlService.selectItem(order3.getId(), matnr, null,csocode,isocode);
                    if (orderDetl3 == null) {
                        orderDetl3 = new OrderDetl();
                        orderDetl3.sync(mat);
                        orderDetl3.setSource(35);
                        orderDetl3.setBatch(null);
                        orderDetl3.setAnfme(anfme);
                        orderDetl3.setOrderId(order3.getId());
                        orderDetl3.setOrderNo(order3.getOrderNo());
                        orderDetl3.setCreateBy(userId);
                        orderDetl3.setCreateTime(now);
                        orderDetl3.setUpdateBy(userId);
                        orderDetl3.setUpdateTime(now);
                        orderDetl3.setThreeCode(csocode);
                        orderDetl3.setDeadTime(isocode);
                        orderDetl3.setStatus(1);
                        orderDetl3.setQty(0.0D);
                        if (!orderDetlService.insert(orderDetl3)) {
                            throw new CoolException("生成单据明细失败,请重新导入!");
                        }
                    } else {
                        if(!orderDetlService.increaseAnfme(order3.getId(), matnr, null, anfme,csocode,isocode)) {
                            throw new CoolException("生成单据明细失败,请重新导入!");
                        }
                    }
                }
            }
        }
        return R.ok("导入成功");
    }
src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java
@@ -328,6 +328,33 @@
        if (Cools.isEmpty(agvBasDevp)) {
            throw new CoolException("暂无"+ station + "站点");
        }
        int br = 0;
        if (containerType == 21 && agvBasDevp.getFloor() == 2) {
            containerType = 20;
        }
        switch (containerType) {
            case 10:
                br = 1;
                break;
            case 20:
                br = 2;
                break;
            case 21:
                br = 4;
                break;
            case 30:
                br = 3;
                break;
            case 40:
                br = 5;
                break;
        }
        if (br == 4 && agvBasDevp.getLocType1() == 2) {
            br = 2;
        }
        if (agvBasDevp.getLocType1() != br) {
            throw new CoolException("站点异常!");
        }
        if (containerType == 40) {
            locType = 5;
        } else if (containerType == 21 && agvBasDevp.getFloor() == 3) {
src/main/webapp/static/js/order/order.js
@@ -197,6 +197,7 @@
            content: $('#editDialog').html(),
            area: '1600px',
            success: function (layero, dIndex) {
                console.log(expTpe)
                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                var isExpAdd = !expTpe;
                // 回显数据
@@ -272,7 +273,7 @@
                        {field: 'deadTime', title: '销售订单行号(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
                        {field: 'processSts', title: '工序', templet: function (d) {
                                console.log(d)
                            var select = `<select class="layui-select" name="processSts"  lay-filter="processStsSelect" data-value=${d.processSts} id=${d.id}>
                            var select = `<select class="layui-select" name="processSts" data-state=${d.processSts} lay-filter="processStsSelect" data-value=${d.processSts} id=${d.id}>
                                            <option value="">选择状态</option>
                                            <option value="1">待加工</option>
                                            <option value="2">已加工</option>
@@ -295,9 +296,11 @@
                        var tableElem = this.elem.next('.layui-table-view');
                        count || tableElem.find('.layui-table-header').css('overflow', 'auto');
                        layui.each(tableElem.find('select[name="processSts"]'), function (index, item) {
                            console.log(item)
                            var elem = $(item);
                            elem.val(elem.data('state')).parents('div.layui-table-cell').css('overflow', 'visible');
                        });
                        form.render();//刷新表单
                    },
                    size: ''