| | |
| | | dtos.add(new OutLocDto(locNo, list)); |
| | | } |
| | | |
| | | if(ioType == 107) { |
| | | //获取当前时间戳 |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | String temp = sf.format(new Date()); |
| | | //获取3位随机数 |
| | | Random rand = new Random(); |
| | | Integer r = rand.nextInt(900) + 100; |
| | | String billNo = temp + r; |
| | | //生成盘点通知档 |
| | | for (LocDetlDto locDetlDto : locDetlDtos) { |
| | | // String replace = UUID.randomUUID().toString().replace("-", ""); |
| | | LocDetl locDetl = locDetlDto.getLocDetl(); |
| | | |
| | | //////插入盘点档前,将通知档之前相同库位数据转历史档 |
| | | List<WaitMatchk> waitMatchks = waitMatchkService.selectList(new EntityWrapper<WaitMatchk>().eq("loc_no",locDetl.getLocNo())); |
| | | for(WaitMatchk one : waitMatchks){ |
| | | waitMatchkLogService.save(one.getBillNo(),one.getLocNo(),one.getMatNo()); |
| | | waitMatchkService.delete(new EntityWrapper<WaitMatchk>().eq("bill_no",one.getBillNo()).eq("loc_no",one.getLocNo()).eq("mat_no",one.getMatNo())); |
| | | } |
| | | |
| | | //生成盘点档 |
| | | WaitMatchk waitMatchk = new WaitMatchk(); |
| | | waitMatchk.setBillNo(billNo);//订单编号 |
| | | waitMatchk.setLocNo(locDetl.getLocNo());//库位号 |
| | | waitMatchk.setStockQty(locDetl.getQty()); |
| | | waitMatchk.setMatNo(locDetl.getMatNo());//产品编号 |
| | | waitMatchk.setMatName(locDetl.getMatName());//铲平名称 |
| | | waitMatchk.setSeqNo(i); |
| | | // waitMatchk.setIoTime(new Date()); |
| | | waitMatchk.setZpallet(locDetl.getZpallet()); |
| | | waitMatchk.setAppeUser(userId); // 操作人员数据 |
| | | waitMatchk.setAppeTime(new Date()); |
| | | waitMatchk.setModiUser(userId); |
| | | waitMatchk.setModiTime(new Date()); |
| | | if (!waitMatchkService.insert(waitMatchk)) { |
| | | throw new CoolException("保存盘点档失败"); |
| | | } |
| | | i++; |
| | | } |
| | | } |
| | | |
| | | // 生成工作档 |
| | | for (OutLocDto dto : dtos) { |
| | | |
| | |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "库位不是在库状态"); |
| | | } |
| | | |
| | | if(ioType == 107) { |
| | | //获取当前时间戳 |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | String temp = sf.format(new Date()); |
| | | //获取3位随机数 |
| | | Random rand = new Random(); |
| | | Integer r = rand.nextInt(900) + 100; |
| | | String billNo = temp + r; |
| | | //生成盘点通知档 |
| | | for (LocDetlDto locDetlDto : locDetlDtos) { |
| | | // String replace = UUID.randomUUID().toString().replace("-", ""); |
| | | LocDetl locDetl = locDetlDto.getLocDetl(); |
| | | |
| | | //////插入盘点档前,将通知档之前相同库位数据转历史档 |
| | | List<WaitMatchk> waitMatchks = waitMatchkService.selectList(new EntityWrapper<WaitMatchk>().eq("loc_no",locDetl.getLocNo())); |
| | | for(WaitMatchk one : waitMatchks){ |
| | | waitMatchkLogService.save(one.getBillNo(),one.getLocNo(),one.getMatNo()); |
| | | waitMatchkService.delete(new EntityWrapper<WaitMatchk>().eq("bill_no",one.getBillNo()).eq("loc_no",one.getLocNo()).eq("mat_no",one.getMatNo())); |
| | | } |
| | | |
| | | //生成盘点档 |
| | | WaitMatchk waitMatchk = new WaitMatchk(); |
| | | waitMatchk.setBillNo(billNo);//订单编号 |
| | | waitMatchk.setLocNo(locDetl.getLocNo());//库位号 |
| | | waitMatchk.setStockQty(locDetl.getQty()); |
| | | waitMatchk.setMatNo(locDetl.getMatNo());//产品编号 |
| | | waitMatchk.setMatName(locDetl.getMatName());//铲平名称 |
| | | waitMatchk.setSeqNo(i); |
| | | // waitMatchk.setIoTime(new Date()); |
| | | waitMatchk.setZpallet(locDetl.getZpallet()); |
| | | waitMatchk.setAppeUser(userId); // 操作人员数据 |
| | | waitMatchk.setAppeTime(new Date()); |
| | | waitMatchk.setModiUser(userId); |
| | | waitMatchk.setModiTime(new Date()); |
| | | if (!waitMatchkService.insert(waitMatchk)) { |
| | | throw new CoolException("保存盘点档失败"); |
| | | } |
| | | i++; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |