|
@@ -9,12 +9,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.kxs.common.security.util.SecurityUtils;
|
|
import com.kxs.common.security.util.SecurityUtils;
|
|
|
import com.kxs.user.api.dto.kxsapp.IntegralStatDTO;
|
|
import com.kxs.user.api.dto.kxsapp.IntegralStatDTO;
|
|
|
import com.kxs.user.api.emun.ShdGradingEnum;
|
|
import com.kxs.user.api.emun.ShdGradingEnum;
|
|
|
|
|
+import com.kxs.user.api.model.KxsShdScore;
|
|
|
import com.kxs.user.api.model.KxsUser;
|
|
import com.kxs.user.api.model.KxsUser;
|
|
|
import com.kxs.user.api.vo.kxsapp.shareholder.ShareholderGetMyStandardsAllVO;
|
|
import com.kxs.user.api.vo.kxsapp.shareholder.ShareholderGetMyStandardsAllVO;
|
|
|
import com.kxs.user.api.vo.kxsapp.shareholder.ShareholderGetMyStandardsVO;
|
|
import com.kxs.user.api.vo.kxsapp.shareholder.ShareholderGetMyStandardsVO;
|
|
|
import com.kxs.user.api.vo.kxsapp.subGetShareholderUserList.UserScoreListVO;
|
|
import com.kxs.user.api.vo.kxsapp.subGetShareholderUserList.UserScoreListVO;
|
|
|
import com.kxs.user.biz.mapper.KxsShdScoreMapper;
|
|
import com.kxs.user.biz.mapper.KxsShdScoreMapper;
|
|
|
-import com.kxs.user.api.model.KxsShdScore;
|
|
|
|
|
import com.kxs.user.biz.mapper.KxsUserMapper;
|
|
import com.kxs.user.biz.mapper.KxsUserMapper;
|
|
|
import com.kxs.user.biz.mapper.KxsUserRealLevelMapper;
|
|
import com.kxs.user.biz.mapper.KxsUserRealLevelMapper;
|
|
|
import com.kxs.user.biz.service.KxsShdScoreService;
|
|
import com.kxs.user.biz.service.KxsShdScoreService;
|
|
@@ -23,7 +23,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -87,66 +86,67 @@ public class KxsShdScoreServiceImpl extends ServiceImpl<KxsShdScoreMapper, KxsSh
|
|
|
if (StrUtil.isBlank(month)){
|
|
if (StrUtil.isBlank(month)){
|
|
|
month = LocalDateTimeUtil.format(LocalDate.now(), DatePattern.SIMPLE_MONTH_PATTERN);
|
|
month = LocalDateTimeUtil.format(LocalDate.now(), DatePattern.SIMPLE_MONTH_PATTERN);
|
|
|
}
|
|
}
|
|
|
- //当交易额大于300W则进入下一步
|
|
|
|
|
- if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_FRIST.getTransactions()) >= 0){
|
|
|
|
|
- //获取上级用户
|
|
|
|
|
- KxsUser kxsUser = kxsUserMapper.getParenUser(integralStatDTO.getUserId());
|
|
|
|
|
- KxsUser sonKxsUser = kxsUserMapper.selectById(integralStatDTO.getUserId());
|
|
|
|
|
- if (kxsUser != null && sonKxsUser != null && sonKxsUser.getStatus() != 0){
|
|
|
|
|
- //查询记录
|
|
|
|
|
- KxsShdScore kxsShdScore = kxsShdScoreMapper.selectOne(Wrappers.<KxsShdScore>query().lambda().eq(KxsShdScore::getUserId, kxsUser.getId()).eq(KxsShdScore::getMonth, month));
|
|
|
|
|
- //版本号对比
|
|
|
|
|
- if (kxsShdScore == null || !kxsShdScore.getVersion().equals(integralStatDTO.getVersion())){
|
|
|
|
|
- //记录不存在则构造数据
|
|
|
|
|
- if (kxsShdScore == null){
|
|
|
|
|
- kxsShdScore = new KxsShdScore();
|
|
|
|
|
- }
|
|
|
|
|
- kxsShdScore.setCreateTime(now);
|
|
|
|
|
- kxsShdScore.setDelFlag("0");
|
|
|
|
|
- kxsShdScore.setUserId(Long.valueOf(kxsUser.getId()));
|
|
|
|
|
- kxsShdScore.setUsername(kxsUser.getUsername());
|
|
|
|
|
- kxsShdScore.setUserCode(kxsUser.getUserCode());
|
|
|
|
|
- kxsShdScore.setVersion(integralStatDTO.getVersion());//版本号
|
|
|
|
|
- if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_FRIST.getTransactions()) >= 0){
|
|
|
|
|
- kxsShdScore.setFirstScore(1);
|
|
|
|
|
- }else {
|
|
|
|
|
- kxsShdScore.setFirstScore(0);
|
|
|
|
|
- }
|
|
|
|
|
- if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_CENTER.getTransactions()) >= 0){
|
|
|
|
|
- kxsShdScore.setCenterScore(1);
|
|
|
|
|
- }else {
|
|
|
|
|
- kxsShdScore.setCenterScore(0);
|
|
|
|
|
- }
|
|
|
|
|
- if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_HIGH.getTransactions()) >= 0){
|
|
|
|
|
- kxsShdScore.setHighScore(1);
|
|
|
|
|
- }else {
|
|
|
|
|
- kxsShdScore.setHighScore(0);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- kxsShdScore.setMonth(month);
|
|
|
|
|
- if(kxsShdScore.getId() == null){
|
|
|
|
|
- kxsShdScoreMapper.insert(kxsShdScore);
|
|
|
|
|
- }else{
|
|
|
|
|
- kxsShdScoreMapper.updateById(kxsShdScore);
|
|
|
|
|
- }
|
|
|
|
|
- }else {
|
|
|
|
|
-
|
|
|
|
|
- //存在数据则根据条件增加
|
|
|
|
|
- if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_FRIST.getTransactions()) >= 0){
|
|
|
|
|
-
|
|
|
|
|
- kxsShdScore.setFirstScore(kxsShdScore.getFirstScore() + 1);
|
|
|
|
|
- }
|
|
|
|
|
- if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_CENTER.getTransactions()) >= 0){
|
|
|
|
|
- kxsShdScore.setCenterScore(kxsShdScore.getCenterScore() + 1);
|
|
|
|
|
- }
|
|
|
|
|
- if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_HIGH.getTransactions()) >= 0){
|
|
|
|
|
- kxsShdScore.setHighScore(kxsShdScore.getHighScore() + 1);
|
|
|
|
|
- }
|
|
|
|
|
- kxsShdScore.setUpdateTime(now);
|
|
|
|
|
- kxsShdScore.setVersion(integralStatDTO.getVersion());
|
|
|
|
|
- kxsShdScoreMapper.updateById(kxsShdScore);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ KxsUser sonKxsUser = kxsUserMapper.selectById(integralStatDTO.getUserId());
|
|
|
|
|
+ if(sonKxsUser == null || sonKxsUser.getStatus() != 1){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ //获取上级用户
|
|
|
|
|
+ KxsUser kxsUser = kxsUserMapper.getParenUser(integralStatDTO.getUserId());
|
|
|
|
|
+ if(kxsUser == null){
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ //查询记录
|
|
|
|
|
+ KxsShdScore kxsShdScore = kxsShdScoreMapper.selectOne(Wrappers.<KxsShdScore>query().lambda().eq(KxsShdScore::getUserId, kxsUser.getId()).eq(KxsShdScore::getMonth, month));
|
|
|
|
|
+ //版本号对比
|
|
|
|
|
+ if (kxsShdScore == null || !kxsShdScore.getVersion().equals(integralStatDTO.getVersion())){
|
|
|
|
|
+ //记录不存在则构造数据
|
|
|
|
|
+ if (kxsShdScore == null){
|
|
|
|
|
+ kxsShdScore = new KxsShdScore();
|
|
|
|
|
+ }
|
|
|
|
|
+ kxsShdScore.setCreateTime(now);
|
|
|
|
|
+ kxsShdScore.setDelFlag("0");
|
|
|
|
|
+ kxsShdScore.setUserId(Long.valueOf(kxsUser.getId()));
|
|
|
|
|
+ kxsShdScore.setUsername(kxsUser.getUsername());
|
|
|
|
|
+ kxsShdScore.setUserCode(kxsUser.getUserCode());
|
|
|
|
|
+ kxsShdScore.setVersion(integralStatDTO.getVersion());//版本号
|
|
|
|
|
+ if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_FRIST.getTransactions()) >= 0){
|
|
|
|
|
+ kxsShdScore.setFirstScore(1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ kxsShdScore.setFirstScore(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_CENTER.getTransactions()) >= 0){
|
|
|
|
|
+ kxsShdScore.setCenterScore(1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ kxsShdScore.setCenterScore(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_HIGH.getTransactions()) >= 0){
|
|
|
|
|
+ kxsShdScore.setHighScore(1);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ kxsShdScore.setHighScore(0);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ kxsShdScore.setMonth(month);
|
|
|
|
|
+ if(kxsShdScore.getId() == null){
|
|
|
|
|
+ kxsShdScoreMapper.insert(kxsShdScore);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ kxsShdScoreMapper.updateById(kxsShdScore);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+
|
|
|
|
|
+ //存在数据则根据条件增加
|
|
|
|
|
+ if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_FRIST.getTransactions()) >= 0){
|
|
|
|
|
+
|
|
|
|
|
+ kxsShdScore.setFirstScore(kxsShdScore.getFirstScore() + 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_CENTER.getTransactions()) >= 0){
|
|
|
|
|
+ kxsShdScore.setCenterScore(kxsShdScore.getCenterScore() + 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_HIGH.getTransactions()) >= 0){
|
|
|
|
|
+ kxsShdScore.setHighScore(kxsShdScore.getHighScore() + 1);
|
|
|
}
|
|
}
|
|
|
|
|
+ kxsShdScore.setUpdateTime(now);
|
|
|
|
|
+ kxsShdScore.setVersion(integralStatDTO.getVersion());
|
|
|
|
|
+ kxsShdScoreMapper.updateById(kxsShdScore);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// //初级积分
|
|
// //初级积分
|