| | |
| | | private StationRelaService stationRelaService; |
| | | @Autowired |
| | | private BasStationDetlService basStationDetlService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void comb(CombParam param, Long userId) { |
| | | // if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { |
| | | // throw new CoolException(BaseRes.PARAM); |
| | | // } |
| | | if (Objects.isNull(param.getBarcode())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | |
| | | Date now = new Date(); |
| | | // 无单组托 |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | //空板组托 |
| | | if (param.getPakinType().equals("3")) { |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.setZpallet(param.getBarcode()); |
| | |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(locDetl.getLocNo()); |
| | | // 获取路径 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", ioType) |
| | | .eq("stn_no", staNo.getDevNo()) |
| | | .eq("crn_no", locMast.getCrnNo()); |
| | | |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | throw new CoolException("出库路径不存在"); |
| | | } |
| | | // Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | // .eq("type_no", ioType) |
| | | // .eq("stn_no", staNo.getDevNo()) |
| | | // .eq("crn_no", locMast.getCrnNo()); |
| | | // |
| | | // StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | // if (Cools.isEmpty(staDesc)) { |
| | | // throw new CoolException("出库路径不存在"); |
| | | // } |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(2); |
| | | // 生成工作档 |
| | |
| | | wrkMast.setIoType(ioType); // 入出库状态 |
| | | wrkMast.setIoPri(13D); // 优先级:13 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | wrkMast.setSourceStaNo(staDesc.getCrnStn() + ""); // 源站 |
| | | wrkMast.setStaNo(staDesc.getStnNo() + ""); // 目标站 |
| | | // wrkMast.setSourceStaNo(staDesc.getCrnStn() + ""); // 源站 |
| | | // wrkMast.setStaNo(staDesc.getStnNo() + ""); // 目标站 |
| | | wrkMast.setSourceLocNo(locDetl.getLocNo()); // 源库位 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | |
| | | .eq("area_id", basAreas.getId()) |
| | | .eq("loc_no", locCache.getLocNo())); |
| | | if (Objects.isNull(locDetls) || locDetls.isEmpty()) { |
| | | throw new CoolException("库存明细不存在!!"); |
| | | continue; |
| | | // throw new CoolException("库存明细不存在!!"); |
| | | } |
| | | |
| | | Set<String> set = locDetls.stream().map(LocDetl::getMatnr).collect(Collectors.toSet()); |
| | |
| | | whsType = 2; |
| | | } |
| | | |
| | | WrkMast barcode = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode())); |
| | | if (!Objects.isNull(barcode) && (barcode.getIoType() == 104 || barcode.getIoType() == 103 || barcode.getIoType() == 107) && barcode.getWrkSts() == 14L) { |
| | | // |
| | | workService.pickWrkMast(barcode.getWrkNo() + "", userId); |
| | | |
| | | Map<String, Object> response = new HashMap<>(); |
| | | response.put("taskNo", barcode.getWrkNo()); |
| | | response.put("locNo", barcode.getLocNo()); |
| | | response.put("taskPri", barcode.getIoPri()); |
| | | |
| | | return R.ok("任务生成成功").add(response); |
| | | } else { |
| | | log.info("WCS任务生成请求参数:{}", JSONObject.toJSONString(param)); |
| | | |
| | | BasDevp station = basDevpService.selectOne(new EntityWrapper<BasDevp>() |
| | |
| | | if (Objects.isNull(station)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | Map<String, Object> response = new HashMap<>(); |
| | | |
| | | if (Objects.isNull(barcode)) { |
| | | List<WaitPakin> waitPakins = waitPakinService |
| | | .selectList(new EntityWrapper<WaitPakin>() |
| | | .eq("io_status", "N") |
| | |
| | | |
| | | WrkMast wrkMast = generateCrnInTask(waitPakins,whsType, station, param.getLocType1(), userId); |
| | | |
| | | Map<String, Object> response = new HashMap<>(); |
| | | response.put("taskNo", wrkMast.getWrkNo()); |
| | | response.put("locNo", wrkMast.getLocNo()); |
| | | response.put("taskPri", wrkMast.getIoPri()); |
| | | } else { |
| | | response.put("taskNo", barcode.getWrkNo()); |
| | | response.put("locNo", barcode.getLocNo()); |
| | | response.put("taskPri", barcode.getIoPri()); |
| | | } |
| | | |
| | | return R.ok("任务生成成功").add(response); |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 6.15WCS申请在库库位更换库位 |
| | | * |
| | | * @param combParam |
| | | * @param l |
| | | * @return |