Conflicts: pmapi/src/main/java/com/ningdatech/pmapi/declared/manage/DeclaredProjectManage.javatags/24080901
@@ -250,6 +250,26 @@ | |||
<groupId>com.ningdatech</groupId> | |||
<artifactId>nd-flowable-starter</artifactId> | |||
</dependency> | |||
<!--浙政钉--> | |||
<dependency> | |||
<groupId>com.alibaba.xxpt</groupId> | |||
<artifactId>zwdd</artifactId> | |||
<version>1.2.0</version> | |||
<scope>system</scope> | |||
<systemPath>${basedir}/src/lib/zwdd-sdk-java-1.2.0.jar</systemPath> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.httpcomponents</groupId> | |||
<artifactId>httpclient</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>joda-time</groupId> | |||
<artifactId>joda-time</artifactId> | |||
<version>2.10.6</version> | |||
</dependency> | |||
</dependencies> | |||
<!-- 打包 --> | |||
<!--配置环境的profile--> | |||
@@ -3,6 +3,7 @@ package com.ningdatech.pmapi; | |||
import org.mybatis.spring.annotation.MapperScan; | |||
import org.springframework.boot.SpringApplication; | |||
import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
import org.springframework.context.annotation.ComponentScan; | |||
import org.springframework.context.annotation.EnableAspectJAutoProxy; | |||
import org.springframework.scheduling.annotation.EnableAsync; | |||
import org.springframework.scheduling.annotation.EnableScheduling; | |||
@@ -0,0 +1,46 @@ | |||
package com.ningdatech.pmapi.common.config; | |||
import com.alibaba.xxpt.gateway.shared.client.http.ExecutableClient; | |||
import com.ningdatech.pmapi.common.util.SpringContextHolder; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Qualifier; | |||
import org.springframework.context.annotation.Bean; | |||
import org.springframework.context.annotation.Configuration; | |||
import org.springframework.context.annotation.DependsOn; | |||
/** | |||
* @author CMM | |||
* @since 2023/02/03 09:24 | |||
*/ | |||
@Configuration | |||
@Slf4j | |||
public class BeanConfig { | |||
@Bean | |||
public SpringContextHolder springContextHolder() { | |||
return new SpringContextHolder(); | |||
} | |||
@Bean("authExecutableClient") | |||
@DependsOn(value = "govDingProperties") | |||
public ExecutableClient executableAuthClientInit() { | |||
ExecutableClient executableClient = ExecutableClient.getInstance(); | |||
executableClient.setAccessKey(GovDingProperties.appAuthkey); | |||
executableClient.setSecretKey(GovDingProperties.appAuthsecret); | |||
executableClient.setDomainName(GovDingProperties.domain); | |||
executableClient.setProtocal("https"); | |||
executableClient.init(); | |||
return executableClient; | |||
} | |||
@Bean("executableClient") | |||
@DependsOn(value = "govDingProperties") | |||
public ExecutableClient executableClientInit() { | |||
ExecutableClient executableClient = new ExecutableClient(); | |||
executableClient.setAccessKey(GovDingProperties.appkey); | |||
executableClient.setSecretKey(GovDingProperties.appsecret); | |||
executableClient.setDomainName(GovDingProperties.domain); | |||
executableClient.setProtocal("https"); | |||
executableClient.init(); | |||
return executableClient; | |||
} | |||
} |
@@ -0,0 +1,65 @@ | |||
package com.ningdatech.pmapi.common.config; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.stereotype.Component; | |||
import lombok.Data; | |||
/** | |||
* @description: 浙政钉配置 | |||
* @author: liushuai | |||
* @date: 2022/5/5 15:10 | |||
*/ | |||
@Data | |||
@Component | |||
public class GovDingProperties { | |||
public static String appkey; | |||
public static String appsecret; | |||
public static String appAuthkey; | |||
public static String appAuthsecret; | |||
public static String appSsoAuthkey; | |||
public static String appSsoAuthsecret; | |||
public static Long tenantId; | |||
public static String domain; | |||
@Value("${ding.app-key}") | |||
public void setPrivateKey(String appkey) { | |||
GovDingProperties.appkey = appkey; | |||
} | |||
@Value("${ding.app-secret}") | |||
public void setAppsecret(String appsecret) { | |||
GovDingProperties.appsecret = appsecret; | |||
} | |||
@Value("${ding.app-auth-key}") | |||
public void setAppAuthKey(String appAuthkey) { | |||
GovDingProperties.appAuthkey = appAuthkey; | |||
} | |||
@Value("${ding.app-auth-secret}") | |||
public void setAppAuthsecret(String appAuthsecret) { | |||
GovDingProperties.appAuthsecret = appAuthsecret; | |||
} | |||
@Value("${ding.app-sso-auth-key}") | |||
public void setAppSsoAuthKey(String appSsoAuthkey) { | |||
GovDingProperties.appSsoAuthkey = appSsoAuthkey; | |||
} | |||
@Value("${ding.app-sso-auth-secret}") | |||
public void setAppSsoAuthsecret(String appSsoAuthsecret) { | |||
GovDingProperties.appSsoAuthsecret = appSsoAuthsecret; | |||
} | |||
@Value("${ding.tenantId}") | |||
public void setTenantId(Long tenantId) { | |||
GovDingProperties.tenantId = tenantId; | |||
} | |||
@Value("${ding.domain}") | |||
public void setDomain(String domain) { | |||
GovDingProperties.domain = domain; | |||
} | |||
} |
@@ -0,0 +1,12 @@ | |||
package com.ningdatech.pmapi.common.constant; | |||
/** | |||
* 浙政钉常量 | |||
* @author CMM | |||
* @since 2023/02/01 14:49 | |||
*/ | |||
public interface DingConstant { | |||
/** | |||
* 工作通知 | |||
*/ | |||
String WORKING_NOTICE = "/message/workNotification"; | |||
} |
@@ -0,0 +1,25 @@ | |||
package com.ningdatech.pmapi.common.util; | |||
/** | |||
* @author qinxianyun | |||
* @see {@link SpringContextHolder} | |||
* 针对某些初始化方法,在SpringContextHolder 初始化前时,<br> | |||
* 可提交一个 提交回调任务。<br> | |||
* 在SpringContextHolder 初始化后,进行回调使用 | |||
*/ | |||
public interface CallBack { | |||
/** | |||
* 回调执行方法 | |||
*/ | |||
void executor(); | |||
/** | |||
* 本回调任务名称 | |||
* @return / | |||
*/ | |||
default String getCallBackName() { | |||
return Thread.currentThread().getId() + ":" + this.getClass().getName(); | |||
} | |||
} | |||
@@ -0,0 +1,150 @@ | |||
package com.ningdatech.pmapi.common.util; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import org.springframework.beans.BeansException; | |||
import org.springframework.beans.factory.DisposableBean; | |||
import org.springframework.context.ApplicationContext; | |||
import org.springframework.context.ApplicationContextAware; | |||
import org.springframework.core.env.Environment; | |||
import org.springframework.lang.NonNull; | |||
import lombok.extern.slf4j.Slf4j; | |||
/** | |||
* @author qinxianyun | |||
*/ | |||
@Slf4j | |||
public class SpringContextHolder implements ApplicationContextAware, DisposableBean { | |||
private static ApplicationContext applicationContext = null; | |||
private static final List<CallBack> CALL_BACKS = new ArrayList<>(); | |||
private static boolean addCallback = true; | |||
/** | |||
* 针对 某些初始化方法,在SpringContextHolder 未初始化时 提交回调方法。 | |||
* 在SpringContextHolder 初始化后,进行回调使用 | |||
* | |||
* @param callBack 回调函数 | |||
*/ | |||
public synchronized static void addCallBacks(CallBack callBack) { | |||
if (addCallback) { | |||
SpringContextHolder.CALL_BACKS.add(callBack); | |||
} else { | |||
log.warn("CallBack:{} 已无法添加!立即执行", callBack.getCallBackName()); | |||
callBack.executor(); | |||
} | |||
} | |||
/** | |||
* 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. | |||
*/ | |||
@SuppressWarnings("unchecked") | |||
public static <T> T getBean(String name) { | |||
assertContextInjected(); | |||
return (T) applicationContext.getBean(name); | |||
} | |||
/** | |||
* 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. | |||
*/ | |||
public static <T> T getBean(Class<T> requiredType) { | |||
assertContextInjected(); | |||
return applicationContext.getBean(requiredType); | |||
} | |||
/** | |||
* 获取SpringBoot 配置信息 | |||
* | |||
* @param property 属性key | |||
* @param defaultValue 默认值 | |||
* @param requiredType 返回类型 | |||
* @return / | |||
*/ | |||
public static <T> T getProperties(String property, T defaultValue, Class<T> requiredType) { | |||
T result = defaultValue; | |||
try { | |||
result = getBean(Environment.class).getProperty(property, requiredType); | |||
} catch (Exception ignored) { | |||
} | |||
return result; | |||
} | |||
/** | |||
* 获取SpringBoot 配置信息 | |||
* | |||
* @param property 属性key | |||
* @return / | |||
*/ | |||
public static String getProperties(String property) { | |||
return getProperties(property, null, String.class); | |||
} | |||
/** | |||
* 获取SpringBoot 配置信息 | |||
* | |||
* @param property 属性key | |||
* @param requiredType 返回类型 | |||
* @return / | |||
*/ | |||
public static <T> T getProperties(String property, Class<T> requiredType) { | |||
return getProperties(property, null, requiredType); | |||
} | |||
/** | |||
* 检查ApplicationContext不为空. | |||
*/ | |||
private static void assertContextInjected() { | |||
if (applicationContext == null) { | |||
throw new IllegalStateException("applicationContext属性未注入, 请在applicationContext" + | |||
".xml中定义SpringContextHolder或在SpringBoot启动类中注册SpringContextHolder."); | |||
} | |||
} | |||
/** | |||
* 清除SpringContextHolder中的ApplicationContext为Null. | |||
*/ | |||
private static void clearHolder() { | |||
log.debug("清除SpringContextHolder中的ApplicationContext:" | |||
+ applicationContext); | |||
applicationContext = null; | |||
} | |||
@Override | |||
public void destroy() { | |||
SpringContextHolder.clearHolder(); | |||
} | |||
@Override | |||
public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException { | |||
if (SpringContextHolder.applicationContext != null) { | |||
log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext); | |||
} | |||
SpringContextHolder.applicationContext = applicationContext; | |||
if (addCallback) { | |||
for (CallBack callBack : SpringContextHolder.CALL_BACKS) { | |||
callBack.executor(); | |||
} | |||
CALL_BACKS.clear(); | |||
} | |||
SpringContextHolder.addCallback = false; | |||
} | |||
/** | |||
* 获取当前启用的配置文件 | |||
* <ul> | |||
* <li><b>生产环境:prod</b></li> | |||
* <li><b>开发环境:dev</b></li> | |||
* </ul> | |||
* | |||
* @return java.lang.String | |||
* @author WendyYang | |||
**/ | |||
public static String getActiveProfile() { | |||
String[] strings = applicationContext.getEnvironment().getActiveProfiles(); | |||
return strings[0]; | |||
} | |||
} |
@@ -287,6 +287,16 @@ public class Project implements Serializable { | |||
@ApiModelProperty("项目二级状态") | |||
private Integer projectStatusSecond; | |||
@ApiModelProperty("单位名称") | |||
private String orgName; | |||
@ApiModelProperty("单位code") | |||
private String orgCode; | |||
@ApiModelProperty("流程状态") | |||
private Integer processStatus; | |||
private Long createBy; | |||
private Long updateBy; | |||
@@ -0,0 +1,26 @@ | |||
package com.ningdatech.pmapi.todocenter.bean.entity; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Builder; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
/** | |||
* 审核附件实体 | |||
* | |||
* @author CMM | |||
* @since 2023/02/01 16:27 | |||
*/ | |||
@Data | |||
@Builder | |||
@AllArgsConstructor | |||
@NoArgsConstructor | |||
public class Attachment { | |||
private String id; | |||
//文件名 | |||
private String name; | |||
//文件类型 | |||
private Boolean isImage; | |||
//访问地址 | |||
private String url; | |||
} |
@@ -0,0 +1,35 @@ | |||
package com.ningdatech.pmapi.todocenter.bean.entity; | |||
import com.wflow.workflow.bean.vo.ProcessHandlerParamsVo; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Builder; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
import java.util.Collections; | |||
import java.util.List; | |||
/** | |||
* 审核意见实体 | |||
* | |||
* @author CMM | |||
* @since 2023/02/01 16:25 | |||
*/ | |||
@Data | |||
@Builder | |||
@NoArgsConstructor | |||
public class ProcessComment { | |||
/** | |||
* 文字评论 | |||
*/ | |||
protected String text; | |||
/** | |||
* 评论附件 | |||
*/ | |||
protected List<Attachment> attachments; | |||
public ProcessComment(String text, List<Attachment> attachments) { | |||
this.text = text; | |||
this.attachments = null == attachments ? Collections.emptyList() : attachments; | |||
} | |||
} |
@@ -1,11 +1,11 @@ | |||
package com.ningdatech.pmapi.todocenter.bean.entity; | |||
import com.ningdatech.pmapi.todocenter.bean.vo.ProgressNodeAuditInfoVo; | |||
import com.ningdatech.pmapi.todocenter.enums.ProcessHandlerEnum; | |||
import com.ningdatech.pmapi.todocenter.model.dto.req.ReqProcessHandlerDTO; | |||
import com.wflow.workflow.bean.process.OrgUser; | |||
import com.wflow.workflow.bean.process.enums.ApprovalModeEnum; | |||
import com.wflow.workflow.bean.process.enums.NodeTypeEnum; | |||
import com.wflow.workflow.bean.vo.ProcessHandlerParamsVo; | |||
import com.wflow.workflow.bean.vo.TaskCommentVo; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Builder; | |||
import lombok.Data; | |||
@@ -52,11 +52,15 @@ public class ProgressNode { | |||
/** | |||
* 该节点动作操作类型 | |||
*/ | |||
private ReqProcessHandlerDTO.Action action; | |||
private ProcessHandlerEnum action; | |||
/** | |||
* 审核信息 | |||
*/ | |||
private List<ProgressNodeAuditInfoVo> auditInfos; | |||
/** | |||
* 处理结果 | |||
*/ | |||
private ReqProcessHandlerDTO.Action result; | |||
private ProcessHandlerEnum result; | |||
/** | |||
* 开始时间 | |||
*/ | |||
@@ -1,6 +1,9 @@ | |||
package com.ningdatech.pmapi.todocenter.bean.vo; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||
import com.ningdatech.pmapi.todocenter.bean.entity.ProgressNode; | |||
import com.ningdatech.pmapi.user.entity.UserInfo; | |||
import com.wflow.workflow.bean.process.OrgUser; | |||
import com.wflow.workflow.bean.process.form.Form; | |||
import lombok.AllArgsConstructor; | |||
@@ -8,6 +11,7 @@ import lombok.Builder; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
import java.time.LocalDateTime; | |||
import java.util.Date; | |||
import java.util.List; | |||
import java.util.Map; | |||
@@ -58,13 +62,21 @@ public class ProcessProgressDetailVo { | |||
/** | |||
* 发起人 | |||
*/ | |||
private OrgUser staterUser; | |||
private OrgUser startTempUser; | |||
/** | |||
* 发起人 | |||
*/ | |||
private UserInfo startUser; | |||
/** | |||
* 发起人部门 | |||
*/ | |||
private String starterDept; | |||
private String startDept; | |||
/** | |||
* 发起时间 | |||
*/ | |||
private Date startTime; | |||
/** | |||
* 项目申报信息 | |||
*/ | |||
private Project declaredProjectInfo; | |||
} |
@@ -0,0 +1,32 @@ | |||
package com.ningdatech.pmapi.todocenter.bean.vo; | |||
import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment; | |||
import com.wflow.workflow.bean.process.OrgUser; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
import java.util.Date; | |||
/** | |||
* 流程节点审核信息 | |||
* | |||
* @author CMM | |||
* @since 2023/02/01 16:52 | |||
*/ | |||
@Data | |||
@NoArgsConstructor | |||
@AllArgsConstructor | |||
public class ProgressNodeAuditInfoVo extends ProcessComment { | |||
private String id; | |||
private String type; | |||
private String taskId; | |||
private String commentType; | |||
private OrgUser user; | |||
private Date createTime; | |||
} |
@@ -0,0 +1,12 @@ | |||
package com.ningdatech.pmapi.todocenter.constant; | |||
/** | |||
* 工作通知格式常量 | |||
* @author CMM | |||
* @since 2023/02/01 14:56 | |||
*/ | |||
public interface WorkNotice { | |||
public final String PASS_MSG_TEMPLATE = "标题:审核任务 内容:【%s】的【%s】需要您审核。"; | |||
public final String PASS_MSG_TEMPLATE2 = "【%s】已通过【%s】,请及时开始下一步操作。"; | |||
} |
@@ -41,9 +41,9 @@ public class TodoCenterController { | |||
* @param param | |||
* @return | |||
*/ | |||
@GetMapping("/query-project-list") | |||
public ApiResponse<PageVo<ResToBeProcessedDTO>> queryProjectList(@Valid @ModelAttribute ReqToBeProcessedDTO param){ | |||
PageVo<ResToBeProcessedDTO> result = todoCenterManage.queryProjectList(param); | |||
@GetMapping("/query-todo-list") | |||
public ApiResponse<PageVo<ResToBeProcessedDTO>> queryPendingProjectList(@Valid @ModelAttribute ReqToBeProcessedDTO param){ | |||
PageVo<ResToBeProcessedDTO> result = todoCenterManage.queryPendingProjectList(param); | |||
return ApiResponse.ofSuccess(result); | |||
} | |||
@@ -54,9 +54,9 @@ public class TodoCenterController { | |||
* @param response | |||
* @return void | |||
*/ | |||
@GetMapping("/export") | |||
public void exportProjectList(ReqToBeProcessedDTO param, HttpServletResponse response){ | |||
ExcelDownUtil.downXlsx(response,param,todoCenterManage::exportProjectList); | |||
@GetMapping("/exportPending") | |||
public void exportPendingProjectList(ReqToBeProcessedDTO param, HttpServletResponse response){ | |||
ExcelDownUtil.downXlsx(response,param,todoCenterManage::exportPendingProjectList); | |||
} | |||
/** | |||
@@ -65,7 +65,7 @@ public class TodoCenterController { | |||
* @param nodeId 当前获取流程人员关联的流程节点ID | |||
* @return 流程进度及表单详情 | |||
*/ | |||
@GetMapping("progress/{instanceId}/{nodeId}") | |||
@GetMapping("/progress/{instanceId}/{nodeId}") | |||
public ApiResponse<ProcessProgressDetailVo> getProcessDetail(@PathVariable String instanceId, | |||
@PathVariable(required = false) String nodeId) { | |||
return ApiResponse.ofSuccess(todoCenterManage.getProcessDetail(nodeId, instanceId)); | |||
@@ -81,4 +81,51 @@ public class TodoCenterController { | |||
todoCenterManage.handler(param); | |||
return ApiResponse.ofSuccess(); | |||
} | |||
/** | |||
* 待办中心-待我处理项目列表查询 | |||
* @param param | |||
* @return | |||
*/ | |||
@GetMapping("/query-do-list") | |||
public ApiResponse<PageVo<ResToBeProcessedDTO>> queryHandledProjectList(@Valid @ModelAttribute ReqToBeProcessedDTO param){ | |||
PageVo<ResToBeProcessedDTO> result = todoCenterManage.queryHandledProjectList(param); | |||
return ApiResponse.ofSuccess(result); | |||
} | |||
/** | |||
* 待办中心-我已处理项目列表导出 | |||
* | |||
* @param param | |||
* @param response | |||
* @return void | |||
*/ | |||
@GetMapping("/exportHandled") | |||
public void exportHandledProjectList(ReqToBeProcessedDTO param, HttpServletResponse response){ | |||
ExcelDownUtil.downXlsx(response,param,todoCenterManage::exportHandledProjectList); | |||
} | |||
/** | |||
* 待办中心-我发起的项目列表查询 | |||
* @param param | |||
* @return | |||
*/ | |||
@GetMapping("/query-mySubmitted-list") | |||
public ApiResponse<PageVo<ResToBeProcessedDTO>> queryMySubmittedProjectList(@Valid @ModelAttribute ReqToBeProcessedDTO param){ | |||
PageVo<ResToBeProcessedDTO> result = todoCenterManage.queryMySubmittedProjectList(param); | |||
return ApiResponse.ofSuccess(result); | |||
} | |||
/** | |||
* 待办中心-我发起的项目列表导出 | |||
* | |||
* @param param | |||
* @param response | |||
* @return void | |||
*/ | |||
@GetMapping("/exportMySubmitted") | |||
public void exportMySubmittedProjectList(ReqToBeProcessedDTO param, HttpServletResponse response){ | |||
ExcelDownUtil.downXlsx(response,param,todoCenterManage::exportMySubmittedProjectList); | |||
} | |||
} |
@@ -0,0 +1,97 @@ | |||
package com.ningdatech.pmapi.todocenter.enums; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
import lombok.NoArgsConstructor; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.Objects; | |||
/** | |||
* 流程处理类型 | |||
* @author CMM | |||
* @since 2023/02/01 16:58 | |||
*/ | |||
@Getter | |||
@AllArgsConstructor | |||
@NoArgsConstructor | |||
@ApiModel(value = "ProcessHandlerEnum", description = "流程处理类型-枚举") | |||
public enum ProcessHandlerEnum { | |||
/** | |||
* 通过 | |||
*/ | |||
PASS(1, "通过"), | |||
/** | |||
* 盖章并通过 | |||
*/ | |||
SEAL_PASS(2, "盖章并通过"), | |||
/** | |||
* 退回 | |||
*/ | |||
BACK(3,"退回"), | |||
/** | |||
* 撤回 | |||
*/ | |||
WITHDRAW(4,"撤回"), | |||
/** | |||
* 驳回 | |||
*/ | |||
REJECT(5,"驳回"); | |||
private Integer code; | |||
private String desc; | |||
public String getDesc() { | |||
return desc; | |||
} | |||
public void setDesc(String desc) { | |||
this.desc = desc; | |||
} | |||
public static String getDescByCode(Integer code) { | |||
if(Objects.isNull(code)){ | |||
return StringUtils.EMPTY; | |||
} | |||
for (ProcessHandlerEnum t : ProcessHandlerEnum.values()) { | |||
if (code.equals(t.getCode())) { | |||
return t.desc; | |||
} | |||
} | |||
return StringUtils.EMPTY; | |||
} | |||
public static Integer getCodeByDesc(String desc) { | |||
if(Objects.isNull(desc)){ | |||
return null; | |||
} | |||
for (ProcessHandlerEnum t : ProcessHandlerEnum.values()) { | |||
if (desc.equals(t.getCode())) { | |||
return t.code; | |||
} | |||
} | |||
return null; | |||
} | |||
public static ProcessHandlerEnum getEnumByValue(Integer code) { | |||
if(Objects.isNull(code)){ | |||
return null; | |||
} | |||
for (ProcessHandlerEnum t : ProcessHandlerEnum.values()) { | |||
if (code.equals(t.getCode())) { | |||
return t; | |||
} | |||
} | |||
return null; | |||
} | |||
public boolean eq(String val) { | |||
return this.name().equals(val); | |||
} | |||
} |
@@ -37,7 +37,11 @@ public enum ProcessStatusEnum { | |||
/** | |||
* 审核通过 | |||
*/ | |||
APPROVED(4,"审核通过"); | |||
APPROVED(4,"审核通过"), | |||
/** | |||
* 被撤回 | |||
*/ | |||
WITHDRAW(5,"被撤回"); | |||
private Integer code; | |||
@@ -1,12 +1,11 @@ | |||
package com.ningdatech.pmapi.todocenter.extension.cmd; | |||
import java.io.Serializable; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Set; | |||
import java.util.*; | |||
import java.util.stream.Collectors; | |||
import com.ningdatech.pmapi.todocenter.enums.ProcessHandlerEnum; | |||
import lombok.RequiredArgsConstructor; | |||
import org.assertj.core.util.Sets; | |||
import org.flowable.bpmn.model.FlowNode; | |||
import org.flowable.bpmn.model.Process; | |||
@@ -16,6 +15,7 @@ import org.flowable.common.engine.api.FlowableObjectNotFoundException; | |||
import org.flowable.common.engine.impl.interceptor.Command; | |||
import org.flowable.common.engine.impl.interceptor.CommandContext; | |||
import org.flowable.engine.RuntimeService; | |||
import org.flowable.engine.TaskService; | |||
import org.flowable.engine.impl.delegate.ActivityBehavior; | |||
import org.flowable.engine.impl.persistence.entity.ExecutionEntity; | |||
import org.flowable.engine.impl.persistence.entity.ExecutionEntityManager; | |||
@@ -31,9 +31,11 @@ import com.wflow.workflow.utils.FlowableUtils; | |||
* @author : willian fu | |||
* @date : 2022/10/14 | |||
*/ | |||
@RequiredArgsConstructor | |||
public class BackToHisApprovalNodeCmd implements Command<String>, Serializable { | |||
private static final long serialVersionUID = -80075781855060928L; | |||
protected TaskService taskService; | |||
protected RuntimeService runtimeService; | |||
protected String taskId; | |||
@@ -74,8 +76,12 @@ public class BackToHisApprovalNodeCmd implements Command<String>, Serializable { | |||
String[] sourceAndTargetRealActivityId = FlowableUtils.getSourceAndTargetRealActivityId(sourceFlowElement, targetFlowElement); | |||
// 实际应操作的当前节点ID | |||
String sourceRealActivityId = sourceAndTargetRealActivityId[0]; | |||
// 实际应操作的目标节点ID | |||
String targetRealActivityId = sourceAndTargetRealActivityId[1]; | |||
//// 实际应操作的目标节点ID | |||
//String targetRealActivityId = sourceAndTargetRealActivityId[1]; | |||
// 实际应操作的目标节点的发起人ID | |||
String targetRealActivityId = sourceAndTargetRealActivityId[0]; | |||
Map<String, Set<String>> specialGatewayNodes = FlowableUtils.getSpecialGatewayElements(process); | |||
// 当前节点处在的并行网关list | |||
@@ -140,6 +146,10 @@ public class BackToHisApprovalNodeCmd implements Command<String>, Serializable { | |||
if (targetRealSpecialGateway != null) { | |||
createTargetInSpecialGatewayEndExecutions(commandContext, realExecutions, process, targetInSpecialGatewayList, targetRealSpecialGateway); | |||
} | |||
// TODO 调用原生的excute方法 在流程实例表中END_ACT_ID添加对应的字段标识 | |||
Map<String, Object> var = new HashMap<>(16); | |||
var.put("approve_" + task.getId(), ProcessHandlerEnum.BACK); | |||
taskService.complete(task.getId(), var); | |||
return targetRealActivityId; | |||
} | |||
@@ -1,5 +1,7 @@ | |||
package com.ningdatech.pmapi.todocenter.model.dto.req; | |||
import com.ningdatech.pmapi.common.model.FileBasicInfo; | |||
import com.ningdatech.pmapi.todocenter.bean.entity.ProcessComment; | |||
import com.ningdatech.pmapi.todocenter.enums.ProcessHandlerEnum; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
@@ -31,7 +33,7 @@ public class ReqProcessHandlerDTO { | |||
/** | |||
* 操作类型 | |||
*/ | |||
private Action action; | |||
private ProcessHandlerEnum action; | |||
/** | |||
* 目标用户 | |||
*/ | |||
@@ -40,43 +42,48 @@ public class ReqProcessHandlerDTO { | |||
* 目标节点 | |||
*/ | |||
private String targetNode; | |||
/** | |||
* 审核通过意见 | |||
*/ | |||
private String auditPassOpinion; | |||
/** | |||
* 审核通过附件 | |||
*/ | |||
private FileBasicInfo auditPassAppendix; | |||
/** | |||
* 盖章通过意见 | |||
*/ | |||
private String sealPassOpinion; | |||
/** | |||
* 盖章通过附件 | |||
*/ | |||
private FileBasicInfo sealPassAppendix; | |||
/** | |||
* 审核退回意见 | |||
*/ | |||
private String auditBackOpinion; | |||
/** | |||
* 审核退回附件 | |||
*/ | |||
private FileBasicInfo auditBackAppendix; | |||
/** | |||
* 审核驳回意见 | |||
*/ | |||
private String auditRejectOpinion; | |||
/** | |||
* 审核驳回附件 | |||
* 审核信息 | |||
*/ | |||
private FileBasicInfo auditRejectAppendix; | |||
public enum Action{ | |||
//通过、盖章并通过、退回、撤回、驳回,审核意见类型 | |||
pass, seal_pass ,back, withdraw, reject; | |||
} | |||
private ProcessComment auditInfo; | |||
///** | |||
// * 审核通过意见 | |||
// */ | |||
//private String auditPassOpinion; | |||
// | |||
///** | |||
// * 审核通过附件 | |||
// */ | |||
//private FileBasicInfo auditPassAppendix; | |||
///** | |||
// * 盖章通过意见 | |||
// */ | |||
//private String sealPassOpinion; | |||
// | |||
///** | |||
// * 盖章通过附件 | |||
// */ | |||
//private FileBasicInfo sealPassAppendix; | |||
///** | |||
// * 审核退回意见 | |||
// */ | |||
//private String auditBackOpinion; | |||
///** | |||
// * 审核退回附件 | |||
// */ | |||
//private FileBasicInfo auditBackAppendix; | |||
///** | |||
// * 审核驳回意见 | |||
// */ | |||
//private String auditRejectOpinion; | |||
// | |||
///** | |||
// * 审核驳回附件 | |||
// */ | |||
//private FileBasicInfo auditRejectAppendix; | |||
//public enum Action{ | |||
// //通过、盖章并通过、退回、撤回、驳回 | |||
// pass, seal_pass ,back, withdraw, reject; | |||
//} | |||
} |
@@ -10,6 +10,8 @@ import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
* 待办中心-待我处理查询实体信息 | |||
* | |||
@@ -26,10 +28,10 @@ public class ReqToBeProcessedDTO extends PagePo implements Serializable { | |||
private String projectName; | |||
@ApiModelProperty("申报单位名称") | |||
private String reportUnitName; | |||
private String buildUnitName; | |||
@ApiModelProperty("预算年度") | |||
private Integer budgetYear; | |||
private Integer projectYear; | |||
@ApiModelProperty("流程发起开始时间") | |||
private LocalDateTime processLaunchStartTime; | |||
@@ -37,6 +39,7 @@ public class ReqToBeProcessedDTO extends PagePo implements Serializable { | |||
@ApiModelProperty("流程发起结束时间") | |||
private LocalDateTime processLaunchEndTime; | |||
@ApiModelProperty(value = "是否增补项目",allowableValues = "非增补项目 false,增补项目 true") | |||
private Boolean isSupplement; | |||
@ApiModelProperty(value = "是否增补项目",allowableValues = "非增补项目 0,增补项目 1") | |||
@NotNull(message = "是否增补字段不能为空!") | |||
private Integer isSupplement; | |||
} |
@@ -0,0 +1,44 @@ | |||
package com.ningdatech.pmapi.todocenter.model.dto.res; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
import com.alibaba.excel.annotation.ExcelProperty; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
/** | |||
* 待办中心我已处理项目列表导出实体 | |||
* | |||
* @author CMM | |||
* @since 2023/01/19 16:42 | |||
*/ | |||
@Data | |||
@NoArgsConstructor | |||
@AllArgsConstructor | |||
public class ResHandledExportDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ExcelProperty("项目名称") | |||
private String projectName; | |||
@ExcelProperty("申报单位") | |||
private String reportUnitName; | |||
@ExcelProperty("申报金额") | |||
private Integer reportAmount; | |||
@ExcelProperty("预算年度") | |||
private Integer budgetYear; | |||
@ExcelProperty("流程状态") | |||
private String processStatusName; | |||
@ExcelProperty("发起时间") | |||
private LocalDateTime processLaunchTime; | |||
@ExcelProperty("处理时间") | |||
private LocalDateTime processHandleTime; | |||
} |
@@ -1,15 +1,16 @@ | |||
package com.ningdatech.pmapi.todocenter.model.dto.res; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
import com.alibaba.excel.annotation.ExcelProperty; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
/** | |||
* 待办中心待我处理项目列表导出实体 | |||
* 待办中心我发起的项目列表导出实体 | |||
* | |||
* @author CMM | |||
* @since 2023/01/19 16:42 | |||
@@ -17,7 +18,7 @@ import java.time.LocalDateTime; | |||
@Data | |||
@NoArgsConstructor | |||
@AllArgsConstructor | |||
public class ResToBeProjectListExportDTO implements Serializable { | |||
public class ResMySubmittedExportDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ExcelProperty("项目名称") |
@@ -0,0 +1,42 @@ | |||
package com.ningdatech.pmapi.todocenter.model.dto.res; | |||
import com.alibaba.excel.annotation.ExcelProperty; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.io.Serializable; | |||
import java.time.LocalDateTime; | |||
/** | |||
* 待办中心待我处理项目列表导出实体 | |||
* | |||
* @author CMM | |||
* @since 2023/01/19 16:42 | |||
*/ | |||
@Data | |||
@NoArgsConstructor | |||
@AllArgsConstructor | |||
public class ResToBeExportDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ExcelProperty("项目名称") | |||
private String projectName; | |||
@ExcelProperty("申报单位") | |||
private String buildUnitName; | |||
@ExcelProperty("申报金额") | |||
private Integer declareAmount; | |||
@ExcelProperty("预算年度") | |||
private Integer projectYear; | |||
@ExcelProperty("流程状态") | |||
private String processStatusName; | |||
@ExcelProperty("发起时间") | |||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") | |||
private LocalDateTime processLaunchTime; | |||
} |
@@ -1,13 +1,20 @@ | |||
package com.ningdatech.pmapi.todocenter.model.dto.res; | |||
import java.io.Serializable; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.ningdatech.pmapi.user.entity.UserInfo; | |||
import com.wflow.workflow.bean.vo.ProcessInstanceVo; | |||
import com.wflow.workflow.bean.vo.ProcessTaskVo; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Data; | |||
import lombok.NoArgsConstructor; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
/** | |||
* 待办中心-待我处理返回实体信息 | |||
@@ -18,26 +25,27 @@ import lombok.NoArgsConstructor; | |||
@Data | |||
@NoArgsConstructor | |||
@AllArgsConstructor | |||
@ExcelIgnoreUnannotated | |||
public class ResToBeProcessedDTO implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("项目ID") | |||
private String projectId; | |||
@ApiModelProperty("流程实例编号") | |||
private String instanceCode; | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
@ApiModelProperty("申报单位ID") | |||
private String reportUnitId; | |||
private String buildUnitId; | |||
@ApiModelProperty("申报单位名称") | |||
private String reportUnitName; | |||
private String buildUnitName; | |||
@ApiModelProperty("申报金额") | |||
private Integer reportAmount; | |||
private BigDecimal declareAmount; | |||
@ApiModelProperty("预算年度") | |||
private Integer budgetYear; | |||
private Integer projectYear; | |||
@ApiModelProperty("流程状态") | |||
private Integer processStatus; | |||
@@ -46,8 +54,19 @@ public class ResToBeProcessedDTO implements Serializable { | |||
private String processStatusName; | |||
@ApiModelProperty("流程发起时间") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") | |||
private LocalDateTime processLaunchTime; | |||
@ApiModelProperty("流程处理时间") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") | |||
private LocalDateTime processHandleTime; | |||
@ApiModelProperty("流程任务信息") | |||
private ProcessTaskVo processTaskInfo; | |||
@ApiModelProperty("流程实例信息") | |||
private ProcessInstanceVo processInstanceInfo; | |||
@ApiModelProperty("流程发起人信息") | |||
private UserInfo owner; | |||
} |
@@ -0,0 +1,13 @@ | |||
package com.ningdatech.pmapi.todocenter.zwdd.model; | |||
import lombok.Data; | |||
/** | |||
* 消息内容 | |||
* @author CMM | |||
* @since 2023/02/01 14:54 | |||
*/ | |||
@Data | |||
public class MessageContent { | |||
private String content; | |||
} |
@@ -0,0 +1,17 @@ | |||
package com.ningdatech.pmapi.todocenter.zwdd.model; | |||
import lombok.Data; | |||
/** | |||
* 文本消息 | |||
* @author CMM | |||
* @since 2023/02/01 14:53 | |||
*/ | |||
@Data | |||
public class MessageText { | |||
private String msgType; | |||
private MessageContent text; | |||
} |
@@ -3,6 +3,9 @@ package com.ningdatech.pmapi.user.service; | |||
import com.ningdatech.pmapi.user.entity.UserInfo; | |||
import com.baomidou.mybatisplus.extension.service.IService; | |||
import java.util.Map; | |||
import java.util.Set; | |||
/** | |||
* <p> | |||
* 用户信息表 服务类 | |||
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||
*/ | |||
public interface IUserInfoService extends IService<UserInfo> { | |||
Map<Long, UserInfo> getUserMapByIds(Set<String> staterUsers); | |||
} |
@@ -4,8 +4,17 @@ import com.ningdatech.pmapi.user.entity.UserInfo; | |||
import com.ningdatech.pmapi.user.mapper.UserInfoMapper; | |||
import com.ningdatech.pmapi.user.service.IUserInfoService; | |||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
import lombok.RequiredArgsConstructor; | |||
import org.apache.catalina.User; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Set; | |||
import java.util.stream.Collectors; | |||
/** | |||
* <p> | |||
* 用户信息表 服务实现类 | |||
@@ -15,6 +24,12 @@ import org.springframework.stereotype.Service; | |||
* @since 2023-01-04 | |||
*/ | |||
@Service | |||
@RequiredArgsConstructor | |||
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements IUserInfoService { | |||
private final UserInfoMapper userInfoMapper; | |||
@Override | |||
public Map<Long, UserInfo> getUserMapByIds(Set<String> staterUsers) { | |||
List<UserInfo> userInfos = userInfoMapper.selectBatchIds(staterUsers); | |||
return userInfos.stream().collect(Collectors.toMap(UserInfo::getId,u -> u )); | |||
} | |||
} |
@@ -153,4 +153,19 @@ sa-token: | |||
# token风格 | |||
token-style: uuid | |||
# 是否输出操作日志 | |||
is-log: false | |||
is-log: false | |||
#专有钉钉 | |||
ding: | |||
#扫码 | |||
app-auth-key: file-manage_dingoa-zte2LbiAfIj | |||
app-auth-secret: H794aFZf271QbfUr50pbBpBTlXSrWIP71q9RTR34 | |||
#扫码 | |||
app-sso-auth-key: fgdn_wjlzjkxt_hz | |||
app-sso-auth-secret: dafe1e6f7d424032acb81f5c2a797a1f | |||
#免登/获取信息 | |||
app-key: file-manage-4Mjx9358wuxjyYFjY3 | |||
app-secret: hE41938wqyQ5LOpc1QDRA9e7gb5YugoClWD3nY4O | |||
#专有钉钉在开发管理工作台,右键查看网页源码realmId: '31141',浙政钉固定196729 | |||
tenantId: 31141 | |||
domain: openplatform.dg-work.cn |