commit
This commit is contained in:
+4
-4
@@ -58,7 +58,7 @@ public class ClubMyApplyController {
|
|||||||
public Object pageData(PageForm pageForm,
|
public Object pageData(PageForm pageForm,
|
||||||
@Param(value = "name",required = false) String name,
|
@Param(value = "name",required = false) String name,
|
||||||
@Param(value = "year",required = false)String year) {
|
@Param(value = "year",required = false)String year) {
|
||||||
CndPlus cnd = CndPlus.create();
|
Cnd cnd = Cnd.NEW();
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
c.*,
|
c.*,
|
||||||
@@ -77,14 +77,14 @@ public class ClubMyApplyController {
|
|||||||
LEFT JOIN audit_state s ON s.stateId = c.state
|
LEFT JOIN audit_state s ON s.stateId = c.state
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
cnd.andEx("c.name", "LIKE", "%" + name + "%");
|
cnd.andEX("c.name", "LIKE", "%" + name + "%");
|
||||||
cnd.andEx("year(c.create_time)", "=", year);
|
cnd.andEX("year(c.create_time)", "=", year);
|
||||||
|
|
||||||
if(!ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly")) {
|
if(!ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly")) {
|
||||||
cnd.and("c.userid", "=", ShiroUtil.getPlatformUid());
|
cnd.and("c.userid", "=", ShiroUtil.getPlatformUid());
|
||||||
}
|
}
|
||||||
|
|
||||||
cnd.asc("state").desc("create_time");
|
cnd.asc("c.code");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
return pagination;
|
return pagination;
|
||||||
|
|||||||
+21
-13
@@ -26,6 +26,7 @@ import org.nutz.mvc.annotation.Param;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author JyuHsin
|
* @Author JyuHsin
|
||||||
@@ -146,24 +147,23 @@ public class ClubRegistApplyController {
|
|||||||
@Param(value = "::deleteIds", required = false) List<String> deleteIds,
|
@Param(value = "::deleteIds", required = false) List<String> deleteIds,
|
||||||
@Param(value = "::managePerson", required = false) List<NutMap> managePerson) throws IOException {
|
@Param(value = "::managePerson", required = false) List<NutMap> managePerson) throws IOException {
|
||||||
|
|
||||||
|
//如果不是管理员,并且点的提交按钮
|
||||||
if (!isSave && !ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly")) {
|
if (!isSave && !ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly")) {
|
||||||
club.setState(club.getSponsorType() == 1 ? ClubRegistAuditState.UNIT_PART_READY : ClubRegistAuditState.XT_READY);
|
club.setState(club.getSponsorType() == 1 ? ClubRegistAuditState.UNIT_PART_READY : ClubRegistAuditState.XT_READY);
|
||||||
club.setXtAuditId("");
|
club.setXtAuditId("");
|
||||||
club.setXldAuditId("");
|
club.setXldAuditId("");
|
||||||
|
club.setUnitPartAuditId("");
|
||||||
|
club.setXghAuditId("");
|
||||||
}
|
}
|
||||||
if (!isSave && ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly")) {
|
|
||||||
club.setState(ClubRegistAuditState.SCHOOL_PASS);
|
|
||||||
}
|
|
||||||
sysClubService.update(club);
|
sysClubService.update(club);
|
||||||
dao.clear(Sys_club_sponsor.class, Cnd.where("clubId", "=", club.getId()));
|
dao.clear(Sys_club_sponsor.class, Cnd.where("clubId", "=", club.getId()));
|
||||||
dao.insertLinks(club, "sponsors");
|
dao.insertLinks(club, "sponsors");
|
||||||
|
|
||||||
//插入新建社团时填入的理事机构
|
|
||||||
dao.clear(Sys_club_user.class, Cnd.where("id", "in", deleteIds));
|
dao.clear(Sys_club_user.class, Cnd.where("id", "in", deleteIds));
|
||||||
dao.clear(Sys_user_role.class, Cnd.where("stid", "=", club.getId())
|
|
||||||
.and("roleid", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04)));
|
|
||||||
List<Sys_club_user> clubUsers = new ArrayList<>();
|
List<Sys_club_user> clubUsers = new ArrayList<>();
|
||||||
//List<Sys_user_role> userRoles = new ArrayList<>();
|
List<Sys_user_role> userRoles = new ArrayList<>();
|
||||||
managePerson.forEach(item -> {
|
managePerson.forEach(item -> {
|
||||||
Sys_club_user cUser = new Sys_club_user();
|
Sys_club_user cUser = new Sys_club_user();
|
||||||
Sys_club_user fetch = dao.fetch(Sys_club_user.class, Cnd.where("clubid", "=", club.getId())
|
Sys_club_user fetch = dao.fetch(Sys_club_user.class, Cnd.where("clubid", "=", club.getId())
|
||||||
@@ -183,17 +183,25 @@ public class ClubRegistApplyController {
|
|||||||
cUser.setIsNormal(true);
|
cUser.setIsNormal(true);
|
||||||
}
|
}
|
||||||
clubUsers.add(cUser);
|
clubUsers.add(cUser);
|
||||||
dao.insertOrUpdate(cUser);
|
|
||||||
/*Sys_user_role uRole = new Sys_user_role();
|
//如果是管理员创建的社团,直接加角色
|
||||||
|
if(ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly") && Objects.equals(club.getState(), ClubRegistAuditState.SCHOOL_PASS)) {
|
||||||
|
Sys_user_role uRole = new Sys_user_role();
|
||||||
uRole.setUserId(item.getString("userId"));
|
uRole.setUserId(item.getString("userId"));
|
||||||
uRole.setRoleId(item.getString("roleId"));
|
uRole.setRoleId(getRoleId(item.getInt("sf")));
|
||||||
uRole.setStid(club.getId());
|
uRole.setStid(club.getId());
|
||||||
userRoles.add(uRole);*/
|
userRoles.add(uRole);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
//dao.insert(userRoles);
|
|
||||||
|
|
||||||
|
if(ShiroUtil.hasAnyRoles("sysadmin, A06, xxhgly") && Objects.equals(club.getState(), ClubRegistAuditState.SCHOOL_PASS)) {
|
||||||
|
dao.clear(Sys_user_role.class, Cnd.where("stid", "=", club.getId())
|
||||||
|
.and("roleid", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04)));
|
||||||
|
dao.insert(userRoles);
|
||||||
|
}
|
||||||
|
|
||||||
|
dao.insertOrUpdate(clubUsers);
|
||||||
flushDict();
|
flushDict();
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,11 +74,15 @@ layout("/layouts/platform.html"){
|
|||||||
<el-table-column label="操作" width="300px">
|
<el-table-column label="操作" width="300px">
|
||||||
<template scope="{row}">
|
<template scope="{row}">
|
||||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||||
|
<template v-if="${@shiro.hasRole('sysadmin')} || ${@shiro.hasRole('A06')} || ${@shiro.hasRole('xxhgly')}">
|
||||||
|
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||||
|
<el-button @click="deleteDo(row)" size="mini" type="danger">删除</el-button>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<el-button v-if="row.sponsorType == 1" :disabled="[810, 840, 870, 900, 930].includes(row.state)" @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
|
<el-button v-if="row.sponsorType == 1" :disabled="[810, 840, 870, 900, 930].includes(row.state)" @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||||
<el-button v-if="row.sponsorType == 2" :disabled="[840, 870, 900, 930].includes(row.state)" @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
|
<el-button v-if="row.sponsorType == 2" :disabled="[840, 870, 900, 930].includes(row.state)" @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||||
<el-button v-if="${@shiro.hasRole('sysadmin')} || ${@shiro.hasRole('A06')} || ${@shiro.hasRole('xxhgly')}"
|
<el-button :disabled="![800,820,850,880].includes(row.state)" @click="deleteDo(row)" size="mini" type="danger">删除</el-button>
|
||||||
@click="deleteDo(row)" size="mini" type="danger">删除</el-button>
|
</template>
|
||||||
<el-button v-else :disabled="![800,820,850,880].includes(row.state)" @click="deleteDo(row)" size="mini" type="danger">删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
Reference in New Issue
Block a user