会员、体育活动
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
package com.budwk.app.sys.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_union_group;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysUnionGroupService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
@@ -55,7 +58,7 @@ public class SysUnionGroupController {
|
||||
@ApiOperation("删除工会小组")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result delete(String id) {
|
||||
sysUnionGroupService.delete(id);
|
||||
sysUnionGroupService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
+21
@@ -31,6 +31,7 @@ import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
@@ -167,4 +168,24 @@ public class SysBranchUnionUserAuthorizationApprovalController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("sys.branch.union.authorization.approval.delete")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("校工会删除")
|
||||
public Result deleteDo(@Valid String id, @Valid String processInstanceId) {
|
||||
Sys_branch_union_user_permission userPermission = dao.fetch(Sys_branch_union_user_permission.class, id);
|
||||
if (Lang.isEmpty(userPermission)) {
|
||||
return Result.error("数据错误!");
|
||||
}
|
||||
// 移除角色
|
||||
dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "=", userPermission.getUserId()).and(Sys_user_role::getUnionId, "=", userPermission.getUnionId())
|
||||
.and(Sys_user_role::getRoleId, "=", userPermission.getRoleId()));
|
||||
dao.delete(Sys_branch_union_user_permission.class, id);
|
||||
bpmService.deleteInstance(processInstanceId);
|
||||
|
||||
sysUserService.clearCache();
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.budwk.app.web.controllers.open.commons;
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.sys.models.Sys_config;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.models.Sys_union;
|
||||
@@ -115,9 +117,21 @@ public class CommonController {
|
||||
@SaCheckLogin
|
||||
@ApiOperation("协会列表")
|
||||
public Result clubOptions(String clubId) {
|
||||
List<SysClub> sysClubs = sysClubService.dao().query(SysClub.class,
|
||||
Cnd.NEW().andEX("id", "=", clubId));
|
||||
return Result.success(sysClubs);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
c.*
|
||||
FROM
|
||||
`sys_club` c
|
||||
LEFT JOIN bpm_process_instance inst ON inst.processInstanceBusinessId = c.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("c.id", "=", clubId);
|
||||
cnd.andEX("inst.processInstanceStatus", "=", "COMPLETED");
|
||||
cnd.andEX("inst.processInstanceNodeCode", "=", 80);
|
||||
sql.setCondition(cnd);
|
||||
List list = sysClubService.listVO(sql, SysClub.class);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
|
||||
+16
-3
@@ -7,6 +7,7 @@ import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
|
||||
import com.budwk.app.zhgh.activity.qsv.dto.QsvCheckAnswerResult;
|
||||
import com.budwk.app.zhgh.activity.qsv.models.QsvActivity;
|
||||
import com.budwk.app.zhgh.activity.qsv.models.QsvOption;
|
||||
@@ -63,6 +64,12 @@ public class H5QsvQuizController {
|
||||
@ApiOperation("题目列表")
|
||||
public Result subjects(@Valid String activityId) {
|
||||
QsvActivity activity = dao.fetch(QsvActivity.class, activityId);
|
||||
|
||||
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getGroupId()).and("userId", "=", SecurityUtil.getUserId()));
|
||||
if (count != 1) {
|
||||
return Result.error("您无需参加此次答题,感谢您的关注!");
|
||||
}
|
||||
|
||||
String mode = activity.getMode();
|
||||
//能否重复答题
|
||||
Boolean repeatable = activity.getRepeatable();
|
||||
@@ -72,6 +79,8 @@ public class H5QsvQuizController {
|
||||
Integer maxAttempts = activity.getMaxAttempts();
|
||||
//题目显示模式
|
||||
String displayMode = activity.getDisplayMode();
|
||||
// 重复答题,显示提示
|
||||
Boolean repeatTips = false;
|
||||
|
||||
//最终返回的题目数据
|
||||
List<QsvSubject> resultSubjects = new ArrayList<>();
|
||||
@@ -81,7 +90,7 @@ public class H5QsvQuizController {
|
||||
List<QsvUserAnswerRecord> answerRecords = dao.query(QsvUserAnswerRecord.class, Cnd.where(QsvUserAnswerRecord::getActivityId, "=", activityId)
|
||||
.and(QsvUserAnswerRecord::getUserId, "=", SecurityUtil.getUserId()));
|
||||
|
||||
if (activity.getEndTime().after(new Date())) {
|
||||
if (activity.getEndTime().before(new Date())) {
|
||||
//已结束 查询最新一次的答题记录
|
||||
Optional<QsvUserAnswerRecord> lastRecordOptional = answerRecords.stream().max(Comparator.comparing(QsvUserAnswerRecord::getAnswerTime));
|
||||
if (lastRecordOptional.isPresent()) {
|
||||
@@ -91,7 +100,7 @@ public class H5QsvQuizController {
|
||||
cnd.and(new Static("1=1 ORDER BY FIELD (id," + dynamic + ")"));
|
||||
resultSubjects = dao.query(QsvSubject.class, cnd);
|
||||
answerRecordId = lastRecordOptional.get().getId();
|
||||
}else{
|
||||
} else {
|
||||
//没生成过 那就看全部的题目
|
||||
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where(QsvSubject::getActivityId, "=", activityId));
|
||||
QsvUserAnswerRecord answerRecord = qsvUserAnswerRecordService.insertRecord(activityId, subjects.stream().map(QsvSubject::getId).collect(Collectors.toList()));
|
||||
@@ -148,6 +157,7 @@ public class H5QsvQuizController {
|
||||
String dynamic = subjectIds.stream().map(id -> "'" + id + "'").collect(Collectors.joining(","));
|
||||
cnd.and(new Static("1=1 ORDER BY FIELD (id," + dynamic + ")"));
|
||||
resultSubjects = dao.query(QsvSubject.class, cnd);
|
||||
repeatTips = true;
|
||||
} else {
|
||||
//已达到最大次数 返回最新一次记录
|
||||
Optional<QsvUserAnswerRecord> maxAnswerRecordOptional = answerRecords.stream().max(Comparator.comparingLong(QsvUserAnswerRecord::getRandomNumber));
|
||||
@@ -293,7 +303,10 @@ public class H5QsvQuizController {
|
||||
|
||||
resultSubjects.forEach(v -> v.setUserSelectOptionIds(new ArrayList<>()));
|
||||
|
||||
NutMap result = NutMap.NEW().addv("subjects", resultSubjects).addv("answerRecordId", answerRecordId).addv("activity", activity);
|
||||
NutMap result = NutMap.NEW().addv("subjects", resultSubjects)
|
||||
.addv("answerRecordId", answerRecordId)
|
||||
.addv("activity", activity)
|
||||
.addv("repeatTips", repeatTips);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
||||
(SELECT ast.`name` FROM activity_school_apply app LEFT JOIN activity_school_team ast ON ast.id = app.teamId WHERE app.eventId = ase.eventId AND app.activityId = ase.activityId AND app.userId = @userId) activityTeamName,
|
||||
(select GROUP_CONCAT(username) FROM activity_school_apply WHERE status=2 and eventId = ase.eventId
|
||||
AND activityId = ase.activityId AND applyUser AND (applyUser=@userId or userId=@userId)) userApplyNames,
|
||||
(SELECT COUNT(1) FROM activity_school_apply WHERE eventId=ase.eventId AND activityId=ase.activityId and status=2) totalApplyNum,
|
||||
(SELECT COUNT(1) FROM activity_school_apply WHERE eventId=ase.eventId AND activityId=ase.activityId and activityUnionId=@unionId and status=2) totalApplyNum,
|
||||
(SELECT COUNT(1) FROM activity_school_apply WHERE eventId=ase.eventId AND activityId=ase.activityId and status=0 and activityUnionId=@unionId) apply_num_bc,
|
||||
(SELECT COUNT(1) FROM activity_school_apply WHERE eventId=ase.eventId AND activityId=ase.activityId and status=1 and activityUnionId=@unionId) apply_num_dsh
|
||||
FROM
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ public class BuildHomeAgencyController {
|
||||
@ApiOperation("删除工会小组")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result deleteGroup(String id) {
|
||||
sysUnionGroupService.delete(id);
|
||||
sysUnionGroupService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
+23
-4
@@ -40,7 +40,7 @@ layout("/layouts/platform.html"){
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程节点" prop="processInstanceNodeName"></el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<el-table-column label="操作" width="300px" fixed="right">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary"
|
||||
@click="onOpen(row.id)">
|
||||
@@ -50,6 +50,10 @@ layout("/layouts/platform.html"){
|
||||
type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-if="$auth.hasPermission('sys.branch.union.authorization.approval.delete')" size="mini"
|
||||
type="danger" @click="deleteDo(row)">
|
||||
删除
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- v-if="row.processInstanceTaskStatus==='COMPLETE' && !row.nextTaskIsComplete"-->
|
||||
<!-- @click="openRevoke(row.processInstanceTaskId)"-->
|
||||
@@ -104,10 +108,25 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async deleteDo(row) {
|
||||
const confirm = await this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await this.$axios.post("/platform/branchUnionUser/authorization/approval/deleteDo", {
|
||||
id: row.id,
|
||||
processInstanceId: row.processInstanceId
|
||||
})
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
onOpen(id) {
|
||||
this.dialogVisible = true
|
||||
this.showApprovalForm = false
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.$refs.infoRef.onOpen(id)
|
||||
})
|
||||
},
|
||||
@@ -116,7 +135,7 @@ layout("/layouts/platform.html"){
|
||||
this.showApprovalForm = true
|
||||
this.formData = row.approvalParam
|
||||
this.formData.approvalOpinion = '同意'
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.$refs.infoRef.onOpen(row.id)
|
||||
})
|
||||
},
|
||||
@@ -144,7 +163,7 @@ layout("/layouts/platform.html"){
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/branchUnionUser/authorization/approval/revoke", { taskId }).then((res) => {
|
||||
this.$axios.post("/platform/branchUnionUser/authorization/approval/revoke", {taskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
|
||||
@@ -125,6 +125,7 @@ layout("/layouts/platform_h5.html"){
|
||||
return {
|
||||
list: [],
|
||||
id: GetQueryString("id"),
|
||||
H5JumpTo: GetQueryString("H5JumpTo"),
|
||||
subjects: [],
|
||||
activity: {},
|
||||
// remainingTime: 0,
|
||||
@@ -161,8 +162,23 @@ layout("/layouts/platform_h5.html"){
|
||||
this.activity = res.data.activity
|
||||
this.subjects = res.data.subjects
|
||||
this.answerRecordId = res.data.answerRecordId
|
||||
this.checkGroupPermission()
|
||||
this.getAnswerRecord()
|
||||
debugger
|
||||
if (!this.H5JumpTo && this.activity.repeatable && res.data.repeatTips){
|
||||
// 如果是可重复答题,第二次答题进来弹出提示
|
||||
vant.Dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您已完成本次答题,是否要重新答题?',
|
||||
confirmButtonText: '重新答题',
|
||||
cancelButtonText: '查看答题记录',
|
||||
}).then(() => {
|
||||
this.getAnswerRecord()
|
||||
}).catch(() => {
|
||||
pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
|
||||
});
|
||||
} else {
|
||||
this.getAnswerRecord()
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -208,6 +208,7 @@ layout("/layouts/platform_h5.html"){
|
||||
</div>
|
||||
|
||||
<div class="button-control">
|
||||
<van-button v-if="canAgainQuestion" type="primary" @click="againQuestion" block>重新答题</van-button>
|
||||
<van-button type="primary" @click="openHistory" block>查看全部答题记录</van-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -239,7 +240,9 @@ layout("/layouts/platform_h5.html"){
|
||||
activity: {},
|
||||
list: [],
|
||||
historyShow: false,
|
||||
historyList: []
|
||||
historyList: [],
|
||||
|
||||
canAgainQuestion: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -268,12 +271,26 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 重新答题
|
||||
*/
|
||||
againQuestion() {
|
||||
vant.Dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '确定要重新答题吗?',
|
||||
}).then(() => {
|
||||
pjaxReplace('/platform/h5/qsv/quiz?id=' + this.activity.id + "&H5JumpTo=true")
|
||||
}).catch(() => {
|
||||
// on cancel
|
||||
});
|
||||
},
|
||||
getAnswerResult() {
|
||||
this.$axios.post("/platform/h5/qsv/quiz/answerResult", { answerRecordId: this.answerRecordId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.subjects = res.data.subjects
|
||||
this.activity = res.data.activity
|
||||
this.getAnswerRecord()
|
||||
this.getHistoryQuestion()
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -317,6 +334,16 @@ layout("/layouts/platform_h5.html"){
|
||||
this.historyList = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getHistoryQuestion() {
|
||||
$.post("/platform/h5/qsv/quiz/historyScore", { activityId: this.activity.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.historyList = res.data
|
||||
if (this.activity.maxAttempts > res.data.length) {
|
||||
this.canAgainQuestion = true
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
Reference in New Issue
Block a user