diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java index f43681a..8aedd09 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolenceApplyController.java @@ -93,6 +93,7 @@ public class CondolenceApplyController { Dict args = Dict.create(); args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode()); args.set(FlowConst.FORM_DATA, condolence); + args.set("userId", condolence.getCertifierUserId()); ProcessInstance instance = flowEngine.startProcessInstanceByKey("ZGWW", condolence.getId(), SecurityUtil.getUserId(), args); // 自动完成第一个申请任务 diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolencesCertifierUserSignController.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolencesCertifierUserSignController.java new file mode 100644 index 0000000..c5c8883 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/controller/CondolencesCertifierUserSignController.java @@ -0,0 +1,131 @@ +package com.budwk.app.zhgh.staffbenefit.condolence.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.condolence.model.Condolence; +import com.budwk.app.zhgh.staffbenefit.condolence.service.CondolenceService; +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.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; + +/** + * @author zhf + * @date 2026/1/9 09:50 + * @description 证明人签字 + */ +@IocBean +@At("/platform/condolence/certifierUserSign") +@Ok("json:full") +@Api("证明人签字") +@Slf4j +public class CondolencesCertifierUserSignController { + + + @Inject + private CondolenceService condolenceService; + + @At("/") + @Ok("beetl:/platform/zhgh/staffbenefit/condolence/certifierUserSign/index.html") + @SaCheckPermission("condolence.certifierUserSign") + public void index() { + } + @At("/h5") + @Ok("beetl:/platform/zhghh5/staffbenefit/condolence/certifierUserSign/index.html") + @SaCheckPermission("h5.condolence.certifierUserSign") + public void h5Index() { + } + + + @At + @ApiOperation("分页查询") + @SaCheckPermission(value = {"condolence.certifierUserSign", "h5.condolence.certifierUserSign"}, mode = SaMode.OR) + public Result pageData(PageForm pageForm, + boolean approval, + Integer year, + String unionId, + String unitId, + String type) { + Sql sql = Sqls.create(""" + SELECT + info.*, + 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 condolence info ON info.id = ins.businessNo + LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id + LEFT JOIN condolence_type type ON info.type = type.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", "=", "ea28dba5-c4c4-425a-bd39-d1c37943c28e"); + 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.createTime)", "=", year); + cnd.andEX("info.applyUnionId", "=", unionId); + cnd.andEX("info.applyUnitId", "=", unitId); + cnd.andEX("info.type", "=", type); + + + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + SqlExpressionGroup seg = new SqlExpressionGroup(); + seg.or(Condolence::getHelpUserName, "like", "%" + pageForm.getSearchKeyword() + "%"); + seg.or(Condolence::getHelpLoginName, "like", "%" + pageForm.getSearchKeyword() + "%"); + cnd.and(seg); + } + if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { + cnd.desc("info.createTime"); + } else { + cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); + } + cnd.groupBy("info.id"); + cnd.desc("info.createdAt"); + sql.setCondition(cnd); + Pagination pagination = condolenceService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + return Result.success(pagination); + } + +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/certifierUserSign/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/certifierUserSign/index.html new file mode 100644 index 0000000..c830fd6 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/certifierUserSign/index.html @@ -0,0 +1,221 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已签字 + 未签字 + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/certifierUserSign/index.html b/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/certifierUserSign/index.html new file mode 100644 index 0000000..a5ba471 --- /dev/null +++ b/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/certifierUserSign/index.html @@ -0,0 +1,191 @@ + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + +
+ 退回到发起人 + 同意 +
+
+
+
+
+ +
+ + + +