REQ-2135: 方方面面
This commit is contained in:
parent
c608e745a1
commit
5c94119d22
@ -4,10 +4,14 @@ import cn.axzo.basics.common.BeanMapper;
|
||||
import cn.axzo.basics.profiles.api.UserProfileServiceApi;
|
||||
import cn.axzo.basics.profiles.dto.basic.PersonProfileDto;
|
||||
import cn.axzo.msg.center.api.request.v3.SearchPendingMessageReq;
|
||||
import cn.axzo.msg.center.api.request.v3.SearchTodoLogReq;
|
||||
import cn.axzo.msg.center.api.response.v3.SearchPendingMessageResp;
|
||||
import cn.axzo.msg.center.api.response.v3.SearchTodoLogResponse;
|
||||
import cn.axzo.msg.center.common.utils.BizAssertions;
|
||||
import cn.axzo.msg.center.dal.TodoDao;
|
||||
import cn.axzo.msg.center.dal.TodoLogDao;
|
||||
import cn.axzo.msg.center.domain.entity.Todo;
|
||||
import cn.axzo.msg.center.domain.entity.TodoLog;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@ -24,9 +28,29 @@ import java.util.List;
|
||||
public class TodoSearchService {
|
||||
|
||||
private final TodoDao todoDao;
|
||||
private final TodoLogDao todoLogDao;
|
||||
private final UserProfileServiceApi userProfileServiceApi;
|
||||
|
||||
public List<SearchPendingMessageResp> search(SearchPendingMessageReq req) {
|
||||
public List<SearchTodoLogResponse> searchTodoLogs(SearchTodoLogReq req) {
|
||||
if (req.getLimit() >= 100) {
|
||||
req.setLimit(100);
|
||||
}
|
||||
List<TodoLog> logs = todoLogDao.lambdaQuery()
|
||||
.eq(StringUtils.isNotBlank(req.getSrcTemplateCode()), TodoLog::getSrcTemplateCode, req.getSrcTemplateCode())
|
||||
.eq(StringUtils.isNotBlank(req.getTemplateCode()), TodoLog::getTemplateCode, req.getTemplateCode())
|
||||
.eq(StringUtils.isNotBlank(req.getIdentityCode()), TodoLog::getIdentityCode, req.getIdentityCode())
|
||||
.eq(StringUtils.isNotBlank(req.getBizCode()), TodoLog::getBizCode, req.getBizCode())
|
||||
.eq(StringUtils.isNotBlank(req.getSubBizCode()), TodoLog::getSubBizCode, req.getSubBizCode())
|
||||
.eq(StringUtils.isNotBlank(req.getRequestNo()), TodoLog::getRequestNo, req.getRequestNo())
|
||||
.eq(req.getLogType() != null, TodoLog::getLogType, req.getLogType())
|
||||
.like(StringUtils.isNotBlank(req.getContext()), TodoLog::getContext, req.getContext())
|
||||
.orderByDesc(TodoLog::getId)
|
||||
.last("LIMIT " + req.getLimit())
|
||||
.list();
|
||||
return BeanMapper.copyList(logs, SearchTodoLogResponse.class);
|
||||
}
|
||||
|
||||
public List<SearchPendingMessageResp> searchTodos(SearchPendingMessageReq req) {
|
||||
if (req.getLimit() >= 100) {
|
||||
req.setLimit(100);
|
||||
}
|
||||
|
||||
@ -51,9 +51,12 @@ public class TodoMappingProcessor implements EventMappingProcessor {
|
||||
request.setPromoter(sendReqV3.getSender() == null ? null : sendReqV3.getSender().asV1());
|
||||
request.setExecutor(convertReceivers(sendReqV3.getReceivers()));
|
||||
request.setTemplateCode(template.getCode());
|
||||
request.setWorkspaceId(sendReqV3.getReceiversWorkspaceId());
|
||||
request.setOuId(sendReqV3.getReceiversOuId());
|
||||
request.setWorkspaceId(sendReqV3.getReceiversWorkspaceId());
|
||||
request.setPromoterOuId(sendReqV3.getSenderOuId());
|
||||
request.setPromoterWorkspaceId(sendReqV3.getSenderWorkspaceId());
|
||||
request.setBizCode(sendReqV3.getBizCode());
|
||||
request.setOrgType(sendReqV3.getReceiversOrgType());
|
||||
request.setBizExtParams(sendReqV3.getBizExtParams() == null
|
||||
? null : sendReqV3.getBizExtParams().toJSONString());
|
||||
request.setRouterParams(sendReqV3.getRouterParams() == null
|
||||
|
||||
@ -4,6 +4,7 @@ import cn.axzo.msg.center.api.MessageAPIV3;
|
||||
import cn.axzo.msg.center.api.request.v3.MessageSendReqV3;
|
||||
import cn.axzo.msg.center.api.request.v3.SearchMessageReqV3;
|
||||
import cn.axzo.msg.center.api.request.v3.SearchPendingMessageReq;
|
||||
import cn.axzo.msg.center.api.request.v3.SearchTodoLogReq;
|
||||
import cn.axzo.msg.center.inside.notices.service.impl.TodoSearchService;
|
||||
import cn.axzo.msg.center.inside.notices.service.impl.v3.MessageRecordServiceV3;
|
||||
import cn.axzo.msg.center.message.domain.param.PendingMessagePushParam;
|
||||
@ -33,14 +34,12 @@ public class PrivateMessageController {
|
||||
private final TodoManager todoManager;
|
||||
|
||||
@PostMapping("/sendPendingMessage")
|
||||
public Object sendPendingMessage(
|
||||
@RequestBody @Valid PendingMessagePushParam request) {
|
||||
public Object sendPendingMessage(@RequestBody @Valid PendingMessagePushParam request) {
|
||||
return todoManager.send(request);
|
||||
}
|
||||
|
||||
@PostMapping("/sendImMessage")
|
||||
public Object sendImMessage(
|
||||
@RequestBody @Valid MessageSendReqV3 request) {
|
||||
public Object sendImMessage(@RequestBody @Valid MessageSendReqV3 request) {
|
||||
return messageAPIV3.send(request);
|
||||
}
|
||||
|
||||
@ -49,10 +48,14 @@ public class PrivateMessageController {
|
||||
return messageRecordServiceV3.search(req);
|
||||
}
|
||||
|
||||
@PostMapping("/searchTodos")
|
||||
public Object searchTodos(@RequestBody @Valid SearchPendingMessageReq req) {
|
||||
return todoSearchService.searchTodos(req);
|
||||
}
|
||||
|
||||
@PostMapping("/searchPendingRecords")
|
||||
public Object searchPendingRecords(@RequestBody @Valid SearchPendingMessageReq req) {
|
||||
return todoSearchService.search(req);
|
||||
@PostMapping("/searchTodoLogs")
|
||||
public Object searchTodoLogs(@RequestBody @Valid SearchTodoLogReq req) {
|
||||
return todoSearchService.searchTodoLogs(req);
|
||||
}
|
||||
|
||||
}
|
||||
@ -93,11 +93,15 @@ public class PendingMessageDTO implements Serializable {
|
||||
private String bizFlag;
|
||||
/**
|
||||
* 工作台id
|
||||
* <p>Deprecated, used {@link #executorWorkspaceId} instead
|
||||
*/
|
||||
@Deprecated
|
||||
private Long workspaceId;
|
||||
/**
|
||||
* 工作台名称
|
||||
* <p>Deprecated, used {@link #executorWorkspaceName} instead
|
||||
*/
|
||||
@Deprecated
|
||||
private String workspaceName;
|
||||
/**
|
||||
* 类型
|
||||
@ -105,7 +109,9 @@ public class PendingMessageDTO implements Serializable {
|
||||
private OrganizationTypeEnum organizationType;
|
||||
/**
|
||||
* 待办发起人的
|
||||
* <p>Deprecated, used {@link #executorOuId} instead
|
||||
*/
|
||||
@Deprecated
|
||||
private Long ouId;
|
||||
/**
|
||||
* 业务类型
|
||||
@ -154,8 +160,33 @@ public class PendingMessageDTO implements Serializable {
|
||||
* 是否已读 (抄送)
|
||||
*/
|
||||
private Boolean isRead;
|
||||
/**
|
||||
* 发起人工作台id
|
||||
*/
|
||||
private Long promoterWorkspaceId;
|
||||
/**
|
||||
* 发起人工作台名称
|
||||
*/
|
||||
private String promoterWorkspaceName;
|
||||
/**
|
||||
* 发起人企业id
|
||||
*/
|
||||
private Long promoterOuId;
|
||||
/**
|
||||
* 接收人工作台id
|
||||
*/
|
||||
private Long executorWorkspaceId;
|
||||
/**
|
||||
* 接收人工作台名称
|
||||
*/
|
||||
private String executorWorkspaceName;
|
||||
/**
|
||||
* 接收人企业id
|
||||
*/
|
||||
private Long executorOuId;
|
||||
|
||||
|
||||
@Deprecated
|
||||
public static PendingMessageDTO from(PendingMessageRecord pendingMessageRecord) {
|
||||
// 代办发起者信息
|
||||
PersonDTO promoter = PersonDTO.builder()
|
||||
@ -206,6 +237,18 @@ public class PendingMessageDTO implements Serializable {
|
||||
|
||||
public PendingMessageResponse toResponse(TerminalTypeEnum terminalType) {
|
||||
return PendingMessageResponse.builder()
|
||||
// 发起人单位、项目信息
|
||||
.promoterOuId(promoterOuId)
|
||||
.promoterWorkspaceId(promoterWorkspaceId)
|
||||
.promoterWorkspaceName(promoterWorkspaceName)
|
||||
// 接收者单位、项目信息
|
||||
.executorOuId(executorOuId)
|
||||
.executorWorkspaceId(executorWorkspaceId)
|
||||
.executorWorkspaceName(executorWorkspaceName)
|
||||
//页面展示
|
||||
.ouId(this.promoterOuId)
|
||||
.workspaceId(promoterWorkspaceId)
|
||||
.workspaceName(promoterWorkspaceName)
|
||||
.isRead(isRead)
|
||||
.todoType(todoType)
|
||||
.templateCategory(templateCategory)
|
||||
@ -226,9 +269,6 @@ public class PendingMessageDTO implements Serializable {
|
||||
.bizFlag(this.bizFlag)
|
||||
.state(this.getState())
|
||||
.bizCategory(this.bizCategory)
|
||||
.workspaceId(this.workspaceId)
|
||||
.workspaceName(this.workspaceName)
|
||||
.ouId(this.ouId)
|
||||
.createTimestamp(DateFormatUtil.toTimestamp(this.createTime))
|
||||
.updateTimestamp(DateFormatUtil.toTimestamp(this.updateTime))
|
||||
.deadlineTimestamp(DateFormatUtil.toTimestamp(this.deadline))
|
||||
|
||||
@ -3,6 +3,7 @@ package cn.axzo.msg.center.message.domain.param;
|
||||
import cn.axzo.core.utils.converter.BeanConverter;
|
||||
import cn.axzo.msg.center.api.request.v3.PendingSendInfo;
|
||||
import cn.axzo.msg.center.service.dto.PersonDTO;
|
||||
import cn.axzo.msg.center.service.enums.OrganizationTypeEnum;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessagePushRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -29,6 +30,10 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class PendingMessagePushParam extends PendingSendInfo implements Serializable {
|
||||
|
||||
/**
|
||||
* 待办所属组织类型
|
||||
*/
|
||||
private OrganizationTypeEnum orgType;
|
||||
/**
|
||||
* 发起者
|
||||
*/
|
||||
@ -42,15 +47,22 @@ public class PendingMessagePushParam extends PendingSendInfo implements Serializ
|
||||
*/
|
||||
private String templateCode;
|
||||
/**
|
||||
* 待办所属项目部Id
|
||||
*/
|
||||
private Long workspaceId;
|
||||
|
||||
/**
|
||||
* 消息所属企业id.
|
||||
* 消息所属企业Id
|
||||
* <p>如果是没有企业的工人可以不传,其它任何情况下都必传。
|
||||
*/
|
||||
private Long ouId;
|
||||
/**
|
||||
* 待办所属项目部Id
|
||||
*/
|
||||
private Long workspaceId;
|
||||
/**
|
||||
* 发送者属企业Id
|
||||
*/
|
||||
private Long promoterOuId;
|
||||
/**
|
||||
* 发送者项目部Id
|
||||
*/
|
||||
private Long promoterWorkspaceId;
|
||||
/**
|
||||
* 关联业务主键
|
||||
*/
|
||||
|
||||
@ -755,6 +755,14 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
} else {
|
||||
pendingMessage = PendingMessageDTO.from(AdapterMigrateUtils.convertAdapterToPending(adapter));
|
||||
}
|
||||
// 发起人单位、项目信息
|
||||
pendingMessage.setPromoterOuId(adapter.getPromoterOuId());
|
||||
pendingMessage.setPromoterWorkspaceId(adapter.getPromoterOrgId());
|
||||
pendingMessage.setPromoterWorkspaceName(adapter.getPromoterOrgName());
|
||||
// 接收者单位、项目信息
|
||||
pendingMessage.setExecutorOuId(adapter.getOuId());
|
||||
pendingMessage.setExecutorWorkspaceId(adapter.getOrgId());
|
||||
pendingMessage.setExecutorWorkspaceName(adapter.getOrgName());
|
||||
pendingMessage.setIsRead(adapter.isRead());
|
||||
Map<String, MessageTemplateDTO> templateCode2Template = messageTemplates.stream()
|
||||
.collect(toMap(MessageTemplateDTO::getCode, identity()));
|
||||
|
||||
@ -110,6 +110,21 @@ public class TodoRecordAdapter implements PendingRecordAdapter {
|
||||
return todo == null ? null : todo.getOrgType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getPromoterOrgId() {
|
||||
return business == null ? 0L : business.getOrgId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPromoterOrgName() {
|
||||
return business == null ? "" : business.getOrgName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getPromoterOuId() {
|
||||
return business == null ? 0L : business.getOuId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getOrgId() {
|
||||
return todo == null ? 0L : todo.getOrgId();
|
||||
|
||||
@ -72,7 +72,7 @@ class TodoLogger {
|
||||
TodoLog log = new TodoLog();
|
||||
log.setLogType(TodoLogType.TODO_BUSINESS);
|
||||
log.setSrcTemplateCode(business.getTemplateCode());
|
||||
log.setTemplateCode("");
|
||||
log.setTemplateCode(business.getTemplateCode());
|
||||
log.setIdentityCode("");
|
||||
log.setBizCode(business.getBizCode());
|
||||
log.setRequestNo(ctx.getRequestNo());
|
||||
|
||||
@ -97,7 +97,9 @@ public class TodoManager {
|
||||
pullTodoBroadcaster.fireTodoChanged(executorPersonIds);
|
||||
// 记录日志
|
||||
// @formatter:off
|
||||
ctx.addLogContent("title", business.getTitle())
|
||||
ctx.addLogContent("templateTitle", template.getTitle())
|
||||
.addLogContent("templateContent", template.getContent())
|
||||
.addLogContent("title", business.getTitle())
|
||||
.addLogContent("content", business.getContent())
|
||||
.addLogContent("bizExtParams", business.getBizExtParam())
|
||||
.addLogContent("routerParams", business.getRouterParams());
|
||||
|
||||
@ -40,23 +40,31 @@ import java.util.Set;
|
||||
@RequiredArgsConstructor
|
||||
class TodoRecordBuilder {
|
||||
|
||||
private static final Long DEFAULT_VALUE = 0L;
|
||||
|
||||
private final OrganizationalNodePractitionerWideApi organizationalNodePractitionerWideApi;
|
||||
private final WorkspaceApi workspaceApi;
|
||||
|
||||
TodoBusiness buildBusiness(PendingMessagePushParam req, MessageTemplateDTO template) {
|
||||
SimpleWorkspaceRes workspace = getWorkspace(req.getPromoterWorkspaceId());
|
||||
PersonDTO promoter = req.getPromoter();
|
||||
JSONObject bizExtParamsObj = JSONUtils.parseObjectOrThrow("bizExtParams", req.getBizExtParams());
|
||||
JSONObject routerParamsObj = JSONUtils.parseObjectOrThrow("routerParams", req.getRouterParams());
|
||||
TodoBusiness business = new TodoBusiness();
|
||||
business.setTemplateCode(req.getTemplateCode());
|
||||
business.setBizCode(req.getBizCode());
|
||||
business.setTitle(PlaceholderResolver.tryResolve(template.getTitle(), bizExtParamsObj));
|
||||
business.setContent(PlaceholderResolver.tryResolve(template.getContent(), routerParamsObj));
|
||||
business.setBizFlag(req.getBizFlag());
|
||||
business.setPromoterId(promoter == null ? 0L : promoter.identityIdOrDefault());
|
||||
business.setPromoterType(promoter == null ? IdentityTypeEnum.NOT_SUPPORT : promoter.identityTypeOrDefault());
|
||||
business.setPromoterType(promoter == null ?
|
||||
IdentityTypeEnum.NOT_SUPPORT : promoter.identityTypeOrDefault());
|
||||
business.setPromoterPersonId(promoter == null ? 0 : promoter.personIdOrDefault());
|
||||
business.setPromoterName(promoter == null ? "" : promoter.getName());
|
||||
business.setOuId(determineOuId(req.getPromoterOuId(),
|
||||
workspace, promoter == null ? null : promoter.getIdentity()));
|
||||
business.setOrgId(req.getPromoterWorkspaceId());
|
||||
business.setOrgName(workspace == null ? "" : workspace.getName());
|
||||
business.setTitle(PlaceholderResolver.tryResolve(template.getTitle(), bizExtParamsObj));
|
||||
business.setContent(PlaceholderResolver.tryResolve(template.getContent(), bizExtParamsObj));
|
||||
business.setBizFlag(req.getBizFlag());
|
||||
business.setBizCategory(req.getBizCategory() == null ? BizCategoryEnum.OTHER : req.getBizCategory());
|
||||
business.setBizExtParam(bizExtParamsObj);
|
||||
business.setRouterParams(routerParamsObj);
|
||||
@ -65,21 +73,15 @@ class TodoRecordBuilder {
|
||||
return business;
|
||||
}
|
||||
|
||||
public List<Todo> buildTodos(String requestNo, PendingMessagePushParam req,
|
||||
TodoBusiness business, MessageTemplateDTO template) {
|
||||
public List<Todo> buildTodos(
|
||||
String requestNo, PendingMessagePushParam req,
|
||||
TodoBusiness business, MessageTemplateDTO template) {
|
||||
SimpleWorkspaceRes workspace = getWorkspace(req.getWorkspaceId());
|
||||
ArrayList<Todo> todos = new ArrayList<>();
|
||||
SimpleWorkspaceRes workspace = null;
|
||||
if (req.getWorkspaceId() != null && req.getWorkspaceId() > 0) {
|
||||
Result<SimpleWorkspaceRes> workspaceRes = workspaceApi.getOne(req.getWorkspaceId());
|
||||
if (200 == workspaceRes.getCode())
|
||||
workspace = workspaceRes.getData();
|
||||
else
|
||||
log.info("未查询到工作台信息. workspaceId={}", req.getWorkspaceId());
|
||||
}
|
||||
JSONObject bizExtParamsObj = JSONUtils.parseObjectOrThrow("bizExtParams", req.getBizExtParams());
|
||||
JSONObject routerParamsObj = JSONUtils.parseObjectOrThrow("routerParams", req.getRouterParams());
|
||||
String title = PlaceholderResolver.tryResolve(template.getTitle(), bizExtParamsObj);
|
||||
String content = PlaceholderResolver.tryResolve(template.getContent(), routerParamsObj);
|
||||
String content = PlaceholderResolver.tryResolve(template.getContent(), bizExtParamsObj);
|
||||
Set<Long> sentPersonIds = new HashSet<>();
|
||||
for (PersonDTO executor : req.getExecutor()) {
|
||||
if (sentPersonIds.contains(executor.getId()))
|
||||
@ -99,11 +101,11 @@ class TodoRecordBuilder {
|
||||
todo.setSubBizCode(req.getSubBizCode());
|
||||
todo.setType(req.determineTodoType());
|
||||
todo.setOuId(determineOuId(req.getOuId(), workspace, executor.getIdentity()));
|
||||
todo.setOrgId(req.getWorkspaceId());
|
||||
todo.setOrgName(workspace == null ? "" : workspace.getName());
|
||||
todo.setExecutorPersonId(executor.personIdOrDefault());
|
||||
todo.setExecutorName(executor.getName());
|
||||
todo.setRequestNo(requestNo);
|
||||
todo.setOrgId(req.getWorkspaceId());
|
||||
todo.setOrgName(workspace == null ? "" : workspace.getName());
|
||||
todo.setBizDesc(req.getBizDesc());
|
||||
todo.setIsOuIdMigrated(YesOrNo.NO);
|
||||
todo.setHideUntil(null);
|
||||
@ -118,8 +120,14 @@ class TodoRecordBuilder {
|
||||
return todos;
|
||||
}
|
||||
|
||||
private SimpleWorkspaceRes getWorkspace(Long workspaceId) {
|
||||
if (workspaceId == null || workspaceId <= 0)
|
||||
return null;
|
||||
Result<SimpleWorkspaceRes> resp = workspaceApi.getOne(workspaceId);
|
||||
return resp.getCode() == 200 ? resp.getData() : null;
|
||||
}
|
||||
|
||||
private Long determineOuId(Long ouId, SimpleWorkspaceRes workspace, IdentityDTO identity) {
|
||||
// 如果传了就以传了的为准
|
||||
if (ouId != null)
|
||||
return ouId;
|
||||
if (workspace != null && identity != null && identity.getType() == IdentityTypeEnum.PRACTITIONER) {
|
||||
@ -134,8 +142,8 @@ class TodoRecordBuilder {
|
||||
params.put("ouId", null);
|
||||
params.put("workspace", workspace);
|
||||
params.put("identity", identity);
|
||||
log.warn("can't determine ouId, use default value: 0L. params={}", params);
|
||||
return 0L;
|
||||
log.warn("can't determine ouId, use default value: {}. params={}", DEFAULT_VALUE, params);
|
||||
return DEFAULT_VALUE;
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,7 +3,7 @@ package cn.axzo.msg.center.message.service.todo.manage;
|
||||
import cn.axzo.msg.center.utils.UUIDUtil;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -13,7 +13,7 @@ import java.util.Map;
|
||||
public class TodoRequestContext {
|
||||
private final String name;
|
||||
private final String requestNo;
|
||||
private final Map<String, Object> logContents = new HashMap<>();
|
||||
private final Map<String, Object> logContents = new LinkedHashMap<>();
|
||||
|
||||
private TodoRequestContext(String name, String requestNo) {
|
||||
this.name = name;
|
||||
|
||||
@ -14,10 +14,6 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
public class PendingSendInfo implements Serializable {
|
||||
/**
|
||||
* 待办所属组织类型
|
||||
*/
|
||||
private OrganizationTypeEnum orgType;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.axzo.msg.center.api.request.v3;
|
||||
|
||||
import cn.axzo.msg.center.service.enums.TodoLogType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class SearchTodoLogReq {
|
||||
|
||||
/**
|
||||
* 源模板编码. 比如抄送, 保存审批流的待办模版code
|
||||
*/
|
||||
private String srcTemplateCode;
|
||||
|
||||
/**
|
||||
* 待办内容模板编码. 比如抄送, 保存审批流的待办模版code或抄送的待办模版code
|
||||
*/
|
||||
private String templateCode;
|
||||
|
||||
/**
|
||||
* 日志类型
|
||||
*/
|
||||
private TodoLogType logType;
|
||||
|
||||
/**
|
||||
* 上下文
|
||||
*/
|
||||
private String context;
|
||||
|
||||
/**
|
||||
* 消息的唯一标识
|
||||
*/
|
||||
private String identityCode;
|
||||
|
||||
/**
|
||||
* 关联业务编码
|
||||
*/
|
||||
private String bizCode;
|
||||
|
||||
/**
|
||||
* 流程类待办的流程结点编码
|
||||
*/
|
||||
private String subBizCode;
|
||||
|
||||
/**
|
||||
* 请求批次号
|
||||
*/
|
||||
private String requestNo;
|
||||
|
||||
private int limit = 10;
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package cn.axzo.msg.center.api.response.v3;
|
||||
|
||||
import cn.axzo.msg.center.service.enums.TodoLogType;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Data
|
||||
public class SearchTodoLogResponse {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 源模板编码. 比如抄送, 保存审批流的待办模版code
|
||||
*/
|
||||
private String srcTemplateCode;
|
||||
|
||||
/**
|
||||
* 待办内容模板编码. 比如抄送, 保存审批流的待办模版code或抄送的待办模版code
|
||||
*/
|
||||
private String templateCode;
|
||||
|
||||
/**
|
||||
* 日志类型
|
||||
*/
|
||||
private TodoLogType logType;
|
||||
|
||||
/**
|
||||
* 上下文
|
||||
*/
|
||||
private String context;
|
||||
|
||||
/**
|
||||
* 消息的唯一标识
|
||||
*/
|
||||
private String identityCode;
|
||||
|
||||
/**
|
||||
* 关联业务编码
|
||||
*/
|
||||
private String bizCode;
|
||||
|
||||
/**
|
||||
* 流程类待办的流程结点编码
|
||||
*/
|
||||
private String subBizCode;
|
||||
|
||||
/**
|
||||
* 关键变化
|
||||
*/
|
||||
private JSONObject logContent;
|
||||
|
||||
/**
|
||||
* 额外信息
|
||||
*/
|
||||
private JSONObject changeExt;
|
||||
|
||||
/**
|
||||
* 请求批次号
|
||||
*/
|
||||
private String requestNo;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
protected Date createAt;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
protected Date updateAt;
|
||||
}
|
||||
@ -94,16 +94,46 @@ public class PendingMessageResponse implements Serializable {
|
||||
private String bizFlag;
|
||||
/**
|
||||
* 工作台id
|
||||
* <p>Deprecated, use {@link #executorWorkspaceId} instead
|
||||
*/
|
||||
@Deprecated
|
||||
private Long workspaceId;
|
||||
/**
|
||||
* 工作台名称
|
||||
* <p>Deprecated, use {@link #executorWorkspaceName} instead
|
||||
*/
|
||||
@Deprecated
|
||||
private String workspaceName;
|
||||
/**
|
||||
* 待办发起人的企业id
|
||||
* 待办接收者的企业id
|
||||
* <p>Deprecated, use {@link #executorOuId} instead
|
||||
*/
|
||||
@Deprecated
|
||||
private Long ouId;
|
||||
/**
|
||||
* 发起人工作台id
|
||||
*/
|
||||
private Long promoterWorkspaceId;
|
||||
/**
|
||||
* 发起人工作台名称
|
||||
*/
|
||||
private String promoterWorkspaceName;
|
||||
/**
|
||||
* 发起人企业id
|
||||
*/
|
||||
private Long promoterOuId;
|
||||
/**
|
||||
* 接收人工作台id
|
||||
*/
|
||||
private Long executorWorkspaceId;
|
||||
/**
|
||||
* 接收人工作台名称
|
||||
*/
|
||||
private String executorWorkspaceName;
|
||||
/**
|
||||
* 接收人企业id
|
||||
*/
|
||||
private Long executorOuId;
|
||||
/**
|
||||
* 待办状态
|
||||
*/
|
||||
|
||||
@ -7,6 +7,7 @@ import cn.axzo.msg.center.service.enums.OrganizationTypeEnum;
|
||||
import cn.axzo.msg.center.service.enums.PendingMessageStateEnum;
|
||||
import cn.axzo.msg.center.service.enums.TodoType;
|
||||
import cn.axzo.msg.center.service.enums.YesOrNo;
|
||||
import org.bouncycastle.asn1.eac.EACTags;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ -86,4 +87,16 @@ public interface PendingRecordAdapter {
|
||||
default Boolean isRead() {
|
||||
return null;
|
||||
}
|
||||
|
||||
default Long getPromoterOrgId() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
default String getPromoterOrgName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
default Long getPromoterOuId() {
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import cn.axzo.msg.center.domain.persistence.BaseEntityExt;
|
||||
import cn.axzo.msg.center.service.enums.BizCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.BizFinalStateEnum;
|
||||
import cn.axzo.msg.center.service.enums.IdentityTypeEnum;
|
||||
import cn.axzo.msg.center.service.enums.OrganizationTypeEnum;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@ -92,4 +93,20 @@ public class TodoBusiness extends BaseEntityExt<TodoBusiness> {
|
||||
* 待办的截止时间
|
||||
*/
|
||||
private Date deadline;
|
||||
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
private Long ouId;
|
||||
|
||||
/**
|
||||
* 消息所属组织Id
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 消息所属组织名称
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
}
|
||||
@ -3,12 +3,17 @@ package cn.axzo.msg.center.domain.entity;
|
||||
import cn.axzo.msg.center.domain.persistence.BaseEntityExt;
|
||||
import cn.axzo.msg.center.service.enums.TodoLogType;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -64,7 +69,7 @@ public class TodoLog extends BaseEntityExt<TodoLog> {
|
||||
* 额外信息
|
||||
*/
|
||||
@TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
private JSONObject changeExt;
|
||||
private JSONObject recordExt;
|
||||
|
||||
/**
|
||||
* 请求批次号
|
||||
@ -76,17 +81,20 @@ public class TodoLog extends BaseEntityExt<TodoLog> {
|
||||
public TodoLog addLogContents(Map<String, Object> contents) {
|
||||
if (contents == null)
|
||||
return this;
|
||||
if (logContent == null)
|
||||
logContent = new JSONObject();
|
||||
maybeCreateLogContent();
|
||||
logContent.putAll(contents);
|
||||
return this;
|
||||
}
|
||||
|
||||
public TodoLog addLogContent(String name, Object value) {
|
||||
if (logContent == null)
|
||||
logContent = new JSONObject();
|
||||
maybeCreateLogContent();
|
||||
logContent.put(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
private void maybeCreateLogContent() {
|
||||
if (logContent == null)
|
||||
logContent = new JSONObject(true);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user