自动化立体仓库 - WMS系统
zyx
2024-04-03 4e81a4277f95b3274d3ac8374a658cb4a815ba8d
src/main/java/com/zy/asrs/controller/OrderController.java
@@ -439,34 +439,34 @@
        DataFormatter dataFormatter = new DataFormatter();
        for (int i = 1; i < totalRows; i++) {
            Row row = sheet.getRow(i);
            // 订单编号
            String uuid = dataFormatter.formatCellValue(row.getCell(0));
            // 物料号
            String maktx = dataFormatter.formatCellValue(row.getCell(1));
            // 物料号
            //单据类型
            String docName =  dataFormatter.formatCellValue(row.getCell(0));
            //单据编号
            String uuid = dataFormatter.formatCellValue(row.getCell(1));
            //物料号
            String matnr = dataFormatter.formatCellValue(row.getCell(2));
            //销售单号
            String csocode = dataFormatter.formatCellValue(row.getCell(3));
            //自由项
            String isocode = dataFormatter.formatCellValue(row.getCell(4));
            // 数量
            Double anfme = Double.parseDouble(dataFormatter.formatCellValue(row.getCell(3)));
            // 下单时间
            String timeStr = dataFormatter.formatCellValue(row.getCell(4));
            // 销售订单号
            String csocode = dataFormatter.formatCellValue(row.getCell(5));
            // 销售订单行号
            String isocode = dataFormatter.formatCellValue(row.getCell(6));
            Date time = null;
            try {
                time = DateUtils.convert(timeStr, DateUtils.yyyyMMddHHmmss_F);
            } catch (Exception e) {
                throw new CoolException("第" + i + "行下的那时间解析失败,请重新导入!");
            if(Cools.isEmpty(dataFormatter.formatCellValue(row.getCell(5)))){
                continue;
            }
            // 商品系列
            String tagName = dataFormatter.formatCellValue(row.getCell(5));
            // 规格
            String specs = dataFormatter.formatCellValue(row.getCell(6));
            Double anfme = Double.parseDouble(dataFormatter.formatCellValue(row.getCell(5)));
            Mat mat = matService.selectByMatnr(matnr);
            if (null == mat) {
                throw new CoolException(matnr + "商品编码的商品不存在,请重新导入!");
            }
            //String timeStr = DateUtils.convert(new Date());
            DocType docType = docTypeService.selectOne(new EntityWrapper<DocType>().eq("doc_name", docName));
            if(docType.getPakin() == 1){
                uuid += "_I";
            }else {
                uuid += "_O";
            }
            Order order = orderService.selectByNo(uuid);
@@ -474,8 +474,8 @@
                order = new Order(
                        String.valueOf(snowflakeIdWorker.nextId()),    // 编号[非空]
                        uuid,    // 订单编号
                        timeStr,    // 单据日期
                        14L,    // 单据类型
                        null,    // 单据日期
                        docType.getDocId(),    // 单据类型
                        null,    // 项目编号
                        null,    //
                        null,    // 调拨项目编号
@@ -524,6 +524,8 @@
                orderDetl.setCreateTime(now);
                orderDetl.setUpdateBy(userId);
                orderDetl.setUpdateTime(now);
                orderDetl.setThreeCode(csocode);
                orderDetl.setDeadTime(isocode);
                orderDetl.setStatus(1);
                orderDetl.setQty(0.0D);
                if (!orderDetlService.insert(orderDetl)) {