| | |
| | | import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam;
|
| | | import com.zy.asrs.wms.asrs.entity.param.PageRequest;
|
| | | import com.zy.asrs.wms.asrs.entity.param.PakinOnShelvesParams;
|
| | | import com.zy.asrs.wms.asrs.mapper.CacheSiteMapper;
|
| | | import com.zy.asrs.wms.asrs.service.*;
|
| | | import com.zy.asrs.wms.system.entity.Host;
|
| | | import com.zy.asrs.wms.system.service.HostService;
|
| | |
| | | @Autowired
|
| | | private OrderService orderService;
|
| | | @Autowired
|
| | | private OrderDetlService orderDetlService;
|
| | | @Autowired
|
| | | private OrderLogService orderLogService;
|
| | | @Autowired
|
| | | private LocService locService;
|
| | |
| | | private PickSheetService pickSheetService;
|
| | | @Autowired
|
| | | private PickSheetDetlService pickSheetDetlService;
|
| | | @Autowired
|
| | | private MatService matService;
|
| | | @Autowired
|
| | | private WaveService waveService;
|
| | | @Autowired
|
| | | private WaveDetlService waveDetlService;
|
| | | @Autowired
|
| | | private CacheSiteMapper cacheSiteMapper;
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | locDetl.setAnfme(pakin.getAnfme());
|
| | | locDetl.setBatch(pakin.getBatch());
|
| | | locDetl.setMatId(pakin.getMatnrId$());
|
| | | ;
|
| | | locDetl.setCreateTime(new Date());
|
| | | locDetl.setOrderNo(pakin.getOrderNo());
|
| | | locDetl.setLocNo(loc.getLocNo());
|
| | | locDetl.setLocId(loc.getId());
|
| | | locDetl.setMatnr(pakin.getMatnr());
|
| | | Mat one = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, pakin.getMatnr()));
|
| | | if (!Objects.isNull(one)) {
|
| | | throw new CoolException("当前物料不存在!!");
|
| | | }
|
| | | locDetl.setMatId(one.getId());
|
| | | locDetl.setMemo(pakin.getMemo());
|
| | | locDetl.setUpdateTime(new Date());
|
| | | if (!locDetlService.saveOrUpdate(locDetl)) {
|
| | |
| | | if (!waitPakinService.removeBatchByIds(waitPakins)) {
|
| | | throw new CoolException("组拖档删除失败!!");
|
| | | }
|
| | |
|
| | | //通过组拖订单ID获取订单,并删除原单据,加入单据历史档
|
| | | List<Long> list = waitPakins.stream().map(WaitPakin::getOrderId).collect(Collectors.toList());
|
| | | List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getId, list));
|
| | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public boolean confirmFlatSheet(String code) {
|
| | | PickSheet pickSheet = pickSheetService.getOne(new LambdaQueryWrapper<PickSheet>().eq(PickSheet::getPickNo, code));
|
| | | if (Objects.isNull(pickSheet)) {
|
| | | throw new CoolException("拣货单不存在!!");
|
| | | }
|
| | | if (pickSheet.getStatus() == 1) {
|
| | | //状态修改为: 已转历史档
|
| | | pickSheet.setStatus(3);
|
| | |
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | //删除波次及对应明细信息
|
| | | if (!waveService.remove(new LambdaQueryWrapper<Wave>().eq(Wave::getId, pickSheet.getWaveId()))) {
|
| | | throw new CoolException("波次列表单据删除失败!!");
|
| | | }
|
| | |
|
| | | if (!waveDetlService.remove(new LambdaQueryWrapper<WaveDetl>().eq(WaveDetl::getWaveId, pickSheet.getWaveId()))) {
|
| | | throw new CoolException("波次明细列表删除失败!!");
|
| | | }
|
| | |
|
| | | List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().eq(Order::getWaveId, pickSheet.getWaveId()));
|
| | | List<Long> list = orders.stream().map(Order::getId).collect(Collectors.toList());
|
| | | boolean remove = orderDetlService.remove(new LambdaQueryWrapper<OrderDetl>().in(OrderDetl::getOrderId, list));
|
| | | if (!remove) {
|
| | | throw new CoolException("原始订单明细删除失败!!");
|
| | | }
|
| | | if (orderService.remove(new LambdaQueryWrapper<Order>().in(Order::getId, list))) {
|
| | | throw new CoolException("原始订单删除失败!!");
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CacheSite> getSeedLocs() {
|
| | | return cacheSiteMapper.selectList(new LambdaQueryWrapper<>());
|
| | | }
|
| | |
|
| | | /**
|
| | | * 订单绑定播种墙
|
| | | * @param param
|
| | | * @return
|
| | | */
|
| | | @Override
|
| | | public boolean bindOrderBySite(Map<String, Object> param) {
|
| | | // return cacheSiteMapper.bindOrderBySite(param);
|
| | | return false;
|
| | | }
|
| | |
|
| | | }
|