|
|
|
@@ -328,7 +328,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
user.setScore(addScoreNumber); |
|
|
|
|
|
|
|
// 3. 记录历史 |
|
|
|
recordScoreHistory(addScoreNumber, user.getTenantId(), user.getId(), EnumScoreType.LOGIN); |
|
|
|
recordScoreHistory(addScoreNumber, user, user.getId(), EnumScoreType.LOGIN); |
|
|
|
|
|
|
|
return addScoreNumber; |
|
|
|
} |
|
|
|
@@ -404,7 +404,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
updateScore(userCar.getCUserId(), addScoreNumber); |
|
|
|
|
|
|
|
// 4. 记录历史 |
|
|
|
recordScoreHistory(addScoreNumber, userCar.getTenantId(), userCar.getCUserId(), EnumScoreType.BIND_CAR); |
|
|
|
recordScoreHistory(addScoreNumber, userCar.getTenantInfo(), userCar.getCUserId(), EnumScoreType.BIND_CAR); |
|
|
|
return addScoreNumber; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -420,7 +420,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
updateScore(user.getId(), addScoreNumber); |
|
|
|
|
|
|
|
// 4. 记录历史 |
|
|
|
recordScoreHistory(addScoreNumber, user.getTenantId(), user.getId(), EnumScoreType.WECHAT_PERSION); |
|
|
|
recordScoreHistory(addScoreNumber, user, user.getId(), EnumScoreType.WECHAT_PERSION); |
|
|
|
return addScoreNumber; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -436,13 +436,13 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
updateScore(user.getId(), addScoreNumber); |
|
|
|
|
|
|
|
// 4. 记录历史 |
|
|
|
recordScoreHistory(addScoreNumber, user.getTenantId(), user.getId(), EnumScoreType.WECHAT_PHONE); |
|
|
|
recordScoreHistory(addScoreNumber, user, user.getId(), EnumScoreType.WECHAT_PHONE); |
|
|
|
return addScoreNumber; |
|
|
|
} |
|
|
|
|
|
|
|
private int checkCompleteInfoScoreCount(WxCUser cUser) { |
|
|
|
WxScoreHistory scoreHistory = new WxScoreHistory(); |
|
|
|
scoreHistory.setTenantId(cUser.getTenantId()); |
|
|
|
scoreHistory.updateTenantInfo(cUser); |
|
|
|
scoreHistory.setCUserId(cUser.getId()); |
|
|
|
scoreHistory.setScoreType(EnumScoreType.COMPLETE_INFO.getCode()); |
|
|
|
return wxScoreHistoryMapper.countList(scoreHistory); |
|
|
|
@@ -465,7 +465,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
updateScore(user.getId(), addScoreNumber); |
|
|
|
|
|
|
|
// 4. 记录历史 |
|
|
|
recordScoreHistory(addScoreNumber, user.getTenantId(), user.getId(), EnumScoreType.COMPLETE_INFO); |
|
|
|
recordScoreHistory(addScoreNumber, user, user.getId(), EnumScoreType.COMPLETE_INFO); |
|
|
|
return addScoreNumber; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -490,14 +490,14 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
if (userInfo.getPhone() != null) { |
|
|
|
WxCUser wxCUser = new WxCUser(); |
|
|
|
wxCUser.setId(userInfo.getId()); |
|
|
|
wxCUser.setTenantId(userInfo.getTenantId()); |
|
|
|
wxCUser.updateTenantInfo(userInfo); |
|
|
|
wxCUser.setPhone(userInfo.getPhone()); |
|
|
|
wxCUser.setScore(score); |
|
|
|
wxCUserService.saveOrUpdate(wxCUser);; |
|
|
|
} |
|
|
|
|
|
|
|
// 2. 记录历史 |
|
|
|
recordReduceScoreHistory(scoreNum, reason, userInfo.getTenantId(), userInfo.getId(), EnumScoreType.MEM_REDUCE); |
|
|
|
recordReduceScoreHistory(scoreNum, reason, userInfo.getTenantInfo(), userInfo.getId(), EnumScoreType.MEM_REDUCE); |
|
|
|
return score; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -505,7 +505,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
WxScoreHistory history = new WxScoreHistory(); |
|
|
|
history.setId(idWorker.nextId()); |
|
|
|
history.setTenantId(userInfo.getTenantId()); |
|
|
|
history.updateTenantInfo(userInfo); |
|
|
|
history.setCUserId(userInfo.getId()); |
|
|
|
history.setCreateDate(new Date()); |
|
|
|
history.setScoreType(wechatPhone.getCode()); |
|
|
|
@@ -513,11 +513,11 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
wxScoreHistoryMapper.insert(history); |
|
|
|
} |
|
|
|
|
|
|
|
private void recordScoreHistory(int addScoreNumber, String tenantId, Long id, EnumScoreType wechatPhone) { |
|
|
|
private void recordScoreHistory(int addScoreNumber, TenantEntity tenantEntity, Long id, EnumScoreType wechatPhone) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
WxScoreHistory history = new WxScoreHistory(); |
|
|
|
history.setId(idWorker.nextId()); |
|
|
|
history.setTenantId(tenantId); |
|
|
|
history.updateTenantInfo(tenantEntity); |
|
|
|
history.setCUserId(id); |
|
|
|
history.setCreateDate(new Date()); |
|
|
|
history.setScoreType(wechatPhone.getCode()); |
|
|
|
@@ -542,11 +542,11 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { |
|
|
|
wxScoreHistoryMapper.insert(history); |
|
|
|
} |
|
|
|
|
|
|
|
private void recordReduceScoreHistory(int reduceScore, String reason, String tenantId, Long id, EnumScoreType wechatPhone) { |
|
|
|
private void recordReduceScoreHistory(int reduceScore, String reason, TenantEntity tenantEntity, Long id, EnumScoreType wechatPhone) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
WxScoreHistory history = new WxScoreHistory(); |
|
|
|
history.setId(idWorker.nextId()); |
|
|
|
history.setTenantId(tenantId); |
|
|
|
history.updateTenantInfo(tenantEntity); |
|
|
|
history.setCUserId(id); |
|
|
|
history.setCreateDate(new Date()); |
|
|
|
history.setScoreType(wechatPhone.getCode()); |
|
|
|
|