diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveApplyController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveApplyController.java new file mode 100644 index 00000000..61364447 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveApplyController.java @@ -0,0 +1,120 @@ +package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller; + +import cn.dev33.satoken.annotation.SaCheckLogin; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.StrUtil; +import com.budwk.app.base.annotation.SLog; +import com.budwk.app.base.result.Result; +import com.budwk.app.base.service.BaseService; +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.ProcessSubmitTypeEnum; +import com.budwk.app.flow.service.FlowCommonService; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.staffbenefit.maternityLeave.models.MaternityLeave; +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.Dao; +import org.nutz.ioc.aop.Aop; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; + +import java.util.Date; +import java.util.List; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/9/15 17:52 + */ + +@IocBean +@At("/platform/maternityLeave/apply") +@Api("生育休假申请") +@Ok("json:full") +@Slf4j +public class MaternityLeaveApplyController { + + @Inject + private Dao dao; + @Inject + private BaseService baseService; + @Inject + private FlowEngine flowEngine; + @Inject + private FlowCommonService flowCommonService; + + @At("/index") + @Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/apply/index.html") + @SaCheckPermission("maternityLeave.apply") + public void index() { + } + @At("/h5") + @Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/apply/index.html") + @SaCheckPermission("h5.maternityLeave.apply") + public void h5Index() { + } + + @At + @ApiOperation("保存申请") + @SaCheckPermission(value = {"maternityLeave.apply", "h5.maternityLeave.apply"}, mode = SaMode.OR) + @SLog(tag = "生育休假-休假申请", msg = "保存休假申请") + public Result save(@Param("data") MaternityLeave maternityLeave) { + if (StrUtil.isBlank(maternityLeave.getId())) maternityLeave.setApplyTime(new Date()); + dao.insertOrUpdate(maternityLeave); + return Result.success(); + } + + @At + @ApiOperation("提交申请") + @SaCheckPermission(value = {"maternityLeave.apply", "h5.maternityLeave.apply"}, mode = SaMode.OR) + public Result submit(@Param("data") MaternityLeave maternityLeave) { + if (StrUtil.isBlank(maternityLeave.getId())) maternityLeave.setApplyTime(new Date()); + + dao.insertOrUpdate(maternityLeave); + // 开启流程实例 + Dict args = Dict.create(); + args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode()); + args.set(FlowConst.FORM_DATA, maternityLeave); + ProcessInstance instance = flowEngine.startProcessInstanceByKey("SYXJ", maternityLeave.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 + @ApiOperation("重新提交申请") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"maternityLeave.apply", "h5.maternityLeave.apply"}, mode = SaMode.OR) + public Result submitAgain(@Param("data") MaternityLeave maternityLeave, @Param("taskId") Long taskId) { + if (StrUtil.isBlank(maternityLeave.getId())) maternityLeave.setApplyTime(new Date()); + + dao.insertOrUpdate(maternityLeave); + + Dict dict = Dict.create(); + dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId); + dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode()); + flowCommonService.executeTask(dict); + return Result.success(); + } + + @At + @SaCheckLogin + public Result findOne(String id) { + return Result.success(baseService.dao().fetch(MaternityLeave.class, id)); + } +} + diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveCollectController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveCollectController.java new file mode 100644 index 00000000..032f4438 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveCollectController.java @@ -0,0 +1,179 @@ +package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller; + +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +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.CommonDownloadUtil; +import com.budwk.app.flow.engine.FlowEngine; +import com.budwk.app.sys.models.Sys_dict; +import com.budwk.app.zhgh.dayofficework.unionReimburse.vo.UnionReimburseCollectExcelVO; +import com.budwk.app.zhgh.staffbenefit.maternityLeave.service.MaternityLeaveService; +import com.budwk.app.zhgh.staffbenefit.maternityLeave.vo.MaternityLeaveCollectExcelVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.Workbook; +import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.dao.Cnd; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +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; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/9/16 16:38 + */ + +@IocBean +@At("/platform/maternityLeave/collect") +@Api("查询统计") +@Ok("json:full") +@Slf4j +public class MaternityLeaveCollectController { + + @Inject + private FlowEngine flowEngine; + @Inject + private MaternityLeaveService maternityLeaveService; + + @At("/index") + @Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/collect/index.html") + @SaCheckPermission("maternityLeave.collect") + public void index() { + } + @At("/h5") + @Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/collect/index.html") + @SaCheckPermission("h5.maternityLeave.collect") + public void h5Index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"unionReimburse.collect", "h5.unionReimburse.collect"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, + Integer year, + String unionId, + String unitId, + String userName, + String sex) { + Sql sql = Sqls.create(""" + SELECT + info.*, + 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' AND taskState in (10,20)) AS startTaskId + FROM + maternity_leave info + 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(); + // 年度查询条件 + cnd.andEX("year(info.applyTime)", "=", year); + + // 工会、单位名称查询条件 + cnd.andEX("info.unionId", "=", unionId); + cnd.andEX("info.unitId", "=", unitId); + + // 性别查询条件 + cnd.andEX("info.sex", "=", sex); + + // 姓名查询条件 + if (StrUtil.isNotBlank(userName)) { + cnd.and("info.userName", "like", "%" + userName + "%"); + } + + // 只查询流程实例状态为20的数据(已完成状态) + cnd.and("ins.state", "=", 20); + + cnd.desc("info.applyTime"); + sql.setCondition(cnd); + Pagination pagination = maternityLeaveService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + @At + @ApiOperation("删除") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"maternityLeave.mine", "h5.maternityLeave.mine"}, mode = SaMode.OR) + @SLog( tag = "删除工会报销", msg = "删除工会报销") + public Result delete(@Param("id") String id) { + maternityLeaveService.delete(id); + flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id); + return Result.success(); + } + + @At + @Ok("void") + @SaCheckPermission(value = {"maternityLeave.collect", "h5.maternityLeave.collect"}, mode = SaMode.OR) + @ApiOperation("导出生育休假表") + public void onExport(@Param(value = "year") Integer year, + @Param(value = "unionId") String unionId, + @Param(value = "unitId") String unitId, + @Param(value = "userName") String userName, + @Param(value = "sex") String sex, + HttpServletResponse response) { + //查询审核通过的数据 + Sql sql = Sqls.create(""" + SELECT + info.*, + ins.state instanceState + FROM + maternity_leave info + LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id + $condition + """); + Cnd cnd = Cnd.NEW(); + if (StrUtil.isNotBlank(userName)) { + cnd.and("info.userName", "like", "%" + userName + "%"); + } + cnd.andEX("year(info.applyTime)", "=", year); + cnd.andEX("info.unionId", "=", unionId); + cnd.andEX("info.unitId", "=", unitId); + cnd.andEX("info.sex", "=", sex); + cnd.and("ins.state", "=", 20); + + cnd.desc("info.applyTime"); + sql.setCondition(cnd); + List list = maternityLeaveService.listVO(sql, MaternityLeaveCollectExcelVO.class); + + ExportParams exportParams = new ExportParams(); + exportParams.setType(ExcelType.XSSF); + + Workbook workbook = ExcelExportUtil.exportExcel(exportParams, MaternityLeaveCollectExcelVO.class, list); + CommonDownloadUtil.download("生育休假表.xlsx", workbook, response); + } + +} + diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveMineController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveMineController.java new file mode 100644 index 00000000..fe70ad86 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveMineController.java @@ -0,0 +1,109 @@ +package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +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.flow.engine.FlowEngine; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.staffbenefit.maternityLeave.service.MaternityLeaveService; +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.Sqls; +import org.nutz.dao.sql.Sql; +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; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/9/15 17:52 + */ + +@IocBean +@At("/platform/maternityLeave/mine") +@Api("我的休假申请") +@Ok("json:full") +@Slf4j +public class MaternityLeaveMineController { + + @Inject + private FlowEngine flowEngine; + @Inject + private MaternityLeaveService maternityLeaveService; + + + @At("/index") + @Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/mine/index.html") + @SaCheckPermission("maternityLeave.mine") + public void index() { + } + @At("/h5") + @Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/mine/index.html") + @SaCheckPermission("h5.maternityLeave.mine") + public void h5Index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"maternityLeave.mine", "h5.maternityLeave.mine"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, @Param(value = "year") Integer year) { + Sql sql = Sqls.create(""" + SELECT + info.*, + 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 + maternity_leave info + 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(); + // 年度查询条件 + cnd.andEX("year(info.applyTime)", "=", year); + cnd.desc("info.applyTime"); + cnd.and("info.userId", "=", SecurityUtil.getUserId()); + sql.setCondition(cnd); + Pagination pagination = maternityLeaveService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + @At + @ApiOperation("删除") + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission(value = {"maternityLeave.mine", "h5.maternityLeave.mine"}, mode = SaMode.OR) + @SLog( tag = "删除工会报销", msg = "删除工会报销") + public Result delete(@Param("id") String id) { + maternityLeaveService.delete(id); + flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id); + return Result.success(); + } +} + diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveSchoolAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveSchoolAuditController.java new file mode 100644 index 00000000..c6ab7cd3 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveSchoolAuditController.java @@ -0,0 +1,129 @@ +package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +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.staffbenefit.maternityLeave.service.MaternityLeaveService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +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 java.util.List; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/9/15 17:54 + */ + +@IocBean +@At("/platform/maternityLeave/schoolAudit") +@Api("校工会审核") +@Ok("json:full") +@Slf4j +public class MaternityLeaveSchoolAuditController { + + @Inject + private MaternityLeaveService maternityLeaveService; + + @At("/index") + @Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/schoolAudit/index.html") + @SaCheckPermission("maternityLeave.schoolAudit") + public void index() { + } + @At("/h5") + @Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/schoolAudit/index.html") + @SaCheckPermission("h5.maternityLeave.schoolAudit") + public void h5Index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"maternityLeave.unionAudit", "h5.maternityLeave.unionAudit"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, + boolean approval, + Integer year, + String unionId, + String unitId, + String userName, + String sex) { + Sql sql = Sqls.create(""" + SELECT + info.*, + 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 maternity_leave 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 + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and("t.taskName", "=", "abf59f7b-dc50-4d5d-8e61-a442ce3f1e8a"); + cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); + + if (approval) { + cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); + } else { + cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); + } + // 年度查询条件 + cnd.andEX("year(info.applyTime)", "=", year); + + // 工会、单位名称查询条件 + cnd.andEX("info.unionId", "=", unionId); + cnd.andEX("info.unitId", "=", unitId); + + // 性别查询条件 + cnd.andEX("info.sex", "=", sex); + + // 姓名查询条件 + if (StrUtil.isNotBlank(userName)) { + cnd.and("info.userName", "like", "%" + userName + "%"); + } + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.desc("info.applyTime"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + cnd.groupBy("t.id"); + cnd.desc("t.createdAt"); + sql.setCondition(cnd); + Pagination pagination = maternityLeaveService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + + +} + diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveUnionAuditController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveUnionAuditController.java new file mode 100644 index 00000000..7e99c34e --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/controller/MaternityLeaveUnionAuditController.java @@ -0,0 +1,127 @@ +package com.budwk.app.zhgh.staffbenefit.maternityLeave.controller; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; +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.staffbenefit.maternityLeave.service.MaternityLeaveService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +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 java.util.List; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/9/15 17:53 + */ + +@IocBean +@At("/platform/maternityLeave/unionAudit") +@Api("分工会审核") +@Ok("json:full") +@Slf4j +public class MaternityLeaveUnionAuditController { + + @Inject + private MaternityLeaveService maternityLeaveService; + + @At("/index") + @Ok("beetl:/platform/zhgh/staffbenefit/maternityLeave/unionAudit/index.html") + @SaCheckPermission("maternityLeave.unionAudit") + public void index() { + } + @At("/h5") + @Ok("beetl:/platform/zhghh5/staffbenefit/maternityLeave/unionAudit/index.html") + @SaCheckPermission("h5.maternityLeave.unionAudit") + public void h5Index() { + } + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"maternityLeave.unionAudit", "h5.maternityLeave.unionAudit"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, + boolean approval, + Integer year, + String unionId, + String unitId, + String userName, + String sex) { + Sql sql = Sqls.create(""" + SELECT + info.*, + 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 maternity_leave 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 + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and("t.taskName", "=", "c28f910f-b888-4404-a6a8-9350cc501241"); + cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); + + if (approval) { + cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); + } else { + cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); + } + // 年度查询条件 + cnd.andEX("year(info.applyTime)", "=", year); + + // 工会、单位名称查询条件 + cnd.andEX("info.unionId", "=", unionId); + cnd.andEX("info.unitId", "=", unitId); + + // 性别查询条件 + cnd.andEX("info.sex", "=", sex); + + // 姓名查询条件 + if (StrUtil.isNotBlank(userName)) { + cnd.and("info.userName", "like", "%" + userName + "%"); + } + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.desc("info.applyTime"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + cnd.groupBy("t.id"); + cnd.desc("t.createdAt"); + sql.setCondition(cnd); + Pagination pagination = maternityLeaveService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } +} + diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/models/MaternityLeave.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/models/MaternityLeave.java new file mode 100644 index 00000000..78868b40 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/models/MaternityLeave.java @@ -0,0 +1,179 @@ +package com.budwk.app.zhgh.staffbenefit.maternityLeave.models; + +import com.budwk.app.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.entity.annotation.*; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/9/15 16:09 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@Table("maternity_leave") +@TableMeta("{'mysql-charset':'utf8mb4'}") +@Comment("生育休假") +public class MaternityLeave extends BaseModel implements Serializable { + + @Column + @Name + @Comment("id") + @ColDefine(type = ColType.VARCHAR, width = 32) + @Prev(els = {@EL("uuid()")}) + private String id; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 32) + @Comment("userId") + private String userId; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 30) + @Comment("姓名") + private String userName; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 30) + @Comment("性别") + private String sex; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 30) + @Comment("民族") + private String nation; + + @Column + @ColDefine(type = ColType.DATETIME, width = 30) + @Comment("出生年月") + private Date birthday; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 30) + @Comment("工号") + private String loginName; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 32) + @Comment("所在工会Id") + private String unionId; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("所在工会") + private String unionName; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 32) + @Comment("所在单位Id") + private String unitId; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("所在单位") + private String unitName; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 30) + @Comment("电话") + private String mobile; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 30) + @Comment("爱人姓名") + private String loverName; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 30) + @Comment("性别") + private String loverSex; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 30) + @Comment("民族") + private String loverNation; + + @Column + @ColDefine(type = ColType.DATETIME, width = 30) + @Comment("出生年月") + private Date loverBirthday; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("所在单位") + private String loverUnitName; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("陪护假") + private String withLeave; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("育儿假") + private String parentalLeave; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("产假") + private String maternityLeave; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("延长假") + private String extendLeave; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("多胞胎") + private String birthsLeave; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("难产假") + private String difficultLeave; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("寒假") + private String winterLeave; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("暑假") + private String summerLeave; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("假期天数") + private String leaveDays; + + @Column + @ColDefine(type = ColType.DATETIME, width = 30) + @Comment("子女出生日期") + private Date childrenBirthday; + + @Column + @ColDefine(type = ColType.DATETIME, width = 30) + @Comment("休假开始时间") + private Date startTime; + + @Column + @ColDefine(type = ColType.DATETIME, width = 30) + @Comment("休假结束时间") + private Date endTime; + + @Column + @ColDefine(type = ColType.VARCHAR,width = 50) + @Comment("填写时间") + private Date applyTime; + + +} + + diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/service/MaternityLeaveService.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/service/MaternityLeaveService.java new file mode 100644 index 00000000..eb29dca4 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/service/MaternityLeaveService.java @@ -0,0 +1,7 @@ +package com.budwk.app.zhgh.staffbenefit.maternityLeave.service; + +import com.budwk.app.base.service.BaseService; +import com.budwk.app.zhgh.staffbenefit.maternityLeave.models.MaternityLeave; + +public interface MaternityLeaveService extends BaseService { +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/service/impl/MaternityLeaveServiceImpl.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/service/impl/MaternityLeaveServiceImpl.java new file mode 100644 index 00000000..f186d859 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/service/impl/MaternityLeaveServiceImpl.java @@ -0,0 +1,22 @@ +package com.budwk.app.zhgh.staffbenefit.maternityLeave.service.impl; + +import com.budwk.app.base.service.impl.BaseServiceImpl; +import com.budwk.app.zhgh.staffbenefit.maternityLeave.models.MaternityLeave; +import com.budwk.app.zhgh.staffbenefit.maternityLeave.service.MaternityLeaveService; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Dao; +import org.nutz.ioc.loader.annotation.IocBean; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/9/15 17:55 + */ +@Slf4j +@IocBean(args = {"refer:dao"}) +public class MaternityLeaveServiceImpl extends BaseServiceImpl implements MaternityLeaveService { + public MaternityLeaveServiceImpl(Dao dao) { + super(dao); + } +} + diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/vo/MaternityLeaveCollectExcelVO.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/vo/MaternityLeaveCollectExcelVO.java new file mode 100644 index 00000000..8002cba5 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/maternityLeave/vo/MaternityLeaveCollectExcelVO.java @@ -0,0 +1,77 @@ +// MaternityLeaveCollectExcelVO.java +package com.budwk.app.zhgh.staffbenefit.maternityLeave.vo; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * @author : hongqiwei + * @description : + * @createDate : 2025/9/16 17:08 + */ + +//生育休假导出 +@Data +public class MaternityLeaveCollectExcelVO { + + @Excel(name = "办理时间", width = 20, format = "yyyy-MM-dd") + private Date applyTime; + + + @Excel(name = "姓名", width = 20) + private String userName; + + @Excel(name = "出生年月", width = 20, format = "yyyy-MM-dd") + private Date birthday; + + @Excel(name = "爱人姓名", width = 20) + private String loverName; + + @Excel(name = "出生年月", width = 20, format = "yyyy-MM-dd") + private Date loverBirthday; + + @Excel(name = "单位", width = 20) + private String unitName; + + @Excel(name = "陪护假", width = 20) + private String withLeave; + + @Excel(name = "育儿假", width = 20) + private String parentalLeave; + + @Excel(name = "产假", width = 20) + private String maternityLeave; + + @Excel(name = "延长假", width = 20) + private String extendLeave; + + @Excel(name = "多胞胎", width = 20) + private String birthsLeave; + + @Excel(name = "难产假", width = 20) + private String difficultLeave; + + @Excel(name = "寒假", width = 20) + private String winterLeave; + + @Excel(name = "暑假", width = 20) + private String summerLeave; + + @Excel(name = "合计天数", width = 20) + private String leaveDays; + + @Excel(name = "子女出生日期", width = 20, format = "yyyy-MM-dd") + private Date childrenBirthday; + + @Excel(name = "休假开始时间", width = 20, format = "yyyy-MM-dd") + private Date startTime; + + @Excel(name = "休假结束时间", width = 20, format = "yyyy-MM-dd") + private Date endTime; + + @Excel(name = "电话", width = 20) + private String mobile; + +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html index 60581bf8..ae1c4e35 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/unionReimburse/collect/index.html @@ -178,21 +178,6 @@ layout("/layouts/platform.html"){ onExport() { this.$downLoad('/platform/unionReimburse/collect/onExport', this.pageForm) }, - onRevoke(row) { - this.$confirm("您确定要撤回吗?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "info" - }).then(() => { - this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => { - if (res.code === 0) { - this.$message.success(res.msg) - this.doSearch() - } - }) - }) - } - }, created() { this.pageData() diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/apply/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/apply/index.html new file mode 100644 index 00000000..75586c61 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/apply/index.html @@ -0,0 +1,294 @@ + + +
+ + + + + + {{formData.userName}} + {{formData.sex}} + {{formData.nation}} + {{formData.birthday}} + {{formData.unitName}} + {{formData.mobile}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{formData.leaveDays}} + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 提交 + 提交1 + + +
+ + + + + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/collect/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/collect/index.html new file mode 100644 index 00000000..c480db55 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/collect/index.html @@ -0,0 +1,135 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + · + + + + + + + + + + + + +
+ + + + + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/common/info.js b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/common/info.js new file mode 100644 index 00000000..b0fed3c2 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/common/info.js @@ -0,0 +1,135 @@ +const maternityLeaveInfo = { + template: /*language=HTML*/ ` +
+
+ 申请信息 + 点击查看流程图 +
+ + + {{viewData.userName}} + {{viewData.sex}} + {{viewData.nation}} + {{viewData.birthday}} + {{viewData.unitName}} + {{viewData.mobile}} + + {{viewData.loverName}} + {{viewData.loverSex}} + {{viewData.loverNation}} + {{viewData.loverBirthday}} + {{viewData.loverUnitName}} + + + + + {{viewData.withLeave}} + + + {{viewData.parentalLeave}} + + + {{viewData.maternityLeave}} + + + {{viewData.extendLeave}} + + + {{viewData.birthsLeave}} + + + {{viewData.difficultLeave}} + + {{viewData.winterLeave}} + {{viewData.summerLeave}} + {{viewData.leaveDays}} + + + + + {{viewData.startTime}} + {{viewData.endTime}} + {{viewData.childrenBirthday}} + + + + + + +
+ `, + store, + dicts: ["PROCESS_TASK_SUBMIT_TYPE"], + data() { + return { + visible: false, + viewData: {}, + doneTasks: [], + row: null + } + }, + methods: { + // 打开 + onOpen(row) { + this.row = row + this.visible = true + this.getInfo() + this.getDoneTasks() + }, + + // 获取申请信息 + getInfo() { + this.$axios.post('/platform/maternityLeave/apply/findOne', {id: this.row.id}).then((res) => { + if (res.code === 0) { + this.viewData = res.data + } + }) + }, + + // 获取已办任务审批记录 + 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) + } + + } + + +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/mine/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/mine/index.html new file mode 100644 index 00000000..c4ff88aa --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/mine/index.html @@ -0,0 +1,119 @@ + +
+ + + + + + + + + + + + + + + + + + + · + + + + + + + + + + + + +
+ + + + + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/schoolAudit/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/schoolAudit/index.html new file mode 100644 index 00000000..52c95cfa --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/schoolAudit/index.html @@ -0,0 +1,192 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已审核 + 未审核 + + + + + + + + + + + · + + + + + + + + + + + + +
+ + + + + + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/unionAudit/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/unionAudit/index.html new file mode 100644 index 00000000..a799f015 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/unionAudit/index.html @@ -0,0 +1,191 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已审核 + 未审核 + + + + + + + + + + + · + + + + + + + + + + + + +
+ + + + + +