commit
This commit is contained in:
+7
-1
@@ -50,12 +50,18 @@ public class TrainSignUpActivityApplyController {
|
||||
@Inject
|
||||
private TrainSignUpActivityStatisticsService statisticsService;
|
||||
|
||||
@At("")
|
||||
@At("/")
|
||||
@SaCheckPermission("trainSingUp.manage.apply")
|
||||
@Ok("beetl:/platform/zhgh/activity/trainSingUp/apply/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.trainSingUp.manage.apply")
|
||||
@Ok("beetl:/platform/zhghh5/activity/trainSingUp/apply/index.html")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("活动查询")
|
||||
@SaCheckPermission("trainSingUp.manage.apply")
|
||||
|
||||
+2
-2
@@ -169,7 +169,7 @@ public class ClubInfoManageController {
|
||||
@SaCheckPermission("club.infoManage.manage")
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "修改身份")
|
||||
public Result updateRoleCode(@Param("id") String id, @Valid String[] roleCodes, @Valid String clubId) {
|
||||
List<String> roleCodeList = Arrays.asList(roleCodes);
|
||||
List<String> roleCodeList = Arrays.asList(roleCodes);
|
||||
//查询社团是否存在会长或者秘书长
|
||||
if(Arrays.asList(roleCodes).contains(RoleConstant.CLUB_PRESIDENT.name())) {
|
||||
int count = dao.count(ClubUser.class, Cnd.where("clubId", "=", clubId)
|
||||
@@ -268,7 +268,7 @@ public class ClubInfoManageController {
|
||||
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where("clubId", "=", clubId).and("userId", "=", user));
|
||||
if(clubUser != null) {
|
||||
List<String> roleCodeList = clubUser.getRoleCode();
|
||||
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name()).contains(roleCode)) {
|
||||
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()).contains(roleCode)) {
|
||||
roleCodeList.remove(RoleConstant.CLUB_MEMBER.name());
|
||||
}
|
||||
if(!roleCodeList.contains(roleCode)) {
|
||||
|
||||
+5
-1
@@ -117,7 +117,11 @@ public class ClubRefreshReportController {
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "提交换届报告")
|
||||
public Object submit(@Param("data") SysClubRefresh clubRefresh) {
|
||||
|
||||
List<SysClubRefresh> list = dao.query(SysClubRefresh.class, Cnd.NEW());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(clubRefresh.getId())) {
|
||||
cnd.and(SysClubRefresh::getId, "!=", clubRefresh.getId());
|
||||
}
|
||||
List<SysClubRefresh> list = dao.query(SysClubRefresh.class, cnd);
|
||||
List<String> idList = list.stream().map(SysClubRefresh::getId).toList();
|
||||
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", idList).and(ProcessInstance::getState, "!=", ProcessInstanceStateEnum.FINISHED.getCode()));
|
||||
if (count > 0) {
|
||||
|
||||
+5
-1
@@ -118,7 +118,11 @@ public class ClubRuleUpdateController {
|
||||
@SLog(tag = "协会管理系统-信息管理", msg = "提交章程备案")
|
||||
public Object submit(@Param("data")SysClubRule clubRule) {
|
||||
|
||||
List<SysClubRule> list = dao.query(SysClubRule.class, Cnd.NEW());
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(clubRule.getId())) {
|
||||
cnd.and(SysClubRule::getId, "!=", clubRule.getId());
|
||||
}
|
||||
List<SysClubRule> list = dao.query(SysClubRule.class, cnd);
|
||||
List<String> idList = list.stream().map(SysClubRule::getId).toList();
|
||||
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", idList).and(ProcessInstance::getState, "!=", ProcessInstanceStateEnum.FINISHED.getCode()));
|
||||
if (count > 0) {
|
||||
|
||||
+4
-2
@@ -135,7 +135,8 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 5
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_OPERATOR"') THEN 5
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 6
|
||||
ELSE 99
|
||||
END
|
||||
""");
|
||||
@@ -270,7 +271,8 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 5
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_OPERATOR"') THEN 5
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 6
|
||||
ELSE 99
|
||||
END
|
||||
""");
|
||||
|
||||
@@ -73,7 +73,8 @@ public class SysClubUserServiceImpl extends BaseServiceImpl<ClubUser> implements
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 5
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_OPERATOR"') THEN 5
|
||||
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 6
|
||||
ELSE 99
|
||||
END
|
||||
""").setParam("clubId", clubId);
|
||||
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
package com.budwk.app.zhgh.dayofficework.meeting.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.service.MeetingInfoService;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName MeetingDelegationApproval
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/11 17:13
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "会议请假团长审核")
|
||||
@At("/platform/meeting/delegationApproval")
|
||||
public class MeetingDelegationApproval {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private MeetingInfoService infoService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("meeting.delegationApproval")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/meeting/delegationApproval/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.meeting.delegationApproval")
|
||||
@Ok("beetl:/platform/zhghh5/dayofficework/meeting/delegationApproval/index.html")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"meeting.delegationApproval", "h5.meeting.delegationApproval"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
mi.name as meetingName,
|
||||
mtp.periodName,
|
||||
mtp.startTime,
|
||||
mtp.endTime,
|
||||
mtp.canLeave,
|
||||
type.name as typeName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN meeting_time_period_user info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
LEFT JOIN meeting_time_period mtp ON mtp.id = info.timePeriodId
|
||||
LEFT JOin meeting_info mi ON mi.id = info.meetingId
|
||||
LEFT JOIN meeting_type type ON type.id = mi.typeId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("mi.name", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("mi.address", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("info.periodName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if(year != null) {
|
||||
long startTime = DateUtil.parse(year + "-01-01").getTime();
|
||||
long endTime = DateUtil.parse(year + "-12-31").getTime();
|
||||
cnd.and("ins.createdAt", ">=", startTime);
|
||||
cnd.and("ins.createdAt", "<=", endTime);
|
||||
}
|
||||
cnd.andEX("mi.type", "=", type);
|
||||
|
||||
cnd.and("t.taskName", "=", "e0ef2404-7468-480a-97b6-b918e0a9232f");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = infoService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
package com.budwk.app.zhgh.dayofficework.meeting.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
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.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.model.MeetingTimePeriodUser;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.service.MeetingInfoService;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.service.MeetingUserService;
|
||||
import com.budwk.app.zhgh.staffbenefit.condolence.model.Condolence;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
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.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
/**
|
||||
* @ClassName MeetingLeaveController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/11 16:20
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "我的请假")
|
||||
@At("/platform/meeting/leave")
|
||||
public class MeetingLeaveController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private MeetingInfoService infoService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private MeetingUserService meetingUserService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("meeting.leave")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/meeting/leave/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.meeting.leave")
|
||||
@Ok("beetl:/platform/zhghh5/dayofficework/meeting/leave/index.html")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"meeting.leave", "h5.meeting.leave"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
mi.name as meetingName,
|
||||
mtp.periodName,
|
||||
mtp.startTime,
|
||||
mtp.endTime,
|
||||
mtp.canLeave,
|
||||
type.name as typeName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask') AS startTaskId
|
||||
FROM
|
||||
meeting_time_period_user info
|
||||
LEFT JOIN meeting_time_period mtp ON mtp.id = info.timePeriodId
|
||||
LEFT JOin meeting_info mi ON mi.id = info.meetingId
|
||||
LEFT JOIN meeting_type type ON type.id = mi.typeId
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("mi.name", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("mi.address", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("info.periodName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.and("info.userId", "=", SecurityUtil.getUserId());
|
||||
cnd.and("ins.id", "is not", null);
|
||||
cnd.andEX("mi.type", "=", type);
|
||||
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
|
||||
if(year != null) {
|
||||
long startTime = DateUtil.parse(year + "-01-01").getTime();
|
||||
long endTime = DateUtil.parse(year + "-12-31").getTime();
|
||||
cnd.and("ins.createdAt", ">=", startTime);
|
||||
cnd.and("ins.createdAt", "<=", endTime);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.desc("t.createdAt");
|
||||
}
|
||||
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = infoService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"meeting.leave", "h5.meeting.leave"}, mode = SaMode.OR)
|
||||
@SLog(tag = "会务管理-我的请假-删除", msg = "删除请假")
|
||||
public Result delete(@Param("id") String id) {
|
||||
MeetingTimePeriodUser periodUser = dao.fetch(MeetingTimePeriodUser.class, id);
|
||||
periodUser.setJoinStatus(true);
|
||||
periodUser.setLeaveTime(null);
|
||||
periodUser.setLeaveReason(null);
|
||||
dao.update(periodUser);
|
||||
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
package com.budwk.app.zhgh.dayofficework.meeting.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
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.base.utils.PageUtil;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.model.MeetingInfo;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.model.MeetingTimePeriod;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.model.MeetingTimePeriodUser;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.model.MeetingType;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.service.MeetingInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
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 org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName MeetingMineController
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/11 14:53
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "我的会议")
|
||||
@At("/platform/meeting/mine")
|
||||
public class MeetingMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private MeetingInfoService infoService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("meeting.mine")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/meeting/mine/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.meeting.mine")
|
||||
@Ok("beetl:/platform/zhghh5/dayofficework/meeting/mine/index.html")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"meeting.mine", "h5.meeting.mine"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param("year") Integer year,
|
||||
@Param("type") String type) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
List<MeetingTimePeriodUser> periodUsers = dao.query(MeetingTimePeriodUser.class, Cnd.where(MeetingTimePeriodUser::getUserId, "=", SecurityUtil.getUserId()));
|
||||
List<String> idList = periodUsers.stream().map(MeetingTimePeriodUser::getMeetingId).toList();
|
||||
|
||||
cnd.and("id", "in", idList);
|
||||
cnd.andEX("typeId", "=", type);
|
||||
cnd.andEX("year(createTime)", "=", year);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("name", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("name", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.desc("createTime");
|
||||
}
|
||||
Pagination<MeetingInfo> pagination = infoService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), MeetingInfo.class, cnd);
|
||||
List<MeetingInfo> list = pagination.getList();
|
||||
|
||||
List<MeetingType> typeList = dao.query(MeetingType.class, null);
|
||||
Map<String, String> typeMap = typeList.stream().collect(Collectors.toMap(MeetingType::getId, MeetingType::getName));
|
||||
|
||||
for (MeetingInfo info : list) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
mtp.*,
|
||||
(select joinStatus from meeting_time_period_user where timePeriodId = mtp.id and userId = @userId) as joinStatus,
|
||||
(select signStatus from meeting_time_period_user where timePeriodId = mtp.id and userId = @userId) as signStatus
|
||||
from
|
||||
meeting_time_period mtp
|
||||
where meetingId = @meetingId
|
||||
order by startTime asc
|
||||
""");
|
||||
sql.setParam("userId", SecurityUtil.getUserId());
|
||||
sql.setParam("meetingId", info.getId());
|
||||
List<MeetingTimePeriod> listVO = infoService.listVO(sql, MeetingTimePeriod.class);
|
||||
info.setTimePeriods(listVO);
|
||||
info.setTypeName(typeMap.getOrDefault(info.getTypeId(), ""));
|
||||
}
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"meeting.mine", "h5.meeting.mine"}, mode = SaMode.OR)
|
||||
@ApiOperation("会议请假")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "会务管理-我的会议-请假", msg = "会议请假")
|
||||
public Result leave(@Valid String periodId, String leaveReason) {
|
||||
MeetingTimePeriodUser user = dao.fetch(
|
||||
MeetingTimePeriodUser.class,
|
||||
Cnd.where(MeetingTimePeriodUser::getTimePeriodId, "=", periodId)
|
||||
.and(MeetingTimePeriodUser::getUserId, "=", SecurityUtil.getUserId())
|
||||
);
|
||||
if(user.getSignStatus()) {
|
||||
return Result.error("您已签到,不能请假!");
|
||||
}
|
||||
if(!user.getJoinStatus()) {
|
||||
return Result.error("请勿重复申请!");
|
||||
}
|
||||
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", user.getId()).and(ProcessInstance::getState, "!=", ProcessInstanceStateEnum.FINISHED.getCode()));
|
||||
if (count > 0) {
|
||||
return Result.error("您有申请记录尚未完成,请核对!");
|
||||
}
|
||||
|
||||
MeetingInfo info = dao.fetch(MeetingInfo.class, user.getMeetingId());
|
||||
MeetingType meetingType = dao.fetch(MeetingType.class, info.getTypeId());
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
NutMap nutMap = Lang.obj2nutmap(user);
|
||||
nutMap.put("leaveReason", leaveReason);
|
||||
args.set(FlowConst.FORM_DATA, nutMap);
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey(meetingType.getDesignId(), user.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"meeting.mine", "h5.meeting.mine"}, mode = SaMode.OR)
|
||||
@ApiOperation("会议请假重新提交")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "会务管理-我的会议-重新提交", msg = "会议请假重新提交")
|
||||
public Result submitAgain(String id, String leaveReason, String taskId) {
|
||||
MeetingTimePeriodUser periodUser = dao.fetch(MeetingTimePeriodUser.class, id);
|
||||
|
||||
if(periodUser.getSignStatus()) {
|
||||
return Result.error("您已签到,不能请假!");
|
||||
}
|
||||
if(!periodUser.getJoinStatus()) {
|
||||
return Result.error("请勿重复申请!");
|
||||
}
|
||||
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
NutMap nutMap = Lang.obj2nutmap(periodUser);
|
||||
nutMap.put("leaveReason", leaveReason);
|
||||
dict.set(FlowConst.FORM_DATA, nutMap);
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"meeting.mine", "h5.meeting.mine"}, mode = SaMode.OR)
|
||||
@ApiOperation("会议签到")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "会务管理-我的会议-签到", msg = "会议签到")
|
||||
public Result sign(@Valid String periodId) {
|
||||
MeetingTimePeriodUser user = dao.fetch(
|
||||
MeetingTimePeriodUser.class,
|
||||
Cnd.where(MeetingTimePeriodUser::getTimePeriodId, "=", periodId)
|
||||
.and(MeetingTimePeriodUser::getUserId, "=", SecurityUtil.getUserId())
|
||||
);
|
||||
int count = dao.count(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", user.getId()));
|
||||
if(!user.getJoinStatus() || count > 0) {
|
||||
return Result.error("您已请假,不能签到!");
|
||||
}
|
||||
|
||||
user.setSignStatus(true);
|
||||
user.setSignTime(DateUtil.date());
|
||||
dao.update(user);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package com.budwk.app.zhgh.dayofficework.meeting.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.service.MeetingInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
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 java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName MeetingSchoolUnionApproval
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/11 17:29
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "会议请假团长审核")
|
||||
@At("/platform/meeting/schoolUnionApproval")
|
||||
public class MeetingSchoolUnionApproval {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private MeetingInfoService infoService;
|
||||
|
||||
@At("/")
|
||||
@SaCheckPermission("meeting.schoolUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/meeting/schoolUnionApproval/index.html")
|
||||
public void index() {}
|
||||
|
||||
@At("/h5")
|
||||
@SaCheckPermission("h5.meeting.schoolUnionApproval")
|
||||
@Ok("beetl:/platform/zhghh5/dayofficework/meeting/schoolUnionApproval/index.html")
|
||||
public void h5Index() {}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页查询")
|
||||
@SaCheckPermission(value = {"meeting.schoolUnionApproval", "h5.meeting.schoolUnionApproval"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "type") String type,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
mi.name as meetingName,
|
||||
mtp.periodName,
|
||||
mtp.startTime,
|
||||
mtp.endTime,
|
||||
mtp.canLeave,
|
||||
type.name as typeName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN meeting_time_period_user info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
LEFT JOIN meeting_time_period mtp ON mtp.id = info.timePeriodId
|
||||
LEFT JOin meeting_info mi ON mi.id = info.meetingId
|
||||
LEFT JOIN meeting_type type ON type.id = mi.typeId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("mi.name", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("mi.address", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
seg.or("info.periodName", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
if(year != null) {
|
||||
long startTime = DateUtil.parse(year + "-01-01").getTime();
|
||||
long endTime = DateUtil.parse(year + "-12-31").getTime();
|
||||
cnd.and("ins.createdAt", ">=", startTime);
|
||||
cnd.and("ins.createdAt", "<=", endTime);
|
||||
}
|
||||
cnd.andEX("mi.type", "=", type);
|
||||
|
||||
cnd.and("t.taskName", "=", "e28e9ab0-5546-4d97-9939-47df088f38ab");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
} else {
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pageVO = infoService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.budwk.app.zhgh.dayofficework.meeting.interceptor;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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.entity.ProcessInstance;
|
||||
import com.budwk.app.zhgh.club.model.ClubUser;
|
||||
import com.budwk.app.zhgh.club.model.ClubUserApply;
|
||||
import com.budwk.app.zhgh.dayofficework.meeting.model.MeetingTimePeriodUser;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
/**
|
||||
* @ClassName MeetingLeave
|
||||
* @Author JyuHsin
|
||||
* @Date 2025/9/11 16:06
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class MeetingLeaveInterceptor implements FlowInterceptor {
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
ProcessInstance processInstance = execution.getProcessInstance();
|
||||
MeetingTimePeriodUser periodUser = Json.fromJson(MeetingTimePeriodUser.class, formDataStr);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
|
||||
periodUser.setJoinStatus(false);
|
||||
periodUser.setLeaveTime(DateUtil.date(processInstance.getCreatedAt()));
|
||||
dao.update(periodUser);
|
||||
}
|
||||
}
|
||||
@@ -54,4 +54,7 @@ public class MeetingTimePeriod extends BaseModel {
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean canLeave;
|
||||
|
||||
private Boolean joinStatus;
|
||||
private Boolean signStatus;
|
||||
}
|
||||
|
||||
+6
-5
@@ -170,18 +170,19 @@ public class SiteApplyController {
|
||||
@At
|
||||
@ApiOperation("查询可以预约的日期")
|
||||
@SaCheckPermission(value = {"site.apply", "h5.site.apply"}, mode = SaMode.OR)
|
||||
public Result queryAllowDay(String siteId, String startTime, String endTime) {
|
||||
public Result queryAllowDay(String siteId) {
|
||||
if(StrUtil.isBlank(siteId)) {
|
||||
return Result.success(new ArrayList<>());
|
||||
}
|
||||
// 查询场地
|
||||
SiteInfo siteInfo = infoService.fetch(siteId);
|
||||
|
||||
// 转化对象
|
||||
DateTime startDate = DateUtil.parseDate(startTime);
|
||||
Date endDate = DateUtil.parseDate(endTime);
|
||||
DateTime startDate = DateUtil.date();
|
||||
Date endDate = DateUtil.offsetDay(startDate, siteInfo.getOpenDayNum() != null ? siteInfo.getOpenDayNum() : 7);
|
||||
// 获取区间内的每一天
|
||||
List<DateTime> fullDateList = DateUtil.rangeToList(startDate, endDate, DateField.DAY_OF_MONTH);
|
||||
|
||||
// 查询场地
|
||||
SiteInfo siteInfo = infoService.fetch(siteId);
|
||||
List<NutMap> openHours = siteInfo.getOpenHours();
|
||||
List<Integer> weekNumList = openHours.stream().map(o -> o.getInt("weekNum")).distinct().toList();
|
||||
|
||||
|
||||
@@ -115,4 +115,10 @@ public class SiteInfo extends BaseModel {
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default(value = "0")
|
||||
private Boolean filterHolidays;
|
||||
|
||||
@Column
|
||||
@Comment("开放天数段")
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Default("7")
|
||||
private Integer openDayNum;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user