| | |
| | | @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("订单不存在"); |
| | | } |
| | | |
| | |
| | | throw new FebsException("还未送至自提点"); |
| | | } |
| | | |
| | | List<MallRefundEntity> mallRefundEntities = mallRefundMapper.selectByItemIdAndOrderIdAndState(null, orderInfo.getId(), 3); |
| | | if(CollUtil.isNotEmpty(mallRefundEntities)){ |
| | | throw new FebsException("请先处理退款商品"); |
| | | } |
| | | |
| | | orderInfo.setStatus(OrderStatusEnum.FINISH.getValue()); |
| | | orderInfo.setReceivingTime(new Date()); |
| | | this.baseMapper.updateById(orderInfo); |
| | |
| | | Long orderInfoId = orderInfo.getId(); |
| | | List<MallOrderItem> mallOrderItemList = mallOrderItemMapper.selectListByOrderId(orderInfoId); |
| | | if(CollUtil.isNotEmpty(mallOrderItemList)){ |
| | | DataDictionaryCustom dicBonusPercent = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.BONUS_PERCENT.getType(), DataDictionaryEnum.BONUS_PERCENT.getCode()); |
| | | BigDecimal bonusPercent = new BigDecimal(dicBonusPercent.getValue()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | |
| | | MallTeamLeader mallTeamLeader = mallTeamLeaderMapper.selectLeaderByUniqueCode(orderInfo.getTakeUniqueCode()); |
| | | BigDecimal bonusPercent =new BigDecimal(mallTeamLeader.getBonusPercent()==null?"0":mallTeamLeader.getBonusPercent()); |
| | | // DataDictionaryCustom dicBonusPercent = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.BONUS_PERCENT.getType(), DataDictionaryEnum.BONUS_PERCENT.getCode()); |
| | | // BigDecimal bonusPercent = new BigDecimal(dicBonusPercent.getValue()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | for(MallOrderItem mallOrderItem : mallOrderItemList){ |
| | | Integer state = mallOrderItem.getState() == null ? 1 : mallOrderItem.getState(); |
| | | if(1 == state){ |
| | |
| | | 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("已取消"); |
| | | } |
| | | |
| | | } |