| | |
| | | taskDtos.add(taskDto); |
| | | } |
| | | } |
| | | // ----------------------------------------------------------------------------------------------- |
| | | for (TaskDto taskDto : taskDtos) { |
| | | |
| | | |
| | | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | * @param locDetls 待出库物料 |
| | | * @param ioType 入出库类型 |
| | | */ |
| | | void stockOut(BasDevp staNo, List<LocDetlDto> locDetls, Integer ioType, Long userId, String allotNo, Boolean sell, Double more); |
| | | void stockOut(BasDevp staNo, List<LocDetlDto> locDetls, Integer ioType, Long userId); |
| | | |
| | | /** |
| | | * 空板入库 |
| | |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | // 启动出库开始 101.出库 |
| | | stockOut(staNo, locDetlDtos, null, userId, null, false, null); |
| | | stockOut(staNo, locDetlDtos, null, userId); |
| | | } else { |
| | | throw new CoolException("库位物料不存在"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, Integer ioType, Long userId, String allotNo, Boolean sell, Double more) { |
| | | public void stockOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, Integer ioType, Long userId) { |
| | | // 合并同类项 |
| | | Set<String> locNos = new HashSet<>(); |
| | | locDetlDtos.forEach(dto -> locNos.add(dto.getLocDetl().getLocNo())); |
| | |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setPacked(allotNo); // 平仓补仓单号 |
| | | wrkMast.setPdcType(sell?"Y":"N"); // ERP销售订单出库任务 |
| | | wrkMast.setRefWrkno(more==null?0.0D:more); |
| | | wrkMast.setAppeUser(userId); // 操作人员数据 |
| | | wrkMast.setAppeTime(new Date()); |
| | | wrkMast.setModiUser(userId); |
| | |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | // 启动出库开始 107.盘点出库 |
| | | stockOut(staNo, locDetlDtos, 107, userId, null, false, null); |
| | | stockOut(staNo, locDetlDtos, 107, userId); |
| | | } else { |
| | | throw new CoolException("库位物料不存在"); |
| | | } |
| | |
| | | dto.setLocDetl(locDetl); |
| | | dto.setCount(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); |
| | | detlDtos.add(dto); |
| | | stockOut(staNo, detlDtos, 101, 9527L, null, true, null); |
| | | stockOut(staNo, detlDtos, 101, 9527L); |
| | | // 拣料 |
| | | } else { |
| | | int priorCount = jdbcTemplate.queryForObject("select isnull(count(*),0) from man_prior where 1=1 and matnr = '" + wrkDetl.getMatnr() + "'", Integer.class); |
| | |
| | | dto.setLocDetl(locDetl); |
| | | dto.setCount(locDetl.getAnfme()); |
| | | detlDtos.add(dto); |
| | | stockOut(staNo, detlDtos, 101, 9527L,null, true,locDetl.getAnfme()-issued); |
| | | stockOut(staNo, detlDtos, 101, 9527L); |
| | | } else { |
| | | BasDevp staNo = basDevpService.checkSiteStatus(pickSite?113:109); |
| | | List<LocDetlDto> detlDtos = new ArrayList<>(); |
| | |
| | | dto.setLocDetl(locDetl); |
| | | dto.setCount(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); |
| | | detlDtos.add(dto); |
| | | stockOut(staNo, detlDtos, 103, 9527L, null, true, null); |
| | | stockOut(staNo, detlDtos, 103, 9527L); |
| | | } |
| | | |
| | | } |