| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | order.setShipCode(param.getQuality()); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | // 单据明细档 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getOrderDetails(); |
| | | List<DetlDto> orderDetails = param.getDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme(),detail.getFromOrderNo() |
| | | , detail.getMark(),detail.getCustomer(),detail.getSuppName(),detail.getTemp1(),detail.getTemp2(),detail.getTemp3(),detail.getTemp4()); |
| | |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | order.setShipCode(param.getQuality()); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | // 单据明细档 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getOrderDetails(); |
| | | List<DetlDto> orderDetails = param.getDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme(),detail.getFromOrderNo() |
| | | , detail.getMark(),detail.getCustomer(),detail.getSuppName(),detail.getTemp1(),detail.getTemp2(),detail.getTemp3(),detail.getTemp4()); |
| | | dto.setTemp1(param.getQuality()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
| | |
| | | } |
| | | }); |
| | | } |
| | | @Transactional |
| | | @Override |
| | | public void orderDelete(String orderNo) { |
| | | Order order = orderService.selectByNo(orderNo); |
| | | if (order == null) { |
| | | throw new CoolException("未查询到对应订单信息"); |
| | | } |
| | | if (order.getSettle() != 1){ |
| | | throw new CoolException("该订单已有对应任务,禁止删除"); |
| | | } |
| | | List<OrderDetl> OrderDetl = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no", orderNo)); |
| | | if (!Cools.isEmpty(OrderDetl)) { |
| | | orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_no", orderNo)); |
| | | } |
| | | orderService.delete(new EntityWrapper<Order>().eq("order_no", orderNo)); |
| | | } |
| | | } |