|
|
|
@@ -6,13 +6,11 @@ import com.iformall.common.IdWorker; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.EnumBusiness; |
|
|
|
import com.iformall.enums.EnumScoreType; |
|
|
|
import com.iformall.mapper.WxCUserBasicInfoMapper; |
|
|
|
import com.iformall.mapper.WxScoreHistoryMapper; |
|
|
|
import com.iformall.mapper.WxScoreRulesMapper; |
|
|
|
import com.iformall.service.WxCUserBasicInfoService; |
|
|
|
import com.iformall.service.WxCUserService; |
|
|
|
import com.iformall.service.WxScoreRulesService; |
|
|
|
import com.iformall.utils.RedisUtils; |
|
|
|
import jdk.nashorn.internal.ir.IdentNode; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -34,9 +32,9 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
@Autowired |
|
|
|
WxScoreHistoryMapper wxScoreHistoryMapper; |
|
|
|
@Autowired |
|
|
|
WxCUserService wxCUserService; |
|
|
|
WxCUserBasicInfoMapper wxCUserBasicInfoMapper; |
|
|
|
@Autowired |
|
|
|
WxCUserBasicInfoService wxCUserBasicInfoService; |
|
|
|
WxCUserService wxCUserService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Qualifier("scoreRuleRedisTemplate") |
|
|
|
@@ -118,20 +116,20 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
wxCUserBasicInfo.setTenantId(wxCUser.getTenantId()); |
|
|
|
wxCUserBasicInfo.setPhone(wxCUser.getPhone()); |
|
|
|
wxCUserBasicInfo.setPoins(newScore); |
|
|
|
wxCUserBasicInfoService.updateScore(wxCUserBasicInfo); |
|
|
|
wxCUserBasicInfoMapper.updateScore(wxCUserBasicInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void resetBasicUserScore(Long userId, int scoreNumber) { |
|
|
|
// 1. basicUser |
|
|
|
WxCUserBasicInfo user = wxCUserBasicInfoService.getById(userId); |
|
|
|
WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectByPrimaryKey(userId); |
|
|
|
if(user == null) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 2. update score/ 修改basic表积分 |
|
|
|
user.setPoins(scoreNumber); |
|
|
|
wxCUserBasicInfoService.updateScore(user); |
|
|
|
wxCUserBasicInfoMapper.updateScore(user); |
|
|
|
|
|
|
|
// 3. 修改 c_user表积分 score |
|
|
|
if (user.getPhone() != null) { |
|
|
|
|