Merge branch 'main' of https://dd3skj.picp.vip/zhaoxinyu/zhgh_njnu
This commit is contained in:
+2
-4
@@ -87,12 +87,10 @@ public class FamilyActivityApplyController {
|
|||||||
cnd.andEX("`year`", "=", year);
|
cnd.andEX("`year`", "=", year);
|
||||||
//查询报名中
|
//查询报名中
|
||||||
if (activityType == 2) {
|
if (activityType == 2) {
|
||||||
cnd.and(new Static("now() > activitySignUpStartTime and now() < activitySignUpEndTime"));
|
cnd.and(new Static("now() < activitySignUpEndTime"));
|
||||||
}//查询已结束的
|
}//查询已结束的
|
||||||
else if (activityType == 3) {
|
else if (activityType == 3) {
|
||||||
cnd.and(new Static("now() > activityEndTime"));
|
cnd.and(new Static("now() >= activityEndTime"));
|
||||||
} else if (activityType == 4) {
|
|
||||||
cnd.and(new Static("now() < activitySignUpStartTime"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AuthUtil.hasRole("H04") && !AuthUtil.hasRoleOr("sysadmin, A06")) {
|
if (AuthUtil.hasRole("H04") && !AuthUtil.hasRoleOr("sysadmin, A06")) {
|
||||||
|
|||||||
+36
-35
@@ -334,44 +334,45 @@ public class ClubInfoManageController {
|
|||||||
@At
|
@At
|
||||||
@SaCheckPermission("club.infoManage.manage")
|
@SaCheckPermission("club.infoManage.manage")
|
||||||
@ApiOperation("授权")
|
@ApiOperation("授权")
|
||||||
public Result doAuthRole(@Valid String userId, @Valid String clubId, @Param("roleCode") @Valid String[] roleCode) {
|
public Result doAuthRole(@Valid String id, @Valid String clubId, @Param("roleCode") @Valid String[] roleCodes) {
|
||||||
// 删除原来的身份
|
List<String> roleCodeList = Arrays.asList(roleCodes);
|
||||||
List<String> roleCodes = List.of(RoleConstant.CLUB_PRESIDENT.name(),
|
//查询社团是否存在会长或者秘书长
|
||||||
RoleConstant.CLUB_VICE_PRESIDENT.name(),
|
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_PRESIDENT.name())) {
|
||||||
RoleConstant.CLUB_SECRETARY.name(),
|
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||||
RoleConstant.CLUB_VICE_SECRETARY.name(),
|
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_PRESIDENT.name()))));
|
||||||
RoleConstant.CLUB_OPERATOR.name(),
|
if (count > 0) {
|
||||||
RoleConstant.CLUB_MEMBER.name());
|
return Result.error("会长只能有一位");
|
||||||
for (String code : roleCodes) {
|
}
|
||||||
String roleId = sysRoleService.getByCode(code).getId();
|
}
|
||||||
dao.clear(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "=", userId).and(Sys_user_role::getClubId, "=", clubId).and(Sys_user_role::getRoleId, "=", roleId));
|
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_SECRETARY.name())) {
|
||||||
}
|
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||||
|
.and(new Static("JSON_CONTAINS(roleCode, '\"%s\"')".formatted(RoleConstant.CLUB_SECRETARY.name()))));
|
||||||
// 新增身份
|
if (count > 0) {
|
||||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", clubId).and(ClubUser::getUserId, "=", userId));
|
return Result.error("秘书长只能有一位");
|
||||||
List<String> list = new ArrayList<>(Arrays.asList(roleCode));
|
}
|
||||||
if(list.isEmpty()) {
|
|
||||||
list.add(RoleConstant.CLUB_MEMBER.name());
|
|
||||||
} else {
|
|
||||||
list.remove(RoleConstant.CLUB_MEMBER.name());
|
|
||||||
}
|
}
|
||||||
clubUser.setRoleCode(list);
|
|
||||||
dao.update(clubUser,"roleCode");
|
|
||||||
|
|
||||||
// 新增权限
|
ClubUser clubUser = clubInfoManageService.dao().fetch(ClubUser.class, id);
|
||||||
for (String code : roleCode) {
|
|
||||||
Sys_role sysRole = sysRoleService.getByCode(code);
|
|
||||||
Sys_user_role userRole = new Sys_user_role();
|
|
||||||
userRole.setUserId(userId);
|
|
||||||
userRole.setRoleId(sysRole.getId());
|
|
||||||
userRole.setClubId(clubId);
|
|
||||||
dao.insert(userRole);
|
|
||||||
}
|
|
||||||
|
|
||||||
sysUserService.clearCache();
|
// 先清除所有的角色
|
||||||
sysRoleService.clearCache();
|
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", clubUser.getUserId()).and("clubId", "=", clubUser.getClubId()));
|
||||||
|
// 再根据传过来的赋值
|
||||||
return Result.success();
|
clubUser.setRoleCode(roleCodeList);
|
||||||
|
dao.update(clubUser);
|
||||||
|
// 设置角色
|
||||||
|
List<Sys_user_role> roles = new ArrayList<>();
|
||||||
|
for (String s : roleCodeList) {
|
||||||
|
Sys_user_role ur = new Sys_user_role();
|
||||||
|
ur.setUserId(clubUser.getUserId());
|
||||||
|
ur.setClubId(clubUser.getClubId());
|
||||||
|
Sys_role sRole = sysRoleService.getByCode(s);
|
||||||
|
ur.setRoleId(sRole.getId());
|
||||||
|
roles.add(ur);
|
||||||
|
}
|
||||||
|
dao.insert(roles);
|
||||||
|
sysUserService.clearCache();
|
||||||
|
sysRoleService.clearCache();
|
||||||
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===============================20250806新增授权 zhaoxinyu==========================================*/
|
/*===============================20250806新增授权 zhaoxinyu==========================================*/
|
||||||
|
|||||||
@@ -54,8 +54,7 @@ layout("/layouts/platform.html"){
|
|||||||
<el-select v-model="pageForm.activityType" @change="doSearch" style="width: 100%"
|
<el-select v-model="pageForm.activityType" @change="doSearch" style="width: 100%"
|
||||||
placeholder="请选择活动状态" filterable>
|
placeholder="请选择活动状态" filterable>
|
||||||
<el-option :value="1" label="全部"></el-option>
|
<el-option :value="1" label="全部"></el-option>
|
||||||
<el-option :value="4" label="即将开始"></el-option>
|
<el-option :value="2" label="即将开始 & 报名中"></el-option>
|
||||||
<el-option :value="2" label="报名中"></el-option>
|
|
||||||
<el-option :value="3" label="已结束"></el-option>
|
<el-option :value="3" label="已结束"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
@@ -90,8 +89,13 @@ layout("/layouts/platform.html"){
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="300">
|
<el-table-column label="操作" width="300">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
<el-button @click="onView(row)" size="mini" type="primary">查看介绍</el-button>
|
<template v-if="$moment().isBefore($moment(row.activitySignUpEndTime))">
|
||||||
<el-button @click="onOpen(row)" size="mini" type="primary">去报名</el-button>
|
<el-button @click="onView(row)" size="mini" type="primary">查看介绍</el-button>
|
||||||
|
<el-button @click="onOpen(row)" size="mini" type="primary">去报名</el-button>
|
||||||
|
</template>
|
||||||
|
<template v-if="$moment().isAfter($moment(row.activitySignUpEndTime))">
|
||||||
|
<el-button size="mini" type="info">已结束</el-button>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -143,7 +147,7 @@ layout("/layouts/platform.html"){
|
|||||||
return {
|
return {
|
||||||
pageForm: {
|
pageForm: {
|
||||||
year: this.$moment().format("YYYY"),
|
year: this.$moment().format("YYYY"),
|
||||||
activityType: 4
|
activityType: 2
|
||||||
},
|
},
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ label: "活动名称", prop: "activityName", width: 600},
|
{ label: "活动名称", prop: "activityName", width: 600},
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const clubUserJoin = {
|
|||||||
{{viewData.sex}}
|
{{viewData.sex}}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="出生年月">
|
<el-descriptions-item label="出生年月">
|
||||||
{{viewData.birthday}}
|
{{$moment(viewData.birthday).format('YYYY-MM-DD')}}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="联系电话">
|
<el-descriptions-item label="联系电话">
|
||||||
{{viewData.mobile}}
|
{{viewData.mobile}}
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
|
|||||||
<el-checkbox label="CLUB_SECRETARY">协会秘书长</el-checkbox>
|
<el-checkbox label="CLUB_SECRETARY">协会秘书长</el-checkbox>
|
||||||
<el-checkbox label="CLUB_VICE_SECRETARY">协会副秘书长</el-checkbox>
|
<el-checkbox label="CLUB_VICE_SECRETARY">协会副秘书长</el-checkbox>
|
||||||
<el-checkbox label="CLUB_OPERATOR">协会操作员</el-checkbox>
|
<el-checkbox label="CLUB_OPERATOR">协会操作员</el-checkbox>
|
||||||
|
<el-checkbox label="CLUB_MEMBER">协会会员</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ layout("/layouts/platform.html"){
|
|||||||
this.$set(this.formData, "unionName", user.union ? user.union.name : null)
|
this.$set(this.formData, "unionName", user.union ? user.union.name : null)
|
||||||
this.$set(this.formData, "sex", user.sex)
|
this.$set(this.formData, "sex", user.sex)
|
||||||
this.$set(this.formData, "birthday", "${@auth.getPrincipalProperty('birthday'),'yyyy-MM-dd'}")
|
this.$set(this.formData, "birthday", "${@auth.getPrincipalProperty('birthday'),'yyyy-MM-dd'}")
|
||||||
|
this.$set(this.formData, "mobile", user.mobile)
|
||||||
this.$set(this.formData, "nation", user.nation)
|
this.$set(this.formData, "nation", user.nation)
|
||||||
this.$set(this.formData, "political", user.political)
|
this.$set(this.formData, "political", user.political)
|
||||||
this.$set(this.formData, "education", user.education)
|
this.$set(this.formData, "education", user.education)
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ layout("/layouts/platform.html"){
|
|||||||
if (this.honorTypeList && this.honorLevelList) {
|
if (this.honorTypeList && this.honorLevelList) {
|
||||||
this.$set(this.pageForm, "honorType", this.honorTypeList[0].id)
|
this.$set(this.pageForm, "honorType", this.honorTypeList[0].id)
|
||||||
this.$set(this.pageForm, "queryTypeCode", this.honorTypeList[0].queryTypeCode)
|
this.$set(this.pageForm, "queryTypeCode", this.honorTypeList[0].queryTypeCode)
|
||||||
this.honorPrizeList = await this.getHonorPrize(this.formData.honorType)
|
this.honorPrizeList = await this.getHonorPrize(this.pageForm.honorType)
|
||||||
console.log(this.pageForm)
|
console.log(this.pageForm)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ layout("/layouts/platform_h5.html"){
|
|||||||
.van-count-down {
|
.van-count-down {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
.item-header .van-tag {
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 3px 6px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="app">
|
<div id="app">
|
||||||
@@ -40,10 +45,25 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<table-list api="/platform/family/apply/activityPageData"
|
<table-list api="/platform/family/apply/activityPageData"
|
||||||
:page_form.sync="pageForm"
|
:page_form.sync="pageForm"
|
||||||
ref="tableListRef"
|
ref="tableListRef"
|
||||||
title="activityName"
|
|
||||||
img="cover"
|
img="cover"
|
||||||
@ready="onReady"
|
@ready="onReady"
|
||||||
>
|
>
|
||||||
|
<template #header="{index,row}">
|
||||||
|
<div class="item-header">
|
||||||
|
<div class="item-title">{{ row.activityName }}</div>
|
||||||
|
<div>
|
||||||
|
<van-tag type="primary" v-if="$moment().isBefore($moment(row.activitySignUpStartTime))">
|
||||||
|
即将开始
|
||||||
|
</van-tag>
|
||||||
|
<van-tag type="success" v-if="$moment().isAfter($moment(row.activitySignUpStartTime)) && $moment().isBefore($moment(row.activitySignUpEndTime))">
|
||||||
|
进行中
|
||||||
|
</van-tag>
|
||||||
|
<van-tag class="grey" v-if="$moment().isAfter($moment(row.activitySignUpEndTime))">
|
||||||
|
已结束
|
||||||
|
</van-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template v-slot="{index,row}">
|
<template v-slot="{index,row}">
|
||||||
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
|
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
|
||||||
<table-column label="报名时间">
|
<table-column label="报名时间">
|
||||||
@@ -54,14 +74,16 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</table-column>
|
</table-column>
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{index,row}">
|
<template #actions="{index,row}">
|
||||||
<div class="action-btn" @click="onView(row)">
|
<template v-if="$moment().isBefore($moment(row.activitySignUpEndTime))">
|
||||||
<i class="fa fa-eye"></i>
|
<div class="action-btn" @click="onView(row)">
|
||||||
<span>查看介绍</span>
|
<i class="fa fa-eye"></i>
|
||||||
</div>
|
<span>查看介绍</span>
|
||||||
<div class="action-btn" @click="onApply(row)">
|
</div>
|
||||||
<i class="fa fa-edit"></i>
|
<div class="action-btn" @click="onApply(row)">
|
||||||
<span>去报名</span>
|
<i class="fa fa-edit"></i>
|
||||||
</div>
|
<span>去报名</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</table-list>
|
</table-list>
|
||||||
|
|
||||||
@@ -105,12 +127,11 @@ layout("/layouts/platform_h5.html"){
|
|||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
searchKeyword: '',
|
searchKeyword: '',
|
||||||
year: new Date().getFullYear(),
|
year: new Date().getFullYear(),
|
||||||
activityType: 4,
|
activityType: 2,
|
||||||
},
|
},
|
||||||
typeOptions: [
|
typeOptions: [
|
||||||
{text: '全部', value: 1},
|
{text: '全部', value: 1},
|
||||||
{text: '即将开始', value: 4},
|
{text: '即将开始 & 报名中', value: 2},
|
||||||
{text: '报名中', value: 2},
|
|
||||||
{text: '已结束', value: 3},
|
{text: '已结束', value: 3},
|
||||||
],
|
],
|
||||||
infoVisible: false,
|
infoVisible: false,
|
||||||
|
|||||||
@@ -261,6 +261,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.formData.loginName = user.loginname;
|
this.formData.loginName = user.loginname;
|
||||||
this.formData.unitName = user.unit ? user.unit.name : null;
|
this.formData.unitName = user.unit ? user.unit.name : null;
|
||||||
this.formData.unionName = user.union ? user.union.name : null;
|
this.formData.unionName = user.union ? user.union.name : null;
|
||||||
|
this.formData.birthday = this.$moment(user.birthday).format('YYYY-MM-DD');
|
||||||
|
this.formData.mobile = user.mobile;
|
||||||
this.formData.sex = user.sex;
|
this.formData.sex = user.sex;
|
||||||
this.formData.education = user.education;
|
this.formData.education = user.education;
|
||||||
this.formData.technicalTitle = user.technicalTitle;
|
this.formData.technicalTitle = user.technicalTitle;
|
||||||
|
|||||||
Reference in New Issue
Block a user