|
|
@@ -1,19 +1,20 @@
|
|
|
package com.kxs.user.biz.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.kxs.common.security.util.SecurityUtils;
|
|
|
+import com.kxs.user.api.model.KxsUser;
|
|
|
+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.subGetShareholderUserList.CenterScoreListVO;
|
|
|
-import com.kxs.user.api.vo.kxsapp.subGetShareholderUserList.FirstScoreListVO;
|
|
|
-import com.kxs.user.api.vo.kxsapp.subGetShareholderUserList.HighScoreListVO;
|
|
|
-import com.kxs.user.api.vo.kxsapp.subGetShareholderUserList.ShareholderGetShareholderUserListVO;
|
|
|
+import com.kxs.user.api.vo.kxsapp.subGetShareholderUserList.UserScoreListVO;
|
|
|
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.service.KxsShdScoreService;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.sql.Array;
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -23,45 +24,77 @@ import java.util.List;
|
|
|
* @since 2024-05-07 09:11:27
|
|
|
*/
|
|
|
@Service("kxsShdScoreService")
|
|
|
+@RequiredArgsConstructor
|
|
|
public class KxsShdScoreServiceImpl extends ServiceImpl<KxsShdScoreMapper, KxsShdScore> implements KxsShdScoreService {
|
|
|
-
|
|
|
+ private final KxsShdScoreMapper kxsShdScoreMapper;
|
|
|
+ private final KxsUserMapper kxsUserMapper;
|
|
|
@Override
|
|
|
public Object getMyStandards(String month) {
|
|
|
- //假数据
|
|
|
-
|
|
|
- ShareholderGetMyStandardsVO shareholderGetMyStandardsVO = new ShareholderGetMyStandardsVO();
|
|
|
-
|
|
|
- shareholderGetMyStandardsVO.setFirstScore(1);
|
|
|
- shareholderGetMyStandardsVO.setCenterScore(2);
|
|
|
- shareholderGetMyStandardsVO.setHighScore(3);
|
|
|
- shareholderGetMyStandardsVO.setFirstScoreAll(4);
|
|
|
- shareholderGetMyStandardsVO.setCenterScoreAll(5);
|
|
|
- shareholderGetMyStandardsVO.setHighScoreAll(6);
|
|
|
-
|
|
|
+ Long id = SecurityUtils.getUser().getId();
|
|
|
+ KxsUser kxsUser = kxsUserMapper.selectById(id);
|
|
|
+ //获取个人积分
|
|
|
+ ShareholderGetMyStandardsVO shareholderGetMyStandardsVO = kxsShdScoreMapper.getMyStandards(month,kxsUser.getUserCode());
|
|
|
+ //获取全国积分
|
|
|
+ ShareholderGetMyStandardsAllVO allVO = kxsShdScoreMapper.getMyStandardsAll(month);
|
|
|
+ if (allVO != null){
|
|
|
+ shareholderGetMyStandardsVO.setCenterScoreAll(allVO.getCenterScoreAll());
|
|
|
+ shareholderGetMyStandardsVO.setFirstScoreAll(allVO.getFirstScoreAll());
|
|
|
+ shareholderGetMyStandardsVO.setHighScoreAll(allVO.getHighScoreAll());
|
|
|
+ }
|
|
|
return shareholderGetMyStandardsVO;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Object getShareholderUserList(Page<ShareholderGetShareholderUserListVO> page, String month) {
|
|
|
- //假数据
|
|
|
- ShareholderGetShareholderUserListVO shareholderGetShareholderUserListVO = new ShareholderGetShareholderUserListVO();
|
|
|
- ArrayList<HighScoreListVO> highScoreListVOS = new ArrayList<>();
|
|
|
- HighScoreListVO highScoreListVO = new HighScoreListVO();
|
|
|
- highScoreListVOS.add(highScoreListVO);
|
|
|
-
|
|
|
- ArrayList<FirstScoreListVO> firstScoreListVOS = new ArrayList<>();
|
|
|
- FirstScoreListVO firstScoreListVO = new FirstScoreListVO();
|
|
|
- firstScoreListVOS.add(firstScoreListVO);
|
|
|
-
|
|
|
- ArrayList<CenterScoreListVO> centerScoreListVOS = new ArrayList<>();
|
|
|
- CenterScoreListVO centerScoreListVO = new CenterScoreListVO();
|
|
|
- centerScoreListVOS.add(centerScoreListVO);
|
|
|
- shareholderGetShareholderUserListVO.setHighScoreList(highScoreListVOS);
|
|
|
- shareholderGetShareholderUserListVO.setFirstScoreList(firstScoreListVOS);
|
|
|
- shareholderGetShareholderUserListVO.setCenterScoreList(centerScoreListVOS);
|
|
|
-
|
|
|
-
|
|
|
- return shareholderGetShareholderUserListVO;
|
|
|
+ public Object getShareholderUserList(Page<KxsShdScore> page, String month, Integer type) {
|
|
|
+ Page<UserScoreListVO> shareholderHighScoreUserList = kxsShdScoreMapper.getShareholderHighScoreUserList(page, month, type);
|
|
|
+ for (UserScoreListVO record : shareholderHighScoreUserList.getRecords()) {
|
|
|
+ String userCode = record.getUserCode();
|
|
|
+ //获取用户头像
|
|
|
+ KxsUser kxsUser = kxsUserMapper.selectOne(Wrappers.<KxsUser>query().lambda().eq(KxsUser::getUserCode, userCode));
|
|
|
+ if (kxsUser != null){
|
|
|
+ record.setAvatar(kxsUser.getAvatar());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return shareholderHighScoreUserList;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void integralStat() {
|
|
|
+ //初级积分
|
|
|
+ //获取全部用户职级 > K3
|
|
|
+ //循环用户查询直属用户数量大于3
|
|
|
+ Long aLong = kxsUserMapper.selectCount(Wrappers.<KxsUser>query().lambda().eq(KxsUser::getPid, 1));
|
|
|
+ if (aLong > 3){
|
|
|
+ List<KxsUser> kxsUsers = kxsUserMapper.selectList(Wrappers.<KxsUser>query().lambda().eq(KxsUser::getPid, 1));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|