| | |
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
| | | import com.zy.asrs.framework.exception.CoolException;
|
| | | import com.zy.asrs.wms.asrs.entity.*;
|
| | | import com.zy.asrs.wms.asrs.entity.dto.PickSheetDetlDto;
|
| | |
| | | import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam;
|
| | | import com.zy.asrs.wms.asrs.entity.param.PakinOnShelvesParams;
|
| | | import com.zy.asrs.wms.asrs.mapper.CacheSiteMapper;
|
| | | import com.zy.asrs.wms.asrs.mapper.OrderDetlMapper;
|
| | | import com.zy.asrs.wms.asrs.mapper.SeedSitesMapper;
|
| | | import com.zy.asrs.wms.asrs.service.*;
|
| | | import com.zy.asrs.wms.system.entity.Host;
|
| | |
| | |
|
| | | @Autowired
|
| | | private SeedSitesMapper seedSitesMapper;
|
| | | @Autowired
|
| | | private OrderDetlMapper orderDetlMapper;
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | |
| | | throw new CoolException("库位没有分配所属仓库区域!!");
|
| | | }
|
| | | locAreas.forEach(locArea -> {
|
| | | LocAreaType typeServiceOne = locAreaTypeService.getOne(new LambdaQueryWrapper<LocAreaType>().eq(LocAreaType::getId, locArea.getTypeId()), false);
|
| | | LocAreaType typeServiceOne = locAreaTypeService.getOne(new LambdaQueryWrapper<LocAreaType>().eq(LocAreaType::getId, locArea.getTypeId()));
|
| | | if (typeServiceOne.getParentId() != LocAreaTypeSts.LOC_AREA_TYPE_FLAT.id && typeServiceOne.getId() != LocAreaTypeSts.LOC_AREA_TYPE_FLAT.id) {
|
| | | throw new CoolException("请选择平库区库位,再操作!!");
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, shelvesParams.getBarcode()));
|
| | | if (waitPakins.isEmpty()) {
|
| | | throw new CoolException("当前拖盘没有组拖档!!");
|
| | | }
|
| | |
|
| | | waitPakins.forEach(pakin -> {
|
| | | LocDetl locDetl = new LocDetl();
|
| | | locDetl.setAnfme(pakin.getAnfme());
|
| | |
| | | if (!waitPakinService.removeBatchByIds(waitPakins)) {
|
| | | throw new CoolException("组拖档删除失败!!");
|
| | | }
|
| | |
|
| | | //通过组拖订单ID获取订单,并删除原单据,加入单据历史档
|
| | | List<Long> list = waitPakins.stream().map(WaitPakin::getOrderId).collect(Collectors.toList());
|
| | | Set<Long> list = waitPakins.stream().map(WaitPakin::getOrderId).collect(Collectors.toSet());
|
| | | List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getId, list));
|
| | | //订单入历史档
|
| | | orders.forEach(order -> {
|
| | | if (order.getOrderType() != OrderType.PK_IN_ORDER.id) {
|
| | | throw new CoolException("当前订单类型:" + order.getOrderType() + ",不可做平库上架操作!!");
|
| | | }
|
| | | OrderLog orderLog = new OrderLog();
|
| | | BeanUtils.copyProperties(order, orderLog);
|
| | | if (!orderLogService.save(orderLog)) {
|
| | |
| | | }
|
| | | });
|
| | |
|
| | | //删除订单数据
|
| | | if (!orderService.removeBatchByIds(orders)) {
|
| | | throw new CoolException("订单删除失败!!");
|
| | | }
|
| | | // //删除订单明细数据
|
| | | // if (orderDetlMapper.delete(new LambdaQueryWrapper<OrderDetl>().in(OrderDetl::getOrderId, list)) < 1) {
|
| | | // throw new CoolException("订单明细删除失败!!");
|
| | | // }
|
| | |
|
| | | return true;
|
| | | }
|