@@ -1,5 +1,6 @@ | |||||
package com.hz.pm.api.external.model.dto; | package com.hz.pm.api.external.model.dto; | ||||
import lombok.Builder; | |||||
import lombok.Data; | import lombok.Data; | ||||
/** | /** | ||||
@@ -11,6 +12,7 @@ import lombok.Data; | |||||
* @since 21:52 2024/3/12 | * @since 21:52 2024/3/12 | ||||
*/ | */ | ||||
@Data | @Data | ||||
@Builder | |||||
public class MhZwddWorkNoticeDTO { | public class MhZwddWorkNoticeDTO { | ||||
private String clientId; | private String clientId; | ||||
@@ -71,7 +71,7 @@ public class MHTodoClient { | |||||
MhTodoRetDTO retData = JSON.parseObject(responseResult, new TypeReference<MhTodoRetDTO>() { | MhTodoRetDTO retData = JSON.parseObject(responseResult, new TypeReference<MhTodoRetDTO>() { | ||||
}); | }); | ||||
if (retData.getCode() != 0 || StrUtil.isBlank(retData.getData())) { | if (retData.getCode() != 0 || StrUtil.isBlank(retData.getData())) { | ||||
log.warn("发送待办失败:{}", map); | |||||
log.warn("发送待办失败:{} {}", map, retData); | |||||
throw BizException.wrap("发送待办失败"); | throw BizException.wrap("发送待办失败"); | ||||
} | } | ||||
MhTodoRecord todo = new MhTodoRecord(); | MhTodoRecord todo = new MhTodoRecord(); | ||||
@@ -0,0 +1,34 @@ | |||||
package com.hz.pm.api.external.todo.dto; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
/** | |||||
* <p> | |||||
* MhTodoExtraParamDTO | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 11:09 2024/3/13 | |||||
*/ | |||||
@Data | |||||
@Builder | |||||
public class MhTodoExtraParamDTO { | |||||
private Long userId; | |||||
private String userName; | |||||
private String instanceId; | |||||
private Long projectId; | |||||
private String taskId; | |||||
private Long bidId; | |||||
private String nodeId; | |||||
private String path; | |||||
} |
@@ -1,16 +1,17 @@ | |||||
package com.hz.pm.api.scheduler.listener; | package com.hz.pm.api.scheduler.listener; | ||||
import cn.hutool.core.text.CharSequenceUtil; | import cn.hutool.core.text.CharSequenceUtil; | ||||
import cn.hutool.core.util.StrUtil; | |||||
import cn.hutool.extra.spring.SpringUtil; | import cn.hutool.extra.spring.SpringUtil; | ||||
import cn.hutool.json.JSONObject; | |||||
import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | import com.hz.pm.api.common.enumeration.ProjectProcessStageEnum; | ||||
import com.hz.pm.api.common.helper.UserInfoHelper; | import com.hz.pm.api.common.helper.UserInfoHelper; | ||||
import com.hz.pm.api.common.helper.WflowHelper; | import com.hz.pm.api.common.helper.WflowHelper; | ||||
import com.hz.pm.api.external.MhApiClient; | import com.hz.pm.api.external.MhApiClient; | ||||
import com.hz.pm.api.external.model.dto.MhZwddWorkNoticeDTO; | import com.hz.pm.api.external.model.dto.MhZwddWorkNoticeDTO; | ||||
import com.hz.pm.api.external.todo.MHTodoClient; | import com.hz.pm.api.external.todo.MHTodoClient; | ||||
import com.hz.pm.api.external.todo.dto.MhTodoExtraParamDTO; | |||||
import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum; | import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum; | ||||
import com.hz.pm.api.projectdeclared.model.entity.PurchaseInst; | |||||
import com.hz.pm.api.projectdeclared.service.IPurchaseInstService; | |||||
import com.hz.pm.api.projectlib.model.entity.Project; | import com.hz.pm.api.projectlib.model.entity.Project; | ||||
import com.hz.pm.api.projectlib.model.entity.ProjectInst; | import com.hz.pm.api.projectlib.model.entity.ProjectInst; | ||||
import com.hz.pm.api.projectlib.service.IProjectInstService; | import com.hz.pm.api.projectlib.service.IProjectInstService; | ||||
@@ -53,6 +54,7 @@ public class TaskCreatedListener implements FlowableEventListener { | |||||
private final MHTodoClient mhTodoClient; | private final MHTodoClient mhTodoClient; | ||||
private final MhApiClient mhApiClient; | private final MhApiClient mhApiClient; | ||||
private final UserInfoHelper userInfoHelper; | private final UserInfoHelper userInfoHelper; | ||||
private final IPurchaseInstService purchaseInstService; | |||||
@Override | @Override | ||||
public void onEvent(FlowableEvent event) { | public void onEvent(FlowableEvent event) { | ||||
@@ -75,25 +77,40 @@ public class TaskCreatedListener implements FlowableEventListener { | |||||
if (!procType.isPresent()) { | if (!procType.isPresent()) { | ||||
return; | return; | ||||
} | } | ||||
switch (procType.get()) { | |||||
ProjectProcessStageEnum processStage = procType.get(); | |||||
switch (processStage) { | |||||
case XC_APPROVAL_PROCESS: | case XC_APPROVAL_PROCESS: | ||||
case PROJECT_RECORD_APPROVAL_PROCESS: | case PROJECT_RECORD_APPROVAL_PROCESS: | ||||
case ACCEPTANCE_DECLARATION_APPROVAL_PROCESS: | case ACCEPTANCE_DECLARATION_APPROVAL_PROCESS: | ||||
// 发送信产平台待办 | // 发送信产平台待办 | ||||
MHTodoTypeEnum todoType = getMhTodoTypeEnum(procType.get()); | MHTodoTypeEnum todoType = getMhTodoTypeEnum(procType.get()); | ||||
JSONObject paramObj = new JSONObject(); | |||||
paramObj.set("projectId", projectInst.getProjectId()); | |||||
paramObj.set("instId", taskEntity.getProcessInstanceId()); | |||||
paramObj.set("taskId", taskEntity.getId()); | |||||
String content = String.format("【%s】的【%s】需要您审核,请及时处理。", | String content = String.format("【%s】的【%s】需要您审核,请及时处理。", | ||||
project.getProjectName(), procType.get().getDesc()); | project.getProjectName(), procType.get().getDesc()); | ||||
MhTodoExtraParamDTO paramObj = MhTodoExtraParamDTO.builder() | |||||
.projectId(project.getId()) | |||||
.taskId(taskEntity.getId()) | |||||
.instanceId(taskEntity.getProcessInstanceId()) | |||||
.nodeId(taskEntity.getTaskDefinitionId()) | |||||
.userId(assignee.getUserId()) | |||||
.userName(assignee.getRealName()) | |||||
.path("/toDoCenter/handleDuringExamine") | |||||
.build(); | |||||
if (processStage.equals(ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS) | |||||
|| processStage.equals(ProjectProcessStageEnum.XC_APPROVAL_PROCESS)) { | |||||
PurchaseInst purchaseInst = purchaseInstService.getByProjectIdAndInstCode(paramObj.getProjectId(), procInstId); | |||||
if (purchaseInst == null) { | |||||
return; | |||||
} | |||||
paramObj.setBidId(purchaseInst.getBidId()); | |||||
} | |||||
mhTodoClient.addTodo(paramObj, assignee, todoType, taskEntity.getId(), content); | mhTodoClient.addTodo(paramObj, assignee, todoType, taskEntity.getId(), content); | ||||
// 发送浙政钉工作通知 | // 发送浙政钉工作通知 | ||||
if (assignee.getAccountId() != null) { | if (assignee.getAccountId() != null) { | ||||
MhZwddWorkNoticeDTO notice = new MhZwddWorkNoticeDTO(); | |||||
notice.setContent(content); | |||||
notice.setTitle(todoType.getVal()); | |||||
notice.setTargetUser(assignee.getMhUserId()); | |||||
MhZwddWorkNoticeDTO notice = MhZwddWorkNoticeDTO.builder() | |||||
.content(content) | |||||
.title(todoType.getVal()) | |||||
.targetUser(assignee.getMhUserId()) | |||||
.build(); | |||||
mhApiClient.sendZwddWorkNotice(notice); | mhApiClient.sendZwddWorkNotice(notice); | ||||
} | } | ||||
break; | break; | ||||
@@ -0,0 +1,39 @@ | |||||
package com.hz.pm.api.todocenter; | |||||
import cn.hutool.json.JSONObject; | |||||
import com.hz.pm.api.AppTests; | |||||
import com.hz.pm.api.common.helper.UserInfoHelper; | |||||
import com.hz.pm.api.external.todo.MHTodoClient; | |||||
import com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum; | |||||
import com.hz.pm.api.user.security.model.UserFullInfoDTO; | |||||
import org.junit.Test; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
/** | |||||
* <p> | |||||
* MhApiClientTest | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 10:06 2024/3/13 | |||||
*/ | |||||
public class MhApiClientTest extends AppTests { | |||||
@Autowired | |||||
private MHTodoClient mhTodoClient; | |||||
@Autowired | |||||
private UserInfoHelper userInfoHelper; | |||||
@Test | |||||
public void sendTodo() { | |||||
UserFullInfoDTO assignee = userInfoHelper.getUserFullInfo("347873"); | |||||
JSONObject paramObj = new JSONObject(); | |||||
paramObj.set("projectId", 1213); | |||||
paramObj.set("instId", 1213); | |||||
paramObj.set("taskId", 1213); | |||||
String content = String.format("【%s】的【%s】需要您审核,请及时处理。", | |||||
"市住保房管局深化信创项目", "立项备案审批"); | |||||
mhTodoClient.addTodo(paramObj, assignee, MHTodoTypeEnum.XCFHX_INSPECT_AUDIT, "1212121", content); | |||||
} | |||||
} |
@@ -23,7 +23,7 @@ spring: | |||||
max-active: 200 | max-active: 200 | ||||
max-idle: 500 | max-idle: 500 | ||||
min-idle: 8 | min-idle: 8 | ||||
max-wait: 60000 | |||||
max-wait: 10000 | |||||
application: | application: | ||||
name: hzpm | name: hzpm | ||||
jackson: | jackson: | ||||
@@ -43,7 +43,7 @@ spring: | |||||
datasource: | datasource: | ||||
type: com.zaxxer.hikari.HikariDataSource | type: com.zaxxer.hikari.HikariDataSource | ||||
driverClassName: dm.jdbc.driver.DmDriver | driverClassName: dm.jdbc.driver.DmDriver | ||||
url: jdbc:dm://47.98.125.47:5236/HZ_PROJECT_MANAGEMENT1?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 | |||||
url: jdbc:dm://47.98.125.47:5236/HZ_PROJECT_MANAGEMENT1?nullToEmpty=true&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 | |||||
username: SYSDBA | username: SYSDBA | ||||
password: SYSDBA | password: SYSDBA | ||||
# 数据源 | # 数据源 | ||||
@@ -51,9 +51,9 @@ spring: | |||||
# 是客户端等待连接池连接的最大毫秒数 | # 是客户端等待连接池连接的最大毫秒数 | ||||
connection-timeout: 30000 | connection-timeout: 30000 | ||||
# 是允许连接在连接池中空闲的最长时间 | # 是允许连接在连接池中空闲的最长时间 | ||||
minimum-idle: 5 | |||||
minimum-idle: 10 | |||||
# 配置最大池大小 | # 配置最大池大小 | ||||
maximum-pool-size: 300 | |||||
maximum-pool-size: 20 | |||||
# 是允许连接在连接池中空闲的最长时间(以毫秒为单位) | # 是允许连接在连接池中空闲的最长时间(以毫秒为单位) | ||||
idle-timeout: 60000 | idle-timeout: 60000 | ||||
# 池中连接关闭后的最长生命周期(以毫秒为单位) | # 池中连接关闭后的最长生命周期(以毫秒为单位) | ||||
@@ -118,7 +118,6 @@ log: | |||||
swagger: | swagger: | ||||
enabled: true | enabled: true | ||||
flowable: | flowable: | ||||
async-executor-activate: true | async-executor-activate: true | ||||
#关闭一些不需要的功能服务 | #关闭一些不需要的功能服务 | ||||
@@ -247,16 +246,18 @@ sync-mh-user: | |||||
sync-mh-company: | sync-mh-company: | ||||
open: false | open: false | ||||
mh: | mh: | ||||
# sso: | |||||
# client-id: ningda-74a5e5da-3bc3-414a-b9e6-004b7d87e310 | |||||
# client-secret: ningda-df746ce4-0c79-4242-b3c7-90ff8630c9742c6727cd-3ae7-48ae-87ad-2b39188ebabd | |||||
# api-host: http://10.54.38.13:8081/mh-gateway/auth-single | |||||
sso: | |||||
client-id: ningda-74a5e5da-3bc3-414a-b9e6-004b7d87e310 | |||||
client-secret: ningda-df746ce4-0c79-4242-b3c7-90ff8630c9742c6727cd-3ae7-48ae-87ad-2b39188ebabd | |||||
api-host: https://hzszxc.hzswb.cn:8443/test/mh-gateway/auth-single | |||||
expert-qr-code-url: https://jiema.wwei.cn/uploads/2023/12/28/658d7a3f15f06.jpg | expert-qr-code-url: https://jiema.wwei.cn/uploads/2023/12/28/658d7a3f15f06.jpg | ||||
file: | file: | ||||
down-url: https://weixin.hzszxc.hzswb.cn:8443/mh-gateway/oss/oss/previewFileLogin | |||||
detail-url: https://weixin.hzszxc.hzswb.cn:8443/mh-gateway/oss/ossfile/getFileInfoList | |||||
down-url: https://weixin.hzszxc.hzswb.cn:8443/test/mh-gateway/oss/oss/previewFileLogin | |||||
detail-url: https://weixin.hzszxc.hzswb.cn:8443/test/mh-gateway/oss/ossfile/getFileInfoList | |||||
auth-code: | auth-code: | ||||
secret-key: nqkmzqojg5j4eiypr3rb8s7nb4noa8b2 | secret-key: nqkmzqojg5j4eiypr3rb8s7nb4noa8b2 | ||||
agent-login: | agent-login: | ||||
proxy: | proxy: | ||||
secret-key: nqkwiqojg7g4eiypr3rb8s7nb4noa8b2 | |||||
secret-key: nqkwiqojg7g4eiypr3rb8s7nb4noa8b2 | |||||
sms: | |||||
client-url: http://10.54.38.13:8081/mh-gateway/auth-single |