#
lsh
2024-09-06 eb151270cf5ec0166d11ad59af42785cf31b183c
zy-asrs-common/src/main/java/com/zy/asrs/common/utils/LocInPrintMatExcelListener.java
@@ -6,8 +6,11 @@
import com.baomidou.mybatisplus.generator.config.IFileCreate;
import com.zy.asrs.common.domain.entity.LocInPrintMatExcel;
import com.zy.asrs.common.wms.entity.LocInPrintMat;
import com.zy.asrs.common.wms.entity.Mat;
import com.zy.asrs.common.wms.service.LocInPrintMatService;
import com.zy.asrs.common.wms.service.MatService;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.framework.exception.CoolException;
import lombok.Data;
@@ -29,7 +32,7 @@
    private int totalAnfme = 0;
    private Long userId;
    private Long hostId;
    List<String[]> OutLocBoxCs = new ArrayList<>();
    List<String[]> printMatList = new ArrayList<>();
    public LocInPrintMatExcelListener() {
    }
@@ -67,9 +70,14 @@
        } catch (Exception e){
            throw new CoolException("品号参数为空");
        }
        MatService matService = SpringUtils.getBean(MatService.class);
        Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, matnr));
        if (Cools.isEmpty(mat)){
            throw new CoolException("品号:"+matnr+"不存在,请先新增商品档案!!!");
        }
        String matax = "";
        try{
            matax =  excel.getMatax();
            matax =  mat.getMaktx();
        } catch (Exception e){
            matax = "";
        }
@@ -93,7 +101,7 @@
        s[0] = matnr;
        s[1] = matax;
        s[2] = anfme;
        OutLocBoxCs.add(s);
        printMatList.add(s);
        total++;
        totalAnfme = totalAnfme+Integer.parseInt(anfme);
    }
@@ -104,13 +112,13 @@
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext ctx) {
        if (!Cools.isEmpty(OutLocBoxCs) && OutLocBoxCs.size() != 0) {
        if (!Cools.isEmpty(printMatList) && printMatList.size() != 0) {
            LocInPrintMatService locInPrintMatService = SpringUtils.getBean(LocInPrintMatService.class);
            Date now = new Date();
            for (String[] outLocBoxC:OutLocBoxCs){
                String matnr = outLocBoxC[0];
                String matax = outLocBoxC[1];
                String anfme = outLocBoxC[2];
            for (String[] printMat:printMatList){
                String matnr = printMat[0];
                String matax = printMat[1];
                String anfme = printMat[2];
                Integer intAnfme = 1;
                try{
                    Integer intAnfme1 = Integer.parseInt(anfme);