| | |
| | | } |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | for (OrderDetl orderDetl : param.getOrderDetlList()) { |
| | | if (orderDetl.getBatch() == null) { |
| | | orderDetl.setBatch(""); |
| | | } |
| | | DetlDto dto = new DetlDto(orderDetl.getMatnr(), orderDetl.getBatch()); |
| | | if (DetlDto.has(list, dto)) { |
| | | OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch()); |
| | |
| | | combMat.setBatch(""); |
| | | } |
| | | } |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | Integer sum = orderDetlService.sameOrderComb(param.getOrderNo(), combMat.getMatnr(),combMat.getBatch()); |
| | | OrderDetl orderDetl = orderDetlService.selectItem(param.getOrderNo(), combMat.getMatnr(), combMat.getBatch()); |
| | | if ( combMat.getAnfme() > (orderDetl.getAnfme() - sum)) { |
| | | throw new CoolException("组托数量已超出订单需求量,请检查是否有其他的组托已完成"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Date now = new Date(); |
| | |
| | | } |
| | | // 关联组托 |
| | | } else { |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | Integer sum = orderDetlService.sameOrderComb(param.getOrderNo(), combMat.getMatnr(),combMat.getBatch()); |
| | | OrderDetl orderDetl = orderDetlService.selectItem(param.getOrderNo(), combMat.getMatnr(), combMat.getBatch()); |
| | | if (orderDetl == null) { |
| | | throw new CoolException("找不到组托的单据明细"); |
| | | |
| | | } |
| | | Double anfme = orderDetl.getAnfme(); |
| | | if ( anfme > (anfme - sum)) { |
| | | throw new CoolException("组托数量已超出订单需求量,请检查是否有其他的组托已完成"); |
| | | } |
| | | } |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | if (order.getSettle() > 2) { |
| | | throw new CoolException("单据编号已过期"); |
| | |
| | | integer = rowLastnoService.selectNextWhsType(); |
| | | BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>() |
| | | .eq("crn_no", i)); |
| | | if (crn_no.getInEnable().equals("Y")){ |
| | | if (crn_no.getInEnable().equals("Y") && crn_no.getCrnSts().equals("3")){ |
| | | break; |
| | | } |
| | | } |
| | |
| | | public StartupDto emptyPlateIn(Integer devpNo, LocTypeDto locTypeDto, String barcode) { |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); |
| | | int rowCount = rowLastnoService.selectCount(null); |
| | | Integer integer = 1; |
| | | for (int i = 1; i <= rowCount; i++) { |
| | | integer = rowLastnoService.selectNextWhsType(); |
| | | BasCrnp crn_no = basCrnpService.selectOne(new EntityWrapper<BasCrnp>() |
| | | .eq("crn_no", i)); |
| | | if (crn_no.getInEnable().equals("Y") && crn_no.getCrnSts().equals("3")){ |
| | | break; |
| | | } |
| | | } |
| | | // 检索库位 |
| | | StartupDto dto = commonService.getLocNo(1, 10, devpNo, null, locTypeDto,0); |
| | | StartupDto dto = commonService.getLocNo(integer, 10, devpNo, null, locTypeDto,0); |
| | | int workNo = dto.getWorkNo(); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |