| | |
| | | if (!Cools.isEmpty(paramLocDetl.getMatNo())) { |
| | | //查询所有库位状态为F的库位信息 |
| | | List<LocDetl> locDetls=locDetlService.getlocDetlList(paramLocDetl.getMatNo()); |
| | | if (locDetls.size()==0){ |
| | | throw new CoolException("库位状态出错"); |
| | | } |
| | | for (LocDetl locDetl : locDetls) { |
| | | WaitMatout waitMatout = waitMatoutService.selectOne(new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()).eq("seq_no",paramLocDetl.getSeqNo())); |
| | | Double outQty = paramLocDetl.getCount() - waitMatout.getOutQty(); |
| | |
| | | |
| | | if (outQty >= locDetl.getQty()){ |
| | | //生成文档记录 |
| | | stockOut(staNo,new LocDetlDto(locDetl,locDetl.getQty()),ioType,userId); |
| | | stockOut(waitMatout.getBillNo(),staNo,new LocDetlDto(locDetl,locDetl.getQty()),ioType,userId); |
| | | waitMatout.setOutQty(waitMatout.getOutQty() + locDetl.getQty()); |
| | | //修改记录 |
| | | Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()) |
| | | .eq("seq_no",paramLocDetl.getSeqNo())); |
| | | }else { |
| | | //生成文档记录 |
| | | stockOut(staNo,new LocDetlDto(locDetl,outQty),ioType,userId); |
| | | stockOut(waitMatout.getBillNo(),staNo,new LocDetlDto(locDetl,outQty),ioType,userId); |
| | | waitMatout.setOutQty(waitMatout.getOutQty() + outQty); |
| | | //修改记录 |
| | | Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()) |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, LocDetlDto locDetlDtos, Integer ioType, Long userId) { |
| | | public void stockOut(String billNo,BasDevp staNo, LocDetlDto locDetlDtos, Integer ioType, Long userId) { |
| | | // 生成工作档 |
| | | LocDetl locDetl=locDetlDtos.getLocDetl(); |
| | | // 获取库位 |
| | |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(new Date()); |
| | | wrkDetl.setBillNo(billNo); |
| | | wrkDetl.setModiUser(userId); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |