Browse Source

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

master
CMM 1 year ago
parent
commit
1b301ac8a4
3 changed files with 53 additions and 8 deletions
  1. +14
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  2. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java
  3. +35
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java

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

@@ -458,17 +458,23 @@ public class TodoCenterManage {
* @param param 参数
*/
private void doSealPass(Task task, Long userId, ReqProcessHandlerDTO param) {
String processInstanceId = task.getProcessInstanceId();
// 获取当前申报项目
Project declaredProject = projectService
.getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId()));
String projectName = declaredProject.getProjectName();

Map<String, Object> var = new HashMap<>(16);
var.put("approve_" + task.getId(), param.getAction());

// 保存审核意见
if (hasComment(param.getAuditInfo())) {
// 执行自定义的保存评论的功能
managementService.executeCommand(new SaveCommentCmd(param.getTaskId(), param.getInstanceId(),
String.valueOf(userId), JSONObject.toJSONString(param.getAuditInfo())));
}
// TODO 判断项目申报单位级别,区县单位申报有上级主管单位意见栏,市级单位没有

// TODO 市级单位:为大数据局;区县单位:为大数据中心(根据附件区分?)
// 获取当前申报项目
Project declaredProject = projectService
.getOne(Wrappers.lambdaQuery(Project.class).eq(Project::getInstCode, task.getProcessInstanceId()));
// 更新项目状态到下一个状态
updatePassProjectStatus(userId, declaredProject);
taskService.complete(param.getTaskId(), var);
}

@@ -554,7 +560,7 @@ public class TodoCenterManage {
// 获取浙政钉用户ID
UserInfo auditUserInfo = userInfoService.getById(Long.valueOf(nextUserId));
WorkNoticeInfo sendWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo);
String msg = String.format(PASS_MSG_TEMPLATE, null, projectName);
String msg = String.format(PASS_MSG_TEMPLATE, sendWorkNoticeInfo.getOrganizationName(), projectName);
zwddClient.sendWorkNotice(sendWorkNoticeInfo.getReceiverUserId(),sendWorkNoticeInfo.getBizMsgId(),msg);
} else {
// 若没有,向发起人发送浙政钉工作通知:【项目名称】已通过【流程名称】,请及时开始下一步操作。
@@ -579,7 +585,7 @@ public class TodoCenterManage {
* @author CMM
* @since 2023/02/15 14:04
*/
private WorkNoticeInfo getSendWorkNoticeInfo(UserInfo auditUserInfo) {
public WorkNoticeInfo getSendWorkNoticeInfo(UserInfo auditUserInfo) {
WorkNoticeInfo workNoticeInfo = new WorkNoticeInfo();
Long accountId = auditUserInfo.getAccountId();
if (Objects.isNull(accountId)){


+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java View File

@@ -2,8 +2,10 @@ package com.ningdatech.pmapi.user.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
@@ -20,6 +22,8 @@ import java.time.LocalDateTime;
@Builder
@Data
@ApiModel(value = "NdUserInfo对象", description = "")
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo implements Serializable {

private static final long serialVersionUID = 1L;


+ 35
- 0
pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java View File

@@ -0,0 +1,35 @@
package com.ningdatech.pmapi.todocenter;

import com.ningdatech.pmapi.AppTests;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import com.ningdatech.pmapi.todocenter.manage.TodoCenterManage;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.zwdd.client.ZwddClient;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static com.ningdatech.pmapi.todocenter.constant.WorkNotice.PASS_MSG_TEMPLATE;

/**
* 待办中心测试
*
* @author CMM
* @since 2023/02/15 22:03
*/
@Slf4j
public class TodoCenterTest extends AppTests {

@Autowired
private TodoCenterManage todoCenterManage;

@Autowired
private ZwddClient zwddClient;
@Test
public void sendWorkNoticeTest(){
String msg = String.format(PASS_MSG_TEMPLATE, "发改委", "测试项目2");
log.info("开始发送工作通知");
zwddClient.sendWorkNotice("843622","666",msg);
log.info("发送工作通知结束");
}
}

Loading…
Cancel
Save