自动化立体仓库 - WMS系统
#1
czkh
4 天以前 e0f5380c21b72184c1455c24eaffe371585e1691
src/main/java/com/zy/asrs/utils/MatExcelListener.java
@@ -30,6 +30,7 @@
    private int total = 0;
    private Long userId;
    private int count;
    public MatExcelListener() {
    }
@@ -145,6 +146,7 @@
            inOut.setMaktx(mat.getMaktx());
            inOut.setColor(mat.getColor());
            inOut.setSpecs(mat.getSpecs());
            inOut.setName(excel.getName());
            inOut.setTemp1("");
            if (!matService.insert(mat)) {
                throw new CoolException("保存商品档案失败,商品编码:" + excel.getMatnr());
@@ -158,6 +160,11 @@
                //模具状态更新为报废 模具与托盘解绑
                List<MatBarcode> list = new ArrayList<>();
                MatBarcode matBarcode = matBarcodeService.selectbyMatnr(excel.getMatnr() + "__" + excel.getName());
                InOut inOut = inOutService.selectByMatnr(excel.getMatnr() + "__" + excel.getName());
                if (inOut != null){
                    inOut.setColor(excel.getColor());
                    inOutService.updateById(inOut);
                }
                if (matBarcode != null){
                    list.add(matBarcode);
                    matBarcodeService.deleteMatBarcode(list);
@@ -172,6 +179,7 @@
            if (!matService.insert(mat)) {
                throw new CoolException("保存商品档案失败,商品编码:" + excel.getMatnr());
            }
            count++;
        }
    }
@@ -187,4 +195,8 @@
    public int getTotal() {
        return total;
    }
    public int getCount() {
        return count;
    }
}