commit
This commit is contained in:
+21
-29
@@ -2,15 +2,13 @@ package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
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.democratic.proposal.models.ProposalMerge;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalCommitteeFilingService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -18,14 +16,12 @@ 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;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
@@ -40,12 +36,8 @@ import java.util.List;
|
||||
@Api(tags = "提案委员会立案审核")
|
||||
public class ProposalCommitteeFilingController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ProposalCommitteeFilingService proposalCommitteeFilingService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
|
||||
@At("")
|
||||
@@ -112,33 +104,33 @@ public class ProposalCommitteeFilingController {
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFiling")
|
||||
@ApiOperation("执行任务")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result executeTask(@Param("data") String data) {
|
||||
Dict args = Json.fromJson(Dict.class, data);
|
||||
proposalCommitteeFilingService.executeTask(args);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFiling")
|
||||
@ApiOperation("并案审核")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result merge(@Param("data") String data) {
|
||||
Dict args = Json.fromJson(Dict.class, data);
|
||||
proposalCommitteeFilingService.merge(args);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
List<Integer> taskIds = (List<Integer>) args.get("processTaskIds");
|
||||
List<String> proposalIds = (List<String>) args.get("proposalIds");
|
||||
|
||||
// 记录提案并案
|
||||
dao.clear(ProposalMerge.class, Cnd.where(ProposalMerge::getProposalId, "in", proposalIds));
|
||||
String groupId = R.UU32();
|
||||
List<ProposalMerge> merges = proposalIds.stream().map(proposalId -> {
|
||||
ProposalMerge merge = new ProposalMerge();
|
||||
merge.setProposalId(proposalId);
|
||||
merge.setGroupId(groupId);
|
||||
return merge;
|
||||
}).toList();
|
||||
dao.insert(merges);
|
||||
|
||||
for (Integer taskId : taskIds) {
|
||||
Dict taskArgs = args.clone();
|
||||
taskArgs.put(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
flowCommonService.executeTask(taskArgs);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFiling")
|
||||
@ApiOperation("撤回")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "提案委员会立案审核", msg = "委员会立案撤回")
|
||||
public Result revoke(@Param("taskId") @Valid Long taskId) {
|
||||
proposalCommitteeFilingService.revoke(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
-58
@@ -46,8 +46,6 @@ public class ProposalCommitteeFilingUnitController {
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private ProposalCommitteeFilingUnitService proposalCommitteeFilingUnitService;
|
||||
|
||||
@At("")
|
||||
@@ -119,62 +117,6 @@ public class ProposalCommitteeFilingUnitController {
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFilingUnit")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "委员会确认承办单位", msg = "委员会确认承办单位")
|
||||
@ApiOperation("委员会确认承办单位")
|
||||
public Result approval(@Valid @Param("approval") ProposalCommitteeFilingUnitApprovalParam approvalParam) {
|
||||
proposalCommitteeFilingUnitService.approval(approvalParam);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFilingUnit")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "委员会确认承办单位", msg = "委员会确认承办单位撤回")
|
||||
public Result revoke(@Valid String taskId) {
|
||||
proposalCommitteeFilingUnitService.revoke(taskId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFilingUnit")
|
||||
@ApiOperation("查询立案的结果及承办单位")
|
||||
public Result committeeFiling(@Valid String processInstanceId, @Valid String processInstanceTaskId) {
|
||||
JSONObject newJson = new JSONObject();
|
||||
|
||||
BpmProcessTask caseUnitTask = proposalCommitteeFilingUnitService.dao().fetch(BpmProcessTask.class,
|
||||
Cnd.where(BpmProcessTask::getId, "=", processInstanceTaskId)
|
||||
.and(BpmProcessTask::getProcessInstanceId, "=", processInstanceId)
|
||||
.and(BpmProcessTask::getProcessTaskNodeCode, "=", 70)
|
||||
.and(BpmProcessTask::getDelFlag, "=", 0)
|
||||
);
|
||||
if (ObjectUtil.isNotNull(caseUnitTask) && ObjectUtil.isNotEmpty(caseUnitTask.getExtVariable())) {
|
||||
JSONObject jsonObject = caseUnitTask.getExtVariable();
|
||||
newJson.set("caseFilingResult", jsonObject.get("caseFilingResult"));
|
||||
newJson.set("hostUnitId", jsonObject.get("hostUnitId"));
|
||||
newJson.set("helpUnitIds", jsonObject.getBeanList("helpUnitIds", String.class));
|
||||
newJson.set("approvalOpinion", jsonObject.get("approvalOpinion"));
|
||||
newJson.set("consolidationIds", jsonObject.getBeanList("consolidationIds", String.class));
|
||||
return Result.success(newJson);
|
||||
}
|
||||
|
||||
BpmProcessTask caseTask = proposalCommitteeFilingUnitService.dao().fetch(BpmProcessTask.class,
|
||||
Cnd.where(BpmProcessTask::getProcessInstanceId, "=", processInstanceId)
|
||||
.and(BpmProcessTask::getDelFlag, "=", 0)
|
||||
.and(BpmProcessTask::getProcessTaskNodeCode, "=", 60)
|
||||
.desc(BpmProcessTask::getCreatedOn)
|
||||
);
|
||||
JSONObject jsonObject = caseTask.getExtVariable();
|
||||
newJson.set("caseFilingResult", jsonObject.get("caseFilingResult"));
|
||||
newJson.set("hostUnitId", jsonObject.get("hostUnitId"));
|
||||
newJson.set("helpUnitIds", jsonObject.getBeanList("helpUnitIds", String.class));
|
||||
newJson.set("approvalOpinion", jsonObject.get("approvalOpinion"));
|
||||
newJson.set("consolidationIds", jsonObject.getBeanList("consolidationIds", String.class));
|
||||
return Result.success(newJson);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFilingUnit")
|
||||
@ApiOperation("查询承办单位")
|
||||
|
||||
+1
@@ -104,6 +104,7 @@ public class ProposalSchoolLeaderApprovalController {
|
||||
LEFT JOIN proposal_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN proposal_merge mer ON mer.proposalId = info.id
|
||||
LEFT JOIN proposal_reply_unit pru ON pru.proposalId = info.id
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 校工会意见
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/proposal/schoolOpinion")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "提案-办理-校工会意见")
|
||||
public class ProposalSchoolOpinionController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/schoolOpinion/index.html")
|
||||
@SaCheckPermission("proposal.schoolOpinion")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/schoolOpinion/index.html")
|
||||
@SaCheckPermission("h5.proposal.schoolOpinion")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"proposal.schoolOpinion", "h5.proposal.schoolOpinion"}, mode = SaMode.OR)
|
||||
@ApiOperation("分页列表")
|
||||
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
LEFT JOIN proposal_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "school_opinion");
|
||||
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class ProposalMasterUnitAssignmentHandler implements AssignmentHandler {
|
||||
ProposalReplyUnit masterUnit = dao.fetch(ProposalReplyUnit.class, Cnd.where(ProposalReplyUnit::getProposalId, "=", proposalId)
|
||||
.and(ProposalReplyUnit::getIsMaster, "=", 1));
|
||||
if (masterUnit == null) {
|
||||
throw new BaseException("系统异常");
|
||||
throw new BaseException("提案主办单位错误");
|
||||
}
|
||||
masterUnitId = masterUnit.getUnitId();
|
||||
}
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.handler;
|
||||
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.flow.engine.AssignmentHandler;
|
||||
import com.budwk.app.flow.engine.core.Execution;
|
||||
import com.budwk.app.flow.engine.core.ServiceContext;
|
||||
import com.budwk.app.flow.engine.model.TaskModel;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 提案主管校领导处理人
|
||||
*/
|
||||
public class ProposalSchoolLeaderAssignmentHandler implements AssignmentHandler {
|
||||
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
CommonService commonService = ServiceContext.find(CommonService.class);
|
||||
List<Sys_user> users = commonService.findUserInfoByRoleCode(RoleConstant.PROPOSAL_BRANCH_SCHOOL_LEADER.name());
|
||||
|
||||
if(Lang.isEmpty(users)) {
|
||||
throw new BaseException("未查询到相关审批人");
|
||||
}
|
||||
|
||||
return users.stream().map(Sys_user::getId).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "获取提案主管校领导";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 220;
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -39,7 +39,7 @@ public class ProposalCaseFilingInterceptor implements FlowInterceptor {
|
||||
// 提案ID
|
||||
String proposalId = execution.getProcessInstance().getBusinessNo();
|
||||
|
||||
// 立案结果
|
||||
/* // 立案结果
|
||||
String caseFilingResult = execution.getArgs().getStr(FlowConst.TASK_FORM_DATA_PREFIX + "caseFilingResult");
|
||||
|
||||
// 储存承办单位
|
||||
@@ -80,7 +80,8 @@ public class ProposalCaseFilingInterceptor implements FlowInterceptor {
|
||||
|
||||
Chain chain = Chain.make("caseFilingResult", execution.getArgs().getStr(FlowConst.TASK_FORM_DATA_PREFIX + "caseFilingResult"));
|
||||
chain.add("caseFilingType", execution.getArgs().getStr(FlowConst.TASK_FORM_DATA_PREFIX + "caseFilingType"));
|
||||
dao.update(ProposalInfo.class, chain, Cnd.where(ProposalInfo::getId, "=", businessNo));
|
||||
dao.update(ProposalInfo.class, chain, Cnd.where(ProposalInfo::getId, "=", businessNo));*/
|
||||
|
||||
|
||||
|
||||
// 当前任务
|
||||
|
||||
+23
-3
@@ -1,12 +1,32 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.service;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalCommitteeFilingApprovalParam;
|
||||
|
||||
public interface ProposalCommitteeFilingService extends BaseService<ProposalInfo> {
|
||||
|
||||
void approval(ProposalCommitteeFilingApprovalParam approvalParam);
|
||||
/**
|
||||
* 单条委员会立案审核。
|
||||
* 执行工作流的同时,同步维护提案立案结果和承办单位业务数据。
|
||||
*
|
||||
* @param args 审核表单及流程参数
|
||||
*/
|
||||
void executeTask(Dict args);
|
||||
|
||||
void revoke(String taskId);
|
||||
/**
|
||||
* 并案委员会立案审核。
|
||||
* 同组提案需要共用同一套审核参数,并在执行工作流后分别落库业务表数据。
|
||||
*
|
||||
* @param args 并案审核表单及流程参数
|
||||
*/
|
||||
void merge(Dict args);
|
||||
|
||||
/**
|
||||
* 委员会立案审核撤回。
|
||||
* 并案审核场景下需要同步撤回同组提案在当前环节已审核的内容,避免只撤回当前列表中的单条数据。
|
||||
*
|
||||
* @param taskId 当前列表行的流程任务ID
|
||||
*/
|
||||
void revoke(Long taskId);
|
||||
}
|
||||
|
||||
-3
@@ -6,7 +6,4 @@ import com.budwk.app.zhgh.democratic.proposal.param.ProposalCommitteeFilingUnitA
|
||||
|
||||
public interface ProposalCommitteeFilingUnitService extends BaseService<ProposalInfo> {
|
||||
|
||||
void approval(ProposalCommitteeFilingUnitApprovalParam approvalParam);
|
||||
|
||||
void revoke(String taskId);
|
||||
}
|
||||
|
||||
+170
-153
@@ -1,196 +1,213 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.bpm.dto.BpmAssignmentDto;
|
||||
import com.budwk.app.bpm.enums.BpmTaskApprovalTypeEnum;
|
||||
import com.budwk.app.bpm.models.BpmProcessInstance;
|
||||
import com.budwk.app.bpm.models.BpmProcessTask;
|
||||
import com.budwk.app.bpm.service.BpmService;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysMsgService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalConsolidation;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.event.ProcessEvent;
|
||||
import com.budwk.app.flow.engine.event.ProcessPublisher;
|
||||
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.ProcessInstanceStateEnum;
|
||||
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.todo.service.TodoService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalMerge;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalReplyUnit;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalCommitteeFilingApprovalParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalCommitteeFilingService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.random.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ProposalCommitteeFilingServiceImpl extends BaseServiceImpl<ProposalInfo> implements ProposalCommitteeFilingService {
|
||||
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
@Inject
|
||||
private SysMsgService sysMsgService;
|
||||
private TodoService todoService;
|
||||
|
||||
public ProposalCommitteeFilingServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void approval(ProposalCommitteeFilingApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
variables.put("proposalIds", approvalParam.getProposalIds());
|
||||
variables.put("hostUnitId", approvalParam.getHostUnitId());
|
||||
variables.put("helpUnitIds", approvalParam.getHelpUnitIds());
|
||||
variables.put("caseFilingResult", approvalParam.getCaseFilingResult());
|
||||
variables.put("consolidationIds", approvalParam.getProposalIds());
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void executeTask(Dict args) {
|
||||
Long processTaskId = args.getLong(FlowConst.PROCESS_TASK_ID_KEY);
|
||||
flowCommonService.executeTask(args);
|
||||
saveCommitteeFilingBusinessData(processTaskId, args);
|
||||
}
|
||||
|
||||
ProposalUndertake hostUnit = null;
|
||||
List<ProposalUndertake> helpUnits = null;
|
||||
//承办单位答复人初步阅览
|
||||
List<BpmAssignmentDto> nextApprovals = new ArrayList<>();
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void merge(Dict args) {
|
||||
List<Integer> taskIds = (List<Integer>) args.get("processTaskIds");
|
||||
List<String> proposalIds = (List<String>) args.get("proposalIds");
|
||||
|
||||
if (approvalParam.getBpmTaskApprovalTypeEnum().equals(BpmTaskApprovalTypeEnum.DYNAMIC)) {
|
||||
if (List.of("CONFIRM_FILING", "SUGGESTION").contains(approvalParam.getCaseFilingResult())) {
|
||||
hostUnit = dao().fetch(ProposalUndertake.class, approvalParam.getHostUnitId());
|
||||
helpUnits = dao().query(ProposalUndertake.class, Cnd.where(ProposalUndertake::getId, "in", approvalParam.getHelpUnitIds()));
|
||||
variables.put("hostUnit", hostUnit.getName());
|
||||
variables.put("helpUnits", helpUnits.stream().map(ProposalUndertake::getName).toArray(String[]::new));
|
||||
// 并案审核前先重建并案关系,保证后续同组提案的联动处理基于最新分组数据。
|
||||
dao().clear(ProposalMerge.class, Cnd.where(ProposalMerge::getProposalId, "in", proposalIds));
|
||||
String groupId = R.UU32();
|
||||
List<ProposalMerge> merges = proposalIds.stream().map(proposalId -> {
|
||||
ProposalMerge merge = new ProposalMerge();
|
||||
merge.setProposalId(proposalId);
|
||||
merge.setGroupId(groupId);
|
||||
return merge;
|
||||
}).toList();
|
||||
dao().insert(merges);
|
||||
|
||||
List<JSONObject> units = new ArrayList<>();
|
||||
units.add(new JSONObject()
|
||||
.set("isMaster",true)
|
||||
.set("underTakeId", hostUnit.getId())
|
||||
.set("underTakeName", hostUnit.getName())
|
||||
.set("underTakeCode", hostUnit.getCode())
|
||||
);
|
||||
|
||||
if(ObjectUtil.isNotEmpty(helpUnits)){
|
||||
for (ProposalUndertake helpUnit : helpUnits) {
|
||||
units.add(new JSONObject()
|
||||
.set("isMaster",false)
|
||||
.set("underTakeId", helpUnit.getId())
|
||||
.set("underTakeName", helpUnit.getName())
|
||||
.set("underTakeCode", helpUnit.getCode())
|
||||
);
|
||||
}
|
||||
}
|
||||
variables.put("units",units);
|
||||
}
|
||||
|
||||
//并案审核
|
||||
if (approvalParam.getProposalIds().length > 1) {
|
||||
ProposalConsolidation proposalConsolidation = new ProposalConsolidation();
|
||||
proposalConsolidation.setConsolidationIds(Arrays.asList(approvalParam.getProposalIds()));
|
||||
dao().insert(proposalConsolidation);
|
||||
}
|
||||
|
||||
//立案和作为意见会有承办单位
|
||||
if (approvalParam.getCaseFilingResult().equals("CONFIRM_FILING") || approvalParam.getCaseFilingResult().equals("SUGGESTION")) {
|
||||
List<ProposalUndertake> units = new ArrayList<>();
|
||||
units.add(hostUnit);
|
||||
if (ObjectUtil.isNotNull(helpUnits)) {
|
||||
units.addAll(helpUnits);
|
||||
}
|
||||
for (ProposalUndertake unit : units) {
|
||||
String approvalLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.PROPOSAL_UNIT_LEADER, Cnd.where(Sys_user_role::getUnderTakeId, "=", unit.getId()));
|
||||
if (StrUtil.isBlank(approvalLoginName)) {
|
||||
throw new BaseException("{}答复人没有配置,请到承办单位管理页面设置!", unit.getName());
|
||||
}
|
||||
|
||||
assert hostUnit != null;
|
||||
nextApprovals.add(new BpmAssignmentDto()
|
||||
.setLoginName(approvalLoginName)
|
||||
.setJsonObject(new JSONObject()
|
||||
.set("isMaster", hostUnit.getId().equals(unit.getId()))
|
||||
.set("underTakeId", unit.getId())
|
||||
.set("underTakeName", unit.getName())
|
||||
.set("underTakeCode", unit.getCode())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//下一个审批人
|
||||
String nextApprovalLoginName = proposalCommonService.getCommitteeDirectorByProposalId(approvalParam.getProcessInstanceBusinessId());
|
||||
|
||||
//提交并案
|
||||
for (String consolidationProposalId : approvalParam.getProposalIds()) {
|
||||
BpmProcessInstance instance = dao().fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", consolidationProposalId));
|
||||
// bpmService.completeTaskWithNextTaskVariable(instance.getProcessInstanceTaskIds().get(0), approvalParam.getBpmTaskApprovalTypeEnum(), variables, nextApprovals);
|
||||
bpmService.completeTask(instance.getProcessInstanceTaskIds().get(0), approvalParam.getBpmTaskApprovalTypeEnum(), variables, List.of(nextApprovalLoginName));
|
||||
}
|
||||
|
||||
//修改提案立案结果
|
||||
dao().update(ProposalInfo.class, Chain.make("caseFilingResult", approvalParam.getCaseFilingResult()), Cnd.where(ProposalInfo::getId, "in", approvalParam.getProposalIds()));
|
||||
|
||||
List<ProposalInfo> proposalInfos = dao().query(ProposalInfo.class, Cnd.where(ProposalInfo::getId, "in", approvalParam.getProposalIds()));
|
||||
for (ProposalInfo proposalInfo : proposalInfos) {
|
||||
//给代表发送消息
|
||||
if("CONFIRM_FILING".equals(approvalParam.getCaseFilingResult())){
|
||||
String template = "{}代表您好!您的提案《{}》提案委员会已立案审核,审核结果为准予立案,您可登陆智慧校园下的暖心工会查看详情。";
|
||||
String content = StrUtil.format(template, proposalInfo.getCreateUserName(), proposalInfo.getName());
|
||||
sysMsgService.sendMsg(proposalInfo.getCreateUserLoginName(), "提案委员会立案审核", content, SecurityUtil.getUserId());
|
||||
}else if("SUGGESTION".equals(approvalParam.getCaseFilingResult())){
|
||||
|
||||
}else if("NOT".equals(approvalParam.getCaseFilingResult())){
|
||||
String template = "{}代表您好!您的提案《{}》提案委员会已立案审核,审核结果为不予立案,您可登陆智慧校园下的暖心工会查看详情。";
|
||||
String content = StrUtil.format(template, proposalInfo.getCreateUserName(), proposalInfo.getName());
|
||||
sysMsgService.sendMsg(proposalInfo.getCreateUserLoginName(), "提案委员会立案审核", content, SecurityUtil.getUserId());
|
||||
}
|
||||
|
||||
//给承办单位发送消息
|
||||
if("CONFIRM_FILING".equals(approvalParam.getCaseFilingResult())){
|
||||
for (BpmAssignmentDto nextApproval : nextApprovals) {
|
||||
String template = "经提案委员会立案审核,提案《{}》由{}作为{}单位,您可登陆智慧校园下的暖心工会查看详情,感谢您对教代会提案工作的大力支持!。";
|
||||
String underTakeName = nextApproval.getJsonObject().getStr("underTakeName");
|
||||
Boolean isMaster = nextApproval.getJsonObject().getBool("isMaster", false);
|
||||
String content = StrUtil.format(template, proposalInfo.getName(), underTakeName,isMaster?"主办":"协办");
|
||||
sysMsgService.sendMsg(nextApproval.getLoginName(), "承办单位初步意见", content, SecurityUtil.getUserId());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Integer taskId : taskIds) {
|
||||
Dict taskArgs = args.clone();
|
||||
taskArgs.put(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
executeTask(taskArgs);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void revoke(String taskId) {
|
||||
BpmProcessTask task = dao().fetch(BpmProcessTask.class, taskId);
|
||||
String instanceId = task.getProcessInstanceId();
|
||||
BpmProcessInstance instance = dao().fetch(BpmProcessInstance.class, instanceId);
|
||||
String instanceBusinessId = instance.getProcessInstanceBusinessId();
|
||||
List<String> consolidationIds = proposalCommonService.getConsolidation(instanceBusinessId);
|
||||
for (String consolidationId : consolidationIds) {
|
||||
BpmProcessInstance consolidationProposalInstance = dao().fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", consolidationId));
|
||||
if (ObjectUtil.isNotEmpty(consolidationProposalInstance.getProcessInstanceTaskIds())) {
|
||||
//还有待处理的任务 那么走的就是确定立案
|
||||
String activeTaskId = consolidationProposalInstance.getProcessInstanceTaskIds().get(0);
|
||||
BpmProcessTask activeTask = dao().fetch(BpmProcessTask.class, Cnd.where(BpmProcessTask::getId, "=", activeTaskId));
|
||||
bpmService.revokeTask(activeTask.getPrevTaskId());
|
||||
}else{
|
||||
//不予立案后撤回
|
||||
bpmService.revokeTask(taskId);
|
||||
public void revoke(Long taskId) {
|
||||
ProcessTask currentTask = dao().fetch(ProcessTask.class, taskId);
|
||||
ProcessInstance currentInstance = dao().fetch(ProcessInstance.class, currentTask.getProcessInstanceId());
|
||||
|
||||
// 并案审核撤回时,需要把同组提案在委员会立案环节已审核的任务一起撤回。
|
||||
List<String> mergeProposalIds = proposalCommonService.mergeProposal(currentInstance.getBusinessNo());
|
||||
if (ObjectUtil.isEmpty(mergeProposalIds)) {
|
||||
revokeSingleTask(taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
for (String proposalId : mergeProposalIds) {
|
||||
ProcessInstance mergeInstance = dao().fetch(ProcessInstance.class,
|
||||
Cnd.where(ProcessInstance::getBusinessNo, "=", proposalId));
|
||||
if (ObjectUtil.isEmpty(mergeInstance)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 取并案提案当前委员会立案环节最新的一条已办任务,确保撤回的是本次联审对应的数据。
|
||||
ProcessTask mergeTask = dao().fetch(ProcessTask.class,
|
||||
Cnd.where(ProcessTask::getProcessInstanceId, "=", mergeInstance.getId())
|
||||
.and(ProcessTask::getTaskName, "=", currentTask.getTaskName())
|
||||
.and(ProcessTask::getTaskState, "in", List.of(
|
||||
ProcessTaskStateEnum.FINISHED.getCode(),
|
||||
ProcessTaskStateEnum.INTERRUPT.getCode()
|
||||
))
|
||||
.desc(ProcessTask::getCreatedAt));
|
||||
if (ObjectUtil.isEmpty(mergeTask)) {
|
||||
continue;
|
||||
}
|
||||
revokeSingleTask(mergeTask.getId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 复用通用撤回规则处理单条任务。
|
||||
* 这样并案撤回时可以对同组提案逐条执行完全一致的回退逻辑,保证流程状态和待办状态同步恢复。
|
||||
*
|
||||
* @param taskId 单条 wf_process_task 主键
|
||||
*/
|
||||
private void revokeSingleTask(Long taskId) {
|
||||
ProcessTask selfTask = dao().fetch(ProcessTask.class, taskId);
|
||||
selfTask.setTaskState(ProcessTaskStateEnum.DOING.getCode());
|
||||
|
||||
List<ProcessTask> nextTasks = dao().query(ProcessTask.class,
|
||||
Cnd.where(ProcessTask::getTaskParentId, "=", taskId));
|
||||
for (ProcessTask nextTask : nextTasks) {
|
||||
nextTask.setTaskState(ProcessTaskStateEnum.WITHDRAW.getCode());
|
||||
dao().update(nextTask);
|
||||
}
|
||||
|
||||
if (ObjectUtil.equals(selfTask.getPerformType(), 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);
|
||||
}
|
||||
}
|
||||
dao().update(ProposalInfo.class, Chain.make("caseFilingResult", null), Cnd.where(ProposalInfo::getId, "in", consolidationIds));
|
||||
dao().clear(ProposalConsolidation.class, Cnd.where(new Static("JSON_CONTAINS(consolidationIds,'\"" + instanceBusinessId + "\"')")));
|
||||
|
||||
dao().update(selfTask);
|
||||
dao().update(ProcessInstance.class,
|
||||
Chain.make("state", ProcessInstanceStateEnum.DOING.getCode()),
|
||||
Cnd.where(ProcessInstance::getId, "=", selfTask.getProcessInstanceId()));
|
||||
|
||||
for (ProcessTask nextTask : nextTasks) {
|
||||
ProcessPublisher.notify(ProcessEvent.builder()
|
||||
.eventType(ProcessEventTypeEnum.PROCESS_TASK_REVOKE)
|
||||
.sourceId(nextTask.getId())
|
||||
.build());
|
||||
todoService.deleteTask(String.valueOf(nextTask.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 委员会审核通过工作流后,同步落业务表。
|
||||
* 这里统一维护承办单位与立案结果,避免页面既走流程又漏写业务数据。
|
||||
*
|
||||
* @param processTaskId 当前审核任务ID
|
||||
* @param args 审核提交参数
|
||||
*/
|
||||
private void saveCommitteeFilingBusinessData(Long processTaskId, Dict args) {
|
||||
ProcessTask processTask = dao().fetch(ProcessTask.class, processTaskId);
|
||||
ProcessInstance processInstance = dao().fetch(ProcessInstance.class, processTask.getProcessInstanceId());
|
||||
String proposalId = processInstance.getBusinessNo();
|
||||
|
||||
// 立案结果
|
||||
String caseFilingResult = args.getStr(FlowConst.TASK_FORM_DATA_PREFIX + "caseFilingResult");
|
||||
|
||||
// 仅在准予立案或转意见建议时重建承办单位数据,避免无效结果写入承办单位表。
|
||||
if (StrUtil.isNotBlank(caseFilingResult) && List.of("CONFIRM_FILING", "SUGGESTION").contains(caseFilingResult)) {
|
||||
dao().clear(ProposalReplyUnit.class, Cnd.where(ProposalReplyUnit::getProposalId, "=", proposalId));
|
||||
|
||||
String masterUnitId = args.getStr(FlowConst.TASK_FORM_DATA_PREFIX + "masterUnitId");
|
||||
if (StrUtil.isNotBlank(masterUnitId)) {
|
||||
ProposalUndertake masterUnit = dao().fetch(ProposalUndertake.class, masterUnitId);
|
||||
if (ObjectUtil.isNotEmpty(masterUnit)) {
|
||||
ProposalReplyUnit masterReplyUnit = new ProposalReplyUnit();
|
||||
masterReplyUnit.setProposalId(proposalId);
|
||||
masterReplyUnit.setUnitId(masterUnit.getId());
|
||||
masterReplyUnit.setUnitCode(masterUnit.getCode());
|
||||
masterReplyUnit.setUnitName(masterUnit.getName());
|
||||
masterReplyUnit.setIsMaster(true);
|
||||
dao().insert(masterReplyUnit);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> helpUnitIds = (List<String>) args.getObj(FlowConst.TASK_FORM_DATA_PREFIX + "slaveUnitIds");
|
||||
if (ObjectUtil.isNotEmpty(helpUnitIds)) {
|
||||
for (String helpUnitId : helpUnitIds) {
|
||||
ProposalUndertake helpUnit = dao().fetch(ProposalUndertake.class, helpUnitId);
|
||||
if (ObjectUtil.isEmpty(helpUnit)) {
|
||||
continue;
|
||||
}
|
||||
ProposalReplyUnit helpReplyUnit = new ProposalReplyUnit();
|
||||
helpReplyUnit.setProposalId(proposalId);
|
||||
helpReplyUnit.setUnitId(helpUnit.getId());
|
||||
helpReplyUnit.setUnitCode(helpUnit.getCode());
|
||||
helpReplyUnit.setUnitName(helpUnit.getName());
|
||||
helpReplyUnit.setIsMaster(false);
|
||||
dao().insert(helpReplyUnit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Chain chain = Chain.make("caseFilingResult", caseFilingResult);
|
||||
chain.add("caseFilingType", args.getStr(FlowConst.TASK_FORM_DATA_PREFIX + "caseFilingType"));
|
||||
dao().update(ProposalInfo.class, chain, Cnd.where(ProposalInfo::getId, "=", proposalId));
|
||||
}
|
||||
}
|
||||
|
||||
-130
@@ -45,139 +45,9 @@ public class ProposalCommitteeFilingUnitServiceImpl extends BaseServiceImpl<Prop
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private SysMsgService sysMsgService;
|
||||
|
||||
public ProposalCommitteeFilingUnitServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void approval(ProposalCommitteeFilingUnitApprovalParam approvalParam) {
|
||||
approvalParam.getBpmTaskApprovalTypeEnum();
|
||||
Map<String, Object> variables = BeanUtil.beanToMap(approvalParam);
|
||||
|
||||
//审批变量
|
||||
variables.put("proposalIds", approvalParam.getProposalIds());
|
||||
variables.put("hostUnitId", approvalParam.getHostUnitId());
|
||||
variables.put("helpUnitIds", approvalParam.getHelpUnitIds());
|
||||
variables.put("caseFilingResult", approvalParam.getCaseFilingResult());
|
||||
|
||||
//承办单位
|
||||
ProposalUndertake hostUnit = dao().fetch(ProposalUndertake.class, approvalParam.getHostUnitId());
|
||||
List<ProposalUndertake> helpUnits = dao().query(ProposalUndertake.class, Cnd.where(ProposalUndertake::getId, "in", approvalParam.getHelpUnitIds()));
|
||||
variables.put("hostUnit", hostUnit.getName());
|
||||
variables.put("helpUnits", helpUnits.stream().map(ProposalUndertake::getName).toArray(String[]::new));
|
||||
|
||||
//查询提案配置协办单位是否需要答复
|
||||
ProposalConfig proposalConfig = dao().fetch(ProposalConfig.class, Cnd.NEW());
|
||||
Boolean slaveUnitNeedReply = proposalConfig.getSlaveUnitNeedReply();
|
||||
if (ObjectUtil.isNull(slaveUnitNeedReply)) {
|
||||
throw new BaseException("协办是否需要答复提案配置缺失,请联系校工会!");
|
||||
}
|
||||
|
||||
//重新并案审核
|
||||
if (approvalParam.getProposalIds().length > 1) {
|
||||
for (String proposalId : approvalParam.getProposalIds()) {
|
||||
dao().clear(ProposalConsolidation.class, Cnd.where(new Static("JSON_CONTAINS(consolidationIds,'\"%s\"')".formatted(proposalId))));
|
||||
}
|
||||
ProposalConsolidation proposalConsolidation = new ProposalConsolidation();
|
||||
proposalConsolidation.setConsolidationIds(Arrays.asList(approvalParam.getProposalIds()));
|
||||
dao().insert(proposalConsolidation);
|
||||
}
|
||||
|
||||
List<ProposalUndertake> proposalUndertakes = new ArrayList<>();
|
||||
proposalUndertakes.add(hostUnit);
|
||||
if (ObjectUtil.isNotEmpty(helpUnits) && slaveUnitNeedReply) {
|
||||
proposalUndertakes.addAll(helpUnits);
|
||||
}
|
||||
|
||||
//承办单位答复人
|
||||
List<BpmAssignmentDto> nextApprovals = new ArrayList<>();
|
||||
// if (approvalParam.getCaseFilingResult().equals("CONFIRM_FILING") || approvalParam.getCaseFilingResult().equals("SUGGESTION")) {
|
||||
//南邮 只有立案需要答复
|
||||
if (approvalParam.getCaseFilingResult().equals("CONFIRM_FILING")) {
|
||||
for (ProposalUndertake undertake : proposalUndertakes) {
|
||||
String approvalLoginName = commonService.findUserLoginNameByRoleCode(RoleConstant.PROPOSAL_UNIT_LEADER, Cnd.where(Sys_user_role::getUnderTakeId, "=", undertake.getId()));
|
||||
if (StrUtil.isBlank(approvalLoginName)) {
|
||||
throw new BaseException("{}答复人没有配置,请到承办单位管理页面进行配置。", undertake.getName());
|
||||
}
|
||||
|
||||
nextApprovals.add(new BpmAssignmentDto()
|
||||
.setLoginName(approvalLoginName)
|
||||
.setJsonObject(new JSONObject()
|
||||
.set("isMaster", hostUnit.getId().equals(undertake.getId()))
|
||||
.set("underTakeId", undertake.getId())
|
||||
.set("underTakeName", undertake.getName())
|
||||
.set("underTakeCode", undertake.getCode())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
for (String consolidationProposalId : approvalParam.getProposalIds()) {
|
||||
BpmProcessInstance instance = dao().fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", consolidationProposalId));
|
||||
BpmProcessTask caseUnitTask = dao().fetch(BpmProcessTask.class, Cnd.where(BpmProcessTask::getProcessInstanceId, "=", instance.getId())
|
||||
.and(BpmProcessTask::getProcessTaskNodeCode, "=", 70)
|
||||
.and(BpmProcessTask::getTaskStatus, "=", BpmProcessTaskStatusEnum.ACTIVE.name())
|
||||
.and(BpmProcessTask::getDelFlag, "=", 0)
|
||||
.desc(BpmProcessTask::getCreatedOn)
|
||||
);
|
||||
bpmService.completeTaskWithNextTaskVariable(caseUnitTask.getId(), approvalParam.getBpmTaskApprovalTypeEnum(), variables, nextApprovals);
|
||||
}
|
||||
|
||||
//修改提案立案结果
|
||||
dao().update(ProposalInfo.class, Chain.make("caseFilingResult", approvalParam.getCaseFilingResult())
|
||||
, Cnd.where(ProposalInfo::getId, "in", approvalParam.getProposalIds()));
|
||||
|
||||
List<ProposalInfo> proposalInfos = dao().query(ProposalInfo.class, Cnd.where(ProposalInfo::getId, "in", approvalParam.getProposalIds()));
|
||||
for (ProposalInfo proposalInfo : proposalInfos) {
|
||||
//给代表发送消息
|
||||
// if("CONFIRM_FILING".equals(approvalParam.getCaseFilingResult())){
|
||||
// String template = "{}代表您好!您的提案《{}》提案委员会已立案审核,审核结果为准予立案,您可登陆智慧校园下的暖心工会查看详情。";
|
||||
// String content = StrUtil.format(template, proposalInfo.getCreateUserName(), proposalInfo.getName());
|
||||
// sysMsgService.sendMsg(proposalInfo.getCreateUserLoginName(), "提案委员会立案审核", content, SecurityUtil.getUserId());
|
||||
// }else if("SUGGESTION".equals(approvalParam.getCaseFilingResult())){
|
||||
//
|
||||
// }else if("NOT".equals(approvalParam.getCaseFilingResult())){
|
||||
// String template = "{}代表您好!您的提案《{}》提案委员会已立案审核,审核结果为不予立案,您可登陆智慧校园下的暖心工会查看详情。";
|
||||
// String content = StrUtil.format(template, proposalInfo.getCreateUserName(), proposalInfo.getName());
|
||||
// sysMsgService.sendMsg(proposalInfo.getCreateUserLoginName(), "提案委员会立案审核", content, SecurityUtil.getUserId());
|
||||
// }
|
||||
|
||||
//给承办单位发送消息
|
||||
if("CONFIRM_FILING".equals(approvalParam.getCaseFilingResult())) {
|
||||
for (BpmAssignmentDto nextApproval : nextApprovals) {
|
||||
String template = "经提案委员会立案审核,提案《{}》最终由{}作为{}单位,您可登陆智慧校园下的暖心工会进行答复,感谢您对教代会提案工作的大力支持!。";
|
||||
String underTakeName = nextApproval.getJsonObject().getStr("underTakeName");
|
||||
Boolean isMaster = nextApproval.getJsonObject().getBool("isMaster", false);
|
||||
String content = StrUtil.format(template, proposalInfo.getName(), underTakeName, isMaster ? "主办" : "协办");
|
||||
sysMsgService.sendMsg(nextApproval.getLoginName(), "承办单位答复", content, SecurityUtil.getUserId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void revoke(String taskId) {
|
||||
BpmProcessTask task = dao().fetch(BpmProcessTask.class, taskId);
|
||||
String instanceId = task.getProcessInstanceId();
|
||||
BpmProcessInstance instance = dao().fetch(BpmProcessInstance.class, instanceId);
|
||||
String instanceBusinessId = instance.getProcessInstanceBusinessId();
|
||||
List<String> consolidationIds = proposalCommonService.getConsolidation(instanceBusinessId);
|
||||
for (String consolidationId : consolidationIds) {
|
||||
BpmProcessInstance consolidationProposalInstance = dao().fetch(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "=", consolidationId));
|
||||
String activeTaskId = consolidationProposalInstance.getProcessInstanceTaskIds().get(0);
|
||||
BpmProcessTask activeTask = dao().fetch(BpmProcessTask.class, Cnd.where(BpmProcessTask::getId, "=", activeTaskId));
|
||||
bpmService.revokeTask(activeTask.getPrevTaskId());
|
||||
}
|
||||
dao().update(ProposalInfo.class, Chain.make("caseFilingResult", null), Cnd.where(ProposalInfo::getId, "in", consolidationIds));
|
||||
dao().clear(ProposalConsolidation.class, Cnd.where(new Static("JSON_CONTAINS(consolidationIds,'\"" + instanceBusinessId + "\"')")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ const PROPOSAL_INFO = {
|
||||
<div class="proposal-info">
|
||||
<div class="process-title">
|
||||
提案基础信息
|
||||
<el-link type="primary" @click="openChart">点击查看流程图</el-link>
|
||||
</div>
|
||||
<h3 style="text-align: center;font-weight: 600" class="pt10 pb10">
|
||||
{{ viewData.name }}
|
||||
@@ -161,12 +162,14 @@ const PROPOSAL_INFO = {
|
||||
</template>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="主办单位" :span="3">{{task.ext.tf_masterUnitName}}
|
||||
<el-descriptions-item label="主办单位" :span="3"
|
||||
v-if="['CONFIRM_FILING','SUGGESTION'].includes(task.ext.tf_caseFilingResult)">{{task.ext.tf_masterUnitName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="协办单位" :span="3">{{task?.ext?.tf_slaveUnitNameStr}}
|
||||
<el-descriptions-item label="协办单位" :span="3"
|
||||
v-if="['CONFIRM_FILING','SUGGESTION'].includes(task.ext.tf_caseFilingResult)">{{task?.ext?.tf_slaveUnitNameStr}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="办理意见" :span="3">
|
||||
<div v-html="task.taskFormData.tf_opinion"></div>
|
||||
<div v-html="task.ext.approvalOpinion"></div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
@@ -197,6 +200,7 @@ const PROPOSAL_INFO = {
|
||||
</template>
|
||||
|
||||
<slot></slot>
|
||||
<snaker-chart ref="snakerChartRef"></snaker-chart>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["PROPOSAL_TYPE", "PROPOSAL_CASE_FILING_RESULT", "PROPOSAL_CASE_FILING_TYPE", "PROCESS_TASK_SUBMIT_TYPE", "PROPOSAL_FEEDBACK"],
|
||||
@@ -245,6 +249,9 @@ const PROPOSAL_INFO = {
|
||||
}
|
||||
})
|
||||
},
|
||||
openChart(){
|
||||
this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId, this.row.instanceId)
|
||||
}
|
||||
|
||||
},
|
||||
style:
|
||||
|
||||
+2
-2
@@ -246,7 +246,7 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
|
||||
const loading = createLoading('提交中')
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
this.$axios.post("/platform/proposal/committeeFiling/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val,
|
||||
@@ -290,7 +290,7 @@ layout("/layouts/platform.html"){
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
|
||||
this.$axios.post("/platform/proposal/committeeFiling/revoke", {taskId: row.taskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
|
||||
+22
-23
@@ -24,24 +24,24 @@ layout("/layouts/platform.html"){
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.createUserKeyword"></el-input>
|
||||
</search-item>
|
||||
<!-- <search-item label="提案人姓名">-->
|
||||
<!-- <el-input-->
|
||||
<!-- @keyup.enter.native="doSearch"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请输入提案人姓名"-->
|
||||
<!-- v-model="pageForm.createUserName"-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- ></el-input>-->
|
||||
<!-- </search-item>-->
|
||||
<!-- <search-item label="提案人工号">-->
|
||||
<!-- <el-input-->
|
||||
<!-- @keyup.enter.native="doSearch"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请输入提案人工号"-->
|
||||
<!-- v-model="pageForm.createUserLoginName"-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- ></el-input>-->
|
||||
<!-- </search-item>-->
|
||||
<!-- <search-item label="提案人姓名">-->
|
||||
<!-- <el-input-->
|
||||
<!-- @keyup.enter.native="doSearch"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请输入提案人姓名"-->
|
||||
<!-- v-model="pageForm.createUserName"-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- ></el-input>-->
|
||||
<!-- </search-item>-->
|
||||
<!-- <search-item label="提案人工号">-->
|
||||
<!-- <el-input-->
|
||||
<!-- @keyup.enter.native="doSearch"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请输入提案人工号"-->
|
||||
<!-- v-model="pageForm.createUserLoginName"-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- ></el-input>-->
|
||||
<!-- </search-item>-->
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
@@ -53,7 +53,8 @@ layout("/layouts/platform.html"){
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod" fixed="left"></el-table-column>
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"
|
||||
fixed="left"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
@@ -72,10 +73,6 @@ layout("/layouts/platform.html"){
|
||||
<el-tag v-if="row.merge" size="small">是</el-tag>
|
||||
<el-tag v-else type="warning" size="small">否</el-tag>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'underTakeIsMaster'" scope="{row}">
|
||||
<el-tag v-if="row.underTakeIsMaster" size="small">主办</el-tag>
|
||||
<el-tag v-else type="warning" size="small">协办</el-tag>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'instanceState'" scope="{row}">
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
|
||||
size="small"></enum-tag>
|
||||
@@ -159,8 +156,10 @@ layout("/layouts/platform.html"){
|
||||
openAudit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
const taskVariable = JSON.parse(row.taskVariable)
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
tf_masterUnitId: taskVariable.tf_masterUnitId,
|
||||
taskKey: row.taskKey,
|
||||
taskName: row.taskName,
|
||||
proposalId: row.id
|
||||
|
||||
+217
@@ -0,0 +1,217 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="教代会">
|
||||
<el-select @change="meetingChange" clearable filterable placeholder="所属教代会"
|
||||
v-model="pageForm.sessionId">
|
||||
<el-option :key="item.id" :label="item.fullName" :value="item.id"
|
||||
v-for="item in sessionOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="提案名称">
|
||||
<el-input v-model="pageForm.name" placeholder="提案名称" @keyup.enter.native="doSearch" clearable
|
||||
style="width: 100%"></el-input>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.createUserKeyword"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool :columns.sync="tableColumns">
|
||||
<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-column label="序号" width="50" type="index" :index="indexMethod" fixed="left"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.key"
|
||||
:min-width="column.width"
|
||||
:fixed="column.fixed"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
v-if="column.visible !== false"
|
||||
>
|
||||
<template v-if="column.prop === 'caseFilingResult'" scope="{row}">
|
||||
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
|
||||
:value="row.caseFilingResult"></dict-tag>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'merge'" scope="{row}">
|
||||
<el-tag v-if="row.merge" size="small">是</el-tag>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'instanceState'" 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="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.taskState === 10" @click="openAudit(row)" size="mini" type="primary">审核
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<proposal-info ref="proposalInfoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
|
||||
class="flow-task-form">
|
||||
<el-form-item label="审批意见" prop="tf_opinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
<!-- <el-button @click="handleTaskAction(6)" size="small" type="info">退回到提案人</el-button>-->
|
||||
<el-button @click="handleTaskAction(2)" size="small" type="danger">不同意</el-button>
|
||||
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</proposal-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../../common/info.js'){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"proposal-info": PROPOSAL_INFO
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{label: "提案编号", prop: "code"},
|
||||
{label: "提案名称", prop: "name", width: "200px"},
|
||||
{label: "提案类别", prop: "typeName"},
|
||||
{label: "届次", prop: "sessionName"},
|
||||
{label: "代表团", prop: "delegationName"},
|
||||
{label: "当前节点", prop: "curTaskName"},
|
||||
{label: "流程状态", prop: "instanceState"}
|
||||
],
|
||||
pageForm: {
|
||||
approval: false
|
||||
},
|
||||
showApprovalForm: false,
|
||||
sessionOptions:[]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.proposalInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openAudit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName
|
||||
}
|
||||
this.$refs.proposalInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
if (!valid) return
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 教代会
|
||||
async meetingChange(val) {
|
||||
this.formData.delegationId = null
|
||||
this.formData.committeeId = null
|
||||
this.doSearch()
|
||||
},
|
||||
listDelegation() {
|
||||
this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.sessionId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.delegationOptions = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询开启的教代会
|
||||
listOpenSession() {
|
||||
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.sessionOptions = res.data
|
||||
if (this.sessionOptions) {
|
||||
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
|
||||
this.pageData()
|
||||
this.listDelegation()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.listOpenSession()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -140,8 +140,10 @@ const PROPOSAL_INFO = {
|
||||
</template>
|
||||
</div>
|
||||
</van-cell>
|
||||
<van-cell title="主办单位">{{ task.ext.tf_masterUnitName }}</van-cell>
|
||||
<van-cell title="协办单位">{{ task?.ext?.tf_slaveUnitNameStr }}</van-cell>
|
||||
<van-cell title="主办单位"
|
||||
v-if="['CONFIRM_FILING','SUGGESTION'].includes(task.ext.tf_caseFilingResult)">{{ task.ext.tf_masterUnitName }}</van-cell>
|
||||
<van-cell title="协办单位"
|
||||
v-if="['CONFIRM_FILING','SUGGESTION'].includes(task.ext.tf_caseFilingResult)">{{ task?.ext?.tf_slaveUnitNameStr }}</van-cell>
|
||||
</van-cell-group>
|
||||
|
||||
<van-cell-group :title="task.displayName" v-else>
|
||||
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="校工会意见" placeholder fixed></van-nav-bar>
|
||||
<van-sticky offset-top="46px">
|
||||
<van-search
|
||||
v-model="pageForm.name"
|
||||
:show-action="false"
|
||||
:reverse-color="false"
|
||||
input-align="left"
|
||||
placeholder="请输入提案名称搜索"
|
||||
@search="doSearch"
|
||||
></van-search>
|
||||
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||
<van-dropdown-item v-model="pageForm.sessionId" :options="sessionOptions" :multiple="false"
|
||||
@change="doSearch"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
<van-tabs v-model="pageForm.approvalText"
|
||||
@change="(val)=>{this.pageForm.approval = val==='1';this.doSearch();}">
|
||||
<van-tab title="已审核" name="1"></van-tab>
|
||||
<van-tab title="未审核" name="0"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
|
||||
<table-list api="/platform/proposal/schoolOpinion/pageData" :page_form.sync="pageForm" @ready="onReady"
|
||||
ref="tableListRef"
|
||||
title="name">
|
||||
<template v-slot="{index,row}">
|
||||
<table-column label="提案编号">{{row.code}}</table-column>
|
||||
<table-column label="提案类别">{{row.typeName}}</table-column>
|
||||
<table-column label="提案人">{{row.createUserName}}</table-column>
|
||||
<table-column label="代表团">{{row.delegationName}}</table-column>
|
||||
<table-column label="当前节点">{{row.curTaskName}}</table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>查看</span>
|
||||
</div>
|
||||
<div class="action-btn" v-if="row.taskState === 10" @click="onApproval(row)">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span>审核</span>
|
||||
</div>
|
||||
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
|
||||
<i class="fa fa-reply"></i>
|
||||
<span>撤回</span>
|
||||
</div>
|
||||
</template>
|
||||
</table-list>
|
||||
|
||||
<proposal-info ref="proposalInfoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">{{formData.taskName}}</div>
|
||||
<van-form ref="formRef">
|
||||
<van-field
|
||||
v-model="formData.tf_opinion"
|
||||
name="tf_opinion"
|
||||
label="审批意见"
|
||||
placeholder="请输入审批意见"
|
||||
:rules="[{ required: true, message: '请填写审批意见' }]"
|
||||
required
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
></van-field>
|
||||
</van-form>
|
||||
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
|
||||
<van-button type="danger" block @click="handleTaskAction(6)">退回</van-button>
|
||||
<van-button type="danger" block @click="handleTaskAction(2)">不同意</van-button>
|
||||
<van-button type="primary" block @click="handleTaskAction(1)">同意</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</proposal-info>
|
||||
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include("../../common/info.js"){}#-->
|
||||
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
name: null,
|
||||
sessionId: null,
|
||||
approvalText: "0",
|
||||
approval: false
|
||||
},
|
||||
|
||||
sessionOptions: [],
|
||||
formData: {},
|
||||
showApprovalForm: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"proposal-info": PROPOSAL_INFO
|
||||
},
|
||||
methods: {
|
||||
onReady() {
|
||||
this.listSession()
|
||||
},
|
||||
listSession() {
|
||||
this.$axios.post("/platform/proposal/common/listSession").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.sessionOptions = [
|
||||
{
|
||||
text: "全部届次",
|
||||
value: null
|
||||
}
|
||||
].concat(res.data.map((v) => ({text: v.fullName, value: v.id})))
|
||||
if (this.sessionOptions.length > 0) {
|
||||
this.pageForm.sessionId = this.sessionOptions[0].value
|
||||
this.doSearch()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onView(row) {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.proposalInfoRef.onOpen(row)
|
||||
},
|
||||
|
||||
onApproval(row) {
|
||||
this.showApprovalForm = true
|
||||
this.$refs.proposalInfoRef.onOpen(row)
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName
|
||||
}
|
||||
},
|
||||
|
||||
async handleTaskAction(val) {
|
||||
try {
|
||||
await this.$refs.formRef.validate();
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.proposalInfoRef.onClose()
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
onRevoke(row){
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要撤回吗?"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
doSearch() {
|
||||
this.$nextTick(() => {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.totalCount = 0
|
||||
this.$refs.tableListRef.doSearch()
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user