| | |
| | | @Override |
| | | public OrderDetailVo findOrderDetailsById(Long id) { |
| | | MallOrderInfo orderInfo = this.baseMapper.selectOrderDetailsById(id); |
| | | if (orderInfo == null || AppContants.DEL_FLAG_Y == orderInfo.getDelFlag()) { |
| | | // if (orderInfo == null || AppContants.DEL_FLAG_Y == orderInfo.getDelFlag()) { |
| | | if (ObjectUtil.isNull(orderInfo)) { |
| | | throw new FebsException("订单不存在"); |
| | | } |
| | | |
| | |
| | | |
| | | if (orderInfo.getDeliveryState() != OrderDeliveryStateEnum.DELIVERY_FINISH.getValue()) { |
| | | throw new FebsException("还未送至自提点"); |
| | | } |
| | | |
| | | List<MallRefundEntity> mallRefundEntities = mallRefundMapper.selectByItemIdAndOrderIdAndState(null, orderInfo.getId(), 3); |
| | | if(CollUtil.isNotEmpty(mallRefundEntities)){ |
| | | throw new FebsException("请先处理退款商品"); |
| | | } |
| | | |
| | | orderInfo.setStatus(OrderStatusEnum.FINISH.getValue()); |
| | |
| | | return new FebsResponse().success().message("已申请"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse cancelRefundOrder(Long id) { |
| | | MallRefundEntity mallRefundEntity = mallRefundMapper.selectById(id); |
| | | mallRefundEntity.setState(2); |
| | | mallRefundMapper.updateById(mallRefundEntity); |
| | | Long itemId = mallRefundEntity.getItemId(); |
| | | MallOrderItem mallOrderItem = mallOrderItemMapper.selectById(itemId); |
| | | mallOrderItem.setState(1); |
| | | mallOrderItemMapper.updateById(mallOrderItem); |
| | | return new FebsResponse().success().message("已取消"); |
| | | } |
| | | |
| | | } |