自动化立体仓库 - WMS系统
#1
dubin
2025-10-30 5ee8d702138b67a8070e850ba622aa4b07d64fb9
src/main/java/com/zy/asrs/utils/MatExcelListener.java
@@ -5,9 +5,11 @@
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.InOut;
import com.zy.asrs.entity.Mat;
import com.zy.asrs.entity.Tag;
import com.zy.asrs.mapper.TagMapper;
import com.zy.asrs.service.InOutService;
import com.zy.asrs.service.MatService;
import com.zy.asrs.service.TagService;
import com.zy.common.entity.MatExcel;
@@ -57,6 +59,7 @@
        TagService tagService = SpringUtils.getBean(TagService.class);
        TagMapper tagMapper = SpringUtils.getBean(TagMapper.class);
        MatService matService = SpringUtils.getBean(MatService.class);
        InOutService inOutService = SpringUtils.getBean(InOutService.class);
        Date now = new Date();
        Long tagId;
        // 分类
@@ -131,8 +134,9 @@
        if (mat == null) {
            mat = excel;
            mat.setTagId(tagId);
            mat.setMatnr(excel.getMatnr());
            if (!matService.insert(mat)) {
                throw new CoolException("保存商品信息失败,商品编码:" + excel.getMatnr());
                throw new CoolException("保存商品档案失败,商品编码:" + excel.getMatnr());
            }
            total++;
        }