自动化立体仓库 - WMS系统
#
18516761980
2022-04-19 c866b8a4cccdfe330ae2da833c62577d6a902a03
src/main/java/com/zy/common/utils/excel/matcode/MatCodeExcelListener.java
@@ -52,14 +52,23 @@
    @Override
    public void invoke(MatCodeExcel data, AnalysisContext ctx) {
        MatCodeService matCodeService = SpringUtils.getBean(MatCodeService.class);
        if (matCodeService.selectById(data.getMatNo()) == null) {
            MatCode matCode = new MatCode();
        MatCode matCode = matCodeService.selectById(data.getMatNo());
        if (matCode == null) {
            matCode = new MatCode();
            VersionUtils.setMatCode(matCode, data);
            matCode.setModiTime(new Date());
            matCode.setModiUser(this.userId);
            matCode.setAppeTime(new Date());
            matCode.setAppeUser(this.userId);
            if (!matCodeService.insert(matCode)) {
                throw new CoolException("导入数据异常");
            }
            total ++;
        } else {
            VersionUtils.setMatCode(matCode, data);
            matCode.setModiTime(new Date());
            matCode.setModiUser(this.userId);
            if (!matCodeService.updateById(matCode)) {
                throw new CoolException("导入数据异常");
            }
            total ++;
@@ -78,7 +87,7 @@
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext ctx) {
        LOGGER.info("新增{}条物料信息!", total);
        LOGGER.info("新增/修改{}条产品信息!", total);
    }
    public int getTotal() {