This commit is contained in:
2025-04-30 14:00:38 +08:00
parent 5ad48c3713
commit 217e6fc628
4 changed files with 12 additions and 9 deletions
@@ -121,9 +121,8 @@ public class ActScoreEnterController {
@Aop(TransAop.READ_COMMITTED)
@ApiOperation(value = "保存成绩", nickname = "/list-activity", httpMethod = "POST")
public Result saveScore(ActItemScoreVo actItemScoreVo) {
List<ActivityItem> itemList = dao.query(ActivityItem.class, Cnd.where(ActivityItem::getActivityId, "=", actItemScoreVo.getActivityId()));
dao.clear(ActItemGroupScore.class, Cnd.where(ActItemGroupScore::getActivityId, "=", actItemScoreVo.getActivityId()));
// dao.clear(ActItemGroupScore.class, Cnd.where(ActItemGroupScore::getActivityId, "=", actItemScoreVo.getActivityId()));
List<ActItemGroupScore> activityItemScores = new ArrayList<>();
actItemScoreVo.getData().forEach(item -> {
itemList.forEach(i -> {
@@ -132,8 +131,9 @@ public class ActScoreEnterController {
if (Lang.isNotEmpty(data)) {
String totalScore = StrUtil.isNotEmpty(data.getString("totalScore")) ? data.getString("totalScore") : "0";
score.setScore(new BigDecimal(totalScore));
int totalRank = data.getInt("totalRank");
int totalRank = data.getInt("totalRank", 0);
score.setRanking(totalRank);
score.setId(data.getLong("id"));
} else {
score.setScore(new BigDecimal(0));
score.setRanking(0);
@@ -145,7 +145,7 @@ public class ActScoreEnterController {
});
});
dao.insert(activityItemScores);
dao.update(activityItemScores);
return Result.success();
}
@@ -163,6 +163,7 @@ layout("/layouts/platform_1.html"){
let data = this.itemScoreList.find(s => s.groupId === group.id && s.itemId === item.id);
if (data) {
row[item.id] = {
id: data.id,
totalScore: data.score ? data.score : null,
totalRank: data.ranking ? data.ranking : null
}
@@ -7,7 +7,7 @@
<view class="content-container">
<view class="page-header">
<text class="page-title">团队报名</text>
<text class="page-subtitle">选择您感兴趣的项目进行报名</text>
<text class="page-subtitle">点击项目报名</text>
</view>
<!-- 项目列表 -->
@@ -31,9 +31,9 @@
<t-icon name="chevron-right" color="#999"/>
</view>
</view>
<view v-if="registrationStatus.get(project.id)?.length" class="project-card__checkmark">
<!-- <view v-if="registrationStatus.get(project.id)?.length" class="project-card__checkmark">
<t-icon name="check" color="#52c41a"/>
</view>
</view>-->
</view>
</view>
</view>
@@ -80,8 +80,10 @@ import {ref, onMounted, computed} from 'vue';
import {useRequest} from '@/utils/request';
import {Dialog, Toast} from 'tdesign-mobile-vue';
import {onLoad} from '@dcloudio/uni-app';
import {useUserStore} from "@/store";
const request = useRequest();
const userStore = useUserStore();
// 活动数据
const actOptions = ref([])
@@ -174,7 +176,7 @@ async function listTeamUser() {
const {code, data, msg} = await request.get('/client/item/list-team-user/' + selectActId.value)
if (code === 0) {
teamMembers.value = data;
isSelfLeader.value = data.find(t => t.userId===getApp().globalData.user.id)?.isLeader
isSelfLeader.value = data.find(t => t.userId===userStore?.userInfo.id)?.isLeader
} else {
Toast.error(msg)
}
+1 -1
View File
@@ -83,7 +83,7 @@ async function routeInterceptor(args, whiteList) {
// 获取用户信息
const user = useUserStore().userInfo
if (user == null) {
await userStore().getUserInfo()
await useUserStore().getUserInfo()
}
return args
} else {