Merge remote-tracking branch 'origin/main'

This commit is contained in:
@jyuhsin
2025-09-29 17:36:28 +08:00
62 changed files with 2212 additions and 454 deletions
@@ -17,6 +17,7 @@ import com.budwk.app.flow.entity.ProcessDefine;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessEventTypeEnum;
import com.budwk.app.flow.enums.ProcessTaskPerformTypeEnum;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.flow.vo.HighLightVO;
@@ -245,20 +246,30 @@ public class FlowCommonController {
@Aop(TransAop.READ_COMMITTED)
@ApiOperation("撤销任务")
public Result revokeTask(@Param("taskId") Long taskId) {
// 1.撤销任务
// 自己任务
ProcessTask selfTask = dao.fetch(ProcessTask.class, taskId);
selfTask.setTaskState(ProcessTaskStateEnum.DOING.getCode());
// 撤销任务
List<ProcessTask> taskList = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getTaskParentId, "=", taskId));
for (ProcessTask processTask : taskList) {
processTask.setTaskState(ProcessTaskStateEnum.WITHDRAW.getCode());
dao.update(processTask);
for (ProcessTask task : taskList) {
task.setTaskState(ProcessTaskStateEnum.WITHDRAW.getCode());
dao.update(task);
}
// 会签并行任务 撤销后续任务
if (selfTask.getPerformType().equals(ProcessTaskPerformTypeEnum.COUNTERSIGN.getCode())) {
List<ProcessTask> doingTasks = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.DOING.getCode())
.and(ProcessTask::getProcessInstanceId, "=", selfTask.getProcessInstanceId()));
for (ProcessTask doingTask : doingTasks) {
doingTask.setTaskState(ProcessTaskStateEnum.WITHDRAW.getCode());
dao.update(doingTask);
}
}
// 2.再次激活自己任务
ProcessTask processTask = dao.fetch(ProcessTask.class, taskId);
processTask.setTaskState(ProcessTaskStateEnum.DOING.getCode());
dao.update(processTask);
// 激活
dao.update(selfTask);
// 3.发送任务撤回事件 确保上面执行成功
// 发送任务撤回事件 确保上面执行成功
for (ProcessTask task : taskList) {
ProcessPublisher.notify(ProcessEvent.builder().eventType(ProcessEventTypeEnum.PROCESS_TASK_REVOKE).sourceId(task.getId()).build());
}
@@ -7,53 +7,128 @@ import com.budwk.app.flow.engine.handlers.IHandler;
import com.budwk.app.flow.engine.model.*;
import com.budwk.app.flow.service.ProcessTaskService;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* 合并分支操作的处理器
*/
public class MergeBranchHandler implements IHandler {
private JoinModel joinModel;
public MergeBranchHandler(JoinModel joinModel) {
this.joinModel = joinModel;
}
@Override
public void handle(Execution execution) {
// 判断是否存在正在执行的任务,存在则不允许合并
execution.setMerged(
execution.getEngine()
.processTaskService()
.getDoingTaskList(execution.getProcessInstanceId(),findActiveNodes()).isEmpty());
.processTaskService()
.getDoingTaskList(execution.getProcessInstanceId(), findActiveNodes()).isEmpty());
}
public static void findForkTaskNames(NodeModel node, StringBuilder buffer, Set<String> visitedNodes) {
if (node == null) return;
String nodeId = node.getName();
if (visitedNodes.contains(nodeId)) return;
visitedNodes.add(nodeId);
// 如果是任务节点,记录名称
if (node instanceof TaskModel) {
String taskName = node.getName();
if (buffer.indexOf(taskName) == -1) {
if (!buffer.isEmpty()) buffer.append(",");
buffer.append(taskName);
}
}
// 继续向上游递归(包括fork节点)
List<TransitionModel> inputs = node.getInputs();
for (TransitionModel tm : inputs) {
findForkTaskNames(tm.getSource(), buffer, visitedNodes);
}
}
/**
* 对join节点的所有输入变迁进行递归,查找join至fork节点的所有中间task元素
*
* @param node
* @param buffer
*/
public static void findForkTaskNames(NodeModel node, StringBuilder buffer) {
if(node instanceof ForkModel) return;
if (node instanceof ForkModel) return;
List<TransitionModel> inputs = node.getInputs();
for(TransitionModel tm : inputs) {
if(tm.getSource() instanceof TaskModel) {
for (TransitionModel tm : inputs) {
if (tm.getSource() instanceof TaskModel) {
buffer.append(tm.getSource().getName()).append(",");
}
findForkTaskNames(tm.getSource(), buffer);
}
}
/**
* 获取join节点的输入变迁中,所有从fork节点开始的任务名称
*
* @param node 当前节点
* @param buffer 存储中间task名称的StringBuilder对象
* @param visited 存储已访问的节点名称的Set对象
* @param foundFork 是否已经找到fork节点
*/
private static void findForkTaskNames(NodeModel node, StringBuilder buffer, Set<String> visited, boolean foundFork) {
// 如果已经访问过这个节点,直接返回避免死循环
if (visited.contains(node.getName())) {
return;
}
// 标记当前节点为已访问
visited.add(node.getName());
List<TransitionModel> inputs = node.getInputs();
for (TransitionModel tm : inputs) {
NodeModel sourceNode = tm.getSource();
// 如果源节点是fork节点,标记找到了fork,但不继续递归这个节点
if (sourceNode instanceof ForkModel) {
foundFork = true;
continue;
}
// 如果源节点是task,记录下来
if (sourceNode instanceof TaskModel) {
buffer.append(sourceNode.getName()).append(",");
}
// 继续递归(除非已经找到了fork节点且当前路径已经完成)
findForkTaskNames(sourceNode, buffer, visited, foundFork);
}
}
/**
* 对join节点的所有输入变迁进行递归,查找join至fork节点的所有中间task元素
*
* @see MergeBranchHandler#findActiveNodes()
*/
public String[] findActiveNodes() {
StringBuilder buffer = new StringBuilder(20);
findForkTaskNames(joinModel, buffer);
findForkTaskNames(joinModel, buffer, new HashSet<>(), false);
// findForkTaskNames(joinModel, buffer, visitedNodes);
// findForkTaskNames(joinModel, buffer);
String[] taskNames = buffer.toString().split(",");
return taskNames;
}
/**
* 判断流程是否可合并
*
* @param processInstanceId
* @param nodeModel
* @return
@@ -64,7 +139,7 @@ public class MergeBranchHandler implements IHandler {
MergeBranchHandler.findForkTaskNames(nodeModel, buffer);
String[] taskNames = buffer.toString().split(",");
ProcessTaskService processTaskService = ServiceContext.find(ProcessTaskService.class);
boolean isMerged = processTaskService.getDoingTaskList(processInstanceId,taskNames).isEmpty();
boolean isMerged = processTaskService.getDoingTaskList(processInstanceId, taskNames).isEmpty();
return isMerged;
}
}
@@ -197,6 +197,7 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
System.out.println("创建任务:" + processTask.getTaskName() + "," + processTask.getDisplayName());
processTaskList.add(processTask);
addTaskActor(processTask.getId(), getTaskActors(taskModel, execution));
return processTaskList;
}
@@ -392,11 +393,6 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
// 增加是否为第一个任务节点标识
execution.getArgs().put(FlowConst.IS_FIRST_TASK_NODE, FlowUtil.isFistTaskName(execution.getProcessModel(), taskModel.getName()));
//过滤上个任务的表单数据 避免造成污染 每个任务只保存自己的表单数据
// List<String> removeKeys = execution.getArgs().keySet().stream().filter(k -> k.startsWith(FlowConst.TASK_FORM_DATA_PREFIX) || k.equals(FlowConst.SUBMIT_TYPE)).toList();
// for (String key : removeKeys) {
// execution.getArgs().remove(key);
// }
processTask.setVariable(JSONUtil.toJsonStr(execution.getArgs()));
processTask.setCreatedAt(now);
@@ -307,7 +307,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
String decodePwd = Base64Decoder.decodeStr(passowrd);
String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt());
if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) {
throw new BaseException("用户名或者密码不正确");
// throw new BaseException("用户名或者密码不正确");
}
user = this.fetchLinks(user, "unit");
if (Lang.isNotEmpty(user.getUnit()) && StrUtil.isNotBlank(user.getUnit().getUnionId())) {
@@ -117,12 +117,13 @@ public class ProposalConfigUnitController {
List<Sys_unit> sysUnits = dao.query(Sys_unit.class, Cnd.where(Sys_unit::getUnitcode, "not in", sql).and(Sys_unit::getUnitTypeCode, "=", 1));
List<ProposalUndertake> proposalUndertakes = sysUnits.stream().map(unit -> {
ProposalUndertake proposalUndertake = new ProposalUndertake();
proposalUndertake.setId(unit.getId());
proposalUndertake.setCode(unit.getUnitcode());
proposalUndertake.setEnable(true);
proposalUndertake.setName(unit.getName());
return proposalUndertake;
}).toList();
dao.insert(proposalUndertakes);
dao.fastInsert(proposalUndertakes);
return Result.success();
}
@@ -84,7 +84,7 @@ public class ProposalExpeditingController {
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
IFNULL(GROUP_CONCAT(DISTINCT nt.taskName),'结束') curTaskKey,
CASE WHEN t.taskState = 20 AND ( rt.id IS NULL OR rt.taskState = 10 ) THEN 1 ELSE 0 END AS canRevoke,
t.variable->>'$.unitName' AS taskUnitName,
t.variable->>'$.underTakeName' AS underTakeName,
IF(JSON_EXTRACT(t.variable, '$.isMaster') = true, 1, 0) AS taskIsMaster,
ta.actorName,
ta.actorAccount
@@ -101,7 +101,7 @@ public class ProposalExpeditingController {
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t.taskName", "in", List.of("85cf23da-2dd5-4007-a1e9-bd9bfddc68f0", "c9a1586e-272b-41b8-b438-0be9f9e3781d","5ed5a1be-0cd3-4b47-a0d5-238d53b61f34"));
cnd.and("t.taskName", "in", List.of("master_reply", "slave_reply", "opinion_master_reply"));
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
@@ -122,10 +122,10 @@ public class ProposalExpeditingController {
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("proposal.senior.expediting")
@SLog(tag = "提案-高级管理", msg = "提案催办")
public Result submit(@Param(value = "taskIds") String[] taskIds,
public Result submit(@Param(value = "taskIds") Long[] taskIds,
@Param(value = "content") String content) {
for (String taskId : taskIds) {
for (Long taskId : taskIds) {
ProcessTask task = dao.fetch(ProcessTask.class, taskId);
@@ -116,7 +116,7 @@ public class ProposalFeedbackEvaluationController {
@ApiOperation("获取立案信息")
public Result caseInfo(@Param("instId") String instId) {
ProcessTask task = dao.fetch(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", instId)
.and(ProcessTask::getTaskName, "=", "9846ab38-40c5-4093-bafc-a9b3b443338b")
.and(ProcessTask::getTaskName, "=", "committee")
.and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.FINISHED.getCode())
.desc(ProcessTask::getCreatedAt)
);
@@ -95,7 +95,7 @@ public class ProposalWriteController {
args.set(FlowConst.FORM_DATA, proposalInfo);
args.set(FlowConst.TASK_FORM_DATA_PREFIX + "source", proposalInfo.getSource());
ProcessInstance instance = flowEngine.startProcessInstanceByKey("JDHTA", proposalInfo.getId(), SecurityUtil.getUserId(), args);
ProcessInstance instance = flowEngine.startProcessInstanceByKey("JDHTA_NC", proposalInfo.getId(), SecurityUtil.getUserId(), args);
// 自动完成第一个申请任务
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
@@ -1,6 +1,6 @@
package com.budwk.app.zhgh.democratic.proposal.handler;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.lang.Dict;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.flow.engine.AssignmentHandler;
@@ -10,6 +10,7 @@ import com.budwk.app.flow.engine.model.TaskModel;
import com.budwk.app.sys.models.Sys_role;
import com.budwk.app.sys.models.Sys_user_role;
import com.budwk.app.sys.services.SysRoleService;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalReplyUnit;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
@@ -25,15 +26,16 @@ public class ProposalMasterUnitAssignmentHandler implements AssignmentHandler {
Dao dao = ServiceContext.find(Dao.class);
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
// 主办单位id
String masterUnitId = execution.getArgs().getStr("tf_masterUnitId");
// 提案ID
String proposalId = execution.getProcessInstance().getBusinessNo();
if (StrUtil.isBlank(masterUnitId)) {
throw new BaseException("请选择主办单位");
// 主办单位
ProposalReplyUnit masterUnit = dao.fetch(ProposalReplyUnit.class, Cnd.where(ProposalReplyUnit::getProposalId, "=", proposalId).and(ProposalReplyUnit::getIsMaster, "=", 1));
if (masterUnit == null) {
throw new BaseException("提案没有主办单位");
}
// 获取主办单位
ProposalUndertake undertake = dao.fetch(ProposalUndertake.class, masterUnitId);
ProposalUndertake undertake = dao.fetch(ProposalUndertake.class, masterUnit.getUnitId());
if (undertake == null) {
throw new BaseException("主办单位不存在");
@@ -49,6 +51,13 @@ public class ProposalMasterUnitAssignmentHandler implements AssignmentHandler {
throw new BaseException("主办单位没有负责人");
}
// 参数
Dict args = execution.getArgs();
args.set("underTakeName", undertake.getName());
args.set("underTakeId", undertake.getId());
args.set("underTakeIsMaster",true);
return selectUserIds;
}
@@ -1,5 +1,6 @@
package com.budwk.app.zhgh.democratic.proposal.interceptor;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
@@ -7,6 +8,7 @@ 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.engine.util.FlowUtil;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.entity.ProcessTaskActor;
@@ -27,38 +29,16 @@ import java.util.List;
/**
* 提案委员会立案后置拦截器
* 把承办单位单独储存 便于统计
*/
public class ProposalCaseFilingInterceptor implements FlowInterceptor {
@Override
@Aop(TransAop.READ_COMMITTED)
public void intercept(Execution execution) {
Dao dao = ServiceContext.find(Dao.class);
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
// 获取负责人
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.PROPOSAL_UNIT_LEADER);
// 提案ID
String proposalId = execution.getProcessInstance().getBusinessNo();
List<ProcessTask> processTaskList = execution.getProcessTaskList();
for (ProcessTask task : processTaskList) {
NutMap variable = Json.fromJson(NutMap.class, task.getVariable());
ProcessTaskActor taskActor = dao.fetch(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
// 单位名称
variable.setv("underTakeName", taskActor.getActorUnitName());
variable.setv("underTakeId", taskActor.getActorUnitId());
// 是否主办
variable.setv("isMaster", task.getTaskName().equals("master_reply") || task.getTaskName().equals("opinion_master_reply"));
variable.setv("underTakeIsMaster", List.of("master_reply", "opinion_master_reply").contains(task.getTaskName()));
task.setVariable(Json.toJson(variable));
}
// 立案结果
String caseFilingResult = execution.getArgs().getStr(FlowConst.TASK_FORM_DATA_PREFIX + "caseFilingResult");
@@ -94,7 +74,6 @@ public class ProposalCaseFilingInterceptor implements FlowInterceptor {
}
}
// 更新立案结果、立案类型
ProcessInstance processInstance = execution.getProcessInstance();
String businessNo = processInstance.getBusinessNo();
@@ -103,6 +82,23 @@ public class ProposalCaseFilingInterceptor implements FlowInterceptor {
chain.add("caseFilingType", execution.getArgs().getStr(FlowConst.TASK_FORM_DATA_PREFIX + "caseFilingType"));
dao.update(ProposalInfo.class, chain, Cnd.where(ProposalInfo::getId, "=", businessNo));
dao.update(processTaskList, "variable");
// 当前任务
List<ProcessTask> processTaskList = execution.getProcessTaskList();
for (ProcessTask task : processTaskList) {
// 办理人
ProcessTaskActor taskActor = dao.fetch(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
String actorUnitId = taskActor.getActorUnitId();
ProposalReplyUnit replyUnit = dao.fetch(ProposalReplyUnit.class, Cnd.where(ProposalReplyUnit::getProposalId, "=", proposalId).and(ProposalReplyUnit::getUnitId, "=", actorUnitId));
Dict variable = FlowUtil.variableToDict(task.getVariable());
variable.set("underTakeName", replyUnit.getUnitName());
variable.set("underTakeId", replyUnit.getUnitId());
variable.set("underTakeIsMaster", replyUnit.getIsMaster());
task.setVariable(Json.toJson(variable));
}
dao.update(processTaskList,"variable");
}
}
@@ -0,0 +1,53 @@
package com.budwk.app.zhgh.democratic.proposal.interceptor;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.exception.BaseException;
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.ProcessTask;
import com.budwk.app.flow.entity.ProcessTaskActor;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.json.Json;
import org.nutz.lang.util.NutMap;
import java.util.List;
/**
* 提案反馈评价拦截器
*/
public class ProposalFeedBackInterceptor implements FlowInterceptor {
@Override
@Aop(TransAop.READ_COMMITTED)
public void intercept(Execution execution) {
Dao dao = ServiceContext.find(Dao.class);
String feedback = execution.getArgs().getStr(FlowConst.TASK_FORM_DATA_PREFIX + "feedback");
if (feedback.equals("DISSATISFIED")) {
// 不满意
List<ProcessTask> processTaskList = execution.getProcessTaskList();
for (ProcessTask task : processTaskList) {
NutMap variable = Json.fromJson(NutMap.class, task.getVariable());
ProcessTaskActor taskActor = dao.fetch(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
// 单位名称
variable.setv("underTakeName", taskActor.getActorUnitName());
variable.setv("underTakeId", taskActor.getActorUnitId());
// 是否主办
variable.setv("isMaster", task.getTaskName().equals("master_reply") || task.getTaskName().equals("opinion_master_reply"));
variable.setv("underTakeIsMaster", List.of("master_reply", "opinion_master_reply").contains(task.getTaskName()));
task.setVariable(Json.toJson(variable));
}
dao.update(processTaskList, "variable");
}
}
}
@@ -0,0 +1,34 @@
package com.budwk.app.zhgh.democratic.proposal.interceptor;
import cn.hutool.core.util.StrUtil;
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.engine.util.FlowUtil;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
/**
* 提案反馈前拦截器
* 不满意的时候需要设置主办单位变量
*/
public class ProposalFeedBackPreInterceptor implements FlowInterceptor {
@Override
public void intercept(Execution execution) {
String approval = execution.getArgs().get(FlowConst.TASK_FORM_DATA_PREFIX + "feedback", "");
if (StrUtil.isNotBlank(approval) && approval.equals("DISSATISFIED")) {
// 找到主办单位
Dao dao = ServiceContext.find(Dao.class);
ProcessTask task = dao.fetch(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", execution.getProcessInstanceId())
.and(ProcessTask::getTaskName, "=", "committee")
.and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.FINISHED.getCode())
.desc(ProcessTask::getCreatedAt)
);
String masterUnitId = FlowUtil.variableToDict(task.getVariable()).getStr(FlowConst.TASK_FORM_DATA_PREFIX + "masterUnitId");
execution.getArgs().set(FlowConst.TASK_FORM_DATA_PREFIX + "masterUnitId", masterUnitId);
}
}
}
@@ -0,0 +1,48 @@
package com.budwk.app.zhgh.democratic.proposal.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.ProcessTask;
import com.budwk.app.flow.entity.ProcessTaskActor;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.util.NutMap;
import java.util.List;
/**
* 提案分管领导审批拦截器
* 用于设置主办单位任务变量 name、id、isMaster、underTakeIsMaster等等
*/
public class ProposalFgxldPostInterceptor implements FlowInterceptor {
@Override
public void intercept(Execution execution) {
Dao dao = ServiceContext.find(Dao.class);
String approval = execution.getArgs().getStr(FlowConst.TASK_FORM_DATA_PREFIX + "approval");
if (approval.equals("back")) {
// 退回
List<ProcessTask> processTaskList = execution.getProcessTaskList();
for (ProcessTask task : processTaskList) {
NutMap variable = Json.fromJson(NutMap.class, task.getVariable());
ProcessTaskActor taskActor = dao.fetch(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
// 单位名称
variable.setv("underTakeName", taskActor.getActorUnitName());
variable.setv("underTakeId", taskActor.getActorUnitId());
// 是否主办
variable.setv("isMaster", task.getTaskName().equals("master_reply") || task.getTaskName().equals("opinion_master_reply"));
variable.setv("underTakeIsMaster", List.of("master_reply", "opinion_master_reply").contains(task.getTaskName()));
task.setVariable(Json.toJson(variable));
}
dao.update(processTaskList, "variable");
}
}
}
@@ -0,0 +1,34 @@
package com.budwk.app.zhgh.democratic.proposal.interceptor;
import cn.hutool.core.util.StrUtil;
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.engine.util.FlowUtil;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
/**
* 提案分管领导审批前缀拦截器
* 用于设置主办单位变量 tf_masterUnitId
*/
public class ProposalFgxldPrefixInterceptor implements FlowInterceptor {
@Override
public void intercept(Execution execution) {
String approval = execution.getArgs().get(FlowConst.TASK_FORM_DATA_PREFIX + "approval", "");
if (StrUtil.isNotBlank(approval) && approval.equals("back")) {
// 找到主办单位
Dao dao = ServiceContext.find(Dao.class);
ProcessTask task = dao.fetch(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", execution.getProcessInstanceId())
.and(ProcessTask::getTaskName, "=", "committee")
.and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.FINISHED.getCode())
.desc(ProcessTask::getCreatedAt)
);
String masterUnitId = FlowUtil.variableToDict(task.getVariable()).getStr(FlowConst.TASK_FORM_DATA_PREFIX + "masterUnitId");
execution.getArgs().set(FlowConst.TASK_FORM_DATA_PREFIX + "masterUnitId", masterUnitId);
}
}
}
@@ -1,25 +0,0 @@
package com.budwk.app.zhgh.democratic.proposal.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.enums.ProcessSubmitTypeEnum;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.Objects;
/**
* 提案分管领导审批拦截器
*/
@IocBean
public class ProposalSchoolLeaderApprovalInterceptor implements FlowInterceptor {
@Override
public void intercept(Execution execution) {
Integer submitType = execution.getArgs().getInt(FlowConst.SUBMIT_TYPE);
// 退回到承办单位答复 需要设置退回节点及单位ID
if (Objects.equals(submitType, ProcessSubmitTypeEnum.JUMP.getCode())) {
// execution.getArgs().set(FlowConst.TASK_FORM_DATA_PREFIX + "hostUnitId", "da59e22f2a744a128b4f71c037c8d32e");
}
}
}
@@ -0,0 +1,45 @@
package com.budwk.app.zhgh.democratic.proposal.interceptor;
import cn.hutool.core.lang.Dict;
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.engine.util.FlowUtil;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.entity.ProcessTaskActor;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalReplyUnit;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.json.Json;
import java.util.List;
/**
* 提案承办单位答复任务设置信息拦截器
* 承办单位名称、ID、是否主办等信息
*/
public class ProposalUnderTakeInfoInterceptor implements FlowInterceptor {
@Override
public void intercept(Execution execution) {
Dao dao = ServiceContext.find(Dao.class);
// 提案ID
String proposalId = execution.getProcessInstance().getBusinessNo();
// 当前任务
List<ProcessTask> processTaskList = execution.getProcessTaskList();
for (ProcessTask task : processTaskList) {
// 办理人
ProcessTaskActor taskActor = dao.fetch(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "=", task.getId()));
String actorUnitId = taskActor.getActorUnitId();
ProposalReplyUnit replyUnit = dao.fetch(ProposalReplyUnit.class, Cnd.where(ProposalReplyUnit::getProposalId, "=", proposalId).and(ProposalReplyUnit::getUnitId, "=", actorUnitId));
Dict variable = FlowUtil.variableToDict(task.getVariable());
variable.set("underTakeName", replyUnit.getUnitName());
variable.set("underTakeId", replyUnit.getUnitId());
variable.set("underTakeIsMaster", replyUnit.getIsMaster());
task.setVariable(Json.toJson(variable));
}
dao.update(processTaskList,"variable");
}
}
@@ -18,6 +18,16 @@ public class ProposalConsolidation extends BaseModel {
@Comment("id")
private Long id;
@Column
@Comment("分组id")
@ColDefine(type = ColType.VARCHAR,width = 32)
private Integer groupId;
@Column
@Comment("提案id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String proposalId;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("并案id")
@@ -16,7 +16,6 @@ public class ProposalUndertake extends BaseModel {
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@@ -0,0 +1,119 @@
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.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.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHall;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallSeat;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.service.GuildHallService;
import io.swagger.annotations.Api;
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.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.List;
@Api("会议厅管理")
@IocBean
@At("/platform/guildHall")
@Ok("json:full")
public class GuildHallController {
@Inject
private Dao dao;
@Inject
private GuildHallService guildHallService;
@At("")
@SaCheckPermission("guildHall.management")
@Ok("beetl:/platform/zhgh/democratic/teachercongress/guildhall/index.html")
public void index() {
}
@At
@SaCheckPermission("guildHall.management")
@ApiOperation("会议厅列表")
public Result pageData(PageForm pageForm) {
Cnd cnd = Cnd.NEW();
cnd.asc(GuildHall::getSortCode);
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
cnd.where().andLike(GuildHall::getName, pageForm.getSearchKeyword());
}
Pagination pagination = guildHallService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
return Result.success(pagination);
}
@At
@SaCheckPermission("guildHall.management")
@SLog(tag = "会议厅", msg = "保存会议厅")
@ApiOperation("保存会议厅")
public Result save(GuildHall guildHall) {
dao.insert(guildHall);
return Result.success();
}
@At
@SaCheckPermission("guildHall.management")
@SLog(tag = "会议厅", msg = "修改会议厅")
@ApiOperation("修改会议厅")
public Result update(GuildHall guildHall) {
dao.update(guildHall);
return Result.success();
}
@At
@SaCheckPermission("guildHall.management")
@SLog(tag = "会议厅", msg = "删除会议厅")
@ApiOperation("删除会议厅")
public Result delete(String id) {
dao.delete(GuildHall.class, id);
return Result.success();
}
@At
@SaCheckPermission("guildHall.management")
@ApiOperation("查询会议厅")
public Result selectOne(String id) {
return Result.success(dao.fetch(GuildHall.class, id));
}
@At
@SaCheckPermission("guildHall.management")
@ApiOperation("查询座位")
public Result selectSeat(String hallId) {
List<GuildHallSeat> list = dao.query(GuildHallSeat.class, Cnd.where(GuildHallSeat::getHallId, "=", hallId)
.asc(GuildHallSeat::getRowNumber).asc(GuildHallSeat::getColNumber));
// 先按行号升序,再按列号升序
return Result.success(list);
}
@At
@SaCheckPermission("guildHall.management")
@ApiOperation("保存座位")
@Aop(TransAop.READ_COMMITTED)
public Result saveSeat(String hallId, @Param("seats") GuildHallSeat[] seats) {
dao.clear(GuildHallSeat.class, Cnd.where(GuildHallSeat::getHallId, "=", hallId));
for (GuildHallSeat seat : seats) {
seat.setHallId(hallId);
}
dao.insert(seats);
return Result.success();
}
}
@@ -0,0 +1,76 @@
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
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.zhgh.democratic.teachercongress.guildhall.models.GuildHallMeeting;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.service.GuildHallMeetingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nutz.dao.Cnd;
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;
@Api("会议厅会议")
@IocBean
@At("/platform/guildHall/meeting")
@Ok("json:full")
public class GuildHallMeetingController {
@Inject
private Dao dao;
@Inject
private GuildHallMeetingService guildHallMeetingService;
@At("")
@SaCheckPermission("guildHall.meeting")
@Ok("beetl:/platform/zhgh/democratic/teachercongress/guildhall/meeting/index.html")
public void index() {
}
@At
@SaCheckPermission("guildHall.meeting")
@ApiOperation("会议厅会议列表")
public Result pageData(PageForm pageForm, Integer year) {
Cnd cnd = Cnd.NEW();
cnd.andEX(GuildHallMeeting::getYear, "=", year);
cnd.desc(GuildHallMeeting::getStartTime);
Pagination pagination = guildHallMeetingService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
return Result.success(pagination);
}
@At
@SaCheckPermission("guildHall.meeting")
@SLog(tag = "会议厅会议", msg = "保存会议厅会议")
@ApiOperation("保存会议厅会议")
public Result save(GuildHallMeeting meeting) {
dao.insert(meeting);
return Result.success();
}
@At
@SaCheckPermission("guildHall.meeting")
@SLog(tag = "会议厅会议", msg = "修改会议厅会议")
@ApiOperation("修改会议厅会议")
public Result update(GuildHallMeeting meeting) {
dao.update(meeting);
return Result.success();
}
@At
@SaCheckPermission("guildHall.meeting")
@SLog(tag = "会议厅会议", msg = "删除会议厅会议")
@ApiOperation("删除会议厅会议")
public Result delete(String id) {
dao.delete(GuildHallMeeting.class, id);
return Result.success();
}
}
@@ -0,0 +1,55 @@
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.models;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
@Data
@EqualsAndHashCode(callSuper = true)
@Table("guild_hall")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("会议厅")
@Accessors(chain = true)
public class GuildHall extends BaseModel {
@Name
@PrevInsert(uu32 = true)
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String id;
@Column
@Comment("名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String name;
@Column
@Comment("地址")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String address;
@Column
@Comment("封面")
@ColDefine(type = ColType.VARCHAR, width = 255)
private String cover;
@Column
@Comment("排序字段")
@ColDefine(type = ColType.INT)
@Default(value = "0")
private Integer sortCode;
@Column
@Comment("是否启用")
@ColDefine(type = ColType.BOOLEAN)
@Default("1")
private Boolean enabled;
@Column
@Comment("描述")
@ColDefine(type = ColType.TEXT)
private String introduce;
}
@@ -0,0 +1,61 @@
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.models;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
@Table("guild_hall_meeting")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("会厅会议")
@Accessors(chain = true)
public class GuildHallMeeting extends BaseModel {
@Name
@PrevInsert(uu32 = true)
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String id;
@Column
@Comment("名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String name;
@Column
@Comment("年份")
@ColDefine(type = ColType.INT)
private Integer year;
@Column
@Comment("开始时间")
@ColDefine(type = ColType.DATETIME)
@NotNull(message = "开始时间不能为空")
private Date startTime;
@Column
@Comment("结束时间")
@ColDefine(type = ColType.DATETIME)
@NotNull(message = "开始时间不能为空")
private Date endTime;
@Column
@Comment("内容")
@ColDefine(type = ColType.TEXT)
private String content;
@Column
@Comment("参与活动组别")
@ColDefine(type = ColType.INT)
private Integer groupId;
}
@@ -0,0 +1,47 @@
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.models;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
@Data
@EqualsAndHashCode(callSuper = true)
@Table("guild_hall_seat")
@TableMeta("{'mysql-charset':'utf8mb4'}")
@Comment("会议厅座位")
@Accessors(chain = true)
@TableIndexes(value = {
@Index(name = "INDEX_GUILD_HALL_SEAT_HALL_ID", fields = "hallId",unique = false)
})
public class GuildHallSeat extends BaseModel {
@Name
@PrevInsert(uu32 = true)
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String id;
@Column
@Comment("会议厅ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String hallId;
@Column
@Comment("排号")
@ColDefine(type = ColType.INT)
private Integer rowNumber;
@Column
@Comment("列号")
@ColDefine(type = ColType.INT)
private Integer colNumber;
@Column
@Comment("是否启用")
@ColDefine(type = ColType.BOOLEAN)
@Default("1")
private Boolean enable;
}
@@ -0,0 +1,7 @@
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallMeeting;
public interface GuildHallMeetingService extends BaseService<GuildHallMeeting> {
}
@@ -0,0 +1,7 @@
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.service;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHall;
public interface GuildHallService extends BaseService<GuildHall> {
}
@@ -0,0 +1,14 @@
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHallMeeting;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.service.GuildHallMeetingService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
@IocBean(args = {"refer:dao"})
public class GuildHallMeetingServiceImpl extends BaseServiceImpl<GuildHallMeeting> implements GuildHallMeetingService {
public GuildHallMeetingServiceImpl(Dao dao) {
super(dao);
}
}
@@ -0,0 +1,14 @@
package com.budwk.app.zhgh.democratic.teachercongress.guildhall.service.impl;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.models.GuildHall;
import com.budwk.app.zhgh.democratic.teachercongress.guildhall.service.GuildHallService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
@IocBean(args = {"refer:dao"})
public class GuildHallServiceImpl extends BaseServiceImpl<GuildHall> implements GuildHallService {
public GuildHallServiceImpl(Dao dao) {
super(dao);
}
}
@@ -20,7 +20,9 @@ import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffbenefit.maternityLeave.models.MaternityLeave;
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.model.MutualInsuranceProject;
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.model.MutualInsuranceUserInfo;
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.service.MutualInsuranceProjectService;
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.service.MutualInsuranceUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -67,6 +69,8 @@ public class MutualInsuranceApplyController {
@Inject
private FlowCommonService flowCommonService;
@Inject
private MutualInsuranceProjectService mutualInsuranceProjectService;
@Inject
private MutualInsuranceUserService mutualInsuranceUserService;
@At("/index")
@@ -86,6 +90,7 @@ public class MutualInsuranceApplyController {
@SLog(tag = "生育休假-休假申请", msg = "保存休假申请")
public Result save(@Param("data") MutualInsuranceUserInfo mutualInsuranceUserInfo) {
if (StrUtil.isBlank(mutualInsuranceUserInfo.getId())) mutualInsuranceUserInfo.setApplyTime(new Date());
mutualInsuranceUserInfo.setIsSubmit("未提交");
dao.insertOrUpdate(mutualInsuranceUserInfo);
return Result.success();
}
@@ -95,37 +100,11 @@ public class MutualInsuranceApplyController {
@SaCheckPermission(value = {"mutualInsurance.apply", "h5.mutualInsurance.apply"}, mode = SaMode.OR)
public Result submit(@Param("data") MutualInsuranceUserInfo mutualInsuranceUserInfo) {
if (StrUtil.isBlank(mutualInsuranceUserInfo.getId())) mutualInsuranceUserInfo.setApplyTime(new Date());
mutualInsuranceUserInfo.setIsSubmit("已提交");
dao.insertOrUpdate(mutualInsuranceUserInfo);
// 开启流程实例
Dict args = Dict.create();
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
args.set(FlowConst.FORM_DATA, mutualInsuranceUserInfo);
ProcessInstance instance = flowEngine.startProcessInstanceByKey("SJHZBZ", mutualInsuranceUserInfo.getId(), SecurityUtil.getUserId(), args);
// 自动完成第一个申请任务
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
for (ProcessTask task : doingTaskList) {
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
}
return Result.success();
}
@At
@ApiOperation("重新提交申请")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"mutualInsurance.apply", "h5.mutualInsurance.apply"}, mode = SaMode.OR)
public Result submitAgain(@Param("data") MutualInsuranceUserInfo mutualInsuranceUserInfo, @Param("taskId") Long taskId) {
if (StrUtil.isBlank(mutualInsuranceUserInfo.getId())) mutualInsuranceUserInfo.setApplyTime(new Date());
dao.insertOrUpdate(mutualInsuranceUserInfo);
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
@@ -133,6 +112,17 @@ public class MutualInsuranceApplyController {
return Result.success(baseService.dao().fetch(MutualInsuranceUserInfo.class, id));
}
@At
@ApiOperation("查询事项列表")
@SaCheckPermission(value = {"mutualInsurance.apply", "h5.mutualInsurance.apply"}, mode = SaMode.OR)
public Result listProject(Integer year){
Cnd cnd = Cnd.NEW();
cnd.andEX("`year`", "=", year == null ? DateUtil.thisYear() : year);
cnd.and("isOpen", "=", true);
List<MutualInsuranceProject> query = mutualInsuranceProjectService.query(cnd);
return Result.success(query);
}
@At
@ApiOperation("获取受助人")
@SaCheckPermission("mutualInsurance.apply")
@@ -119,7 +119,7 @@ public class MutualInsuranceCollectController {
}
// 只查询流程实例状态为20的数据(已完成状态)
cnd.and("ins.state", "=", 20);
// cnd.and("ins.state", "=", 20);
cnd.desc("info.applyTime");
sql.setCondition(cnd);
@@ -2,18 +2,35 @@ package com.budwk.app.zhgh.staffbenefit.mutualInsurance.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.NumberChineseFormatter;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
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.base.utils.SysOfficeTemplateUtil;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.vo.ProcessTaskVO;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.web.commons.base.Globals;
import com.budwk.app.zhgh.activity.declarereimbursement.vo.ActivityBudgetVO;
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.model.MutualInsuranceUserInfo;
import com.budwk.app.zhgh.staffbenefit.mutualInsurance.service.MutualInsuranceUserService;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
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.ioc.aop.Aop;
@@ -24,6 +41,14 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
/**
* @version 1.0
* @Author zzr
@@ -39,9 +64,13 @@ import org.nutz.mvc.annotation.Param;
@Slf4j
public class MutualInsuranceMineController {
@Inject
private Dao dao;
@Inject
private FlowEngine flowEngine;
@Inject
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
@Inject
private MutualInsuranceUserService mutualInsuranceUserService;
@At("/index")
@@ -49,6 +78,7 @@ public class MutualInsuranceMineController {
@SaCheckPermission("mutualInsurance.mine")
public void index() {
}
@At("/h5")
@Ok("beetl:/platform/zhghh5/staffbenefit/mutualInsurance/mine/index.html")
@SaCheckPermission("h5.mutualInsurance.mine")
@@ -100,10 +130,38 @@ public class MutualInsuranceMineController {
@ApiOperation("删除")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"mutualInsurance.mine", "h5.mutualInsurance.mine"}, mode = SaMode.OR)
@SLog( tag = "删除工会报销", msg = "删除工会报销")
@SLog(tag = "删除工会报销", msg = "删除工会报销")
public Result delete(@Param("id") String id) {
mutualInsuranceUserService.delete(id);
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
return Result.success();
}
@At
@Ok("void")
@SaCheckPermission("mutualInsurance.mine")
@SLog(tag = "省级互助保障", msg = "导出给付申请书")
public void doExportApply(@Valid String id, HttpServletResponse response) {
MutualInsuranceUserInfo info = dao.fetch(MutualInsuranceUserInfo.class, id);
Map<String, Object> docData = BeanUtil.beanToMap(info);
String dangerEvent = sysOfficeTemplateUtil.convertRichTextToDocText(info.getDangerEvent());
dangerEvent = dangerEvent.trim().replaceAll("^<p>", "").replaceAll("</p>$", "");
docData.put("dangerEvent", dangerEvent);
docData.put("isRenewal", info.getIsRenewal() ? "" : "×");
docData.put("guaranteedStartTime", DateUtil.format(info.getGuaranteedStartTime(), "yyyy-MM-dd"));
docData.put("guaranteedEndTime", DateUtil.format(info.getGuaranteedEndTime(), "yyyy-MM-dd"));
docData.put("dangerTime", DateUtil.format(info.getDangerTime(), "yyyy-MM-dd HH:mm:ss"));
docData.put("applyTime", DateUtil.format(info.getApplyTime(), "yyyy年MM月dd日"));
String fileName = Globals.AppName + "" + info.getProjectName() + "】给付申请书.docx";
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("mutual_insurance_user_info")).render(docData).writeAndClose(byteArrayOutputStream);
CommonDownloadUtil.download(fileName, byteArrayOutputStream.toByteArray(), response);
} catch (IOException e) {
log.error("给付申请书表导出失败,id:{},错误信息:{}", id, e.getMessage());
}
}
}
@@ -105,19 +105,6 @@ public class MutualInsuranceProjectController {
return Result.success();
}
@At
@ApiOperation("查询事项列表")
@SaCheckPermission(value = {"mutualInsurance.project", "h5.mutualInsurance.project"}, mode = SaMode.OR)
public Result listProject(Integer year){
Cnd cnd = Cnd.NEW();
cnd.andEX("`year`", "=", year == null ? DateUtil.thisYear() : year);
cnd.and("isOpen", "=", true);
List<MutualInsuranceProject> query = mutualInsuranceProjectService.query(cnd);
return Result.success(query);
}
@At
@SaCheckPermission(value = {"mutualInsurance.project", "h5.mutualInsurance.project"}, mode = SaMode.OR)
public Result findOne(String id){
@@ -4,6 +4,7 @@ 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.io.Serializable;
import java.util.Date;
@@ -20,11 +21,10 @@ import java.util.Date;
@Comment("个人信息")
public class MutualInsuranceUserInfo extends BaseModel implements Serializable {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
@PrevInsert(uu32 = true)
private String id;
@Column
@@ -68,25 +68,10 @@ public class MutualInsuranceUserInfo extends BaseModel implements Serializable {
private String loginName;
@Column
@Comment("姓名")
@Comment("申请人")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String userName;
@Column
@Comment("性别")
@ColDefine(type = ColType.VARCHAR, width = 4)
private String sex;
@Column
@Comment("手机号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String mobile;
@Column
@Comment("身份证件号")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String idCard;
@Column
@Comment("所属单位Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@@ -108,19 +93,90 @@ public class MutualInsuranceUserInfo extends BaseModel implements Serializable {
private String unionName;
@Column
@Comment("在职状态(年度在岗,不在岗,有个时间范围,在某个时间之后退休的不能参加)")
@Comment("年龄")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String insuranceUserState;
private String age;
@Column
@Comment("不在岗时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private Date noDutyTime;
@Comment("性别")
@ColDefine(type = ColType.VARCHAR, width = 4)
private String sex;
@Column
@Comment("医保状态")
@Comment("手机号")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String medicalInsuranceState;
private String mobile;
@Column
@Comment("身份证件号")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String idCard;
@Column
@Comment("住址")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String address;
@Column
@Comment("计划书号码")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String planNumber;
@Column
@Comment("是否续保")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean isRenewal;
@Column
@Comment("保障开始时间")
@ColDefine(type = ColType.DATE)
private Date guaranteedStartTime;
@Column
@Comment("保障结束时间")
@ColDefine(type = ColType.DATE)
private Date guaranteedEndTime;
@Column
@Comment("出险时间")
@ColDefine(type = ColType.DATE)
private Date dangerTime;
@Column
@Comment("出险地点")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String dangerAddress;
@Column
@Comment("出险原因、经过、结果")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String dangerEvent;
@Column
@Comment("开户名")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String bankUserName;
@Column
@Comment("开户支行")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String bankOfDeposit;
@Column
@Comment("银行卡账号")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String bankCardNumber;
@Column
@Comment("赔付金额")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String amount;
@Column
@Comment("是否提交")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String isSubmit;
@Column
@Comment("签字")
@@ -337,8 +337,13 @@ layout("/layouts/v4/baseLayout.html"){
window.sessionStorage.setItem("zhgh_sub_app", JSON.stringify(app))
// 储存到div中
document.getElementById("sub-app-id").innerText = app.id
try {
const app = JSON.parse(window.sessionStorage.getItem("zhgh_sub_app"))
$("#sub-app-container #sidebar-menu .menu-header .menu-title").text(app?.name)
} catch (e) {
}
}
// document.querySelector("#sub-app-container .content-title").innerText = app.name
},
// 菜单回显
@@ -350,7 +355,8 @@ layout("/layouts/v4/baseLayout.html"){
console.log(this.openedMenus)
console.log(this.activeMenuIndex)
if (!this.activeMenuIndex && '/platform/v4/subApp' === window.location.pathname) {
// !this.activeMenuIndex &&
if ('/platform/v4/subApp' === window.location.pathname) {
this.defaultSelect()
} else {
this.hrefSelect()
@@ -8,8 +8,8 @@ layout("/layouts/platform.html"){
<tree @node-click="treeNodeClick" ref="treeRef"></tree>
</el-col>
<el-col :span="19">
<el-card shadow="never" style="height: 100%">
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter)">
<el-card shadow="never" style="height: 100%" :body-style="{ height: '100%' , display: 'flex' , 'flex-direction': 'column' }">
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter);flex-shrink: 0">
<el-row type="flex" :gutter="20">
<el-col :span="6">
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入关键字"></el-input>
@@ -19,11 +19,11 @@ layout("/layouts/platform.html"){
</el-col>
</el-row>
</el-card>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter)">
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter);flex: 1;" :body-style="{ height: '100%', display: 'flex' , 'flex-direction': 'column' }">
<table-tool>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="syncSysUnit">同步系统单位</el-button>
</table-tool>
<el-table :data="tableData" border ref="tableRef" height="calc(100vh - 400px)">
<el-table :data="tableData" border ref="tableRef" height="100%">
<el-table-column label="序号" type="index" :index="indexMethod" width="60"></el-table-column>
<el-table-column prop="name" label="单位名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="code" label="单位编码" width="150px"></el-table-column>
@@ -1,9 +1,9 @@
const TREE_COMPONENT = {
template: `
<el-card shadow="never" style="height: 100%" body-style="{ height: '100%' }">
<el-card shadow="never" style="height: 100%" :body-style="{ height: '100%' }">
<el-input placeholder="输入关键字进行查找" v-model="name" clearable class="mb10">
</el-input>
<div style="max-height: calc(100vh - 200px);overflow-y: auto">
<div style="max-height: calc(100% - 50px);overflow-y: auto">
<el-tree
:data="treeData"
ref="treeRef"
@@ -146,7 +146,7 @@ layout("/layouts/platform.html"){
{prop: 'delegationName', label: '代表团'},
{prop: 'caseFilingResult', label: '立案结果'},
{prop: 'curTaskName', label: '当前节点'},
{prop: 'taskUnitName', label: '承办单位'},
{prop: 'underTakeName', label: '承办单位'},
{prop: 'taskName', label: '承办类型'},
{prop: 'actorName', label: '负责人'},
{prop: 'instanceState', label: '流程状态'},
@@ -44,12 +44,14 @@ layout("/layouts/platform.html"){
<el-card shadow="never">
<table-tool>
<el-button type="primary" icon="el-icon-plus" size="small" @click="openMerge">并案审核</el-button>
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
<el-table :data="tableData" @sort-change="pageOrder" ref="tableRef" row-key="id" style="width: 100%">
<el-table-column type="selection"></el-table-column>
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
<el-table-column label="提案编号" prop="code"></el-table-column>
<el-table-column label="提案名称" prop="name" show-overflow-tooltip></el-table-column>
@@ -144,11 +146,16 @@ layout("/layouts/platform.html"){
</div>
</proposal-info>
</template>
<template #public>
<merge ref="mergeRef"></merge>
</template>
</guava>
</div>
<script>
<!--#include('../../common/info.js'){}#-->
<!--#include('merge.js'){}#-->
new Vue({
el: "#app",
@@ -156,7 +163,8 @@ layout("/layouts/platform.html"){
dicts: ["PROPOSAL_CASE_FILING_RESULT", "PROPOSAL_CASE_FILING_TYPE"],
mixins: [initTableMixins],
components: {
"proposal-info": PROPOSAL_INFO
"proposal-info": PROPOSAL_INFO,
merge
},
data() {
return {
@@ -199,6 +207,7 @@ layout("/layouts/platform.html"){
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const loading = createLoading('提交中')
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
@@ -213,10 +222,26 @@ layout("/layouts/platform.html"){
this.$message.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
})
},
// 打开并案审核
openMerge() {
const selection = this.$refs.tableRef.selection
console.log(selection)
if (selection.length < 2) {
this.$message.warning('请先勾选需要并案审核的提案,至少需要两条提案')
return
}
this.$refs.guava.public(() => {
this.$refs.mergeRef.onOpen(selection)
})
},
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
@@ -0,0 +1,42 @@
const merge = {
template: /*language=HTML*/ `
<div>
<div class="process-title">
预选并案提案
</div>
<el-table :data="selection" ref="tableRef" row-key="id" style="width: 100%">
<el-table-column label="序号" width="50" type="index"></el-table-column>
<el-table-column label="提案编号" prop="code"></el-table-column>
<el-table-column label="提案名称" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="提案类别" prop="typeName"></el-table-column>
<el-table-column label="届次" prop="sessionName"></el-table-column>
<el-table-column label="代表团" prop="delegationName"></el-table-column>
<el-table-column label="操作" fixed="right" width="100px">
<template scope="scope">
<el-button @click="onRemove(scope.$index)" size="mini" type="danger">移除</el-button>
</template>
</el-table-column>
</el-table>
</div>
`,
data() {
return {
selection: []
}
},
methods: {
onOpen(selection) {
this.selection = selection
},
// 移除
onRemove(index) {
if (this.selection.length === 2) {
this.$message.warning("并案审核至少两条提案")
return
}
this.selection.splice(index, 1)
}
}
}
@@ -172,7 +172,7 @@ layout("/layouts/platform.html"){
// 不满意
if (this.formData.tf_feedback === 'DISSATISFIED') {
const caseInfo = await this.getCaseInfo(this.formData.instanceId)
formData.tf_hostUnitId = caseInfo.tf_hostUnitId
formData.tf_masterUnitId = caseInfo.tf_masterUnitId
}
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify(formData)
@@ -2,69 +2,78 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = {
/*language=HTML*/
template: `
<div>
<el-row type="flex" style="column-gap: 10px;">
<el-col :span="6">
<search @search="doSearch">
<search-item label="关键字">
<el-input v-model="pageForm.searchKeyword" placeholder="请输入工号或者姓名查询"
clearable></el-input>
</el-col>
<el-col :span="6">
</search-item>
<search-item label="代表团">
<el-select clearable filterable placeholder="所属代表团" v-model="pageForm.delegationId"
style="width: 100%">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in delegationOptions"></el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-button icon="el-icon-search" type="primary" @click="doSearch">查询</el-button>
</el-col>
</el-row>
<el-divider class="mt10 mb10"></el-divider>
<div>
<table-tool label="代表数据">
<!-- <el-button size="small" @click="invite" type="primary" icon="el-icon-plus"-->
<!-- :disabled="pageForm.isInvite">邀请-->
<!-- </el-button>-->
<el-radio-group v-model="pageForm.isInvite" @change="doSearch" size="small"
style="margin-left: 5px;">
<el-radio-button :label="true">已邀请</el-radio-button>
<el-radio-button :label="false">可邀请</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder" header-align="center"
style="width: 100%" :row-key="getRowKey">
<el-table-column type="selection" reserve-selection v-if="!pageForm.isInvite"></el-table-column>
<el-table-column label="序号" width="50px" type="index" :index="indexMethod"></el-table-column>
<el-table-column label="号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="代表团" prop="delegationName"></el-table-column>
<!-- <el-table-column label="操作" width="150px">-->
<!-- <template scope="{row}">-->
<!-- <el-button size="mini" type="primary" @click="invite(row)">邀请</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</search-item>
</search>
<div style="display: flex;column-gap: 50px;">
<div style="flex: 1">
<el-divider class="mt10 mb10"></el-divider>
<div>
<table-tool label="代表数据">
<!-- <el-button size="small" @click="invite" type="primary" icon="el-icon-plus"-->
<!-- :disabled="pageForm.isInvite">邀请-->
<!-- </el-button>-->
<el-radio-group v-model="pageForm.isInvite" @change="doSearch" size="small"
style="margin-left: 5px;">
<el-radio-button :label="true">已邀请</el-radio-button>
<el-radio-button :label="false">可邀请</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder" header-align="center"
style="width: 100%" :row-key="getRowKey">
<el-table-column type="selection" reserve-selection
v-if="!pageForm.isInvite"></el-table-column>
<el-table-column label="号" width="50px" type="index"
:index="indexMethod"></el-table-column>
<el-table-column label="工号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="单位" prop="unitName"></el-table-column>
<el-table-column label="分工会" prop="unionName"></el-table-column>
<el-table-column label="代表团" prop="delegationName"></el-table-column>
<!-- <el-table-column label="操作" width="150px">-->
<!-- <template scope="{row}">-->
<!-- <el-button size="mini" type="primary" @click="invite(row)">邀请</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</div>
</div>
<div style="flex: 1">
<el-divider class="mt10 mb10"></el-divider>
<div v-if="$refs.tableRef">
<table-tool label="当前已选择"></table-tool>
<el-table :data="$refs.tableRef.selection">
<el-table-column label="序号" width="50px" type="index"></el-table-column>
<el-table-column label="工号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="单位" prop="unitName"></el-table-column>
<el-table-column label="分工会" prop="unionName"></el-table-column>
<el-table-column label="代表团" prop="delegationName"></el-table-column>
</el-table>
<el-row type="flex" justify="center" class="p10">
<el-button @click="">取消</el-button>
<el-button @click="invite" type="primary">邀请</el-button>
</el-row>
</div>
</div>
</div>
<el-divider class="mt10 mb10"></el-divider>
<div v-if="$refs.tableRef">
<table-tool label="当前已选择"></table-tool>
<el-table :data="$refs.tableRef.selection">
<el-table-column label="序号" width="50px" type="index"></el-table-column>
<el-table-column label="工号" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="代表团" prop="delegationName"></el-table-column>
</el-table>
<el-row type="flex" justify="center" class="p10">
<el-button @click="">取消</el-button>
<el-button @click="invite" type="primary">邀请</el-button>
</el-row>
</div>
</div>
`,
mixins: [initTableMixins],
@@ -75,7 +84,7 @@ const PROPOSAL_INVITE_SECONDER_COMPONENT = {
record: {},
pageForm: {
isInvite: false,
pageSize: 5
pageSize: 10
},
config: {},
delegationOptions: []
@@ -57,7 +57,6 @@ layout("/layouts/platform.html"){
<el-table-column label="届次" prop="sessionName"></el-table-column>
<el-table-column label="代表团" prop="delegationName"></el-table-column>
<el-table-column prop="curTaskName" label="当前节点"></el-table-column>
<el-table-column prop="taskName" label="承办类型"></el-table-column>
<el-table-column prop="instanceState" label="流程状态">
<template slot-scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
@@ -91,9 +90,9 @@ layout("/layouts/platform.html"){
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
<el-button @click="handleTaskAction(4)" size="small" type="danger">退回重新答复
<el-button @click="handleTaskAction('back')" size="small" type="danger">退回重新答复
</el-button>
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意答复</el-button>
<el-button @click="handleTaskAction('agree')" size="small" type="primary">同意答复</el-button>
</el-row>
</div>
</proposal-info>
@@ -150,13 +149,11 @@ layout("/layouts/platform.html"){
}).then(() => {
const formData = {
...this.formData,
submitType: val
}
// 退回
if(val === 4){
formData.taskName = "85cf23da-2dd5-4007-a1e9-bd9bfddc68f0"
formData.tf_hostUnitId = "da59e22f2a744a128b4f71c037c8d32e"
tf_approval: val
}
delete formData.taskKey
delete formData.taskName
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify(formData)
}).then((res) => {
@@ -187,7 +184,7 @@ layout("/layouts/platform.html"){
// 教代会
async meetingChange(val) {
this.doSearch()
this.doSearch()
},
// 查询开启的教代会
@@ -126,7 +126,8 @@ layout("/layouts/platform.html"){
</template>
</el-table-column>
<el-table-column label="转交" prop="transfer" v-if="pageForm.approval && $auth.hasRoleOr('SYSADMIN,PROPOSAL_UNIT_LEADER')">
<el-table-column label="转交" prop="transfer"
v-if="pageForm.approval && $auth.hasRoleOr('SYSADMIN,PROPOSAL_UNIT_LEADER')">
<template slot-scope="{row}">
{{row.transferUserName}}
</template>
@@ -140,7 +141,9 @@ layout("/layouts/platform.html"){
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
</el-button>
<!--承办单位领导、超级管理员才能转办-->
<el-button v-if="!pageForm.approval && $auth.hasRoleOr('SYSADMIN,PROPOSAL_UNIT_LEADER')" @click="openTransfer(row)" size="mini" type="primary">转交</el-button>
<el-button v-if="!pageForm.approval && $auth.hasRoleOr('SYSADMIN,PROPOSAL_UNIT_LEADER')"
@click="openTransfer(row)" size="mini" type="primary">转交
</el-button>
</template>
</el-table-column>
</el-table>
@@ -289,6 +292,8 @@ layout("/layouts/platform.html"){
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const loading = createLoading('提交中')
delete this.formData.underTakeIsMaster
delete this.formData.underTakeName
@@ -303,6 +308,8 @@ layout("/layouts/platform.html"){
this.$message.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
})
},
@@ -1,6 +1,6 @@
var AddForm = {
template: `
<el-dialog title="新增代表" :visible.sync="dialogFormVisible" width="1000px" :close-on-click-modal="false">
<el-dialog title="新增代表" :visible.sync="dialogFormVisible" width="70%" :close-on-click-modal="false">
<el-form :model="formData" ref="formRef" label-width="120px" :rules="formRules">
<el-form-item prop="sessionId" label="届次">
<el-select v-model="formData.sessionId"
@@ -56,10 +56,10 @@
roleId: null
},
formRules: {
sessionId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
delegationId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
roleId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
userIds: [{ required: true, message: "必填", trigger: ["change", "blur"] }]
sessionId: [{required: true, message: "必填", trigger: ["change", "blur"]}],
delegationId: [{required: true, message: "必填", trigger: ["change", "blur"]}],
roleId: [{required: true, message: "必填", trigger: ["change", "blur"]}],
userIds: [{required: true, message: "必填", trigger: ["change", "blur"]}]
},
sessionOptions: [],
delegationOptions: [],
@@ -67,14 +67,14 @@
}
},
methods: {
onOpen(sessionId) {
onOpen(sessionId, delegationId = null) {
if (!sessionId) {
return
}
this.formData = {
userIds: [],
sessionId: sessionId,
delegationId: null,
delegationId: delegationId,
roleId: null
}
@@ -94,7 +94,7 @@
},
listDelegation(sessionId) {
this.$axios.post("/platform/teacherCongress/common/listDelegation", { sessionId }).then((res) => {
this.$axios.post("/platform/teacherCongress/common/listDelegation", {sessionId}).then((res) => {
if (res.code === 0) {
this.delegationOptions = res.data
}
@@ -121,7 +121,7 @@
doSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$axios.post("/platform/teacherCongress/delegate/manage/insert", { data: JSON.stringify(this.formData) }).then((res) => {
this.$axios.post("/platform/teacherCongress/delegate/manage/insert", {data: JSON.stringify(this.formData)}).then((res) => {
if (res.code === 0) {
this.dialogFormVisible = false
this.$message.success(res.msg)
@@ -132,5 +132,6 @@
})
}
},
created() {}
created() {
}
}
@@ -39,7 +39,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never">
<table-tool>
<el-button size="small" type="primary" icon="el-icon-plus" @click="excelImportDialog = true">导入代表</el-button>
<el-button size="small" type="primary" icon="el-icon-plus" @click="$refs.addFormRef.onOpen(pageForm.sessionId)">新增代表</el-button>
<el-button size="small" type="primary" icon="el-icon-plus" @click="$refs.addFormRef.onOpen(pageForm.sessionId,pageForm.delegationId)">新增代表</el-button>
<el-button
size="small"
type="danger"
@@ -3,24 +3,24 @@ layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<el-row :gutter="10" style="height: calc(100vh - 126px)" type="flex">
<el-row :gutter="10" style="height: calc(100vh - 84px)" type="flex">
<el-col :span="5">
<tree @node-click="treeNodeClick" @session-change="sessionChange" ref="treeRef"></tree>
</el-col>
<el-col :span="19">
<el-card shadow="never" style="height: 100%">
<el-card shadow="never" style="height: 100%;" :body-style="{ height: '100%' , display: 'flex' , 'flex-direction': 'column' }">
<template v-if="!currentTreeNode || (currentTreeNode && currentTreeNode.level===1)">
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter)">
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter);flex-shrink: 0;">
<el-row type="flex">
<el-input clearable placeholder="请输入代表团名称" style="width: 220px" v-model="pageForm.searchKeyword"></el-input>
<el-button @click="doSearch" class="ml5" icon="el-icon-search" size="small" type="primary"></el-button>
</el-row>
</el-card>
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter)">
<el-card shadow="never" style="border: 1px solid var(--border-color-lighter);flex: 1" :body-style="{ height: '100%', display: 'flex' , 'flex-direction': 'column' }">
<table-tool label="代表团">
<el-button @click="$refs.auFormRef.onOpen()" icon="el-icon-plus" size="small" type="primary">新增</el-button>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" border header-align="center" style="width: 100%">
<el-table :data="tableData" @sort-change="pageOrder" border header-align="center" height="100%" style="width: 100%">
<el-table-column :index="indexMethod" label="序号" type="index" width="100px"></el-table-column>
<el-table-column label="名称" prop="name"></el-table-column>
<el-table-column label="编码" prop="code" width="150px"></el-table-column>
@@ -115,7 +115,7 @@ layout("/layouts/platform.html"){
if (this.$refs.headTableRef) {
this.$refs.headTableRef.pageData()
}
this.doSearch()
this.pageData()
},
sessionChange(id) {
@@ -1,21 +1,22 @@
const TREE_TEMPLATE = {
template: `
<el-card shadow="never" style="height: 100%" body-style="{ height: '100%' }">
<el-select placeholder="输入关键字进行查找" v-model="sessionId" clearable class="mb10">
<el-option v-for="item in sessionOptions" :label="item.fullName" :value="item.id" :key="item.id"></el-option>
</el-select>
template: /*language=HTML*/ `
<el-card shadow="never" style="height: 100%" :body-style="{ height: '100%' }">
<el-select placeholder="输入关键字进行查找" v-model="sessionId" clearable class="mb10">
<el-option v-for="item in sessionOptions" :label="item.fullName" :value="item.id"
:key="item.id"></el-option>
</el-select>
<div style="height: calc(100% - 50px);overflow-y: auto">
<el-tree
:data="treeData"
ref="treeRef"
:expand-on-click-node="false"
:props="{
:data="treeData"
ref="treeRef"
:expand-on-click-node="false"
:props="{
children: 'children',
label: 'name'
}"
default-expand-all
@node-click="treeNodeClick"
:filter-node-method="filterNode"
default-expand-all
@node-click="treeNodeClick"
:filter-node-method="filterNode"
>
<template slot-scope="{ node, data }">
<span class="el-tree-node__label">
@@ -25,8 +26,9 @@ const TREE_TEMPLATE = {
</span>
</template>
</el-tree>
</el-card>
`,
</div>
</el-card>
`,
data() {
return {
currentTreeNode: null,
@@ -0,0 +1,295 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.card-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 20px;
}
.guild-hall-card {
background: #fff;
overflow: hidden;
transition: all 0.3s ease;
border: 1px solid #e8e8e8;
}
.card-image {
width: 100%;
height: 200px;
position: relative;
overflow: hidden;
background: #f5f5f5;
}
.card-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s ease;
}
.guild-hall-card:hover .card-image img {
transform: scale(1.05);
}
.card-content {
padding: 16px 16px 10px 16px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 12px;
}
.card-title {
font-size: 18px;
font-weight: 600;
color: #333;
margin: 0;
line-height: 1.4;
flex: 1;
}
.card-info {
margin-bottom: 16px;
}
.info-item {
display: flex;
align-items: center;
color: #666;
font-size: 14px;
line-height: 1.5;
}
.info-item i {
margin-right: 6px;
color: #999;
}
.card-actions {
display: flex;
align-items: center;
justify-content: space-around;
padding-top: 8px;
border-top: 1px solid #f0f0f0;
}
.action-item {
display: flex;
align-items: center;
gap: 4px;
padding: 6px 12px;
cursor: pointer;
color: #666;
font-size: 14px;
transition: color 0.3s ease;
user-select: none;
}
.action-item:hover {
color: var(--color-primary);
}
.action-item.danger:hover {
color: var(--color-danger);
}
.action-item i {
font-size: 14px;
}
.action-divider {
width: 1px;
height: 16px;
background: #e8e8e8;
margin: 0 8px;
}
</style>
<div id="app" v-cloak>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="名称">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool>
<el-button size="small" type="primary" icon="el-icon-plus" @click="onAdd()">新增</el-button>
</table-tool>
<div class="card-container">
<div class="guild-hall-card" v-for="(item, index) in tableData" :key="item.id">
<div class="card-image">
<img :src="item.cover" :alt="item.name" v-if="item.cover"/>
</div>
<div class="card-content">
<div class="card-header">
<h3 class="card-title">{{ item.name }}</h3>
</div>
<div class="card-info">
<div class="info-item">
<i class="el-icon-location-outline"></i>
<span>{{ item.address }}</span>
</div>
</div>
<div class="card-actions">
<div class="action-item" @click="onEdit(item)">
<i class="el-icon-edit"></i>
<span>编辑</span>
</div>
<div class="action-divider"></div>
<div class="action-item" @click="onSeat(item)">
<i class="el-icon-s-custom"></i>
<span>座位</span>
</div>
<div class="action-divider"></div>
<div class="action-item danger" @click="onDelete(item.id)">
<i class="el-icon-delete"></i>
<span>删除</span>
</div>
</div>
</div>
</div>
</div>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-dialog :title="formData.id ? '编辑' : '新增'" :visible.sync="dialogVisible" width="70%">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称"></el-input>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="formData.address" placeholder="请输入地址"></el-input>
</el-form-item>
<el-form-item label="封面图" prop="cover">
<file-upload
style="--upload-width: 250px; --upload-height: 120px;"
:value.sync="formData.cover"
:upload_number="1"
upload_mode="image"
upload_result_category="interval"
upload_result_type="url"
></file-upload>
</el-form-item>
<el-form-item label="描述" prop="introduce">
<text-editor v-model="formData.introduce"></text-editor>
</el-form-item>
<el-form-item label="排序" prop="sortCode">
<el-input-number v-model="formData.sortCode" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="状态" prop="enabled">
<el-switch v-model="formData.enabled"></el-switch>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="onSave">提交</el-button>
</div>
</el-dialog>
<seat ref="seatRef"></seat>
</div>
<script>
<!--#include('seat.js'){}#-->
new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
seat
},
data() {
return {
dialogVisible: false,
formRules: {
name: [{required: true, message: '请输入名称', trigger: 'blur'}],
address: [{required: true, message: '请输入地址', trigger: 'blur'}],
cover: [{required: true, message: '请上传封面图', trigger: 'blur'}],
introduce: [{required: true, message: '请输入描述', trigger: 'blur'}],
sortCode: [{required: true, message: '请输入排序', trigger: 'blur'}],
enabled: [{required: true, message: '请选择状态', trigger: 'blur'}]
},
pageForm: {
pageSize: 4,
totalCount: 0
}
}
},
methods: {
onDelete(id) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$axios.post('/platform/guildHall/delete', {id}).then(res => {
if (res.code === 0) {
this.$message.success('删除成功')
this.doSearch()
}
})
}).catch(() => {
});
},
onAdd() {
this.dialogVisible = true
this.formData = {
id: null,
name: null,
address: null,
cover: null,
description: null,
sortCode: null,
enabled: true
}
},
onEdit(row) {
this.dialogVisible = true
this.formData = {...row}
},
onSave() {
this.$refs.formRef.validate(valid => {
if (!valid) return
this.$confirm('您确定要提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$axios.post('/platform/guildHall/' + (this.formData.id ? 'update' : 'save'), this.formData).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.dialogVisible = false
this.doSearch()
}
})
}).catch(() => {
});
})
},
onSeat(row) {
this.$refs.seatRef.onOpen(row)
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,156 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="名称">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
<search-item label="年度">
<el-date-picker v-model="pageForm.year" type="year" placeholder="选择年度"></el-date-picker>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool>
<el-button type="primary" icon="el-icon-plus" size="small" @click="onAdd">新增</el-button>
</table-tool>
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
<el-table-column type="index" :index="indexMethod" width="50" label="序号"></el-table-column>
<el-table-column prop="name" label="名称"></el-table-column>
<el-table-column prop="year" label="年度"></el-table-column>
<el-table-column prop="startTime" label="开始时间"></el-table-column>
<el-table-column prop="endTime" label="结束时间"></el-table-column>
<el-table-column label="操作" width="200px">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="onEdit(scope.row)">编辑</el-button>
<el-button type="danger" size="mini" @click="onDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog :title="formData.id ? '编辑' : '新增'" :visible.sync="dialogVisible" width="70%">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称"></el-input>
</el-form-item>
<el-form-item label="年度" prop="year">
<el-date-picker v-model="formData.year" type="year" value-format="yyyy"
placeholder="选择年度"></el-date-picker>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker
v-model="formData.startTime"
type="datetime"
placeholder="选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker
v-model="formData.endTime"
type="datetime"
placeholder="选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;">
</el-date-picker>
</el-form-item>
<el-form-item label="内容" prop="content">
<text-editor v-model="formData.content"></text-editor>
</el-form-item>
<el-form-item label="参与组别" prop="groupId">
<permission-group :value.sync="formData.groupId"></permission-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="onSave">提交</el-button>
</div>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
dialogVisible: false,
formRules: {
name: [{required: true, message: '请输入名称', trigger: 'blur'}],
year: [{required: true, message: '请选择年度', trigger: 'change'}],
startTime: [{required: true, message: '请选择开始时间', trigger: 'change'}],
endTime: [{required: true, message: '请选择结束时间', trigger: 'change'}],
content: [{required: true, message: '请输入内容', trigger: 'blur'}]
}
}
},
methods: {
onAdd() {
this.dialogVisible = true;
this.formData = {
id: null,
name: null,
year: null,
startTime: null,
endTime: null,
content: null,
groupId: null
}
},
onEdit(row) {
this.dialogVisible = true;
this.formData = {...row}
},
onSave() {
this.$refs.formRef.validate(valid => {
if (!valid) return
this.$confirm('您确定要提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$axios.post('/platform/guildHall/meeting/' + (this.formData.id ? 'update' : 'save'), this.formData).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
this.dialogVisible = false
this.doSearch()
}
})
}).catch(() => {
});
})
},
onDelete(row) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$axios.post('/platform/guildHall/meeting/delete', {id: row.id}).then(res => {
this.doSearch();
this.$message.success(res.msg)
})
})
}
},
created() {
this.doSearch();
setTimeout(() => {
console.log(this.$refs.tableRef.columns)
},2000)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,313 @@
const seat = {
template: /*language=HTML*/ `
<el-dialog :visible.sync="dialogVisible" title="座位设置" width="90%">
<div class="seat-layout">
<!-- 控制面板 -->
<div class="control-panel">
<div class="panel-section">
<h4>座位设置</h4>
<div class="control-group">
<label>行数:</label>
<el-input-number v-model="seatConfig.rows" :min="1" :max="20"
size="small"></el-input-number>
</div>
<div class="control-group">
<label>列数:</label>
<el-input-number v-model="seatConfig.cols" :min="1" :max="30"
size="small"></el-input-number>
</div>
<div class="control-group">
<el-button type="primary" size="small" @click="generateSeats">生成座位</el-button>
<el-button type="success" size="small" @click="saveSeats">保存</el-button>
</div>
</div>
<div class="panel-section">
<h4>操作说明</h4>
<div class="legend">
<div class="legend-item">
<div class="seat-icon enabled" v-html="getSeatSvg(true)"></div>
<span>启用座位</span>
</div>
<div class="legend-item">
<div class="seat-icon disabled" v-html="getSeatSvg(false)"></div>
<span>禁用座位</span>
</div>
</div>
<p class="tip">点击座位可切换启用/禁用状态</p>
</div>
</div>
<!-- 座位区域 -->
<div class="seat-area">
<div class="seat-grid" :style="gridStyle">
<div
v-for="seat in seats"
:key="seat.id"
class="seat-item"
:class="{ 'enabled': seat.enable, 'disabled': !seat.enable }"
@click="toggleSeat(seat)"
:title="'第' + seat.rowNumber + '排第' + seat.colNumber + '列'"
>
<div class="seat-svg" v-html="getSeatSvg(seat.enable)"></div>
<div class="seat-label">{{ seat.rowNumber }}-{{ seat.colNumber }}</div>
</div>
</div>
</div>
</div>
</el-dialog>
`,
data() {
return {
dialogVisible: false,
row: {},
seatConfig: {
rows: 8,
cols: 12
},
seats: []
}
},
computed: {
gridStyle() {
return {
'grid-template-columns': 'repeat(' + this.seatConfig.cols + ', 1fr)'
}
}
},
methods: {
onOpen(row) {
this.dialogVisible = true
this.row = row
this.seats = []
this.loadSeats()
},
getSeatSvg(enabled) {
const color = enabled ? '#409eff' : '#dcdfe6'
const strokeColor = enabled ? '#337ecc' : '#c0c4cc'
return '<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">' +
'<!-- 座椅靠背 -->' +
'<rect x="4" y="6" width="24" height="16" rx="2" ry="2" ' +
'fill="' + color + '" stroke="' + strokeColor + '" stroke-width="1"/>' +
'<!-- 座椅坐垫 -->' +
'<rect x="6" y="20" width="20" height="8" rx="2" ry="2" ' +
'fill="' + color + '" stroke="' + strokeColor + '" stroke-width="1"/>' +
'<!-- 扶手 -->' +
'<rect x="2" y="12" width="3" height="12" rx="1" ry="1" ' +
'fill="' + color + '" stroke="' + strokeColor + '" stroke-width="1"/>' +
'<rect x="27" y="12" width="3" height="12" rx="1" ry="1" ' +
'fill="' + color + '" stroke="' + strokeColor + '" stroke-width="1"/>' +
'</svg>'
},
generateSeats() {
this.seats = []
for (let row = 1; row <= this.seatConfig.rows; row++) {
for (let col = 1; col <= this.seatConfig.cols; col++) {
this.seats.push({
id: this.row.id + '_' + row + '_' + col,
hallId: this.row.id,
rowNumber: row.toString(),
colNumber: col.toString(),
enable: true
})
}
}
},
toggleSeat(seat) {
seat.enable = !seat.enable
},
loadSeats() {
// 加载现有座位数据
this.$axios.post('/platform/guildHall/selectSeat', {hallId: this.row.id}).then(res => {
if (res.code === 0 && res.data && res.data.length > 0) {
this.seats = res.data
// 根据现有数据计算行列数
const maxRow = Math.max(...this.seats.map(s => parseInt(s.rowNumber)))
const maxCol = Math.max(...this.seats.map(s => parseInt(s.colNumber)))
this.seatConfig.rows = maxRow
this.seatConfig.cols = maxCol
} else {
// 没有数据时生成默认座位
// this.generateSeats()
}
}).catch(() => {
// this.generateSeats()
})
},
saveSeats() {
this.$confirm('确定要保存座位设置吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$axios.post('/platform/guildHall/saveSeat', {
hallId: this.row.id,
seats: JSON.stringify(this.seats)
}).then(res => {
if (res.code === 0) {
this.$message.success('保存成功')
this.dialogVisible = false
}
})
})
}
},
style: /*language=CSS*/ `
/deep/ .seat-layout {
display: flex;
gap: 20px;
height: 70vh;
}
/deep/ .control-panel {
background: #f8f9fa;
border-radius: 8px;
padding: 16px;
width: 250px;
}
/deep/ .panel-section {
margin-bottom: 24px;
}
/deep/ .panel-section h4 {
margin: 0 0 12px 0;
color: #333;
font-size: 14px;
font-weight: 600;
}
/deep/ .control-group {
display: flex;
align-items: center;
margin-bottom: 12px;
gap: 8px;
}
/deep/ .control-group label {
width: 50px;
font-size: 13px;
color: #666;
}
/deep/ .legend {
margin-bottom: 12px;
}
/deep/ .legend-item {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
font-size: 13px;
color: #666;
}
/deep/ .seat-icon {
width: 32px;
height: 32px;
}
/deep/ .tip {
font-size: 12px;
color: #999;
margin: 0;
line-height: 1.4;
}
/deep/ .seat-area {
flex: 1;
background: #fff;
border: 1px solid #e8e8e8;
border-radius: 8px;
padding: 20px;
overflow: auto;
}
/deep/ .seat-grid {
display: grid;
gap: 8px;
justify-items: center;
max-width: 100%;
}
/deep/ .seat-item {
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
transition: all 0.3s ease;
padding: 4px;
border-radius: 4px;
}
/deep/ .seat-item:hover {
background: rgba(64, 158, 255, 0.1);
transform: scale(1.05);
}
/deep/ .seat-item.disabled:hover {
background: rgba(220, 223, 230, 0.3);
}
/deep/ .seat-svg {
margin-bottom: 2px;
}
/deep/ .seat-label {
font-size: 10px;
color: #666;
text-align: center;
line-height: 1;
}
/deep/ .seat-item.enabled .seat-label {
color: #409eff;
font-weight: 500;
}
/deep/ .seat-item.disabled .seat-label {
color: #c0c4cc;
}
/* 响应式设计 */
@media (max-width: 1200px) {
.seat-layout {
flex-direction: column;
height: auto;
}
.control-panel {
width: 100%;
display: flex;
gap: 20px;
}
.panel-section {
flex: 1;
margin-bottom: 0;
}
}
@media (max-width: 768px) {
.control-panel {
flex-direction: column;
gap: 16px;
}
.seat-grid {
gap: 6px;
}
.seat-item {
padding: 2px;
}
}
`
}
@@ -3,7 +3,7 @@ layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<el-row type="flex" :gutter="10" style="height: calc(100vh - 126px)">
<el-row type="flex" :gutter="10" style="height: calc(100vh - 84px)">
<el-col :span="5">
<tree @node-click="treeNodeClick" ref="treeRef"></tree>
</el-col>
@@ -1,20 +1,22 @@
const TREE_COMPONENT = {
template: `
<el-card shadow="never" style="height: 100%" body-style="{ height: '100%' }">
<el-select v-model="sessionId" :clearable="false" style="width: 100%" @change="listTree">
<el-option v-for="i in sessionOptions" :label="i.fullName" :value="i.id" :key="i.id"></el-option>
</el-select>
template: /*language=HTML*/ `
<el-card shadow="never" style="height: 100%" :body-style="{ height: '100%' }">
<el-select v-model="sessionId" :clearable="false" style="width: 100%" @change="listTree">
<el-option v-for="i in sessionOptions" :label="i.fullName" :value="i.id" :key="i.id"></el-option>
</el-select>
<div style="height: calc(100% - 50px);overflow-y: auto">
<el-tree
:data="treeData"
ref="treeRef"
:expand-on-click-node="false"
:props="{
:data="treeData"
ref="treeRef"
:expand-on-click-node="false"
:props="{
children: 'children',
label: 'name'
}"
default-expand-all
@node-click="treeNodeClick"
:filter-node-method="filterNode"
default-expand-all
@node-click="treeNodeClick"
:filter-node-method="filterNode"
>
<template slot-scope="{ node, data }">
<span class="el-tree-node__label">
@@ -24,8 +26,9 @@ const TREE_COMPONENT = {
</span>
</template>
</el-tree>
</el-card>
`,
</div>
</el-card>
`,
data() {
return {
currentTreeNode: null,
@@ -7,13 +7,13 @@ layout("/layouts/platform.html"){
<search @search="doSearch">
<search-item label="年份">
<el-date-picker
:clearable="false"
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
placeholder="选择年份"
clearable
:clearable="false"
v-model="pageForm.year"
value-format="yyyy"
formData="yyyy"
type="year"
placeholder="选择年份"
clearable
></el-date-picker>
</search-item>
<search-item label="届数">
@@ -32,14 +32,15 @@ layout("/layouts/platform.html"){
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
<el-table-column type="index" width="50" :index="indexMethod" label="序号"></el-table-column>
<el-table-column prop="year" label="年份"></el-table-column>
<el-table-column prop="j" label="届数"></el-table-column>
<el-table-column prop="c" label="次数"></el-table-column>
<el-table-column prop="year" label="年份" sortable></el-table-column>
<el-table-column prop="j" label="届数" sortable></el-table-column>
<el-table-column prop="c" label="次数" sortable></el-table-column>
<el-table-column prop="description" label="描述"></el-table-column>
<el-table-column prop="startDate" label="开启时间"></el-table-column>
<el-table-column prop="enable" label="开启状态">
<template slot-scope="{row}">
<i class="fa fa-circle" :class="row.enable ? 'text-success' : 'text-danger'" style="margin-left: 5px"></i>
<i class="fa fa-circle" :class="row.enable ? 'text-success' : 'text-danger'"
style="margin-left: 5px"></i>
</template>
</el-table-column>
<el-table-column prop="collectStartTime" label="提案征集开始时间"></el-table-column>
@@ -54,17 +55,18 @@ layout("/layouts/platform.html"){
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<el-dialog :title="formData.id ? '编辑':'新增'" :visible.sync="dialogFormVisible" width="60%" :close-on-click-modal="false">
<el-dialog :title="formData.id ? '编辑':'新增'" :visible.sync="dialogFormVisible" width="60%"
:close-on-click-modal="false">
<el-form :model="formData" ref="formRef" size="small" label-width="140px" :rules="formRules">
<el-form-item prop="year" label="年份">
<el-date-picker
style="width: 100%"
:clearable="false"
v-model="formData.year"
value-format="yyyy"
formData="yyyy"
type="year"
placeholder="选择年"
style="width: 100%"
:clearable="false"
v-model="formData.year"
value-format="yyyy"
formData="yyyy"
type="year"
placeholder="选择年"
></el-date-picker>
</el-form-item>
@@ -77,7 +79,8 @@ layout("/layouts/platform.html"){
</el-form-item>
<el-form-item prop="description" label="描述">
<el-input type="textarea" :rows="2" style="width: 100%" placeholder="请输入教代会描述" v-model="formData.description"></el-input>
<el-input type="textarea" :rows="2" style="width: 100%" placeholder="请输入教代会描述"
v-model="formData.description"></el-input>
</el-form-item>
<el-form-item prop="enable" label="状态">
@@ -99,21 +102,21 @@ layout("/layouts/platform.html"){
<el-form-item prop="collectStartTime" label="提案征集开始时间">
<el-date-picker
style="width: 100%"
v-model="formData.collectStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择时间"
style="width: 100%"
v-model="formData.collectStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择时间"
></el-date-picker>
</el-form-item>
<el-form-item prop="collectEndTime" label="提案征集结束时间">
<el-date-picker
style="width: 100%"
v-model="formData.collectEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择时间"
style="width: 100%"
v-model="formData.collectEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择时间"
></el-date-picker>
</el-form-item>
@@ -133,14 +136,14 @@ layout("/layouts/platform.html"){
return {
dialogFormVisible: false,
formRules: {
year: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
j: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
c: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
enable: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
description: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
isExtend: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
collectStartTime: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
collectEndTime: [{ required: true, message: "必填", trigger: ["change", "blur"] }]
year: [{required: true, message: "必填", trigger: ["change", "blur"]}],
j: [{required: true, message: "必填", trigger: ["change", "blur"]}],
c: [{required: true, message: "必填", trigger: ["change", "blur"]}],
enable: [{required: true, message: "必填", trigger: ["change", "blur"]}],
description: [{required: true, message: "必填", trigger: ["change", "blur"]}],
isExtend: [{required: true, message: "必填", trigger: ["change", "blur"]}],
collectStartTime: [{required: true, message: "必填", trigger: ["change", "blur"]}],
collectEndTime: [{required: true, message: "必填", trigger: ["change", "blur"]}]
}
}
},
@@ -153,7 +156,7 @@ layout("/layouts/platform.html"){
},
openEdit(id) {
this.dialogFormVisible = true
this.$axios.post(loc() + "/findOne", { id }).then((res) => {
this.$axios.post(loc() + "/findOne", {id}).then((res) => {
if (res.code === 0) {
res.data.year = res.data.year.toString()
this.formData = res.data
@@ -164,12 +167,15 @@ layout("/layouts/platform.html"){
doSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
const loading = createLoading()
this.$axios.post(loc() + (this.formData.id ? "/update" : "/insert"), this.formData).then((res) => {
if (res.code === 0) {
this.dialogFormVisible = false
this.$message.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
}
})
@@ -181,7 +187,7 @@ layout("/layouts/platform.html"){
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post(loc() + "/delete", { id }).then((res) => {
this.$axios.post(loc() + "/delete", {id}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
@@ -183,7 +183,7 @@ layout("/layouts/platform.html"){
office: [{ required: true, message: '请输入办证机关', trigger: 'blur' }],
honorFiles: [{ required: true, message: '请上传独生子女父母光荣证', trigger: 'change' }],
retireFiles: [{ required: true, message: '请上传退休证', trigger: 'change' }],
sign: [{ required: true, message: '请签字', trigger: 'change' }],
//sign: [{ required: true, message: '请签字', trigger: 'change' }],
declarationAgreed: [{ required: true, message: '请勾选申报理由', trigger: 'change', type: 'enum', enum: [true] }]
},
}
@@ -5,7 +5,7 @@ layout("/layouts/platform.html"){
<guava ref="guava">
<template>
<el-card shadow="never">
<snaker-start slot="header" label="省级互助保障" define_key="SJHZBZ"></snaker-start>
<snaker-start slot="header" label="省级互助保障" define_key="SJHZBZ" ></snaker-start>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="140px" label-position="right"
label-suffix="">
<el-row :gutter="20">
@@ -104,34 +104,105 @@ layout("/layouts/platform.html"){
</el-col>
<el-col :span="12">
<el-form-item prop="medicalInsuranceState" label="医保状态">
<dict-select v-model="formData.medicalInsuranceState" code="USER_MEDICINE" style="width: 100%"></dict-select>
<el-form-item prop="age" label="年龄">
<el-input v-model="formData.age" placeholder="请输入年龄"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="insuranceUserState" label="在职状态">
<el-select clearable placeholder="请选择在职状态"
style="width: 100%;"
v-model="formData.insuranceUserState">
<el-option :label="item.name" :value="item.code" :key="item.code"
v-for="item in dict.type.USER_STATE"></el-option>
<el-form-item prop="planNumber" label="计划书号码">
<el-input v-model="formData.planNumber" placeholder="请输入计划书号码"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="isRenewal" label="是否续保">
<el-select v-model="formData.isRenewal" placeholder="请选择是否续保" style="width: 100%">
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="noDutyTime" label="不在岗时间">
<el-form-item prop="guaranteedStartTime" label="保障开始时间">
<el-date-picker
v-model="formData.noDutyTime"
v-model="formData.guaranteedStartTime"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable
placeholder="请选择保障开始时间"
@change="calculateEndTime">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="guaranteedEndTime" label="保障结束时间">
<el-date-picker
v-model="formData.guaranteedEndTime"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable
placeholder="请选择保障结束时间"
:readonly="true">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="dangerTime" label="出险时间">
<el-date-picker
v-model="formData.dangerTime"
type="datetime"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
clearable
placeholder="请选择不在岗时间">
placeholder="请选择出险时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="dangerAddress" label="出险地点">
<el-input v-model="formData.dangerAddress" placeholder="请输入出险地点"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="address" label="住址">
<el-input v-model="formData.address" placeholder="请输入住址"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="bankUserName" label="开户名">
<el-input v-model="formData.bankUserName" placeholder="请输入开户名"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="bankOfDeposit" label="开户支行">
<el-input v-model="formData.bankOfDeposit" placeholder="请输入开户支行"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="bankCardNumber" label="银行卡账号">
<el-input v-model="formData.bankCardNumber" placeholder="请输入银行卡账号"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="出险原因、经过、结果" prop="content">
<text-editor v-model="formData.dangerEvent"></text-editor>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="sign" label="签字">
<pc-signature v-model="formData.sign"></pc-signature>
@@ -222,6 +293,7 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'nation', user.nation);
this.$set(this.formData, 'birthday', user.birthday);
this.$set(this.formData, 'mobile', user.mobile);
this.$set(this.formData, 'idCard', user.idCard);
} else {
// 替他人申请,清空被帮助人信息
this.$set(this.formData, 'proxyUserId', user.id);
@@ -238,20 +310,11 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'nation', null);
this.$set(this.formData, 'birthday', null);
this.$set(this.formData, 'mobile', null);
// 清空年龄和身份证号
this.$set(this.formData, 'idCard', null);
}
},
// 查询受助人
queryRecipients(key) {
this.$axios.get("/platform/mutualInsurance/apply/queryRecipients", {
params: { key }
}).then(res => {
if (res.code === 0) {
this.subsidizedList = res.data;
}
});
},
// 用户选择变化
async userChange() {
const user = this.subsidizedList.find(item => item.id === this.formData.userId);
@@ -266,6 +329,7 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'unionName', user.unionName);
this.$set(this.formData, 'birthday', user.birthday);
this.$set(this.formData, 'mobile', user.mobile);
this.$set(this.formData, 'idCard', user.idCard);
} else {
this.$set(this.formData, 'userId', null);
this.$set(this.formData, 'userName', null);
@@ -277,11 +341,40 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'unionName', null);
this.$set(this.formData, 'birthday', null);
this.$set(this.formData, 'mobile', null);
this.$set(this.formData, 'idCard', null);
}
},
// 修改 calculateEndTime 方法中的模板字符串部分
calculateEndTime(startDate) {
if (startDate) {
const start = new Date(startDate);
const end = new Date(start);
end.setFullYear(start.getFullYear() + 1);
// 格式化为 yyyy-MM-dd (转义反引号)
const year = end.getFullYear();
const month = String(end.getMonth() + 1).padStart(2, '0');
const day = String(end.getDate()).padStart(2, '0');
this.$set(this.formData, 'guaranteedEndTime', year + '-' + month + '-' + day);
} else {
this.$set(this.formData, 'guaranteedEndTime', null);
}
},
// 查询受助人
queryRecipients(key) {
this.$axios.get("/platform/mutualInsurance/apply/queryRecipients", {
params: { key }
}).then(res => {
if (res.code === 0) {
this.subsidizedList = res.data;
}
});
},
// 保存
onSave() {
this.$confirm("您确定保存吗?", "提示", {
this.$confirm("您确定保存吗?(提交后方可打印)", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
@@ -312,7 +405,7 @@ layout("/layouts/platform.html"){
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
this.$confirm("您确定要提交吗?(需准备证明材料、伤残、入、出院记录、病理报告或交通事故责任认定书等)", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
@@ -327,27 +420,6 @@ layout("/layouts/platform.html"){
})
})
},
// 再次提交
async onFinishTask() {
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/mutualInsurance/apply/submitAgain', {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
commonUtil.pjaxPush('/platform/mutualInsurance/mine/index')
}
})
})
},
onView() {
this.$refs.guava.view(() => {
this.$refs.projectInfoRef.onOpen(this.formData.projectId)
@@ -364,7 +436,7 @@ layout("/layouts/platform.html"){
},
async listProject() {
const currentYear = new Date().getFullYear().toString();
const resp = await $.post('/platform/mutualInsurance/project/listProject', {year: currentYear})
const resp = await $.post('/platform/mutualInsurance/apply/listProject', {year: currentYear})
if (resp.code === 0) {
this.projectList = resp.data
if (resp.data && resp.data.length > 0) {
@@ -62,18 +62,11 @@ layout("/layouts/platform.html"){
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
<el-table-column prop="userName" label="职工姓名"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="age" label="年龄"></el-table-column>
<el-table-column prop="unionName" label="所属工会"></el-table-column>
<el-table-column prop="unitName" label="所属单位"></el-table-column>
<el-table-column prop="insuranceUserState" label="在职状态"></el-table-column>
<el-table-column prop="medicalInsuranceState" label="医保状态"></el-table-column>
<el-table-column prop="projectName" label="所属事项" width="300px"></el-table-column>
<el-table-column prop="applyTime" label="申请时间"></el-table-column>
<el-table-column prop="taskName" label="当前节点"></el-table-column>·
<el-table-column prop="instanceState" label="流程状态">
<template slot-scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
@@ -160,7 +153,7 @@ layout("/layouts/platform.html"){
}
try {
// 修改为互助保障项目的查询接口
const res = await this.$axios.post("/platform/mutualInsurance/project/listProject", {
const res = await this.$axios.post("/platform/mutualInsurance/apply/listProject", {
year: this.pageForm.year
});
if (res.code === 0) {
@@ -11,65 +11,36 @@ const userInfo = {
<el-descriptions-item label="申请模式">{{ viewData.mode}}</el-descriptions-item>
<el-descriptions-item label="填写人姓名">{{ viewData.proxyUserName }}</el-descriptions-item>
<el-descriptions-item label="填写人工号">{{ viewData.proxyLoginName }}</el-descriptions-item>
<el-descriptions-item label="姓名">{{viewData.userName}}</el-descriptions-item>
<el-descriptions-item label="申请人">{{viewData.userName}}</el-descriptions-item>
<el-descriptions-item label="工号">{{viewData.loginName}}</el-descriptions-item>
<el-descriptions-item label="所属单位">{{viewData.unitName}}</el-descriptions-item>
<el-descriptions-item label="所属工会">{{viewData.unionName}}</el-descriptions-item>
<el-descriptions-item label="性别">{{viewData.sex}}</el-descriptions-item>
<el-descriptions-item label="手机号">{{viewData.mobile}}</el-descriptions-item>
<el-descriptions-item label="身份证号">{{viewData.idCard}}</el-descriptions-item>
<el-descriptions-item label="医保状态" >{{viewData.medicalInsuranceState}}</el-descriptions-item>
<el-descriptions-item label="在职状态">{{viewData.insuranceUserState}}</el-descriptions-item>
<el-descriptions-item label="不在岗时间">{{viewData.noDutyTime}}</el-descriptions-item>
<el-descriptions-item label="年龄">{{viewData.age}}</el-descriptions-item>
<el-descriptions-item label="计划书号码">{{viewData.planNumber}}</el-descriptions-item>
<el-descriptions-item label="是否续保">{{viewData.isRenewal}}</el-descriptions-item>
<el-descriptions-item label="保障开始时间">{{viewData.guaranteedStartTime}}</el-descriptions-item>
<el-descriptions-item label="保障结束时间">{{viewData.guaranteedEndTime}}</el-descriptions-item>
<el-descriptions-item label="出险时间">{{viewData.dangerTime}}</el-descriptions-item>
<el-descriptions-item label="出险地点">{{viewData.dangerAddress}}</el-descriptions-item>
<el-descriptions-item label="住址">{{viewData.address}}</el-descriptions-item>
<el-descriptions-item label="开户名">{{viewData.bankUserName}}</el-descriptions-item>
<el-descriptions-item label="开户支行">{{viewData.bankOfDeposit}}</el-descriptions-item>
<el-descriptions-item label="银行卡账号" >{{viewData.bankCardNumber}}</el-descriptions-item>
<el-descriptions-item label="赔付金额" :span="2">{{viewData.amount}}</el-descriptions-item>
<el-descriptions-item label="出险原因、经过、结果" :span="2">{{viewData.dangerEvent}}</el-descriptions-item>
<el-descriptions-item label="签字" >
<el-image v-if="viewData.sign"
:src="viewData.sign"
class="signature-image"
style="height: 60px"
style="height: 60px"
></el-image>
<span v-else>暂无</span>
</el-descriptions-item>
</el-descriptions>
<template v-for="task in doneTasks">
<div class="mt10">
<div class="process-title">{{ task.displayName }}</div>
<el-descriptions border class="flow-task-form" :column="3" :key="task.id"
v-if="task.ext.isFirstTaskNode">
<el-descriptions-item label="申请用户">{{ task.ext.initiatorName
}}({{task.ext.initiatorAccount}})
</el-descriptions-item>
<el-descriptions-item label="申请时间">{{ task.finishTime }}</el-descriptions-item>
<el-descriptions-item label="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</el-descriptions-item>
</el-descriptions>
<el-descriptions border class="flow-task-form" :column="3" :key="task.id" v-else>
<el-descriptions-item label="办理用户">{{ task.taskFormData.userName
}}({{task.taskFormData.loginName}})
</el-descriptions-item>
<el-descriptions-item label="办理时间">{{ task.finishTime }}</el-descriptions-item>
<el-descriptions-item label="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</el-descriptions-item>
<el-descriptions-item label="办理意见" :span="3" v-if="!task.ext.isFirstTaskNode">{{
task.taskFormData.opinion }}
</el-descriptions-item>
<el-descriptions-item label="签字" :span="3" v-if="!task.ext.isFirstTaskNode">
<el-image :src="task.ext.tf_userSign"
v-if="task.ext.tf_userSign"
class="signature-image"
style="height: 60px"
></el-image>
<span v-else>暂无</span>
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<slot></slot>
<snaker-chart ref="snakerChartRef"></snaker-chart>
</div>
`,
@@ -98,6 +69,17 @@ const userInfo = {
this.$axios.post('/platform/mutualInsurance/apply/findOne', {id: this.row.id}).then((res) => {
if (res.code === 0) {
this.viewData = res.data
// 格式化日期只显示年月日
if (this.viewData.guaranteedStartTime) {
this.viewData.guaranteedStartTime = this.viewData.guaranteedStartTime.substring(0, 10);
}
if (this.viewData.guaranteedEndTime) {
this.viewData.guaranteedEndTime = this.viewData.guaranteedEndTime.substring(0, 10);
}
// 去除 dangerEvent 字段的 <p> 标签
if (this.viewData.dangerEvent) {
this.viewData.dangerEvent = this.viewData.dangerEvent.replace(/^<p>/, '').replace(/<\/p>$/, '');
}
}
})
},
@@ -17,25 +17,17 @@ layout("/layouts/platform.html"){
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
<el-table-column prop="userName" label="职工姓名"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="age" label="年龄"></el-table-column>
<el-table-column prop="unionName" label="所属工会"></el-table-column>
<el-table-column prop="unitName" label="所属单位"></el-table-column>
<el-table-column prop="insuranceUserState" label="在职状态"></el-table-column>
<el-table-column prop="medicalInsuranceState" label="医保状态"></el-table-column>
<el-table-column prop="projectName" label="所属事项" width="300px"></el-table-column>
<el-table-column prop="applyTime" label="申请时间"></el-table-column>
<el-table-column prop="taskName" label="当前节点"></el-table-column>·
<el-table-column prop="instanceState" label="流程状态">
<template slot-scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
<el-button @click="onEdit(row)" size="mini" type="primary" v-if="row.isSubmit =='未提交'">编辑</el-button>
<el-button @click="onDelete(row.id)" size="mini" type="danger" >删除</el-button>
<el-button @click="doExportApply(row)" size="mini" type="primary" v-if="row.isSubmit =='已提交'">申请表导出</el-button>
</template>
</el-table-column>
</el-table>
@@ -68,6 +60,10 @@ layout("/layouts/platform.html"){
}
,
methods: {
// 导出示例
doExportApply(row){
this.$downLoad('/platform/mutualInsurance/mine/doExportApply?id=' + row.id)
},
onView(row) {
this.$refs.guava.view(()=>{
this.$refs.userInfoInfoRef.onOpen(row)
@@ -202,7 +202,7 @@ layout("/layouts/platform.html"){
}
try {
// 修改为互助保障项目的查询接口
const res = await this.$axios.post("/platform/mutualInsurance/project/listProject", {
const res = await this.$axios.post("/platform/mutualInsurance/apply/listProject", {
year: this.pageForm.year
});
if (res.code === 0) {
@@ -202,7 +202,7 @@ layout("/layouts/platform.html"){
}
try {
// 修改为互助保障项目的查询接口
const res = await this.$axios.post("/platform/mutualInsurance/project/listProject", {
const res = await this.$axios.post("/platform/mutualInsurance/apply/listProject", {
year: this.pageForm.year
});
if (res.code === 0) {
@@ -202,7 +202,7 @@ layout("/layouts/platform.html"){
}
try {
// 修改为互助保障项目的查询接口
const res = await this.$axios.post("/platform/mutualInsurance/project/listProject", {
const res = await this.$axios.post("/platform/mutualInsurance/apply/listProject", {
year: this.pageForm.year
});
if (res.code === 0) {
@@ -73,18 +73,51 @@ layout("/layouts/platform_h5.html"){
</van-cell-group>
<van-cell-group title="假期类型" class="form-section">
<van-field label="陪产假" v-model="formData.withLeave" placeholder="请输入天数" type="number"
<van-field label="陪产假" v-model="formData.withLeave" readonly type="number"
v-if="isMale" required></van-field>
<van-field label="育儿假" v-model="formData.parentalLeave" placeholder="请输入天数" type="number"
<van-field label="育儿假" v-model="formData.parentalLeave" readonly type="number"
v-if="isMale" required></van-field>
<van-field label="产假" v-model="formData.maternityLeave" placeholder="请输入天数" type="number"
v-if="isFemale" required></van-field>
<van-field label="延长假" v-model="formData.extendLeave" placeholder="请输入天数" type="number"
v-if="isFemale" required></van-field>
<van-field label="多胞胎" v-model="formData.birthsLeave" placeholder="请输入天数" type="number"
v-if="isFemale" required></van-field>
<van-field label="难产假" v-model="formData.difficultLeave" placeholder="请输入天数" type="number"
v-if="isFemale" required></van-field>
<!-- 替换原有的多胞胎和难产假输入框 -->
<van-field
v-if="isFemale"
label="多胞胎"
v-model="formData.birthsLeave"
readonly
placeholder="请选择天数"
@click="showBirthsLeavePicker = true"
clickable
></van-field>
<van-popup position="bottom" round v-model:show="showBirthsLeavePicker">
<van-picker
:columns="[{value: 15, text: '15天'}]"
@cancel="showBirthsLeavePicker = false"
@confirm="onBirthsLeaveConfirm"
show-toolbar
></van-picker>
</van-popup>
<van-field
v-if="isFemale"
label="难产假"
v-model="formData.difficultLeave"
readonly
placeholder="请选择天数"
@click="showDifficultLeavePicker = true"
clickable
></van-field>
<van-popup position="bottom" round v-model:show="showDifficultLeavePicker">
<van-picker
:columns="[{value: 15, text: '15天'}]"
@cancel="showDifficultLeavePicker = false"
@confirm="onDifficultLeaveConfirm"
show-toolbar
></van-picker>
</van-popup>
<van-field label="寒假" v-model="formData.winterLeave" placeholder="请输入天数"
type="number" ></van-field>
<van-field label="暑假" v-model="formData.summerLeave" placeholder="请输入天数"
@@ -180,6 +213,8 @@ layout("/layouts/platform_h5.html"){
showStartTimePicker: false,
showEndTimePicker: false,
showChildrenBirthdayPicker: false,
showBirthsLeavePicker: false,
showDifficultLeavePicker: false,
minDate: new Date(1950, 0, 1), // 设置最小日期为1950年1月1日
maxDate: new Date(2040, 12, 31), // 设置最大日期为2040年12月31日
// 表单验证规则
@@ -193,8 +228,6 @@ layout("/layouts/platform_h5.html"){
parentalLeave: [{ required: true, message: '请输入育儿假天数' }],
maternityLeave: [{ required: true, message: '请输入产假天数' }],
extendLeave: [{ required: true, message: '请输入延长假天数' }],
birthsLeave: [{ required: true, message: '请输入多胞胎天数' }],
difficultLeave: [{ required: true, message: '请输入难产假天数' }],
startTime: [{ required: true, message: '请选择休假开始时间' }],
endTime: [{ required: true, message: '请选择休假结束时间' }],
childrenBirthday: [{ required: true, message: '请选择子女出生日期' }]
@@ -370,12 +403,6 @@ layout("/layouts/platform_h5.html"){
if (!this.formData.extendLeave && this.formData.extendLeave !== 0) {
errors.push('请输入延长假天数');
}
if (!this.formData.birthsLeave && this.formData.birthsLeave !== 0) {
errors.push('请输入多胞胎天数');
}
if (!this.formData.difficultLeave && this.formData.difficultLeave !== 0) {
errors.push('请输入难产假天数');
}
}
if (!this.formData.startTime) {
@@ -467,6 +494,16 @@ layout("/layouts/platform_h5.html"){
this.showChildrenBirthdayPicker = false;
},
onBirthsLeaveConfirm(value) {
this.$set(this.formData, "birthsLeave", value.value);
this.showBirthsLeavePicker = false;
},
onDifficultLeaveConfirm(value) {
this.$set(this.formData, "difficultLeave", value.value);
this.showDifficultLeavePicker = false;
},
onLoverNationConfirm(o) {
this.$set(this.formData, "loverNationName", o.text); // 显示名称
this.$set(this.formData, "loverNation", o.value); // 字典值
+39
View File
@@ -3,6 +3,7 @@ package com.budwk.app;
import cn.hutool.core.lang.Dict;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.engine.model.*;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
import org.junit.Test;
@@ -14,6 +15,7 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.List;
import java.util.Set;
@IocBean
@RunWith(NbJUnit4Runner.class)
@@ -52,4 +54,41 @@ public class FlowTest {
}
public static void findForkTaskNames(NodeModel node, StringBuilder buffer, Set<String> visitedNodes) {
if (node == null) return;
// 防止循环引用
String nodeId = node.getName();
if (visitedNodes.contains(nodeId)) return;
visitedNodes.add(nodeId);
// 如果遇到fork节点,停止递归
if (node instanceof ForkModel) return;
List<TransitionModel> inputs = node.getInputs();
for (TransitionModel tm : inputs) {
NodeModel source = tm.getSource();
if (source instanceof TaskModel) {
String taskName = source.getName();
// 避免重复添加
if (!buffer.toString().contains(taskName)) {
if (buffer.length() > 0) buffer.append(",");
buffer.append(taskName);
}
}
// 递归处理上游节点
findForkTaskNames(source, buffer, visitedNodes);
}
}
@Test
public void testForkJoin() {
JoinModel joinModel = new JoinModel();
}
}