Browse Source

待办中心-发送工作通知测试

master
CMM 1 year ago
parent
commit
90800bbd9a
3 changed files with 21 additions and 15 deletions
  1. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java
  2. +14
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  3. +4
    -2
      pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java

+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java View File

@@ -66,8 +66,9 @@ public class TodoCenterController {
*/
@GetMapping("/progress/{instanceId}/{nodeId}")
public ApiResponse<ProcessProgressDetailVo> getProcessDetail(@PathVariable String instanceId,
@PathVariable(required = false) String nodeId) {
return ApiResponse.ofSuccess(todoCenterManage.getProcessDetail(nodeId, instanceId));
@PathVariable(required = false) String nodeId,
@PathVariable Long projectId) {
return ApiResponse.ofSuccess(todoCenterManage.getProcessDetail(nodeId, instanceId, projectId));
}

/**


+ 14
- 11
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -791,6 +791,17 @@ public class TodoCenterManage {
.singleResult();
// 获取前一个审核节点审核人信息
String beforeUserId = lastInstance.getAssignee();
// 获取当前审核节点审核人信息
String currentUserId = task.getAssignee();
//HashSet<String> userSet = new HashSet<>();
//userSet.add(beforeUserId);
//userSet.add(currentUserId);
//Map<Long, UserInfoVO> userMap = userInfoService.getUserMapByIds(userSet);
//UserInfoVO beforeUserInfoVO = userMap.get(Long.valueOf(beforeUserId));
//UserInfoVO currentUserInfoVO = userMap.get(Long.valueOf(currentUserId));
//String beforeUserOrgCode = beforeUserInfoVO.getOrganizationCode();
//String currentUserOrgCode = currentUserInfoVO.getOrganizationCode();
//Boolean orgFlag = currentUserOrgCode.equals(beforeUserOrgCode) ? true : false;

// TODO 判断前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常
Boolean orgFlag = true;
@@ -903,7 +914,7 @@ public class TodoCenterManage {
* @param instanceId 流程实例ID
* @return 流程进度及表单详情
*/
public ProcessProgressDetailVo getProcessDetail(String nodeId, String instanceId) {
public ProcessProgressDetailVo getProcessDetail(String nodeId, String instanceId, Long projectId) {
HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery()
.processInstanceId(instanceId)
.singleResult();
@@ -979,16 +990,8 @@ public class TodoCenterManage {
.progress(taskRecords)
.build();
//res.setStartUser(userInfoVO);
if (Objects.isNull(instance.getEndActivityId())) {
res.setStatus(ProcessStatusEnum.UNDER_REVIEW.name());
} else if (HisProInsEndActId.BACK.equals(instance.getEndActivityId())) {
// TODO 被退回的审核节点状态这里只是暂时这么判断,具体怎么保存这个退回状态,后面讨论
res.setStatus(ProcessStatusEnum.BE_BACKED.name());
} else if (HisProInsEndActId.REJECT.equals(instance.getEndActivityId())) {
res.setStatus(ProcessStatusEnum.BE_REJECTED.name());
} else if (HisProInsEndActId.END.equals(instance.getEndActivityId())) {
res.setStatus(ProcessStatusEnum.APPROVED.name());
}
Project project = projectService.getById(projectId);
res.setStatus(ProcessStatusEnum.getDescByCode(project.getProcessStatus()));
return res;
}



+ 4
- 2
pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java View File

@@ -27,9 +27,11 @@ public class TodoCenterTest extends AppTests {
private ZwddClient zwddClient;
@Test
public void sendWorkNoticeTest(){
String msg = String.format(PASS_MSG_TEMPLATE, "发改委", "测试项目2");
// String msg = String.format(PASS_MSG_TEMPLATE, "发改委", "0216-4-测试项目");
String msg = "发改委的0216-6-测试项目需要您审核";
log.info("开始发送工作通知");
zwddClient.sendWorkNotice("843622","666",msg);
zwddClient.sendWorkNotice("846085","0216-7",msg);
// zwddClient.sendWorkNotice("829728","0216-5",msg);
log.info("发送工作通知结束");
}
}

Loading…
Cancel
Save