| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void confirmOrder(Long id) { |
| | | MallMember member = LoginUserUtil.getLoginUser(); |
| | | MallOrderInfo orderInfo = this.baseMapper.selectOrderByMemberIdAndId(member.getId(), id); |
| | | if (orderInfo == null || AppContants.DEL_FLAG_Y == orderInfo.getDelFlag()) { |
| | | throw new FebsException("订单不存在"); |
| | | } |
| | | |
| | | if (orderInfo.getStatus() != OrderStatusEnum.WAIT_FINISH.getValue()) { |
| | | throw new FebsException("该状态不能确认收货"); |
| | | } |
| | | |
| | | MallOrderInfo orderInfo = ValidateEntityUtils.ensureColumnReturnEntity(id,MallOrderInfo::getId,this.baseMapper::selectOne,"订单不存在"); |
| | | ValidateEntityUtils.ensureEqual(member.getId(), orderInfo.getMemberId(), "订单数据异常"); |
| | | ValidateEntityUtils.ensureEqual(orderInfo.getStatus(), OrderStatusEnum.WAIT_FINISH.getValue(), "该状态不能确认收货"); |
| | | // if (orderInfo.getDeliveryState() != OrderDeliveryStateEnum.DELIVERY_FINISH.getValue()) { |
| | | // throw new FebsException("还未送至自提点"); |
| | | // } |
| | |
| | | @Override |
| | | public void delOrder(Long id) { |
| | | MallMember member = LoginUserUtil.getLoginUser(); |
| | | MallOrderInfo orderInfo = this.baseMapper.selectOrderByMemberIdAndId(member.getId(), id); |
| | | if (orderInfo == null || AppContants.DEL_FLAG_Y == orderInfo.getDelFlag()) { |
| | | throw new FebsException("订单不存在"); |
| | | } |
| | | |
| | | MallOrderInfo orderInfo = ValidateEntityUtils.ensureColumnReturnEntity(id,MallOrderInfo::getId,this.baseMapper::selectOne,"订单不存在"); |
| | | ValidateEntityUtils.ensureNotEqual(orderInfo.getDelFlag(),AppContants.DEL_FLAG_Y,"订单已删除"); |
| | | orderInfo.setDelFlag(AppContants.DEL_FLAG_Y); |
| | | this.baseMapper.updateById(orderInfo); |
| | | } |