diff --git a/src/main/java/com/budwk/app/zhgh/activity/trainSignUp/controller/manage/TrainSignUpActivityApplyController.java b/src/main/java/com/budwk/app/zhgh/activity/trainSignUp/controller/manage/TrainSignUpActivityApplyController.java index f17aff7f..4ed69623 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/trainSignUp/controller/manage/TrainSignUpActivityApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/trainSignUp/controller/manage/TrainSignUpActivityApplyController.java @@ -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") diff --git a/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubInfoManageController.java b/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubInfoManageController.java index 8353e0c2..edebb085 100644 --- a/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubInfoManageController.java +++ b/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubInfoManageController.java @@ -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 roleCodeList = Arrays.asList(roleCodes); + List 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 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)) { diff --git a/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubRefreshReportController.java b/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubRefreshReportController.java index 1512151b..cadce594 100644 --- a/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubRefreshReportController.java +++ b/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubRefreshReportController.java @@ -117,7 +117,11 @@ public class ClubRefreshReportController { @SLog(tag = "协会管理系统-信息管理", msg = "提交换届报告") public Object submit(@Param("data") SysClubRefresh clubRefresh) { - List list = dao.query(SysClubRefresh.class, Cnd.NEW()); + Cnd cnd = Cnd.NEW(); + if(StrUtil.isNotBlank(clubRefresh.getId())) { + cnd.and(SysClubRefresh::getId, "!=", clubRefresh.getId()); + } + List list = dao.query(SysClubRefresh.class, cnd); List 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) { diff --git a/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubRuleUpdateController.java b/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubRuleUpdateController.java index 22fb1360..c888e9b2 100644 --- a/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubRuleUpdateController.java +++ b/src/main/java/com/budwk/app/zhgh/club/controller/infoManage/ClubRuleUpdateController.java @@ -118,7 +118,11 @@ public class ClubRuleUpdateController { @SLog(tag = "协会管理系统-信息管理", msg = "提交章程备案") public Object submit(@Param("data")SysClubRule clubRule) { - List list = dao.query(SysClubRule.class, Cnd.NEW()); + Cnd cnd = Cnd.NEW(); + if(StrUtil.isNotBlank(clubRule.getId())) { + cnd.and(SysClubRule::getId, "!=", clubRule.getId()); + } + List list = dao.query(SysClubRule.class, cnd); List 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) { diff --git a/src/main/java/com/budwk/app/zhgh/club/service/impl/SysClubInfoManageServiceImpl.java b/src/main/java/com/budwk/app/zhgh/club/service/impl/SysClubInfoManageServiceImpl.java index 8c915ad1..59d9328e 100644 --- a/src/main/java/com/budwk/app/zhgh/club/service/impl/SysClubInfoManageServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/club/service/impl/SysClubInfoManageServiceImpl.java @@ -135,7 +135,8 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl 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); diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingDelegationApproval.java b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingDelegationApproval.java new file mode 100644 index 00000000..294d4f4f --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingDelegationApproval.java @@ -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 pageVO = infoService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pageVO); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingLeaveController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingLeaveController.java new file mode 100644 index 00000000..ceea749c --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingLeaveController.java @@ -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 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(); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingMineController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingMineController.java new file mode 100644 index 00000000..f50a9312 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingMineController.java @@ -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 periodUsers = dao.query(MeetingTimePeriodUser.class, Cnd.where(MeetingTimePeriodUser::getUserId, "=", SecurityUtil.getUserId())); + List 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 pagination = infoService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), MeetingInfo.class, cnd); + List list = pagination.getList(); + + List typeList = dao.query(MeetingType.class, null); + Map 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 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 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(); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingSchoolUnionApproval.java b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingSchoolUnionApproval.java new file mode 100644 index 00000000..9473a4d8 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/controller/MeetingSchoolUnionApproval.java @@ -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 pageVO = infoService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pageVO); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/interceptor/MeetingLeaveInterceptor.java b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/interceptor/MeetingLeaveInterceptor.java new file mode 100644 index 00000000..f2f1a68e --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/interceptor/MeetingLeaveInterceptor.java @@ -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); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/model/MeetingTimePeriod.java b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/model/MeetingTimePeriod.java index 2e48dd5e..992b1d4f 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/model/MeetingTimePeriod.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/meeting/model/MeetingTimePeriod.java @@ -54,4 +54,7 @@ public class MeetingTimePeriod extends BaseModel { @ColDefine(type = ColType.BOOLEAN) @Default("0") private Boolean canLeave; + + private Boolean joinStatus; + private Boolean signStatus; } diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/site/controller/SiteApplyController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/site/controller/SiteApplyController.java index ddebdc18..87765b59 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/site/controller/SiteApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/site/controller/SiteApplyController.java @@ -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 fullDateList = DateUtil.rangeToList(startDate, endDate, DateField.DAY_OF_MONTH); - // 查询场地 - SiteInfo siteInfo = infoService.fetch(siteId); List openHours = siteInfo.getOpenHours(); List weekNumList = openHours.stream().map(o -> o.getInt("weekNum")).distinct().toList(); diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/site/model/SiteInfo.java b/src/main/java/com/budwk/app/zhgh/dayofficework/site/model/SiteInfo.java index 4e8ce4b4..17ea9d9a 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/site/model/SiteInfo.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/site/model/SiteInfo.java @@ -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; } diff --git a/src/main/resources/static/assets/platform/js/util/commonUtil.js b/src/main/resources/static/assets/platform/js/util/commonUtil.js index 70ccd0f8..b1491434 100644 --- a/src/main/resources/static/assets/platform/js/util/commonUtil.js +++ b/src/main/resources/static/assets/platform/js/util/commonUtil.js @@ -19,7 +19,7 @@ const commonUtil = { } if (response.data && response.data.code !== 0 && response.data.code !== 99) { if (isMobile) { - vant.Toast(response.data.msg) + vant.Toast.fail(response.data.msg) } else { ELEMENT.Message.error(response.data.msg) } diff --git a/src/main/resources/static/components/plugins/h5/TableList.vue b/src/main/resources/static/components/plugins/h5/TableList.vue index eca9b7cd..b07e5ca6 100644 --- a/src/main/resources/static/components/plugins/h5/TableList.vue +++ b/src/main/resources/static/components/plugins/h5/TableList.vue @@ -1,253 +1,278 @@ diff --git a/src/main/resources/views/platform/zhgh/activity/trainSingUp/apply/index.html b/src/main/resources/views/platform/zhgh/activity/trainSingUp/apply/index.html index 52aa6112..0efa35e8 100644 --- a/src/main/resources/views/platform/zhgh/activity/trainSingUp/apply/index.html +++ b/src/main/resources/views/platform/zhgh/activity/trainSingUp/apply/index.html @@ -9,27 +9,25 @@ layout("/layouts/platform.html"){
- - - - - - - - 全部 - 报名中 - 已结束 - - - - + + + + + + + 全部 + 报名中 + 已结束 + + + diff --git a/src/main/resources/views/platform/zhgh/activity/trainSingUp/apply/info.js b/src/main/resources/views/platform/zhgh/activity/trainSingUp/apply/info.js index e7d5eec0..d5f075bc 100644 --- a/src/main/resources/views/platform/zhgh/activity/trainSingUp/apply/info.js +++ b/src/main/resources/views/platform/zhgh/activity/trainSingUp/apply/info.js @@ -257,43 +257,43 @@ const info = { }, style: /*language=CSS*/ ` - .glow-box { + ::v-deep .glow-box { min-height: calc(100vh - 56px - 40px - 50px - 80px); max-height: calc(100vh - 56px - 40px - 50px - 80px); overflow-y: auto; background: #F0F2F5; } - img { + ::v-deep img { width: 100%; height: 180px; } - .title { + ::v-deep .title { background: white; height: 20px; } - .query-row { + ::v-deep .query-row { display: flex; align-items: center; padding: 6px 0; } - .query-row:not(:last-child) { + ::v-deep .query-row:not(:last-child) { border-bottom: 1px dashed rgb(230, 230, 230); } - .query-row > .query-title { + ::v-deep .query-row > .query-title { width: 100px; max-width: 100px; min-width: 100px; overflow: hidden; } - .query-row > .query-content { + ::v-deep .query-row > .query-content { min-width: 200px; overflow: hidden; } - .query-row > .query-content > .el-tag { + ::v-deep .query-row > .query-content > .el-tag { margin-bottom: 5px; margin-top: 5px; } - @media screen and (max-width: 992px) { + ::v-deep @media screen and (max-width: 992px) { .query-row:nth-child(4) .query-content .el-col:not(:last-child) { margin-bottom: 5px; } diff --git a/src/main/resources/views/platform/zhgh/dayofficework/meeting/common/leaveInfo.js b/src/main/resources/views/platform/zhgh/dayofficework/meeting/common/leaveInfo.js new file mode 100644 index 00000000..d66d5ba7 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/meeting/common/leaveInfo.js @@ -0,0 +1,96 @@ +const leaveInfo = { + template: /*language=HTML*/ ` +
+
+ 申请信息 + 点击查看流程图 +
+ + {{ viewData.userName }} + {{ viewData.loginName }} + {{ viewData.unitName }} + {{ viewData.unionName }} + {{ viewData.periodName }} + {{ viewData.startTime }} + {{ viewData.endTime }} + {{ viewData.leaveReason }} + {{ viewData.meetingName }} + {{ viewData.typeName }} + + + + + +
+ `, + store, + dicts: ["PROCESS_TASK_SUBMIT_TYPE"], + data() { + return { + visible: false, + viewData: {}, + doneTasks: [], + row: null + } + }, + methods: { + onOpen(row) { + row.leaveReason = JSON.parse(row.instanceVariable).f_data.leaveReason || '' + this.row = row + this.visible = true + this.viewData = clone(row) + this.getDoneTasks() + }, + // 获取已办任务审批记录 + getDoneTasks() { + this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => { + if (res.code === 0) { + this.doneTasks = res.data + } + }) + }, + // 查看流程图 + openChart(){ + this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId, this.row.instanceId) + } + }, + style: /*language=CSS*/ ` + .el-descriptions-item__label { + width: 200px; + min-width: 200px; + max-width: 200px; + } + .el-tabs__header { + margin: 0; + } + ` +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/meeting/delegationApproval/index.html b/src/main/resources/views/platform/zhgh/dayofficework/meeting/delegationApproval/index.html new file mode 100644 index 00000000..fae4d904 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/meeting/delegationApproval/index.html @@ -0,0 +1,199 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + 已审核 + 未审核 + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/meeting/leave/index.html b/src/main/resources/views/platform/zhgh/dayofficework/meeting/leave/index.html new file mode 100644 index 00000000..833e0c69 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/meeting/leave/index.html @@ -0,0 +1,183 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/meeting/mine/index.html b/src/main/resources/views/platform/zhgh/dayofficework/meeting/mine/index.html new file mode 100644 index 00000000..3d6251dd --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/meeting/mine/index.html @@ -0,0 +1,205 @@ + + + + +
+ + + + + +
+ + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/meeting/online/index.html b/src/main/resources/views/platform/zhgh/dayofficework/meeting/online/index.html index 85267b71..583bfb73 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/meeting/online/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/meeting/online/index.html @@ -106,10 +106,10 @@ layout("/layouts/platform.html"){ -