| | |
| | | import com.webmanage.mapper.UserPointsMapper; |
| | | import com.webmanage.mapper.PointsTransactionMapper; |
| | | import com.webmanage.entity.PointsTransaction; |
| | | import com.webmanage.service.OrderInfoService; |
| | | import com.webmanage.service.PointsFlowService; |
| | | import com.webmanage.service.PointsRuleService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Resource |
| | | private PointsTransactionMapper pointsTransactionMapper; |
| | | |
| | | |
| | | @Override |
| | | public PageResult<PointsFlow> getPersonalPointsFlowPage(PointsFlowQueryDTO queryDTO) { |
| | |
| | | public boolean deductUserPoints(DeductUserPointsDTO deductDTO) { |
| | | try { |
| | | String userId = deductDTO.getUserId(); |
| | | String providerId = deductDTO.getProviderId(); |
| | | String unitId = deductDTO.getUnitId(); |
| | | Integer points = deductDTO.getPoints(); |
| | | String orderId = deductDTO.getOrderId(); |
| | |
| | | if (inserted <= 0 || trans.getId() == null) { |
| | | throw new BusinessException("保存积分交易记录失败"); |
| | | } |
| | | |
| | | // 为提供者新增积分 |
| | | AddPointsFlowDTO addPointsFlowDTO = new AddPointsFlowDTO(); |
| | | addPointsFlowDTO.setCategory("资源交易"); |
| | | addPointsFlowDTO.setCount(1); |
| | | addPointsFlowDTO.setProviderId(providerId); |
| | | addPointsFlowDTO.setRuleType(0); |
| | | addPointsFlowDTO.setRuleNameCode("digital_product_transaction"); |
| | | addPointsFlowDTO.setDescription("产品交易"); |
| | | addPointsFlowByRule(addPointsFlowDTO); |
| | | return true; |
| | | } catch (Exception e) { |
| | | log.error("扣减用户积分失败", e); |