| | |
| | | package com.zy.asrs.wms.asrs.service.impl;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
| | | import com.zy.asrs.framework.common.Cools;
|
| | | import com.zy.asrs.framework.exception.CoolException;
|
| | | import com.zy.asrs.wms.asrs.entity.*;
|
| | | import com.zy.asrs.wms.asrs.entity.dto.OrderInfoDto;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.OrderSettleType;
|
| | | import com.zy.asrs.wms.asrs.entity.enums.OrderType;
|
| | | import com.zy.asrs.wms.asrs.entity.param.CreateOrderParam;
|
| | | import com.zy.asrs.wms.asrs.entity.param.UpdateOrderParam;
|
| | | import com.zy.asrs.wms.asrs.mapper.OrderMapper;
|
| | |
| | | private OrderNoRuleService orderNoRuleService;
|
| | | @Autowired
|
| | | private OrderUtils orderUtils;
|
| | | @Autowired
|
| | | private WaitPakinService waitPakinService;
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | |
| | | Order order = new Order();
|
| | | order.setOrderNo(orderNo);
|
| | | order.setOrderType(param.getOrderType());
|
| | | order.setCustomer(param.getCustomer());
|
| | | order.setPhone(param.getPhone());
|
| | | order.setAddress(param.getAddress());
|
| | | order.setOrderSettle(OrderSettleType.INIT.val());
|
| | | order.setIoPri(orderUtils.getIoPri());
|
| | | order.setOrderTime(format.format(new Date()));
|
| | |
| | | throw new CoolException("订单已经生成波次,删除失败");
|
| | | }
|
| | |
|
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getOrderId, orderId));
|
| | | if (!waitPakins.isEmpty()) {
|
| | | throw new CoolException("单据已生成组托,不可执行删除操作!!");
|
| | | }
|
| | | //删除订单
|
| | | this.removeById(orderId);
|
| | | //删除明细
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<OrderInfoDto> getDetlForOrderId(Long id) {
|
| | | return this.baseMapper.getDetlForOrderId(id);
|
| | | public List<OrderInfoDto> getDetlForOrderId(Long id, String matnr) {
|
| | | if (!Objects.isNull(matnr)) {
|
| | | Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>()
|
| | | .eq(StringUtils.isNotBlank(matnr), Mat::getMatnr, matnr), false);
|
| | | if (Objects.isNull(mat)) {
|
| | | return this.baseMapper.getDetlForOrderId(id, null);
|
| | | } else {
|
| | | return this.baseMapper.getDetlForOrderId(id, mat.getId());
|
| | | }
|
| | | } else {
|
| | | return this.baseMapper.getDetlForOrderId(id, null);
|
| | | }
|
| | | }
|
| | | }
|