| | |
| | | @RequestMapping("/plate/out/start") |
| | | @ManagerAuth(memo = "出库作业") |
| | | public R fullStoreTakeStart(@RequestBody StockOutParam param) { |
| | | workService.startupFullTakeStore(param, getUserId()); |
| | | //workService.startupFullTakeStore(param, getUserId()); |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | |
| | |
| | | private Double count; |
| | | |
| | | // |
| | | |
| | | private String containerCode; |
| | | } |
| | | |
| | | } |
| | |
| | | @Repository |
| | | public interface LocDetlMapper extends BaseMapper<LocDetl> { |
| | | |
| | | LocDetl selectItem(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | | LocDetl selectItem(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch,@Param("suppCode")String suppCode); |
| | | |
| | | int deleteItem(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | | |
| | |
| | | |
| | | public interface LocDetlService extends IService<LocDetl> { |
| | | |
| | | LocDetl selectItem(String locNo, String matnr, String batch); |
| | | LocDetl selectItem(String locNo, String matnr, String batch,String suppCode); |
| | | |
| | | Page<LocDetl> getStockOut(Page<LocDetl> page); |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public LocDetl selectItem(String locNo, String matnr, String batch) { |
| | | return this.baseMapper.selectItem(locNo, matnr, batch); |
| | | public LocDetl selectItem(String locNo, String matnr, String batch,String suppCode) { |
| | | return this.baseMapper.selectItem(locNo, matnr, batch,suppCode); |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch()); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | //LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch()); |
| | | // if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | } |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | |
| | | // 生成工作档明细 |
| | | for (LocDto locDto : taskDto.getLocDtos()) { |
| | | if (locDto.getAnfme()==null || locDto.getAnfme() <= 0.0D) { continue; } |
| | | LocDetl locDetl = locDetlService.selectItem(locDto.getLocNo(), locDto.getMatnr(), locDto.getBatch()); |
| | | LocDetl locDetl = locDetlService.selectItem(locDto.getLocNo(), locDto.getMatnr(), locDto.getBatch(), locDto.getContainerCode()); |
| | | if (locDetl == null || locDetl.getAnfme() < locDto.getAnfme()) { |
| | | throw new CoolException(locDto.getLocNo() + "库位中" + locDto.getMatnr() + "商品库存不足!"); |
| | | } |
| | |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch()); |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch(),paramLocDetl.getContainerCode()); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | } |
| | | } |
| | |
| | | } |
| | | // 遍历工作明细,更新库存明细和入库通知档 |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), wrkMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) { |
| | | exceptionHandle("全板入库 ===>> 更新库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | } else { |
| | | locDetl = new LocDetl(); |
| | | LocDetl locDetl = new LocDetl(); |
| | | locDetl.sync(wrkDetl); |
| | | locDetl.setLocNo(wrkMast.getLocNo()); // 库位号 |
| | | locDetl.setAnfme(wrkDetl.getAnfme()); // 数量 |
| | |
| | | if (!locDetlService.insert(locDetl)) { |
| | | exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 更新入库通知档 ioStatus ===>> Y |
| | | try { |
| | |
| | | } |
| | | for (WrkDetl wrkDetl : wrkDetls53) { |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getSuppCode()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) { |
| | | exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | |
| | | // 修改库存明细数量,如无库存,曾新增 |
| | | for (WrkDetl wrkDetl:wrkDetls54) { |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getSuppCode()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) { |
| | | exceptionHandle("并板入库 ===>> 修改库存明细数量失败;[workNo={0}],[matnr={1}]", wrkMast.getWrkNo(), wrkDetl.getMatnr()); |
| | |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <choose> |
| | | <when test="suppCode != null and suppCode != ''"> |
| | | and supp_code = #{suppCode} |
| | | </when> |
| | | </choose> |
| | | <include refid="batchSeq"></include> |
| | | </select> |
| | | |