| | |
| | | import com.zy.asrs.wms.asrs.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.wms.utils.OrderUtils; |
| | | import com.zy.asrs.wms.utils.Utils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | } |
| | | |
| | | orderDetl.setStockIndex(Utils.getMatUniqueKey(matnr, batch, orderDetl.getUniqueField())); |
| | | if (!orderDetlService.updateById(orderDetl)) { |
| | | throw new CoolException("更新明细索引失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | return true; |
| | |
| | | @Override |
| | | public boolean updateOrder(UpdateOrderParam param) { |
| | | Order order = this.getOne(new LambdaQueryWrapper<Order>().eq(Order::getId, param.getOrderId())); |
| | | if (order == null) { |
| | | throw new CoolException("订单不存在"); |
| | | } |
| | | |
| | | if (order.getHasWave() == 1) { |
| | | throw new CoolException("订单已经生成波次,无法修改"); |
| | | } |
| | | |
| | | order.setOrderType(param.getOrderType()); |
| | | order.setOrderSettle(param.getOrderSettle()); |
| | | order.setUpdateTime(new Date()); |
| | |
| | | } |
| | | } |
| | | |
| | | orderDetl.setStockIndex(Utils.getMatUniqueKey(matnr, batch, orderDetl.getUniqueField())); |
| | | if (!orderDetlService.updateById(orderDetl)) { |
| | | throw new CoolException("更新明细索引失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | List<Long> deleteDetlId = param.getDeleteDetlId(); |
| | |
| | | |
| | | @Override |
| | | public boolean deleteOrder(Long orderId) { |
| | | Order order = this.getById(orderId); |
| | | if (order.getHasWave() == 1) { |
| | | throw new CoolException("订单已经生成波次,删除失败"); |
| | | } |
| | | |
| | | //删除订单 |
| | | this.removeById(orderId); |
| | | //删除明细 |