git查看用户

This commit is contained in:
Paidax
2026-03-20 15:09:35 +08:00
parent ad326ec240
commit c5fbf8576c
39 changed files with 2924 additions and 609 deletions
@@ -0,0 +1,99 @@
package com.budwk.app.base.utils;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @version 1.0
* @Author FKY
* @nameFileExcelUtil
* @Date 2026/1/31 15:33
* @注释
*/
@Slf4j
public class FileExcelUtil {
public static Map<String, String> readExcelTable(File file){
Map<String, String> dataMap = new HashMap<>();
try {
FileInputStream fis = new FileInputStream(file);
Workbook workbook = new XSSFWorkbook(fis);
Sheet sheet = workbook.getSheetAt(0);
// 遍历所有行
for (Row row : sheet) {
int rowColumnIndex = 0 ;
String keyName = "";
String keyValue = "";
// 遍历所有单元格
for (Cell cell : row) {
String cellValue = String.valueOf(getCellValue(cell));
log.info("| " + cellValue + " ");
if((rowColumnIndex % 2) <= 0) {
keyName = cellValue;
} else {
keyValue = cellValue;
}
if(StrUtil.isNotBlank(keyName) && StrUtil.isNotBlank(keyValue)) {
if(keyName.contains("*")) {
keyName = keyName.replace("*", "");
}
dataMap.put(keyName, keyValue);
keyName = "";
keyValue = "";
}
rowColumnIndex ++;
}
}
}catch (Exception e) {
e.printStackTrace();
}
return dataMap;
}
public static Object getCellValue(Cell cell) {
CellType cellType = cell.getCellType();
if (cellType == CellType.FORMULA) {
cellType = cell.getCachedFormulaResultType();
}
switch (cellType) {
case STRING:
return cell.getStringCellValue();
case NUMERIC:
if (isCellDateType(cell)) {
return cell.getDateCellValue();
}
return cell.getNumericCellValue();
case BOOLEAN:
return cell.getBooleanCellValue();
case BLANK:
return "";
default:
return "";
}
}
public static Boolean isCellDateType(Cell cell) {
try {
cell.getDateCellValue();
} catch (Exception e) {
return false;
}
return true;
}
}
@@ -0,0 +1,81 @@
package com.budwk.app.base.utils;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableCell;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @version 1.0
* @Author FKY
* @nameFileWordUtil
* @Date 2026/1/31 15:01
* @注释
*/
@Slf4j
public class FileWordUtil {
public static List<Map<String, String>> readWordTable(File file) {
List<Map<String, String>> dataMaps = new ArrayList<>();
try{
FileInputStream fis = new FileInputStream(file);
XWPFDocument document = new XWPFDocument(fis);
// 获取所有表格
List<XWPFTable> tables = document.getTables();
log .info("文档中共有 " + tables.size() + " 个表格");
// 遍历每个表格
for (int t = 0; t < tables.size(); t++) {
log.info("\n--- 表格 " + (t + 1) + " ---");
XWPFTable table = tables.get(t);
Map<String, String> dataMap = new HashMap<>();
// 遍历表格的每一行
for (XWPFTableRow row : table.getRows()) {
int rowColumnIndex = 0 ;
String keyName = "";
String keyValue = "";
// 遍历行中的每个单元格
for (XWPFTableCell cell : row.getTableCells()) {
// 获取单元格文本并打印
String cellText = cell.getText();
log.info("| " + cellText + " ");
if((rowColumnIndex % 2) <= 0) {
keyName = cellText;
} else {
keyValue = cellText;
}
if(StrUtil.isNotBlank(keyName) && StrUtil.isNotBlank(keyValue)) {
if(keyName.contains("*")) {
keyName = keyName.replace("*", "");
}
dataMap.put(keyName, keyValue);
keyName = "";
keyValue = "";
}
rowColumnIndex ++;
}
log.info("|"); // 换行
}
if(!dataMap.isEmpty()){
dataMaps.add(dataMap);
}
}
} catch (Exception e) {
e.printStackTrace();
log.error("读取word文件出错",e);
}
return dataMaps;
}
}
@@ -3,19 +3,34 @@ package com.budwk.app.flow.service;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.ObjectUtil;
import com.budwk.app.base.event.flow.jumptofirsttask.FlowJumpToFirstTaskNodePublisher;
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.enums.ProcessSubmitTypeEnum;
import com.budwk.app.flow.engine.event.ProcessEvent;
import com.budwk.app.flow.engine.event.ProcessPublisher;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.*;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.List;
@IocBean
public class FlowCommonService {
@Inject
private FlowEngine flowEngine;
@Inject
private Dao dao;
/**
* 执行任务
* @param args
@@ -70,4 +85,40 @@ public class FlowCommonService {
}
}
@Aop(TransAop.READ_COMMITTED)
public Result revokeTask(Long taskId) {
// 自己任务
ProcessTask selfTask = dao.fetch(ProcessTask.class, taskId);
selfTask.setTaskState(ProcessTaskStateEnum.DOING.getCode());
// 撤销任务
List<ProcessTask> taskList = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getTaskParentId, "=", taskId));
for (ProcessTask task : taskList) {
task.setTaskState(ProcessTaskStateEnum.WITHDRAW.getCode());
dao.update(task);
}
// 会签并行任务 撤销后续任务
if (selfTask.getPerformType().equals(ProcessTaskPerformTypeEnum.COUNTERSIGN.getCode())) {
List<ProcessTask> doingTasks = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.DOING.getCode())
.and(ProcessTask::getProcessInstanceId, "=", selfTask.getProcessInstanceId()));
for (ProcessTask doingTask : doingTasks) {
doingTask.setTaskState(ProcessTaskStateEnum.WITHDRAW.getCode());
dao.update(doingTask);
}
}
// 激活
dao.update(selfTask);
// 流程激活
dao.update(ProcessInstance.class, Chain.make("state", ProcessInstanceStateEnum.DOING.getCode()),Cnd.where(ProcessInstance::getId, "=", selfTask.getProcessInstanceId()));
// 发送任务撤回事件 确保上面执行成功
for (ProcessTask task : taskList) {
ProcessPublisher.notify(ProcessEvent.builder().eventType(ProcessEventTypeEnum.PROCESS_TASK_REVOKE).sourceId(task.getId()).build());
}
return Result.success();
}
}
@@ -211,4 +211,12 @@ public interface ProcessTaskService extends BaseService<ProcessTask> {
*/
List<ProcessTask> getDoingTaskByBizIdTaskName(List<String> bizIds, String taskName);
/**
* 获取已结束的任务
*
* @param bizIds 业务ID
* @param taskName 任务名称
* @return
*/
List<ProcessTask> getDoneTaskByBizIdTaskName(List<String> bizIds, String taskName);
}
@@ -87,6 +87,16 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
return vo;
}
@Override
public List<ProcessTask> getDoneTaskByBizIdTaskName(List<String> bizIds, String taskName) {
List<ProcessInstance> instances = dao().query(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "in", bizIds));
List<Long> instanceIds = instances.stream().map(ProcessInstance::getId).toList();
List<ProcessTask> tasks = dao().query(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "in", instanceIds)
.and(ProcessTask::getTaskName, "=", taskName)
.and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.FINISHED.getCode()));
return tasks;
}
@Override
@Aop(TransAop.READ_COMMITTED)
public void saveProcessTask(ProcessTask processTask) {
@@ -197,4 +197,5 @@ public interface SysUserService extends BaseService<Sys_user> {
*/
String loginPlus(Sys_user user, LoginType loginType, HttpServletRequest request);
Sys_user getByLoginName(String loginName);
}
@@ -449,4 +449,13 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
return Globals.AppDomain + "/platform/home";
}
}
@Override
public Sys_user getByLoginName(String loginName) {
Sql sql = Sqls.create("select * from sys_user where loginname = @loginname");
sql.params().set("loginname", loginName);
sql.setCallback(Sqls.callback.record());
this.dao().execute(sql);
return sql.getObject(Sys_user.class);
}
}
@@ -0,0 +1,51 @@
package com.budwk.app.web.controllers;
import org.apache.commons.io.IOUtils;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
/**
* @Author: 1V
* @DateTime: 2020/12/3 8:50
* @Description: TODO
*/
@At("/platform/basics")
@IocBean
@Ok("json")
public class BasicsController {
private static final Log log = Logs.get();
private final String TEMPLATE_PATH = "templates";
/**
* 下载模板文件
*
* @param filePath
* @param fileName
* @param response
*/
@At
public void downloadTemplate(String filePath, String fileName, HttpServletResponse response) throws IOException {
try {
response.setHeader("Content-Disposition", "attachment;filename="
.concat(String.valueOf(URLEncoder.encode(fileName, "UTF-8"))));
if (filePath.startsWith("/")) {
filePath = filePath.substring(1);
}
InputStream fin = Thread.currentThread().getContextClassLoader().getResourceAsStream(TEMPLATE_PATH + "/" + filePath);
IOUtils.copy(fin, response.getOutputStream());
} catch (Exception e) {
log.error(e);
}
}
}
@@ -0,0 +1,79 @@
package com.budwk.app.zhgh.democratic.proposal.constants;
/**
* @author: Aaron
* @create: 2021-01-27 09:54
* @description: 提案状态
**/
public interface ProposalState {
/**
* 未提交
*/
Integer UNSUBMIT = 100;
/**
* 邀请附议人
*/
Integer INVIRTE = 150;
/**
* 待团长审核
*/
Integer DELEGATION = 200;
/**
* 预审核
*/
Integer PREAUDIT = 250;
/**
* 待提案委员会立案审核
*/
Integer CASE = 300;
/**
* 执委会建议
*/
Integer EXECUTORREAD = 310;
/**
* 分管校领导建议
*/
Integer BRANCHLEADERREAD = 320;
/**
* 校长、书记建议
*/
Integer PRINCIPALREAD = 330;
/**
* 待提案委员会确认承办单位
*/
Integer CASEUNIT = 400;
/**
* 待承办单位答复
*/
Integer UNITREPLY = 500;
/**
* 待承办单位分管校领导审批
*/
Integer LEADERAUDIT = 600;
/**
* 待反馈评分
*/
Integer FEEDBACKSCORE = 700;
/**
* 待提案委员会审查
*/
Integer CASE_CHECK = 800;
/**
* 已完结
*/
Integer FINISH = 900;
}
@@ -102,7 +102,7 @@ public class ProposalCommonController {
@Ok("void")
@SaCheckPermission("proposal")
public void exportProposalAsDocx(String id, HttpServletResponse response) {
proposalCommonService.exportProposalAsDocx(id, response);
proposalCommonService.exportProposalAsDocx(id, response);
}
}
@@ -0,0 +1,82 @@
package com.budwk.app.zhgh.democratic.proposal.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.base.service.BaseService;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.validation.Valid;
import java.util.List;
/**
* @version 1.0
* @Author FKY
* @nameProposalAllFinishedController
* @Date 2026/3/17 15:33
* @注释
*/
@IocBean
@At("/platform/proposal/all/finished")
@Slf4j
@Ok("json:full")
@Api(tags = "提案管理-办结")
public class ProposalAllFinishedController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/allFinished/index.html")
@SaCheckPermission("proposal.mine")
public void index() {
}
@At
@SaCheckPermission("proposal.allFinishedQuery")
@ApiOperation("分页列表")
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
Sql sql = Sqls.create("""
SELECT
info.*,
type.name AS typeName,
tcs.fullName AS sessionName,
tcd.`name` AS delegationName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
ins.processDefineId instanceProcessDefineId
FROM wf_process_instance ins
LEFT JOIN proposal_info info ON info.id = ins.businessNo
LEFT JOIN proposal_type type on type.id = info.typeId
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("ins.state", "=", "20");
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
}
ProposalSearchParam.buildSearch(cnd, pageForm);
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(), sql);
return Result.success(pagination);
}
}
@@ -0,0 +1,106 @@
package com.budwk.app.zhgh.democratic.proposal.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.base.service.BaseService;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.validation.Valid;
import java.util.List;
/**
* @version 1.0
* @Author FKY
* @nameProposalCaseCheckController
* @Date 2026/3/17 13:35
* @注释
*/
@IocBean
@At("/platform/proposal/case/check")
@Slf4j
@Ok("json:full")
@Api(tags = "提案管理-提案委员会审查")
public class ProposalCaseCheckController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/caseCheck/index.html")
@SaCheckPermission("proposal.mine")
public void index() {
}
@At
@SaCheckPermission("proposal.caseCheck")
@ApiOperation("分页列表")
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
Sql sql = Sqls.create("""
SELECT
info.*,
type.name AS typeName,
tcs.fullName AS sessionName,
tcd.`name` AS delegationName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariable,
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
FROM
wf_process_task t
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
LEFT JOIN proposal_info info ON info.id = ins.businessNo
LEFT JOIN proposal_type type on type.id = info.typeId
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t.taskName", "=", "caseCheck");
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
}
if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
} else {
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
}
ProposalSearchParam.buildSearch(cnd, pageForm);
cnd.groupBy("t.id");
cnd.desc("t.createdAt");
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(), sql);
return Result.success(pagination);
}
}
@@ -1,23 +1,26 @@
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.bpm.enums.BpmProcessTaskStatusEnum;
import com.budwk.app.bpm.models.BpmProcessTask;
import com.budwk.app.bpm.service.BpmService;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.entity.ProcessTaskActor;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.flow.service.ProcessTaskService;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.proposal.controller.vo.ProposalInfoPageVO;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalUndertake;
import com.budwk.app.zhgh.democratic.proposal.param.ProposalCommitteeFilingUnitApprovalParam;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
import com.budwk.app.zhgh.democratic.proposal.service.ProposalCommitteeFilingUnitService;
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -25,10 +28,10 @@ import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
@@ -46,10 +49,15 @@ public class ProposalCommitteeFilingUnitController {
@Inject
private BaseService baseService;
@Inject
private BpmService bpmService;
@Inject
private ProposalCommitteeFilingUnitService proposalCommitteeFilingUnitService;
@Inject
private ProposalCommonService proposalCommonService;
@Inject
private FlowCommonService flowCommonService;
@Inject
private ProcessTaskService processTaskService;
@At("")
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/committeeFilingUnit/index.html")
@SaCheckPermission("proposal.committeeFilingUnit")
@@ -64,123 +72,143 @@ public class ProposalCommitteeFilingUnitController {
SELECT
info.*,
type.name AS typeName,
tcs.fullName AS sessionName,
tcd.`name` AS delegationName,
inst.id processInstanceId,
inst.processInstanceNodeId,
inst.processInstanceNodeName,
inst.processInstanceTaskIds,
inst.processInstanceStatus,
task.id processInstanceTaskId,
task.taskStatus processInstanceTaskStatus,
COUNT(p.consolidationIds) > 0 AS isConsolidation,
EXISTS (
SELECT 1
FROM bpm_process_task next_task
WHERE next_task.prevTaskId = task.id
AND next_task.taskStatus = 'COMPLETE'
) AS nextTaskIsComplete
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
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 OR (ins.state = 20 AND info.caseFilingResult = 'NOT'), 1, 0) AS canRevoke
FROM
bpm_process_task task
INNER JOIN bpm_process_node_define nd ON nd.id = task.processTaskNodeId
INNER JOIN bpm_process_instance inst ON inst.id = task.processInstanceId
INNER JOIN proposal_info info ON info.id = inst.processInstanceBusinessId
LEFT JOIN proposal_consolidation p ON JSON_CONTAINS(p.consolidationIds, JSON_QUOTE(info.id))
wf_process_task t
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
LEFT JOIN proposal_info info ON info.id = ins.businessNo
LEFT JOIN proposal_type type on type.id = info.typeId
LEFT JOIN teacher_congress_session tcs ON tcs.id = info.sessionId
LEFT JOIN teacher_congress_delegation tcd ON tcd.id = info.delegationId
LEFT JOIN bpm_process_task nt ON nt.prevTaskId = task.id AND nt.taskStatus = 'COMPLETE'
LEFT JOIN proposal_merge mer ON mer.proposalId = info.id
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t.taskName", "=", "committeeFilingUnit");
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
cnd.and(new Static("JSON_CONTAINS( task.assignments, '\"%s\"' )".formatted(SecurityUtil.getUserLoginname())));
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
}
cnd.and("nd.nodeCode", "=", 70);
if (approval) {
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.COMPLETE);
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
} else {
cnd.and("task.taskStatus", "=", BpmProcessTaskStatusEnum.ACTIVE);
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
}
ProposalSearchParam.buildSearch(cnd, pageForm);
cnd.and(new Static("""
NOT EXISTS(
SELECT 1
FROM bpm_process_task t2
WHERE t2.processInstanceId = task.processInstanceId
AND t2.processTaskNodeCode = task.processTaskNodeCode
AND t2.createdOn > task.createdOn
)
"""));
cnd.groupBy("info.id");
cnd.groupBy("task.id");
cnd.groupBy("t.id");
cnd.desc("t.createdAt");
sql.setCondition(cnd);
Pagination pagination = baseService.listPageVO(pageForm, sql, ProposalInfoPageVO.class);
Pagination pagination = proposalCommitteeFilingUnitService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
@At
@SaCheckPermission("proposal.committeeFilingUnit")
@ApiOperation("执行任务")
@Aop(TransAop.READ_COMMITTED)
@SLog(tag = "委员会确认承办单位", msg = "委员会确认承办单位")
@ApiOperation("委员会确认承办单位")
public Result approval(@Valid @Param("approval") ProposalCommitteeFilingUnitApprovalParam approvalParam) {
proposalCommitteeFilingUnitService.approval(approvalParam);
return Result.success();
}
public Result executeTask(@Param("data") String data) {
Dict args = Json.fromJson(Dict.class, data);
String proposalId = args.getStr("proposalId");
@At
@SaCheckPermission("proposal.committeeFilingUnit")
@Aop(TransAop.READ_COMMITTED)
@SLog(tag = "委员会确认承办单位", msg = "委员会确认承办单位撤回")
public Result revoke(@Valid String taskId) {
proposalCommitteeFilingUnitService.revoke(taskId);
return Result.success();
}
// 查询是否提案
@At
@SaCheckPermission("proposal.committeeFilingUnit")
@ApiOperation("查询立案的结果及承办单位")
public Result committeeFiling(@Valid String processInstanceId, @Valid String processInstanceTaskId) {
JSONObject newJson = new JSONObject();
BpmProcessTask caseUnitTask = proposalCommitteeFilingUnitService.dao().fetch(BpmProcessTask.class,
Cnd.where(BpmProcessTask::getId, "=", processInstanceTaskId)
.and(BpmProcessTask::getProcessInstanceId, "=", processInstanceId)
.and(BpmProcessTask::getProcessTaskNodeCode, "=", 70)
.and(BpmProcessTask::getDelFlag, "=", 0)
);
if (ObjectUtil.isNotNull(caseUnitTask) && ObjectUtil.isNotEmpty(caseUnitTask.getExtVariable())) {
JSONObject jsonObject = caseUnitTask.getExtVariable();
newJson.set("caseFilingResult", jsonObject.get("caseFilingResult"));
newJson.set("hostUnitId", jsonObject.get("hostUnitId"));
newJson.set("helpUnitIds", jsonObject.getBeanList("helpUnitIds", String.class));
newJson.set("approvalOpinion", jsonObject.get("approvalOpinion"));
newJson.set("consolidationIds", jsonObject.getBeanList("consolidationIds", String.class));
return Result.success(newJson);
// 单条审核
List<String> mergeProposalIds = proposalCommonService.mergeProposal(proposalId);
if (ObjectUtil.isEmpty(mergeProposalIds)) {
flowCommonService.executeTask(args);
return Result.success();
}
BpmProcessTask caseTask = proposalCommitteeFilingUnitService.dao().fetch(BpmProcessTask.class,
Cnd.where(BpmProcessTask::getProcessInstanceId, "=", processInstanceId)
.and(BpmProcessTask::getDelFlag, "=", 0)
.and(BpmProcessTask::getProcessTaskNodeCode, "=", 60)
.desc(BpmProcessTask::getCreatedOn)
);
JSONObject jsonObject = caseTask.getExtVariable();
newJson.set("caseFilingResult", jsonObject.get("caseFilingResult"));
newJson.set("hostUnitId", jsonObject.get("hostUnitId"));
newJson.set("helpUnitIds", jsonObject.getBeanList("helpUnitIds", String.class));
newJson.set("approvalOpinion", jsonObject.get("approvalOpinion"));
newJson.set("consolidationIds", jsonObject.getBeanList("consolidationIds", String.class));
return Result.success(newJson);
// 并案审核
ProcessTask thisTask = baseService.dao().fetch(ProcessTask.class, args.getLong(FlowConst.PROCESS_TASK_ID_KEY));
List<ProcessTask> mergeTasks = processTaskService.getDoingTaskByBizIdTaskName(mergeProposalIds, thisTask.getTaskName());
for (ProcessTask mergeTask : mergeTasks) {
Dict cloneArgs = args.clone();
cloneArgs.put(FlowConst.PROCESS_TASK_ID_KEY, mergeTask.getId());
flowCommonService.executeTask(cloneArgs);
}
ProposalInfo info = proposalCommonService.fetch(proposalId);
info.setCaseFilingResult(args.getStr("caseFilingResult"));
return Result.success();
}
@At
@SaCheckLogin
@Aop(TransAop.READ_COMMITTED)
@ApiOperation("撤销任务")
public Result revokeTask(@Param("taskId") Long taskId,@Param("proposalId")String proposalId) {
// 单条审核
List<String> mergeProposalIds = proposalCommonService.mergeProposal(proposalId);
if (ObjectUtil.isEmpty(mergeProposalIds)) {
flowCommonService.revokeTask(taskId);
return Result.success();
}
// 并案审核
ProcessTask thisTask = baseService.dao().fetch(ProcessTask.class, taskId);
List<ProcessTask> mergeTasks = processTaskService.getDoneTaskByBizIdTaskName(mergeProposalIds, thisTask.getTaskName());
for (ProcessTask mergeTask : mergeTasks) {
flowCommonService.revokeTask(mergeTask.getId());
}
return Result.success();
}
@At
@SaCheckPermission("proposal.committeeFilingUnit")
@ApiOperation("查询承办单位")
public Result listUnderTake() {
List<ProposalUndertake> list = baseService.dao().query(ProposalUndertake.class, Cnd.NEW().asc(ProposalUndertake::getCode));
return Result.success(list);
public Result doUpData(){
List<ProcessTask> tasks = baseService.dao().query(ProcessTask.class, Cnd.where("taskName", "=", "personnelOffice"));
List<Long> list = tasks.stream().map(ProcessTask::getId).toList();
List<ProcessTaskActor> actorList = baseService.dao().query(ProcessTaskActor.class, Cnd.where(ProcessTaskActor::getProcessTaskId, "in", list));
List<ProcessInstance> instanceList = baseService.dao().query(ProcessInstance.class, Cnd.where(ProcessInstance::getProcessDefineId, "=", 396));
for (ProcessTask task : tasks) {
task.setTaskName("committee");
task.setDisplayName("提案委员会立案");
task.setFormKey("/platform/proposal/committee");
task.setH5FormKey("");
}
for (ProcessTaskActor actor : actorList) {
actor.setActorId("1fb89886bf4c43dcb48409c83d3363c3");
actor.setActorAccount("018054");
actor.setActorName("赵丽霞");
actor.setActorUnitName("工会");
actor.setActorUnitId("0011");
}
for (ProcessInstance instance : instanceList) {
instance.setProcessDefineId(400L);
}
baseService.update(tasks);
baseService.update(actorList);
baseService.update(instanceList);
return Result.success();
}
}
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HtmlUtil;
@@ -9,6 +10,8 @@ import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.FileExcelUtil;
import com.budwk.app.base.utils.FileWordUtil;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance;
@@ -38,13 +41,19 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.validation.Valid;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@IocBean
@@ -83,6 +92,7 @@ public class ProposalMineController {
Sql sql = Sqls.create("""
SELECT
info.*,
sd.name as sourceName,
type.name AS typeName,
tcs.fullName AS sessionName,
tcd.`name` AS delegationName,
@@ -110,6 +120,7 @@ public class ProposalMineController {
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
left join sys_dict sd on sd.code = info.source
$condition
""");
@@ -372,5 +383,37 @@ public class ProposalMineController {
return Result.success();
}
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@Aop(TransAop.READ_COMMITTED)
public Object importProposal(TempFile file, String templateType) throws Exception {
if (file == null) {
return Result.error("文件不能为空!");
}
String name = file.getSubmittedFileName();
String suffix = FileUtil.getSuffix(name);
if(!List.of("xls", "xlsx", "docx", "doc").contains(suffix.toLowerCase())) {
throw new RuntimeException("文件格式错误: 不支持该文件{" + suffix + "}导入!");
}
// word docx 文件导入
if(templateType.equals("2")) {
List<Map<String, String>> dataMaps = FileWordUtil.readWordTable(file.getFile());
if(dataMaps == null || dataMaps.size() == 0) {
throw new RuntimeException("文件内容错误: 文件内容不能为空!");
}
for (Map<String, String> dataMap : dataMaps) {
proposalCommonService.importProposal(dataMap);
}
// excel xlsx 文件导入
} else {
Map<String, String> dataMap = FileExcelUtil.readExcelTable(file.getFile());
if(dataMap == null || dataMap.size() == 0) {
throw new RuntimeException("文件内容错误: 文件内容不能为空!");
}
proposalCommonService.importProposal(dataMap);
}
return Result.success();
}
}
@@ -0,0 +1,107 @@
package com.budwk.app.zhgh.democratic.proposal.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.base.service.BaseService;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.validation.Valid;
import java.util.List;
/**
* @version 1.0
* @Author FKY
* @nameProposalPreAuditController
* @Date 2026/3/16 17:30
* @注释
*/
@IocBean
@At("/platform/proposal/pre/audit")
@Slf4j
@Ok("json:full")
@Api(tags = "提案管理-校工会预审核")
public class ProposalPreAuditController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/preAudit/index.html")
@SaCheckPermission("proposal.mine")
public void index() {
}
@At
@SaCheckPermission("proposal.preAudit")
@ApiOperation("分页列表")
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
Sql sql = Sqls.create("""
SELECT
info.*,
type.name AS typeName,
tcs.fullName AS sessionName,
tcd.`name` AS delegationName,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariable,
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
FROM
wf_process_task t
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
LEFT JOIN proposal_info info ON info.id = ins.businessNo
LEFT JOIN proposal_type type on type.id = info.typeId
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t.taskName", "=", "preAudit");
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
}
if (approval) {
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
} else {
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
}
ProposalSearchParam.buildSearch(cnd, pageForm);
cnd.groupBy("t.id");
cnd.desc("t.createdAt");
sql.setCondition(cnd);
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(), sql);
return Result.success(pagination);
}
}
@@ -109,7 +109,7 @@ public class ProposalSchoolLeaderApprovalController {
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t.taskName", "=", "school_leader");
cnd.and("t.taskName", "=", "schoolLeader");
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
@@ -145,6 +145,14 @@ public class ProposalSchoolLeaderApprovalController {
Dict args = Json.fromJson(Dict.class, data);
String proposalId = args.getStr("proposalId");
ProcessTask thisTask = dao.fetch(ProcessTask.class, args.getLong(FlowConst.PROCESS_TASK_ID_KEY));
ProcessTask parentTask = dao.fetch(ProcessTask.class, Cnd.where("id", "=", thisTask.getTaskParentId()));
Dict dict = Json.fromJson(Dict.class, parentTask.getVariable());
args.put("tf_caseFilingResult", dict.getStr("tf_caseFilingResult"));
// 方案流程实例
// 单条审核
List<String> mergeProposalIds = proposalCommonService.mergeProposal(proposalId);
if (ObjectUtil.isEmpty(mergeProposalIds)) {
@@ -153,7 +161,7 @@ public class ProposalSchoolLeaderApprovalController {
}
// 并案审核
ProcessTask thisTask = dao.fetch(ProcessTask.class, args.getLong(FlowConst.PROCESS_TASK_ID_KEY));
List<ProcessTask> mergeTasks = processTaskService.getDoingTaskByBizIdTaskName(mergeProposalIds, thisTask.getTaskName());
for (ProcessTask mergeTask : mergeTasks) {
Dict cloneArgs = args.clone();
@@ -1,28 +1,41 @@
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.aspose.slides.internal.og.and;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.bpm.service.BpmService;
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.enums.ProcessTaskStateEnum;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalSecond;
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
import com.budwk.app.zhgh.democratic.proposal.service.ProposalSecondedService;
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
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.dao.util.cri.Static;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.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;
@@ -83,9 +96,11 @@ public class ProposalSecondedController {
t.finishTime,
t.taskParentId,
t.variable taskVariable,
ta.actorName taskActorName,
if(t.taskName = 'second', ta.actorId, ps.seconderId) taskActorUserId,
if(t.taskName = 'second', ta.actorName, ps.userName) taskActorName,
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke,
sum( CASE WHEN ps.seconderId=@seconderId and ps.isAgree is not null THEN 1 ELSE 0 END ) as count
FROM
wf_process_task t
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
@@ -93,13 +108,16 @@ public class ProposalSecondedController {
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
LEFT JOIN proposal_info info ON info.id = ins.businessNo
LEFT JOIN proposal_second ps ON ps.proposalId = info.id
LEFT JOIN proposal_type type on type.id = info.typeId
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t.taskName", "=", "second");
cnd.and("t.taskName", "in", List.of("invite", "second", "delegation", "committee"));
cnd.and(new Static("ps.isAgree is null"));
sql.setParam("seconderId", SecurityUtil.getUserId());
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
@@ -122,4 +140,42 @@ public class ProposalSecondedController {
return Result.success(pagination);
}
@At
@SaCheckPermission("proposal.seconded")
@Aop(TransAop.READ_COMMITTED)
@ApiOperation("修改提案附议信息")
@SLog(tag = "提案管理系统-附议提案", msg = "修改提案附议信息")
public Result updateInfo(@Param("proposalId") String proposalId,
@Param("taskActorUserId") String taskActorUserId,
@Param("opinion") String opinion,
@Param("submitType") Integer submitType) {
// 查询附议信息表
ProposalSecond proposalSecond = dao.fetch(
ProposalSecond.class,
Cnd.where(ProposalSecond::getProposalId, "=", proposalId)
.and(ProposalSecond::getSeconderId, "=", taskActorUserId)
);
proposalSecond.setIsAgree(ObjectUtil.equals(submitType, ProcessSubmitTypeEnum.AGREE.getCode()));
proposalSecond.setOpinion(opinion);
proposalSecond.setSecondedTime(DateUtil.date());
dao.update(proposalSecond);
// 流程实例
ProcessInstance processInstance = dao.fetch(ProcessInstance.class,Cnd.where(ProcessInstance::getBusinessNo, "=", proposalId));
if(processInstance == null) return Result.success();
ProcessTask processTask = dao.fetch(ProcessTask.class,Cnd.where(ProcessTask::getProcessInstanceId, "=", processInstance.getId())
.and(ProcessTask::getTaskName, "=", "second")
.and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.ABANDON.getCode())
.and(new Static("id in (select processTaskId from wf_process_task_actor where actorId='" + taskActorUserId + "')"))
.limit(1,1));
if(processTask == null) return Result.success();
processTask.setTaskState(ProcessTaskStateEnum.FINISHED.getCode());
processTask.setFinishTime(DateUtil.date());
dao.update(processTask);
return Result.success();
}
}
@@ -0,0 +1,103 @@
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
import io.swagger.annotations.ApiOperation;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpression;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static;
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 javax.validation.Valid;
/**
* 未提交预审汇总
*/
@IocBean
@Ok("json:full")
@At("/platform/proposal/unSubmitQuery")
public class ProposalUnSubmitQueryController {
@Inject
private ProposalCommonService proposalCommonService;
@At("")
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/unSubmitQuery/index.html")
@SaCheckPermission("proposal.unSubmitQuery")
public void index() {
}
@At
@ApiOperation("分页列表")
public Result pageData(@Valid ProposalSearchParam pageForm, String searchName, String searchKeyword, String searchName2, String searchKeyword2) {
Sql sql = Sqls.create("""
SELECT
distinct
info.id,
info.code as proposalCode,
info.name as proposalName,
vu.username,
vu.mobile,
vu.unitName,
tcd.name as delegationName,
pt.name as typeName,
manner.name as mannerName,
(select count(DISTINCT(seconderId))from proposal_seconded where proposalId = info.id) AS secondedNum,
(select count(DISTINCT(seconderId))from proposal_seconded where proposalId = info.id and isAgree = 1) AS secondedAgreeNum,
IF(info.stateCode <= 200 ,'未审核','已审核') AS delegationAudit
FROM
proposal_info info
left join vw_user vu on info.createUserId = vu.id
left join teacher_congress_delegation tcd on info.delegationId = tcd.id
left join proposal_type pt on info.typeId = pt.id
left join sys_dict manner on manner.`code` = info.source
left join `wf_process_instance` ins on ins.businessNo = info.id
left join wf_process_task nt on nt.processInstanceId = ins.id
$condition
""");
Cnd cnd = Cnd.NEW();
SqlExpressionGroup group = Cnd.exps("ins.state", "=", 30);
group.or("ins.state", "=", 45);
group.or("ins.state", "=", 10);
group.orIsNull("ins.id");
cnd.and(group);
SqlExpressionGroup group2 = Cnd.exps("ins.state", "=", 30);
group2.or("ins.state", "=", 45);
group2.or(new Static("ins.id not in (select processInstanceId from wf_process_task where taskName='delegation')"));
cnd.and(group2);
if(searchName != null && StrUtil.isNotBlank(searchKeyword)) {
if(searchName.equals("proposalName")) {
cnd.and("info.name", "like", "%" + searchKeyword + "%");
}
if(searchName.equals("proposalCode")) {
cnd.and("info.code", "like", "%" + searchKeyword + "%");
}
}
if(searchName2 != null && StrUtil.isNotBlank(searchKeyword2)) {
if(searchName2.equals("su.username")) {
cnd.and("vu.username", "like", "%" + searchKeyword2 + "%");
}
}
if(pageForm.getSessionId() != null) {
cnd.and("info.sessionId", "=", pageForm.getSessionId());
}
sql.setCondition(cnd);
Pagination<NutMap> pagination = proposalCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
}
}
@@ -155,6 +155,7 @@ public class ProposalUnderTakeReplyController {
}
@At
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("proposal.unitReply")
@ApiOperation("执行任务")
public Result executeTask(@Param("data") String data) {
@@ -1,10 +1,13 @@
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.io.FileUtil;
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.base.utils.FileExcelUtil;
import com.budwk.app.base.utils.FileWordUtil;
import com.budwk.app.flow.constant.FlowConst;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance;
@@ -13,8 +16,10 @@ 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.proposal.constants.ProposalState;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
import com.budwk.app.zhgh.democratic.proposal.service.ProposalWriteService;
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
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;
@@ -26,11 +31,16 @@ 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.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
/**
* 提案撰写
@@ -49,6 +59,8 @@ public class ProposalWriteController {
private FlowEngine flowEngine;
@Inject
private FlowCommonService flowCommonService;
@Inject
private ProposalCommonService proposalCommonService;
@At("")
@@ -74,6 +86,8 @@ public class ProposalWriteController {
if (StrUtil.isBlank(proposalInfo.getCode())) {
proposalInfo.setCode(proposalWriteService.generateProposalCode(proposalInfo.getSessionId(), proposalInfo.getDelegationId()));
}
// 状态码
proposalInfo.setStateCode(ProposalState.UNSUBMIT);
dao.insertOrUpdate(proposalInfo);
return Result.success(proposalInfo);
}
@@ -103,6 +117,8 @@ public class ProposalWriteController {
flowEngine.executeProcessTask(task.getId(), SecurityUtil.getUserId(), args);
}
// 更新提案状态码
proposalCommonService.updateStateCode(proposalInfo.getId(), ProposalState.INVIRTE);
return Result.success(proposalInfo);
}
@@ -151,6 +167,14 @@ public class ProposalWriteController {
return Result.success().addData(sysDicts);
}
@At
@SaCheckPermission("proposal.write")
@ApiOperation("查询自己可撰写的提案方式(个人、代表团、委员会)")
public Result listSourceByCode(@Valid String code) {
List<Sys_dict> sysDicts = proposalWriteService.listSourceByCode(code);
return Result.success().addData(sysDicts);
}
@At
@SaCheckPermission("proposal.write")
@ApiOperation("检查提案撰写时间")
@@ -160,4 +184,36 @@ public class ProposalWriteController {
return Result.success().addData(flag);
}
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@Aop(TransAop.READ_COMMITTED)
public Result importProposal(TempFile file, String templateType) {
if (file == null) {
return Result.error("文件不能为空!");
}
String name = file.getSubmittedFileName();
String suffix = FileUtil.getSuffix(name);
if(!List.of("xls", "xlsx", "docx", "doc").contains(suffix.toLowerCase())) {
throw new RuntimeException("文件格式错误: 不支持该文件{" + suffix + "}导入!");
}
ProposalInfo proposalInfo = null;
// word docx 文件导入
if(templateType.equals("2")) {
List<Map<String, String>> dataMaps = FileWordUtil.readWordTable(file.getFile());
if(dataMaps == null || dataMaps.size() == 0) {
throw new RuntimeException("文件内容错误: 文件内容不能为空!");
}
proposalInfo = proposalWriteService.importProposal(dataMaps.get(0));
// excel xlsx 文件导入
} else {
Map<String, String> dataMap = FileExcelUtil.readExcelTable(file.getFile());
if(dataMap == null || dataMap.size() == 0) {
throw new RuntimeException("文件内容错误: 文件内容不能为空!");
}
proposalInfo = proposalWriteService.importProposal(dataMap);
}
return Result.success(proposalInfo);
}
}
@@ -0,0 +1,55 @@
package com.budwk.app.zhgh.democratic.proposal.handler;
import cn.hutool.core.lang.Dict;
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.flow.entity.Candidate;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalConfig;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.lang.util.NutMap;
import java.util.List;
/**
* 提案主管校领导处理人
*/
public class ProposalSchoolLeaderAssignmentHandler implements AssignmentHandler {
@Override
public List<String> assign(TaskModel model, Execution execution) {
Dao dao = ServiceContext.find(Dao.class);
ProposalConfig proposalConfig = dao.fetch(ProposalConfig.class, Cnd.NEW());
List<String> unitIds = proposalConfig.getSchoolLeaderUnitIds();
Sql sql = Sqls.create("select id,username,loginname from vw_user where unitId in (@unitIds)");
sql.setParam("unitIds", unitIds);
sql.setCallback(Sqls.callback.maps());
dao.execute(sql);
List<NutMap> list = sql.getList(NutMap.class);
List<Candidate> candidates = list.stream().map(item -> Candidate.builder()
.userId(item.getString("id"))
.userName(item.getString("username"))
.ext(Dict.of("loginName", item.getString("loginname")))
.build()
).toList();
if(candidates.size() > 0) {
return candidates.stream().map(Candidate::getUserId).toList();
}
return List.of();
}
@Override
public String getMessage() {
return "指定主管校领导";
}
@Override
public int getOrder() {
return 220;
}
}
@@ -77,4 +77,8 @@ public class ProposalSecond extends BaseModel {
@ColDefine(type = ColType.BOOLEAN)
private Boolean isAgree;
@Column
@Comment("附议人内容")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String opinion;
}
@@ -4,7 +4,9 @@ import com.budwk.app.base.service.BaseService;
import com.budwk.app.sys.models.Sys_dict;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
public interface ProposalWriteService extends BaseService<ProposalInfo> {
@@ -18,4 +20,7 @@ public interface ProposalWriteService extends BaseService<ProposalInfo> {
*/
String generateProposalCode(String sessionId,String delegationId);
List<Sys_dict> listSourceByCode(@Valid String code);
ProposalInfo importProposal(Map<String, String> stringStringMap);
}
@@ -8,6 +8,7 @@ import org.nutz.lang.util.NutMap;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.util.List;
import java.util.Map;
public interface ProposalCommonService extends BaseService<ProposalInfo> {
@@ -113,4 +114,15 @@ public interface ProposalCommonService extends BaseService<ProposalInfo> {
*/
List<String> mergeProposal(String id);
/**
* 导入提案
*
* @param dataMap
*/
void importProposal(Map dataMap);
/**
* 修改提案状态码
*/
void updateStateCode(String id, Integer stateCode);
}
@@ -1,6 +1,8 @@
package com.budwk.app.zhgh.democratic.proposal.service.common;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@@ -23,13 +25,15 @@ 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.sys.services.SysUserService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.web.commons.base.Globals;
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.proposal.constants.ProposalState;
import com.budwk.app.zhgh.democratic.proposal.models.*;
import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam;
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.delegate.service.TeacherCongressDelegateService;
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
@@ -47,11 +51,14 @@ 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.Strings;
import org.nutz.lang.util.NutMap;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
@@ -70,6 +77,12 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
private FlowEngine flowEngine;
@Inject
private SysDictService sysDictService;
@Inject
private SysUserService sysUserService;
@Inject
private TeacherCongressDelegateService teacherCongressDelegateService;
@Inject
private ProposalWriteService proposalWriteService;
public ProposalCommonServiceImpl(Dao dao) {
super(dao);
@@ -193,14 +206,15 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
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));
List<Sys_dict> feedBackDict = sysDictService.getSubListByCode("PROPOSAL_FEEDBACK");
Map<String, String> feedBackMap = feedBackDict.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
// List<Sys_dict> feedBackDict = sysDictService.getSubListByCode("PROPOSAL_FEEDBACK");
// Map<String, String> feedBackMap = feedBackDict.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
// 流程实例
@@ -217,20 +231,86 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
Map<String, List<ProcessTaskVO>> taskGroups = doneTaskVos.stream().collect(Collectors.groupingBy(ProcessTaskVO::getDisplayName));
docData.putAll(taskGroups);
// 提案附议
List<NutMap> secondInfos = new ArrayList<>();
List<ProcessTaskVO> secondTaskVos = taskGroups.get("提案附议");
if(secondTaskVos != null && secondTaskVos.size() > 0) {
for (ProcessTaskVO secondTaskVO : secondTaskVos) {
Dict taskFormData = secondTaskVO.getTaskFormData();
if(taskFormData == null) {
continue;
}
NutMap secondInfo = new NutMap();
secondInfo.put("s_username", taskFormData.getStr("userName"));
secondInfo.put("s_unitName", taskFormData.getStr("unitName"));
Sql taskUserSql = Sqls.create("select mobile from sys_user where loginname=@loginname and delFlag != 1 limit 0,1");
taskUserSql.setParam("loginname", taskFormData.getStr("loginName"));
taskUserSql.setCallback(Sqls.callback.map());
execute(taskUserSql);
NutMap taskUserMap = (NutMap) taskUserSql.getResult();
secondInfo.put("s_mobile", taskUserMap.getString("mobile"));
secondInfos.add(secondInfo);
}
}
// 代表团意见
List<NutMap> delegationAuditList = new ArrayList<>();
List<ProcessTaskVO> delegationTaskVos = taskGroups.get("团长审核");
if(delegationTaskVos != null && delegationTaskVos.size() > 0) {
for (ProcessTaskVO delegationTaskVO : delegationTaskVos) {
Dict taskFormData = delegationTaskVO.getTaskFormData();
if(taskFormData == null) {
continue;
}
NutMap delegationAudit = new NutMap();
delegationAudit.put("opinion", taskFormData.getStr("opinion"));
delegationAudit.put("username", taskFormData.getStr("userName"));
delegationAudit.put("auditTime", DateUtil.format(delegationTaskVO.getFinishTime(), "yyyy-MM-dd HH:mm:ss"));
delegationAuditList.add(delegationAudit);
}
}
// 导出单元格数据信息
Map<String, Object> docCellDataMap = new HashMap<>();
// 编号
docCellDataMap.put("proposalCode", docData.getString("code"));
// 提交时间
docCellDataMap.put("createTime", docData.getString("createTime"));
// 提案人
docCellDataMap.put("username", docData.getString("createUserName"));
// 所在代表团
docCellDataMap.put("delegationName", docData.getString("delegationName"));
// 所在单位
docCellDataMap.put("unitName", docData.getString("unitName"));
// 联系方式
docCellDataMap.put("mobile", docData.getString("mobile"));
// 提案名称
docCellDataMap.put("proposalName", docData.getString("name"));
// 提案内容
docCellDataMap.put("brief", docData.getString("brief"));
// 建议措施
docCellDataMap.put("measures", docData.getString("measures"));
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
htmlRenderPolicy.getConfig().setShowDefaultTableBorderInTableCell(true);
Configure config = Configure.builder()
.bind("secondedList", policy)
.bind("seconders", policy)
.bind("提案附议", policy)
.bind("brief", htmlRenderPolicy)
.bind("measures", htmlRenderPolicy)
.bind("taskFormData.tf_opinion", htmlRenderPolicy)
.build();
Map<String, Object> renderDocCellDataMap = MapUtil.of("proposal", docCellDataMap);
renderDocCellDataMap.put("secondedList", secondInfos);
renderDocCellDataMap.put("delegationAuditList", delegationAuditList);
try {
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("proposal"), config).render(docData).writeAndClose(byteArrayOutputStream);
XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("proposal"), config).render(renderDocCellDataMap).writeAndClose(byteArrayOutputStream);
} catch (IOException e) {
log.error("提案导出失败{},提案id:{}", e.getMessage(), id);
}
@@ -632,4 +712,130 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
}
return null;
}
@Override
public void importProposal(Map dataMap) {
String loginName = MapUtil.getStr(dataMap, "工号", "");
String username = MapUtil.getStr(dataMap, "提案人", "");
String proposalDate = MapUtil.getStr(dataMap, "提案时间", "");
String proposalType = MapUtil.getStr(dataMap, "提案类型", "");
String proposalSource = MapUtil.getStr(dataMap, "提案方式", "");
String proposalName = MapUtil.getStr(dataMap, "提案名称", "");
String proposalContent = MapUtil.getStr(dataMap, "案由", "");
String proposalMeasures = MapUtil.getStr(dataMap, "建议措施", "");
// 工号
if(StrUtil.isBlank(loginName)) {
throw new RuntimeException("工号不能为空");
}
Sys_user user = sysUserService.getByLoginName(loginName);
if(user == null){
throw new RuntimeException("工号不存在");
}
if(StrUtil.isNotBlank(username) && !username.equals(user.getUsername())) {
throw new RuntimeException("工号和提案人不一致");
}
// 提案时间
if(StrUtil.isBlank(proposalDate)) {
throw new RuntimeException("提案时间不能为空");
}
// 提案类型
if(StrUtil.isBlank(proposalType)) {
throw new RuntimeException("提案类型不能为空");
}
ProposalType proposalTypeObj = dao().fetch(ProposalType.class, Cnd.where(ProposalType::getName, "=", proposalType));
if(proposalTypeObj == null) {
throw new RuntimeException("提案类型不存在");
}
// 提案方式
if(StrUtil.isBlank(proposalSource)) {
throw new RuntimeException("提案方式不能为空");
}
Sys_dict dict = sysDictService.fetch(Cnd.where("code", "=", "PROPOSAL_SOURCE"));
if(dict == null) {
throw new RuntimeException("提案方式字典配置不存在");
}
List<Sys_dict> sysDicts = sysDictService.query(Cnd.where("parentId", "=", Strings.sNull(dict.getId())).asc("location"));
if(sysDicts == null || sysDicts.size() == 0) {
throw new RuntimeException("提案方式字典配置不存在");
}
Sys_dict proposalSourceDict = sysDicts.stream().filter(v -> v.getName().equals(proposalSource)).findFirst().orElse(null);
if(proposalSourceDict == null) {
throw new RuntimeException("提案方式不存在");
}
// 提案名称
if(StrUtil.isBlank(proposalName)) {
throw new RuntimeException("提案名称不能为空");
}
// 案由
if(StrUtil.isBlank(proposalContent)) {
throw new RuntimeException("案由不能为空");
}
// 建议措施
if(StrUtil.isBlank(proposalMeasures)) {
throw new RuntimeException("建议措施不能为空");
}
// 判断当前导入用户是否是代表
Teacher_congress_delegate delegate = teacherCongressDelegateService.fetch(Cnd.where(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())
.and(Teacher_congress_delegate::getDelFlag, "!=", 1).limit(1));
if(delegate == null) {
throw new RuntimeException("当前用户不是代表");
}
// 教代会
List<Teacher_congress_session> teacherCongressSessions = this.dao().query(Teacher_congress_session.class, Cnd.where("enable", "=", 1).desc("startDate"));
if(teacherCongressSessions == null || teacherCongressSessions.size() <= 0) {
throw new RuntimeException("没有开启的教代会");
}
Teacher_congress_session teacherCongressSession = teacherCongressSessions.get(0);
// 保存到数据库
ProposalInfo proposalInfo = new ProposalInfo();
// 状态码
proposalInfo.setStateCode(ProposalState.UNSUBMIT);
// 教代会信息
proposalInfo.setSessionId(teacherCongressSession.getId());
// 代表团ID
proposalInfo.setDelegationId(delegate.getDelegationId());
// 提案编号
Sql sql = Sqls.create("select max(code) proposalCode from proposal_info where sessionId='%s' and stateCode<='%s'".formatted(proposalInfo.getSessionId(), ProposalState.CASE));
sql.setCallback(Sqls.callback.map());
Map<String, Object> map = this.dao().execute(sql).getObject(Map.class);
int proposalCode = MapUtil.getInt(map, "proposalCode", -1);
if (proposalCode == -1) {
proposalCode = Integer.parseInt(com.budwk.app.sys.utils.DateUtil.getYear() + "01");
} else {
proposalCode = proposalCode + 1;
}
proposalInfo.setCode(proposalCode + "");
// 提案人
proposalInfo.setCreateUserId(user.getId());
proposalInfo.setCreateUserName(user.getUsername());
// 提案名称
proposalInfo.setName(proposalName);
// 提案时间
proposalInfo.setCreateTime(proposalDate);
// 提案方式
proposalInfo.setSource(proposalSourceDict.getCode());
// 提案类型
proposalInfo.setTypeId(proposalTypeObj.getId());
// 案由
proposalInfo.setBrief(proposalContent);
// 建议措施
proposalInfo.setMeasures(proposalMeasures);
this.insert(proposalInfo);
}
@Override
public void updateStateCode(String id, Integer stateCode) {
Sql sql = Sqls.create("update proposal_info set stateCode='%s' where id='%s'".formatted(stateCode, id));
this.dao().execute(sql);
}
}
@@ -1,30 +1,44 @@
package com.budwk.app.zhgh.democratic.proposal.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.map.MapUtil;
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.models.Sys_user;
import com.budwk.app.sys.services.SysDictService;
import com.budwk.app.sys.services.SysUserService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.democratic.proposal.constants.ProposalState;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
import com.budwk.app.zhgh.democratic.proposal.models.ProposalType;
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.delegate.service.TeacherCongressDelegateService;
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.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@IocBean(args = {"refer:dao"})
public class ProposalWriteServiceImpl extends BaseServiceImpl<ProposalInfo> implements ProposalWriteService {
@Inject
private SysDictService sysDictService;
@Inject
private TeacherCongressDelegateService teacherCongressDelegateService;
@Inject
private SysUserService sysUserService;
public ProposalWriteServiceImpl(Dao dao) {
super(dao);
@@ -67,28 +81,163 @@ public class ProposalWriteServiceImpl extends BaseServiceImpl<ProposalInfo> impl
@Override
public String generateProposalCode(String sessionId, String delegationId) {
//查询届次下 某代表团的提案数量
Teacher_congress_session session = dao().fetch(Teacher_congress_session.class, sessionId);
Teacher_congress_delegation delegation = dao().fetch(Teacher_congress_delegation.class, delegationId);
Sql sql = Sqls.fetchString("""
SELECT
MAX( t1.code ) as proposalCode
FROM
proposal_info t1
WHERE
t1.sessionId = @sessionId
AND t1.delegationId = @delegationId
""");
sql.setParam("sessionId", sessionId);
sql.setParam("delegationId", delegationId);
execute(sql);
String proposalCode = sql.getString();
if (StrUtil.isBlank(proposalCode)) {
proposalCode = delegation.getCode() + "-" + "01";
// Teacher_congress_session session = dao().fetch(Teacher_congress_session.class, sessionId);
// Teacher_congress_delegation delegation = dao().fetch(Teacher_congress_delegation.class, delegationId);
//
// Sql sql = Sqls.fetchString("""
// SELECT
// MAX( t1.code ) as proposalCode
// FROM
// proposal_info t1
// WHERE
// t1.sessionId = @sessionId
// AND t1.delegationId = @delegationId
// """);
// sql.setParam("sessionId", sessionId);
// sql.setParam("delegationId", delegationId);
// execute(sql);
// String proposalCode = sql.getString();
// if (StrUtil.isBlank(proposalCode)) {
// proposalCode = delegation.getCode() + "-" + "01";
// } else {
// String s = String.format("%02d", (Convert.toInt(proposalCode.substring(proposalCode.length() - 2))) + 1);
// proposalCode = delegation.getCode() + "-" + s;
// }
Sql sql = Sqls.create("select max(code) proposalCode from proposal_info where sessionId='%s' and stateCode<='%s'".formatted(sessionId, ProposalState.CASE));
sql.setCallback(Sqls.callback.map());
Map<String, Object> map = this.dao().execute(sql).getObject(Map.class);
int proposalCode = MapUtil.getInt(map, "proposalCode", -1);
if (proposalCode == -1) {
proposalCode = Integer.parseInt(com.budwk.app.sys.utils.DateUtil.getYear() + "01");
} else {
String s = String.format("%02d", (Convert.toInt(proposalCode.substring(proposalCode.length() - 2))) + 1);
proposalCode = delegation.getCode() + "-" + s;
proposalCode = proposalCode + 1;
}
return proposalCode;
return String.valueOf(proposalCode);
}
@Override
public List<Sys_dict> listSourceByCode(String code) {
Sys_dict dict = sysDictService.fetch(Cnd.where("code", "=", code));
return dict == null ? new ArrayList<>() : sysDictService.query(Cnd.where("parentId", "=", Strings.sNull(dict.getId())).asc("location"));
}
@Override
public ProposalInfo importProposal(Map<String, String> dataMap) {
String loginName = MapUtil.getStr(dataMap, "工号", "");
String username = MapUtil.getStr(dataMap, "提案人", "");
String proposalDate = MapUtil.getStr(dataMap, "提案时间", "");
String proposalType = MapUtil.getStr(dataMap, "提案类型", "");
String proposalSource = MapUtil.getStr(dataMap, "提案方式", "");
String proposalName = MapUtil.getStr(dataMap, "提案名称", "");
String proposalContent = MapUtil.getStr(dataMap, "案由", "");
String proposalMeasures = MapUtil.getStr(dataMap, "建议措施", "");
// 工号
if(StrUtil.isBlank(loginName)) {
throw new RuntimeException("工号不能为空");
}
Sys_user user = sysUserService.getByLoginName(loginName);
if(user == null){
throw new RuntimeException("工号不存在");
}
if(StrUtil.isNotBlank(username) && !username.equals(user.getUsername())) {
throw new RuntimeException("工号和提案人不一致");
}
// 提案时间
if(StrUtil.isBlank(proposalDate)) {
throw new RuntimeException("提案时间不能为空");
}
// 提案类型
if(StrUtil.isBlank(proposalType)) {
throw new RuntimeException("提案类型不能为空");
}
ProposalType proposalTypeObj = dao().fetch(ProposalType.class, Cnd.where(ProposalType::getName, "=", proposalType));
if(proposalTypeObj == null) {
throw new RuntimeException("提案类型不存在");
}
// 提案方式
if(StrUtil.isBlank(proposalSource)) {
throw new RuntimeException("提案方式不能为空");
}
Sys_dict dict = sysDictService.fetch(Cnd.where("code", "=", "PROPOSAL_SOURCE"));
if(dict == null) {
throw new RuntimeException("提案方式字典配置不存在");
}
List<Sys_dict> sysDicts = sysDictService.query(Cnd.where("parentId", "=", Strings.sNull(dict.getId())).asc("location"));
if(sysDicts == null || sysDicts.size() == 0) {
throw new RuntimeException("提案方式字典配置不存在");
}
Sys_dict proposalSourceDict = sysDicts.stream().filter(v -> v.getName().equals(proposalSource)).findFirst().orElse(null);
if(proposalSourceDict == null) {
throw new RuntimeException("提案方式不存在");
}
// 提案名称
if(StrUtil.isBlank(proposalName)) {
throw new RuntimeException("提案名称不能为空");
}
// 案由
if(StrUtil.isBlank(proposalContent)) {
throw new RuntimeException("案由不能为空");
}
// 建议措施
if(StrUtil.isBlank(proposalMeasures)) {
throw new RuntimeException("建议措施不能为空");
}
// 判断当前导入用户是否是代表
Teacher_congress_delegate delegate = teacherCongressDelegateService.fetch(Cnd.where(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())
.and(Teacher_congress_delegate::getDelFlag, "!=", 1).limit(1));
if(delegate == null) {
throw new RuntimeException("当前用户不是代表");
}
// 教代会
List<Teacher_congress_session> teacherCongressSessions = this.dao().query(Teacher_congress_session.class, Cnd.where("enable", "=", 1).desc("startDate"));
if(teacherCongressSessions == null || teacherCongressSessions.size() <= 0) {
throw new RuntimeException("没有开启的教代会");
}
Teacher_congress_session teacherCongressSession = teacherCongressSessions.get(0);
// 保存到数据库
ProposalInfo proposalInfo = new ProposalInfo();
// 状态码
proposalInfo.setStateCode(ProposalState.UNSUBMIT);
// 教代会信息
proposalInfo.setSessionId(teacherCongressSession.getId());
// 代表团ID
proposalInfo.setDelegationId(delegate.getDelegationId());
// 提案编号
Sql sql = Sqls.create("select max(code) proposalCode from proposal_info where sessionId='%s' and stateCode<='%s'".formatted(proposalInfo.getSessionId(), ProposalState.CASE));
sql.setCallback(Sqls.callback.map());
Map<String, Object> map = this.dao().execute(sql).getObject(Map.class);
int proposalCode = MapUtil.getInt(map, "proposalCode", -1);
if (proposalCode == -1) {
proposalCode = Integer.parseInt(com.budwk.app.sys.utils.DateUtil.getYear() + "01");
} else {
proposalCode = proposalCode + 1;
}
proposalInfo.setCode(proposalCode + "");
// 提案人
proposalInfo.setCreateUserId(user.getId());
proposalInfo.setCreateUserName(user.getUsername());
// 提案名称
proposalInfo.setName(proposalName);
// 提案时间
proposalInfo.setCreateTime(proposalDate);
// 提案方式
proposalInfo.setSource(proposalSourceDict.getCode());
// 提案类型
proposalInfo.setTypeId(proposalTypeObj.getId());
// 案由
proposalInfo.setBrief(proposalContent);
// 建议措施
proposalInfo.setMeasures(proposalMeasures);
return proposalInfo;
}
}
@@ -114,6 +114,31 @@ const initTableMixins = {
this.$set(this.pageForm, 'isAudit', approvalParam === 'done')
this._approvalInitialized = true;
}
},
fileHandleRemove(file, fileList) {
return fileList;
},
fileHandleChange(file, fileList, {type, size}) {
const removeFile = () => {
fileList.splice(fileList.findIndex(v => v === file))
}
if (!file.size) {
this.notifyWarning('您选择的是空文件!')
removeFile()
}
if (type && type.length && !type.includes(file.name.split('.').pop().toLowerCase())) {
this.notifyWarning(`文件只能是 ${type.map(v => v.toUpperCase()).join('/')} 格式!`)
removeFile()
}
if (size && !file.size < size) {
this.notifyWarning(`文件大小不能超过 ${size / 1024 / 1024}MB`)
removeFile()
}
return fileList;
}
},
created() {
Binary file not shown.
@@ -0,0 +1,108 @@
<!--#
layout("/layouts/platform.html"){
#-->
<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-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" style="width: 100%">
<el-table-column label="序号" width="50" type="index" :index="indexMethod" fixed="left"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.key"
:min-width="column.width"
:fixed="column.fixed"
show-overflow-tooltip
v-for="column in tableColumns"
v-if="column.visible !== false"
>
<template v-if="column.prop === '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>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include('../../common/info.js'){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
components: {
"proposal-info": PROPOSAL_INFO
},
data() {
return {
tableColumns: [
{label: "提案编号", prop: "code"},
{label: "提案名称", prop: "name", width: "200px"},
{label: "提案人", prop: "createUserName", width: "80px"},
{label: "提案类别", prop: "typeName"},
{label: "届次", prop: "sessionName"},
{label: "代表团", prop: "delegationName"},
{label: "流程状态", prop: "instanceState"}
],
pageForm: {
approval: false
},
showApprovalForm: false,
}
},
created() {
this.pageData()
this.listOpenSession()
},
methods: {
// 查询开启的教代会
listOpenSession() {
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions) {
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
this.pageData()
this.listDelegation()
}
}
})
},
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,202 @@
<!--#
layout("/layouts/platform.html"){
#-->
<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-item label="姓名/工号">
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.createUserKeyword"></el-input>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool :columns.sync="tableColumns">
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
<el-table-column label="序号" width="50" type="index" :index="indexMethod" fixed="left"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.key"
:min-width="column.width"
:fixed="column.fixed"
show-overflow-tooltip
v-for="column in tableColumns"
v-if="column.visible !== false"
>
<template v-if="column.prop === 'instanceState'" scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskState === 10" @click="openAudit(row)" size="mini" type="primary">审核
</el-button>
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #edit>
<proposal-info ref="proposalInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
{{formData.taskName}}
</div>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="150px" label-suffix="">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人" proop="tf_username">
<el-input readonly v-model="formData.tf_username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间">
<el-input readonly v-model="formData.tf_auditTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="二次答复" prop="tf_caseCheckNeedSecondReply">
<el-radio-group v-model="formData.tf_caseCheckNeedSecondReply">
<el-radio :label="0" border>
无需二次答复
</el-radio>
<el-radio :label="1" border>
需要二次答复
</el-radio>
</el-radio-group>
<span class="text-primary ml10" v-if="formData.tf_caseCheckNeedSecondReply">
(二次答复只需要主办单位答复)
</span>
</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(6)" size="small" type="info">退回到提案人</el-button>
<el-button @click="handleTaskAction(2)" size="small" type="danger">不同意</el-button>
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意</el-button>
</el-row>
</div>
</proposal-info>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include('../../common/info.js'){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
components: {
"proposal-info": PROPOSAL_INFO
},
data() {
return {
tableColumns: [
{label: "提案编号", prop: "code"},
{label: "提案名称", prop: "name", width: "200px"},
{label: "提案人", prop: "createUserName", width: "80px"},
{label: "提案类别", prop: "typeName"},
{label: "届次", prop: "sessionName"},
{label: "代表团", prop: "delegationName"},
{label: "当前节点", prop: "curTaskName"},
{label: "流程状态", prop: "instanceState"}
],
pageForm: {
approval: false
},
showApprovalForm: false,
}
},
created() {
this.pageData()
this.listOpenSession()
},
methods: {
openView(row) {
this.$refs.guava.edit(() => {
this.showApprovalForm = false
this.$refs.proposalInfoRef.onOpen(row)
})
},
openAudit(row) {
this.$refs.guava.edit(() => {
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_auditTime: this.$moment().format('YYYY-MM-DD'),
tf_username: this.$store.state.user.username
}
this.$refs.proposalInfoRef.onOpen(row)
})
},
// 查询开启的教代会
listOpenSession() {
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions) {
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
this.pageData()
this.listDelegation()
}
}
})
},
handleTaskAction(val) {
this.$refs.formRef.validate(valid => {
if (!valid) return
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
})
})
}
}
})
</script>
<!--#
}
#-->
@@ -2,429 +2,351 @@
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-input v-model="pageForm.code" placeholder="提案编号" @keyup.enter.native="doSearch" clearable style="width: 100%"></el-input>
</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
@keyup.enter.native="doSearch"
clearable
placeholder="请输入提案人姓名"
v-model="pageForm.createUserName"
style="width: 100%"
></el-input>
</search-item>
<search-item label="提案人工号">
<el-input
@keyup.enter.native="doSearch"
clearable
placeholder="请输入提案人工号"
v-model="pageForm.createUserLoginName"
style="width: 100%"
></el-input>
</search-item>
<search-item label="教代会">
<el-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>
</el-card>
<el-card shadow="never">
<table-tool>
<el-button @click="openConsolidationApproval" size="small" type="primary" class="mr5">重新并案审核</el-button>
<el-radio-group v-model="pageForm.approval" @change="doSearch();$refs.tableRef.clearSelection()" size="small">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table
:data="tableData"
ref="tableRef"
@sort-change="pageOrder"
header-align="center"
style="width: 100%"
:row-key="(val)=>{val.id + val.processInstanceTaskId}"
>
<el-table-column
v-if="!pageForm.approval"
type="selection"
reserve-selection
:selectable="(row)=>row.processInstanceTaskStatus==='ACTIVE'"
></el-table-column>
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
<el-table-column label="提案编号" prop="code" width="120" sortable></el-table-column>
<el-table-column label="提案名称" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="提案人" prop="createUserName"></el-table-column>
<el-table-column label="代表团" prop="delegationName" show-overflow-tooltip></el-table-column>
<el-table-column label="立案结果" prop="caseFilingResult">
<template scope="{row}">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT" :value="row.caseFilingResult"></dict-tag>
</template>
</el-table-column>
<el-table-column label="是否并案" prop="isConsolidation">
<template scope="{row}">
<el-tag size="mini" v-if="row.isConsolidation" type="success"></el-tag>
<el-tag size="mini" v-else type="danger"></el-tag>
</template>
</el-table-column>
<el-table-column label="当前节点" prop="processInstanceNodeName" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" fixed="right" width="200px">
<template scope="{row}">
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
<el-button v-if="row.processInstanceTaskStatus==='ACTIVE'" @click="openApproval(row)" size="mini" type="primary">
审核
</el-button>
<el-button
v-if="row.processInstanceTaskStatus==='COMPLETE' && !row.nextTaskIsComplete"
@click="openRevoke(row.processInstanceTaskId)"
size="mini"
type="danger"
>
撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #public>
<proposal-info ref="infoRef"></proposal-info>
<div v-if="showApprovalForm">
<div class="process-title">{{formData.processInstanceNodeName}}</div>
<el-alert v-if="formData.isConsolidation" type="success" title="提醒:本提案已并案,您只需审核一次即可!"></el-alert>
<el-divider></el-divider>
<el-form :model="formData" ref="approvalFormRef" label-position="left" label-width="80px">
<el-form-item label="立案结果" prop="caseFilingResult" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-radio-group v-model="formData.caseFilingResult" size="small">
<el-radio v-for="item in dict.type.PROPOSAL_CASE_FILING_RESULT" :label="item.code" border>{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="主办单位"
v-if="['CONFIRM_FILING','SUGGESTION'].includes(formData.caseFilingResult)"
:rules="[{required:['CONFIRM_FILING','SUGGESTION'].includes(formData.caseFilingResult),message:'必填',trigger:['change','blur']}]"
>
<el-select v-model="formData.hostUnitId" filterable clearable style="width: 100%">
<el-option
v-for="item in underTakeOptions"
:label="item.name"
:value="item.id"
:key="item.id"
:disabled="formData && formData.helpUnitIds.includes(item.id)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="协办单位" v-if="['CONFIRM_FILING','SUGGESTION'].includes(formData.caseFilingResult)">
<el-select v-model="formData.helpUnitIds" filterable clearable multiple style="width: 100%">
<el-option
v-for="item in underTakeOptions"
:label="item.name"
:value="item.id"
:key="item.id"
:disabled="item.id===formData.hostUnitId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="审核意见" prop="approvalOpinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.approvalOpinion"></user-opinion-textarea>
</el-form-item>
<!-- <el-form-item label="电子签名" prop="approvalSignature" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">-->
<!-- <pc-signature v-model="formData.approvalSignature"></pc-signature>-->
<!-- </el-form-item>-->
</el-form>
<el-row type="flex" justify="end">
<el-button plain @click="$refs.guava.index()">取消</el-button>
<el-button type="primary" @click="doApproval('DYNAMIC')">提交</el-button>
</el-row>
</div>
</template>
<template #edit>
<div class="process-title">并案提案列表</div>
<el-table :data="consolidationProposalTableData" size="small">
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
<el-table-column label="提案编号" prop="code" width="120px" sortable></el-table-column>
<el-table-column label="提案名称" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column label="提案人" prop="createUserName" width="200px"></el-table-column>
<el-table-column label="代表团" prop="delegationName" width="300px"></el-table-column>
<el-table-column label="立案结果" prop="caseFilingResult" width="100px">
<template scope="{row}">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT" :value="row.caseFilingResult"></dict-tag>
</template>
</el-table-column>
<el-table-column label="是否并案" prop="isConsolidation" width="100px">
<template scope="{row}">
<el-tag size="mini" v-if="row.isConsolidation" type="success"></el-tag>
<el-tag size="mini" v-else type="danger"></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="100px">
<template scope="{row}">
<el-link size="mini" type="primary" @click="openViewDialog(row)">查看</el-link>
</template>
</el-table-column>
</el-table>
<div class="process-title">{{consolidationFormData.processInstanceNodeName}}</div>
<el-form :model="consolidationFormData" ref="consolidationFormRef" label-position="left" label-width="80px">
<el-form-item label="立案结果" prop="caseFilingResult" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-radio-group v-model="consolidationFormData.caseFilingResult" size="small">
<el-radio v-for="item in dict.type.PROPOSAL_CASE_FILING_RESULT" :label="item.code" border>{{item.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="主办单位"
v-if="['CONFIRM_FILING','SUGGESTION'].includes(consolidationFormData.caseFilingResult)"
:rules="[{required:['CONFIRM_FILING','SUGGESTION'].includes(consolidationFormData.caseFilingResult),message:'必填',trigger:['change','blur']}]"
>
<el-select v-model="consolidationFormData.hostUnitId" filterable clearable style="width: 100%">
<el-option
v-for="item in underTakeOptions"
:label="item.name"
:value="item.id"
:key="item.id"
:disabled="consolidationFormData && consolidationFormData.helpUnitIds.includes(item.id)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="协办单位" v-if="['CONFIRM_FILING','SUGGESTION'].includes(consolidationFormData.caseFilingResult)">
<el-select v-model="consolidationFormData.helpUnitIds" filterable clearable multiple style="width: 100%">
<el-option
v-for="item in underTakeOptions"
:label="item.name"
:value="item.id"
:key="item.id"
:disabled="item.id===consolidationFormData.hostUnitId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="审核意见" prop="approvalOpinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="consolidationFormData.approvalOpinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="电子签名" prop="approvalSignature" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="consolidationFormData.approvalSignature"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button plain @click="$refs.guava.index()">取消</el-button>
<el-button type="primary" @click="doConsolidationApproval('PASS')">提交</el-button>
</el-row>
</template>
<el-dialog title="提案详情" :visible.sync="viewDialogVisible" width="1200px" top="50px" append-to-body>
<div style="max-height: 80vh; overflow-y: auto">
<proposal-info ref="infoDialogRef"></proposal-info>
</div>
</el-dialog>
</guava>
<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.code" placeholder="提案编号" @keyup.enter.native="doSearch" clearable
style="width: 100%"></el-input>
</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-item label="提案人姓名">-->
<!-- <el-input-->
<!-- @keyup.enter.native="doSearch"-->
<!-- clearable-->
<!-- placeholder="请输入提案人姓名"-->
<!-- v-model="pageForm.createUserName"-->
<!-- style="width: 100%"-->
<!-- ></el-input>-->
<!-- </search-item>-->
<!-- <search-item label="提案人工号">-->
<!-- <el-input-->
<!-- @keyup.enter.native="doSearch"-->
<!-- clearable-->
<!-- placeholder="请输入提案人工号"-->
<!-- v-model="pageForm.createUserLoginName"-->
<!-- style="width: 100%"-->
<!-- ></el-input>-->
<!-- </search-item>-->
</search>
</el-card>
<el-card shadow="never">
<table-tool :columns.sync="tableColumns">
<!-- <el-button type="primary" icon="el-icon-plus" size="small" @click="openMerge">并案审核</el-button>-->
<!-- <el-button type="primary" icon="el-icon-plus" size="small" @click="doUpData">更新</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 type="selection" width="50" fixed="left" v-if="!pageForm.approval"></el-table-column>
<el-table-column label="序号" width="50" type="index" :index="indexMethod"
fixed="left"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.key"
:min-width="column.width"
:fixed="column.fixed"
show-overflow-tooltip
v-for="column in tableColumns"
v-if="column.visible !== false"
>
<template v-if="column.prop === 'caseFilingResult'" scope="{row}">
<dict-tag v-if="row.taskState!==10"
:options="dict.type.PROPOSAL_CASE_FILING_RESULT"
:value="row.caseFilingResult"></dict-tag>
</template>
<template v-else-if="column.prop === 'merge'" scope="{row}">
<el-tag v-if="row.merge" size="small"></el-tag>
</template>
<template v-else-if="column.prop === 'instanceState'" scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskState === 10" @click="openAudit(row)" size="mini" type="primary">审核
</el-button>
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #edit>
<proposal-info ref="proposalInfoRef" @done-tasks="doneTasks">
<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_caseFilingResult"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-radio-group v-model="formData.tf_caseFilingResult" size="small">
<el-radio v-for="item in dict.type.PROPOSAL_CASE_FILING_RESULT" :label="item.code"
border>{{item.label}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="['CONFIRM_FILING'].includes(formData.tf_caseFilingResult)" label="立案类型"
prop="tf_caseFilingType"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-radio-group v-model="formData.tf_caseFilingType" size="small">
<el-radio v-for="item in dict.type.PROPOSAL_CASE_FILING_TYPE" :label="item.code" border>
{{item.label}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="主办单位"
v-if="['CONFIRM_FILING','SUGGESTION'].includes(formData.tf_caseFilingResult)"
:rules="[{required:['CONFIRM_FILING','SUGGESTION'].includes(formData.tf_caseFilingResult),message:'必填',trigger:['change','blur']}]"
prop="tf_masterUnitId"
>
<el-select v-model="formData.tf_masterUnitId" filterable clearable style="width: 100%">
<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="协办单位"
v-if="['CONFIRM_FILING','SUGGESTION'].includes(formData.tf_caseFilingResult)"
prop="tf_slaveUnitIds"
>
<el-select v-model="formData.tf_slaveUnitIds" filterable clearable multiple
style="width: 100%">
<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(6)" size="small" type="info">退回到提案人</el-button>
<el-button @click="handleTaskAction(1)" size="small" type="primary">提交</el-button>
</el-row>
</div>
</proposal-info>
</template>
<template #public>
<merge ref="mergeRef" @close="$refs.guava.index()"></merge>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include("../../common/info.js"){}#-->
const vue = new Vue({
el: "#app",
dicts: ["PROPOSAL_CASE_FILING_RESULT"],
store,
mixins: [initTableMixins],
components: {
"proposal-info": PROPOSAL_INFO_COMPONENT
},
data() {
return {
sessionOptions: [],
delegationOptions: [],
underTakeOptions: [],
formData: {
hostUnitIds: null,
helpUnitId: []
},
pageForm: {
approval: false
},
showApprovalForm: false,
//并案的提案列表
consolidationProposalTableData: [],
consolidationFormData: {},
viewDialogVisible: false
}
},
methods: {
openView(row) {
this.$refs.guava.public(() => {
this.$refs.infoRef.onOpen(row.id)
this.showApprovalForm = false
})
},
openApproval(row) {
this.$refs.guava.public(() => {
this.$refs.infoRef.onOpen(row.id)
this.formData = row.approvalParam
this.formData.isConsolidation = row.isConsolidation
this.$axios
.post(loc() + "/committeeFiling", {
processInstanceId: row.processInstanceId,
processInstanceTaskId: row.processInstanceTaskId
})
.then((res) => {
if (res.code === 0) {
this.$set(this.formData, "caseFilingResult", res.data.caseFilingResult)
this.$set(this.formData, "hostUnitId", res.data.hostUnitId)
this.$set(this.formData, "helpUnitIds", res.data.helpUnitIds || [])
this.$set(this.formData, "approvalOpinion", res.data.approvalOpinion)
this.$set(this.formData, "proposalIds", res.data.consolidationIds || [row.id])
}
})
this.showApprovalForm = true
})
},
doApproval(approvalType) {
this.formData.bpmTaskApprovalType = approvalType
this.$refs.approvalFormRef.validate((valid) => {
if (valid) {
this.$axios
.post(loc() + "/approval", {
approval: JSON.stringify(this.formData)
})
.then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
}
})
},
openRevoke(taskId) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
this.$axios.post(loc() + "/revoke", { taskId }).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
viewSingleProposal(row) {
this.proposalInfoVisible = true
this.$nextTick(() => {
this.$refs.infoRef.onOpen(row.id)
})
},
//打开并案审核
openConsolidationApproval() {
const selection = this.$refs.tableRef.selection
if (selection.length < 2) {
this.$message.error("并案审核至少需要选择两条提案")
return
}
this.consolidationProposalTableData = selection
this.$refs.guava.edit()
this.consolidationFormData = selection[0].approvalParam
this.$set(this.consolidationFormData, "caseFilingResult", null)
this.$set(this.consolidationFormData, "hostUnitId", null)
this.$set(this.consolidationFormData, "helpUnitIds", [])
this.$set(this.consolidationFormData, "helpUnitIds", [])
this.$set(this.consolidationFormData, "approvalOpinion", null)
this.$set(
this.consolidationFormData,
"proposalIds",
selection.map((v) => v.id)
)
},
openViewDialog(row) {
this.viewDialogVisible = true
this.$nextTick(() => {
this.$refs.infoDialogRef.onOpen(row.id)
})
},
//并案审核
doConsolidationApproval() {
this.consolidationFormData.bpmTaskApprovalType = "DYNAMIC"
this.$refs.consolidationFormRef.validate((valid) => {
if (valid) {
this.$axios
.post(loc() + "/approval", {
approval: JSON.stringify(this.consolidationFormData)
})
.then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$refs.tableRef.clearSelection()
this.$message.success(res.msg)
this.doSearch()
}
})
}
})
},
//教代会change
async meetingChange(val) {
this.formData.delegationId = null
this.formData.committeeId = null
this.delegationOptions = await proposal.getDelegation(val)
this.committeeOptions = await this.getInstitutions(val)
},
listDelegation() {
this.$axios.post("/platform/proposal/common/listDelegation", { sessionId: this.pageForm.sessionId }).then((res) => {
if (res.code === 0) {
this.delegationOptions = res.data
}
})
},
listOpenSession() {
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions) {
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
this.pageData()
this.listDelegation()
}
}
})
},
listUnderTake() {
this.$axios.post(loc() + "/listUnderTake").then((res) => {
if (res.code === 0) {
this.underTakeOptions = res.data
}
})
}
},
created() {
this.listOpenSession()
this.listUnderTake()
}
})
<!--#include('../../common/info.js'){}#-->
<!--#include('../committeeFiling/merge.js'){}#-->
new Vue({
el: "#app",
store,
dicts: ["PROPOSAL_CASE_FILING_RESULT", "PROPOSAL_CASE_FILING_TYPE"],
mixins: [initTableMixins],
components: {
"proposal-info": PROPOSAL_INFO,
merge
},
data() {
return {
tableColumns: [
{label: "提案编号", prop: "code"},
{label: "提案名称", prop: "name", width: "200px"},
{label: "提案类别", prop: "typeName"},
{label: "届次", prop: "sessionName"},
{label: "立案结果", prop: "caseFilingResult"},
{label: "代表团", prop: "delegationName"},
{label: "当前节点", prop: "curTaskName"},
{label: "流程状态", prop: "instanceState"}
],
pageForm: {
approval: false
},
formData: {
tf_masterUnitId: null,
tf_slaveUnitIds: []
},
showApprovalForm: false,
sessionOptions: [],
delegationOptions: [],
underTakeOptions: [],
}
},
methods: {
doUpData(){
this.$.axios.post(loc()+"/doUpData")
},
openView(row) {
this.$refs.guava.edit(() => {
this.showApprovalForm = false
this.$refs.proposalInfoRef.onOpen(row)
})
},
doneTasks(val) {
const data = val[val.length - 1]
this.$set(this.formData, "tf_caseFilingResult", data.ext.tf_caseFilingResult)
this.$set(this.formData, "tf_caseFilingType", data.ext.tf_caseFilingType)
this.$set(this.formData, "tf_masterUnitId", data.ext.tf_masterUnitId)
this.$set(this.formData, "tf_slaveUnitIds", data.ext.tf_slaveUnitIds)
},
openAudit(row) {
this.$refs.guava.edit(() => {
this.showApprovalForm = true
this.formData = {
proposalId: row.id,
processTaskId: row.taskId,
taskName: row.curTaskName,
tf_masterUnitId: null,
tf_slaveUnitIds: []
}
this.$refs.proposalInfoRef.onOpen(row)
})
},
handleTaskAction(val) {
this.$refs.formRef.validate(valid => {
if (!valid) return
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
// 是否有协办单位
let tf_helpunitreply;
if (this.formData.tf_slaveUnitIds && this.formData.tf_slaveUnitIds.length > 0) {
tf_helpunitreply = 'HAS_HELP_UNIT'
} else {
tf_helpunitreply = 'NO_HELP_UNIT'
}
const loading = createLoading('提交中')
this.$axios.post("/platform/proposal/committeeFilingUnit/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(','),
tf_helpunitreply: tf_helpunitreply
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
})
})
},
// 打开并案审核
openMerge() {
const selection = this.$refs.tableRef.selection
if (selection.length < 2) {
this.$message.warning('请先勾选需要并案审核的提案,至少需要两条提案')
return
}
this.$refs.guava.public(() => {
this.$refs.mergeRef.onOpen(selection, {
processTaskIds: selection.map(v => v.taskId),
taskName: selection[0].curTaskName,
tf_masterUnitId: null,
tf_slaveUnitIds: []
})
})
},
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info"
}).then(() => {
this.$axios.post("/platform/proposal/committeeFilingUnit/revokeTask", {
taskId: row.taskId,
proposalId: row.id
}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
// 教代会
async meetingChange(val) {
this.doSearch()
},
// 查询开启的教代会
listOpenSession() {
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions) {
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
this.pageData()
}
}
})
},
// 查询承办单位
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>
<!--#
}
#-->
@@ -107,6 +107,7 @@ layout("/layouts/platform.html"){
tableColumns: [
{label: "提案编号", prop: "code"},
{label: "提案名称", prop: "name", width: "200px"},
{label: "提案人", prop: "createUserName", width: "80px"},
{label: "提案类别", prop: "typeName"},
{label: "届次", prop: "sessionName"},
{label: "代表团", prop: "delegationName"},
@@ -22,7 +22,11 @@ layout("/layouts/platform.html"){
</search>
</el-card>
<el-card shadow="never">
<table-tool :columns.sync="tableColumns"></table-tool>
<table-tool :columns.sync="tableColumns">
<el-button class="ml5" icon="el-icon-upload2" plain type="primary"
@click="openImport">导入提案
</el-button>
</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
@@ -46,8 +50,11 @@ layout("/layouts/platform.html"){
<span>{{ (row.startTaskId) ? row.taskName : '待提交' }}</span>
</template>
<template v-else-if="column.prop === 'instanceState'" scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
<span v-if="row.instanceState">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</span>
<span v-else>未提交</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="400px">
@@ -75,6 +82,60 @@ layout("/layouts/platform.html"){
</template>
</el-table-column>
</el-table>
<el-dialog
title="提案导入"
:visible.sync="importVisible"
:close-on-click-modal="false"
width="50%"
>
<el-timeline-item timestamp="下载模板" placement="top">
<el-card>
<el-row :gutter="24">
<el-col :span="24">
<el-radio-group v-model="importTemplateType">
<el-radio :label="1">excel</el-radio>
<el-radio :label="2">word</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row :gutter="24" style="margin-top: 20px;">
<el-col :span="24">
<el-button size="medium" type="" style="width: 200px"
@click="downloadTemplate"
icon="el-icon-download">下载模板
</el-button>
</el-col>
</el-row>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传文件" placement="top">
<el-card>
<el-upload
name="file"
ref="upload"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList)
}"
:on-change="(file, fileList) => {
if(this.importTemplateType === 2) {
importData.fileList = fileHandleChange(file, fileList,{type:['docx']})
} else {
importData.fileList = fileHandleChange(file, fileList,{type:['xlsx']})
}
}"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList">
<el-button size="medium" type="" icon="el-icon-upload" style="width: 200px">选择文件
</el-button>
</el-upload>
</el-card>
</el-timeline-item>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false" :disabled="importLoading">取 消</el-button>
<el-button type="primary" @click="doImport" :loading="importLoading">确定</el-button>
</span>
</el-dialog>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #public>
@@ -100,16 +161,22 @@ layout("/layouts/platform.html"){
},
data() {
return {
// 将 window.location 的引用存储在响应式数据中
location: window.location,
importTemplateType: 1,
importData: {},
importVisible: false,
importLoading: false,
sessionOptions: [],
businessNo: null,
tableColumns: [
{label: "提案编号", prop: "code"},
{label: "提案名称", prop: "name", width: "200px"},
{label: "提案", prop: "createUserName"},
{label: "提案类", prop: "typeName"},
{label: "提案时间", prop: "createTime"},
{label: "提案类", prop: "typeName"},
{label: "提案方式", prop: "sourceName"},
{label: "届次", prop: "sessionName"},
{label: "代表团", prop: "delegationName"},
{label: "当前节点", prop: "taskName"},
{label: "提案状态", prop: "taskName"},
{label: "流程状态", prop: "instanceState"}
]
}
@@ -202,8 +269,53 @@ layout("/layouts/platform.html"){
}
})
}
}
},
// 打开导入模板
async openImport() {
this.importData = {
fileList: []
}
this.importVisible = true;
},
downloadTemplate() {
let templateType = '.xlsx'
if(this.importTemplateType === 2) {
templateType = '.docx'
}
this.location.href='/platform/basics/downloadTemplate?filePath=proposal/proposal' + templateType + '&fileName=教职工代表大会提案表' + templateType
},
doImport() {
if (!this.importData.fileList.length) {
this.notifyWarning("请选择文件!")
return
}
const data = new FormData();
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name);
});
this.importLoading = false
$.ajax({
url: loc() + "/importProposal?templateType=" + this.importTemplateType,
type: "post",
data: data,
processData: false,
contentType: false,
success: (data) => {
if (!data.code) {
this.pageData();
this.importVisible = false
} else {
this.notifyWarning(data.msg)
}
this.importLoading = false
},
error: (data) => {
this.notifyWarning("导入失败")
this.importLoading = false
}
});
},
},
created() {
this.listSession()
@@ -212,6 +324,9 @@ layout("/layouts/platform.html"){
}
})
</script>
<style>
</style>
<!--#
}
#-->
@@ -0,0 +1,179 @@
<!--#
layout("/layouts/platform.html"){
#-->
<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-item label="姓名/工号">
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.createUserKeyword"></el-input>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool :columns.sync="tableColumns">
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
<el-table-column label="序号" width="50" type="index" :index="indexMethod" fixed="left"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.key"
:min-width="column.width"
:fixed="column.fixed"
show-overflow-tooltip
v-for="column in tableColumns"
v-if="column.visible !== false"
>
<template v-if="column.prop === 'instanceState'" scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskState === 10" @click="openAudit(row)" size="mini" type="primary">审核
</el-button>
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #edit>
<proposal-info ref="proposalInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
{{formData.taskName}}
</div>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=""
class="flow-task-form">
<el-form-item label="审批意见" prop="tf_opinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到提案人</el-button>
<el-button @click="handleTaskAction(2)" size="small" type="danger">不同意</el-button>
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意</el-button>
</el-row>
</div>
</proposal-info>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include('../../common/info.js'){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
components: {
"proposal-info": PROPOSAL_INFO
},
data() {
return {
tableColumns: [
{label: "提案编号", prop: "code"},
{label: "提案名称", prop: "name", width: "200px"},
{label: "提案人", prop: "createUserName", width: "80px"},
{label: "提案类别", prop: "typeName"},
{label: "届次", prop: "sessionName"},
{label: "代表团", prop: "delegationName"},
{label: "当前节点", prop: "curTaskName"},
{label: "流程状态", prop: "instanceState"}
],
pageForm: {
approval: false
},
showApprovalForm: false
}
},
created() {
this.pageData()
this.listOpenSession()
},
methods: {
openView(row) {
this.$refs.guava.edit(() => {
this.showApprovalForm = false
this.$refs.proposalInfoRef.onOpen(row)
})
},
openAudit(row) {
this.$refs.guava.edit(() => {
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$refs.proposalInfoRef.onOpen(row)
})
},
// 查询开启的教代会
listOpenSession() {
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions) {
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
this.pageData()
this.listDelegation()
}
}
})
},
handleTaskAction(val) {
this.$refs.formRef.validate(valid => {
if (!valid) return
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
})
})
}
}
})
</script>
<!--#
}
#-->
@@ -54,7 +54,7 @@ layout("/layouts/platform.html"){
<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 v-if="row.taskState === 10 || row.count <= 0" @click="openAudit(row)" size="mini" type="primary">附议
</el-button>
<!-- <el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回-->
<!-- </el-button>-->
@@ -77,11 +77,16 @@ layout("/layouts/platform.html"){
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-row type="flex" justify="end" v-if="row.taskKey ==='second'">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
<el-button @click="handleTaskAction(20)" size="small" type="danger">不同意</el-button>
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意</el-button>
</el-row>
<el-row type="flex" justify="end" v-else>
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
<el-button @click="updateSecond(2)" size="small" type="danger">不同意</el-button>
<el-button @click="updateSecond(1)" size="small" type="primary">同意</el-button>
</el-row>
</div>
</proposal-info>
</template>
@@ -126,6 +131,7 @@ layout("/layouts/platform.html"){
})
},
openAudit(row) {
this.row = row
this.$refs.guava.edit(() => {
this.showApprovalForm = true
this.formData = {
@@ -155,11 +161,27 @@ layout("/layouts/platform.html"){
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
this.updateSecond(val)
}
})
})
})
},
updateSecond(submitType) {
this.$axios.post("/platform/proposal/seconded/updateInfo", {
proposalId: this.row.id,
taskActorUserId: this.row.taskActorUserId,
opinion: this.formData.tf_opinion,
submitType: submitType,
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
},
onRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
@@ -0,0 +1,161 @@
<!--#
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>
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
style="width: 90%" v-model="pageForm.searchKeyword">
<el-select placeholder="查询类型" slot="prepend" style="width: 110px;"
v-model="pageForm.searchName">
<el-option label="提案名称" value="proposalName"></el-option>
<el-option label="编号" value="proposalCode"></el-option>
</el-select>
</el-input>
</search-item>
<search-item>
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
style="width: 90%" v-model="pageForm.searchKeyword2">
<el-select placeholder="查询类型" slot="prepend" style="width: 100px;"
v-model="pageForm.searchName2">
<el-option label="提案人" value="su.username"></el-option>
<!-- <el-option label="附议人" value="seconded.username"></el-option>-->
</el-select>
</el-input>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
<el-table-column label="序号" width="50" type="index" :index="indexMethod" fixed="left"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.key"
:min-width="column.width"
:fixed="column.fixed"
show-overflow-tooltip
v-for="column in tableColumns"
v-if="column.visible !== false"
>
<template v-if="column.prop === 'caseFilingResult'" scope="{row}">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
:value="row.caseFilingResult"></dict-tag>
</template>
<template v-else-if="column.prop === 'merge'" scope="{row}">
<el-tag v-if="row.merge" size="small"></el-tag>
</template>
<template v-else-if="column.prop === 'instanceState'" scope="{row}">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #edit>
<proposal-info ref="proposalInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
{{formData.taskName}}
</div>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=""
class="flow-task-form">
<el-form-item label="审批意见" prop="tf_opinion"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到提案人</el-button>
<el-button @click="handleTaskAction(2)" size="small" type="danger">不同意</el-button>
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意</el-button>
</el-row>
</div>
</proposal-info>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include('../../common/info.js'){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
components: {
"proposal-info": PROPOSAL_INFO
},
data() {
return {
tableColumns: [
{label: "提案编号", prop: "proposalCode"},
{label: "提案名称", prop: "proposalName", width: "200px"},
{label: "提案人", prop: "username"},
{label: "联系方式", prop: "mobile"},
{label: "单位", prop: "unitName"},
{label: "代表团", prop: "delegationName"},
{label: "提案类型", prop: "typeName"},
{label: "提交方式", prop: "mannerName"},
{label: "附议人数量", prop: "secondedNum"},
{label: "已附议", prop: "secondedAgreeNum"},
{label: "团长审核", prop: "delegationAudit"},
],
pageForm: {
approval: false
},
showApprovalForm: false,
sessionOptions: []
}
},
methods: {
// 查看
openView(row) {
this.$refs.guava.edit(() => {
this.showApprovalForm = false
this.$refs.proposalInfoRef.onOpen(row)
})
},
// 查询开启的教代会
listOpenSession() {
this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => {
if (res.code === 0) {
this.sessionOptions = res.data
if (this.sessionOptions) {
this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id)
this.pageData()
this.listDelegation()
}
}
})
}
},
created() {
this.pageData()
// 加载教代会信息
this.listOpenSession()
}
})
</script>
<!--#
}
#-->
@@ -172,6 +172,16 @@ layout("/layouts/platform.html"){
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="tf_attachment" label="附件">
<file-upload
:value.sync="formData.tf_attachment"
upload_mode="drag"
:upload_number="5"
upload_result_category="array"
complete_result
upload_mode="file"
></file-upload>
</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>
@@ -187,6 +197,7 @@ layout("/layouts/platform.html"){
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
<el-button @click="handleTaskAction(1)" size="small" type="primary">提交</el-button>
</el-row>
</div>
@@ -286,8 +297,19 @@ layout("/layouts/platform.html"){
this.$refs.proposalInfoRef.onOpen(row)
})
},
openAudit(row) {
async openAudit(row) {
this.loadCandidates(row.taskId)
try{
await this.$confirm("是否已与提案代表进行充分沟通?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "info"
})
} catch (e) {
console.log(e)
return
}
this.$refs.guava.edit(() => {
this.showApprovalForm = true
@@ -304,35 +326,43 @@ layout("/layouts/platform.html"){
},
handleTaskAction(val) {
this.$refs.formRef.validate(valid => {
if (!valid) return
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const loading = createLoading('提交中')
delete this.formData.underTakeIsMaster
delete this.formData.underTakeName
this.$axios.post("/platform/proposal/unitReply/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()
})
})
})
if(val === 6) {
this.handleTaskConfirm(val)
}else {
this.$refs.formRef.validate(valid => {
if (!valid) return
this.handleTaskConfirm(val)
})
}
},
handleTaskConfirm(val) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const loading = createLoading('提交中')
delete this.formData.underTakeIsMaster
delete this.formData.underTakeName
this.$axios.post("/platform/proposal/unitReply/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) {
@@ -7,7 +7,13 @@ layout("/layouts/platform.html"){
<div id="app" v-cloak>
<template>
<el-card shadow="never">
<snaker-start slot="header" label="撰写提案" define_key="JDHTA"></snaker-start>
<snaker-start slot="header" label="撰写提案" define_key="JDHTA">
<template slot="header-right-label">
<span style="margin-right: 15px" v-if="!formData.id">
<el-link type="success" @click="openImport">导入</el-link>
</span>
</template>
</snaker-start>
<template>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
<el-row :gutter="20" type="flex">
@@ -24,7 +30,7 @@ layout("/layouts/platform.html"){
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-col :span="12" v-if="false">
<el-form-item label="所属教代会" prop="sessionId">
<el-select
@change="meetingChange"
@@ -40,7 +46,7 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="12" v-if="false">
<el-form-item label="所属代表团" prop="delegationId">
<el-select clearable filterable placeholder="所属代表团" v-model="formData.delegationId"
style="width: 100%" disabled>
@@ -59,7 +65,7 @@ layout("/layouts/platform.html"){
</el-col>
</el-row>
<el-row :gutter="20">
<el-row :gutter="20" v-if="false">
<el-col :span="12">
<el-form-item label="单位" prop="unitName">
<el-input v-model="formData.unitName" disabled></el-input>
@@ -80,17 +86,22 @@ layout("/layouts/platform.html"){
</el-col>
<el-col :span="12">
<el-form-item label="提案方式" prop="source">
<el-select v-model="formData.source" style="width: 100%">
<el-option :key="item.code" :label="item.name" :value="item.code"
v-for="item in sourceOptions"></el-option>
</el-select>
<!-- <el-select v-model="formData.source" style="width: 100%">-->
<!-- <el-option :key="item.code" :label="item.name" :value="item.code"-->
<!-- v-for="item in sourceOptions"></el-option>-->
<!-- </el-select>-->
<el-radio :key="item.code" :label="item.code" border
size="medium"
v-for="item in sourceOptions" v-model="formData.source">
{{item.name}}
</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="提案类" prop="typeId">
<el-form-item label="提案类" prop="typeId">
<el-select v-model="formData.typeId" style="width: 100%">
<el-option :key="item.code" :label="item.name" :value="item.id"
v-for="item in typeOptions"></el-option>
@@ -125,7 +136,7 @@ layout("/layouts/platform.html"){
<!-- ></el-input>-->
<!-- </el-form-item>-->
<el-form-item label="建议承办单位" prop="suggestUnits">
<el-form-item label="建议承办单位" prop="suggestUnits" v-if="false">
<el-select v-model="formData.suggestUnits" multiple filterable style="width: 100%"
placeholder="请选择建议承办单位">
<el-option :key="item.id" :label="item.name" :value="item.name"
@@ -169,6 +180,60 @@ layout("/layouts/platform.html"){
<el-button type="primary" @click="noticeDialogVisible = false">我已知晓</el-button>
</div>
</el-dialog>
<el-dialog
title="提案导入"
:visible.sync="importVisible"
:close-on-click-modal="false"
width="50%"
>
<el-timeline-item timestamp="下载模板" placement="top">
<el-card>
<el-row :gutter="24">
<el-col :span="24">
<el-radio-group v-model="importTemplateType">
<el-radio :label="1">excel</el-radio>
<el-radio :label="2">word</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row :gutter="24" style="margin-top: 20px;">
<el-col :span="24">
<el-button size="medium" type="" style="width: 200px"
@click="downloadTemplate"
icon="el-icon-download">下载模板
</el-button>
</el-col>
</el-row>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传文件" placement="top">
<el-card>
<el-upload
name="file"
ref="upload"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList)
}"
:on-change="(file, fileList) => {
if(this.importTemplateType === 2) {
importData.fileList = fileHandleChange(file, fileList,{type:['docx']})
} else {
importData.fileList = fileHandleChange(file, fileList,{type:['xlsx']})
}
}"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList">
<el-button size="medium" type="" icon="el-icon-upload" style="width: 200px">选择文件
</el-button>
</el-upload>
</el-card>
</el-timeline-item>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false" :disabled="importLoading">取 消</el-button>
<el-button type="primary" @click="doImport" :loading="importLoading">确定</el-button>
</span>
</el-dialog>
</div>
<script nonce="${cspNonce!}">
@@ -180,10 +245,18 @@ layout("/layouts/platform.html"){
return {
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
// 将 window.location 的引用存储在响应式数据中
location: window.location,
importTemplateType: 1,
importData: {},
importVisible: false,
importLoading: false,
formData: {},
sessionOptions: [],
sourceOptions: [],
allSourceOptions: [],
delegationOptions: [],
committeeOptions: [],
typeOptions: [],
@@ -268,6 +341,7 @@ layout("/layouts/platform.html"){
}).then(() => {
commonUtil.pjaxPush('/platform/proposal/mine?bizId=' + res.data.id + "&operation=invite")
}).catch(() => {
loading.close()
this.$message.info("请到我的提案界面邀请附议人")
commonUtil.pjaxPush('/platform/proposal/mine')
})
@@ -276,10 +350,65 @@ layout("/layouts/platform.html"){
}
}
}).catch(() => {
loading.close()
})
})
}
},
// 打开导入窗口
async openImport() {
this.importData = {
fileList: []
}
this.importVisible = true;
},
// 下载导入模板
async downloadTemplate() {
let templateType = '.xlsx'
if(this.importTemplateType === 2) {
templateType = '.docx'
}
this.location.href='/platform/basics/downloadTemplate?filePath=proposal/proposal' + templateType + '&fileName=教职工代表大会提案表' + templateType
},
// 开始导入数据
async doImport() {
if (!this.importData.fileList.length) {
this.notifyWarning("请选择文件!")
return
}
const data = new FormData();
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name);
});
this.importLoading = false
$.ajax({
url: loc() + "/importProposal?templateType=" + this.importTemplateType,
type: "post",
data: data,
processData: false,
contentType: false,
success: (data) => {
console.log(loc(), data)
if (!data.code) {
if(data.data) {
this.formData = { ...data.data }
}
this.importVisible = false
} else {
this.notifyWarning(data.msg)
}
this.importLoading = false
},
error: (data) => {
this.notifyWarning("导入失败")
this.importLoading = false
}
});
},
// 重新提交
async onSubmitAgain() {
@@ -375,7 +504,7 @@ layout("/layouts/platform.html"){
this.checkWriteTime()
}
await this.listDelegation()
await this.listSource()
// await this.listSource()
}
})
},
@@ -388,6 +517,13 @@ layout("/layouts/platform.html"){
}
})
},
// 查询字典 撰写方式
async getDictByCode(code) {
const res = await $.get("/platform/proposal/write/listSourceByCode", {code: code})
console.log('getDictByCode', res)
return res.data;
},
//查询自己有权限的代表团
searchMineDelegation() {
@@ -412,7 +548,7 @@ layout("/layouts/platform.html"){
})
},
init() {
async init() {
if (this.bizId) {
this.$axios.post("/platform/proposal/write/detail", {id: this.bizId}).then((res) => {
if (res.code === 0) {
@@ -431,6 +567,10 @@ layout("/layouts/platform.html"){
this.$set(this.formData, "mobile", this.$store.state.user.mobile)
this.$set(this.formData, "unitName", this.$store.state.user.unit?.name)
}
// 撰写方式
this.allSourceOptions = await this.getDictByCode("PROPOSAL_SOURCE")
this.sourceOptions = this.allSourceOptions
}
},
created() {