This commit is contained in:
2025-09-30 15:49:11 +08:00
14 changed files with 405 additions and 68 deletions
@@ -21,8 +21,10 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
import java.util.Arrays;
import java.util.List;
@IocBean
@@ -82,8 +84,11 @@ public class SysUnionGroupController {
@At
@SaCheckPermission("sys.manager.union")
@ApiOperation("获取非工会小组组长人员")
public Result listUser(@Valid String unionId, String keyword) {
List<NutMap> list = sysUnionGroupService.listNotLeader(unionId, keyword);
public Result listUser(@Valid @Param("unionId") String unionId,
@Param("keyword") String keyword,
@Param("userIds") String[] userIds) {
System.out.println(Arrays.toString(userIds));
List<NutMap> list = sysUnionGroupService.listNotLeader(unionId, keyword, Arrays.asList(userIds));
return Result.success(list);
}
@@ -22,8 +22,9 @@ public interface SysUnionGroupService extends BaseService<Sys_union_group> {
* 查询非组长的成员
* @param unionId 分工会id
* @param keyword 关键字
* @param userIds 用户Id
*/
List<NutMap> listNotLeader(String unionId, String keyword);
List<NutMap> listNotLeader(String unionId, String keyword, List<String> userIds);
/**
* 分页查询
@@ -22,6 +22,7 @@ import org.nutz.dao.util.cri.SqlExpressionGroup;
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.lang.util.NutMap;
import java.util.List;
@@ -72,14 +73,19 @@ public class SysUnionGroupServiceImpl extends BaseServiceImpl<Sys_union_group> i
}
@Override
public List<NutMap> listNotLeader(String unionId, String keyword) {
public List<NutMap> listNotLeader(String unionId, String keyword, List<String> userIds) {
Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user $condition limit 0,10");
Cnd cnd = Cnd.NEW();
cnd.and("unionId", "=", unionId);
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("username", keyword);
seg.orLike("loginname", keyword);
cnd.and(seg);
if (StrUtil.isNotBlank(keyword)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("username", keyword);
seg.orLike("loginname", keyword);
cnd.and(seg);
} else {
cnd.and("id", "in", userIds);
}
sql.setCondition(cnd);
return listMap(sql);
}
@@ -194,7 +194,7 @@ public class BuildHomeAgencyController {
@SaCheckPermission("buildHome.agency")
@ApiOperation("获取非工会小组组长人员")
public Result listUser(@Valid String keyword) {
List<NutMap> list = sysUnionGroupService.listNotLeader(SecurityUtil.getUnionId(), keyword);
List<NutMap> list = sysUnionGroupService.listNotLeader(SecurityUtil.getUnionId(), keyword, null);
return Result.success(list);
}
@@ -45,6 +45,11 @@ public class MemberApplyUnionGroupApprovalController {
@SaCheckPermission("member.apply.unionGroupApproval")
public void index() {}
@At
@Ok("beetl:/platform/zhghh5/staffmanage/member/apply/uniongroupapproval/index.html")
@SaCheckPermission("h5.member.apply.uniongroupapproval")
public void h5() {
}
@At
@ApiOperation("会员入会申请工会小组审核列表")
@@ -2,12 +2,15 @@ package com.budwk.app.zhgh.staffmanage.member.interceptor;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.engine.FlowInterceptor;
import com.budwk.app.flow.engine.core.Execution;
import com.budwk.app.flow.engine.core.ServiceContext;
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
import com.budwk.app.sys.models.Sys_role;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.models.Sys_user_role;
import com.budwk.app.zhgh.staffmanage.member.models.MemberApplyRecord;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
@@ -44,7 +47,21 @@ public class MemberApplySchoolApprovalInterceptor implements FlowInterceptor {
Sys_user sysUser = new Sys_user();
BeanUtil.copyProperties(record, sysUser);
sysUser.setId(record.getUserId());
sysUser.setMember(true);
sysUser.setWelfareMember(true);
dao.updateIgnoreNull(sysUser);
// 还要设置会员角色
Sys_role role = dao.fetch(Sys_role.class, Cnd.where(Sys_role::getCode, "=", RoleConstant.MEMBER.name()));
int count = dao.count(Sys_user_role.class, Cnd.where("userId", "=", record.getUserId()).and("roleId", "=", role.getId()));
if (count == 0) {
Sys_user_role userRole = new Sys_user_role();
userRole.setUserId(record.getUserId());
userRole.setRoleId(role.getId());
dao.insert(userRole);
}
// 正常的发送短信,审核通过
} else {
// 发TMD短信 HMC,流程在流转到分工会接收环节
@@ -113,8 +113,10 @@ const branchUnionGroupManage = {
async onEdit(row) {
this.formData = { ...row }
this.formData.unitIds = JSON.parse(row.unitIds)
this.formData.leaders = JSON.parse(row.leaders)
await this.getUnits(row.id)
this.getUserOptions(row.leaderUserName)
this.getUserOptions(null, this.formData.leaders)
this.dialogFormVisible = true
this.$nextTick(() => {
this.$refs.formRef.clearValidate()
@@ -166,8 +168,12 @@ const branchUnionGroupManage = {
})
},
getUserOptions(keyword) {
$.get("/platform/sys/unionGroup/listUser", { keyword, unionId: this.union_id }).then((res) => {
getUserOptions(keyword, userIds = null) {
$.get("/platform/sys/unionGroup/listUser", {
keyword,
unionId: this.union_id,
userIds: JSON.stringify(userIds)
}).then((res) => {
if (res.code === 0) {
this.userOptions = res.data
}
@@ -101,7 +101,12 @@ layout("/layouts/platform.html"){
disabled style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="编制类别">
<el-form-item prop="preparedBy">
<dict-select v-model="formData.preparedBy" code="USER_PREPARED_BY_TYPE"
disabled style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="身份证号码">
<el-form-item prop="idCard">
@@ -157,7 +157,7 @@ const MEMBER_CHANGE = {
<el-form-item prop="retireDate">
<el-date-picker v-model="formData.retireDate"
type="date"
placeholder="请选择出生日期"
placeholder="请选择退休日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
@@ -128,30 +128,32 @@ layout("/layouts/platform_h5.html"){
},
async handleTaskAction(val) {
try {
await this.$refs.formRef.validate();
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.infoRef.onClose()
this.$toast.success(res.msg)
this.doSearch()
}
})
}).catch(() => {
await this.$refs.formRef.validate();
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
} catch (error) {
}
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.infoRef.onClose()
this.$toast.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
})
},
// 撤回
@@ -160,11 +162,19 @@ layout("/layouts/platform_h5.html"){
title: '提示',
message: '您确定要撤回吗?',
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post('/flow/common/revokeTask', {taskId: row.taskId}).then(res => {
if (res.code === 0) {
this.$toast.success('撤回成功');
this.doSearch();
}
}).finally(() => {
loading.close()
})
})
},
@@ -98,9 +98,17 @@ layout("/layouts/platform_h5.html"){
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post("/flow/common/revokeTask", { taskId: row.startTaskId }).then((resp) => {
this.$toast.success(resp.msg)
this.doSearch()
}).finally(() => {
loading.close()
})
})
},
@@ -112,6 +120,12 @@ layout("/layouts/platform_h5.html"){
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post("/platform/member/apply/mine/onDelete", { id }).then((res) => {
if (res.code === 0) {
this.doSearch()
@@ -119,6 +133,8 @@ layout("/layouts/platform_h5.html"){
} else {
this.$toast.fail(res.msg)
}
}).finally(() => {
loading.close()
})
})
},
@@ -128,30 +128,32 @@ layout("/layouts/platform_h5.html"){
},
async handleTaskAction(val) {
try {
await this.$refs.formRef.validate();
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.infoRef.onClose()
this.$toast.success(res.msg)
this.doSearch()
}
})
}).catch(() => {
await this.$refs.formRef.validate();
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
} catch (error) {
}
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.infoRef.onClose()
this.$toast.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
})
},
// 撤回
@@ -160,14 +162,21 @@ layout("/layouts/platform_h5.html"){
title: '提示',
message: '您确定要撤回吗?',
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post('/flow/common/revokeTask', {taskId: row.startTaskId}).then(res => {
if (res.code === 0) {
this.$toast.success('撤回成功');
this.doSearch();
}
}).finally(() => {
loading.close()
})
}).catch(() => {
});
})
},
initUnion() {
@@ -143,6 +143,14 @@ layout("/layouts/platform_h5.html"){
placeholder="请填写人员类型"
clickable
></van-field>
<van-field
v-model="formData.preparedBy"
name="preparedBy"
label="编制类别"
readonly
placeholder="请填写编制类别"
clickable
></van-field>
<van-field
v-model="formData.idCard"
disabled
@@ -278,6 +286,12 @@ layout("/layouts/platform_h5.html"){
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post('/platform/member/apply/submit/save', {data: JSON.stringify(this.formData)}).then(res => {
if (res.code === 0) {
this.$toast.success(res.msg)
@@ -286,6 +300,8 @@ layout("/layouts/platform_h5.html"){
this.$toast.fail('操作失败')
console.log(res.msg)
}
}).finally(() => {
loading.close()
})
})
},
@@ -296,6 +312,12 @@ layout("/layouts/platform_h5.html"){
title: "提示",
message: "您确定要提交吗?"
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post('/platform/member/apply/submit/submit', {
data: JSON.stringify(this.formData)
}).then(res => {
@@ -306,7 +328,9 @@ layout("/layouts/platform_h5.html"){
this.$toast.fail('操作失败')
console.log(res.msg)
}
})
}).finally(() => {
loading.close()
})
})
})
},
@@ -317,6 +341,12 @@ layout("/layouts/platform_h5.html"){
title: "提示",
message: "您确定要提交吗?"
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post('/platform/member/apply/submit/submitAgain', {
data: JSON.stringify(this.formData),
taskId: this.taskId,
@@ -328,7 +358,9 @@ layout("/layouts/platform_h5.html"){
this.$toast.fail('操作失败')
console.log(res.msg)
}
})
}).finally(() => {
loading.close()
})
})
})
},
@@ -465,27 +497,28 @@ layout("/layouts/platform_h5.html"){
}
},
computed: {
nationColumns(){
if(this.dict && this.dict.type && this.dict.type.USER_NATION){
return this.dict.type.USER_NATION.map(v=>v.value)
return this.dict.type.USER_NATION.map(v=>v.name)
}
return []
},
politicalColumns(){
if(this.dict && this.dict.type && this.dict.type.USER_POLITICAL){
return this.dict.type.USER_POLITICAL.map(v=>v.value)
return this.dict.type.USER_POLITICAL.map(v=>v.name)
}
return []
},
educationColumns(){
if(this.dict && this.dict.type && this.dict.type.USER_EDUCATION){
return this.dict.type.USER_EDUCATION.map(v=>v.value)
return this.dict.type.USER_EDUCATION.map(v=>v.name)
}
return []
},
academicDegreeColumns(){
if(this.dict && this.dict.type && this.dict.type.USER_ACADEMIC_DEGREE){
return this.dict.type.USER_ACADEMIC_DEGREE.map(v=>v.value)
return this.dict.type.USER_ACADEMIC_DEGREE.map(v=>v.name)
}
return []
},
@@ -0,0 +1,224 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar title="入会校工会审核" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
<van-sticky>
<van-search
v-model="pageForm.searchKeyword"
placeholder="请输入工号或者姓名进行查询"
show-action
:reverse-color="false"
input-align="left"
@search="doSearch">
<template #action>
<div @click="doSearch">搜索</div>
</template>
</van-search>
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="unitList" @change="doSearch" v-model="pageForm.unitId"></van-dropdown-item>
<van-dropdown-item :options="auditList" @change="doSearch" v-model="pageForm.audit"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<table-list api="/platform/member/apply/unionGroupApproval/pageData" :page_form.sync="pageForm" ref="tableListRef" title="userName" @ready="doSearch">
<template v-slot="{index,row}">
<table-column label="工号">{{row.loginName}}</table-column>
<table-column label="所属工会">{{row.unionName}}</table-column>
<table-column label="工作单位">{{row.unitName}}</table-column>
<table-column label="填报时间">{{row.applyDateTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskState === 10" @click="onApproval(row)">
<i class="fa fa-check"></i>
<span>审核</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
<i class="fa fa-undo"></i>
<span>撤回</span>
</div>
</template>
</table-list>
<info ref="infoRef">
<div v-if="showApprovalForm">
<div class="process-title">{{formData.taskName}}</div>
<van-form ref="formRef">
<van-field
v-model="formData.tf_opinion"
name="tf_opinion"
label="审批意见"
placeholder="请输入审批意见"
:rules="[{ required: true, message: '请填写审批意见' }]"
required
maxlength="100"
show-word-limit
></van-field>
</van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="danger" block @click="handleTaskAction(6)">退回</van-button>
<van-button type="danger" block @click="handleTaskAction(2)">拒绝</van-button>
<van-button type="primary" block @click="handleTaskAction(1)">同意</van-button>
</div>
</div>
</info>
</div>
<script>
<!--#include("../common/info.js"){}#-->
new Vue({
el: "#app",
store,
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
unionId: "",
unitId: "",
audit: false
},
unitList: [],
auditList: [
{ text: "已审核", value: true },
{ text: "未审核", value: false }
],
// 审核相关
formData: {},
showApprovalForm: false
}
},
components: {
"info": INFO
},
methods: {
historyBack,
onReady() {
this.doSearch()
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
// 查看详情
onView(row) {
this.showApprovalForm = false
this.$refs.infoRef.onOpen(row)
},
onApproval(row) {
this.showApprovalForm = true
this.$refs.infoRef.onOpen(row)
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName
}
},
async handleTaskAction(val) {
await this.$refs.formRef.validate();
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.infoRef.onClose()
this.$toast.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
})
},
// 撤回
onRevoke(row) {
this.$dialog.confirm({
title: '提示',
message: '您确定要撤回吗?',
}).then(() => {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post('/flow/common/revokeTask', {taskId: row.startTaskId}).then(res => {
if (res.code === 0) {
this.$toast.success('撤回成功');
this.doSearch();
}
}).finally(() => {
loading.close()
})
}).catch(() => {
});
},
initUnion() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? null : this.$store.state.user.union.id
this.$businessTool.listUnion(unionId).then((data) => {
this.unionList = data
this.unionList.forEach((v) => {
v.text = v.name
v.value = v.id
})
if (hasAdmin) {
this.unionList.unshift({ text: "全部工会", value: null })
}
if (this.unionList && this.unionList.length > 0) {
this.$set(this.pageForm, "unionId", this.unionList[0].value)
}
})
},
flushUnits() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
this.$businessTool.listUnit(unionId).then((data) => {
this.unitList = data
this.unitList.forEach((v) => {
v.text = v.name
v.value = v.id
})
if (this.unitList && this.unitList.length > 0) {
this.unitList.unshift({ text: "全部单位", value: null })
this.$set(this.pageForm, "unitId", this.unitList[0].value)
}
})
}
},
async created() {
await this.initUnion()
await this.flushUnits()
}
})
</script>
<!--#
}
#-->