| | |
| | | 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; |
| | |
| | | private int totalAnfme = 0; |
| | | private Long userId; |
| | | private Long hostId; |
| | | List<String[]> OutLocBoxCs = new ArrayList<>(); |
| | | List<String[]> printMatList = new ArrayList<>(); |
| | | |
| | | public LocInPrintMatExcelListener() { |
| | | } |
| | |
| | | } 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 = ""; |
| | | } |
| | |
| | | s[0] = matnr; |
| | | s[1] = matax; |
| | | s[2] = anfme; |
| | | OutLocBoxCs.add(s); |
| | | printMatList.add(s); |
| | | total++; |
| | | totalAnfme = totalAnfme+Integer.parseInt(anfme); |
| | | } |
| | |
| | | */ |
| | | @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); |