commit
This commit is contained in:
+19
-6
@@ -5,6 +5,7 @@ import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
@@ -16,6 +17,7 @@ import com.budwk.app.sys.models.Sys_union;
|
||||
import com.budwk.app.sys.models.Sys_union_group;
|
||||
import com.budwk.app.sys.models.Sys_unit;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.staffmanage.member.models.MemberChangeRecord;
|
||||
@@ -101,9 +103,15 @@ public class MemberChangeApplyController {
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
// 判断有没有工会小组
|
||||
Sys_union_group group = dao.fetch(Sys_union_group.class, Cnd.where(Sys_union_group::getUnionId, "=", SecurityUtil.getUnionId())
|
||||
.and(new Static("JSON_CONTAINS(unitIds, '\"%s\"')".formatted(SecurityUtil.getUnitId()))));
|
||||
args.set("submit", Lang.isEmpty(group) ? "singleBranch" : "singleHaveGroup");
|
||||
// Sys_union_group group = dao.fetch(Sys_union_group.class, Cnd.where(Sys_union_group::getUnionId, "=", SecurityUtil.getUnionId())
|
||||
// .and(new Static("JSON_CONTAINS(unitIds, '\"%s\"')".formatted(SecurityUtil.getUnitId()))));
|
||||
// args.set("submit", Lang.isEmpty(group) ? "singleBranch" : "singleHaveGroup");
|
||||
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
args.set("origin", "schoolUnion");
|
||||
}else {
|
||||
args.set("origin", "person");
|
||||
}
|
||||
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, memberChangeRecord);
|
||||
@@ -133,9 +141,14 @@ public class MemberChangeApplyController {
|
||||
|
||||
Dict dict = Dict.create();
|
||||
// 判断有没有工会小组
|
||||
Sys_union_group group = dao.fetch(Sys_union_group.class, Cnd.where(Sys_union_group::getUnionId, "=", SecurityUtil.getUnionId())
|
||||
.and(new Static("JSON_CONTAINS(unitIds, '\"%s\"')".formatted(SecurityUtil.getUnitId()))));
|
||||
dict.set("submit", Lang.isEmpty(group) ? "singleBranch" : "singleHaveGroup");
|
||||
// Sys_union_group group = dao.fetch(Sys_union_group.class, Cnd.where(Sys_union_group::getUnionId, "=", SecurityUtil.getUnionId())
|
||||
// .and(new Static("JSON_CONTAINS(unitIds, '\"%s\"')".formatted(SecurityUtil.getUnitId()))));
|
||||
// dict.set("submit", Lang.isEmpty(group) ? "singleBranch" : "singleHaveGroup");
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name())) {
|
||||
dict.set("origin", "schoolUnion");
|
||||
}else {
|
||||
dict.set("origin", "person");
|
||||
}
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
flowCommonService.executeTask(dict);
|
||||
|
||||
+9
-17
@@ -108,13 +108,12 @@ public class MemberChangeManageController {
|
||||
}
|
||||
|
||||
boolean schoolRoleBool = AuthUtil.hasRoleOr(RoleConstant.SCHOOL_UNION_CHAIRMAN.name(), RoleConstant.SCHOOL_UNION_MEMBER_ADMIN.name(), RoleConstant.SYSADMIN.name());
|
||||
boolean branchRoleBool = AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name());
|
||||
boolean branchRoleBool = AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name(), RoleConstant.BRANCH_UNION_ADMIN.name());
|
||||
boolean groupRoleBool = AuthUtil.hasRole(RoleConstant.BRANCH_UNION_GROUP_LEADER.name());
|
||||
|
||||
// 变更类型
|
||||
MemberChangeOrigin changeOrigin = schoolRoleBool ? MemberChangeOrigin.SCHOOL_UNION :
|
||||
branchRoleBool ? MemberChangeOrigin.BRANCH_UNION :
|
||||
groupRoleBool ? MemberChangeOrigin.UNION_GROUP : null;
|
||||
branchRoleBool ? MemberChangeOrigin.BRANCH_UNION : null;
|
||||
|
||||
if (changeOrigin == null) {
|
||||
throw new BaseException("没有权限,或未设置工会小组");
|
||||
@@ -125,23 +124,16 @@ public class MemberChangeManageController {
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set("submit", "admin");
|
||||
args.set("origin", "schoolUnion");
|
||||
|
||||
if (schoolRoleBool) {
|
||||
// 校工会管理员提交
|
||||
args.set("adminSubmit", "schoolUnion");
|
||||
} else if (branchRoleBool) {
|
||||
args.set("adminSubmit", "branchUnion");
|
||||
args.set("origin", "schoolUnion");
|
||||
} else {
|
||||
args.set("adminSubmit", "unionGroup");
|
||||
// 还要设置工会小组是否需要审核的参数
|
||||
Sys_config config = dao.fetch(Sys_config.class, Cnd.where(Sys_config::getConfigKey, "=", "UnionGroupIsNeedBranchAudit"));
|
||||
if ("true".equals(config.getConfigValue())) {
|
||||
// 需要,流转到分工会审核
|
||||
args.set("groupAuditNext", "branchAudit");
|
||||
} else {
|
||||
// 不需要,流转到校工会审核
|
||||
args.set("groupAuditNext", "schoolAudit");
|
||||
}
|
||||
// 分工会管理员提交
|
||||
args.set("adminSubmit", "branchUnion");
|
||||
args.set("origin", "branchUnion");
|
||||
}
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, record);
|
||||
@@ -183,6 +175,6 @@ public class MemberChangeManageController {
|
||||
@Ok("void")
|
||||
@ApiOperation("导出会员名单")
|
||||
public void doExport(MemberManagePageForm pageForm, HttpServletResponse response) {
|
||||
memberCommonService.assembleExcel(pageForm, response);
|
||||
memberCommonService.assembleExcel(pageForm, response);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -408,8 +408,11 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
|
||||
// 如果有工会关系变更,也需要记录变更了什么工会
|
||||
history.setChangeInfos(changeList);
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue"));
|
||||
}).collect(Collectors.joining(";"));
|
||||
String fieldName = v.getString("fieldName", "");
|
||||
String sourceValue = v.getString("sourceValue", "");
|
||||
String newValue = v.getString("newValue", "");
|
||||
return fieldName + ":" + HtmlUtil.cleanHtmlTag(sourceValue) + "->" + HtmlUtil.cleanHtmlTag(newValue);
|
||||
}).collect(Collectors.joining(";"));
|
||||
history.setChangeInfosStr(changeInfos);
|
||||
dao().updateIgnoreNull(info);
|
||||
dao().insert(history);
|
||||
|
||||
@@ -74,7 +74,7 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||
{ prop: "changeTypes", label: "变更类型", sortable: true, width: 200 },
|
||||
{ prop: "applyDateTime", label: "申请时间", sortable: true },
|
||||
{ prop: "curTaskName", label: "当前节点"},
|
||||
{ prop: "taskName", label: "当前节点"},
|
||||
{ prop: "instanceState", label: "流程状态"}
|
||||
],
|
||||
changeTypeData: [],
|
||||
|
||||
Reference in New Issue
Block a user