..
This commit is contained in:
@@ -17,6 +17,7 @@ import com.budwk.app.flow.entity.ProcessDefine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessEventTypeEnum;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskPerformTypeEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
@@ -27,6 +28,7 @@ import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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;
|
||||
@@ -269,6 +271,9 @@ public class FlowCommonController {
|
||||
// 激活
|
||||
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());
|
||||
|
||||
+4
@@ -1,6 +1,7 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.export;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.ExportTableColumns;
|
||||
import com.budwk.app.base.result.Result;
|
||||
@@ -67,6 +68,9 @@ public class ProposalExportComprehensiveController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(pageForm.getUnderTakeUnitId())){
|
||||
cnd.andEX("pru.unitId", "=", pageForm.getUnderTakeUnitId());
|
||||
}
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
+10
-8
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ArrayUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService;
|
||||
@@ -99,6 +100,7 @@ public class ProposalQueryCollectProgressController {
|
||||
if (ArrayUtil.contains(pageForm.getCollectIds(), 40)) {
|
||||
seg.or("t.taskName", "not in", List.of("startTask", "second", "delegation"));
|
||||
seg.and("t.taskName", "is not", null);
|
||||
seg.or("ins.state","=", ProcessInstanceStateEnum.FINISHED.getCode());
|
||||
}
|
||||
if (!seg.isEmpty()) {
|
||||
cnd.and(seg);
|
||||
@@ -107,14 +109,14 @@ public class ProposalQueryCollectProgressController {
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = proposalCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> list = (List<NutMap>) pagination.getList();
|
||||
for (NutMap row : list) {
|
||||
int count = dao.count(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", row.getString("instanceId"))
|
||||
.and(ProcessTask::getTaskName, "=", "second")
|
||||
.and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.FINISHED.getCode())
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
// for (NutMap row : list) {
|
||||
// int count = dao.count(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", row.getString("instanceId"))
|
||||
// .and(ProcessTask::getTaskName, "=", "second")
|
||||
// .and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.FINISHED.getCode())
|
||||
// );
|
||||
//
|
||||
//
|
||||
// }
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -114,8 +114,8 @@ public class ProposalQueryComprehensiveController {
|
||||
}
|
||||
}
|
||||
|
||||
if(StrUtil.isNotBlank(pageForm.getUndertakeUnitId())){
|
||||
|
||||
if(StrUtil.isNotBlank(pageForm.getUnderTakeUnitId())){
|
||||
cnd.andEX("pru.unitId", "=", pageForm.getUnderTakeUnitId());
|
||||
}
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("info.id");
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ public class ProposalQueryYearReportController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
COUNT(p.consolidationIds) > 0 AS isConsolidation,
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
@@ -59,8 +59,8 @@ public class ProposalQueryYearReportController {
|
||||
GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 0 THEN pru.unitName END) AS slaveUnitNames
|
||||
FROM
|
||||
proposal_info info
|
||||
LEFT JOIN proposal_consolidation p ON JSON_CONTAINS(p.consolidationIds, JSON_QUOTE(info.id))
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
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
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
|
||||
+8
-9
@@ -21,6 +21,7 @@ import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@@ -48,7 +49,7 @@ public class ProposalSeniorBasicController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
COUNT(p.consolidationIds) > 0 AS isConsolidation,
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
@@ -58,15 +59,16 @@ public class ProposalSeniorBasicController {
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.displayName curTaskName,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(caseTasks.variable, '$.tf_hostUnitName')) AS masterUnitName,
|
||||
JSON_EXTRACT(caseTasks.variable, '$.tf_helpUnitNames') AS slaveUnitNames
|
||||
GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 1 THEN pru.unitName END) AS masterUnitName,
|
||||
GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 0 THEN pru.unitName END) AS slaveUnitNames
|
||||
FROM
|
||||
proposal_info info
|
||||
LEFT JOIN proposal_consolidation p ON JSON_CONTAINS(p.consolidationIds, JSON_QUOTE(info.id))
|
||||
LEFT JOIN proposal_merge mer ON mer.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
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
LEFT JOIN proposal_reply_unit pru ON pru.proposalId = info.id
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
LEFT JOIN (SELECT processInstanceId, MAX(finishTime) AS finishTime FROM wf_process_task WHERE taskName = '9846ab38-40c5-4093-bafc-a9b3b443338b' AND taskState = 20 GROUP BY processInstanceId) latestTasks ON latestTasks.processInstanceId = ins.id
|
||||
LEFT JOIN wf_process_task caseTasks ON caseTasks.processInstanceId = ins.id AND caseTasks.taskName = '9846ab38-40c5-4093-bafc-a9b3b443338b' AND caseTasks.taskState = 20 AND caseTasks.finishTime = latestTasks.finishTime
|
||||
@@ -74,9 +76,6 @@ public class ProposalSeniorBasicController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getUndertakeUnitId())) {
|
||||
|
||||
}
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
@@ -89,8 +88,8 @@ public class ProposalSeniorBasicController {
|
||||
@SaCheckPermission("proposal.senior.basic")
|
||||
@ApiOperation(value = "提案内容修改")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result update(@Valid ProposalInfo proposalInfo) {
|
||||
dao.update(proposalInfo,"^name|typeId|brief|measures|excerpt$$");
|
||||
public Result update(@Valid @Param("info") ProposalInfo proposalInfo) {
|
||||
dao.update(proposalInfo,"^name|typeId|brief|measures|excerpt|suggestUnits$");
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -50,7 +50,7 @@ public class ProposalSeniorDeleteController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
COUNT(p.consolidationIds) > 0 AS isConsolidation,
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
@@ -62,18 +62,19 @@ public class ProposalSeniorDeleteController {
|
||||
t.displayName curTaskName
|
||||
FROM
|
||||
proposal_info info
|
||||
LEFT JOIN proposal_consolidation p ON JSON_CONTAINS(p.consolidationIds, JSON_QUOTE(info.id))
|
||||
LEFT JOIN proposal_merge mer ON mer.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
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
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
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getUndertakeUnitId())) {
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getUnderTakeUnitId())) {
|
||||
cnd.andEX("pru.unitId", "=", pageForm.getUnderTakeUnitId());
|
||||
}
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("info.id");
|
||||
|
||||
+16
-10
@@ -56,7 +56,7 @@ public class ProposalSeniorFeedBackController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
COUNT(p.consolidationIds) > 0 AS isConsolidation,
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
@@ -66,26 +66,32 @@ public class ProposalSeniorFeedBackController {
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.displayName curTaskName,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(caseTasks.variable, '$.tf_hostUnitName')) AS masterUnitName,
|
||||
JSON_EXTRACT(caseTasks.variable, '$.tf_helpUnitNames') AS slaveUnitNames
|
||||
GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 1 THEN pru.unitName END) AS masterUnitName,
|
||||
GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 0 THEN pru.unitName END) AS slaveUnitNames,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(latestFeedBack.variable, '$.tf_feedback')) AS tf_feedback
|
||||
FROM
|
||||
proposal_info info
|
||||
LEFT JOIN proposal_consolidation p ON JSON_CONTAINS(p.consolidationIds, JSON_QUOTE(info.id))
|
||||
LEFT JOIN proposal_merge mer ON mer.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
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
LEFT JOIN proposal_reply_unit pru ON pru.proposalId = info.id
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
LEFT JOIN (SELECT processInstanceId, MAX(finishTime) AS finishTime FROM wf_process_task WHERE taskName = '9846ab38-40c5-4093-bafc-a9b3b443338b' AND taskState = 20 GROUP BY processInstanceId) latestTasks ON latestTasks.processInstanceId = ins.id
|
||||
LEFT JOIN wf_process_task caseTasks ON caseTasks.processInstanceId = ins.id AND caseTasks.taskName = '9846ab38-40c5-4093-bafc-a9b3b443338b' AND caseTasks.taskState = 20 AND caseTasks.finishTime = latestTasks.finishTime
|
||||
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
processInstanceId,
|
||||
variable,
|
||||
ROW_NUMBER() OVER (PARTITION BY processInstanceId ORDER BY finishTime DESC) as rn
|
||||
FROM wf_process_task
|
||||
WHERE taskName = 'feedback'
|
||||
) latestFeedBack ON latestFeedBack.processInstanceId = ins.id AND latestFeedBack.rn = 1
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getUndertakeUnitId())) {
|
||||
|
||||
}
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
// cnd.and("latestFeedBack.id","is not",null);
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = proposalCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
@@ -97,7 +103,7 @@ public class ProposalSeniorFeedBackController {
|
||||
@ApiOperation(value = "反馈信息")
|
||||
public Result info(@Param("instanceId") String instanceId) {
|
||||
List<ProcessTask> taskList = dao.query(ProcessTask.class, Cnd.where(ProcessTask::getProcessInstanceId, "=", instanceId)
|
||||
.and(ProcessTask::getTaskName, "=", "013a7cf9-20dd-4188-a196-53fd595448e5")
|
||||
.and(ProcessTask::getTaskName, "=", "feedback")
|
||||
.and(ProcessTask::getTaskState, "=", ProcessTaskStateEnum.FINISHED.getCode())
|
||||
);
|
||||
|
||||
|
||||
+7
-6
@@ -50,7 +50,7 @@ public class ProposalSeniorTypeController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
COUNT(p.consolidationIds) > 0 AS isConsolidation,
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
type.name AS typeName,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
@@ -60,15 +60,16 @@ public class ProposalSeniorTypeController {
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.displayName curTaskName,
|
||||
JSON_UNQUOTE(JSON_EXTRACT(caseTasks.variable, '$.tf_hostUnitName')) AS masterUnitName,
|
||||
JSON_EXTRACT(caseTasks.variable, '$.tf_helpUnitNames') AS slaveUnitNames
|
||||
GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 1 THEN pru.unitName END) AS masterUnitName,
|
||||
GROUP_CONCAT(DISTINCT CASE WHEN pru.isMaster = 0 THEN pru.unitName END) AS slaveUnitNames
|
||||
FROM
|
||||
proposal_info info
|
||||
LEFT JOIN proposal_consolidation p ON JSON_CONTAINS(p.consolidationIds, JSON_QUOTE(info.id))
|
||||
LEFT JOIN proposal_merge mer ON mer.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
|
||||
LEFT JOIN teacher_congress_delegate tcde on tcde.loginName = info.createUserLoginName
|
||||
LEFT JOIN proposal_reply_unit pru ON pru.proposalId = info.id
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
LEFT JOIN (SELECT processInstanceId, MAX(finishTime) AS finishTime FROM wf_process_task WHERE taskName = '9846ab38-40c5-4093-bafc-a9b3b443338b' AND taskState = 20 GROUP BY processInstanceId) latestTasks ON latestTasks.processInstanceId = ins.id
|
||||
LEFT JOIN wf_process_task caseTasks ON caseTasks.processInstanceId = ins.id AND caseTasks.taskName = '9846ab38-40c5-4093-bafc-a9b3b443338b' AND caseTasks.taskState = 20 AND caseTasks.finishTime = latestTasks.finishTime
|
||||
@@ -76,8 +77,8 @@ public class ProposalSeniorTypeController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getUndertakeUnitId())) {
|
||||
|
||||
if (StrUtil.isNotBlank(pageForm.getUnderTakeUnitId())) {
|
||||
cnd.andEX("pru.unitId", "=", pageForm.getUnderTakeUnitId());
|
||||
}
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("info.id");
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ public class ProposalCommitteeFilingController {
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
IF(rt.id IS NOT NULL OR (ins.state = 20 AND info.caseFilingResult = 'NOT'), 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
|
||||
+9
-15
@@ -47,7 +47,7 @@ public class ProposalQueryComprehensiveParam extends PageForm {
|
||||
@ApiModelProperty(name = "承办单位编码")
|
||||
private String replyUnitCode;
|
||||
@ApiModelProperty(name = "承办单位ID")
|
||||
private String undertakeUnitId;
|
||||
private String underTakeUnitId;
|
||||
|
||||
@ApiModelProperty(name = "征集进度状态")
|
||||
private Integer[] collectIds;
|
||||
@@ -93,25 +93,19 @@ public class ProposalQueryComprehensiveParam extends PageForm {
|
||||
if (StrUtil.isNotBlank(searchParam.getCreateUserName())) {
|
||||
cnd.where().andLike("info.createUserName", searchParam.getCreateUserName());
|
||||
}
|
||||
//提案人分工会
|
||||
// 提案人分工会
|
||||
cnd.andEX("tcde.unionId", "=", searchParam.getUnionId());
|
||||
//提案人单位
|
||||
// 提案人单位
|
||||
cnd.andEX("tcde.unitId", "=", searchParam.getUnitId());
|
||||
//提案类型
|
||||
// 提案类型
|
||||
cnd.andEX("info.typeId", "=", searchParam.getType());
|
||||
cnd.andEX("info.typeId", "in", searchParam.getTypeIds());
|
||||
//提案立案结果
|
||||
// 提案立案结果
|
||||
cnd.andEX("info.caseFilingResult", "in", searchParam.getCaseFilingResults());
|
||||
//承办单位编码
|
||||
cnd.andEX("pru.code", "=", searchParam.getReplyUnitCode());
|
||||
|
||||
//承办单位Id
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
if(StrUtil.isNotBlank(searchParam.getUndertakeUnitId())){
|
||||
seg.orLike("JSON_EXTRACT(caseUnitTasks.extVariable, '$.hostUnitId')",searchParam.getUndertakeUnitId());
|
||||
seg.orLike("JSON_EXTRACT(caseUnitTasks.extVariable, '$.helpUnitIds')",searchParam.getUndertakeUnitId());
|
||||
cnd.and(seg);
|
||||
}
|
||||
// 提案立案类型
|
||||
cnd.andEX("info.caseFilingType", "in", searchParam.getCaseFilingTypes());
|
||||
// 承办单位编码
|
||||
cnd.andEX("pru.unitId", "=", searchParam.getUnderTakeUnitId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+153
-8
@@ -3,10 +3,16 @@ package com.budwk.app.zhgh.democratic.teachercongress.delegate.controller;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.delegation.models.Teacher_congress_delegation;
|
||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
@@ -15,6 +21,11 @@ import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,6 +37,9 @@ public class TeacherCongressDelegateTransitionController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/teachercongress/delegate/transition/index.html")
|
||||
@@ -47,8 +61,11 @@ public class TeacherCongressDelegateTransitionController {
|
||||
List<Teacher_congress_delegate> delegates = dao.query(Teacher_congress_delegate.class, Cnd.where(Teacher_congress_delegate::getSessionId, "=", sessionId));
|
||||
dao.fetchLinks(delegates, "delegation");
|
||||
// 上一届次代表
|
||||
List<Teacher_congress_delegate> lastDelegates = dao.query(Teacher_congress_delegate.class, Cnd.where(Teacher_congress_delegate::getSessionId, "=", lastSession.getId()));
|
||||
dao.fetchLinks(lastDelegates, "delegation");
|
||||
List<Teacher_congress_delegate> lastDelegates = new ArrayList<>();
|
||||
if (lastSession != null) {
|
||||
dao.query(Teacher_congress_delegate.class, Cnd.where(Teacher_congress_delegate::getSessionId, "=", lastSession.getId()));
|
||||
dao.fetchLinks(lastDelegates, "delegation");
|
||||
}
|
||||
|
||||
// 代表数据
|
||||
List<NutMap> delegateFull = delegates.stream().map(delegate -> {
|
||||
@@ -76,20 +93,21 @@ public class TeacherCongressDelegateTransitionController {
|
||||
}).toList();
|
||||
|
||||
|
||||
List<HashMap<String, Object>> list = delegations.stream().map(delegation -> {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
List<NutMap> list = delegations.stream().map(delegation -> {
|
||||
NutMap map = NutMap.NEW();
|
||||
map.put("id", delegation.getId());
|
||||
map.put("name", delegation.getName());
|
||||
map.put("code", delegation.getCode());
|
||||
// 上一届次人数
|
||||
map.put("lastCount", delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode())).count());
|
||||
// 增补代表数 (上一届次不是代表 但是本届次是代表)
|
||||
map.put("addCount", delegateFull.stream().filter(delegate -> StrUtil.isBlank(delegate.getString("lastDelegationCode")) && delegate.getString("delegationCode").equals(delegation.getCode())));
|
||||
map.put("addCount", delegateFull.stream().filter(delegate -> StrUtil.isBlank(delegate.getString("lastDelegationCode")) && delegate.getString("delegationCode").equals(delegation.getCode())).count());
|
||||
// 转入代表数 (上一届次是代表 但是在别的代表团)
|
||||
map.put("transferCount", delegateFull.stream().filter(delegate -> !delegate.getString("lastDelegationCode").equals(delegation.getCode()) && delegate.getString("delegationCode").equals(delegation.getCode())));
|
||||
map.put("transferCount", delegateFull.stream().filter(delegate -> StrUtil.isNotBlank(delegate.getString("lastDelegationCode")) && !delegate.getString("lastDelegationCode").equals(delegation.getCode()) && delegate.getString("delegationCode").equals(delegation.getCode())).count());
|
||||
// 转出代表数 (上一届次在本团 本届次转出去了)
|
||||
map.put("transferOutCount", delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode()) && StrUtil.isNotBlank(delegate.getString("delegationCode")) && !delegate.getString("delegationCode").equals(delegation.getCode())));
|
||||
map.put("transferOutCount", delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode()) && StrUtil.isNotBlank(delegate.getString("delegationCode")) && !delegate.getString("delegationCode").equals(delegation.getCode())).count());
|
||||
// 减少代表数 (上一届次是代表 本届次不是代表)
|
||||
map.put("reduceCount", delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode()) && StrUtil.isBlank(delegate.getString("delegationCode"))));
|
||||
map.put("reduceCount", delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode()) && StrUtil.isBlank(delegate.getString("delegationCode"))).count());
|
||||
// 当前代表数
|
||||
map.put("currentCount", delegateFull.stream().filter(delegate -> delegate.getString("delegationCode").equals(delegation.getCode())).count());
|
||||
return map;
|
||||
@@ -98,4 +116,131 @@ public class TeacherCongressDelegateTransitionController {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("tc.delegate.transition")
|
||||
@ApiOperation("代表换届详情")
|
||||
public Result detail(String sessionId, String delegationId) {
|
||||
HashMap<String, Object> data = innerData(sessionId, delegationId);
|
||||
return Result.success(data);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("tc.delegate.transition")
|
||||
public void exportDocx(String sessionId, String delegationId, HttpServletResponse response) {
|
||||
HashMap<String, Object> data = innerData(sessionId, delegationId);
|
||||
|
||||
List<NutMap> addUser = (List<NutMap>) data.get("addUser");
|
||||
for (int i = 0; i < addUser.size(); i++) {
|
||||
addUser.get(i).put("index", i + 1);
|
||||
}
|
||||
|
||||
List<NutMap> transferUser = (List<NutMap>) data.get("transferUser");
|
||||
for (int i = 0; i < transferUser.size(); i++) {
|
||||
transferUser.get(i).put("index", i + 1);
|
||||
}
|
||||
|
||||
List<NutMap> transferOutUser = (List<NutMap>) data.get("transferOutUser");
|
||||
for (int i = 0; i < transferOutUser.size(); i++) {
|
||||
transferOutUser.get(i).put("index", i + 1);
|
||||
}
|
||||
|
||||
List<NutMap> transferInOutUser = new ArrayList<>();
|
||||
transferInOutUser.addAll(transferUser);
|
||||
transferInOutUser.addAll(transferOutUser);
|
||||
|
||||
data.put("transferInOutUser", transferInOutUser);
|
||||
data.put("addUserCount", ((List<NutMap>) data.get("addUser")).size());
|
||||
|
||||
LoopRowTableRenderPolicy hackLoopTableRenderPolicy = new LoopRowTableRenderPolicy();
|
||||
Configure config = Configure.builder()
|
||||
.bind("transferInOutUser", hackLoopTableRenderPolicy)
|
||||
.bind("addUser", hackLoopTableRenderPolicy)
|
||||
.build();
|
||||
|
||||
ByteArrayOutputStream byteOs = new ByteArrayOutputStream();
|
||||
try {
|
||||
InputStream inputStream = sysOfficeTemplateUtil.getTemplate("tcDelegateTransition");
|
||||
XWPFTemplate.compile(inputStream, config)
|
||||
.render(data)
|
||||
.writeAndClose(byteOs);
|
||||
CommonDownloadUtil.download(data.get("delegationName")+"代表换届变动信息.docx", byteOs.toByteArray(), response);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public HashMap<String, Object> innerData(String sessionId, String delegationId) {
|
||||
// 当前届次
|
||||
Teacher_congress_session session = dao.fetch(Teacher_congress_session.class, sessionId);
|
||||
// 上一届次
|
||||
Teacher_congress_session lastSession = dao.fetch(Teacher_congress_session.class, Cnd.where(Teacher_congress_session::getStartDate, "<", session.getStartDate()).desc(Teacher_congress_session::getStartDate));
|
||||
// 当前代表团
|
||||
Teacher_congress_delegation delegation = dao.fetch(Teacher_congress_delegation.class, delegationId);
|
||||
|
||||
// 当前届次代表团代表
|
||||
List<Teacher_congress_delegate> delegates = dao.query(Teacher_congress_delegate.class, Cnd.where(Teacher_congress_delegate::getSessionId, "=", sessionId).and(Teacher_congress_delegate::getDelegationId, "=", delegation.getId()));
|
||||
dao.fetchLinks(delegates, "delegation");
|
||||
|
||||
// 上一届次代表
|
||||
List<Teacher_congress_delegate> lastDelegates = new ArrayList<>();
|
||||
if (lastSession != null) {
|
||||
dao.query(Teacher_congress_delegate.class, Cnd.where(Teacher_congress_delegate::getSessionId, "=", lastSession.getId()));
|
||||
dao.fetchLinks(lastDelegates, "delegation");
|
||||
}
|
||||
|
||||
// 代表数据
|
||||
List<NutMap> delegateFull = delegates.stream().map(delegate -> {
|
||||
NutMap delegateMap = NutMap.NEW();
|
||||
delegateMap.put("userId", delegate.getUserId());
|
||||
delegateMap.put("userName", delegate.getUserName());
|
||||
|
||||
// 本届次代表团信息
|
||||
delegateMap.put("delegationId", delegate.getDelegationId());
|
||||
delegateMap.put("delegationName", delegate.getDelegation().getName());
|
||||
delegateMap.put("delegationCode", delegate.getDelegation().getCode());
|
||||
|
||||
// 上一届次代表团信息
|
||||
lastDelegates.stream().filter(lastDelegate -> lastDelegate.getUserId().equals(delegate.getUserId())).findFirst().ifPresentOrElse(lastDelegate -> {
|
||||
delegateMap.put("lastDelegationId", lastDelegate.getDelegationId());
|
||||
delegateMap.put("lastDelegationName", lastDelegate.getDelegation().getName());
|
||||
delegateMap.put("lastDelegationCode", lastDelegate.getDelegation().getCode());
|
||||
}, () -> {
|
||||
delegateMap.put("lastDelegationId", "");
|
||||
delegateMap.put("lastDelegationName", "");
|
||||
delegateMap.put("lastDelegationCode", "");
|
||||
});
|
||||
|
||||
return delegateMap;
|
||||
}).toList();
|
||||
|
||||
// 增补代表数据 (上一届次不是代表 但是本届次是代表)
|
||||
List<NutMap> addUser = delegateFull.stream().filter(delegate -> StrUtil.isBlank(delegate.getString("lastDelegationCode")) && delegate.getString("delegationCode").equals(delegation.getCode())).toList();
|
||||
|
||||
// 转入代表数据 (上一届次是代表 但是在别的代表团)
|
||||
List<NutMap> transferUser = delegateFull.stream().filter(delegate -> StrUtil.isNotBlank(delegate.getString("lastDelegationCode")) && !delegate.getString("lastDelegationCode").equals(delegation.getCode()) && delegate.getString("delegationCode").equals(delegation.getCode())).toList();
|
||||
|
||||
// 转出代表数据 (上一届次在本团 本届次转出去了)
|
||||
List<NutMap> transferOutUser = delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode()) && StrUtil.isNotBlank(delegate.getString("delegationCode")) && !delegate.getString("delegationCode").equals(delegation.getCode())).toList();
|
||||
|
||||
// 减少代表数据 (上一届次是代表 本届次不是代表)
|
||||
List<NutMap> reduceUser = delegateFull.stream().filter(delegate -> delegate.getString("lastDelegationCode").equals(delegation.getCode()) && StrUtil.isBlank(delegate.getString("delegationCode"))).toList();
|
||||
|
||||
// 当前代表人数
|
||||
int currentCount = delegates.size();
|
||||
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("addUser", addUser);
|
||||
map.put("transferUser", transferUser);
|
||||
map.put("transferOutUser", transferOutUser);
|
||||
map.put("reduceUser", reduceUser);
|
||||
map.put("currentCount", currentCount);
|
||||
map.put("sessionName", session.getFullName());
|
||||
map.put("delegationName", delegation.getName());
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user