| | |
| | | private TagMapper tagMapper; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WrkMastLogServiceImpl wrkMastLogService; |
| | | @Autowired |
| | | private WrkDetlLogServiceImpl wrkDetlLogService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | |
| | | Date now = new Date(); |
| | | Mat mat = matService.selectByMatnr(matParam.getMatnr()); |
| | | if (mat == null) { |
| | | mat = new Mat(); |
| | | // 分类 |
| | | Long tagId; |
| | | // 一级分类 |
| | |
| | | } |
| | | } |
| | | // 二级分类 |
| | | Tag secTag = tagService.selectByName(matParam.getGroupName(), 3); |
| | | Tag secTag = tagService.selectByName(matParam.getGroupName(), 2); |
| | | if (secTag == null) { |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(priTag.getId()); |
| | |
| | | null, // 图片 |
| | | null, // 简要描述 |
| | | null, // 数量 |
| | | 3, // 等级 |
| | | 2, // 等级 |
| | | null, // 排序 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | |
| | | } else { |
| | | tagId = tagService.getTop().getId(); |
| | | } |
| | | if (mat == null) { |
| | | mat = new Mat(); |
| | | |
| | | mat.sync(matParam); |
| | | // mat.setMatnr(param.getMatnr()); |
| | | // mat.setMaktx(param.getMaktx()); |
| | |
| | | } |
| | | } else { |
| | | mat.sync(matParam); |
| | | mat.setTagId(tagId); |
| | | if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr",matParam.getMatnr()))) { |
| | | throw new CoolException("更新已存在商品信息失败,请联系管理员"); |
| | | } |
| | |
| | | @Override |
| | | public List<LocDetlByTimeDTO> selectTimeLocDetl(TimeSelectParam param) { |
| | | ArrayList<LocDetlByTimeDTO> locDetlByTimeDTOS = new ArrayList<>(); |
| | | EntityWrapper<LocDetl> locDetlEntityWrapper = new EntityWrapper<>(); |
| | | locDetlEntityWrapper.ge("appe_time",param.getStartTime()); |
| | | locDetlEntityWrapper.le("appe_time",param.getEndTime()); |
| | | List<LocDetl> locDetls = locDetlService.selectList(locDetlEntityWrapper); |
| | | if (!Cools.isEmpty(locDetls)) { |
| | | for (LocDetl locDetl : locDetls) { |
| | | EntityWrapper<WrkMastLog> wrkMastLogEntityWrapper = new EntityWrapper<>(); |
| | | wrkMastLogEntityWrapper.ge("appe_time",param.getStartTime()); |
| | | wrkMastLogEntityWrapper.le("appe_time",param.getEndTime()); |
| | | wrkMastLogEntityWrapper.isNotNull("sheet_no"); |
| | | wrkMastLogService.selectList(wrkMastLogEntityWrapper).forEach(wrkMastLog -> { |
| | | List<WrkDetlLog> wrkDetlLogs = wrkDetlLogService.selectList(new EntityWrapper<WrkDetlLog>() |
| | | .eq("wrk_no", wrkMastLog.getWrkNo()).eq("zpallet", wrkMastLog.getBarcode())); |
| | | wrkDetlLogs.forEach(wrkDetlLog -> { |
| | | LocDetlByTimeDTO locDetlByTimeDTO = new LocDetlByTimeDTO(); |
| | | if (!Cools.isEmpty(locDetl.getOrderNo())){ |
| | | Order order = orderService.selectByNo(locDetl.getOrderNo()); |
| | | Order order = orderService.selectByNo(wrkMastLog.getSheetNo()); |
| | | if (!Cools.isEmpty(order)) { |
| | | locDetlByTimeDTO.setDate(order.getOrderTime()); |
| | | locDetlByTimeDTO.setWarehouse(order.getItemName()); |
| | | locDetlByTimeDTO.setOrderType(order.getDocType().toString()); |
| | | } |
| | | } |
| | | |
| | | locDetlByTimeDTO.setMatnr(locDetl.getMatnr()); |
| | | locDetlByTimeDTO.setLocNo(locDetl.getLocNo()); |
| | | locDetlByTimeDTO.setBatch(locDetl.getBatch()); |
| | | locDetlByTimeDTO.setAnfme(locDetl.getAnfme()); |
| | | locDetlByTimeDTO.setOrderNo(locDetl.getOrderNo()); |
| | | locDetlByTimeDTO.setMatnr(wrkDetlLog.getMatnr()); |
| | | locDetlByTimeDTO.setLocNo(wrkMastLog.getIoType() <100? wrkMastLog.getLocNo(): wrkMastLog.getSourceLocNo()); |
| | | locDetlByTimeDTO.setBatch(wrkDetlLog.getBatch()); |
| | | locDetlByTimeDTO.setAnfme(wrkDetlLog.getAnfme()); |
| | | locDetlByTimeDTO.setOrderNo(wrkMastLog.getSheetNo()); |
| | | locDetlByTimeDTOS.add(locDetlByTimeDTO); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | // if (!Cools.isEmpty(locDetls)) { |
| | | // for (LocDetl locDetl : locDetls) { |
| | | // |
| | | // if (!Cools.isEmpty(locDetl.getOrderNo())){ |
| | | // Order order = orderService.selectByNo(locDetl.getOrderNo()); |
| | | // if (!Cools.isEmpty(order)) { |
| | | // locDetlByTimeDTO.setDate(order.getOrderTime()); |
| | | // locDetlByTimeDTO.setWarehouse(order.getItemName()); |
| | | // locDetlByTimeDTO.setOrderType(order.getDocType().toString()); |
| | | // } |
| | | // } |
| | | // |
| | | // locDetlByTimeDTO.setMatnr(locDetl.getMatnr()); |
| | | // locDetlByTimeDTO.setLocNo(locDetl.getLocNo()); |
| | | // locDetlByTimeDTO.setBatch(locDetl.getBatch()); |
| | | // locDetlByTimeDTO.setAnfme(locDetl.getAnfme()); |
| | | // locDetlByTimeDTO.setOrderNo(locDetl.getOrderNo()); |
| | | // locDetlByTimeDTOS.add(locDetlByTimeDTO); |
| | | // } |
| | | // } |
| | | return locDetlByTimeDTOS; |
| | | } |
| | | |