| | |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.TagService; |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.entity.OutLocBoxExcel; |
| | | import com.zy.common.model.LocDto; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | public void doAfterAllAnalysed(AnalysisContext ctx) { |
| | | if (!Cools.isEmpty(OutLocBoxCs) && OutLocBoxCs.size() != 0) { |
| | | LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class); |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | WorkService workService = SpringUtils.getBean(WorkService.class); |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | List<String[]> outLocBoxCList = new ArrayList<>(); |
| | |
| | | LocDetl locDetlSou = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch", outLocBoxC[0])); |
| | | if (Cools.isEmpty(locDetlSou)){ |
| | | throw new CoolException("箱号:"+outLocBoxC[0]+" 未查询到数据!!!"); |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlSou.getLocNo())); |
| | | if (Cools.isEmpty(locMast)){ |
| | | throw new CoolException("箱号:"+outLocBoxC[0]+" 所在库位不满足出库条件!!!未查询到此箱号所在库位"); |
| | | } |
| | | if (!locMast.getLocSts().equals("F")){ |
| | | throw new CoolException("箱号:"+outLocBoxC[0]+" 所在库位不满足出库条件!!!库位状态不为F!!!库位状态:"+locMast.getLocSts$()); |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locDetlSou.getLocNo()).eq("origin", locDetlSou.getOrigin())); |
| | |
| | | |
| | | StockOutParam param = new StockOutParam(); |
| | | ArrayList<StockOutParam.LocDetl> locDetls = new ArrayList<>(); |
| | | for (LocDto locDto:locDtos){ |
| | | List<LocDto> locDtosList = new ArrayList<>(); |
| | | List<String> batchList = new ArrayList<>(); |
| | | for (LocDto locDto : locDtos) { |
| | | if (!batchList.contains(locDto.getBatch())){ |
| | | batchList.add(locDto.getBatch()); |
| | | locDtosList.add(locDto); |
| | | } |
| | | } |
| | | for (LocDto locDto:locDtosList){ |
| | | StockOutParam.LocDetl locDetl = new StockOutParam.LocDetl(); |
| | | locDetl.setBrand(locDto.getBrand()); |
| | | locDetl.setLocNo(locDto.getLocNo()); |