协会整改
This commit is contained in:
+88
-6
@@ -1,7 +1,9 @@
|
||||
package com.budwk.app.zhgh.club.controller.infoManage;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
@@ -16,11 +18,13 @@ import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.sys.services.SysUserService;
|
||||
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.activity.basic.models.ActivityUserScope;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpActivity;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpUser;
|
||||
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpUserCourse;
|
||||
import com.budwk.app.zhgh.club.model.ClubPayRecord;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
|
||||
@@ -269,7 +273,7 @@ public class ClubInfoManageController {
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(tag = "社团管理系统-信息管理", msg = "添加社团成员")
|
||||
@SLog(tag = "社团管理系统-信息管理", msg = "添加社团成员")
|
||||
public Result userDoAdd(@Valid String clubId, @Valid String[] users, @Valid String roleCode, @Valid Boolean payed) {
|
||||
|
||||
//查询社团是否存在会长或者秘书长
|
||||
@@ -307,10 +311,48 @@ public class ClubInfoManageController {
|
||||
clubUser.setRoleCode(List.of(roleCode));
|
||||
}
|
||||
dao.insertOrUpdate(clubUser);
|
||||
|
||||
ClubPayRecord payRecord = dao.fetch(
|
||||
ClubPayRecord.class,
|
||||
Cnd.where(ClubPayRecord::getClubId, "=", clubId)
|
||||
.and(ClubPayRecord::getUserId, "=", user)
|
||||
.and(ClubPayRecord::getYear, "=", DateUtil.thisYear())
|
||||
);
|
||||
if (payRecord == null) {
|
||||
ClubPayRecord record = new ClubPayRecord();
|
||||
record.setClubId(clubId);
|
||||
record.setUserId(user);
|
||||
record.setYear(DateUtil.thisYear());
|
||||
record.setPayed(payed != null ? payed : false);
|
||||
|
||||
JSONObject log = new JSONObject();
|
||||
log.set("operatorUserId", SecurityUtil.getUserId());
|
||||
log.set("operatorUserName", SecurityUtil.getUserUsername());
|
||||
log.set("operatorTime", DateUtil.now());
|
||||
log.set("operatorType", "录入成员");
|
||||
log.set("oldValue", null);
|
||||
log.set("newValue", payed != null ? payed : false);
|
||||
|
||||
record.setOperateLogs(List.of(log));
|
||||
dao.insert(record);
|
||||
} else {
|
||||
payRecord.setPayed(payed != null ? payed : false);
|
||||
|
||||
JSONObject log = new JSONObject();
|
||||
log.set("operatorUserId", SecurityUtil.getUserId());
|
||||
log.set("operatorUserName", SecurityUtil.getUserUsername());
|
||||
log.set("operatorTime", DateUtil.now());
|
||||
log.set("operatorType", "录入成员");
|
||||
log.set("oldValue", payRecord.getPayed());
|
||||
log.set("newValue", payed != null ? payed : false);
|
||||
|
||||
payRecord.setOperateLogs(List.of(log));
|
||||
dao.update(payRecord);
|
||||
}
|
||||
}
|
||||
|
||||
clubUserService.clubUser2Scope(clubId, Arrays.asList(users));
|
||||
return Result.success();
|
||||
clubUserService.clubUser2Scope(clubId, Arrays.asList(users));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@@ -381,9 +423,49 @@ public class ClubInfoManageController {
|
||||
});
|
||||
dao.insert(sysUserRoleList);
|
||||
|
||||
if(Lang.isNotEmpty(clubUserList)) {
|
||||
clubUserService.clubUser2Scope(businessId, clubUserList.stream().map(ClubUser::getUserId).toList());
|
||||
}
|
||||
if(Lang.isNotEmpty(clubUserList)) {
|
||||
clubUserService.clubUser2Scope(businessId, clubUserList.stream().map(ClubUser::getUserId).toList());
|
||||
|
||||
for (ClubUser cUser : clubUserList) {
|
||||
ClubPayRecord payRecord = dao.fetch(
|
||||
ClubPayRecord.class,
|
||||
Cnd.where(ClubPayRecord::getClubId, "=", businessId)
|
||||
.and(ClubPayRecord::getUserId, "=", cUser.getUserId())
|
||||
.and(ClubPayRecord::getYear, "=", DateUtil.thisYear())
|
||||
);
|
||||
if (payRecord == null) {
|
||||
ClubPayRecord record = new ClubPayRecord();
|
||||
record.setClubId(businessId);
|
||||
record.setUserId(cUser.getUserId());
|
||||
record.setYear(DateUtil.thisYear());
|
||||
record.setPayed(false);
|
||||
|
||||
JSONObject log = new JSONObject();
|
||||
log.set("operatorUserId", SecurityUtil.getUserId());
|
||||
log.set("operatorUserName", SecurityUtil.getUserUsername());
|
||||
log.set("operatorTime", DateUtil.now());
|
||||
log.set("operatorType", "导入成员");
|
||||
log.set("oldValue", null);
|
||||
log.set("newValue", false);
|
||||
|
||||
record.setOperateLogs(List.of(log));
|
||||
dao.insert(record);
|
||||
} else {
|
||||
payRecord.setPayed(false);
|
||||
|
||||
JSONObject log = new JSONObject();
|
||||
log.set("operatorUserId", SecurityUtil.getUserId());
|
||||
log.set("operatorUserName", SecurityUtil.getUserUsername());
|
||||
log.set("operatorTime", DateUtil.now());
|
||||
log.set("operatorType", "导入成员");
|
||||
log.set("oldValue", payRecord.getPayed());
|
||||
log.set("newValue", false);
|
||||
|
||||
payRecord.setOperateLogs(List.of(log));
|
||||
dao.update(payRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//如果有错误数据就返回给前端
|
||||
if (Lang.isNotEmpty(errorInfos)) {
|
||||
|
||||
+15
-2
@@ -6,13 +6,17 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.club.model.ClubPayRecord;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.service.ClubPayRecordService;
|
||||
import com.budwk.app.zhgh.club.service.SysClubService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -51,6 +55,9 @@ public class ClubPayRecordController {
|
||||
@Inject
|
||||
private ClubPayRecordService payRecordService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("club.infoManage.pay")
|
||||
@Ok("beetl:/platform/zhgh/club/infoManage/pay/index.html")
|
||||
@@ -82,10 +89,16 @@ public class ClubPayRecordController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
List<String> clubIdList = sysClubService.getMyManageClub().stream()
|
||||
.map(SysClub::getId)
|
||||
.toList();
|
||||
cnd.andEX("cpr.year", "=", year);
|
||||
cnd.andEX("cpr.clubId", "=", clubId);
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.andEX("cpr.clubId", "in", clubIdList);
|
||||
}else{
|
||||
cnd.andEX("cpr.clubId", "=", clubId);
|
||||
}
|
||||
cnd.andEX("cpr.payed", "=", payed);
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("u.userName", pageForm.getSearchKeyword());
|
||||
|
||||
@@ -66,6 +66,7 @@ public class ClubMyApplyController {
|
||||
sysClubService.dao().clear(Sys_user_role.class, Cnd.where("clubId", "=", id));
|
||||
sysClubService.dao().clear(SysClubEvaluate.class, Cnd.where("clubId", "=", id));
|
||||
sysClubService.dao().clear(SysClubExamineRegister.class, Cnd.where("clubId", "=", id));
|
||||
sysClubService.dao().clear(ClubPayRecord.class, Cnd.where("clubId", "=", id));
|
||||
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
|
||||
+76
-1
@@ -172,19 +172,24 @@ public class ClubStatisticsController {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("人员明细.zip"));
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
SELECT
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.unitname as unitName,
|
||||
u.userstate as userState,
|
||||
club.clubName,
|
||||
club.foundTime,
|
||||
c.*
|
||||
FROM
|
||||
club_user c
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
LEFT JOIN sys_club club ON club.id = c.clubId
|
||||
$condition
|
||||
ORDER BY
|
||||
club.foundTime ASC,
|
||||
club.clubCode ASC,
|
||||
CASE
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_PRESIDENT"') THEN 1
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
@@ -254,6 +259,76 @@ public class ClubStatisticsController {
|
||||
zipOutputStream.close();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.statistics")
|
||||
public void exportUserDataExcel(String userState,
|
||||
String sex,
|
||||
Boolean giveMoney,
|
||||
HttpServletResponse response) throws IOException {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode("全部人员明细.xlsx"));
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.username as userName,
|
||||
u.loginname as loginName,
|
||||
u.sex,
|
||||
u.mobile,
|
||||
u.unitname as unitName,
|
||||
u.userstate as userState,
|
||||
club.clubName,
|
||||
c.*
|
||||
FROM
|
||||
club_user c
|
||||
LEFT JOIN `vw_user` u ON u.id = c.userId
|
||||
LEFT JOIN sys_club club ON club.id = c.clubId
|
||||
$condition
|
||||
ORDER BY
|
||||
club.clubCode,
|
||||
CASE
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_PRESIDENT"') THEN 1
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(c.roleCode, '"CLUB_MEMBER"') THEN 5
|
||||
ELSE 99
|
||||
END
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_CLUB_ADMIN.name())) {
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.CLUB_PRESIDENT);
|
||||
List<Sys_user_role> userRoles = sysClubService.dao().query(Sys_user_role.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("roleId", "=", sysRole.getId()));
|
||||
List<String> myClubId = userRoles.stream().map(Sys_user_role::getClubId).toList();
|
||||
cnd.and("c.clubId", "in", myClubId);
|
||||
}
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = sysClubService.listMap(sql);
|
||||
|
||||
for (NutMap nutMap : listMap) {
|
||||
List<String> list = Json.fromJsonAsList(String.class, nutMap.getString("roleCode"));
|
||||
String roleName = SysClubUserServiceImpl.convertRoleName(list);
|
||||
nutMap.put("roleName", roleName);
|
||||
nutMap.put("roleCode", list);
|
||||
}
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("社团名称", "clubName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
exportEntities.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所在单位", "unitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||
exportEntities.add(new ExcelExportEntity("职务", "roleName", 20));
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, listMap);
|
||||
CommonDownloadUtil.download("全部人员明细.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("club.statistics")
|
||||
|
||||
@@ -310,7 +310,8 @@ public class SysClubExamineServiceImpl extends BaseServiceImpl<SysClubExamineReg
|
||||
buildPageBaseCondition(cnd, pageForm, "info");
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.groupBy("info.id");
|
||||
cnd.desc("registerDate");
|
||||
// cnd.desc("registerDate");
|
||||
cnd.asc("sc.foundTime");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubExaminePageVo.class);
|
||||
}
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
cnd.and("c.id", "in", clubIdList);
|
||||
}
|
||||
cnd.groupBy("c.id");
|
||||
cnd.asc("c.clubCode");
|
||||
cnd.asc("c.foundTime");
|
||||
sql.setCondition(cnd);
|
||||
return listPageVO(pageForm, sql, ClubCommonPageVo.class);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.budwk.app.zhgh.club.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.constant.BpmProcessConstant;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
@@ -21,6 +22,7 @@ import com.budwk.app.sys.models.Sys_user_role;
|
||||
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.club.model.ClubPayRecord;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.SysClub;
|
||||
import com.budwk.app.zhgh.club.model.SysClubSponsor;
|
||||
@@ -177,6 +179,33 @@ public class SysClubServiceImpl extends BaseServiceImpl<SysClub> implements SysC
|
||||
return clubUser;
|
||||
}).toList();
|
||||
dao().insert(clubUsers);
|
||||
|
||||
for (ClubUser clubUser : clubUsers) {
|
||||
ClubPayRecord payRecord = dao().fetch(
|
||||
ClubPayRecord.class,
|
||||
Cnd.where(ClubPayRecord::getClubId, "=", clubUser.getClubId())
|
||||
.and(ClubPayRecord::getUserId, "=", clubUser.getUserId())
|
||||
.and(ClubPayRecord::getYear, "=", DateUtil.thisYear())
|
||||
);
|
||||
if (payRecord == null) {
|
||||
ClubPayRecord record = new ClubPayRecord();
|
||||
record.setClubId(clubUser.getClubId());
|
||||
record.setUserId(clubUser.getUserId());
|
||||
record.setYear(DateUtil.thisYear());
|
||||
record.setPayed(false);
|
||||
|
||||
JSONObject log = new JSONObject();
|
||||
log.set("operatorUserId", SecurityUtil.getUserId());
|
||||
log.set("operatorUserName", SecurityUtil.getUserUsername());
|
||||
log.set("operatorTime", DateUtil.now());
|
||||
log.set("operatorType", "社团创建");
|
||||
log.set("oldValue", null);
|
||||
log.set("newValue", false);
|
||||
|
||||
record.setOperateLogs(List.of(log));
|
||||
dao().insert(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sysClub;
|
||||
}
|
||||
|
||||
+1
@@ -146,6 +146,7 @@ public class OutlayManageClubQueryServiceImpl extends BaseServiceImpl implements
|
||||
us.unitName,
|
||||
us.username,
|
||||
us.loginname,
|
||||
us.retireDate,
|
||||
club.clubName
|
||||
FROM
|
||||
`outlay_club_user_back_history` clubUser
|
||||
|
||||
Reference in New Issue
Block a user