Merge branch 'test' into 'ou_id_migration'
# Conflicts: # inside-notices/pom.xml # inside-notices/src/main/java/cn/axzo/msg/center/message/controller/PrivateMessageController.java # start/src/main/resources/bootstrap.yml # start/src/test/java/cn/axzo/msg/center/message/service/PendingMessageNewServiceTest.java
This commit is contained in:
commit
37a16239d0
@ -173,6 +173,7 @@ public class InsideNoticesApiImpl implements InsideNoticesApi {
|
||||
|
||||
@Override
|
||||
public CommonResponse<Void> updateReadMsgStatus(CmsReadMsgReq req) {
|
||||
log.info("updateReadMsgStatus, req={}", req);
|
||||
messageRecordService.updateReadMsgStatus(req);
|
||||
return CommonResponse.success();
|
||||
}
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
package cn.axzo.msg.center.inside.notices.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public class Queries {
|
||||
|
||||
/**
|
||||
* @param domainType help compiler
|
||||
*/
|
||||
public static <T> LambdaQueryWrapper<T> query(
|
||||
@SuppressWarnings({"unused", "help compiler"}) Class<T> domainType) {
|
||||
return new LambdaQueryWrapper<>();
|
||||
}
|
||||
|
||||
}
|
||||
@ -14,6 +14,7 @@ import cn.axzo.msg.center.service.pending.request.CompletePendingMessageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageByBizCodeRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageCountUncompletedRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageFixedTemplatePageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageIterateRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessagePageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessagePushRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageQueryRequest;
|
||||
@ -21,6 +22,8 @@ import cn.axzo.msg.center.service.pending.request.PendingMessageStatisticRequest
|
||||
import cn.axzo.msg.center.service.pending.request.RevokePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.SetHideRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.UpdatePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.response.AnalysisPage;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageIterateResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageSimpleDTO;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageStatisticResponse;
|
||||
@ -66,7 +69,7 @@ public class PendingMessageNewController implements PendingMessageClient {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Page<PendingMessageResponse>> pageQuery(PendingMessagePageRequest request) {
|
||||
public CommonResponse<AnalysisPage<PendingMessageResponse>> pageQuery(PendingMessagePageRequest request) {
|
||||
log.info("pageQuery, request={}", request);
|
||||
return CommonResponse.success(pendingMessageNewService.pageQuery(request));
|
||||
}
|
||||
@ -101,6 +104,11 @@ public class PendingMessageNewController implements PendingMessageClient {
|
||||
return CommonResponse.success(pendingMessageNewService.push(PendingMessagePushParam.from(request)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Page<PendingMessageIterateResponse>> iterate(PendingMessageIterateRequest request) {
|
||||
return CommonResponse.success(pendingMessageNewService.iterate(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> complete(String requestNo) {
|
||||
return CommonResponse.success(pendingMessageNewService.complete(requestNo));
|
||||
|
||||
@ -23,13 +23,14 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author syl
|
||||
* @date 2023/12/18
|
||||
@ -121,7 +122,10 @@ public class PrivateMessageController {
|
||||
@AllArgsConstructor
|
||||
public static class BizEventInitRequest {
|
||||
|
||||
private List<Long> originalRelationIds;
|
||||
@RequestMapping("determinePageQueryTemplateCode")
|
||||
public List<String> determinePageQueryTemplateCode(
|
||||
@RequestBody @Valid PendingMessagePageRequest request) {
|
||||
return pendingMessageNewService.determinePageQueryTemplateCodes(request);
|
||||
}
|
||||
|
||||
@PostMapping("/migrateOuId")
|
||||
|
||||
@ -30,8 +30,6 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class PendingMessagePushParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6308469943450138452L;
|
||||
|
||||
/**
|
||||
* 发起者
|
||||
*/
|
||||
@ -45,21 +43,17 @@ public class PendingMessagePushParam implements Serializable {
|
||||
*/
|
||||
private String templateCode;
|
||||
/**
|
||||
* 消息所属组织类型
|
||||
* 待办所属组织类型
|
||||
*/
|
||||
private OrganizationTypeEnum orgType;
|
||||
/**
|
||||
* 消息所属项目部Id
|
||||
* 待办所属项目部Id
|
||||
*/
|
||||
private Long workspaceId;
|
||||
// /**
|
||||
// * 删除工作台名称,通过id查
|
||||
// * 消息所属项目部名称
|
||||
// */
|
||||
// private String workspaceName;
|
||||
|
||||
/**
|
||||
* 消息所属企业id
|
||||
* 消息所属企业id.
|
||||
* <p>如果是没有企业的工人可以不传,其它任何情况下都必传。
|
||||
*/
|
||||
private Long ouId;
|
||||
/**
|
||||
|
||||
@ -11,17 +11,19 @@ import cn.axzo.msg.center.service.pending.request.CompletePendingMessageByIdRequ
|
||||
import cn.axzo.msg.center.service.pending.request.CompletePendingMessageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageByBizCodeRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageFixedTemplatePageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageIterateRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessagePageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageQueryRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.RevokePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.SetHideRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.UpdatePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.response.AnalysisPage;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageIterateResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageSimpleDTO;
|
||||
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@ -66,7 +68,20 @@ public interface PendingMessageNewService {
|
||||
* @param request 分页查询相关参数
|
||||
* @return 代办列表
|
||||
*/
|
||||
Page<PendingMessageResponse> pageQuery(PendingMessagePageRequest request);
|
||||
AnalysisPage<PendingMessageResponse> pageQuery(PendingMessagePageRequest request);
|
||||
|
||||
/**
|
||||
* 遍历待办数据
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
Page<PendingMessageIterateResponse> iterate(PendingMessageIterateRequest request);
|
||||
|
||||
/**
|
||||
* 查询可以用于分页查询的模版
|
||||
* @param request
|
||||
*/
|
||||
List<String> determinePageQueryTemplateCodes(PendingMessagePageRequest request);
|
||||
|
||||
/**
|
||||
* 代办列表分页查询
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.axzo.msg.center.message.service.impl;
|
||||
|
||||
import cn.axzo.msg.center.service.pending.response.AnalysisPage;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Component
|
||||
public class AnalysisPageFactory {
|
||||
|
||||
private final Set<String> enableAnalysisProfiles = ImmutableSet.of("dev", "test", "pre", "live");
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String profile;
|
||||
|
||||
public <T> AnalysisPage<T> createPage(Long pageNum, Long pageSize, Long totalCount, List<T> list) {
|
||||
AnalysisPage<T> page = new AnalysisPage<>(pageNum, pageSize, totalCount, list);
|
||||
page.setEnableAnalysis(enableAnalysisProfiles.contains(profile));
|
||||
return page;
|
||||
}
|
||||
|
||||
public <T> AnalysisPage<T> createPage() {
|
||||
AnalysisPage<T> page = new AnalysisPage<>();
|
||||
page.setEnableAnalysis(enableAnalysisProfiles.contains(profile));
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
||||
@ -71,6 +71,9 @@ public class GeneralMessageOldServiceImpl implements GeneralMessageOldService {
|
||||
}
|
||||
|
||||
public int countUnread(Long personId, List<IdentityDTO> identities, List<Long> excludeMsgIds) {
|
||||
if (CollectionUtils.isEmpty(identities)) {
|
||||
return 0;
|
||||
}
|
||||
int count = 0;
|
||||
for (IdentityDTO identity : identities) {
|
||||
PersonDTO person = PersonDTO.from(personId, identity.getId(), identity.getType());
|
||||
|
||||
@ -6,11 +6,15 @@ import cn.axzo.apollo.workspace.api.workspace.WorkspaceApi;
|
||||
import cn.axzo.apollo.workspace.api.workspace.req.OrganizationalNodePractitionerWideReqParams;
|
||||
import cn.axzo.apollo.workspace.api.workspace.res.OrganizationalNodePractitionerWideDto;
|
||||
import cn.axzo.apollo.workspace.api.workspace.res.SimpleWorkspaceRes;
|
||||
import cn.axzo.basics.common.BeanMapper;
|
||||
import cn.axzo.framework.core.util.MapUtil;
|
||||
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.axzo.im.center.api.feign.MessageApi;
|
||||
import cn.axzo.im.center.api.vo.req.CustomMessageInfo;
|
||||
import cn.axzo.im.center.common.enums.AppTypeEnum;
|
||||
import cn.axzo.im.center.common.enums.BizTypeEnum;
|
||||
import cn.axzo.maokai.api.client.OrganizationalTeamOuRelationApi;
|
||||
import cn.axzo.maokai.api.vo.response.OrganizationalTeamOuRelationResp;
|
||||
import cn.axzo.msg.center.api.enums.MsgRecordTerminalTypeEnum;
|
||||
import cn.axzo.msg.center.api.enums.MsgStateEnum;
|
||||
import cn.axzo.msg.center.api.response.MessageDetailRes;
|
||||
@ -25,6 +29,7 @@ import cn.axzo.msg.center.domain.dto.PendingCalendarCodeDTO;
|
||||
import cn.axzo.msg.center.domain.entity.PendingMessageRecord;
|
||||
import cn.axzo.msg.center.domain.enums.NativeTypeEnum;
|
||||
import cn.axzo.msg.center.inside.notices.config.PendingCalendarCodeConfig;
|
||||
import cn.axzo.msg.center.inside.notices.utils.Queries;
|
||||
import cn.axzo.msg.center.message.domain.dto.GroupTreeNodePathDTO;
|
||||
import cn.axzo.msg.center.message.domain.dto.MessageTemplateDTO;
|
||||
import cn.axzo.msg.center.message.domain.dto.MessageTemplateRouterDTO;
|
||||
@ -57,11 +62,14 @@ import cn.axzo.msg.center.service.pending.request.CompletePendingMessageByIdRequ
|
||||
import cn.axzo.msg.center.service.pending.request.CompletePendingMessageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageByBizCodeRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageFixedTemplatePageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageIterateRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessagePageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageQueryRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.RevokePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.SetHideRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.UpdatePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.response.AnalysisPage;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageIterateResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageSimpleDTO;
|
||||
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
||||
@ -89,6 +97,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
@ -103,14 +112,14 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description
|
||||
*
|
||||
* @author cold_blade
|
||||
* @date 2023/9/28
|
||||
* @version 1.0
|
||||
* @description
|
||||
* @date 2023/9/28
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@ -126,6 +135,8 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
private final OrganizationalNodePractitionerWideApi organizationalNodePractitionerWideApi;
|
||||
private final PendingCalendarCodeConfig calendarCodeConfig;
|
||||
private final MessageApi messageApi;
|
||||
private final OrganizationalTeamOuRelationApi organizationalTeamOuRelationApi;
|
||||
private final AnalysisPageFactory analysisPageFactory;
|
||||
|
||||
@Value("${msg.center.pending.hide-seconds:60}")
|
||||
private int pendingDefaultHideSeconds;
|
||||
@ -168,21 +179,21 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<PendingMessageResponse> pageQuery(PendingMessagePageRequest request) {
|
||||
List<String> groupTreeRootNodeCodes = messageGroupNodeService
|
||||
.listGroupTreeRootNodeCodes(MessageGroupCategoryEnum.PENDING, request.getAppTerminalType());
|
||||
public AnalysisPage<PendingMessageResponse> pageQuery(PendingMessagePageRequest request) {
|
||||
PersonDTO operator = PersonDTO.from(request.getPersonId(), request.getIdentityId(), request.getIdentityType());
|
||||
PendingMessageStateEnum pendingMessageState = fetchPendingMessageState(request.getRoleCategory(), request.getMsgState());
|
||||
BizFinalStateEnum bizFinalState = fetchBizFinalState(request.getRoleCategory(), request.getBizFinalState());
|
||||
// 开始构建分页查询条件
|
||||
LambdaQueryChainWrapper<PendingMessageRecord> query = pendingMessageRecordDao.lambdaQuery()
|
||||
// REQ-1507期发起人不通过ouId过滤
|
||||
.eq(!PendingMessageRoleCategoryEnum.PROMOTER.equals(request.getRoleCategory())
|
||||
&& Objects.nonNull(request.getOuId()), PendingMessageRecord::getOuId, request.getOuId())
|
||||
.eq(Objects.nonNull(pendingMessageState), PendingMessageRecord::getState, pendingMessageState)
|
||||
.eq(Objects.nonNull(bizFinalState), PendingMessageRecord::getBizFinalState, bizFinalState)
|
||||
.eq(PendingMessageRecord::getIsDelete, IsDeletedEnum.NO.getCode())
|
||||
.eq(Objects.nonNull(request.getWorkspaceId()), PendingMessageRecord::getOrgId, request.getWorkspaceId());
|
||||
// REQ-1507期发起人不通过ouId过滤, 只有执行人对ouId进行过滤
|
||||
List<Long> determinedOuIds = Collections.emptyList();
|
||||
if (request.determineRoleCategory() == PendingMessageRoleCategoryEnum.EXECUTOR) {
|
||||
determinedOuIds = appendExecutorOuIdExpr(query, request.getOuId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(request.getTitle())) {
|
||||
query.and(v -> v.like(PendingMessageRecord::getTitle, request.getTitle())
|
||||
.or().like(PendingMessageRecord::getPromoterName, request.getTitle()));
|
||||
@ -191,6 +202,68 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
buildHideUntil(query);
|
||||
// 构建人维度的查询条件
|
||||
buildPersonCondition(query, request.getWithIdentify(), request.getRoleCategory(), operator);
|
||||
List<String> templateCodes = determinePageQueryTemplateCodes(request);
|
||||
if (CollectionUtils.isEmpty(templateCodes)) {
|
||||
// 如果该分类未关联任何模板,直接返回空集合
|
||||
log.info("there is not any template matched... appTerminal:[{}]", request.getAppTerminalType());
|
||||
return AnalysisPage.emptyPage(request.getPage(), request.getPageSize());
|
||||
}
|
||||
query.in(PendingMessageRecord::getTemplateCode, templateCodes);
|
||||
// query.groupBy(PendingMessageRecord::getTemplateCode,PendingMessageRecord::getBizCode);
|
||||
// 构建排序条件
|
||||
buildSortCondition(query, request.getOrderFields(), pendingMessageState);
|
||||
IPage<PendingMessageRecord> page = request.toPage();
|
||||
List<PendingMessageRecord> pendingMessageRecords = pendingMessageRecordMapper.selectPageWithCustomSql(query.getWrapper(), page);
|
||||
templateCodes = pendingMessageRecords.stream().map(PendingMessageRecord::getTemplateCode)
|
||||
.collect(Collectors.toList());
|
||||
List<MessageTemplateDTO> messageTemplates = messageTemplateNewService.listByTemplateCodes(templateCodes);
|
||||
List<PendingMessageResponse> responseRecords = pendingMessageRecords.stream()
|
||||
.map(e -> convert(e, messageTemplates).toResponse(request.getTerminalType()))
|
||||
.collect(Collectors.toList());
|
||||
AnalysisPage<PendingMessageResponse> resultPage = analysisPageFactory
|
||||
.createPage(request.getPage(), request.getPageSize(), page.getTotal(), responseRecords);
|
||||
if (resultPage.isEnableAnalysis() && StringUtils.isNotBlank(request.getFetchTemplateCode())) {
|
||||
List<PendingMessageRecord> templateMessages = pendingMessageRecordMapper.selectList(
|
||||
Queries.query(PendingMessageRecord.class)
|
||||
.eq(PendingMessageRecord::getTemplateCode, request.getFetchTemplateCode())
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.orderByDesc(PendingMessageRecord::getId)
|
||||
.last("LIMIT " + request.getFetchLimit()));
|
||||
resultPage.addAnalysis("fetchedTemplateMessages", templateMessages);
|
||||
}
|
||||
resultPage.addAnalysis("templateCodes", templateCodes);
|
||||
resultPage.addAnalysis("personId", request.getPersonId());
|
||||
resultPage.addAnalysis("operator", operator);
|
||||
resultPage.addAnalysis("ouId", request.getOuId());
|
||||
resultPage.addAnalysis("determinedOuIds", determinedOuIds);
|
||||
resultPage.addAnalysis("request", request);
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<PendingMessageIterateResponse> iterate(PendingMessageIterateRequest request) {
|
||||
IPage<PendingMessageRecord> page = pendingMessageRecordDao.lambdaQuery()
|
||||
//.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.eq(PendingMessageRecord::getTemplateCode, request.getTemplateCode())
|
||||
.le(request.getCratedAtAfter() != null, PendingMessageRecord::getCreateAt, request.getCratedAtAfter())
|
||||
.eq(StringUtils.isNotBlank(request.getBizCode()),
|
||||
PendingMessageRecord::getBizCode, request.getBizCode())
|
||||
.orderByAsc(PendingMessageRecord::getId)
|
||||
.page(request.toPage());
|
||||
if (CollectionUtils.isEmpty((page.getRecords()))) {
|
||||
return new Page<>((long) request.getPage(), (long) request.getPageSize(), 0L, Collections.emptyList());
|
||||
}
|
||||
List<PendingMessageIterateResponse> pageItems = page.getRecords().stream()
|
||||
.map(m -> BeanMapper.copyBean(m, PendingMessageIterateResponse.class))
|
||||
.collect(Collectors.toList());
|
||||
return new Page<>(page.getCurrent(), page.getPages(), page.getTotal(), pageItems);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> determinePageQueryTemplateCodes(PendingMessagePageRequest request) {
|
||||
List<String> groupTreeRootNodeCodes = messageGroupNodeService
|
||||
.listGroupTreeRootNodeCodes(MessageGroupCategoryEnum.PENDING, request.getAppTerminalType());
|
||||
// 模板的分类,对代办进行分组过滤
|
||||
List<GroupTreeNodePathDTO> leafNodePaths = messageGroupNodeService
|
||||
.leafGroupNodeCodePathsByRootNodeCodes(groupTreeRootNodeCodes);
|
||||
@ -198,32 +271,19 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
if (StringUtils.isNotBlank(request.getGroupNodeCode())) {
|
||||
GroupTreeNodePathDTO nodePath = messageGroupNodeService.queryLeafGroupNodeCodePath(request.getGroupNodeCode())
|
||||
.orElse(null);
|
||||
if (Objects.isNull(nodePath) || !paths.contains(nodePath.getNodeCodePath())) {
|
||||
if (nodePath == null) {
|
||||
// 如果该分类未关联任何模板,直接返回空集合
|
||||
log.info("invalid group node code...");
|
||||
return PageHelperUtil.emptyPage(request.getPage(), request.getPageSize());
|
||||
paths = Collections.emptyList();
|
||||
} else {
|
||||
paths = Lists.newArrayList(nodePath.getNodeCodePath());
|
||||
}
|
||||
paths = Lists.newArrayList(nodePath.getNodeCodePath());
|
||||
}
|
||||
List<String> templateCodes = messageTemplateGroupService.listMessageTemplateCodes(paths);
|
||||
if (CollectionUtils.isEmpty(templateCodes)) {
|
||||
// 如果该分类未关联任何模板,直接返回空集合
|
||||
log.info("there is not any template matched... appTerminal:[{}]", request.getAppTerminalType());
|
||||
return PageHelperUtil.emptyPage(request.getPage(), request.getPageSize());
|
||||
List<String> templateCodes = null;
|
||||
if (CollectionUtils.isNotEmpty(paths)) {
|
||||
templateCodes = messageTemplateGroupService.listMessageTemplateCodes(paths);
|
||||
}
|
||||
query.in(PendingMessageRecord::getTemplateCode, templateCodes);
|
||||
// query.groupBy(PendingMessageRecord::getTemplateCode,PendingMessageRecord::getBizCode);
|
||||
// 构建排序条件
|
||||
buildSortCondition(query, request.getOrderFields(), pendingMessageState);
|
||||
IPage<PendingMessageRecord> page = request.toPage();
|
||||
List<PendingMessageRecord> pendingMessageRecords = pendingMessageRecordMapper.selectPageWithCustomSql(query.getWrapper(),page);
|
||||
templateCodes = pendingMessageRecords.stream().map(PendingMessageRecord::getTemplateCode)
|
||||
.collect(Collectors.toList());
|
||||
List<MessageTemplateDTO> messageTemplates = messageTemplateNewService.listByTemplateCodes(templateCodes);
|
||||
List<PendingMessageResponse> responseRecords = pendingMessageRecords.stream()
|
||||
.map(e -> convert(e, messageTemplates).toResponse(request.getTerminalType()))
|
||||
.collect(Collectors.toList());
|
||||
return Page.toPage(request.getPage(), request.getPageSize(), page.getTotal(), responseRecords);
|
||||
return templateCodes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -231,12 +291,12 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
List<PendingMessageResponse> result = new ArrayList<>();
|
||||
// 未来无待办
|
||||
LocalDate localDate = request.getSelectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
if(localDate.isAfter(LocalDate.now())) {
|
||||
if (localDate.isAfter(LocalDate.now())) {
|
||||
return result;
|
||||
}
|
||||
Boolean isNowDay = localDate.isBefore(LocalDate.now())?false:true;
|
||||
Boolean isNowDay = localDate.isBefore(LocalDate.now()) ? false : true;
|
||||
PendingCalendarCodeDTO calendarCodeDTO = buildCalendarCodesDTO(calendarCodeConfig);
|
||||
List<PendingMessageRecord> pendingMessageRecords = pendingMessageRecordMapper.queryByTemplateCodes(calendarCodeDTO,request.getWorkspaceId(),request.getSelectDate(),request.getPersonId(),isNowDay);
|
||||
List<PendingMessageRecord> pendingMessageRecords = pendingMessageRecordMapper.queryByTemplateCodes(calendarCodeDTO, request.getWorkspaceId(), request.getSelectDate(), request.getPersonId(), isNowDay);
|
||||
List<MessageTemplateDTO> messageTemplates = messageTemplateNewService.listByTemplateCodes(calendarCodeConfig.getCalendarAllCodes());
|
||||
result = pendingMessageRecords.stream()
|
||||
.map(e -> convert(e, messageTemplates).toResponse(request.getTerminalType()))
|
||||
@ -246,7 +306,7 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
}
|
||||
|
||||
private PendingCalendarCodeDTO buildCalendarCodesDTO(PendingCalendarCodeConfig calendarCodeConfig) {
|
||||
return new PendingCalendarCodeDTO(calendarCodeConfig.getConstructionCodes(),calendarCodeConfig.getClockInCodes(),calendarCodeConfig.getPunchInCodes(),calendarCodeConfig.getCalendarAllCodes());
|
||||
return new PendingCalendarCodeDTO(calendarCodeConfig.getConstructionCodes(), calendarCodeConfig.getClockInCodes(), calendarCodeConfig.getPunchInCodes(), calendarCodeConfig.getCalendarAllCodes());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ -363,11 +423,11 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
List<PendingMessageRecord> record = convert(param, msgTemplate, requestNo, workspace);
|
||||
pendingMessageRecordDao.saveBatch(record);
|
||||
try {
|
||||
ListUtils.emptyIfNull(record).forEach(re->{
|
||||
ListUtils.emptyIfNull(record).forEach(re -> {
|
||||
// 发送IM通知
|
||||
pushIMMessage(re.getExecutorPersonId());
|
||||
});
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error("sendCustomMessage error.", e);
|
||||
}
|
||||
return record.stream().map(e -> PushPendingMessageDTO.builder()
|
||||
@ -398,7 +458,7 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
public Boolean completeById(CompletePendingMessageByIdRequest param) {
|
||||
log.info("the [{}] record is updated complete by id.", param);
|
||||
String bizExtParam = null;
|
||||
if(StringUtils.isNotBlank(param.getBizExtParams())){
|
||||
if (StringUtils.isNotBlank(param.getBizExtParams())) {
|
||||
bizExtParam = param.getBizExtParams();
|
||||
}
|
||||
Boolean update = pendingMessageRecordDao.lambdaUpdate()
|
||||
@ -410,12 +470,12 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.update();
|
||||
try {
|
||||
if(update){
|
||||
if (update) {
|
||||
PendingMessageRecord one = pendingMessageRecordDao.lambdaQuery().eq(PendingMessageRecord::getId, param.getId()).one();
|
||||
// 发送IM通知
|
||||
pushIMMessage(one.getExecutorPersonId());
|
||||
}
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error("sendCustomMessage error.", e);
|
||||
}
|
||||
return update;
|
||||
@ -452,12 +512,12 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.update();
|
||||
try {
|
||||
if(update){
|
||||
if (update) {
|
||||
PendingMessageRecord one = pendingMessageRecordDao.lambdaQuery().eq(PendingMessageRecord::getId, msgId).one();
|
||||
// 发送IM通知
|
||||
pushIMMessage(one.getExecutorPersonId());
|
||||
}
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error("sendCustomMessage error.", e);
|
||||
}
|
||||
return update;
|
||||
@ -468,7 +528,7 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
public Boolean completeByTemplateCodeBizCode(CompletePendingMessageRequest param) {
|
||||
log.info("the [{}] record is completeByTemplateCodeBizCode retract.", param);
|
||||
Boolean result = false;
|
||||
if(null != param.getFinalStatus() && param.getFinalStatus() && null == param.getBizFinalStateEnum()){
|
||||
if (null != param.getFinalStatus() && param.getFinalStatus() && null == param.getBizFinalStateEnum()) {
|
||||
return result;
|
||||
}
|
||||
result = pendingMessageRecordDao.lambdaUpdate()
|
||||
@ -480,7 +540,7 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.update();
|
||||
// 关联业务的终态设置
|
||||
if(null != param.getFinalStatus() && param.getFinalStatus()){
|
||||
if (null != param.getFinalStatus() && param.getFinalStatus()) {
|
||||
result = pendingMessageRecordDao.lambdaUpdate()
|
||||
.set(PendingMessageRecord::getBizFinalState, param.getBizFinalStateEnum())
|
||||
.eq(PendingMessageRecord::getTemplateCode, param.getTemplateCode())
|
||||
@ -490,24 +550,24 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
.update();
|
||||
}
|
||||
try {
|
||||
if(result){
|
||||
if (result) {
|
||||
List<PendingMessageRecord> list = pendingMessageRecordDao.lambdaQuery()
|
||||
.eq(PendingMessageRecord::getTemplateCode, param.getTemplateCode())
|
||||
.eq(PendingMessageRecord::getBizCode, param.getBizCode())
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.list();
|
||||
ListUtils.emptyIfNull(list).forEach(record->{
|
||||
ListUtils.emptyIfNull(list).forEach(record -> {
|
||||
// 发送IM通知
|
||||
pushIMMessage(record.getExecutorPersonId());
|
||||
});
|
||||
}
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error("sendCustomMessage error.", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void pushIMMessage(Long personId){
|
||||
private void pushIMMessage(Long personId) {
|
||||
log.info("the [{}] record is personId.", personId);
|
||||
messageApi.sendCustomMessage(CustomMessageInfo.builder().appTypeList(Lists.newArrayList(AppTypeEnum.CM)).toPersonId(personId.toString()).bizType(BizTypeEnum.PENDING).build());
|
||||
}
|
||||
@ -554,8 +614,14 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
@Override
|
||||
public Boolean updateById(UpdatePendingMessageByIdRequest param) {
|
||||
log.info("the [{}] record is UpdatePendingMessageByIdRequest.", param);
|
||||
BizAssertions.assertFalse(
|
||||
StringUtils.isBlank(param.getRouterParam()) && StringUtils.isBlank(param.getBizParam()),
|
||||
"routerParam和bizParam至少要转一个");
|
||||
return pendingMessageRecordDao.lambdaUpdate()
|
||||
.set(PendingMessageRecord::getBizExtParam, param.getBizParam())
|
||||
.set(StringUtils.isNotBlank(param.getBizParam()),
|
||||
PendingMessageRecord::getBizExtParam, param.getBizParam())
|
||||
.set(StringUtils.isNotBlank(param.getRouterParam()),
|
||||
PendingMessageRecord::getRouterParams, param.getRouterParam())
|
||||
.eq(PendingMessageRecord::getId, param.getId())
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.update();
|
||||
@ -574,15 +640,15 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
List<PendingMessageRecord> value = entry.getValue();
|
||||
List<PendingMessageRecord> personRecords = new ArrayList<>(value.size());
|
||||
// 存在操作人
|
||||
if(null != param.getOperatorIdentityId()){
|
||||
if (null != param.getOperatorIdentityId()) {
|
||||
personRecords = ListUtils.emptyIfNull(value).stream().filter(e -> e.getExecutorId().equals(param.getOperatorIdentityId())).collect(Collectors.toList());
|
||||
}
|
||||
// 流程最终的记录
|
||||
List<PendingMessageRecord> pendingMessageRecords1 = CollectionUtils.isEmpty(personRecords) ? value : personRecords;
|
||||
// 获取最新的待办
|
||||
PendingMessageRecord maxRecord = pendingMessageRecords1.stream().max(Comparator.comparing(PendingMessageRecord::getId)).orElseGet(null);
|
||||
if(null != maxRecord){
|
||||
groupByMapFiltered.put(entry.getKey(),maxRecord);
|
||||
if (null != maxRecord) {
|
||||
groupByMapFiltered.put(entry.getKey(), maxRecord);
|
||||
}
|
||||
}
|
||||
List<PendingMessageRecord> groupByList = groupByMapFiltered.values().stream().collect(Collectors.toList());
|
||||
@ -621,7 +687,7 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
}
|
||||
authParam.putAll(routerParam);
|
||||
// 流程待办 - url无身份ID,手动拼接
|
||||
if(pendingMessageRecord.getBizCategory() == BizCategoryEnum.FLOW && (!authParam.containsKey("identityCode") || null == authParam.get("identityCode"))){
|
||||
if (pendingMessageRecord.getBizCategory() == BizCategoryEnum.FLOW && (!authParam.containsKey("identityCode") || null == authParam.get("identityCode"))) {
|
||||
authParam.put("identityCode", pendingMessageRecord.getIdentityCode());
|
||||
}
|
||||
msgTemplateRouter = MessageRouterUtil.parseRouteUrl(msgTemplateRouter, authParam);
|
||||
@ -709,9 +775,9 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
}
|
||||
LambdaQueryChainWrapper<PendingMessageRecord> query = pendingMessageRecordDao.lambdaQuery()
|
||||
.in(PendingMessageRecord::getTemplateCode, templateCodes)
|
||||
.eq(Objects.nonNull(param.getOuId()), PendingMessageRecord::getOuId, param.getOuId())
|
||||
.eq(PendingMessageRecord::getState, PendingMessageStateEnum.HAS_BEEN_SENT)
|
||||
.eq(PendingMessageRecord::getIsDelete,IsDeletedEnum.NO.getCode());
|
||||
.eq(PendingMessageRecord::getIsDelete, IsDeletedEnum.NO.getCode());
|
||||
appendExecutorOuIdExpr(query, param.getOuId());
|
||||
buildPersonCondition(query, param.getWithIdentify(), PendingMessageRoleCategoryEnum.EXECUTOR, param.getOperator());
|
||||
return pendingMessageRecordMapper.selecCustomSqlCount(query.getWrapper());
|
||||
}
|
||||
@ -802,6 +868,36 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
});
|
||||
}
|
||||
|
||||
private List<Long> appendExecutorOuIdExpr(LambdaQueryChainWrapper<PendingMessageRecord> query, Long ouId) {
|
||||
List<Long> ouIds = determineOuIds(ouId);
|
||||
if (ouIds.isEmpty()) return Collections.emptyList();
|
||||
query.and(expr -> expr
|
||||
// 查询ouId下面所有的平台班组id当成ouId
|
||||
.in(!ouIds.isEmpty(), PendingMessageRecord::getOuId, ouIds)
|
||||
.or()
|
||||
// 或者 ouId = 0 的数据
|
||||
.eq(PendingMessageRecord::getOuId, 0));
|
||||
return ouIds;
|
||||
}
|
||||
|
||||
private List<Long> determineOuIds(Long ouId) {
|
||||
if (ouId == null)
|
||||
return Collections.emptyList();
|
||||
List<Long> ouIds = new ArrayList<>();
|
||||
ouIds.add(ouId);
|
||||
if (ouId != 0) {
|
||||
ApiResult<List<OrganizationalTeamOuRelationResp>> resp =
|
||||
organizationalTeamOuRelationApi.teamOuRelationList(ouId);
|
||||
List<OrganizationalTeamOuRelationResp> relations =
|
||||
BizAssertions.assertResponse(resp, "获取平台班组id失败");
|
||||
relations.stream()
|
||||
.map(OrganizationalTeamOuRelationResp::getTeamOuId)
|
||||
.distinct()
|
||||
.forEach(ouIds::add);
|
||||
}
|
||||
return ouIds;
|
||||
}
|
||||
|
||||
private List<PendingMessageRecord> convert(PendingMessagePushParam param, MessageTemplateDTO msgTemplate,
|
||||
String requestNo, SimpleWorkspaceRes workspace) {
|
||||
// 多个执行者生成多条record
|
||||
@ -829,22 +925,25 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
}
|
||||
|
||||
private void buildPersonInfo(PendingMessageRecord record, PersonDTO promoter, PersonDTO executor, Long workspaceId) {
|
||||
record.setPromoterId(promoter.getIdentity().getId());
|
||||
record.setPromoterType(promoter.getIdentity().getType());
|
||||
IdentityDTO promoterIdentity = promoter.getIdentity();
|
||||
IdentityDTO executorIdentity = executor.getIdentity();
|
||||
record.setPromoterId(promoterIdentity == null ? 0 : promoterIdentity.getId());
|
||||
record.setPromoterType(promoterIdentity == null ? IdentityTypeEnum.NOT_SUPPORT : promoterIdentity.getType());
|
||||
record.setPromoterPersonId(promoter.getId());
|
||||
record.setPromoterName(promoter.getName());
|
||||
record.setExecutorId(executor.getIdentity().getId());
|
||||
record.setExecutorType(executor.getIdentity().getType());
|
||||
record.setExecutorId(executorIdentity == null ? 0 : executorIdentity.getId());
|
||||
record.setExecutorType(executorIdentity == null ? IdentityTypeEnum.NOT_SUPPORT : executorIdentity.getType());
|
||||
record.setExecutorPersonId(executor.getId());
|
||||
record.setExecutorName(executor.getName());
|
||||
// 执行人身份是从业人员,查询ouId
|
||||
record.setOuId(getPractitionOuId(executor, workspaceId,record.getOuId()));
|
||||
record.setOuId(getPractitionOuId(executor, workspaceId, record.getOuId()));
|
||||
}
|
||||
|
||||
private Long getPractitionOuId(PersonDTO executor, Long workspaceId, Long ouId) {
|
||||
Supplier<Long> executorOuIdFun = () -> ouId == null ? 0L : ouId;
|
||||
// 从业人员单位处理
|
||||
if (IdentityTypeEnum.PRACTITIONER == executor.getIdentity().getType()) {
|
||||
if(null == ouId){
|
||||
if (null == ouId) {
|
||||
OrganizationalNodePractitionerWideReqParams param = new OrganizationalNodePractitionerWideReqParams();
|
||||
param.setWorkspaceId(workspaceId);
|
||||
param.setIdentityId(executor.getIdentity().getId());
|
||||
@ -854,15 +953,15 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
if (null != result && null != result.getData() && null != result.getData().getOrganizationalUnitId()) {
|
||||
return result.getData().getOrganizationalUnitId();
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
// 业务传递了从业人员ouId
|
||||
return ouId;
|
||||
return executorOuIdFun.get();
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
// 非从业人员处理
|
||||
return 0L;
|
||||
return executorOuIdFun.get();
|
||||
}
|
||||
return 0L;
|
||||
return executorOuIdFun.get();
|
||||
}
|
||||
|
||||
private void buildTemplateInfo(PendingMessageRecord record, MessageTemplateDTO msgTemplate, String bizParam) {
|
||||
@ -870,7 +969,8 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
String title = PlaceholderResolver
|
||||
.getDefaultResolver().resolveByMap(msgTemplate.getTitle(), bizExtParam);
|
||||
String content = PlaceholderResolver
|
||||
.getDefaultResolver().resolveByMap(msgTemplate.getContent(), bizExtParam);;
|
||||
.getDefaultResolver().resolveByMap(msgTemplate.getContent(), bizExtParam);
|
||||
;
|
||||
// 获取模板卡片信息
|
||||
List<MessageCardContentItemDTO> rawCardContentItems = msgTemplate.getMsgCardContentItems();
|
||||
List<MessageCardContentItemDTO> cardContentItems = rawCardContentItems;
|
||||
|
||||
@ -25,6 +25,7 @@ import javax.annotation.Nullable;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@ -204,8 +205,14 @@ public final class MessageRouterUtil {
|
||||
|
||||
private static void concatRouterParam(Supplier<String> getUrlSupplier, Consumer<String> setUrlConsumer,
|
||||
JSONObject routerParam, boolean isConcat) {
|
||||
JSONObject copy = new JSONObject(routerParam);
|
||||
// 对第一层的值进行编码
|
||||
//for (String key : new HashSet<>(copy.keySet())) {
|
||||
// Object value = copy.get(key);
|
||||
// copy.put(key, tryEncode(value));
|
||||
//}
|
||||
// 替换原始URL中的参数变量
|
||||
String routerUrl = PlaceholderResolver.getDefaultResolver().resolveByMap(getUrlSupplier.get(), routerParam);
|
||||
String routerUrl = PlaceholderResolver.getDefaultResolver().resolveByMap(getUrlSupplier.get(), copy);
|
||||
// 将routerParam追加到原始的URL后面
|
||||
if (isConcat) {
|
||||
routerUrl = concatRouterParam(routerUrl, routerParam);
|
||||
@ -222,12 +229,7 @@ public final class MessageRouterUtil {
|
||||
if (originalUrl.contains(entry.getKey() + "=")) {
|
||||
continue;
|
||||
}
|
||||
String value = String.valueOf(entry.getValue());
|
||||
try {
|
||||
value = URLEncoder.encode(value, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
log.warn("error encode pending dynamic value. originalUrl={}, value={}", originalUrl, value);
|
||||
}
|
||||
String value = tryEncode(entry.getValue());
|
||||
paramBuilder.append("&").append(entry.getKey()).append("=").append(value);
|
||||
}
|
||||
if (StringUtils.isBlank(paramBuilder.toString())) {
|
||||
@ -240,6 +242,16 @@ public final class MessageRouterUtil {
|
||||
return originalUrl + paramBuilder;
|
||||
}
|
||||
|
||||
private static String tryEncode(Object o) {
|
||||
String value = String.valueOf(o);
|
||||
try {
|
||||
value = URLEncoder.encode(value, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
log.warn("error encode pending dynamic value. value={}", value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private static DetailRouterDTO convert(MessageRouteDetailDTO detailRouteStrategy, TerminalTypeEnum terminalType) {
|
||||
MessageRouterConfigDTO routerTerminal = select(detailRouteStrategy.getRouterConfigs(), terminalType);
|
||||
if (routerTerminal == null) {
|
||||
|
||||
@ -42,7 +42,7 @@ public class GeneralMessageOldDataStatisticRequest implements Serializable {
|
||||
if (identityId != null && identityType != null) {
|
||||
return Collections.singletonList(new IdentityDTO(identityId, identityType));
|
||||
}
|
||||
return identities;
|
||||
return identities == null ? Collections.emptyList() : identities;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -2,8 +2,22 @@ package cn.axzo.msg.center.service.pending.client;
|
||||
|
||||
import cn.axzo.msg.center.api.response.MessageDetailRes;
|
||||
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
||||
import cn.axzo.msg.center.service.pending.client.fallback.PendingMessageClientFallback;
|
||||
import cn.axzo.msg.center.service.pending.request.*;
|
||||
import cn.axzo.msg.center.service.pending.request.CompletePendingBySubCodeRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.CompletePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.CompletePendingMessageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageByBizCodeRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageCountUncompletedRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageFixedTemplatePageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageIterateRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessagePageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessagePushRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageQueryRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageStatisticRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.RevokePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.SetHideRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.UpdatePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.response.AnalysisPage;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageIterateResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageSimpleDTO;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageStatisticResponse;
|
||||
@ -13,7 +27,9 @@ import cn.azxo.framework.common.model.Page;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@ -27,8 +43,7 @@ import java.util.List;
|
||||
* @version 1.0
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(value = "msg-center", url = "${server.serviceUrl:http://msg-center:8080}",
|
||||
fallback = PendingMessageClientFallback.class)
|
||||
@FeignClient(value = "msg-center", url = "${server.serviceUrl:http://msg-center:8080}")
|
||||
public interface PendingMessageClient {
|
||||
|
||||
/**
|
||||
@ -57,7 +72,7 @@ public interface PendingMessageClient {
|
||||
* @return 代办列表
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/record/page", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Page<PendingMessageResponse>> pageQuery(@RequestBody @Valid PendingMessagePageRequest request);
|
||||
CommonResponse<AnalysisPage<PendingMessageResponse>> pageQuery(@RequestBody @Valid PendingMessagePageRequest request);
|
||||
|
||||
/**
|
||||
* 指定几种代办模型列表分页查询
|
||||
@ -107,6 +122,15 @@ public interface PendingMessageClient {
|
||||
@PostMapping(value = "/pending-message/push", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<List<PushPendingMessageDTO>> push(@RequestBody @Valid PendingMessagePushRequest request);
|
||||
|
||||
/**
|
||||
* 遍历待办数据
|
||||
*
|
||||
* @param request 代办核心参数
|
||||
* @return 代办唯一标识
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/iterate", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Page<PendingMessageIterateResponse>> iterate(@RequestBody @Valid PendingMessageIterateRequest request);
|
||||
|
||||
/**
|
||||
* 完成代办
|
||||
*
|
||||
|
||||
@ -1,143 +0,0 @@
|
||||
package cn.axzo.msg.center.service.pending.client.fallback;
|
||||
|
||||
import cn.axzo.msg.center.api.response.MessageDetailRes;
|
||||
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
||||
import cn.axzo.msg.center.service.pending.client.PendingMessageClient;
|
||||
import cn.axzo.msg.center.service.pending.request.*;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageSimpleDTO;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageStatisticResponse;
|
||||
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* client降级处理类
|
||||
* @author cold_blade
|
||||
* @date 2023/9/23
|
||||
* @version 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PendingMessageClientFallback implements PendingMessageClient {
|
||||
|
||||
@Override
|
||||
public CommonResponse<List<PendingMessageStatisticResponse>> groupStatistic(PendingMessageStatisticRequest request) {
|
||||
log.error("fall back while statistic pending message. req:{}", request);
|
||||
return CommonResponse.error("fall back while statistic pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Integer> countUncompleted(PendingMessageCountUncompletedRequest request) {
|
||||
log.error("fall back while counting pending message. req:{}", request);
|
||||
return CommonResponse.error("fall back while counting pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Page<PendingMessageResponse>> pageQuery(PendingMessagePageRequest request) {
|
||||
log.error("fall back while page querying pending message. req:{}", request);
|
||||
return CommonResponse.error("fall back while page querying pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<List<PendingMessageResponse>> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request) {
|
||||
log.error("fall back while page queryByTemplateCodes pending message. req:{}", request);
|
||||
return CommonResponse.error("fall back while page queryByTemplateCodes pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Page<MessageDetailRes>> compatiblePageQuery(PendingMessagePageRequest request) {
|
||||
log.error("fall back while page querying pending message. req:{}", request);
|
||||
return CommonResponse.error("fall back while page querying pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<PendingMessageResponse> query(PendingMessageQueryRequest request) {
|
||||
log.error("fall back while querying pending message. req:{}", request);
|
||||
return CommonResponse.error("fall back while querying pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<PendingMessageResponse> detail(String msgIdentityCode, TerminalTypeEnum terminalType) {
|
||||
log.error("fall back while querying pending message. msgIdentityCode:[{}], terminalType:[{}]",
|
||||
msgIdentityCode, terminalType);
|
||||
return CommonResponse.error("fall back while querying pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<List<PushPendingMessageDTO>> push(PendingMessagePushRequest request) {
|
||||
log.error("fall back while push pending message. request:{}", request);
|
||||
return CommonResponse.error("fall back while push pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> complete(String msgIdentityCode) {
|
||||
log.error("fall back while completing pending message. msgIdentityCode:[{}]", msgIdentityCode);
|
||||
return CommonResponse.error("fall back while completing pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> completeById(CompletePendingMessageByIdRequest param) {
|
||||
log.error("fall back while completing pending message. CompletePendingMessageByIdRequest:[{}]", param);
|
||||
return CommonResponse.error("fall back while completing pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> revoke(String msgIdentityCode) {
|
||||
log.error("fall back while revoking pending message. msgIdentityCode:[{}]", msgIdentityCode);
|
||||
return CommonResponse.error("fall back while revoking pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> revokeByMsgId(String msgIdentityCode) {
|
||||
log.error("fall back while revoking pending message by id. msgIdentityCode:[{}]", msgIdentityCode);
|
||||
return CommonResponse.error("fall back while revoking pending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> completeByTemplateCodeBizCode(CompletePendingMessageRequest param) {
|
||||
log.error("fall back while completing pending message by biz code. request:[{}]", param);
|
||||
return CommonResponse.error("fall back while completing pending message by biz code");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> completeByTemplateCodeSubBizCode(CompletePendingBySubCodeRequest param) {
|
||||
log.error("fall back while completing pending message by sub biz code. request:[{}]", param);
|
||||
return CommonResponse.error("fall back while completing pending message by sub biz code");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> revokeByTemplateCodeBizCode(CompletePendingMessageRequest param) {
|
||||
log.error("fall back while revoking pending message by biz code. msgIdentityCode:[{}]", param);
|
||||
return CommonResponse.error("fall back while revoking pending message by biz code");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> revokeById(RevokePendingMessageByIdRequest param) {
|
||||
log.error("fall back while revoking pending message by ID. param:[{}]", param);
|
||||
return CommonResponse.error("fall back while revoking pending message by ID");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> updateById(UpdatePendingMessageByIdRequest param) {
|
||||
log.error("fall back while updateById pending message update by ID. param:[{}]", param);
|
||||
return CommonResponse.error("fall back while revoking pending message update by ID");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<List<PendingMessageSimpleDTO>> getLatestByBizCode(PendingMessageByBizCodeRequest param) {
|
||||
log.error("fall back while getLatestByBizCode pending message update by ID. param:[{}]", param);
|
||||
return CommonResponse.error("fall back while revoking pending message update by ID");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> setHide(SetHideRequest req) {
|
||||
log.error("fall back setHide. req={}", req);
|
||||
return CommonResponse.error("fall back while invoking setHide");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package cn.axzo.msg.center.service.pending.request;
|
||||
|
||||
import cn.axzo.core.domain.PageRequest;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class PendingMessageIterateRequest extends PageRequest {
|
||||
@NotBlank(message = "templateCode is required")
|
||||
private String templateCode;
|
||||
private String bizCode;
|
||||
// 在某个时间点后创建的 create_at <= ${cratedAtAfter}
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date cratedAtAfter;
|
||||
}
|
||||
@ -105,6 +105,14 @@ public class PendingMessagePageRequest extends PageRequest implements Serializab
|
||||
*/
|
||||
private Collection<QueryOrderByDTO> orderFields;
|
||||
|
||||
// !! 用于排查问题
|
||||
private String fetchTemplateCode;
|
||||
private int fetchLimit = 5;
|
||||
|
||||
public PendingMessageRoleCategoryEnum determineRoleCategory() {
|
||||
return roleCategory != null ? roleCategory : PendingMessageRoleCategoryEnum.EXECUTOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
|
||||
@ -24,7 +24,11 @@ public class UpdatePendingMessageByIdRequest {
|
||||
/**
|
||||
* 关联业务主键
|
||||
*/
|
||||
@NotNull(message = "bizParam不能为空")
|
||||
private String bizParam;
|
||||
|
||||
/**
|
||||
* 关联业务主键
|
||||
*/
|
||||
private String routerParam;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
package cn.axzo.msg.center.service.pending.response;
|
||||
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
public class AnalysisPage<T> extends Page<T> {
|
||||
|
||||
private TreeMap<String, Object> analysis = new TreeMap<>();
|
||||
private boolean enableAnalysis;
|
||||
|
||||
public AnalysisPage() {
|
||||
}
|
||||
|
||||
public AnalysisPage(Long pageNum, Long pageSize, Long totalElements, List<T> list) {
|
||||
super(pageNum, pageSize, totalElements, list);
|
||||
}
|
||||
|
||||
public static <T> AnalysisPage<T> toPage(Long pageNum, Long pageSize, Long totalCount, List<T> list) {
|
||||
return new AnalysisPage<>(pageNum, pageSize, totalCount, list);
|
||||
}
|
||||
|
||||
public static <T> AnalysisPage<T> emptyPage(Long pageNum, Long pageSize) {
|
||||
return toPage(pageNum, pageSize, 0L, Collections.emptyList());
|
||||
}
|
||||
|
||||
public AnalysisPage<T> copy() {
|
||||
AnalysisPage<T> copy = new AnalysisPage<>();
|
||||
copy.setPageNum(getPageNum());
|
||||
copy.setPageSize(getPageSize());
|
||||
copy.setTotalElements(getTotalElements());
|
||||
copy.setList(new ArrayList<>(getList()));
|
||||
copy.setEnableAnalysis(enableAnalysis);
|
||||
copy.addAnalysis(analysis);
|
||||
return copy;
|
||||
}
|
||||
|
||||
public void addAnalysis(Map<String, Object> analysis) {
|
||||
if (enableAnalysis) {
|
||||
this.analysis.putAll(analysis);
|
||||
}
|
||||
}
|
||||
|
||||
public void addAnalysis(String key, Object value) {
|
||||
if (enableAnalysis) {
|
||||
analysis.put(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
public TreeMap<String, Object> getAnalysis() {
|
||||
return analysis;
|
||||
}
|
||||
|
||||
public void setAnalysis(TreeMap<String, Object> analysis) {
|
||||
this.analysis = analysis;
|
||||
}
|
||||
|
||||
public boolean isEnableAnalysis() {
|
||||
return enableAnalysis;
|
||||
}
|
||||
|
||||
public void setEnableAnalysis(boolean enableAnalysis) {
|
||||
this.enableAnalysis = enableAnalysis;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
package cn.axzo.msg.center.service.pending.response;
|
||||
|
||||
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 cn.axzo.msg.center.service.enums.PendingMessageStateEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class PendingMessageIterateResponse {
|
||||
private Long id;
|
||||
/**
|
||||
* 消息的唯一标识
|
||||
*/
|
||||
private String identityCode;
|
||||
/**
|
||||
* 请求批次号
|
||||
*/
|
||||
private String requestNo;
|
||||
/**
|
||||
* 发起者ID
|
||||
*/
|
||||
private Long promoterId;
|
||||
/**
|
||||
* 发起者的自然人ID
|
||||
*/
|
||||
private Long promoterPersonId;
|
||||
/**
|
||||
* 发起者姓名
|
||||
*/
|
||||
private String promoterName;
|
||||
/**
|
||||
* 发起者身份
|
||||
*/
|
||||
private IdentityTypeEnum promoterType;
|
||||
/**
|
||||
* 执行者ID
|
||||
*/
|
||||
private Long executorId;
|
||||
/**
|
||||
* 执行者的自然人ID
|
||||
*/
|
||||
private Long executorPersonId;
|
||||
/**
|
||||
* 执行者姓名
|
||||
*/
|
||||
private String executorName;
|
||||
/**
|
||||
* 执行者身份
|
||||
*/
|
||||
private IdentityTypeEnum executorType;
|
||||
/**
|
||||
* 模板编码
|
||||
*/
|
||||
private String templateCode;
|
||||
/**
|
||||
* 消息标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 消息所属组织类型
|
||||
*/
|
||||
private OrganizationTypeEnum orgType;
|
||||
/**
|
||||
* 消息所属组织Id
|
||||
*/
|
||||
private Long orgId;
|
||||
/**
|
||||
* 消息所属组织名称
|
||||
*/
|
||||
private String orgName;
|
||||
/**
|
||||
* 消息所属企业ID
|
||||
*/
|
||||
private Long ouId;
|
||||
/**
|
||||
* 待办状态
|
||||
*/
|
||||
private PendingMessageStateEnum state;
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private BizCategoryEnum bizCategory;
|
||||
/**
|
||||
* 关联业务主键
|
||||
*/
|
||||
private String bizCode;
|
||||
/**
|
||||
* 流程类代办的流程结点编码
|
||||
*/
|
||||
private String subBizCode;
|
||||
/**
|
||||
* 业务描述eg:流程结点描述
|
||||
*/
|
||||
private String bizDesc;
|
||||
/**
|
||||
* 业务标签
|
||||
*/
|
||||
private String bizFlag;
|
||||
/**
|
||||
* 业务扩展参数
|
||||
*/
|
||||
private String bizExtParam;
|
||||
/**
|
||||
* 路由参数(留存)
|
||||
*/
|
||||
private String routerParams;
|
||||
/**
|
||||
* 业务终态,可为空
|
||||
*/
|
||||
private BizFinalStateEnum bizFinalState;
|
||||
/**
|
||||
* 待办的截止时间
|
||||
*/
|
||||
private Date deadline;
|
||||
}
|
||||
@ -61,10 +61,6 @@ public class MessageRecordDao extends
|
||||
public void readMsg(InsideCmsReadMsgReq req,
|
||||
Long personId, Long identityId) {
|
||||
lambdaUpdate().set(MessageRecord::getState, MsgStateEnum.HAVE_READ)
|
||||
.and(i -> i.and(
|
||||
a -> a.eq(MessageRecord::getPersonId, personId).eq(MessageRecord::getReceiveType,
|
||||
ReceiveTypeEnum.NOT_IDENTITY)).or()
|
||||
.eq(MessageRecord::getToId, identityId))
|
||||
.eq(MessageRecord::getIsDelete, 0L)
|
||||
.eq(req.getMsgId() != -1L, MessageRecord::getId, req.getMsgId())
|
||||
.eq(MessageRecord::getType, MsgTypeEnum.GENERAL_MESSAGE)
|
||||
@ -72,9 +68,9 @@ public class MessageRecordDao extends
|
||||
}
|
||||
|
||||
public void readAllMsg(InsideCmsReadMsgReq req, Long personId, Long identityId) {
|
||||
List<MessageRecord> list = this.lambdaQuery().and(i -> i.and(
|
||||
a -> a.eq(MessageRecord::getPersonId, personId).eq(MessageRecord::getReceiveType,
|
||||
ReceiveTypeEnum.NOT_IDENTITY)).or()
|
||||
List<MessageRecord> list = this.lambdaQuery()
|
||||
.and(nested -> nested.eq(MessageRecord::getPersonId, personId)
|
||||
.or()
|
||||
.eq(MessageRecord::getToId, identityId))
|
||||
.eq(MessageRecord::getIsDelete, 0L)
|
||||
.eq(MessageRecord::getType, MsgTypeEnum.GENERAL_MESSAGE)
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.axzo.msg.center.inside.notices.service;
|
||||
|
||||
import cn.axzo.msg.center.MsgCenterApplication;
|
||||
import cn.axzo.msg.center.api.enums.BizTypeEnum;
|
||||
import cn.axzo.msg.center.api.request.CmsReadMsgReq;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.Commit;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
* @author yanglin
|
||||
*/
|
||||
@SpringBootTest(classes = MsgCenterApplication.class)
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
class MessageRecordServiceTest {
|
||||
|
||||
private final MessageRecordService messageRecordService;
|
||||
|
||||
@Test
|
||||
@Commit
|
||||
void foo() {
|
||||
// CmsReadMsgReq(msgId=1790536, personId=9000399060, identityId=2004201, bizTypeEnum=CONSTRUCTION)
|
||||
CmsReadMsgReq req = new CmsReadMsgReq();
|
||||
req.setMsgId(1790536L);
|
||||
req.setPersonId(9000399060L);
|
||||
req.setPersonId(2004201L);
|
||||
req.setBizTypeEnum(BizTypeEnum.CONSTRUCTION);
|
||||
messageRecordService.updateReadMsgStatus(req);
|
||||
}
|
||||
|
||||
}
|
||||
@ -18,7 +18,6 @@ class PendingMessageNewServiceTest {
|
||||
private final PendingMessageNewService pendingMessageNewService;
|
||||
|
||||
@Test
|
||||
@Commit
|
||||
void foo() {
|
||||
String str = "{\"bizCategory\":\"OTHER\",\"bizCode\":\"200000700321808\",\"bizExtParams\":\"{\\\"teamLeaderName\\\":\\\"袁均清\\\"}\",\"executor\":[{\"id\":16562,\"identity\":{\"id\":0,\"type\":\"NOT_SUPPORT\",\"valid\":true},\"name\":\"马元猛\",\"valid\":true},{\"id\":16563,\"identity\":{\"id\":0,\"type\":\"NOT_SUPPORT\",\"valid\":true},\"name\":\"辛宁\",\"valid\":true}],\"orgType\":\"PROJECT\",\"ouId\":6066,\"promoter\":{\"id\":16444,\"identity\":{\"id\":2004889,\"type\":\"PRACTITIONER\",\"valid\":true},\"name\":\"袁均清\",\"valid\":true},\"routerParams\":\"{\\\"acceptanceNo\\\":\\\"700013411\\\",\\\"status\\\":\\\"1\\\"}\",\"templateCode\":\"52ae3e8ec48242e485e9389202e102ce\",\"workspaceId\":375}";
|
||||
PendingMessagePushParam param = JSON.parseObject(str, PendingMessagePushParam.class);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user