From 3c8dc107047c0b5ee407fa36ca2ce06090f75929 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 12 四月 2025 18:05:02 +0800
Subject: [PATCH] bug修改
---
cloud-server-account/src/main/java/com/dsh/account/service/impl/StudentHonorServiceImpl.java | 114 +++++++++++++++++---------------------------------------
1 files changed, 35 insertions(+), 79 deletions(-)
diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/StudentHonorServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/StudentHonorServiceImpl.java
index 0a24768..22af474 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/StudentHonorServiceImpl.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/StudentHonorServiceImpl.java
@@ -47,17 +47,20 @@
@Resource
private SiteClient siteClient;
- @Autowired
+ @Resource
private HonorDeClient honorDeClient;
@Autowired
private TStudentService studentService;
- @Autowired
+ @Resource
private HonorRulesClient honorRulesClient;
@Resource
private WorldCupCompetitorClient worldCupCompetitorClient;
+
+ @Autowired
+ private StudentHonorService studentHonorService;
@@ -65,86 +68,37 @@
@Override
- public List<GongVo> queryStuOfMedalData(Integer stuId) {
+ public List<GongVo> queryStuOfMedalData(Integer stuId, Integer appUserId) {
List<GongVo> voList = new ArrayList<>();
-// List<StudentHonor> studentHonors = this.baseMapper.selectList(new QueryWrapper<StudentHonor>()
-// .eq("stuId", stuId));
-//
- TStudent student = studentService.getById(stuId);
-//
-//
-// if (studentHonors.size() > 0){
-// studentHonors.forEach( stuoHo -> {
-// GongVo vo = new GongVo();
-// vo.setMedalType(stuoHo.getHonorType());
-// switch (stuoHo.getHonorType()){
-// case 1:
-// vo.setMedalName("俱乐部之星");
-// break;
-// case 2:
-// vo.setMedalName("运动达人");
-// break;
-// case 3:
-// vo.setMedalName("社区之王");
-// break;
-// case 4:
-// vo.setMedalName("深度玩家");
-// break;
-// default:
-// break;
-// }
-// voList.add(vo);
-// });
-// }
- Integer count1 = coursePackageClient.counts(stuId);
- if (count1 > 0) {
+ List<StudentHonor> list = studentHonorService.list(new QueryWrapper<StudentHonor>()
+ .eq("appUserId", appUserId));
+ for (StudentHonor studentHonor : list) {
GongVo vo = new GongVo();
- vo.setMedalType(1);
- vo.setMedalName("俱乐部之星");
+ vo.setMedalType(studentHonor.getHonorType());
+ switch (studentHonor.getHonorType()){
+ case 1:
+ vo.setMedalName("俱乐部之星");
+ break;
+ case 2:
+ vo.setMedalName("运动达人");
+ break;
+ case 3:
+ vo.setMedalName("社区之王");
+ break;
+ case 4:
+ vo.setMedalName("深度玩家");
+ break;
+ case 5:
+ vo.setMedalName("常胜将军");
+ break;
+ case 6:
+ vo.setMedalName("越战越勇");
+ break;
+ default:
+ break;
+ }
voList.add(vo);
}
-
- Integer count2 = participantClient.counts(stuId);
- if (count2 > 0) {
- GongVo vo = new GongVo();
- vo.setMedalType(2);
- vo.setMedalName("运动达人");
- voList.add(vo);
- }
-
- Integer count3 = siteClient.counts(student.getAppUserId());
- if (count3 > 0) {
- GongVo vo = new GongVo();
- vo.setMedalType(3);
- vo.setMedalName("社区之王");
- voList.add(vo);
- }
-
-
- Integer count4 = coursePackageClient.counts1(stuId);
- if (count4 > 0) {
- GongVo vo = new GongVo();
- vo.setMedalType(4);
- vo.setMedalName("深度玩家");
- voList.add(vo);
- }
-
- Integer count5 = worldCupCompetitorClient.winCount(stuId);
- if (count5 > 0) {
- GongVo vo = new GongVo();
- vo.setMedalType(5);
- vo.setMedalName("常胜将军");
- voList.add(vo);
- }
-
- Integer count6 = worldCupCompetitorClient.count(stuId);
- if (count6 > 0) {
- GongVo vo = new GongVo();
- vo.setMedalType(6);
- vo.setMedalName("越战越勇");
- voList.add(vo);
- }
-
return voList;
}
@@ -185,8 +139,10 @@
vo.setLevelNum(Integer.valueOf(honorRules.getLevel()) - 1);
vo.setNextLevel(Integer.valueOf(honorRules.getLevel()));
vo.setUpgradeConditions(String.valueOf(Integer.valueOf(honorRules.getCondition()) - studentHonor.getNumber()));
- vo.setIsTopLevel(0);
+ vo.setIsTopLevel(2);
} else {
+ vo.setLevelNum(10);
+ vo.setNextLevel(10);
vo.setIsTopLevel(1);
}
list.add(vo);
--
Gitblit v1.7.1