This commit is contained in:
@jyuhsin
2026-03-09 16:05:02 +08:00
parent 7caa5ba577
commit f38212b157
4 changed files with 45 additions and 8 deletions
@@ -118,6 +118,7 @@ public class SysMsgController {
@Param("type") String type,
@Param("unionId") String unionId,
@Param("unitId") String unitId,
@Param("clubId") String clubId,
@Param("id") String id) {
try {
Cnd cnd = Cnd.NEW();
@@ -147,6 +148,13 @@ public class SysMsgController {
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(pageForm.getSearchName(), "like", "%" + pageForm.getSearchKeyword() + "%");
}
if(StrUtil.isNotBlank(clubId)) {
List<ClubUser> clubUsers = sysClubService.dao().query(ClubUser.class, Cnd.where("clubId", "=", clubId));
if(Lang.isNotEmpty(clubUsers)) {
List<String> clubUserList = clubUsers.stream().map(ClubUser::getUserId).distinct().toList();
cnd.and("u.id", "in", clubUserList);
}
}
if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} else {
@@ -192,7 +200,7 @@ public class SysMsgController {
@At
@Ok("json:{locked:'password|salt',ignoreNull:false}")
@SaCheckLogin
public Object user_data(@Valid PageForm pageForm, String unionId, String unitId, String roleId, String sex) {
public Object user_data(@Valid PageForm pageForm, String unionId, String unitId, String roleId, String sex, String clubId) {
try {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
@@ -211,6 +219,14 @@ public class SysMsgController {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
if(StrUtil.isNotBlank(clubId)) {
List<ClubUser> clubUsers = sysClubService.dao().query(ClubUser.class, Cnd.where("clubId", "=", clubId));
if(Lang.isNotEmpty(clubUsers)) {
List<String> clubUserList = clubUsers.stream().map(ClubUser::getUserId).distinct().toList();
cnd.and("u.id", "in", clubUserList);
}
}
SqlExpressionGroup group = new SqlExpressionGroup();
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if(AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
@@ -77,10 +77,10 @@ layout("/layouts/platform.html"){
</el-card>
</template>
<template #edit>
<msg-form ref="msgForm" @back="back" :union-list="unionList" :unit-list="unitList" @parent-do-search="doSearch"></msg-form>
<msg-form ref="msgForm" @back="back" :union-list="unionList" :unit-list="unitList" :club-list="clubList" @parent-do-search="doSearch"></msg-form>
</template>
</guava>
<view-user ref="viewUser" :type="type" :id="id" :union-list="unionList" :unit-list="unitList"></view-user>
<view-user ref="viewUser" :type="type" :id="id" :union-list="unionList" :unit-list="unitList" :club-list="clubList"></view-user>
<el-dialog title="消息内容" :visible.sync="noteVisible" width="50%">
<div class="note" v-html="nodeData.note">
@@ -113,6 +113,7 @@ layout("/layouts/platform.html"){
id: "",
unionList: [],
unitList: [],
clubList: [],
noteVisible: false,
nodeData: {}
}
@@ -172,6 +173,7 @@ layout("/layouts/platform.html"){
created: async function () {
this.unitList = await this.$businessTool.listUnit()
this.unionList = await this.$businessTool.listUnion()
this.clubList = await this.$businessTool.listCLubByRole()
this.pageData()
}
})
@@ -64,8 +64,8 @@ const MSG_FORM_TEMPLATE = {
</el-row>
</el-form>
<el-dialog title="选择用户" :visible.sync="selectDialogVisible" width="65%" append-to-body top="2%">
<div class="btn-group tool-button">
<el-dialog title="选择用户" :visible.sync="selectDialogVisible" width="65%" append-to-body top="2%" class="select-dialog">
<div class="btn-group tool-button" style="line-height: 50px">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" @keyup.enter.native="doSearch" style="width: 240px">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
<el-option label="工号" value="u.loginname"></el-option>
@@ -84,6 +84,9 @@ const MSG_FORM_TEMPLATE = {
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位" filterable clearable>
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-select v-model="pageForm.clubId" placeholder="请选择所属协会" filterable clearable>
<el-option v-for="item in clubList" :key="item.id" :label="item.clubName" :value="item.id"></el-option>
</el-select>
<el-select v-model="pageForm.roleId" placeholder="请选择角色" filterable clearable>
<el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
@@ -122,7 +125,11 @@ const MSG_FORM_TEMPLATE = {
unitList: {
type: Array,
required: true
}
},
clubList: {
type: Array,
required: true
},
},
data() {
return {
@@ -269,5 +276,10 @@ const MSG_FORM_TEMPLATE = {
},
async created() {
this.roleList = await this.getRoleList()
}
},
style: /*language=CSS*/ `
/deep/.select-dialog .el-dialog__body{
padding: 10px 20px !important;
}
`
}
@@ -16,6 +16,9 @@ const VIEW_USER_TEMPLATE = {
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位" size="small" filterable clearable>
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-select v-model="pageForm.clubId" placeholder="请选择所属协会" filterable clearable>
<el-option v-for="item in clubList" :key="item.id" :label="item.clubName" :value="item.id"></el-option>
</el-select>
<el-button icon="el-icon-search" @click="doSearch" size="small" type="primary"></el-button>
</div>
<div class="left-span-label mt20">{{viewUserTitle}}列表</div>
@@ -54,7 +57,11 @@ const VIEW_USER_TEMPLATE = {
unitList: {
type: Array,
required: true
}
},
clubList: {
type: Array,
required: true
},
},
data() {
return {