..
This commit is contained in:
@@ -11,6 +11,7 @@ import com.budwk.app.web.commons.auth.satoken.SaTokenDaoRedisImpl;
|
||||
import com.budwk.app.web.commons.auth.satoken.StpInterfaceImpl;
|
||||
import com.budwk.app.web.commons.base.Globals;
|
||||
import com.budwk.app.web.commons.ext.pubsub.WebPubSub;
|
||||
import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.beetl.core.GroupTemplate;
|
||||
import org.nutz.boot.NbApp;
|
||||
@@ -82,6 +83,7 @@ public class MainLauncher {
|
||||
init_auth();
|
||||
ioc.get(Globals.class);
|
||||
ioc.get(FlowEngine.class);
|
||||
ioc.get(GlobalMessageSendService.class);
|
||||
|
||||
AppIocUtil.setIoc(ioc);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.budwk.app.base.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 自定义导出表格列
|
||||
*/
|
||||
@Data
|
||||
public class ExportTableColumns {
|
||||
|
||||
private String label;
|
||||
private String prop;
|
||||
|
||||
}
|
||||
@@ -201,4 +201,14 @@ public interface ProcessTaskService extends BaseService<ProcessTask> {
|
||||
* @param transferUserId 转办用户ID
|
||||
*/
|
||||
void transfer(Long taskId, String transferUserId);
|
||||
|
||||
/**
|
||||
* 获取正在进行的任务
|
||||
*
|
||||
* @param bizIds 业务ID
|
||||
* @param taskName 任务名称
|
||||
* @return
|
||||
*/
|
||||
List<ProcessTask> getDoingTaskByBizIdTaskName(List<String> bizIds, String taskName);
|
||||
|
||||
}
|
||||
|
||||
@@ -485,7 +485,17 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl<ProcessTask> impleme
|
||||
processTaskList.forEach(processTask -> {
|
||||
ProcessPublisher.notify(ProcessEvent.builder().eventType(ProcessEventTypeEnum.PROCESS_TASK_START).sourceId(processTask.getId()).build());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ProcessTask> getDoingTaskByBizIdTaskName(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.DOING.getCode()));
|
||||
return tasks;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,30 +22,30 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class ParamValidationProcessor extends AbstractProcessor {
|
||||
|
||||
protected ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
|
||||
// protected ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
|
||||
|
||||
@Override
|
||||
public void process(ActionContext ac) throws Throwable {
|
||||
Validator validator = factory.getValidator();
|
||||
Method method = ac.getMethod();
|
||||
Object[] methodArgs = ac.getMethodArgs();
|
||||
Parameter[] parameters = method.getParameters();
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
Parameter parameter = parameters[i];
|
||||
boolean hasValidAnnotation = parameter.isAnnotationPresent(Valid.class);
|
||||
if (hasValidAnnotation) {
|
||||
Object argValue = methodArgs[i];
|
||||
if (argValue == null) {
|
||||
throw new MethodArgumentNotValidException(parameter.getName() + "不能为null");
|
||||
}
|
||||
|
||||
Set<ConstraintViolation<Object>> violations = validator.validate(argValue);
|
||||
if (!violations.isEmpty()) {
|
||||
String errMsg = violations.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining(","));
|
||||
throw new MethodArgumentNotValidException(errMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Validator validator = factory.getValidator();
|
||||
// Method method = ac.getMethod();
|
||||
// Object[] methodArgs = ac.getMethodArgs();
|
||||
// Parameter[] parameters = method.getParameters();
|
||||
// for (int i = 0; i < parameters.length; i++) {
|
||||
// Parameter parameter = parameters[i];
|
||||
// boolean hasValidAnnotation = parameter.isAnnotationPresent(Valid.class);
|
||||
// if (hasValidAnnotation) {
|
||||
// Object argValue = methodArgs[i];
|
||||
// if (argValue == null) {
|
||||
// throw new MethodArgumentNotValidException(parameter.getName() + "不能为null");
|
||||
// }
|
||||
//
|
||||
// Set<ConstraintViolation<Object>> violations = validator.validate(argValue);
|
||||
// if (!violations.isEmpty()) {
|
||||
// String errMsg = violations.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining(","));
|
||||
// throw new MethodArgumentNotValidException(errMsg);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
doNext(ac);
|
||||
}
|
||||
}
|
||||
|
||||
+31
-34
@@ -10,11 +10,12 @@ import org.nutz.ioc.Ioc;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 全局消息发送服务
|
||||
@@ -47,22 +48,18 @@ public class GlobalMessageSendService {
|
||||
log.info("开始初始化消息发送策略...");
|
||||
|
||||
// 获取所有实现了GlobalMessageSendStrategy接口的Bean
|
||||
String[] beanNames = ioc.getNames();
|
||||
for (String beanName : beanNames) {
|
||||
String[] namesByType = ioc.getNamesByType(GlobalMessageSendStrategy.class);
|
||||
|
||||
for (String beanName : namesByType) {
|
||||
try {
|
||||
Object bean = ioc.get(null, beanName);
|
||||
if (bean instanceof GlobalMessageSendStrategy) {
|
||||
GlobalMessageSendStrategy strategy = (GlobalMessageSendStrategy) bean;
|
||||
GlobalMessageChannel channel = strategy.getChannel();
|
||||
strategyMap.put(channel, strategy);
|
||||
|
||||
// 缓存本地策略
|
||||
if (channel == GlobalMessageChannel.LOCAL) {
|
||||
localStrategy = strategy;
|
||||
}
|
||||
|
||||
log.info("注册消息发送策略:{} -> {}", channel.getValue(), strategy.getClass().getSimpleName());
|
||||
GlobalMessageSendStrategy strategy = ioc.get(GlobalMessageSendStrategy.class, beanName);
|
||||
GlobalMessageChannel channel = strategy.getChannel();
|
||||
strategyMap.put(channel, strategy);
|
||||
// 缓存本地策略
|
||||
if (channel == GlobalMessageChannel.LOCAL) {
|
||||
localStrategy = strategy;
|
||||
}
|
||||
log.info("注册消息发送策略:{} -> {}", channel.getValue(), strategy.getClass().getSimpleName());
|
||||
} catch (Exception e) {
|
||||
log.warn("初始化Bean {}时出错:{}", beanName, e.getMessage());
|
||||
}
|
||||
@@ -96,7 +93,7 @@ public class GlobalMessageSendService {
|
||||
request.setType(type);
|
||||
request.setReceiverIds(receiverIds);
|
||||
request.setConfig(config);
|
||||
|
||||
|
||||
sendMessage(request);
|
||||
}
|
||||
|
||||
@@ -105,27 +102,27 @@ public class GlobalMessageSendService {
|
||||
*/
|
||||
public void sendMessage(GlobalMessageSendRequest request) {
|
||||
try {
|
||||
log.info("开始发送全局消息,标题:{},接收人数量:{}", request.getTitle(),
|
||||
log.info("开始发送全局消息,标题:{},接收人数量:{}", request.getTitle(),
|
||||
request.getReceiverIds() != null ? request.getReceiverIds().size() : 0);
|
||||
|
||||
|
||||
// 参数校验
|
||||
validateRequest(request);
|
||||
|
||||
|
||||
// 获取启用的策略
|
||||
List<GlobalMessageSendStrategy> enabledStrategies = getEnabledStrategies();
|
||||
|
||||
|
||||
if (enabledStrategies.isEmpty()) {
|
||||
log.warn("没有找到启用的消息发送策略");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 执行消息发送 - 本地消息优先,然后是外部策略
|
||||
for (GlobalMessageSendStrategy strategy : enabledStrategies) {
|
||||
try {
|
||||
// 本地消息必须同步发送,确保优先完成
|
||||
if (strategy.getChannel() == GlobalMessageChannel.LOCAL) {
|
||||
strategy.send(request.getTitle(), request.getContent(), request.getType(),
|
||||
request.getReceiverIds(), request.getConfig());
|
||||
strategy.send(request.getTitle(), request.getContent(), request.getType(),
|
||||
request.getReceiverIds(), request.getConfig());
|
||||
log.info("本地消息发送成功");
|
||||
} else {
|
||||
// 外部消息策略根据配置决定同步或异步
|
||||
@@ -133,8 +130,8 @@ public class GlobalMessageSendService {
|
||||
// 异步发送
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
strategy.send(request.getTitle(), request.getContent(), request.getType(),
|
||||
request.getReceiverIds(), request.getConfig());
|
||||
strategy.send(request.getTitle(), request.getContent(), request.getType(),
|
||||
request.getReceiverIds(), request.getConfig());
|
||||
log.info("异步发送消息成功,渠道:{}", strategy.getChannel().getValue());
|
||||
} catch (Exception e) {
|
||||
log.error("异步发送消息失败,渠道:{},错误:{}", strategy.getChannel().getValue(), e.getMessage(), e);
|
||||
@@ -142,8 +139,8 @@ public class GlobalMessageSendService {
|
||||
});
|
||||
} else {
|
||||
// 同步发送
|
||||
strategy.send(request.getTitle(), request.getContent(), request.getType(),
|
||||
request.getReceiverIds(), request.getConfig());
|
||||
strategy.send(request.getTitle(), request.getContent(), request.getType(),
|
||||
request.getReceiverIds(), request.getConfig());
|
||||
log.info("同步发送消息成功,渠道:{}", strategy.getChannel().getValue());
|
||||
}
|
||||
}
|
||||
@@ -156,7 +153,7 @@ public class GlobalMessageSendService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
log.info("全局消息发送完成,标题:{}", request.getTitle());
|
||||
} catch (Exception e) {
|
||||
log.error("全局消息发送失败,标题:{},错误:{}", request.getTitle(), e.getMessage(), e);
|
||||
@@ -191,20 +188,20 @@ public class GlobalMessageSendService {
|
||||
*/
|
||||
private List<GlobalMessageSendStrategy> getEnabledStrategies() {
|
||||
List<GlobalMessageSendStrategy> enabledStrategies = new ArrayList<>();
|
||||
|
||||
|
||||
// 本地消息策略必须存在且优先添加
|
||||
if (localStrategy != null) {
|
||||
enabledStrategies.add(localStrategy);
|
||||
log.debug("添加本地消息策略:{}", localStrategy.getChannel().getValue());
|
||||
}
|
||||
|
||||
|
||||
// 查找其他启用的策略
|
||||
for (GlobalMessageSendStrategy strategy : strategyMap.values()) {
|
||||
// 跳过本地策略(已经添加)
|
||||
if (strategy.getChannel() == GlobalMessageChannel.LOCAL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// 检查策略是否启用
|
||||
if (strategy.isEnabled()) {
|
||||
enabledStrategies.add(strategy);
|
||||
@@ -213,7 +210,7 @@ public class GlobalMessageSendService {
|
||||
log.debug("跳过未启用的消息策略:{}", strategy.getChannel().getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
log.info("共找到{}个启用的消息发送策略", enabledStrategies.size());
|
||||
return enabledStrategies;
|
||||
}
|
||||
|
||||
+19
-11
@@ -2,9 +2,8 @@ package com.budwk.app.zhgh.democratic.proposal.controller.export;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.ExportTableColumns;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.controller.vo.ProposalInfoPageVO;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalExportService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -33,7 +32,8 @@ public class ProposalExportComprehensiveController {
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/export/comprehensive/index.html")
|
||||
@SaCheckPermission("proposal.export.comprehensive")
|
||||
public void index() {}
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.query.comprehensive")
|
||||
@@ -42,7 +42,7 @@ public class ProposalExportComprehensiveController {
|
||||
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,
|
||||
@@ -56,8 +56,8 @@ public class ProposalExportComprehensiveController {
|
||||
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
|
||||
@@ -70,7 +70,7 @@ public class ProposalExportComprehensiveController {
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = proposalExportService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(), sql);
|
||||
Pagination pagination = proposalExportService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ProposalExportComprehensiveController {
|
||||
@Ok("void")
|
||||
@ApiOperation("导出汇总表excel")
|
||||
@SaCheckPermission("proposal.query.comprehensive")
|
||||
public void exportSummaryAsExcel(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response){
|
||||
public void exportSummaryAsExcel(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response) {
|
||||
proposalExportService.exportSummaryAsExcel(pageForm, response);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ProposalExportComprehensiveController {
|
||||
@Ok("void")
|
||||
@ApiOperation("导出提案立案汇总表excel")
|
||||
@SaCheckPermission("proposal.query.comprehensive")
|
||||
public void exportProposalRegisterSummaryAsExcel(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response){
|
||||
public void exportProposalRegisterSummaryAsExcel(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response) {
|
||||
proposalExportService.exportProposalRegisterSummaryAsExcel(pageForm, response);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class ProposalExportComprehensiveController {
|
||||
@Ok("void")
|
||||
@ApiOperation("导出全部提案ZIP")
|
||||
@SaCheckPermission("proposal.query.comprehensive")
|
||||
public void exportAllProposalAsZip(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response){
|
||||
public void exportAllProposalAsZip(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response) {
|
||||
proposalExportService.exportProposalStatisticsAsZip(pageForm, response);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class ProposalExportComprehensiveController {
|
||||
@Ok("void")
|
||||
@ApiOperation("导出全部提案反馈表ZIP")
|
||||
@SaCheckPermission("proposal.query.comprehensive")
|
||||
public void exportAllProposalFeedBackAsZip(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response){
|
||||
public void exportAllProposalFeedBackAsZip(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response) {
|
||||
proposalExportService.exportFeedBackAsZip(pageForm, response);
|
||||
}
|
||||
|
||||
@@ -112,8 +112,16 @@ public class ProposalExportComprehensiveController {
|
||||
@Ok("void")
|
||||
@ApiOperation("导出征集表ZIP")
|
||||
@SaCheckPermission("proposal.query.comprehensive")
|
||||
public void exportCollectZip(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response){
|
||||
public void exportCollectZip(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, HttpServletResponse response) {
|
||||
proposalExportService.exportCollectZip(pageForm, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("导出自定义表excel")
|
||||
@SaCheckPermission("proposal.query.comprehensive")
|
||||
public void exportCustomAsExcel(@Valid @Param("pageForm") ProposalQueryComprehensiveParam pageForm, @Param("tableColumns") ExportTableColumns[] tableColumns, HttpServletResponse response) {
|
||||
proposalExportService.exportCustomAsExcel(pageForm, tableColumns, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -49,7 +49,7 @@ public class ProposalQueryComprehensiveController {
|
||||
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,
|
||||
@@ -63,8 +63,8 @@ public class ProposalQueryComprehensiveController {
|
||||
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
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ public class ProposalQueryHistoryController {
|
||||
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,
|
||||
@@ -56,8 +56,8 @@ public class ProposalQueryHistoryController {
|
||||
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
|
||||
|
||||
+50
-3
@@ -1,24 +1,34 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalMerge;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam;
|
||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalCommitteeFilingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@@ -30,8 +40,13 @@ import java.util.List;
|
||||
@Api(tags = "提案委员会立案审核")
|
||||
public class ProposalCommitteeFilingController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ProposalCommitteeFilingService proposalCommitteeFilingService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/committeeFiling/index.html")
|
||||
@@ -42,11 +57,12 @@ public class ProposalCommitteeFilingController {
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFiling")
|
||||
@ApiOperation("分页列表")
|
||||
public Result pageData(@Valid ProposalSearchParam pageForm,boolean approval) {
|
||||
public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.id AS instanceId,
|
||||
@@ -73,13 +89,14 @@ public class ProposalCommitteeFilingController {
|
||||
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 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", "=", "committee");
|
||||
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
if (approval) {
|
||||
@@ -91,8 +108,38 @@ public class ProposalCommitteeFilingController {
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = proposalCommitteeFilingService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(), sql);
|
||||
Pagination pagination = proposalCommitteeFilingService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.committeeFiling")
|
||||
@ApiOperation("并案审核")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result merge(@Param("data") String data) {
|
||||
Dict args = Json.fromJson(Dict.class, data);
|
||||
|
||||
List<Integer> taskIds = (List<Integer>) args.get("processTaskIds");
|
||||
List<String> proposalIds = (List<String>) args.get("proposalIds");
|
||||
|
||||
// 记录提案并案
|
||||
dao.clear(ProposalMerge.class, Cnd.where(ProposalMerge::getProposalId, "in", proposalIds));
|
||||
String groupId = R.UU32();
|
||||
List<ProposalMerge> merges = proposalIds.stream().map(proposalId -> {
|
||||
ProposalMerge merge = new ProposalMerge();
|
||||
merge.setProposalId(proposalId);
|
||||
merge.setGroupId(groupId);
|
||||
return merge;
|
||||
}).toList();
|
||||
dao.insert(merges);
|
||||
|
||||
for (Integer taskId : taskIds) {
|
||||
Dict taskArgs = args.clone();
|
||||
taskArgs.put(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
flowCommonService.executeTask(taskArgs);
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -41,7 +41,7 @@ public class ProposalFeedbackEvaluationController {
|
||||
private ProposalCommonService proposalCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/feedbackEvaluation/index.html")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/feedback/index.html")
|
||||
@SaCheckPermission("proposal.feedbackEvaluation")
|
||||
public void index() {
|
||||
}
|
||||
@@ -61,6 +61,7 @@ public class ProposalFeedbackEvaluationController {
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.id AS instanceId,
|
||||
@@ -87,6 +88,7 @@ public class ProposalFeedbackEvaluationController {
|
||||
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 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
|
||||
|
||||
+39
@@ -1,11 +1,16 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.vo.LabelValueVO;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
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;
|
||||
@@ -21,8 +26,10 @@ 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.json.Json;
|
||||
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;
|
||||
@@ -42,6 +49,8 @@ public class ProposalSchoolLeaderApprovalController {
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private ProcessTaskService processTaskService;
|
||||
@Inject
|
||||
private FlowCommonService flowCommonService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/democratic/proposal/transact/schoolLeaderApproval/index.html")
|
||||
@@ -66,6 +75,7 @@ public class ProposalSchoolLeaderApprovalController {
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.id AS instanceId,
|
||||
@@ -92,6 +102,7 @@ public class ProposalSchoolLeaderApprovalController {
|
||||
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 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
|
||||
@@ -125,4 +136,32 @@ public class ProposalSchoolLeaderApprovalController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.schoolLeaderApproval")
|
||||
@ApiOperation("执行任务")
|
||||
public Result executeTask(@Param("data") String data) {
|
||||
Dict args = Json.fromJson(Dict.class, data);
|
||||
String proposalId = args.getStr("proposalId");
|
||||
|
||||
// 单条审核
|
||||
List<String> mergeProposalIds = proposalCommonService.mergeProposal(proposalId);
|
||||
if (ObjectUtil.isEmpty(mergeProposalIds)) {
|
||||
flowCommonService.executeTask(args);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
// 并案审核
|
||||
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();
|
||||
cloneArgs.put(FlowConst.PROCESS_TASK_ID_KEY, mergeTask.getId());
|
||||
flowCommonService.executeTask(cloneArgs);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+51
-2
@@ -1,9 +1,13 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.controller.transact;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.constant.FlowConst;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.flow.service.ProcessTaskService;
|
||||
@@ -20,12 +24,14 @@ 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.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
@@ -42,6 +48,8 @@ import java.util.stream.Stream;
|
||||
@Api(tags = "提案承办单位答复")
|
||||
public class ProposalUnderTakeReplyController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
@@ -73,6 +81,7 @@ public class ProposalUnderTakeReplyController {
|
||||
SELECT
|
||||
info.*,
|
||||
type.name AS typeName,
|
||||
IF(mer.proposalId IS NOT NULL, 1, 0) AS merge,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
ins.id AS instanceId,
|
||||
@@ -104,6 +113,7 @@ public class ProposalUnderTakeReplyController {
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id
|
||||
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 teacher_congress_session tcs on tcs.id = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId
|
||||
LEFT JOIN sys_user transferUser on transferUser.id = t.variable->>'$.tf_transferUserId'
|
||||
@@ -143,6 +153,34 @@ public class ProposalUnderTakeReplyController {
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.unitReply")
|
||||
@ApiOperation("执行任务")
|
||||
public Result executeTask(@Param("data") String data) {
|
||||
Dict args = Json.fromJson(Dict.class, data);
|
||||
String proposalId = args.getStr("proposalId");
|
||||
|
||||
// 查询是否提案
|
||||
|
||||
// 单条审核
|
||||
List<String> mergeProposalIds = proposalCommonService.mergeProposal(proposalId);
|
||||
if (ObjectUtil.isEmpty(mergeProposalIds)) {
|
||||
flowCommonService.executeTask(args);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
// 并案审核
|
||||
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();
|
||||
cloneArgs.put(FlowConst.PROCESS_TASK_ID_KEY, mergeTask.getId());
|
||||
flowCommonService.executeTask(cloneArgs);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("proposal.unitReply")
|
||||
@ApiOperation("查询本单位可转办用户")
|
||||
@@ -167,7 +205,7 @@ public class ProposalUnderTakeReplyController {
|
||||
@SaCheckPermission("proposal.unitReply")
|
||||
@ApiOperation("转办")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result transfer(@Param("taskId") @Valid Long taskId, @Param("userId") @Valid String userId) {
|
||||
public Result transfer(@Param("taskId") @Valid Long taskId, @Param("proposalId") String proposalId, @Param("userId") @Valid String userId) {
|
||||
// 此处设置转办用户的角色即可
|
||||
Sys_role proxyRole = sysRoleService.getByCode(RoleConstant.PROPOSAL_UNIT_PROXY);
|
||||
int count = sysRoleService.dao().count(Sys_user_role.class, Cnd.where(Sys_user_role::getUserId, "=", userId).and(Sys_user_role::getRoleId, "=", proxyRole.getId()));
|
||||
@@ -181,7 +219,18 @@ public class ProposalUnderTakeReplyController {
|
||||
sysRoleService.clearCache();
|
||||
}
|
||||
|
||||
processTaskService.transfer(taskId, userId);
|
||||
// 查询是否并案
|
||||
List<String> mergeProposalIds = proposalCommonService.mergeProposal(proposalId);
|
||||
if (ObjectUtil.isEmpty(mergeProposalIds)) {
|
||||
processTaskService.transfer(taskId, userId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
ProcessTask thisTask = dao.fetch(ProcessTask.class, taskId);
|
||||
List<ProcessTask> mergeTasks = processTaskService.getDoingTaskByBizIdTaskName(mergeProposalIds, thisTask.getTaskName());
|
||||
for (ProcessTask mergeTask : mergeTasks) {
|
||||
processTaskService.transfer(mergeTask.getId(), userId);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table("proposal_merge")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@Comment("提案并案")
|
||||
@TableIndexes(value = {
|
||||
@Index(name = "INDEX_PROPOSAL_MERGE_PROPOSAL_ID", fields = "proposalId", unique = true)
|
||||
})
|
||||
public class ProposalMerge extends BaseModel {
|
||||
|
||||
@Id
|
||||
@Comment("id")
|
||||
private Long id;
|
||||
|
||||
@Column
|
||||
@Comment("分组id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String groupId;
|
||||
|
||||
@Column
|
||||
@Comment("提案id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String proposalId;
|
||||
}
|
||||
+4
@@ -30,6 +30,10 @@ public class ProposalQueryComprehensiveParam extends PageForm {
|
||||
private String caseFilingResult;
|
||||
@ApiModelProperty(name = "提案立案结果")
|
||||
private String[] caseFilingResults;
|
||||
@ApiModelProperty(name = "提案立案类型")
|
||||
private String caseFilingType;
|
||||
@ApiModelProperty(name = "提案立案类型")
|
||||
private String[] caseFilingTypes;
|
||||
@ApiModelProperty(name = "提案类型")
|
||||
private String type;
|
||||
@ApiModelProperty(name = "提案类型")
|
||||
|
||||
+9
@@ -1,5 +1,6 @@
|
||||
package com.budwk.app.zhgh.democratic.proposal.service;
|
||||
|
||||
import com.budwk.app.base.param.ExportTableColumns;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam;
|
||||
@@ -72,4 +73,12 @@ public interface ProposalExportService extends BaseService<ProposalInfo> {
|
||||
* @param response
|
||||
*/
|
||||
void exportCollectZip(ProposalQueryComprehensiveParam pageForm, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 导出自定义表excel
|
||||
* @param pageForm
|
||||
* @param tableColumns
|
||||
* @param response
|
||||
*/
|
||||
void exportCustomAsExcel(ProposalQueryComprehensiveParam pageForm, ExportTableColumns[] tableColumns, HttpServletResponse response);
|
||||
}
|
||||
|
||||
+17
-1
@@ -17,6 +17,7 @@ public interface ProposalCommonService extends BaseService<ProposalInfo> {
|
||||
|
||||
/**
|
||||
* 导出word
|
||||
*
|
||||
* @param id
|
||||
* @param response
|
||||
*/
|
||||
@@ -32,14 +33,16 @@ public interface ProposalCommonService extends BaseService<ProposalInfo> {
|
||||
|
||||
/**
|
||||
* 导出单个反馈表
|
||||
*
|
||||
* @param id
|
||||
* @param byteArrayOutputStream
|
||||
*/
|
||||
void exportProposalFeedBackAsDocx(String id,ByteArrayOutputStream byteArrayOutputStream);
|
||||
void exportProposalFeedBackAsDocx(String id, ByteArrayOutputStream byteArrayOutputStream);
|
||||
|
||||
|
||||
/**
|
||||
* 导出征集表
|
||||
*
|
||||
* @param id
|
||||
* @param byteArrayOutputStream
|
||||
*/
|
||||
@@ -71,6 +74,7 @@ public interface ProposalCommonService extends BaseService<ProposalInfo> {
|
||||
|
||||
/**
|
||||
* 获取自管代表团
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> getSelfManageDelegationIds();
|
||||
@@ -78,6 +82,7 @@ public interface ProposalCommonService extends BaseService<ProposalInfo> {
|
||||
|
||||
/**
|
||||
* 根据提案id查询并案的提案
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@@ -85,8 +90,19 @@ public interface ProposalCommonService extends BaseService<ProposalInfo> {
|
||||
|
||||
/**
|
||||
* 导出年度报告
|
||||
*
|
||||
* @param sessionId
|
||||
* @param response
|
||||
*/
|
||||
void exportYearReport(String sessionId, HttpServletResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* 合并提案
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<String> mergeProposal(String id);
|
||||
|
||||
}
|
||||
|
||||
+36
-1
@@ -27,6 +27,7 @@ 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.teachercongress.prepare.models.Teacher_congress_session;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
@@ -100,6 +101,30 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
if (StrUtil.isNotBlank(info.getString("suggestUnits"))) {
|
||||
info.put("suggestUnits", String.join(",", Json.fromJson(ArrayList.class, info.getString("suggestUnits"))));
|
||||
}
|
||||
|
||||
// 并案提案
|
||||
List<String> mergedProposalIds = mergeProposal(id);
|
||||
if (ObjectUtil.isNotEmpty(mergedProposalIds)) {
|
||||
Sql mergeSql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.name,
|
||||
info.code,
|
||||
info.createUserName,
|
||||
type.name AS typeName,
|
||||
tcde.NAME AS delegationName
|
||||
FROM
|
||||
`proposal_info` info
|
||||
LEFT JOIN proposal_type type on type.id = info.typeId
|
||||
LEFT JOIN teacher_congress_delegate tcd ON tcd.userId = info.createUserId AND tcd.sessionId = info.sessionId
|
||||
LEFT JOIN teacher_congress_delegation tcde ON tcde.id = tcd.delegationId
|
||||
WHERE info.id in (@ids)
|
||||
""");
|
||||
mergeSql.setParam("ids", mergedProposalIds);
|
||||
List<NutMap> mergeInfos = listMap(mergeSql);
|
||||
info.put("merges", mergeInfos);
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -238,7 +263,7 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
String implementState = FlowUtil.variableToDict(masterUnitReplyTask.getVariable()).getStr("tf_implementState");
|
||||
info.put(implementState, "√");
|
||||
// 承办单位名称
|
||||
info.put("underTakeName",FlowUtil.variableToDict(masterUnitReplyTask.getVariable()).getStr("underTakeName"));
|
||||
info.put("underTakeName", FlowUtil.variableToDict(masterUnitReplyTask.getVariable()).getStr("underTakeName"));
|
||||
}
|
||||
|
||||
|
||||
@@ -542,4 +567,14 @@ public class ProposalCommonServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> mergeProposal(String id) {
|
||||
ProposalMerge merge = dao().fetch(ProposalMerge.class, Cnd.where(ProposalMerge::getProposalId, "=", id));
|
||||
if (merge != null) {
|
||||
List<ProposalMerge> merges = dao().query(ProposalMerge.class, Cnd.where(ProposalMerge::getGroupId, "=", merge.getGroupId()));
|
||||
return merges.stream().map(ProposalMerge::getProposalId).toList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+104
-3
@@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import com.budwk.app.base.param.ExportTableColumns;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
@@ -14,6 +15,8 @@ import com.budwk.app.flow.engine.util.FlowUtil;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.sys.models.Sys_dict;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.web.commons.base.Globals;
|
||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||
import com.budwk.app.zhgh.democratic.proposal.param.ProposalQueryComprehensiveParam;
|
||||
@@ -41,6 +44,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
@@ -53,6 +57,8 @@ public class ProposalExportServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
private ProposalCommonService proposalCommonService;
|
||||
@Inject
|
||||
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
|
||||
|
||||
public ProposalExportServiceImpl(Dao dao) {
|
||||
@@ -195,7 +201,7 @@ public class ProposalExportServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
// 查询附议人信息
|
||||
ProcessTask inviteTask = dao().fetch(ProcessTask.class,
|
||||
Cnd.where(ProcessTask::getProcessInstanceId, "=", instance.getId())
|
||||
.and(ProcessTask::getTaskName, "=", "85b7b9bd-d706-48cb-99a1-ef1370fb1819")
|
||||
.and(ProcessTask::getTaskName, "=", "invite")
|
||||
.and(ProcessTask::getTaskState, "in",
|
||||
List.of(ProcessTaskStateEnum.DOING.getCode(), ProcessTaskStateEnum.FINISHED.getCode()))
|
||||
.desc(ProcessTask::getCreatedAt));
|
||||
@@ -416,7 +422,7 @@ public class ProposalExportServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
info.put("measures", sysOfficeTemplateUtil.convertRichTextToDocText(info.getString("measures")));
|
||||
|
||||
// 处理建议承办单位
|
||||
if(StrUtil.isNotBlank(info.getString("suggestUnits"))){
|
||||
if (StrUtil.isNotBlank(info.getString("suggestUnits"))) {
|
||||
info.put("suggestUnits", String.join("、", Json.fromJsonAsList(String.class, info.getString("suggestUnits"))));
|
||||
}
|
||||
|
||||
@@ -439,10 +445,11 @@ public class ProposalExportServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
NutMap variable = Json.fromJson(NutMap.class, inviteTask.getVariable());
|
||||
if (variable != null) {
|
||||
List<NutMap> seconders = variable.getAsList(FlowConst.TASK_FORM_DATA_PREFIX + "seconder", NutMap.class);
|
||||
if(seconders != null){
|
||||
if (seconders != null) {
|
||||
String secondersNames = seconders.stream().map(seconder -> seconder.getString("userName")).collect(Collectors.joining("、"));
|
||||
docData.put("secondersNames", secondersNames);
|
||||
}
|
||||
docData.put("seconders", seconders);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,4 +528,98 @@ public class ProposalExportServiceImpl extends BaseServiceImpl<ProposalInfo> imp
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportCustomAsExcel(ProposalQueryComprehensiveParam pageForm, ExportTableColumns[] tableColumns, HttpServletResponse response) {
|
||||
// 基本信息查询
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.id,
|
||||
info.name,
|
||||
info.code,
|
||||
info.researchFindings,
|
||||
info.brief,
|
||||
info.measures,
|
||||
info.createUserName,
|
||||
tcde.unitName,
|
||||
tcde.mobile,
|
||||
IF(mer.proposalId IS NOT NULL, '是', '') AS merge,
|
||||
type.name AS typeName,
|
||||
tcs.j,
|
||||
tcs.c,
|
||||
tcs.fullName AS sessionName,
|
||||
tcd.`name` AS delegationName,
|
||||
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_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
|
||||
LEFT JOIN proposal_reply_unit pru ON pru.proposalId = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
ProposalQueryComprehensiveParam.buildSearch(cnd, pageForm);
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
// 导出的数据
|
||||
List<NutMap> list = listMap(sql);
|
||||
// 添加序号,去除富文本,获取附议人
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(i).put("index", i + 1);
|
||||
list.get(i).put("brief", HtmlUtil.cleanHtmlTag(list.get(i).getString("brief")));
|
||||
list.get(i).put("measures", HtmlUtil.cleanHtmlTag(list.get(i).getString("measures")));
|
||||
|
||||
// 流程实例
|
||||
// ProcessInstance instance = dao().fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", list.get(i).getString("id")));
|
||||
//
|
||||
// // 查询附议人信息
|
||||
// ProcessTask inviteTask = dao().fetch(ProcessTask.class,
|
||||
// Cnd.where(ProcessTask::getProcessInstanceId, "=", instance.getId())
|
||||
// .and(ProcessTask::getTaskName, "=", "invite")
|
||||
// .and(ProcessTask::getTaskState, "in",
|
||||
// List.of(ProcessTaskStateEnum.DOING.getCode(), ProcessTaskStateEnum.FINISHED.getCode()))
|
||||
// .desc(ProcessTask::getCreatedAt));
|
||||
//
|
||||
// if (inviteTask != null) {
|
||||
// NutMap variable = Json.fromJson(NutMap.class, inviteTask.getVariable());
|
||||
// List<NutMap> seconders = variable.getAsList(FlowConst.TASK_FORM_DATA_PREFIX + "seconder", NutMap.class);
|
||||
// list.get(i).put("secondedUserNames", seconders.stream().map(v -> v.getString("userName")).collect(Collectors.joining(",")));
|
||||
// }
|
||||
}
|
||||
|
||||
// 立案结果
|
||||
List<Sys_dict> caseFilingResult = sysDictService.getSubListByCode("PROPOSAL_CASE_FILING_RESULT");
|
||||
Map<String, String> caseFilingResultMap = caseFilingResult.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
|
||||
// 立案类型
|
||||
List<Sys_dict> caseFilingType = sysDictService.getSubListByCode("PROPOSAL_CASE_FILING_TYPE");
|
||||
Map<String, String> caseFilingTypeMap = caseFilingType.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
|
||||
// 流程状态
|
||||
List<Sys_dict> processInstanceState = sysDictService.getSubListByCode("PROCESS_INSTANCE_STATE");
|
||||
Map<String, String> processInstanceStateMap = processInstanceState.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
|
||||
|
||||
for (NutMap row : list) {
|
||||
row.put("caseFilingResult", caseFilingResultMap.get(row.getString("caseFilingResult")));
|
||||
row.put("caseFilingType", caseFilingTypeMap.get(row.getString("caseFilingType")));
|
||||
row.put("instanceState", processInstanceStateMap.get(row.getString("instanceState")));
|
||||
}
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
|
||||
for (ExportTableColumns column : tableColumns) {
|
||||
exportEntities.add(new ExcelExportEntity(column.getLabel(), column.getProp(), 20));
|
||||
}
|
||||
|
||||
Teacher_congress_session session = dao().fetch(Teacher_congress_session.class, pageForm.getSessionId());
|
||||
String title = StrUtil.format("{}第{}{}教代会提案汇总表", Globals.AppName, session.getJ(), session.getC());
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
exportParams.setTitle(title);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
|
||||
CommonDownloadUtil.download(title + ".xlsx", workbook, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.budwk.app.zhgh.mall.models.dto.goods;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@@ -41,7 +40,6 @@ public class MallGoodsOperationDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "商品名称", required = true)
|
||||
@NotEmpty(message = "商品名称不能为空")
|
||||
@Length(max = 50, message = "商品名称不能超过50个字符")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "详情")
|
||||
|
||||
Reference in New Issue
Block a user