自动化立体仓库 - WMS系统
ZY
2024-08-17 4a655363927ba4c189b34072cffd3351eadf00fb
src/main/java/com/zy/third/erp/task/ERPInOrOutService.java
@@ -61,7 +61,7 @@
            }
            orderService.remove(order.getId());
        }
        DocType docType = docTypeService.selectOrAdd(inHedTB.getIoKindID(), Boolean.FALSE);
        DocType docType = docTypeService.selectOrAdd(inHedTB.getIoKindName(), inHedTB.getIoKindID(), Boolean.TRUE);
        Date now = new Date();
        // 单据主档
        order = new Order(
@@ -100,11 +100,16 @@
                inHedTB.getMakeDate(),    // 修改时间
                inHedTB.getRemark()    // 备注
        );
        order.setTemp1(inHedTB.getTemp1());
        order.setTemp2(inHedTB.getTemp2());
        order.setTemp3(inHedTB.getTemp3());
        order.setWareId(inHedTB.getWareId());
        order.setWareName(inHedTB.getWareName());
        if (!orderService.insert(order)) {
            throw new CoolException("生成单据主档失败,请联系管理员");
        }
        for (InDetTB outDetTB : inDetTBs) {
            Mat mat = matService.selectByMatnr(outDetTB.getItemCode());
            Mat mat = matService.selectByMatnr(outDetTB.getItemId());
            if (Cools.isEmpty(mat)) {
                throw new CoolException(outDetTB.getItemCode() + "编号商品检索失败,请先添加商品");
            }
@@ -120,7 +125,7 @@
            orderDetl.setWareName(outDetTB.getWareName());
            orderDetl.setBatch(outDetTB.getItemBatch());
            orderDetl.setAnfme(outDetTB.getMainNum());
            orderDetl.setINO(outDetTB.getINO());
            orderDetl.setINo(outDetTB.getINO());
            orderDetl.setOrderId(order.getId());
            orderDetl.setTemp1(outDetTB.getTemp1());
            orderDetl.setTemp2(outDetTB.getTemp2());
@@ -132,7 +137,9 @@
            orderDetl.setUpdateBy(9527L);
            orderDetl.setUpdateTime(now);
            orderDetl.setStatus(1);
            orderDetl.setProType(outDetTB.getProtype());
            orderDetl.setQty(0.0D);
            orderDetl.setSPgNO(outDetTB.getSPgNO());
            if (!orderDetlService.insert(orderDetl)) {
                throw new CoolException("生成单据明细失败,请联系管理员");
            }
@@ -154,7 +161,7 @@
            }
            orderService.remove(order.getId());
        }
        DocType docType = docTypeService.selectOrAdd(inHedTB.getIoKindID(), Boolean.FALSE);
        DocType docType = docTypeService.selectOrAdd(inHedTB.getIoKindName(),inHedTB.getIoKindID(), Boolean.FALSE);
        Date now = new Date();
        // 单据主档
        order = new Order(
@@ -193,11 +200,17 @@
                inHedTB.getMakeDate(),    // 修改时间
                inHedTB.getRemark()    // 备注
        );
        order.setTemp1(inHedTB.getTemp1());
        order.setTemp2(inHedTB.getTemp2());
        order.setTemp3(inHedTB.getTemp3());
        order.setWareId(inHedTB.getWareId());
        order.setWareName(inHedTB.getWareName());
        if (!orderService.insert(order)) {
            throw new CoolException("生成单据主档失败,请联系管理员");
        }
        for (OutDetTB outDetTB : inDetTBs) {
            Mat mat = matService.selectByMatnr(outDetTB.getItemCode());
            Mat mat = matService.selectByMatnr(outDetTB.getItemId());
            if (Cools.isEmpty(mat)) {
                throw new CoolException(outDetTB.getItemCode() + "编号商品检索失败,请先添加商品");
            }
@@ -213,7 +226,7 @@
            orderDetl.setWareName(outDetTB.getWareName());
            orderDetl.setBatch(outDetTB.getItemBatch());
            orderDetl.setAnfme(outDetTB.getMainNum());
            orderDetl.setINO(outDetTB.getINO());
            orderDetl.setINo(outDetTB.getINO());
            orderDetl.setOrderId(order.getId());
            orderDetl.setTemp1(outDetTB.getTemp1());
            orderDetl.setTemp2(outDetTB.getTemp2());
@@ -226,6 +239,8 @@
            orderDetl.setUpdateTime(now);
            orderDetl.setStatus(1);
            orderDetl.setQty(0.0D);
            orderDetl.setProType(outDetTB.getProType());
            orderDetl.setSPgNO(outDetTB.getSPgNO());
            if (!orderDetlService.insert(orderDetl)) {
                throw new CoolException("生成单据明细失败,请联系管理员");
            }