| | |
| | | record.setOrderId(orderId); |
| | | pointGoodsRecordMapper.updateById(record); |
| | | } |
| | | |
| | | public void revertExchangeGoods(Long recordId) { |
| | | PointGoodsRecord record = pointGoodsRecordMapper.selectById(recordId); |
| | | if(record == null){ |
| | |
| | | if(!Constants.POINT_GOODS_RECORD_STATUS.U.name().equals(record.getStatus())){ |
| | | throw new ValidationException("兑换券未使用或过期"); |
| | | } |
| | | if(!SecurityUtils.getUserId().equals(record.getUserId())){ |
| | | if(SecurityUtils.getUserId() != null && !SecurityUtils.getUserId().equals(record.getUserId())){ |
| | | throw new ValidationException("兑换券不属于当前用户"); |
| | | } |
| | | record.setStatus(Constants.POINT_GOODS_RECORD_STATUS.A.name()); |