commit
This commit is contained in:
@@ -16,6 +16,10 @@ RoleConstant {
|
||||
|
||||
UNION_COMMITTEE_MEMBER("工代会委员"),
|
||||
|
||||
OFFICE_MANAGER("两办办公室负责人"),
|
||||
SCHOOL_SECRETARY("学校书记"),
|
||||
SCHOOL_HEADMASTER("学校校长"),
|
||||
|
||||
SCHOOL_UNION_ADMIN("校工会管理员"),
|
||||
SCHOOL_UNION_CHAIRMAN("校工会主席"),
|
||||
SCHOOL_UNION_VICE_CHAIRMAN("校工会副主席"),
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.budwk.app.flow.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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_role;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName FlowGeneralRoleCodeByArgsAssignmentHandler
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/1/31 16:58
|
||||
* @Version 1.0
|
||||
* @Description 根据参数的roleCode获取审核人
|
||||
*/
|
||||
public class FlowGeneralRoleCodeByArgsAssignmentHandler implements AssignmentHandler {
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
String roleCode = execution.getArgs().getStr("roleCode");
|
||||
if (StrUtil.isBlank(roleCode)) {
|
||||
throw new BaseException("参数 roleCode 不能为空");
|
||||
}
|
||||
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
Sys_role role = sysRoleService.getByCode(roleCode);
|
||||
|
||||
List<Sys_user_role> roles = ServiceContext.find(Dao.class).query(
|
||||
Sys_user_role.class,
|
||||
Cnd.where(Sys_user_role::getRoleId, "=", role.getId())
|
||||
);
|
||||
|
||||
if (Lang.isEmpty(roles)) {
|
||||
throw new RuntimeException(role.getName() + "未设置用户。");
|
||||
}
|
||||
|
||||
return roles.stream().map(Sys_user_role::getUserId).distinct().toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "根据角色编码获取审核人(根据args中的roleCode)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return AssignmentHandler.super.getOrder();
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.controller.common;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionType;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.common.OpinionCommonService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalConfig;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalType;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||
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;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@At("/platform/opinion/common")
|
||||
@Ok("json:full")
|
||||
public class OpinionCommonController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OpinionCommonService opinionCommonService;
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion")
|
||||
@ApiOperation("意见详情")
|
||||
public Result opinionInfo(@Valid String id) {
|
||||
return Result.success(opinionCommonService.info(id));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询全部的意见类型")
|
||||
@SaCheckLogin
|
||||
public Result listOpinionType(){
|
||||
List<OpinionType> list = dao.query(OpinionType.class, Cnd.NEW().asc(OpinionType::getCode));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("查询全部的教代会")
|
||||
public Result listSession() {
|
||||
List<Teacher_congress_session> list = dao.query(Teacher_congress_session.class, Cnd.NEW().desc("startDate"));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("查询开启的教代会")
|
||||
public Result listOpenSession() {
|
||||
List<Teacher_congress_session> list = dao.query(Teacher_congress_session.class, Cnd.where("enable", "=", 1).desc("startDate"));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("查询当前用户所属的教代会")
|
||||
public Result listOpenSessionByUser() {
|
||||
List<Teacher_congress_session> list = dao.query(Teacher_congress_session.class, Cnd.where("enable", "=", 1).desc("startDate"));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("查询当前教代会的代表团")
|
||||
public Result listDelegation(@Valid String sessionId) {
|
||||
List<Teacher_congress_delegation> list = dao.query(Teacher_congress_delegation.class, Cnd.where("sessionId", "=", sessionId).asc("code"));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("承办单位列表")
|
||||
public Result listUnderTake() {
|
||||
List<ProposalUndertake> list = dao.query(ProposalUndertake.class, Cnd.NEW());
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission("proposal")
|
||||
public void exportProposalAsDocx(String id, HttpServletResponse response) {
|
||||
opinionCommonService.exportOpinionAsDocx(id, response);
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.controller.config;
|
||||
|
||||
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.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionInfo;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionType;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionConfigTypeController
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/2 10:16
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/opinion/config/type")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api("意见类型配置")
|
||||
public class OpinionConfigTypeController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/opinion/config/type/index.html")
|
||||
@SaCheckPermission("opinion.config.type")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.config.type")
|
||||
@ApiModelProperty("分页查询意见类型")
|
||||
public Result pageData(@Valid PageForm pageForm, String name){
|
||||
Sql sql = Sqls.create("select * from opinion_type $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(Cnd.likeEX("name", name));
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageVO(pageForm, sql, OpinionType.class);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.config.type")
|
||||
@ApiModelProperty("新增意见类型")
|
||||
@SLog(type = "意见类型配置", tag = "新增意见类型", msg = "${type.name}")
|
||||
public Result insert(OpinionType type){
|
||||
int count = dao.count(OpinionType.class, Cnd.where("code", "=", type.getCode()));
|
||||
if(count>0){
|
||||
return Result.error("编码重复!");
|
||||
}
|
||||
dao.insert(type);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.config.type")
|
||||
@ApiModelProperty("修改意见类型")
|
||||
@SLog(type = "意见类型配置", tag = "修改意见类型", msg = "${type.name}")
|
||||
public Result update(OpinionType type){
|
||||
int count = dao.count(OpinionType.class, Cnd.where("code", "=", type.getCode()).and("id", "!=", type.getId()));
|
||||
if (count > 0) {
|
||||
return Result.error("编码重复!");
|
||||
}
|
||||
dao.updateIgnoreNull(type);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.config.type")
|
||||
@ApiModelProperty("删除意见类型")
|
||||
@SLog(type = "意见类型配置", tag = "删除意见类型", msg = "id:${id}")
|
||||
public Result delete(@Valid Integer id){
|
||||
int count = dao.count(OpinionInfo.class, Cnd.where(OpinionInfo::getTypeId, "=", id));
|
||||
if(count > 0){
|
||||
return Result.error("该类型有关联的意见,无法删除!");
|
||||
}
|
||||
dao.delete(OpinionType.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.opinion.param.OpinionSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.common.OpinionCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
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.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionFeedbackController
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 15:21
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/opinion/feedback")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "意见管理-反馈评价")
|
||||
public class OpinionFeedbackController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OpinionCommonService opinionCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/opinion/transact/feedback/index.html")
|
||||
@SaCheckPermission("opinion.feedback")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.feedback")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result pageData(@Valid OpinionSearchParam pageForm,
|
||||
@Param(value = "String") String sessionId,
|
||||
@Param(value = "approval") 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,
|
||||
t.variable->>'$.underTakeName' AS underTakeName,
|
||||
IF(JSON_EXTRACT(t.variable, '$.underTakeIsMaster') = 1, 1, 0) AS underTakeIsMaster
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN opinion_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN opinion_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
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.and("t.taskName", "in", List.of("feedback"));
|
||||
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());
|
||||
}
|
||||
|
||||
OpinionSearchParam.buildSearch(cnd, pageForm);
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<NutMap> pageVO = opinionCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
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.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionInfo;
|
||||
import com.budwk.app.zhgh.democratic.opinion.param.OpinionSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.OpinionWriteService;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.common.OpinionCommonService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
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.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.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionMineController
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/2 17:13
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/opinion/mine")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "意见管理-我的意见")
|
||||
public class OpinionMineController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OpinionCommonService opinionCommonService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/opinion/transact/mine/index.html")
|
||||
@SaCheckPermission("opinion.mine")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/opinion/transact/mine/index.html")
|
||||
@SaCheckPermission("h5.opinion.mine")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.mine")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result pageData(@Valid OpinionSearchParam pageForm, String sessionId) {
|
||||
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,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId
|
||||
FROM
|
||||
opinion_info info
|
||||
LEFT JOIN opinion_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
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
$condition
|
||||
""");
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name(), RoleConstant.SCHOOL_UNION_PROPOSAL_ADMIN.name())) {
|
||||
cnd.and("info.createUserId", "=", SecurityUtil.getUserId());
|
||||
}
|
||||
OpinionSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = opinionCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"opinion.mine", "h5.opinion.mine"}, mode = SaMode.OR)
|
||||
@SLog(tag = "教代会意见系统-我的意见", msg = "删除意见")
|
||||
public Result delete(@Param("id") String id) {
|
||||
dao.delete(OpinionInfo.class, id);
|
||||
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"opinion.mine", "h5.opinion.mine"}, mode = SaMode.OR)
|
||||
public Result detail(@Valid String id) {
|
||||
OpinionInfo info = dao.fetch(OpinionInfo.class, id);
|
||||
return Result.success(info);
|
||||
}
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.opinion.param.OpinionSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.common.OpinionCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
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.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionOfficeAuditController
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 10:37
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/opinion/office")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "意见管理-两办审核")
|
||||
public class OpinionOfficeAuditController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OpinionCommonService opinionCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/opinion/transact/office/index.html")
|
||||
@SaCheckPermission("opinion.office")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.office")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result pageData(@Valid OpinionSearchParam pageForm,
|
||||
@Param(value = "String") String sessionId,
|
||||
@Param(value = "approval") 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 opinion_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN opinion_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
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.and("t.taskName", "=", "office");
|
||||
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());
|
||||
}
|
||||
|
||||
OpinionSearchParam.buildSearch(cnd, pageForm);
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<NutMap> pageVO = opinionCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.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.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
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.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionInfo;
|
||||
import com.budwk.app.zhgh.democratic.opinion.param.OpinionSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.common.OpinionCommonService;
|
||||
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;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionSchoolAuditController
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/2 17:50
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/opinion/schoolAudit")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "意见管理-校工会审核")
|
||||
public class OpinionSchoolAuditController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OpinionCommonService opinionCommonService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/opinion/transact/schoolAudit/index.html")
|
||||
@SaCheckPermission("opinion.schoolAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.schoolAudit")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result pageData(@Valid OpinionSearchParam pageForm,
|
||||
@Param(value = "String") String sessionId,
|
||||
@Param(value = "approval") 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 opinion_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN opinion_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
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.and("t.taskName", "=", "schoolAudit");
|
||||
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());
|
||||
}
|
||||
|
||||
OpinionSearchParam.buildSearch(cnd, pageForm);
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<NutMap> pageVO = opinionCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.schoolAudit")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("修改意见")
|
||||
@SLog(tag = "意见管理系统-校工会审核", msg = "修改意见")
|
||||
public Result edit(@Param("info") OpinionInfo opinionInfo) {
|
||||
dao.update(opinionInfo);
|
||||
|
||||
ProcessInstance instance = dao.fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", opinionInfo.getId()));
|
||||
Dict dict = FlowUtil.variableToDict(instance.getVariable());
|
||||
dict.set(FlowConst.FORM_DATA, opinionInfo);
|
||||
dao.update(instance);
|
||||
|
||||
List<ProcessTask> doingTaskList = flowEngine.processTaskService().getDoingTaskList(instance.getId(), null);
|
||||
for (ProcessTask task : doingTaskList) {
|
||||
Dict args = FlowUtil.variableToDict(task.getVariable());
|
||||
args.set(FlowConst.FORM_DATA, opinionInfo);
|
||||
}
|
||||
dao.update(doingTaskList);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.opinion.param.OpinionSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.common.OpinionCommonService;
|
||||
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;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionSchoolSubmitController
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 14:34
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/opinion/schoolSubmit")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "意见管理-校工会提交")
|
||||
public class OpinionSchoolSubmitController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OpinionCommonService opinionCommonService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/opinion/transact/schoolSubmit/index.html")
|
||||
@SaCheckPermission("opinion.schoolSubmit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.schoolSubmit")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result pageData(@Valid OpinionSearchParam pageForm,
|
||||
@Param(value = "String") String sessionId,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = getSql(pageForm, sessionId, approval);
|
||||
Pagination<NutMap> pageVO = opinionCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.schoolSubmit")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result queryBatch(@Valid OpinionSearchParam pageForm,
|
||||
@Param(value = "String") String sessionId,
|
||||
@Param(value = "approval") Boolean approval) {
|
||||
Sql sql = getSql(pageForm, sessionId, approval);
|
||||
List<NutMap> list = opinionCommonService.listMap(sql);
|
||||
List<String> taskIds = list.stream().map(o -> o.getString("taskId")).filter(Strings::isNotBlank).toList();
|
||||
return Result.success(taskIds);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("执行任务")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("opinion.schoolSubmit")
|
||||
public Result executeTask(@Param("data") String[] taskIds) {
|
||||
List<ProcessTask> taskList = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getId, "in", taskIds));
|
||||
for (ProcessTask task : taskList) {
|
||||
Dict args = Dict.create();
|
||||
args.set("processTaskId", task.getId());
|
||||
args.set("taskName", task.getTaskName());
|
||||
args.set("submitType", ProcessSubmitTypeEnum.AGREE.getCode());
|
||||
args.set("tf_opinion", "同意");
|
||||
flowCommonService.executeTask(args);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
private Sql getSql(OpinionSearchParam pageForm, String sessionId, 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 opinion_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN opinion_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
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.and("t.taskName", "in", List.of("schoolSubmit"));
|
||||
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());
|
||||
}
|
||||
|
||||
OpinionSearchParam.buildSearch(cnd, pageForm);
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
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.enums.ProcessInstanceStateEnum;
|
||||
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.opinion.param.OpinionSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.common.OpinionCommonService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalConfig;
|
||||
import io.swagger.annotations.Api;
|
||||
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.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionSummaryController
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 17:55
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/opinion/summary")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "意见管理-查询统计")
|
||||
public class OpinionSummaryController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OpinionCommonService opinionCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/opinion/transact/summary/index.html")
|
||||
@SaCheckPermission("opinion.summary")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.summary")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result pageData(@Valid OpinionSearchParam pageForm,
|
||||
@Param(value = "String") String sessionId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.id AS instanceId,
|
||||
ins.state instanceState,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.displayName taskName
|
||||
FROM
|
||||
opinion_info info
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
processInstanceId,
|
||||
displayName,
|
||||
createdAt,
|
||||
ROW_NUMBER() OVER (PARTITION BY processInstanceId ORDER BY createdAt DESC) AS rn
|
||||
FROM wf_process_task
|
||||
) t ON t.processInstanceId = ins.id AND t.rn = 1
|
||||
LEFT JOIN opinion_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
|
||||
LEFT JOIN vw_user u ON u.id = info.createUserId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_SECRETARY.name(), RoleConstant.SCHOOL_HEADMASTER.name())) {
|
||||
// 其他校领导看自己单位
|
||||
cnd.and("u.unit", "=", SecurityUtil.getUnitId());
|
||||
}
|
||||
|
||||
OpinionSearchParam.buildSearch(cnd, pageForm);
|
||||
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<NutMap> pageVO = opinionCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.opinion.param.OpinionSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.common.OpinionCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
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.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionUnitReplyController
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 10:50
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/opinion/unitReply")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "意见管理-承办答复")
|
||||
public class OpinionUnitReplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OpinionCommonService opinionCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/opinion/transact/unitReply/index.html")
|
||||
@SaCheckPermission("opinion.unitReply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.unitReply")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result pageData(@Valid OpinionSearchParam pageForm,
|
||||
@Param(value = "String") String sessionId,
|
||||
@Param(value = "approval") 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,
|
||||
t.variable->>'$.underTakeName' AS underTakeName,
|
||||
IF(JSON_EXTRACT(t.variable, '$.underTakeIsMaster') in (true, 1), 1, 0) AS underTakeIsMaster
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN opinion_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN opinion_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
|
||||
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 wf_process_task_actor pta ON pta.processTaskId = nt.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("info.sessionId", "=", sessionId);
|
||||
cnd.and("t.taskName", "in", List.of("master_reply", "slave_reply"));
|
||||
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("pta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
|
||||
OpinionSearchParam.buildSearch(cnd, pageForm);
|
||||
|
||||
cnd.groupBy("t.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination<NutMap> pageVO = opinionCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pageVO);
|
||||
}
|
||||
}
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionInfo;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.OpinionWriteService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalWriteService;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||
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.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 javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见撰写
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/opinion/write")
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@Api(tags = "意见管理-意见撰写")
|
||||
public class OpinionWriteController {
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private OpinionWriteService opinionWriteService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/opinion/transact/write/index.html")
|
||||
@SaCheckPermission("opinion.write")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/democratic/opinion/transact/write/index.html")
|
||||
@SaCheckPermission("h5.opinion.write")
|
||||
public void h5Index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.write")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("保存意见")
|
||||
@SLog(tag = "意见管理系统-我的意见", msg = "保存意见")
|
||||
public Result save(@Param("info") OpinionInfo opinionInfo) {
|
||||
if (StrUtil.isBlank(opinionInfo.getCode())) {
|
||||
opinionInfo.setCode(opinionWriteService.generateOpinionCode(opinionInfo.getSessionId(), opinionInfo.getDelegationId()));
|
||||
}
|
||||
dao.insertOrUpdate(opinionInfo);
|
||||
return Result.success(opinionInfo);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.write")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("提交意见")
|
||||
@SLog(tag = "意见管理系统-我的意见", msg = "提交意见")
|
||||
public Result submit(@Param("info") OpinionInfo opinionInfo) {
|
||||
if (StrUtil.isBlank(opinionInfo.getCode())) {
|
||||
opinionInfo.setCode(opinionWriteService.generateOpinionCode(opinionInfo.getSessionId(), opinionInfo.getDelegationId()));
|
||||
}
|
||||
dao.insertOrUpdate(opinionInfo);
|
||||
|
||||
// 开启流程实例
|
||||
Dict args = Dict.create();
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, opinionInfo);
|
||||
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("JDHYJ", opinionInfo.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(opinionInfo);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.write")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("重新提交意见")
|
||||
@SLog(tag = "意见管理系统-我的意见", msg = "重新提交意见")
|
||||
public Result submitAgain(@Param("info") OpinionInfo opinionInfo, @Param("taskId") Long taskId) {
|
||||
dao.insertOrUpdate(opinionInfo);
|
||||
|
||||
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
|
||||
@SaCheckPermission("opinion.write")
|
||||
@ApiOperation("意见详情")
|
||||
public Result detail(@Valid String id) {
|
||||
OpinionInfo info = dao.fetch(OpinionInfo.class, id);
|
||||
return Result.success(info);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("opinion.write")
|
||||
@ApiOperation("查询代表所属代表团")
|
||||
public Result searchDelegation(@Valid String sessionId, String userId) {
|
||||
if (StrUtil.isBlank(userId)) {
|
||||
userId = SecurityUtil.getUserId();
|
||||
}
|
||||
Teacher_congress_delegate delegate = dao.fetch(Teacher_congress_delegate.class,
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", sessionId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", userId)
|
||||
);
|
||||
return Result.success().addData(delegate != null ? delegate.getDelegationId() : null);
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.zhgh.democratic.opinion.models.OpinionInfo;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionCreatedUserAssignmentHandler
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 15:26
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OpinionCreatedUserAssignmentHandler implements AssignmentHandler {
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
String opinionId = execution.getProcessInstance().getBusinessNo();
|
||||
|
||||
OpinionInfo info = dao.fetch(OpinionInfo.class, opinionId);
|
||||
if (info == null || StrUtil.isBlank(info.getCreateUserId())) {
|
||||
throw new BaseException("未查询到意见人信息");
|
||||
}
|
||||
|
||||
return List.of(info.getCreateUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "获取意见人";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return AssignmentHandler.super.getOrder();
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.handler;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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_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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionMasterUnitAssignmentHandler
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 11:13
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OpinionMasterUnitAssignmentHandler implements AssignmentHandler {
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
|
||||
String opinionId = execution.getProcessInstance().getBusinessNo();
|
||||
|
||||
String masterUnitId = execution.getArgs().getStr("tf_masterUnitId");
|
||||
|
||||
if(StrUtil.isBlank(masterUnitId)){
|
||||
ProposalReplyUnit masterUnit = dao.fetch(ProposalReplyUnit.class, Cnd.where(ProposalReplyUnit::getProposalId, "=", opinionId).and(ProposalReplyUnit::getIsMaster, "=", 1));
|
||||
if (masterUnit == null) {
|
||||
throw new BaseException("系统异常");
|
||||
}
|
||||
masterUnitId = masterUnit.getUnitId();
|
||||
}
|
||||
|
||||
if(StrUtil.isBlank(masterUnitId)){
|
||||
throw new BaseException("提案没有主办单位");
|
||||
}
|
||||
|
||||
ProposalUndertake undertake = dao.fetch(ProposalUndertake.class, masterUnitId);
|
||||
if (undertake == null) {
|
||||
throw new BaseException("主办单位不存在");
|
||||
}
|
||||
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.PROPOSAL_UNIT_LEADER);
|
||||
|
||||
List<Sys_user_role> sysUserRoles = dao.query(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "=", sysRole.getId()).and(Sys_user_role::getUnderTakeId, "=", undertake.getId()));
|
||||
List<String> selectUserIds = sysUserRoles.stream().map(Sys_user_role::getUserId).toList();
|
||||
|
||||
if (selectUserIds.isEmpty()) {
|
||||
throw new BaseException("主办单位没有负责人");
|
||||
}
|
||||
|
||||
|
||||
// 参数
|
||||
Dict args = execution.getArgs();
|
||||
args.set("underTakeName", undertake.getName());
|
||||
args.set("underTakeId", undertake.getId());
|
||||
args.set("underTakeIsMaster",true);
|
||||
|
||||
return selectUserIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "意见主办单位处理人";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return AssignmentHandler.super.getOrder();
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.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_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.ProposalUndertake;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionSlaveUnitAssignmentHandler
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 11:15
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OpinionSlaveUnitAssignmentHandler implements AssignmentHandler {
|
||||
@Override
|
||||
public List<String> assign(TaskModel model, Execution execution) {
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
SysRoleService sysRoleService = ServiceContext.find(SysRoleService.class);
|
||||
|
||||
List<String> assignee = new ArrayList<>();
|
||||
|
||||
List<String> helpUnitIds = (List<String>) execution.getArgs().get("tf_slaveUnitIds");
|
||||
|
||||
if (helpUnitIds != null && !helpUnitIds.isEmpty()) {
|
||||
|
||||
Sys_role sysRole = sysRoleService.getByCode(RoleConstant.PROPOSAL_UNIT_LEADER);
|
||||
|
||||
for (String helpUnitId : helpUnitIds) {
|
||||
ProposalUndertake undertake = dao.fetch(ProposalUndertake.class, helpUnitId);
|
||||
List<Sys_user_role> sysUserRoles = dao.query(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "=", sysRole.getId()).and(Sys_user_role::getUnderTakeId, "=", undertake.getId()));
|
||||
if (sysUserRoles.isEmpty()) {
|
||||
throw new BaseException(undertake.getName() + "单位没有设置负责人!");
|
||||
}
|
||||
assignee.addAll(sysUserRoles.stream().map(Sys_user_role::getUserId).toList());
|
||||
}
|
||||
return assignee;
|
||||
}
|
||||
return assignee;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "意见协办单位处理人";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return AssignmentHandler.super.getOrder();
|
||||
}
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.listenter;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.entity.ProcessTaskActor;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionReplyUnit;
|
||||
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;
|
||||
import org.nutz.json.Json;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionOfficeSuffixInterceptor
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 14:04
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OpinionOfficeSuffixInterceptor implements FlowInterceptor {
|
||||
@Override
|
||||
public void intercept(Execution execution) {
|
||||
Dao dao = ServiceContext.find(Dao.class);
|
||||
|
||||
String opinionId = execution.getProcessInstance().getBusinessNo();
|
||||
String officeResult = execution.getArgs().getStr(FlowConst.TASK_FORM_DATA_PREFIX + "officeResult");
|
||||
|
||||
if (StrUtil.isNotBlank(officeResult) && "YES".equals(officeResult)) {
|
||||
// 删除原来的记录
|
||||
dao.clear(OpinionReplyUnit.class, Cnd.where(OpinionReplyUnit::getOpinionId, "=", opinionId));
|
||||
|
||||
// 主办单位
|
||||
String masterUnitId = execution.getArgs().getStr(FlowConst.TASK_FORM_DATA_PREFIX + "masterUnitId");
|
||||
ProposalUndertake masterUnit = dao.fetch(ProposalUndertake.class, masterUnitId);
|
||||
OpinionReplyUnit masterReplyUnit = new OpinionReplyUnit();
|
||||
masterReplyUnit.setOpinionId(opinionId);
|
||||
masterReplyUnit.setUnitId(masterUnit.getId());
|
||||
masterReplyUnit.setUnitCode(masterUnit.getCode());
|
||||
masterReplyUnit.setUnitName(masterUnit.getName());
|
||||
masterReplyUnit.setIsMaster(true);
|
||||
dao.insert(masterReplyUnit);
|
||||
|
||||
// 协办单位
|
||||
List<String> helpUnitIds = (List<String>) execution.getArgs().getObj(FlowConst.TASK_FORM_DATA_PREFIX + "slaveUnitIds");
|
||||
if(ObjectUtil.isNotEmpty(helpUnitIds)){
|
||||
for (String helpUnitId : helpUnitIds) {
|
||||
ProposalUndertake helpUnit = dao.fetch(ProposalUndertake.class, helpUnitId);
|
||||
OpinionReplyUnit helpReplyUnit = new OpinionReplyUnit();
|
||||
helpReplyUnit.setOpinionId(opinionId);
|
||||
helpReplyUnit.setUnitId(helpUnit.getId());
|
||||
helpReplyUnit.setUnitCode(helpUnit.getCode());
|
||||
helpReplyUnit.setUnitName(helpUnit.getName());
|
||||
helpReplyUnit.setIsMaster(false);
|
||||
dao.insert(helpReplyUnit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 当前任务
|
||||
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();
|
||||
OpinionReplyUnit replyUnit = dao.fetch(OpinionReplyUnit.class, Cnd.where(OpinionReplyUnit::getOpinionId, "=", opinionId).and(OpinionReplyUnit::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,125 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.models;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.json.JsonField;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("opinion_info")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("教代会意见")
|
||||
@TableIndexes({
|
||||
@Index(name = "INDEX_OPINION_INFO_SESSION_CODE", fields = {"sessionId", "code"})
|
||||
})
|
||||
public class OpinionInfo extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("意见编号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String code;
|
||||
|
||||
@Column
|
||||
@Comment("意见名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@NotBlank(message = "意见名称不能为空")
|
||||
@Size(max = 100)
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@Comment("意见类型")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer typeId;
|
||||
|
||||
@Column
|
||||
@Comment("教代会ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String sessionId;
|
||||
|
||||
@Column
|
||||
@Comment("意见人ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String createUserId;
|
||||
|
||||
@Column
|
||||
@Comment("意见人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String createUserName;
|
||||
|
||||
@Column
|
||||
@Comment("意见人工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 120)
|
||||
private String createUserLoginName;
|
||||
|
||||
@Column
|
||||
@Comment("联系电话")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("所属代表团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String delegationId;
|
||||
|
||||
@Column
|
||||
@Comment("单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@JsonField(dataFormat = "yyyy-MM-dd")
|
||||
private String createTime;
|
||||
|
||||
@Column
|
||||
@Comment("意见和建议")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String brief;
|
||||
|
||||
@Column
|
||||
@Comment("工作措施")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String measures;
|
||||
|
||||
@Column
|
||||
@Comment("建议落实部门")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> suggestUnits;
|
||||
|
||||
@Column
|
||||
@Comment("附件")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<JSONObject> files;
|
||||
|
||||
@Column
|
||||
@Comment("意见人签字ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String signId;
|
||||
|
||||
@Column
|
||||
@Comment("是否公示意见")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default(value = "0")
|
||||
private Boolean publicity;
|
||||
|
||||
@Column
|
||||
@Comment("是否优秀意见")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default(value = "0")
|
||||
private Boolean excellent;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.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;
|
||||
|
||||
/**
|
||||
* @ClassName OpinionReplyUnit
|
||||
* @Author JyuHsin
|
||||
* @Date 2026/2/3 14:00
|
||||
* @Version 1.0
|
||||
* @Description TODO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@Table("opinion_reply_unit")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("意见承办单位信息")
|
||||
public class OpinionReplyUnit extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("意见ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String opinionId;
|
||||
|
||||
@Column
|
||||
@Comment("承办单位ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("承办单位code")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String unitCode;
|
||||
|
||||
@Column
|
||||
@Comment("承办单位名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String unitName;
|
||||
|
||||
@Column
|
||||
@Comment("是否主办单位")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isMaster;
|
||||
|
||||
@Column
|
||||
@Comment("是否答复")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("0")
|
||||
private Boolean isReply;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@Table("opinion_type")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("意见类型")
|
||||
public class OpinionType extends BaseModel {
|
||||
|
||||
@Id
|
||||
@Comment("id")
|
||||
private Integer id;
|
||||
|
||||
@Column
|
||||
@Comment("编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String code;
|
||||
|
||||
@Column
|
||||
@Comment("名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.param;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.utils.PageUtil;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
|
||||
/**
|
||||
* 意见通用搜索
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class OpinionSearchParam extends PageForm {
|
||||
|
||||
private String name;
|
||||
private String code;
|
||||
private String sessionId;
|
||||
private String delegationId;
|
||||
private String createUserName;
|
||||
private String createUserLoginName;
|
||||
private String createUserKeyword;
|
||||
|
||||
/**
|
||||
* 构建通用查询参数
|
||||
*
|
||||
* @param cnd cnd
|
||||
* @param searchParam searchParam
|
||||
*/
|
||||
public static void buildSearch(Cnd cnd, OpinionSearchParam searchParam) {
|
||||
if (cnd == null) {
|
||||
cnd = Cnd.NEW();
|
||||
}
|
||||
if (StrUtil.isNotBlank(searchParam.getName())) {
|
||||
cnd.where().andLike("info.name", searchParam.getName());
|
||||
}
|
||||
if (StrUtil.isNotBlank(searchParam.getCode())) {
|
||||
cnd.where().andLike("info.code", searchParam.getCode());
|
||||
}
|
||||
cnd.andEX("info.sessionId", "=", searchParam.getSessionId());
|
||||
cnd.andEX("info.delegationId", "=", searchParam.getDelegationId());
|
||||
if (StrUtil.isNotBlank(searchParam.getCreateUserName())) {
|
||||
cnd.where().andLike("info.createUserName", searchParam.getCreateUserName());
|
||||
}
|
||||
if (StrUtil.isNotBlank(searchParam.getCreateUserLoginName())) {
|
||||
cnd.where().andLike("info.createUserLoginName", searchParam.getCreateUserLoginName());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(searchParam.getCreateUserKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.createUserName", searchParam.getCreateUserKeyword());
|
||||
seg.orLike("info.createUserLoginName", searchParam.getCreateUserKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
if (StrUtil.isAllNotBlank(searchParam.getPageOrderName(), searchParam.getPageOrderBy())) {
|
||||
cnd.orderBy(searchParam.getPageOrderName(), PageUtil.getOrder(searchParam.getPageOrderBy()));
|
||||
} else {
|
||||
cnd.asc("info.code");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface OpinionWriteService extends BaseService<OpinionInfo> {
|
||||
|
||||
/**
|
||||
* 生成意见编号 代表团编码+顺序号
|
||||
*
|
||||
* @param sessionId 届次id
|
||||
* @param delegationId 代表团id
|
||||
*/
|
||||
String generateOpinionCode(String sessionId,String delegationId);
|
||||
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.service.common;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
|
||||
public interface OpinionCommonService extends BaseService<OpinionInfo> {
|
||||
|
||||
/**
|
||||
* 查询意见信息
|
||||
*/
|
||||
NutMap info(String id);
|
||||
|
||||
/**
|
||||
* 导出word
|
||||
*
|
||||
* @param id
|
||||
* @param response
|
||||
*/
|
||||
void exportOpinionAsDocx(String id, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 导出word
|
||||
*
|
||||
* @param id
|
||||
* @param byteArrayOutputStream
|
||||
*/
|
||||
void exportOpinionAsDocx(String id, ByteArrayOutputStream byteArrayOutputStream);
|
||||
|
||||
/**
|
||||
* 导出单个反馈表
|
||||
*
|
||||
* @param id
|
||||
* @param byteArrayOutputStream
|
||||
*/
|
||||
void exportOpinionFeedBackAsDocx(String id, ByteArrayOutputStream byteArrayOutputStream);
|
||||
|
||||
|
||||
/**
|
||||
* 导出征集表
|
||||
*
|
||||
* @param id
|
||||
* @param byteArrayOutputStream
|
||||
*/
|
||||
void exportCollectAsDocx(String id, ByteArrayOutputStream byteArrayOutputStream);
|
||||
|
||||
/**
|
||||
* 根据意见id查询团长
|
||||
*
|
||||
* @param proposalId
|
||||
* @return
|
||||
*/
|
||||
String getDelegationHeadByOpinionId(String proposalId);
|
||||
|
||||
/**
|
||||
* 根据代表团id查询团长
|
||||
*
|
||||
* @param delegationId
|
||||
* @return
|
||||
*/
|
||||
String getDelegationHeadById(String delegationId);
|
||||
|
||||
/**
|
||||
* 获取自管代表团
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> getSelfManageDelegationIds();
|
||||
|
||||
/**
|
||||
* 获取自管承办单位
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ProposalUndertake getSelfManageUndertake();
|
||||
}
|
||||
+332
@@ -0,0 +1,332 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.service.common;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
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.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
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.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.vo.ProcessTaskVO;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.sys.models.Sys_user_role;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.web.commons.base.Globals;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalConsolidation;
|
||||
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.ProposalUndertake;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.ddr.poi.html.HtmlRenderPolicy;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.FieldFilter;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.Daos;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class OpinionCommonServiceImpl extends BaseServiceImpl<OpinionInfo> implements OpinionCommonService {
|
||||
|
||||
//找出富文本里面上传的图片
|
||||
static String IMG_SRC_REGEX = "<img\\s+[^>]*src\\s*=\\s*([\"'])(/platform/sys/file/download\\?id=.*?)\\1[^>]*>";
|
||||
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
@Inject
|
||||
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
|
||||
public OpinionCommonServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NutMap info(String id) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
throw new BaseException("意见信息不存在");
|
||||
}
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
tcs.fullName,
|
||||
tcs.fullName as sessionName,
|
||||
tcd.unionName,
|
||||
tcde.NAME AS delegationName
|
||||
FROM
|
||||
`opinion_info` info
|
||||
LEFT JOIN teacher_congress_session tcs ON tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegate tcd ON tcd.userId = info.createUserId
|
||||
AND tcd.sessionId = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcde ON tcde.id = tcd.delegationId
|
||||
LEFT JOIN opinion_type type on type.id = info.typeId
|
||||
WHERE
|
||||
info.id = @id
|
||||
""").setParam("id", id);
|
||||
NutMap info = (NutMap) dao().execute(sql.setCallback(Sqls.callback.map())).getResult();
|
||||
if (StrUtil.isNotBlank(info.getString("suggestUnits"))) {
|
||||
info.put("suggestUnits", String.join(",", Json.fromJson(ArrayList.class, info.getString("suggestUnits"))));
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportOpinionAsDocx(String id, HttpServletResponse response) {
|
||||
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
|
||||
exportOpinionAsDocx(id, byteArrayOutputStream);
|
||||
FieldFilter fieldFilter = FieldFilter.create(OpinionInfo.class, "^name|code$");
|
||||
OpinionInfo opinionInfo = Daos.ext(dao(), fieldFilter).fetch(OpinionInfo.class, id);
|
||||
String name = opinionInfo.getName();
|
||||
String code = opinionInfo.getCode();
|
||||
CommonDownloadUtil.download(code + "-" + name + ".docx", byteArrayOutputStream.toByteArray(), response);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportOpinionAsDocx(String id, ByteArrayOutputStream byteArrayOutputStream) {
|
||||
if (id == null || id.isEmpty()) {
|
||||
throw new BaseException("意见信息不存在");
|
||||
}
|
||||
|
||||
//基本信息
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.name,
|
||||
info.code,
|
||||
info.brief,
|
||||
info.measures,
|
||||
info.createUserName,
|
||||
DATE_FORMAT(info.createTime, '%Y年%m月%d日') AS createTime,
|
||||
info.unitName,
|
||||
tcde.unitName,
|
||||
tcde.mobile,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName
|
||||
FROM
|
||||
opinion_info info
|
||||
LEFT JOIN opinion_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
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
WHERE info.id = @id
|
||||
""").setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
execute(sql);
|
||||
NutMap docData = (NutMap) sql.getResult();
|
||||
//处理下富文本
|
||||
String brief = docData.getString("brief");
|
||||
String measures = docData.getString("measures");
|
||||
docData.put("brief", sysOfficeTemplateUtil.convertRichTextToDocText(brief));
|
||||
docData.put("measures", sysOfficeTemplateUtil.convertRichTextToDocText(measures));
|
||||
|
||||
// 流程实例
|
||||
ProcessInstance processInstance = dao().fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", id));
|
||||
|
||||
List<ProcessTaskVO> doneTaskVos = new ArrayList<>();
|
||||
List<ProcessTask> doneTaskList = flowEngine.processTaskService().getDoneTaskList(processInstance.getId(), null);
|
||||
for (ProcessTask doneTask : doneTaskList) {
|
||||
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(doneTask.getId());
|
||||
doneTaskVos.add(taskVO);
|
||||
}
|
||||
|
||||
// 按任务节点分组
|
||||
Map<String, List<ProcessTaskVO>> taskGroups = doneTaskVos.stream().collect(Collectors.groupingBy(ProcessTaskVO::getDisplayName));
|
||||
docData.putAll(taskGroups);
|
||||
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
||||
htmlRenderPolicy.getConfig().setShowDefaultTableBorderInTableCell(true);
|
||||
|
||||
Configure config = Configure.builder()
|
||||
.bind("brief", htmlRenderPolicy)
|
||||
.bind("measures", htmlRenderPolicy)
|
||||
.bind("taskFormData.tf_opinion", htmlRenderPolicy)
|
||||
.build();
|
||||
|
||||
try {
|
||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("opinion"), config).render(docData).writeAndClose(byteArrayOutputStream);
|
||||
} catch (IOException e) {
|
||||
log.error("意见导出失败{},提案id:{}", e.getMessage(), id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportOpinionFeedBackAsDocx(String id, ByteArrayOutputStream byteArrayOutputStream) {
|
||||
if (id == null || id.isEmpty()) {
|
||||
throw new BaseException("意见信息不存在");
|
||||
}
|
||||
|
||||
//基本信息
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.name,
|
||||
info.code,
|
||||
info.measures,
|
||||
info.createUserName,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
tcs.j,
|
||||
tcs.c
|
||||
FROM
|
||||
opinion_info info
|
||||
LEFT JOIN opinion_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
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
WHERE info.id = @id
|
||||
""").setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
execute(sql);
|
||||
NutMap info = (NutMap) sql.getResult();
|
||||
|
||||
// 获取流程实例
|
||||
ProcessInstance processInstance = dao().fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", id));
|
||||
|
||||
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
||||
htmlRenderPolicy.getConfig().setShowDefaultTableBorderInTableCell(true);
|
||||
|
||||
Configure config = Configure.builder().build();
|
||||
try {
|
||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("opinion_feedback"), config).render(info).writeAndClose(byteArrayOutputStream);
|
||||
} catch (IOException e) {
|
||||
log.error("意见导出失败{},提案id:{}", e.getMessage(), id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportCollectAsDocx(String id, ByteArrayOutputStream byteArrayOutputStream) {
|
||||
if (id == null || id.isEmpty()) {
|
||||
throw new BaseException("意见信息不存在");
|
||||
}
|
||||
|
||||
//基本信息
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.name,
|
||||
info.code,
|
||||
info.researchFindings,
|
||||
info.brief,
|
||||
info.measures,
|
||||
info.createUserName,
|
||||
tcde.unitName,
|
||||
tcde.mobile,
|
||||
type.name AS typeName,
|
||||
tcs.j,
|
||||
tcs.c,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName
|
||||
FROM
|
||||
opinion_info info
|
||||
LEFT JOIN opinion_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
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
WHERE info.id = @id
|
||||
""").setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
execute(sql);
|
||||
NutMap info = (NutMap) sql.getResult();
|
||||
HashMap<String, Object> docData = new HashMap<>(info);
|
||||
|
||||
//处理下富文本
|
||||
String brief = info.getString("brief");
|
||||
String measures = info.getString("measures");
|
||||
info.put("brief", sysOfficeTemplateUtil.convertRichTextToDocText(brief));
|
||||
info.put("measures", sysOfficeTemplateUtil.convertRichTextToDocText(measures));
|
||||
|
||||
// 高校
|
||||
info.put("schoolName", Globals.AppName);
|
||||
|
||||
Configure config = Configure.builder().build();
|
||||
try {
|
||||
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("opinion"), config).render(docData).writeAndClose(byteArrayOutputStream);
|
||||
} catch (IOException e) {
|
||||
log.error("提案导出失败{},提案id:{}", e.getMessage(), id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDelegationHeadByOpinionId(String opinionId) {
|
||||
OpinionInfo opinionInfo = dao().fetch(OpinionInfo.class, opinionId);
|
||||
return getDelegationHeadById(opinionInfo.getDelegationId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDelegationHeadById(String delegationId) {
|
||||
Sys_role sys_role = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD);
|
||||
Sys_user_role sys_user_role = dao().fetch(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "=", sys_role.getId()).and(Sys_user_role::getTcDelegationId, "=", delegationId));
|
||||
if (ObjectUtil.isEmpty(sys_user_role)) {
|
||||
throw new BaseException("代表团没有设置团长,无法流转到下一步,请联系管理员进行设置。");
|
||||
}
|
||||
Sys_user sys_user = dao().fetch(Sys_user.class, sys_user_role.getUserId());
|
||||
if (ObjectUtil.isEmpty(sys_user)) {
|
||||
throw new BaseException("代表团没有设置团长,无法流转到下一步,请联系管理员进行设置。");
|
||||
}
|
||||
return sys_user.getLoginname();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSelfManageDelegationIds() {
|
||||
Sys_role role = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD.name());
|
||||
Sys_role viceRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_VICE_DELEGATION_HEAD.name());
|
||||
List<Sys_user_role> sysUserRoles = dao().query(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "in", List.of(role.getId(), viceRole.getId()))
|
||||
.and(Sys_user_role::getUserId, "=", SecurityUtil.getUserId()));
|
||||
List<String> delegationIds = sysUserRoles.stream()
|
||||
.map(Sys_user_role::getTcDelegationId)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.toList();
|
||||
return delegationIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProposalUndertake getSelfManageUndertake() {
|
||||
Sys_role role = sysRoleService.getByCode(RoleConstant.PROPOSAL_UNIT_LEADER.name());
|
||||
Sys_user_role userRole = dao().fetch(Sys_user_role.class, Cnd.where(Sys_user_role::getRoleId, "=", role.getId())
|
||||
.and(Sys_user_role::getUserId, "=", SecurityUtil.getUserId()));
|
||||
if(Lang.isEmpty(userRole)) {
|
||||
throw new RuntimeException("当前登录用户不是" + role.getName());
|
||||
}
|
||||
return dao().fetch(ProposalUndertake.class, Cnd.where(ProposalUndertake::getId, "=", userRole.getUnderTakeId()));
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.budwk.app.zhgh.democratic.opinion.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.opinion.models.OpinionInfo;
|
||||
import com.budwk.app.zhgh.democratic.opinion.service.OpinionWriteService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalWriteService;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class OpinionWriteServiceImpl extends BaseServiceImpl<OpinionInfo> implements OpinionWriteService {
|
||||
|
||||
public OpinionWriteServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateOpinionCode(String sessionId, String delegationId) {
|
||||
Teacher_congress_delegation delegation = dao().fetch(Teacher_congress_delegation.class, delegationId);
|
||||
|
||||
Sql sql = Sqls.fetchString("""
|
||||
SELECT
|
||||
MAX( t1.code ) as opinionCode
|
||||
FROM
|
||||
opinion_info t1
|
||||
WHERE
|
||||
t1.sessionId = @sessionId
|
||||
AND t1.delegationId = @delegationId
|
||||
""");
|
||||
sql.setParam("sessionId", sessionId);
|
||||
sql.setParam("delegationId", delegationId);
|
||||
execute(sql);
|
||||
String opinionCode = sql.getString();
|
||||
if (StrUtil.isBlank(opinionCode)) {
|
||||
opinionCode = delegation.getCode() + "-" + "01";
|
||||
} else {
|
||||
String s = String.format("%02d", (Convert.toInt(opinionCode.substring(opinionCode.length() - 2))) + 1);
|
||||
opinionCode = delegation.getCode() + "-" + s;
|
||||
}
|
||||
return opinionCode;
|
||||
}
|
||||
}
|
||||
+20
@@ -5,10 +5,13 @@ import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.sys.models.Sys_role;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -49,6 +52,23 @@ public class TeacherCongressCommonController {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
public Result listDelegate(String sessionId, String keyWord) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("sessionId", "=", sessionId);
|
||||
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("userName", keyWord);
|
||||
group.orLike("loginName", keyWord);
|
||||
cnd.and(group);
|
||||
|
||||
cnd.limit(1, 5);
|
||||
|
||||
List<Teacher_congress_delegate> list = dao.query(Teacher_congress_delegate.class, cnd);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 代表类型
|
||||
* @return
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<!-- 完全自定义卡片容器,复刻el-card样式 -->
|
||||
<div
|
||||
class="el-card custom-card"
|
||||
:style="{ width: width || '100%' }"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<!-- 卡片头部 - 独立节点 -->
|
||||
<div v-if="$slots.header" class="el-card__header card-header">
|
||||
<slot name="header"></slot>
|
||||
</div>
|
||||
|
||||
<!-- 可滚动内容区域 - 独立节点 -->
|
||||
<div class="el-card__body card-body">
|
||||
<slot></slot>
|
||||
</div>
|
||||
|
||||
<!-- 卡片底部 - 独立节点 -->
|
||||
<div v-if="$slots.footer" class="el-card__footer card-footer">
|
||||
<slot name="footer"></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
name: 'CustomCard',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
// 保留el-card的核心属性,保证使用体验一致
|
||||
width: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
shadow: {
|
||||
type: String,
|
||||
default: 'hover', // 同el-card默认值
|
||||
validator: (val) => ['always', 'hover', 'never'].includes(val)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 根据shadow属性动态设置阴影样式
|
||||
shadowClass() {
|
||||
return {
|
||||
'el-card--shadow-always': this.shadow === 'always',
|
||||
'el-card--shadow-hover': this.shadow === 'hover',
|
||||
'el-card--shadow-never': this.shadow === 'never'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 卡片核心样式 - 完全复刻el-card */
|
||||
.custom-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - 84px); /* 关键:卡片高度撑满父容器 */
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
/* 继承el-card的字体样式 */
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 14px;
|
||||
transition: box-shadow 0.3s ease-in-out;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 阴影样式 - 完全对齐el-card */
|
||||
:deep(.el-card--shadow-always) {
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
:deep(.el-card--shadow-hover):hover {
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
:deep(.el-card--shadow-never) {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* 头部样式 - 固定高度,不滚动 */
|
||||
.card-header {
|
||||
flex-shrink: 0; /* 关键:不被压缩 */
|
||||
padding: 18px 20px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 内容区域 - 自动填充剩余空间,可滚动 */
|
||||
.card-body {
|
||||
flex: 1; /* 关键:占满剩余高度 */
|
||||
padding: 20px;
|
||||
overflow-y: auto; /* 垂直滚动 */
|
||||
overflow-x: hidden; /* 隐藏水平滚动 */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 底部样式 - 固定高度,不滚动 */
|
||||
.card-footer {
|
||||
flex-shrink: 0; /* 关键:不被压缩 */
|
||||
padding: 18px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
box-sizing: border-box;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* 兼容el-card的默认样式覆盖 */
|
||||
:deep(.el-card__header) {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -362,6 +362,7 @@
|
||||
Vue.component("excel-import", httpVueLoader("/components/plugins/sysImport/excelImport.vue?v=" + new Date().getTime()))
|
||||
Vue.component("flow-form-button", httpVueLoader("/components/plugins/flowable/formButton.vue?v=" + new Date().getTime()))
|
||||
Vue.component("snaker-flow", httpVueLoader("/components/plugins/snaker/snakerFlow.vue?v=" + new Date().getTime()))
|
||||
Vue.component("custom-card", httpVueLoader("/components/plugins/sysCard/index.vue?v=" + new Date().getTime()))
|
||||
Vue.component(
|
||||
"snaker-flow-task-form-action",
|
||||
httpVueLoader("/components/plugins/snaker/snakerFlowTaskFormAction.vue?v=" + new Date().getTime())
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
const OPINION_INFO = {
|
||||
name: "OpinionInfo",
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<div class="opinion-info">
|
||||
<div class="process-title">
|
||||
意见基础信息
|
||||
</div>
|
||||
<h3 style="text-align: center;font-weight: 600" class="pt10 pb10">
|
||||
{{ viewData.name }}
|
||||
</h3>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="意见编号">{{ viewData.code }}</el-descriptions-item>
|
||||
<el-descriptions-item label="意见人">{{viewData.createUserName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="意见时间">{{ viewData.createTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="教代会届次"> {{ viewData.sessionName || '暂无' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="意见人单位">{{ viewData.unitName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="代表团名称">{{ viewData.delegationName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="意见类别">
|
||||
{{viewData.typeName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="建议承办单位" :span="2">
|
||||
{{viewData.suggestUnits}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="意见和建议" :span="3">
|
||||
<div class="text-left" v-html="viewData.brief"></div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工作措施" :span="3">
|
||||
<div class="text-left" v-html="viewData.measures"></div>
|
||||
</el-descriptions-item>
|
||||
<!--<el-descriptions-item label="附件" :span="3">
|
||||
<file-preview :files="viewData.files" complete_result></file-preview>
|
||||
</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="签字" :span="3">-->
|
||||
<!-- <el-image :src="viewData.signature" class="signature-image">-->
|
||||
<!-- <div slot="error" class="image-slot">-->
|
||||
<!-- <i class="el-icon-picture-outline"></i>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-image>-->
|
||||
<!-- </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="办理评价" v-if="['feedback'].includes(task.taskName)" :span="3">
|
||||
<dict-tag :options="dict.type.PROPOSAL_FEEDBACK"
|
||||
:value="task.ext.tf_feedback"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="办理结果" v-else>
|
||||
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
|
||||
:value="task.ext.submitType"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
|
||||
<template v-if="['schoolAudit', 'office'].includes(task.taskName)">
|
||||
<el-descriptions-item label="主办单位" :span="3">
|
||||
{{task.ext.tf_masterUnitName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="协办单位" :span="3">
|
||||
{{task.ext.tf_slaveUnitNameStr}}
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
|
||||
<template v-if="['master_reply', 'slave_reply'].includes(task.taskName)">
|
||||
<el-descriptions-item label="落实情况" :span="3">
|
||||
<dict-tag :options="dict.type.PROPOSAL_REPLY_IMPLEMENT"
|
||||
:value="task.ext.tf_implementState"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
|
||||
<el-descriptions-item label="办理意见" :span="3" v-if="!task.ext.isFirstTaskNode">
|
||||
<div v-html="task.taskFormData.tf_opinion"></div>
|
||||
</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<slot></slot>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["PROCESS_TASK_SUBMIT_TYPE", "PROPOSAL_FEEDBACK", "PROPOSAL_REPLY_IMPLEMENT"],
|
||||
props: {
|
||||
hide_slave: false
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
doneTasks: [],
|
||||
row: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 打开
|
||||
onOpen(row) {
|
||||
this.row = row
|
||||
this.visible = true
|
||||
this.getInfo()
|
||||
this.getDoneTasks()
|
||||
},
|
||||
|
||||
// 获取申请信息
|
||||
getInfo() {
|
||||
this.$axios.post("/platform/opinion/common/opinionInfo", {id: this.row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 获取已办任务审批记录
|
||||
getDoneTasks() {
|
||||
this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.doneTasks = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
style:
|
||||
/*language=CSS*/
|
||||
`
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="名称">
|
||||
<el-input v-model="pageForm.name" placeholder="请输入名称"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button type="primary" size="mini" icon="el-icon-plus" @click="openAdd">新增</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" border stripe>
|
||||
<el-table-column label="序号" type="index" :index="indexMethod" width="50px"></el-table-column>
|
||||
<el-table-column prop="name" label="名称"></el-table-column>
|
||||
<el-table-column prop="code" label="编码"></el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button size="mini" type="danger" @click="doDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogVisible" :title="formData.id?'编辑':'新增'" width="500px">
|
||||
<el-form :model="formData" :rules="formRules" label-width="80px" ref="formRef" size="small">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入名称" max="10"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="formData.code" placeholder="请输入编码" max="10"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="dialogVisible=false">取消</el-button>
|
||||
<el-button type="primary" @click="submit">提交</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
formRules: {
|
||||
name: [{ required: true, message: "请输入名称", trigger: ["blur", "change"] }],
|
||||
code: [{ required: true, message: "请输入编码", trigger: ["blur", "change"] }]
|
||||
},
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openAdd() {
|
||||
this.formData = {}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openEdit(row) {
|
||||
this.formData = { ...row }
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios.post(loc() + (this.formData.id ? "/update" : "/insert"), this.formData).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogVisible = false
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post(loc() + "/delete", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
<!--#
|
||||
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>
|
||||
<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"></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 === '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>
|
||||
<opinion-info ref="infoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" label-width="120px" :rules="formRules" label-suffix="">
|
||||
<el-form-item label="满意度" prop="tf_feedback"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.tf_feedback" size="small">
|
||||
<el-radio v-for="item in dict.type.PROPOSAL_FEEDBACK" :key="item.code"
|
||||
:label="item.code" border>{{item.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<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(1)" size="small" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</opinion-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../../common/info.js'){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["PROPOSAL_FEEDBACK"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"opinion-info": OPINION_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
|
||||
},
|
||||
formData: {},
|
||||
showApprovalForm: false,
|
||||
sessionOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openAudit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskKey: row.taskKey,
|
||||
taskName: row.taskName,
|
||||
instanceId: row.instanceId
|
||||
}
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading('提交中')
|
||||
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()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 撤销
|
||||
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.doSearch()
|
||||
},
|
||||
|
||||
// 查询开启的教代会
|
||||
listOpenSession() {
|
||||
this.$axios.post("/platform/opinion/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()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.listOpenSession()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,170 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style></style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<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>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool :columns.sync="tableColumns"></table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" header-align="center" style="width: 100%" row-key="id">
|
||||
<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 === '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="400px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
|
||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" size="mini" type="primary"
|
||||
@click="onEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" size="mini" type="danger" @click="onRevoke(row)">
|
||||
撤回
|
||||
</el-button>
|
||||
<!--v-if="row.taskKey === 'startTask' || !row.instanceId"-->
|
||||
<el-button size="mini" type="danger"
|
||||
@click="del(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<opinion-info ref="infoRef"></opinion-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../../common/info.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"opinion-info": OPINION_INFO,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sessionOptions: [],
|
||||
businessNo: null,
|
||||
tableColumns: [
|
||||
{label: "意见编号", prop: "code"},
|
||||
{label: "意见名称", prop: "name", width: "200px"},
|
||||
{label: "意见人", prop: "createUserName"},
|
||||
{label: "意见类别", prop: "typeName"},
|
||||
{label: "届次", prop: "sessionName"},
|
||||
{label: "代表团", prop: "delegationName"},
|
||||
{label: "当前节点", prop: "taskName"},
|
||||
{label: "流程状态", prop: "instanceState"}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onEdit(row) {
|
||||
commonUtil.pjaxPush('/platform/opinion/write?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id)
|
||||
},
|
||||
openRevoke(row) {
|
||||
this.$confirm("您确定要撤销申请吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
//教代会change
|
||||
async meetingChange(val) {
|
||||
this.doSearch()
|
||||
//this.delegationOptions = await proposal.getDelegation(val)
|
||||
//this.committeeOptions = await this.getInstitutions(val)
|
||||
},
|
||||
listSession() {
|
||||
this.$axios.post("/platform/opinion/common/listSession").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.sessionOptions = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
onRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", { taskId: row.startTaskId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
del(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post(loc() + "/delete", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.listSession()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,257 @@
|
||||
<!--#
|
||||
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" ref="tableRef" row-key="id" 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"
|
||||
>
|
||||
<template v-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>
|
||||
<opinion-info ref="infoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" label-width="120px" :rules="formRules" label-suffix="">
|
||||
<el-form-item label="审核结果" prop="tf_officeResult"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.tf_officeResult" size="small">
|
||||
<el-radio label="YES" border>通过</el-radio>
|
||||
<el-radio label="NO" border>不通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="主办单位"
|
||||
:rules="[{required:true, message:'必填',trigger:['change','blur']}]"
|
||||
prop="tf_masterUnitId"
|
||||
>
|
||||
<el-select v-model="formData.tf_masterUnitId" filterable clearable style="width: 100%" placeholder="请选择主办单位">
|
||||
<el-option
|
||||
v-for="item in underTakeOptions"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:disabled="formData && formData.tf_slaveUnitIds.includes(item.id)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="协办单位" prop="tf_slaveUnitIds">
|
||||
<el-select v-model="formData.tf_slaveUnitIds" filterable clearable multiple
|
||||
style="width: 100%" placeholder="请选择协办单位">
|
||||
<el-option
|
||||
v-for="item in underTakeOptions"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:disabled="item.id===formData.tf_masterUnitId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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(1)" size="small" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</opinion-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../../common/info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"opinion-info": OPINION_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
|
||||
},
|
||||
formData: {
|
||||
tf_masterUnitId: null,
|
||||
tf_slaveUnitIds: []
|
||||
},
|
||||
showApprovalForm: false,
|
||||
sessionOptions: [],
|
||||
delegationOptions: [],
|
||||
underTakeOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openAudit(row) {
|
||||
const taskVariable = JSON.parse(row.taskVariable)
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName,
|
||||
tf_masterUnitId: taskVariable?.tf_masterUnitId || null,
|
||||
tf_slaveUnitIds: taskVariable?.tf_slaveUnitIds || [],
|
||||
tf_officeResult: 'YES',
|
||||
}
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading('提交中')
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val,
|
||||
tf_masterUnitName: this.formData.tf_masterUnitId ? this.underTakeOptions.find(v => v.id === this.formData.tf_masterUnitId)?.name : null,
|
||||
tf_slaveUnitNames: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name),
|
||||
tf_slaveUnitNameStr: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name).join(','),
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
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.doSearch()
|
||||
},
|
||||
|
||||
// 查询开启的教代会
|
||||
listOpenSession() {
|
||||
this.$axios.post("/platform/opinion/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()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查询承办单位
|
||||
listUnderTake() {
|
||||
this.$axios.post("/platform/proposal/common/listUnderTake").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.underTakeOptions = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.listOpenSession()
|
||||
this.listUnderTake()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+278
@@ -0,0 +1,278 @@
|
||||
<!--#
|
||||
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" ref="tableRef" row-key="id" 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"
|
||||
>
|
||||
<template v-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="openEdit(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>
|
||||
<opinion-info ref="infoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" label-width="120px" :rules="formRules" label-suffix="">
|
||||
<el-form-item label="审核结果" prop="tf_schoolResult"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.tf_schoolResult" size="small">
|
||||
<el-radio label="YES" border>通过</el-radio>
|
||||
<el-radio label="NO" border>不通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="主办单位"
|
||||
:rules="[{required:true, message:'必填',trigger:['change','blur']}]"
|
||||
prop="tf_masterUnitId"
|
||||
>
|
||||
<el-select v-model="formData.tf_masterUnitId" filterable clearable style="width: 100%" placeholder="请选择主办单位">
|
||||
<el-option
|
||||
v-for="item in underTakeOptions"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:disabled="formData && formData.tf_slaveUnitIds.includes(item.id)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="协办单位" prop="tf_slaveUnitIds">
|
||||
<el-select v-model="formData.tf_slaveUnitIds" filterable clearable multiple
|
||||
style="width: 100%" placeholder="请选择协办单位">
|
||||
<el-option
|
||||
v-for="item in underTakeOptions"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:disabled="item.id===formData.tf_masterUnitId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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(1)" size="small" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</opinion-info>
|
||||
</template>
|
||||
|
||||
<template #public>
|
||||
<basic-form @ready="onReady" @edit="$refs.guava.index()" ref="basicFormRef" :school="true"></basic-form>
|
||||
</template>
|
||||
|
||||
<template #public_footer>
|
||||
<el-button @click="$refs.guava.index()">取消</el-button>
|
||||
<el-button type="primary" @click="$refs.basicFormRef?.edit()">提交</el-button>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../../common/info.js'){}#-->
|
||||
<!--#include('../write/form.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"opinion-info": OPINION_INFO,
|
||||
"basic-form": BASIC_FORM,
|
||||
},
|
||||
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
|
||||
},
|
||||
formData: {
|
||||
tf_masterUnitId: null,
|
||||
tf_slaveUnitIds: []
|
||||
},
|
||||
showApprovalForm: false,
|
||||
sessionOptions: [],
|
||||
delegationOptions: [],
|
||||
underTakeOptions: [],
|
||||
|
||||
row: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openEdit(row) {
|
||||
this.row = row
|
||||
this.$refs.guava.public()
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.basicFormRef.ready(this.row.id, this.row.taskId)
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openAudit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName,
|
||||
tf_masterUnitId: null,
|
||||
tf_slaveUnitIds: [],
|
||||
tf_schoolResult: 'YES',
|
||||
roleCode: 'OFFICE_MANAGER',
|
||||
}
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading('提交中')
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val,
|
||||
tf_masterUnitName: this.formData.tf_masterUnitId ? this.underTakeOptions.find(v => v.id === this.formData.tf_masterUnitId)?.name : null,
|
||||
tf_slaveUnitNames: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name),
|
||||
tf_slaveUnitNameStr: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name).join(','),
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
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.doSearch()
|
||||
},
|
||||
|
||||
// 查询开启的教代会
|
||||
listOpenSession() {
|
||||
this.$axios.post("/platform/opinion/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()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查询承办单位
|
||||
listUnderTake() {
|
||||
this.$axios.post("/platform/proposal/common/listUnderTake").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.underTakeOptions = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.listOpenSession()
|
||||
this.listUnderTake()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
<!--#
|
||||
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-button type="primary" @click="batchSubmit" size="mini" class="mr5">一键提交</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" ref="tableRef" row-key="id" 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"
|
||||
>
|
||||
<template v-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="onSubmit(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>
|
||||
<opinion-info ref="infoRef"></opinion-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../../common/info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"opinion-info": OPINION_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
|
||||
},
|
||||
formData: {},
|
||||
sessionOptions: [],
|
||||
delegationOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
onSubmit(row) {
|
||||
this.handleTaskAction([row.taskId], '您当前选择了1条记录,确定要提交吗?')
|
||||
},
|
||||
async batchSubmit() {
|
||||
const res = await this.$axios.post("/platform/opinion/schoolSubmit/queryBatch", this.pageForm)
|
||||
if(res.code !== 0) {
|
||||
this.$message.error(res.msg)
|
||||
return
|
||||
}
|
||||
if(res.data.length === 0) {
|
||||
this.$message.warning("当前筛选条件暂无数据")
|
||||
return
|
||||
}
|
||||
const msg = '根据当前筛选条件,共有' + res.data.length + '条数据,确定要一键提交吗?'
|
||||
this.handleTaskAction(res.data, msg)
|
||||
},
|
||||
handleTaskAction(data, msg) {
|
||||
this.$confirm(msg, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading('提交中')
|
||||
this.$axios.post("/platform/opinion/schoolSubmit/executeTask", {
|
||||
data: JSON.stringify(data)
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
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.doSearch()
|
||||
},
|
||||
|
||||
// 查询开启的教代会
|
||||
listOpenSession() {
|
||||
this.$axios.post("/platform/opinion/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()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.listOpenSession()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
<!--#
|
||||
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"></table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" ref="tableRef" row-key="id" 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"
|
||||
>
|
||||
<template v-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="100px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<opinion-info ref="infoRef"></opinion-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../../common/info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"opinion-info": OPINION_INFO,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{label: "意见编号", prop: "code"},
|
||||
{label: "意见名称", prop: "name", width: "200px"},
|
||||
{label: "意见类别", prop: "typeName"},
|
||||
{label: "届次", prop: "sessionName"},
|
||||
{label: "代表团", prop: "delegationName"},
|
||||
{label: "流程状态", prop: "instanceState"}
|
||||
],
|
||||
pageForm: {},
|
||||
sessionOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
|
||||
// 教代会
|
||||
async meetingChange(val) {
|
||||
this.doSearch()
|
||||
},
|
||||
|
||||
// 查询开启的教代会
|
||||
listOpenSession() {
|
||||
this.$axios.post("/platform/opinion/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()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.listOpenSession()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+223
@@ -0,0 +1,223 @@
|
||||
<!--#
|
||||
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" ref="tableRef" row-key="id" 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"
|
||||
>
|
||||
<template v-if="column.prop === 'instanceState'" scope="{row}">
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
|
||||
size="small"></enum-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>
|
||||
</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>
|
||||
<opinion-info ref="infoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" label-width="120px" :rules="formRules" label-suffix="">
|
||||
<el-form-item label="承办单位">
|
||||
<el-input :value="formData.underTakeName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="落实情况" prop="tf_implementState"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.tf_implementState" size="small">
|
||||
<el-radio v-for="item in dict.type.PROPOSAL_REPLY_IMPLEMENT" :label="item.code" border>
|
||||
{{item.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="答复内容" prop="tf_opinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<text-editor v-model="formData.tf_opinion"></text-editor>
|
||||
</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(1)" size="small" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</opinion-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../../common/info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
dicts: ["PROPOSAL_REPLY_IMPLEMENT"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"opinion-info": OPINION_INFO,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{label: "意见编号", prop: "code"},
|
||||
{label: "意见名称", prop: "name", width: "200px"},
|
||||
{label: "意见类别", prop: "typeName"},
|
||||
{label: "届次", prop: "sessionName"},
|
||||
{label: "代表团", prop: "delegationName"},
|
||||
{label: "承办单位", prop: "underTakeName"},
|
||||
{label: "承办类型", prop: "underTakeIsMaster"},
|
||||
{label: "当前节点", prop: "curTaskName"},
|
||||
{label: "流程状态", prop: "instanceState"}
|
||||
],
|
||||
pageForm: {
|
||||
approval: false
|
||||
},
|
||||
formData: {},
|
||||
showApprovalForm: false,
|
||||
sessionOptions: [],
|
||||
delegationOptions: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openAudit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName,
|
||||
opinionId: row.id,
|
||||
underTakeName: row.underTakeName,
|
||||
underTakeIsMaster: row.underTakeIsMaster
|
||||
}
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading('提交中')
|
||||
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()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
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.doSearch()
|
||||
},
|
||||
|
||||
// 查询开启的教代会
|
||||
listOpenSession() {
|
||||
this.$axios.post("/platform/opinion/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()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.listOpenSession()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,374 @@
|
||||
const BASIC_FORM = {
|
||||
name: "BasicForm",
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="代表姓名" prop="createUserId">
|
||||
<user-select
|
||||
:disabled="school"
|
||||
ref="userSelectRef"
|
||||
v-model="formData.createUserId"
|
||||
style="width: 100%"
|
||||
api="/platform/teacherCongress/common/listDelegate"
|
||||
option_label="userName"
|
||||
option_value="userId"
|
||||
:api_params="{sessionId:formData.sessionId}"
|
||||
:option_label_func="(item)=>{return item.userName + ' - ' + item.loginName}"
|
||||
@change="userChange"
|
||||
></user-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="意见时间" prop="createTime">
|
||||
<el-input readonly v-model="formData.createTime" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属教代会" prop="sessionId">
|
||||
<el-select
|
||||
:disabled="school"
|
||||
@change="meetingChange"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择所属教代会"
|
||||
v-model="formData.sessionId"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option :key="item.id" :label="item.fullName" :value="item.id"
|
||||
v-for="item in sessionOptions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属代表团" prop="delegationId">
|
||||
<el-select clearable filterable placeholder="请选择所属代表团" v-model="formData.delegationId"
|
||||
style="width: 100%" disabled>
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in delegationOptions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位" prop="unitName">
|
||||
<el-input v-model="formData.unitName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="mobile">
|
||||
<el-input v-model="formData.mobile" clearable placeholder="请输入联系电话"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="意见名称" prop="name">
|
||||
<el-input maxlength="100" placeholder="请输入意见名称" v-model="formData.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="意见类别" prop="typeId">
|
||||
<el-select v-model="formData.typeId" style="width: 100%" placeholder="请选择意见类别">
|
||||
<el-option :key="item.code" :label="item.name" :value="item.id"
|
||||
v-for="item in typeOptions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="建议承办单位" prop="suggestUnits">
|
||||
<el-select v-model="formData.suggestUnits" multiple filterable style="width: 100%" placeholder="请选择建议承办单位">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.name"
|
||||
v-for="item in suggestUnitOptions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="意见和建议" prop="brief">
|
||||
<text-editor v-model="formData.brief" key="brief" placeholder="请输入意见和建议"></text-editor>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="工作措施" prop="measures">
|
||||
<text-editor v-model="formData.measures" key="measures"
|
||||
placeholder="请输入工作措施"></text-editor>
|
||||
</el-form-item>
|
||||
|
||||
<!--<el-form-item label="附件上传" prop="files">
|
||||
<file-upload
|
||||
:value.sync="formData.files"
|
||||
:upload_number="5"
|
||||
upload_result_category="array"
|
||||
upload_mode="drag"
|
||||
complete_result
|
||||
></file-upload>
|
||||
</el-form-item>-->
|
||||
|
||||
<!--<el-form-item label="电子签名" prop="signature">
|
||||
<pc-signature v-model="formData.signature"></pc-signature>
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
`,
|
||||
props: {
|
||||
school: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bizId: '',
|
||||
taskId: '',
|
||||
formData: {},
|
||||
sessionOptions: [],
|
||||
delegationOptions: [],
|
||||
typeOptions: [],
|
||||
formRules: {
|
||||
createUserId: [{required: true, message: "请选择意见人", trigger: ["blur", "change"]}],
|
||||
createTime: [{required: true, message: "请输入意见时间", trigger: ["blur", "change"]}],
|
||||
name: [{required: true, message: "请输入意见名称", trigger: ["blur", "change"]}],
|
||||
delegationId: [{required: true, message: "请选择所属代表团", trigger: ["blur", "change"]}],
|
||||
sessionId: [{required: true, message: "请选择所属教代会", trigger: ["blur", "change"]}],
|
||||
typeId: [{required: true, message: "请选择意见类别", trigger: ["blur", "change"]}],
|
||||
suggestUnits: [{required: true, message: "请选择建议承办单位", trigger: ["blur", "change"]}],
|
||||
brief: [{required: true, message: "请输入意见和建议", trigger: ["blur", "change"]}],
|
||||
measures: [{required: true, message: "请输入工作措施", trigger: ["blur", "change"]}],
|
||||
unitName: [{required: true, message: "请输入单位", trigger: ["blur", "change"]}],
|
||||
mobile: [{required: true, message: "请输入联系方式", trigger: ["blur", "change"]}],
|
||||
signature: [{required: false, message: "请扫描二维码进行签字", trigger: ["blur", "change"]}]
|
||||
},
|
||||
// 建议承办单位
|
||||
suggestUnitOptions: [],
|
||||
|
||||
tempUserId: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async ready(bizId, taskId) {
|
||||
this.bizId = bizId
|
||||
this.taskId = taskId
|
||||
await this.init()
|
||||
this.listSuggestUnit()
|
||||
this.listOpinionType()
|
||||
this.echoRepresentativeName()
|
||||
},
|
||||
async edit() {
|
||||
const valid = await this.$refs["addForm"].validate()
|
||||
if (valid) {
|
||||
if (!this.formData.name || this.formData.name.trim().length < 1) {
|
||||
this.$message.warning("请输入意见名称")
|
||||
return
|
||||
}
|
||||
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading('正在提交中')
|
||||
this.$axios.post('/platform/opinion/schoolAudit/edit', { info: JSON.stringify(this.formData) }).then(res => {
|
||||
loading.close()
|
||||
if (res.code === 0) {
|
||||
this.$message.success("提交成功")
|
||||
this.$emit('edit')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
userChange(val) {
|
||||
const user = this.$refs.userSelectRef.options.find(item => item.userId === val)
|
||||
this.searchDelegation()
|
||||
this.$set(this.formData, "createUserName", user?.userName)
|
||||
this.$set(this.formData, "createUserLoginName", user?.loginName)
|
||||
this.$set(this.formData, "mobile", user?.mobile)
|
||||
this.$set(this.formData, "unitName", user.unitName)
|
||||
},
|
||||
async onSave() {
|
||||
const valid = await this.$refs["addForm"].validate()
|
||||
if (valid) {
|
||||
if (!this.formData.name || this.formData.name.trim().length < 1) {
|
||||
this.$message.warning("请输入意见名称")
|
||||
return
|
||||
}
|
||||
|
||||
this.$axios.post("/platform/opinion/write/save", {info: JSON.stringify(this.formData)}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.formData = res.data
|
||||
commonUtil.pjaxPush('/platform/opinion/mine')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 提交
|
||||
async onSubmit() {
|
||||
const valid = await this.$refs["addForm"].validate()
|
||||
if (valid) {
|
||||
if (!this.formData.name || this.formData.name.trim().length < 1) {
|
||||
this.$message.warning("请输入意见名称")
|
||||
return
|
||||
}
|
||||
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading('正在提交中')
|
||||
this.$axios.post('/platform/opinion/write/submit', {info: JSON.stringify(this.formData)}).then(res => {
|
||||
loading.close()
|
||||
if (res.code === 0) {
|
||||
this.$message.success("提交成功")
|
||||
commonUtil.pjaxPush('/platform/opinion/mine')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 重新提交
|
||||
async onSubmitAgain() {
|
||||
const valid = await this.$refs["addForm"].validate()
|
||||
if (valid) {
|
||||
if (!this.formData.name || this.formData.name.trim().length < 1) {
|
||||
this.$message.warning("请输入意见名称")
|
||||
return
|
||||
}
|
||||
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post('/platform/opinion/write/submitAgain', {
|
||||
info: JSON.stringify(this.formData),
|
||||
taskId: GetQueryString("taskId")
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("提交成功")
|
||||
commonUtil.pjaxPush('/platform/opinion/mine')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取意见类别
|
||||
listOpinionType() {
|
||||
this.$axios.post("/platform/opinion/common/listOpinionType").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.typeOptions = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
//教代会change
|
||||
async meetingChange(val) {
|
||||
this.formData.delegationId = null
|
||||
this.formData.committeeId = null
|
||||
this.listDelegation()
|
||||
this.searchDelegation()
|
||||
},
|
||||
// 建议承办单位
|
||||
listSuggestUnit() {
|
||||
this.$axios.post("/platform/opinion/common/listUnderTake").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.suggestUnitOptions = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取代表团
|
||||
listDelegation() {
|
||||
return this.$axios.post("/platform/opinion/common/listDelegation", {sessionId: this.formData.sessionId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.delegationOptions = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询开启的教代会
|
||||
listOpenSession(isModify = false) {
|
||||
this.$axios.post("/platform/opinion/common/listOpenSession").then(async (res) => {
|
||||
if (res.code === 0) {
|
||||
this.sessionOptions = res.data
|
||||
if (!isModify && this.sessionOptions) {
|
||||
this.$set(this.formData, "sessionId", this.sessionOptions[0].id)
|
||||
// 获取代表团
|
||||
await this.searchDelegation()
|
||||
}
|
||||
await this.listDelegation()
|
||||
}
|
||||
})
|
||||
},
|
||||
//查询代表的代表团
|
||||
searchDelegation() {
|
||||
return this.$axios.post("/platform/opinion/write/searchDelegation", {
|
||||
sessionId: this.formData.sessionId,
|
||||
userId: this.formData.createUserId
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$set(this.formData, "delegationId", res.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
// 清空显示值
|
||||
this.$set(this.formData, "createUserId", '');
|
||||
if (this.bizId) {
|
||||
const res = await this.$axios.post("/platform/opinion/write/detail", {id: this.bizId})
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
this.tempUserId = this.formData.createUserId;
|
||||
this.listOpenSession(true)
|
||||
}
|
||||
} else {
|
||||
this.listOpenSession(false)
|
||||
|
||||
// 临时存储用户ID
|
||||
this.tempUserId = this.$store.state.user.id;
|
||||
|
||||
this.$set(this.formData, "createUserName", this.$store.state.user.username)
|
||||
this.$set(this.formData, "createUserLoginName", this.$store.state.user.loginname)
|
||||
this.$set(this.formData, "createTime", this.$moment().format("YYYY-MM-DD"))
|
||||
this.$set(this.formData, "mobile", this.$store.state.user.mobile)
|
||||
this.$set(this.formData, "unitName", this.$store.state.user.unit?.name)
|
||||
}
|
||||
},
|
||||
// 回显代表姓名
|
||||
echoRepresentativeName() {
|
||||
const checkRefAndSet = () => {
|
||||
if (this.$refs.userSelectRef) {
|
||||
// 1. 设置options
|
||||
this.$refs.userSelectRef.options = [{
|
||||
userId: this.tempUserId || this.$store.state.user.id,
|
||||
userName: this.formData.createUserName || this.$store.state.user.username,
|
||||
loginName: this.formData.createUserLoginName || this.$store.state.user.loginname
|
||||
}];
|
||||
// 2. 延迟赋值,确保options已生效
|
||||
this.$nextTick(() => {
|
||||
this.$set(this.formData, "createUserId", this.tempUserId || this.$store.state.user.id);
|
||||
});
|
||||
} else {
|
||||
setTimeout(checkRefAndSet, 50);
|
||||
}
|
||||
};
|
||||
|
||||
this.$nextTick(() => {
|
||||
checkRefAndSet();
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$emit('ready')
|
||||
},
|
||||
style:
|
||||
/*language=CSS*/
|
||||
`
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style></style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<custom-card>
|
||||
<snaker-start slot="header" label="撰写意见" define_key="JDHYJ"></snaker-start>
|
||||
|
||||
<basic-form @ready="onReady" ref="formRef" :school="false"></basic-form>
|
||||
|
||||
<template slot="footer">
|
||||
<el-button type="primary" @click="$refs.formRef?.onSave()">保存</el-button>
|
||||
<el-button type="primary" @click="$refs.formRef?.onSubmit()" v-if="!$refs.formRef?.taskId">提交</el-button>
|
||||
<el-button type="primary" @click="$refs.formRef?.onSubmitAgain()" v-else>提交</el-button>
|
||||
</template>
|
||||
</custom-card>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('form.js'){}#-->
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"basic-form": BASIC_FORM,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
bizId: GetQueryString("bizId"),
|
||||
taskId: GetQueryString("taskId"),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onReady() {
|
||||
this.$refs.formRef.ready(this.bizId, this.taskId)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user