Merge remote-tracking branch 'origin/main'
This commit is contained in:
+170
@@ -0,0 +1,170 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpApplyController
|
||||
* @Date 2025/7/31 8:41
|
||||
* @注释 困难补助申请
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助申请")
|
||||
@At("/platform/difficultHelp/apply")
|
||||
public class DifficultHelpApplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.apply")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/apply/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("difficultHelp.apply")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/apply/form.html")
|
||||
public void form() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("困难补助申请,我的申请列表")
|
||||
@SaCheckPermission("difficultHelp.apply")
|
||||
public Result pageData(DifficultHelpPageParam pageParam) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.proxyUserName,
|
||||
info.proxyLoginName,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.subsidyStandards,
|
||||
info.applyTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
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
|
||||
difficult_help_info 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();
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
if (StrUtil.isAllBlank(pageParam.getPageOrderName(), pageParam.getPageOrderBy())) {
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy()));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("获取受助人")
|
||||
@SaCheckPermission("difficultHelp.apply")
|
||||
public Result queryRecipients(String key){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
birthday,
|
||||
mobile,
|
||||
sex,
|
||||
unitName,
|
||||
unionName,
|
||||
unionId,
|
||||
unitId
|
||||
FROM
|
||||
`vw_user`
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name())) {
|
||||
cnd.and("unionid", "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
cnd.and("id", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(key)) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("username", key);
|
||||
group.orLike("loginname", key);
|
||||
cnd.and(group);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = difficultHelpCommonService.listPageMap(1, 10, sql);
|
||||
return Result.success().addData(pagination.getList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("困难帮扶删除申请")
|
||||
@SLog(tag = "困难帮扶申请", msg = "删除困难帮扶申请")
|
||||
public Result onDelete(@Valid String id){
|
||||
dao.clear(DifficultHelpInfo.class, Cnd.where("id", "=", id));
|
||||
// 流程相关操作
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
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.difficulthelp.service.DifficultHelpCommonService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpBranchUnionApprovalController
|
||||
* @Date 2025/7/31 11:47
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助分工会审核")
|
||||
@At("/platform/difficultHelp/branchUnionApproval")
|
||||
public class DifficultHelpBranchUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.branchUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("difficultHelp.branchUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/branchunionapproval/form.html")
|
||||
public void form() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("困难补助分工会审核列表")
|
||||
@SaCheckPermission("difficultHelp.branchUnionApproval")
|
||||
public Result pageData(DifficultHelpPageParam pageParam) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.proxyUserName,
|
||||
info.proxyLoginName,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.subsidyStandards,
|
||||
info.applyTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
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 difficult_help_info 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();
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
|
||||
cnd.and("t.taskName", "=", "9d11798e-a0e4-4ff5-939b-e6c5519e0eb6");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (pageParam.getAudit()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageParam.getPageOrderName(), pageParam.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpReadingController
|
||||
* @Date 2025/7/31 15:07
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助汇总阅览")
|
||||
@At("/platform/difficultHelp/reading")
|
||||
public class DifficultHelpReadingController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.reading")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/reading/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("困难补助汇总阅览列表")
|
||||
@SaCheckPermission("difficultHelp.reading")
|
||||
public Result pageData(DifficultHelpPageParam pageParam) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.proxyUserName,
|
||||
info.proxyLoginName,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.subsidyStandards,
|
||||
info.applyTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariale,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable
|
||||
FROM
|
||||
difficult_help_info info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
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.difficulthelp.service.DifficultHelpCommonService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.vo.DifficultHelpPageParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpSchoolUnionApprovalController
|
||||
* @Date 2025/7/31 11:47
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助校工会审核")
|
||||
@At("/platform/difficultHelp/schoolUnionApproval")
|
||||
public class DifficultHelpSchoolUnionApprovalController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.schoolUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("difficultHelp.schoolUnionApproval")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/schoolunionapproval/form.html")
|
||||
public void form() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("困难补助校工会审核列表")
|
||||
@SaCheckPermission("difficultHelp.schoolUnionApproval")
|
||||
public Result pageData(DifficultHelpPageParam pageParam) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.proxyUserName,
|
||||
info.proxyLoginName,
|
||||
info.userName,
|
||||
info.loginName,
|
||||
info.unitName,
|
||||
info.unionName,
|
||||
info.subsidyStandards,
|
||||
info.applyTime,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
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 difficult_help_info 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();
|
||||
pageParam.buildSearch(cnd, "info.");
|
||||
|
||||
cnd.and("t.taskName", "=", "715ece82-4ae3-433c-ad18-ed875f45d1e3");
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (pageParam.getAudit()) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.WITHDRAW.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isAllBlank(pageParam.getPageOrderName(), pageParam.getPageOrderBy())) {
|
||||
cnd.desc("t.createdAt");
|
||||
cnd.desc("info.applyTime");
|
||||
} else {
|
||||
cnd.orderBy("info." + pageParam.getPageOrderName(), PageUtil.getOrder(pageParam.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
}
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Dao;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpViewController
|
||||
* @Date 2025/7/31 11:50
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
@ApiOperation("困难补助查看")
|
||||
@At("/platform/difficultHelp/view")
|
||||
public class DifficultHelpViewController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private DifficultHelpCommonService difficultHelpCommonService;
|
||||
|
||||
@At("")
|
||||
@SaCheckPermission("difficultHelp.apply")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/difficulthelp/view/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiModelProperty("获取困难补助申请")
|
||||
@SaCheckPermission("difficultHelp.apply")
|
||||
public Result findOne(String id) {
|
||||
DifficultHelpInfo helpInfo = dao.fetch(DifficultHelpInfo.class, id);
|
||||
return Result.success().addData(helpInfo);
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.interceptor;
|
||||
|
||||
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.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpSaveInterceptor
|
||||
* @Date 2025/7/31 11:04
|
||||
* @注释
|
||||
*/
|
||||
public class DifficultHelpSaveInterceptor implements FlowInterceptor {
|
||||
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
System.out.println("difficult help apply ..................");
|
||||
String formDataStr = execution.getArgs().getStr(FlowConst.FORM_DATA);
|
||||
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
DifficultHelpInfo article = Json.fromJson(DifficultHelpInfo.class, formDataStr);
|
||||
article.setApplyTime(new Date());
|
||||
dao.insertOrUpdate(article);
|
||||
|
||||
execution.getArgs().set(FlowConst.FORM_DATA, Json.toJson(article));
|
||||
|
||||
int instanceId = execution.getArgs().getInt(FlowConst.PROCESS_INSTANCE_ID_KEY);
|
||||
dao.update(ProcessInstance.class, Chain.make("businessNo", article.getId()), Cnd.where(ProcessInstance::getId, "=", instanceId));
|
||||
}
|
||||
}
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.models;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficulHelpInfo
|
||||
* @Date 2025/7/30 17:33
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DifficultHelpInfo extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("申请时间")
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
private Date applyTime;
|
||||
|
||||
@Column
|
||||
@Comment("申请模式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String mode;
|
||||
|
||||
@Column
|
||||
@Comment("填写人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String proxyUserId;
|
||||
|
||||
@Column
|
||||
@Comment("填写人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String proxyUserName;
|
||||
|
||||
@Column
|
||||
@Comment("填写人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String proxyLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("申请人id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("申请人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("申请人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String loginName;
|
||||
|
||||
@Column
|
||||
@Comment("性别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String sex;
|
||||
|
||||
@Column
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("单位名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("分工会id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String unionName;
|
||||
|
||||
@Column
|
||||
@Comment("月收入")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String monthlyIncome;
|
||||
|
||||
@Column
|
||||
@Comment("出生日期")
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date birthday;
|
||||
|
||||
@Column
|
||||
@Comment("联系电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("身份证号码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String idCard;
|
||||
|
||||
@Column
|
||||
@Comment("职务职称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String officialCapacity;
|
||||
|
||||
@Column
|
||||
@Comment("银行卡号(华夏银行工资卡卡号)")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String bankCardNum;
|
||||
|
||||
@Column
|
||||
@Comment("家庭住址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String homeAddress;
|
||||
|
||||
@Column
|
||||
@Comment("补助标准")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String subsidyStandards;
|
||||
|
||||
@Column
|
||||
@Comment("家庭成员")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> familyList;
|
||||
|
||||
@Column
|
||||
@Comment("申请理由")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String reason;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String remarks;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@Column
|
||||
@Comment("申请人签字")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String sign;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpCommonService
|
||||
* @Date 2025/7/31 9:16
|
||||
* @注释
|
||||
*/
|
||||
public interface DifficultHelpCommonService extends BaseService<DifficultHelpInfo> {
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.service.impl;
|
||||
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.service.DifficultHelpCommonService;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpCommonServiceImpl
|
||||
* @Date 2025/7/31 9:16
|
||||
* @注释
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class DifficultHelpCommonServiceImpl extends BaseServiceImpl<DifficultHelpInfo> implements DifficultHelpCommonService {
|
||||
|
||||
public DifficultHelpCommonServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.difficulthelp.vo;
|
||||
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.staffbenefit.difficulthelp.models.DifficultHelpInfo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
* @name:DifficultHelpPageParam
|
||||
* @Date 2025/7/31 9:50
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DifficultHelpPageParam extends PageForm<DifficultHelpInfo> {
|
||||
|
||||
private String year;
|
||||
|
||||
private String unionId;
|
||||
|
||||
private String unitId;
|
||||
|
||||
private List<String> dateRange;
|
||||
|
||||
public void buildSearch(Cnd cnd, String prefix){
|
||||
if (cnd == null) {
|
||||
cnd = Cnd.NEW();
|
||||
}
|
||||
|
||||
cnd.andEX("YEAR(" + prefix + "applyTime)", "=", this.getYear());
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if (AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_OPERATOR.name())) {
|
||||
cnd.and(prefix + "unionid", "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
cnd.and(prefix + "userId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
} else {
|
||||
cnd.andEX(prefix + "unionId", "=", this.getUnionId());
|
||||
}
|
||||
|
||||
cnd.andEX(prefix + "unitId", "=", this.getUnitId());
|
||||
|
||||
if (Lang.isNotEmpty(this.getDateRange())) {
|
||||
cnd.andEX("DATE(" + prefix + "applyTime)", ">=", this.getDateRange().get(0));
|
||||
cnd.andEX("DATE(" + prefix + "applyTime)", "<=", this.getDateRange().get(1));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user