Merge remote-tracking branch 'origin/main'
This commit is contained in:
+24
-1
@@ -24,6 +24,8 @@ import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
|
||||
import com.budwk.app.zhgh.activity.basic.param.ActivityUserScopePageParam;
|
||||
import com.budwk.app.zhgh.activity.basic.service.ActivityBasicScopeService;
|
||||
import com.budwk.app.zhgh.activity.basic.template.UserTemp;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@@ -73,6 +75,9 @@ public class ActivityBasicScopeController {
|
||||
@Inject
|
||||
private ActivityBasicScopeService activityBasicScopeService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@@ -244,6 +249,8 @@ public class ActivityBasicScopeController {
|
||||
return Result.success(new NutMap() {{
|
||||
addv("is_A06", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_ADMIN.name()));
|
||||
addv("is_H04", StpUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()));
|
||||
addv("is_H02", StpUtil.hasRole(RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name()));
|
||||
addv("is_CLUB_PRESIDENT", StpUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name()));
|
||||
addv("is_sysadmin", StpUtil.hasRole(RoleConstant.SYSADMIN.name()));
|
||||
addv("unionid", SecurityUtil.getUnionId());
|
||||
}});
|
||||
@@ -377,7 +384,23 @@ public class ActivityBasicScopeController {
|
||||
try {
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())){
|
||||
cnd.andEX("u.unionid", "=", SecurityUtil.getUnionId());
|
||||
boolean isBranchUnionChairman = AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name());
|
||||
boolean isClubPresident = AuthUtil.hasRole(RoleConstant.CLUB_PRESIDENT.name());
|
||||
List<String> manageClubIdList = sysClubService.getMyManageClub().stream().map(SysClub::getId).toList();
|
||||
if (isBranchUnionChairman && isClubPresident) {
|
||||
// Users with both roles can search their union users and their managed club members.
|
||||
SqlExpressionGroup scopeGroup = new SqlExpressionGroup();
|
||||
scopeGroup.or("u.unionid", "=", SecurityUtil.getUnionId());
|
||||
if (Lang.isNotEmpty(manageClubIdList)) {
|
||||
scopeGroup.or("clubuser.clubid", "in", manageClubIdList);
|
||||
}
|
||||
cnd.and(scopeGroup);
|
||||
} else if (isClubPresident) {
|
||||
// Club presidents can only search members from clubs they manage.
|
||||
cnd.and("clubuser.clubid", "in", Lang.isNotEmpty(manageClubIdList) ? manageClubIdList : List.of("__EMPTY_CLUB_ID__"));
|
||||
} else {
|
||||
cnd.andEX("u.unionid", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
}
|
||||
cnd.andEX("u.unionid", EQ_OR_NEQ_OP, activityUserScopePageParam.getUnionId());
|
||||
cnd.andEX("u.unitid", EQ_OR_NEQ_OP, activityUserScopePageParam.getUnitId());
|
||||
|
||||
+2
-1
@@ -141,7 +141,8 @@ public class ActivityCultureApplyActivityController {
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, tissue);
|
||||
args.set("activity_type", tissue.getActivity_type());
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey(tissue.getActivity_type().equals(40002) ? "FGHWHHD" : "XHWHHD", tissue.getId(), SecurityUtil.getUserId(), args);
|
||||
// ProcessInstance instance = flowEngine.startProcessInstanceByKey(tissue.getActivity_type().equals(40002) ? "FGHWHHD" : "XHWHHD", tissue.getId(), SecurityUtil.getUserId(), args);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("WHHD", tissue.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
|
||||
@@ -82,4 +82,11 @@ public class ClubCommonController {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result listManageClubByRole() {
|
||||
// Activity user scope uses manageable clubs, not all clubs the user has joined.
|
||||
return Result.success(sysClubService.getMyManageClub());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -282,7 +282,8 @@ public class ClubInfoManageController {
|
||||
}
|
||||
Sys_role sysRole = sysRoleService.getByCode(roleCode);
|
||||
for (String user : users) {
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name()) || !Objects.equals(RoleConstant.CLUB_MEMBER.name(), roleCode)) {
|
||||
// 校工会主席可按校级管理角色录入协会会员并同步用户角色。
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.name()) || !Objects.equals(RoleConstant.CLUB_MEMBER.name(), roleCode)) {
|
||||
Sys_user_role sysUserRole = new Sys_user_role();
|
||||
sysUserRole.setUserId(user);
|
||||
sysUserRole.setRoleId(sysRole.getId());
|
||||
|
||||
+3
-1
@@ -118,8 +118,10 @@ public class ClubRefreshReportController {
|
||||
public Object submit(@Param("data") SysClubRefresh clubRefresh) {
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("userId", "=", SecurityUtil.getUserId());
|
||||
// cnd.and("userId", "=", SecurityUtil.getUserId());
|
||||
// cnd.and("clubId", "=", clubRefresh.getClubId());
|
||||
// 只校验当前协会的未完成换届报告申请,避免其他协会记录误拦截。
|
||||
cnd.and(SysClubRefresh::getClubId, "=", clubRefresh.getClubId());
|
||||
if(StrUtil.isNotBlank(clubRefresh.getId())) {
|
||||
cnd.and(SysClubRefresh::getId, "!=", clubRefresh.getId());
|
||||
}
|
||||
|
||||
+2
@@ -119,6 +119,8 @@ public class ClubRuleUpdateController {
|
||||
public Object submit(@Param("data")SysClubRule clubRule) {
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// 只校验当前协会的未完成章程备案申请,避免其他协会记录误拦截。
|
||||
cnd.and(SysClubRule::getClubId, "=", clubRule.getClubId());
|
||||
if(StrUtil.isNotBlank(clubRule.getId())) {
|
||||
cnd.and(SysClubRule::getId, "!=", clubRule.getId());
|
||||
}
|
||||
|
||||
+14
-3
@@ -291,8 +291,20 @@ public class ClubStatisticsController {
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("上传资料数据.zip"));
|
||||
LinkedHashMap<String, List<JSONObject>> fileList = new LinkedHashMap<>();
|
||||
|
||||
//查询社团
|
||||
List<SysClub> clubList = sysClubService.query(Cnd.NEW().andEX("id", "=", clubId));
|
||||
// 导出上传资料时只取未删除且注册流程已完成的协会,避免历史删除协会资料被打包。
|
||||
Cnd clubCnd = Cnd.NEW();
|
||||
clubCnd.andEX("id", "=", clubId);
|
||||
clubCnd.and("dismiss", "=", false);
|
||||
List<SysClub> clubList = sysClubService.query(clubCnd);
|
||||
if (!clubList.isEmpty()) {
|
||||
List<ProcessInstance> instanceList = sysClubService.dao().query(
|
||||
ProcessInstance.class,
|
||||
Cnd.where(ProcessInstance::getBusinessNo, "in", clubList.stream().map(SysClub::getId).toList())
|
||||
.and(ProcessInstance::getState, "=", ProcessInstanceStateEnum.FINISHED.getCode())
|
||||
);
|
||||
List<String> passList = instanceList.stream().map(ProcessInstance::getBusinessNo).toList();
|
||||
clubList = clubList.stream().filter(o -> passList.contains(o.getId())).toList();
|
||||
}
|
||||
clubList.forEach(item -> {
|
||||
List<JSONObject> file = new ArrayList<>();
|
||||
file.addAll(Optional.ofNullable(item.getFiles()).orElseGet(ArrayList::new));
|
||||
@@ -301,7 +313,6 @@ public class ClubStatisticsController {
|
||||
file.addAll(Optional.ofNullable(item.getManageFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getYearPlanFile()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getReplaceReport()).orElseGet(ArrayList::new));
|
||||
file.addAll(Optional.ofNullable(item.getRulesFile()).orElseGet(ArrayList::new));
|
||||
fileList.put(item.getId(), file);
|
||||
});
|
||||
|
||||
|
||||
+2
-1
@@ -113,7 +113,8 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
cnd.andEX("year(c.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("c.dismiss", "=", false);
|
||||
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
// 校工会主席在协会管理界面按校级管理角色查看全部协会。
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.name())) {
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()));
|
||||
List<Sys_user_role> clubList = dao().query(Sys_user_role.class, Cnd.where("roleId", "in", roleList).and("userId", "=", SecurityUtil.getUserId()).and("clubId", "is not", null));
|
||||
List<String> clubIdList = clubList.stream().map(Sys_user_role::getClubId).toList();
|
||||
|
||||
@@ -114,7 +114,8 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
Cnd cnd = Cnd.where("dismiss", "=", false);
|
||||
cnd.asc("createTime");
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
// 校工会主席在协会管理界面按校级管理角色查看全部协会。
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name(), RoleConstant.SCHOOL_UNION_CHAIRMAN.name())) {
|
||||
List<String> roleList = commonService.findUserRoleByRoleCode(List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(),RoleConstant.CLUB_OPERATOR.name()));
|
||||
List<Sys_user_role> clubList = dao().query(Sys_user_role.class, Cnd.where("roleId", "in", roleList).and("userId", "=", SecurityUtil.getUserId()).and("clubId", "is not", null));
|
||||
List<String> clubIdList = clubList.stream().map(Sys_user_role::getClubId).toList();
|
||||
@@ -245,6 +246,7 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
cnd.andEX("year(info.createTime)", "=", pageForm.getYear());
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.desc("createTime");
|
||||
// cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubRegisterPageVo.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user