|
@@ -4,6 +4,7 @@ import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofitlog.PtProfitLogDO;
|
|
|
import cn.newfeifan.mall.module.distri.dal.mysql.ptprofitlog.PtProfitLogMapper;
|
|
|
import cn.newfeifan.mall.module.distri.enums.CaclEnum;
|
|
|
+import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
|
|
|
import cn.newfeifan.mall.module.distri.service.sharepath.SharePathService;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
@@ -46,6 +47,9 @@ public class IntegralServiceImpl implements IntegralService {
|
|
|
@Lazy
|
|
|
private SharePathService sharePathService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private PtProfitLogService ptProfitLogService;
|
|
|
+
|
|
|
@Override
|
|
|
public Long createIntegral(IntegralSaveReqVO createReqVO) {
|
|
|
// 插入
|
|
@@ -183,4 +187,15 @@ public class IntegralServiceImpl implements IntegralService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void updateUserIntegral(Long userId, CaclEnum caclEnum, Long payIntegral, Long tradeOrderId, String orderNum) {
|
|
|
+ //退还订单支付过期积分
|
|
|
+ IntegralDO integralDO = integralMapper.selectOne(new LambdaQueryWrapper<IntegralDO>().eq(IntegralDO::getUserId, userId));
|
|
|
+ integralDO.setCurrentQuota(integralDO.getCurrentQuota() + payIntegral);
|
|
|
+
|
|
|
+ integralMapper.updateById(integralDO);
|
|
|
+
|
|
|
+ ptProfitLogService.addMessage(userId,userId,caclEnum,payIntegral,integralDO.getCurrentQuota(),0L,0L,null,tradeOrderId,orderNum);
|
|
|
+ }
|
|
|
+
|
|
|
}
|