Merge remote-tracking branch 'origin/main'
This commit is contained in:
+46
-24
@@ -54,29 +54,41 @@ public class ProposalQueryAnalysisController {
|
||||
@At
|
||||
@ApiOperation("统计数据")
|
||||
@SaCheckPermission("proposal.query.analysis")
|
||||
public Result statisticsData(String sessionId) {
|
||||
public Result statisticsData(String sessionId, String dimension) {
|
||||
/*
|
||||
* 查询参数说明:
|
||||
* sessionId:教代会届次ID,用于限定统计提案范围;
|
||||
* dimension:统计维度,可传“提案人单位、提案类型、代表团、立案结果、满意度”,为空时返回全部维度。
|
||||
* 返回值:Result.data 为统计行列表,包含 dimension、itemName、count、rate。
|
||||
*/
|
||||
if (StrUtil.isBlank(sessionId)) {
|
||||
return Result.error("请先选择教代会届次");
|
||||
}
|
||||
return Result.success(buildStatisticsRows(sessionId));
|
||||
return Result.success(buildStatisticsRows(sessionId, dimension));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分析数据")
|
||||
@SaCheckPermission("proposal.query.analysis")
|
||||
public Result analysisData(String sessionId) {
|
||||
public Result analysisData(String sessionId, String dimension) {
|
||||
/*
|
||||
* 查询参数说明:
|
||||
* sessionId:教代会届次ID,用于限定分析提案范围;
|
||||
* dimension:统计维度,可传“提案人单位、提案类型、代表团、立案结果、满意度”,为空时返回全部维度。
|
||||
* 返回值:Result.data 为分析行列表,包含 dimension、total、categoryCount、topItem、topCount、topRate、analysis。
|
||||
*/
|
||||
if (StrUtil.isBlank(sessionId)) {
|
||||
return Result.error("请先选择教代会届次");
|
||||
}
|
||||
return Result.success(buildAnalysisRows(sessionId));
|
||||
return Result.success(buildAnalysisRows(sessionId, dimension));
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("导出统计数据")
|
||||
@SaCheckPermission("proposal.query.analysis")
|
||||
public void exportStatisticsData(String sessionId, HttpServletResponse response) {
|
||||
List<NutMap> list = buildStatisticsRows(sessionId);
|
||||
public void exportStatisticsData(String sessionId, String dimension, HttpServletResponse response) {
|
||||
List<NutMap> list = buildStatisticsRows(sessionId, dimension);
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("统计维度", "dimension", 20));
|
||||
entities.add(new ExcelExportEntity("分类项", "itemName", 30));
|
||||
@@ -92,8 +104,8 @@ public class ProposalQueryAnalysisController {
|
||||
@Ok("void")
|
||||
@ApiOperation("导出分析数据")
|
||||
@SaCheckPermission("proposal.query.analysis")
|
||||
public void exportAnalysisData(String sessionId, HttpServletResponse response) {
|
||||
List<NutMap> list = buildAnalysisRows(sessionId);
|
||||
public void exportAnalysisData(String sessionId, String dimension, HttpServletResponse response) {
|
||||
List<NutMap> list = buildAnalysisRows(sessionId, dimension);
|
||||
List<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("统计维度", "dimension", 20));
|
||||
entities.add(new ExcelExportEntity("总量", "total", 12));
|
||||
@@ -108,15 +120,15 @@ public class ProposalQueryAnalysisController {
|
||||
CommonDownloadUtil.download("提案分析数据.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
private List<NutMap> buildStatisticsRows(String sessionId) {
|
||||
Map<String, List<NutMap>> dataMap = loadDimensionData(sessionId);
|
||||
private List<NutMap> buildStatisticsRows(String sessionId, String dimension) {
|
||||
Map<String, List<NutMap>> dataMap = loadDimensionData(sessionId, dimension);
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
dataMap.forEach((dimension, items) -> {
|
||||
dataMap.forEach((dimensionName, items) -> {
|
||||
long total = items.stream().mapToLong(v -> v.getLong("count", 0L)).sum();
|
||||
for (NutMap item : items) {
|
||||
long count = item.getLong("count", 0L);
|
||||
result.add(NutMap.NEW()
|
||||
.addv("dimension", dimension)
|
||||
.addv("dimension", dimensionName)
|
||||
.addv("itemName", item.getString("itemName", "未维护"))
|
||||
.addv("count", count)
|
||||
.addv("rate", formatPercent(count, total)));
|
||||
@@ -125,13 +137,13 @@ public class ProposalQueryAnalysisController {
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<NutMap> buildAnalysisRows(String sessionId) {
|
||||
Map<String, List<NutMap>> dataMap = loadDimensionData(sessionId);
|
||||
private List<NutMap> buildAnalysisRows(String sessionId, String dimension) {
|
||||
Map<String, List<NutMap>> dataMap = loadDimensionData(sessionId, dimension);
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
dataMap.forEach((dimension, items) -> {
|
||||
dataMap.forEach((dimensionName, items) -> {
|
||||
if (items.isEmpty()) {
|
||||
result.add(NutMap.NEW()
|
||||
.addv("dimension", dimension)
|
||||
.addv("dimension", dimensionName)
|
||||
.addv("total", 0)
|
||||
.addv("categoryCount", 0)
|
||||
.addv("topItem", "-")
|
||||
@@ -150,10 +162,10 @@ public class ProposalQueryAnalysisController {
|
||||
long topCount = top.getLong("count", 0L);
|
||||
String topItem = top.getString("itemName", "未维护");
|
||||
String topRate = formatPercent(topCount, total);
|
||||
String analysis = String.format("%s主要集中在【%s】,数量为%d,占比%s。", dimension, topItem, topCount, topRate);
|
||||
String analysis = String.format("%s主要集中在【%s】,数量为%d,占比%s。", dimensionName, topItem, topCount, topRate);
|
||||
|
||||
result.add(NutMap.NEW()
|
||||
.addv("dimension", dimension)
|
||||
.addv("dimension", dimensionName)
|
||||
.addv("total", total)
|
||||
.addv("categoryCount", sorted.size())
|
||||
.addv("topItem", topItem)
|
||||
@@ -164,13 +176,23 @@ public class ProposalQueryAnalysisController {
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String, List<NutMap>> loadDimensionData(String sessionId) {
|
||||
private Map<String, List<NutMap>> loadDimensionData(String sessionId, String dimension) {
|
||||
Map<String, List<NutMap>> map = new LinkedHashMap<>();
|
||||
map.put("提案人单位", queryUnitStat(sessionId));
|
||||
map.put("提案类型", queryTypeStat(sessionId));
|
||||
map.put("代表团", queryDelegationStat(sessionId));
|
||||
map.put("立案结果", queryCaseFilingResultStat(sessionId));
|
||||
map.put("满意度", querySatisfactionStat(sessionId));
|
||||
if (StrUtil.isBlank(dimension) || "提案人单位".equals(dimension)) {
|
||||
map.put("提案人单位", queryUnitStat(sessionId));
|
||||
}
|
||||
if (StrUtil.isBlank(dimension) || "提案类型".equals(dimension)) {
|
||||
map.put("提案类型", queryTypeStat(sessionId));
|
||||
}
|
||||
if (StrUtil.isBlank(dimension) || "代表团".equals(dimension)) {
|
||||
map.put("代表团", queryDelegationStat(sessionId));
|
||||
}
|
||||
if (StrUtil.isBlank(dimension) || "立案结果".equals(dimension)) {
|
||||
map.put("立案结果", queryCaseFilingResultStat(sessionId));
|
||||
}
|
||||
if (StrUtil.isBlank(dimension) || "满意度".equals(dimension)) {
|
||||
map.put("满意度", querySatisfactionStat(sessionId));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -73,9 +73,10 @@ public class ProposalQueryComprehensiveController {
|
||||
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 proposal_reply_unit pru ON pru.proposalId = info.id
|
||||
LEFT JOIN wf_process_task replyTask on replyTask.processInstanceId = ins.id AND replyTask.taskState = 20 AND replyTask.taskName in ('master_reply','slave_reply','opinion_master_reply')
|
||||
LEFT JOIN wf_process_task replyTask on replyTask.processInstanceId = ins.id
|
||||
$condition
|
||||
""");
|
||||
// AND replyTask.taskState = 20 AND replyTask.taskName in ('master_reply','slave_reply','opinion_master_reply')
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (ArrayUtil.isNotEmpty(pageForm.getOrigins()) && StrUtil.isNotBlank(pageForm.getCommonKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
|
||||
+16
-6
@@ -6,6 +6,7 @@ import com.budwk.app.flow.engine.util.FlowUtil;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalConfig;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalReplyUnit;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -44,16 +45,25 @@ public class ProposalQueryUnitReplyController {
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.query.unitReply")
|
||||
public Result data(String sessionId, String undertakeUnitId) {
|
||||
public Result data(String sessionId, String undertakeUnitId, String caseFilingResult) {
|
||||
/*
|
||||
* 查询参数说明:
|
||||
* sessionId:教代会届次ID,用于限定统计的提案范围;
|
||||
* undertakeUnitId:承办单位ID,用于只统计某个承办单位,为空时统计全部承办单位;
|
||||
* caseFilingResult:立案结果字典值,对应 proposal_info.caseFilingResult,为空时不限制立案结果。
|
||||
* 返回值:Result.data 中包含 tableData 统计行列表,以及 slaveNeedReply 协办单位是否需要答复配置。
|
||||
*/
|
||||
// 提案配置 协办是否需要答复
|
||||
ProposalConfig proposalConfig = dao.fetch(ProposalConfig.class, Cnd.NEW());
|
||||
boolean slaveNeedReply = proposalConfig.getSlaveUnitNeedReply();
|
||||
|
||||
// 当前届次所有的提案ID
|
||||
Sql sql = Sqls.create("select id from proposal_info where sessionId = @sessionId").setParam("sessionId", sessionId);
|
||||
sql.setCallback(Sqls.callback.strList());
|
||||
dao.execute(sql);
|
||||
List<String> proposalIds = sql.getList(String.class);
|
||||
Cnd proposalCnd = Cnd.where(ProposalInfo::getSessionId, "=", sessionId);
|
||||
proposalCnd.andEX(ProposalInfo::getCaseFilingResult, "=", caseFilingResult);
|
||||
List<String> proposalIds = dao.query(ProposalInfo.class, proposalCnd)
|
||||
.stream()
|
||||
.map(ProposalInfo::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if(proposalIds.isEmpty()){
|
||||
return Result.success().addData(Map.of("tableData", Collections.EMPTY_LIST, "slaveNeedReply", slaveNeedReply));
|
||||
@@ -73,7 +83,7 @@ public class ProposalQueryUnitReplyController {
|
||||
List<ProposalReplyUnit> replyUnits = dao.query(ProposalReplyUnit.class, cnd);
|
||||
|
||||
// 承办单位答复记录
|
||||
List<ProcessTask> replyTasks = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "in", instIds).and(ProcessTask::getTaskName, "in", List.of("master_reply", "slave_reply", "opinion_master_reply")).and(ProcessTask::getTaskState, "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.DOING.getCode())));
|
||||
List<ProcessTask> replyTasks = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "in", instIds).and(ProcessTask::getTaskName, "in", List.of("two_unit_reply","unit_reply","master_reply", "slave_reply", "opinion_master_reply")).and(ProcessTask::getTaskState, "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.DOING.getCode())));
|
||||
|
||||
// 承办单位
|
||||
List<NutMap> tableData = new ArrayList<>();
|
||||
|
||||
+4
-1
@@ -45,7 +45,7 @@ public class ProposalCaseCheckController {
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/caseCheck/index.html")
|
||||
@SaCheckPermission("proposal.mine")
|
||||
@SaCheckPermission("proposal.caseCheck")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ public class ProposalCaseCheckController {
|
||||
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 vw_user vu ON vu.id = info.createUserId
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
@@ -99,6 +100,8 @@ public class ProposalCaseCheckController {
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
// 工会筛选按提案人所属工会口径处理,来源为 proposal_info.createUserId 关联 vw_user.unionId。
|
||||
cnd.andEX("vu.unionId", "=", pageForm.getUnionId());
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
|
||||
+3
@@ -83,6 +83,7 @@ public class ProposalCommitteeFilingController {
|
||||
LEFT JOIN proposal_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN proposal_merge mer ON mer.proposalId = info.id
|
||||
LEFT JOIN vw_user vu ON vu.id = info.createUserId
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
@@ -97,6 +98,8 @@ public class ProposalCommitteeFilingController {
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
// 工会筛选按提案人所属工会口径处理,来源为 proposal_info.createUserId 关联 vw_user.unionId。
|
||||
cnd.andEX("vu.unionId", "=", pageForm.getUnionId());
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
|
||||
+3
@@ -99,6 +99,7 @@ public class ProposalCommitteeFilingUnitController {
|
||||
LEFT JOIN proposal_info info ON info.id = ins.businessNo
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN proposal_merge mer ON mer.proposalId = info.id
|
||||
LEFT JOIN vw_user vu ON vu.id = info.createUserId
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
@@ -113,6 +114,8 @@ public class ProposalCommitteeFilingUnitController {
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
// 工会筛选按提案人所属工会口径处理,来源为 proposal_info.createUserId 关联 vw_user.unionId。
|
||||
cnd.andEX("vu.unionId", "=", pageForm.getUnionId());
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
|
||||
+4
-1
@@ -42,7 +42,7 @@ public class ProposalPreAuditController {
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/preAudit/index.html")
|
||||
@SaCheckPermission("proposal.mine")
|
||||
@SaCheckPermission("proposal.preAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ public class ProposalPreAuditController {
|
||||
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 vw_user vu ON vu.id = info.createUserId
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
@@ -97,6 +98,8 @@ public class ProposalPreAuditController {
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
// 工会筛选按提案人所属工会口径处理,来源为 proposal_info.createUserId 关联 vw_user.unionId。
|
||||
cnd.andEX("vu.unionId", "=", pageForm.getUnionId());
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
|
||||
+3
@@ -114,6 +114,7 @@ public class ProposalSchoolLeaderApprovalController {
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN proposal_merge mer ON mer.proposalId = info.id
|
||||
LEFT JOIN proposal_reply_unit pru ON pru.proposalId = info.id
|
||||
LEFT JOIN vw_user vu ON vu.id = info.createUserId
|
||||
LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
$condition
|
||||
@@ -130,6 +131,8 @@ public class ProposalSchoolLeaderApprovalController {
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
// 工会筛选按提案人所属工会口径处理,来源为 proposal_info.createUserId 关联 vw_user.unionId。
|
||||
cnd.andEX("vu.unionId", "=", pageForm.getUnionId());
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
|
||||
+148
-34
@@ -2,24 +2,25 @@ 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.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.aspose.slides.internal.og.and;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
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.service.FlowCommonService;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.entity.ProcessTaskActor;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
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;
|
||||
@@ -28,11 +29,12 @@ 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.dao.util.cri.SqlExpressionGroup;
|
||||
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.json.Json;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
@@ -55,11 +57,9 @@ public class ProposalSecondedController {
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private BpmService bpmService;
|
||||
@Inject
|
||||
private ProposalSecondedService proposalSecondedService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/seconded/index.html")
|
||||
@@ -96,6 +96,7 @@ public class ProposalSecondedController {
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
nt.taskName curTaskCode,
|
||||
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,
|
||||
@@ -108,36 +109,40 @@ 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_second ps ON ps.proposalId = info.id AND ps.seconderId = @seconderId
|
||||
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
|
||||
""");
|
||||
sql.setParam("seconderId", SecurityUtil.getUserId());
|
||||
sql.setParam("seconderId", SecurityUtil.getUserId());
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "in", List.of("invite", "second", "delegation", "committee"));
|
||||
cnd.and("ps.isAgree", "is", null);
|
||||
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
|
||||
if (approval) {
|
||||
// 已附议页签只展示当前登录附议人已经处理过的记录。
|
||||
cnd.and("ps.isAgree", "is not", null);
|
||||
cnd.and("t.taskName", "in", List.of("invite", "second", "delegation", "preAudit", "committee"));
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
// 未附议页签只展示当前登录附议人尚未处理的记录。
|
||||
cnd.and("ps.isAgree", "is", null);
|
||||
// 待附议列表只展示两类任务:
|
||||
// 1. invite / second 节点任务
|
||||
// 2. delegation / committee 节点,且任务状态必须是已废弃(99)
|
||||
SqlExpressionGroup taskGroup = Cnd.exps("t.taskName", "in", List.of("invite", "second"));
|
||||
SqlExpressionGroup delegationOrCommitteeGroup = Cnd.exps("t.taskName", "in", List.of("delegation", "preAudit", "committee"));
|
||||
delegationOrCommitteeGroup.and("t.taskState", "=", ProcessTaskStateEnum.ABANDON.getCode());
|
||||
taskGroup.or(delegationOrCommitteeGroup);
|
||||
cnd.and(taskGroup);
|
||||
}
|
||||
ProposalSearchParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> list = pagination.getList(NutMap.class);
|
||||
for (NutMap row : list) {
|
||||
// String instanceId = row.getString("instanceId");
|
||||
}
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@@ -146,37 +151,146 @@ public class ProposalSecondedController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("修改提案附议信息")
|
||||
@SLog(tag = "提案管理系统-附议提案", msg = "修改提案附议信息")
|
||||
/**
|
||||
* 仅更新附议结果和附议任务状态,不调用流程引擎推进流程。
|
||||
* 参数说明:
|
||||
* 1. proposalId:提案主键,用于定位 proposal_second 附议记录。
|
||||
* 2. taskId:当前页面点击的任务主键,用于定位本次需要完成的 wf_process_task。
|
||||
* 3. taskActorUserId:附议人用户ID,用于校验附议记录和任务参与人是否匹配。
|
||||
* 4. opinion:附议意见,写入 proposal_second.opinion。
|
||||
* 5. submitType:附议结果,1 表示同意,20 表示不同意。
|
||||
* 返回值:
|
||||
* Result.success() 表示 proposal_second 和 wf_process_task 更新成功;
|
||||
* Result.error(...) 表示参数错误或未找到对应业务数据。
|
||||
*/
|
||||
public Result updateInfo(@Param("proposalId") String proposalId,
|
||||
@Param("taskId") Long taskId,
|
||||
@Param("taskActorUserId") String taskActorUserId,
|
||||
@Param("opinion") String opinion,
|
||||
@Param("submitType") Integer submitType) {
|
||||
// 查询附议信息表
|
||||
if (Strings.isBlank(proposalId) || Strings.isBlank(taskActorUserId) || taskId == null || submitType == null) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
|
||||
// 先定位 wf_process_task,确保本次请求能准确命中需要完成的附议任务,再更新两张业务表。
|
||||
ProcessTask processTask = this.getSecondTask(taskId, taskActorUserId);
|
||||
if (processTask == null) {
|
||||
return Result.error("未找到附议任务");
|
||||
}
|
||||
|
||||
// 更新 proposal_second,记录当前附议人的最终附议结果、附议意见和附议时间。
|
||||
ProposalSecond proposalSecond = dao.fetch(
|
||||
ProposalSecond.class,
|
||||
Cnd.where(ProposalSecond::getProposalId, "=", proposalId)
|
||||
.and(ProposalSecond::getSeconderId, "=", taskActorUserId)
|
||||
);
|
||||
if (proposalSecond == null) {
|
||||
return Result.error("未找到附议记录");
|
||||
}
|
||||
proposalSecond.setIsAgree(ObjectUtil.equals(submitType, ProcessSubmitTypeEnum.AGREE.getCode()));
|
||||
proposalSecond.setOpinion(opinion);
|
||||
proposalSecond.setIsAgree(submitType == 1);
|
||||
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();
|
||||
|
||||
// 仅更新本次附议对应的 wf_process_task,不推动实例、也不创建后续任务。
|
||||
View_user user = dao.fetch(View_user.class, Cnd.where(View_user::getId, "=", taskActorUserId));
|
||||
Dict taskArgs = Json.fromJson(Dict.class, processTask.getVariable());
|
||||
taskArgs.set("u_userId", user.getId());
|
||||
taskArgs.set("initiator", user.getId());
|
||||
taskArgs.set("initiatorName", user.getUsername());
|
||||
taskArgs.set("initiatorAccount", user.getLoginname());
|
||||
taskArgs.set("initiatorUnitId", user.getUnitId());
|
||||
taskArgs.set("initiatorUnitName", user.getUnitName());
|
||||
taskArgs.set("initiatorUnionId", user.getUnionId());
|
||||
taskArgs.set("initiatorUnionName", user.getUnionName());
|
||||
taskArgs.set("tf_loginName", user.getLoginname());
|
||||
taskArgs.set("tf_unionId", user.getUnionId());
|
||||
taskArgs.set("tf_unitId", user.getUnitId());
|
||||
taskArgs.set("tf_unitName", user.getUnitName());
|
||||
taskArgs.set("tf_userId", user.getId());
|
||||
taskArgs.set("tf_userName", user.getUsername());
|
||||
processTask.setVariable(JSONUtil.toJsonStr(taskArgs));
|
||||
processTask.setTaskState(ProcessTaskStateEnum.FINISHED.getCode());
|
||||
processTask.setFinishTime(DateUtil.date());
|
||||
processTask.setOperator(taskActorUserId);
|
||||
dao.update(processTask);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* second 节点审核专用接口。
|
||||
* 参数说明:
|
||||
* 1. data:前端提交的 JSON 字符串,必须包含 processTaskId、proposalId、taskActorUserId、tf_opinion、submitType。
|
||||
* 2. processTaskId:wf_process_task 主键,公共流程执行服务依赖该参数定位当前审核任务。
|
||||
* 3. proposalId:提案主键,附议业务表 proposal_second 通过该字段定位当前提案记录。
|
||||
* 4. taskActorUserId:附议人用户ID,用于定位当前登录人的附议记录。
|
||||
* 5. tf_opinion:审核意见,会同步写入流程表单变量和附议业务表 opinion 字段。
|
||||
* 6. submitType:审核结果,1 表示同意,20 表示不同意。
|
||||
* 返回值:
|
||||
* Result.success() 表示公共流程任务执行成功且 proposal_second 已同步更新;
|
||||
* Result.error(...) 表示请求参数不完整。
|
||||
*/
|
||||
@At
|
||||
@SaCheckPermission("proposal.seconded")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@ApiOperation("执行附议审核任务")
|
||||
@SLog(tag = "提案管理系统-附议提案", msg = "执行附议审核任务")
|
||||
public Result executeTask(@Param("data") String data) {
|
||||
if (Strings.isBlank(data)) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
Dict args = Json.fromJson(Dict.class, data);
|
||||
String proposalId = args.getStr("proposalId");
|
||||
String taskActorUserId = args.getStr("taskActorUserId");
|
||||
String opinion = args.getStr("tf_opinion");
|
||||
Integer submitType = args.getInt("submitType");
|
||||
if (args.getLong("processTaskId") == null || Strings.isBlank(proposalId) || Strings.isBlank(taskActorUserId) || submitType == null) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
flowCommonService.executeTask(args);
|
||||
proposalSecondedService.updateSecondRecord(proposalId, taskActorUserId, opinion, submitType);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据当前点击的任务和附议人,定位实际需要完成的 second 节点任务。
|
||||
* 处理规则:
|
||||
* 1. 如果页面点击的就是 second 节点任务,则直接更新该任务。
|
||||
* 2. 如果页面点击的是 invite、delegation、committee 等关联节点,则回查同实例下当前附议人的 second 任务。
|
||||
*/
|
||||
private ProcessTask getSecondTask(Long taskId, String taskActorUserId) {
|
||||
ProcessTask currentTask = dao.fetch(ProcessTask.class, taskId);
|
||||
if (currentTask == null) {
|
||||
return null;
|
||||
}
|
||||
if ("second".equals(currentTask.getTaskName())
|
||||
&& List.of(ProcessTaskStateEnum.DOING.getCode(), ProcessTaskStateEnum.ABANDON.getCode()).contains(currentTask.getTaskState())
|
||||
&& this.isTaskActorMatched(currentTask.getId(), taskActorUserId)) {
|
||||
return currentTask;
|
||||
}
|
||||
|
||||
List<ProcessTask> secondTaskList = dao.query(ProcessTask.class,
|
||||
Cnd.where(ProcessTask::getProcessInstanceId, "=", currentTask.getProcessInstanceId())
|
||||
.and(ProcessTask::getTaskName, "=", "second")
|
||||
.and(ProcessTask::getTaskState, "in", List.of(ProcessTaskStateEnum.DOING.getCode(), ProcessTaskStateEnum.ABANDON.getCode()))
|
||||
.desc(ProcessTask::getCreatedAt));
|
||||
for (ProcessTask secondTask : secondTaskList) {
|
||||
if (this.isTaskActorMatched(secondTask.getId(), taskActorUserId)) {
|
||||
return secondTask;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验任务参与人是否为当前附议人,避免误更新其他代表的 second 任务。
|
||||
*/
|
||||
private boolean isTaskActorMatched(Long processTaskId, String taskActorUserId) {
|
||||
return dao.count(ProcessTaskActor.class,
|
||||
Cnd.where(ProcessTaskActor::getProcessTaskId, "=", processTaskId)
|
||||
.and(ProcessTaskActor::getActorId, "=", taskActorUserId)) > 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -83,6 +83,7 @@ public class ProposalWriteController {
|
||||
@ApiOperation("保存提案")
|
||||
@SLog(tag = "提案管理系统-我的提案", msg = "保存提案")
|
||||
public Result save(@Param("info") ProposalInfo proposalInfo) {
|
||||
proposalWriteService.checkCurrentUserDelegate(proposalInfo.getSessionId());
|
||||
if (StrUtil.isBlank(proposalInfo.getCode())) {
|
||||
proposalInfo.setCode(proposalWriteService.generateProposalCode(proposalInfo.getSessionId(), proposalInfo.getDelegationId()));
|
||||
}
|
||||
@@ -98,6 +99,7 @@ public class ProposalWriteController {
|
||||
@ApiOperation("提交提案")
|
||||
@SLog(tag = "提案管理系统-我的提案", msg = "提交提案")
|
||||
public Result submit(@Param("info") ProposalInfo proposalInfo) {
|
||||
proposalWriteService.checkCurrentUserDelegate(proposalInfo.getSessionId());
|
||||
if (StrUtil.isBlank(proposalInfo.getCode())) {
|
||||
proposalInfo.setCode(proposalWriteService.generateProposalCode(proposalInfo.getSessionId(), proposalInfo.getDelegationId()));
|
||||
}
|
||||
|
||||
+2
-28
@@ -1,19 +1,9 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.listenter;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.budwk.app.flow.engine.event.ProcessEvent;
|
||||
import com.budwk.app.flow.engine.event.ProcessEventListener;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessEventTypeEnum;
|
||||
import com.budwk.app.flow.service.ProcessInstanceService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalMerge;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
@@ -25,27 +15,11 @@ import org.nutz.lang.Lang;
|
||||
@IocBean
|
||||
public class ProposalCommitteeFilingRevokeEventListener implements ProcessEventListener {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ProcessInstanceService processInstanceService;
|
||||
|
||||
@Override
|
||||
public void onEvent(ProcessEvent event) {
|
||||
if (event.getEventType() == ProcessEventTypeEnum.PROCESS_TASK_REVOKE) {
|
||||
Long taskId = event.getSourceId();
|
||||
ProcessTask task = dao.fetch(ProcessTask.class, taskId);
|
||||
ProcessInstance processInstance = processInstanceService.getById(task.getProcessInstanceId());
|
||||
|
||||
// 处理并案信息撤回
|
||||
if ("committee".equals(task.getTaskName())) {
|
||||
// 如果有并案,删掉并案数据(傻逼提的需求,nmsl)
|
||||
ProposalMerge proposalMerge = dao.fetch(ProposalMerge.class, Cnd.where("proposalId", "=", processInstance.getBusinessNo()));
|
||||
|
||||
if (Lang.isNotEmpty(proposalMerge)) {
|
||||
dao.clear(ProposalMerge.class, Cnd.where(ProposalMerge::getProposalId, "=", proposalMerge.getProposalId()));
|
||||
}
|
||||
}
|
||||
// proposal_merge 的删除逻辑已统一收口到 ProposalCommitteeFilingServiceImpl.revokeTask,
|
||||
// 这里不再重复处理业务表,避免事件监听和 service 两处口径不一致。
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ public class ProposalQueryComprehensiveParam extends PageForm {
|
||||
if (Lang.isNotEmpty(searchParam.getSessionIds())) {
|
||||
cnd.and("info.sessionId", "in", searchParam.getSessionIds());
|
||||
} else {
|
||||
cnd.andEX("info.sessionId", "=", searchParam.getSessionId());
|
||||
// cnd.andEX("info.sessionId", "=", searchParam.getSessionId());
|
||||
}
|
||||
|
||||
//提案名称
|
||||
|
||||
@@ -19,6 +19,7 @@ public class ProposalSearchParam extends PageForm {
|
||||
private String code;
|
||||
private String sessionId;
|
||||
private String delegationId;
|
||||
private String unionId;
|
||||
private String createUserName;
|
||||
private String createUserLoginName;
|
||||
private String createUserKeyword;
|
||||
|
||||
+9
-1
@@ -5,5 +5,13 @@ import com.budwk.app.zhgh.democratic.proposal.models.ProposalSecond;
|
||||
|
||||
public interface ProposalSecondedService extends BaseService<ProposalSecond> {
|
||||
|
||||
|
||||
/**
|
||||
* 仅更新附议表 proposal_second 中当前附议人的附议结果。
|
||||
* 参数说明:
|
||||
* 1. proposalId:提案ID,用于定位当前提案的附议记录。
|
||||
* 2. taskActorUserId:附议人用户ID,用于定位当前登录人的附议记录。
|
||||
* 3. opinion:附议意见,写入附议记录的 opinion 字段。
|
||||
* 4. submitType:附议结果,1 表示同意,20 表示不同意。
|
||||
*/
|
||||
void updateSecondRecord(String proposalId, String taskActorUserId, String opinion, Integer submitType);
|
||||
}
|
||||
|
||||
+10
@@ -22,5 +22,15 @@ public interface ProposalWriteService extends BaseService<ProposalInfo> {
|
||||
|
||||
List<Sys_dict> listSourceByCode(@Valid String code);
|
||||
|
||||
/**
|
||||
* 校验当前登录用户在指定教代会届次下是否具备代表身份。
|
||||
* 参数说明:
|
||||
* 1. sessionId:教代会届次ID,保存和提交提案时通过该字段定位当前届次代表信息。
|
||||
* 返回值说明:
|
||||
* 1. 校验通过时无返回值。
|
||||
* 2. 校验不通过时抛出业务异常,由上层统一返回提示信息。
|
||||
*/
|
||||
void checkCurrentUserDelegate(String sessionId);
|
||||
|
||||
ProposalInfo importProposal(Map<String, String> stringStringMap);
|
||||
}
|
||||
|
||||
+22
-22
@@ -234,10 +234,10 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
// 提案附议
|
||||
List<NutMap> secondInfos = new ArrayList<>();
|
||||
List<ProcessTaskVO> secondTaskVos = taskGroups.get("提案附议");
|
||||
if(secondTaskVos != null && secondTaskVos.size() > 0) {
|
||||
if (secondTaskVos != null && secondTaskVos.size() > 0) {
|
||||
for (ProcessTaskVO secondTaskVO : secondTaskVos) {
|
||||
Dict taskFormData = secondTaskVO.getTaskFormData();
|
||||
if(taskFormData == null) {
|
||||
if (taskFormData == null) {
|
||||
continue;
|
||||
}
|
||||
NutMap secondInfo = new NutMap();
|
||||
@@ -248,7 +248,7 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
taskUserSql.setCallback(Sqls.callback.map());
|
||||
execute(taskUserSql);
|
||||
NutMap taskUserMap = (NutMap) taskUserSql.getResult();
|
||||
secondInfo.put("s_mobile", taskUserMap.getString("mobile"));
|
||||
secondInfo.put("s_mobile", Objects.isNull(taskUserMap) ? "" : taskUserMap.getString("mobile"));
|
||||
secondInfos.add(secondInfo);
|
||||
}
|
||||
}
|
||||
@@ -256,10 +256,10 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
// 代表团意见
|
||||
List<NutMap> delegationAuditList = new ArrayList<>();
|
||||
List<ProcessTaskVO> delegationTaskVos = taskGroups.get("团长审核");
|
||||
if(delegationTaskVos != null && delegationTaskVos.size() > 0) {
|
||||
if (delegationTaskVos != null && delegationTaskVos.size() > 0) {
|
||||
for (ProcessTaskVO delegationTaskVO : delegationTaskVos) {
|
||||
Dict taskFormData = delegationTaskVO.getTaskFormData();
|
||||
if(taskFormData == null) {
|
||||
if (taskFormData == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -601,10 +601,10 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
List<NutMap> caseUnitList = listMap(caseUnitSql);
|
||||
for (NutMap v : caseUnitList) {
|
||||
String hostUnitName = v.getString("masterUnitName");
|
||||
if (StrUtil.isNotBlank(hostUnitName)){
|
||||
if (StrUtil.isNotBlank(hostUnitName)) {
|
||||
underTakeNames.add(hostUnitName);
|
||||
}
|
||||
if (StrUtil.isNotBlank(v.getString("slaveUnitNames"))){
|
||||
if (StrUtil.isNotBlank(v.getString("slaveUnitNames"))) {
|
||||
List<String> helpUnitNames = Arrays.asList(v.getString("slaveUnitNames").split("、"));
|
||||
underTakeNames.addAll(helpUnitNames);
|
||||
}
|
||||
@@ -725,73 +725,73 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
String proposalMeasures = MapUtil.getStr(dataMap, "建议措施", "");
|
||||
|
||||
// 工号
|
||||
if(StrUtil.isBlank(loginName)) {
|
||||
if (StrUtil.isBlank(loginName)) {
|
||||
throw new RuntimeException("工号不能为空");
|
||||
}
|
||||
Sys_user user = sysUserService.getByLoginName(loginName);
|
||||
if(user == null){
|
||||
if (user == null) {
|
||||
throw new RuntimeException("工号不存在");
|
||||
}
|
||||
if(StrUtil.isNotBlank(username) && !username.equals(user.getUsername())) {
|
||||
if (StrUtil.isNotBlank(username) && !username.equals(user.getUsername())) {
|
||||
throw new RuntimeException("工号和提案人不一致");
|
||||
}
|
||||
|
||||
// 提案时间
|
||||
if(StrUtil.isBlank(proposalDate)) {
|
||||
if (StrUtil.isBlank(proposalDate)) {
|
||||
throw new RuntimeException("提案时间不能为空");
|
||||
}
|
||||
|
||||
// 提案类型
|
||||
if(StrUtil.isBlank(proposalType)) {
|
||||
if (StrUtil.isBlank(proposalType)) {
|
||||
throw new RuntimeException("提案类型不能为空");
|
||||
}
|
||||
ProposalType proposalTypeObj = dao().fetch(ProposalType.class, Cnd.where(ProposalType::getName, "=", proposalType));
|
||||
if(proposalTypeObj == null) {
|
||||
if (proposalTypeObj == null) {
|
||||
throw new RuntimeException("提案类型不存在");
|
||||
}
|
||||
|
||||
// 提案方式
|
||||
if(StrUtil.isBlank(proposalSource)) {
|
||||
if (StrUtil.isBlank(proposalSource)) {
|
||||
throw new RuntimeException("提案方式不能为空");
|
||||
}
|
||||
Sys_dict dict = sysDictService.fetch(Cnd.where("code", "=", "PROPOSAL_SOURCE"));
|
||||
if(dict == null) {
|
||||
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) {
|
||||
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) {
|
||||
if (proposalSourceDict == null) {
|
||||
throw new RuntimeException("提案方式不存在");
|
||||
}
|
||||
|
||||
// 提案名称
|
||||
if(StrUtil.isBlank(proposalName)) {
|
||||
if (StrUtil.isBlank(proposalName)) {
|
||||
throw new RuntimeException("提案名称不能为空");
|
||||
}
|
||||
|
||||
// 案由
|
||||
if(StrUtil.isBlank(proposalContent)) {
|
||||
if (StrUtil.isBlank(proposalContent)) {
|
||||
throw new RuntimeException("案由不能为空");
|
||||
}
|
||||
|
||||
// 建议措施
|
||||
if(StrUtil.isBlank(proposalMeasures)) {
|
||||
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) {
|
||||
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) {
|
||||
if (teacherCongressSessions == null || teacherCongressSessions.size() <= 0) {
|
||||
throw new RuntimeException("没有开启的教代会");
|
||||
}
|
||||
Teacher_congress_session teacherCongressSession = teacherCongressSessions.get(0);
|
||||
|
||||
+3
@@ -83,6 +83,9 @@ public class ProposalCommitteeFilingServiceImpl extends BaseServiceImpl<Proposal
|
||||
for (ProcessTask mergeTask : mergeTasks) {
|
||||
flowCommonService.revokeTask(mergeTask.getId());
|
||||
}
|
||||
|
||||
// 并案整组撤回后,需要同步删除 proposal_merge 中整组并案关系,避免列表仍按并案数据展示。
|
||||
dao().clear(ProposalMerge.class, Cnd.where(ProposalMerge::getProposalId, "in", mergeProposalIds));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+21
-5
@@ -1,21 +1,37 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalSecond;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalSecondedService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ProposalSecondedServiceImpl extends BaseServiceImpl<ProposalSecond> implements ProposalSecondedService {
|
||||
|
||||
@Inject
|
||||
private CommonService commonService;
|
||||
|
||||
public ProposalSecondedServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSecondRecord(String proposalId, String taskActorUserId, String opinion, Integer submitType) {
|
||||
if (Strings.isBlank(proposalId) || Strings.isBlank(taskActorUserId) || submitType == null) {
|
||||
return;
|
||||
}
|
||||
// 仅更新当前提案、当前附议人的附议结果,不处理流程任务表。
|
||||
ProposalSecond proposalSecond = this.fetch(Cnd.where(ProposalSecond::getProposalId, "=", proposalId)
|
||||
.and(ProposalSecond::getSeconderId, "=", taskActorUserId));
|
||||
if (proposalSecond == null) {
|
||||
return;
|
||||
}
|
||||
proposalSecond.setIsAgree(ObjectUtil.equals(submitType, ProcessSubmitTypeEnum.AGREE.getCode()));
|
||||
proposalSecond.setOpinion(opinion);
|
||||
proposalSecond.setSecondedTime(DateUtil.date());
|
||||
this.update(proposalSecond);
|
||||
}
|
||||
}
|
||||
|
||||
+17
@@ -121,6 +121,23 @@ public class ProposalWriteServiceImpl extends BaseServiceImpl<ProposalInfo> impl
|
||||
return dict == null ? new ArrayList<>() : sysDictService.query(Cnd.where("parentId", "=", Strings.sNull(dict.getId())).asc("location"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkCurrentUserDelegate(String sessionId) {
|
||||
if (StrUtil.isBlank(sessionId)) {
|
||||
throw new RuntimeException("所属教代会不能为空");
|
||||
}
|
||||
// 撰写提案必须绑定当前届次代表身份,避免非代表用户保存或提交提案。
|
||||
Teacher_congress_delegate delegate = teacherCongressDelegateService.fetch(
|
||||
Cnd.where(Teacher_congress_delegate::getSessionId, "=", sessionId)
|
||||
.and(Teacher_congress_delegate::getUserId, "=", SecurityUtil.getUserId())
|
||||
.and(Teacher_congress_delegate::getDelFlag, "!=", 1)
|
||||
.limit(1)
|
||||
);
|
||||
if (delegate == null) {
|
||||
throw new RuntimeException("当前用户不是代表,无法撰写提案");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProposalInfo importProposal(Map<String, String> dataMap) {
|
||||
String loginName = MapUtil.getStr(dataMap, "工号", "");
|
||||
|
||||
+10
-2
@@ -150,7 +150,7 @@ public class TeacherCongressDelegatePushController {
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("tc.delegate.push")
|
||||
// @SLog(tag = "民主管理-教代会代表推选", msg = "获取本分工会下的非代表用户")
|
||||
public Result getUnionUser(String sessionId, String unionId) {
|
||||
public Result getUnionUser(String sessionId, String unionId, String keyword) {
|
||||
// 查询预选中的代表
|
||||
Cnd cndx = Cnd.where("sessionId", "=", sessionId);
|
||||
cndx.andEX("unionId", "=", SecurityUtil.getUnionId());
|
||||
@@ -173,7 +173,7 @@ public class TeacherCongressDelegatePushController {
|
||||
`vw_user` u
|
||||
LEFT JOIN teacher_congress_delegate tcd ON tcd.userId = u.id
|
||||
AND tcd.sessionId = @sessionId
|
||||
LEFT JOIN teacher_congress_delegate_push tcdp ON tcdp.userId = tcdp.id
|
||||
LEFT JOIN teacher_congress_delegate_push tcdp ON tcdp.userId = u.id
|
||||
AND tcdp.sessionId = @sessionId
|
||||
$condition
|
||||
""");
|
||||
@@ -185,6 +185,14 @@ public class TeacherCongressDelegatePushController {
|
||||
cnd.and("tcd.userId", "is", null);
|
||||
cnd.and("tcdp.id", "is", null);
|
||||
cnd.and("u.unionId", "=", SecurityUtil.getUnionId());
|
||||
if (StrUtil.isNotBlank(keyword)) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("u.username", keyword);
|
||||
group.orLike("u.loginname", keyword);
|
||||
cnd.and(group);
|
||||
}
|
||||
// 搜索候选人时只返回少量命中数据,避免前端大列表筛选导致严重卡顿
|
||||
cnd.limit(1, 100);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> userList = baseService.listMap(sql);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user