Merge branch 'feature/REQ-1634' into 'dev'
+获取人员到msg See merge request universal/infrastructure/backend/msg-center-plat!82
This commit is contained in:
commit
f2adcaaa5a
@ -117,6 +117,10 @@
|
|||||||
<groupId>cn.axzo.apollo</groupId>
|
<groupId>cn.axzo.apollo</groupId>
|
||||||
<artifactId>apollo-workspace-api</artifactId>
|
<artifactId>apollo-workspace-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.axzo.basics</groupId>
|
||||||
|
<artifactId>basics-profiles-api</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package cn.axzo.msg.center.message.controller;
|
package cn.axzo.msg.center.message.controller;
|
||||||
|
|
||||||
|
import cn.axzo.framework.auth.annotation.PreBuildContext;
|
||||||
import cn.axzo.msg.center.api.response.MessageDetailRes;
|
import cn.axzo.msg.center.api.response.MessageDetailRes;
|
||||||
import cn.axzo.msg.center.message.domain.dto.PendingMessageDTO;
|
import cn.axzo.msg.center.message.domain.dto.PendingMessageDTO;
|
||||||
import cn.axzo.msg.center.message.domain.dto.PendingMessageStatisticDTO;
|
import cn.axzo.msg.center.message.domain.dto.PendingMessageStatisticDTO;
|
||||||
@ -11,6 +12,7 @@ import cn.axzo.msg.center.service.pending.client.PendingMessageClient;
|
|||||||
import cn.axzo.msg.center.service.pending.request.*;
|
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.PendingMessageResponse;
|
||||||
import cn.axzo.msg.center.service.pending.response.PendingMessageStatisticResponse;
|
import cn.axzo.msg.center.service.pending.response.PendingMessageStatisticResponse;
|
||||||
|
import cn.axzo.msg.center.service.pending.response.PendingMessageWorkerResponse;
|
||||||
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
||||||
import cn.azxo.framework.common.model.CommonResponse;
|
import cn.azxo.framework.common.model.CommonResponse;
|
||||||
import cn.azxo.framework.common.model.Page;
|
import cn.azxo.framework.common.model.Page;
|
||||||
@ -30,6 +32,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@PreBuildContext
|
||||||
public class PendingMessageNewController implements PendingMessageClient {
|
public class PendingMessageNewController implements PendingMessageClient {
|
||||||
|
|
||||||
private final PendingMessageNewService pendingMessageNewService;
|
private final PendingMessageNewService pendingMessageNewService;
|
||||||
@ -56,7 +59,7 @@ public class PendingMessageNewController implements PendingMessageClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResponse<List<PendingMessageResponse>> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request) {
|
public CommonResponse<List<PendingMessageWorkerResponse>> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request) {
|
||||||
return CommonResponse.success(pendingMessageNewService.getPendingMessageByAppWorker(request));
|
return CommonResponse.success(pendingMessageNewService.getPendingMessageByAppWorker(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import cn.axzo.msg.center.message.domain.param.PendingMessagePushParam;
|
|||||||
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
||||||
import cn.axzo.msg.center.service.pending.request.*;
|
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.PendingMessageResponse;
|
||||||
|
import cn.axzo.msg.center.service.pending.response.PendingMessageWorkerResponse;
|
||||||
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
||||||
import cn.azxo.framework.common.model.Page;
|
import cn.azxo.framework.common.model.Page;
|
||||||
|
|
||||||
@ -63,7 +64,7 @@ public interface PendingMessageNewService {
|
|||||||
* @param request 分页查询相关参数
|
* @param request 分页查询相关参数
|
||||||
* @return 代办列表
|
* @return 代办列表
|
||||||
*/
|
*/
|
||||||
List<PendingMessageResponse> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request);
|
List<PendingMessageWorkerResponse> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代办列表分页查询
|
* 代办列表分页查询
|
||||||
|
|||||||
@ -0,0 +1,38 @@
|
|||||||
|
package cn.axzo.msg.center.message.service.impl;
|
||||||
|
|
||||||
|
import cn.axzo.basics.common.util.AssertUtil;
|
||||||
|
import cn.axzo.framework.auth.domain.TerminalInfo;
|
||||||
|
import cn.axzo.msg.center.service.enums.AppTerminalTypeEnum;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author cold_blade
|
||||||
|
* @date 2023/11/9
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
|
public final class AppTerminalHelper {
|
||||||
|
|
||||||
|
public static AppTerminalTypeEnum parseTerminalInfo(TerminalInfo terminalInfo) {
|
||||||
|
AssertUtil.notNull(terminalInfo, "terminalInfo can not be null");
|
||||||
|
if (terminalInfo.isOMS_WEB()) {
|
||||||
|
return AppTerminalTypeEnum.OMS_WEB_PC;
|
||||||
|
}
|
||||||
|
if (terminalInfo.isCMS()) {
|
||||||
|
return AppTerminalTypeEnum.CMS_WEB_PC;
|
||||||
|
}
|
||||||
|
if (isCMP(terminalInfo)) {
|
||||||
|
return AppTerminalTypeEnum.B_ENTERPRISE_APP;
|
||||||
|
}
|
||||||
|
if (terminalInfo.isCM()) {
|
||||||
|
return AppTerminalTypeEnum.C_WORKER_APP;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isCMP(TerminalInfo terminalInfo) {
|
||||||
|
return terminalInfo.isCMP() ||
|
||||||
|
terminalInfo.isCM_APP_CM_LEADER();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,9 @@ import cn.axzo.apollo.workspace.api.workspace.WorkspaceApi;
|
|||||||
import cn.axzo.apollo.workspace.api.workspace.req.OrganizationalNodePractitionerWideReqParams;
|
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.OrganizationalNodePractitionerWideDto;
|
||||||
import cn.axzo.apollo.workspace.api.workspace.res.SimpleWorkspaceRes;
|
import cn.axzo.apollo.workspace.api.workspace.res.SimpleWorkspaceRes;
|
||||||
|
import cn.axzo.basics.profiles.api.UserProfileServiceApi;
|
||||||
|
import cn.axzo.basics.profiles.dto.basic.PersonProfileDto;
|
||||||
|
import cn.axzo.framework.auth.domain.ContextInfoHolder;
|
||||||
import cn.axzo.framework.core.util.MapUtil;
|
import cn.axzo.framework.core.util.MapUtil;
|
||||||
import cn.axzo.msg.center.api.enums.MsgRecordTerminalTypeEnum;
|
import cn.axzo.msg.center.api.enums.MsgRecordTerminalTypeEnum;
|
||||||
import cn.axzo.msg.center.api.enums.MsgStateEnum;
|
import cn.axzo.msg.center.api.enums.MsgStateEnum;
|
||||||
@ -31,14 +34,17 @@ import cn.axzo.msg.center.service.dto.*;
|
|||||||
import cn.axzo.msg.center.service.enums.*;
|
import cn.axzo.msg.center.service.enums.*;
|
||||||
import cn.axzo.msg.center.service.pending.request.*;
|
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.PendingMessageResponse;
|
||||||
|
import cn.axzo.msg.center.service.pending.response.PendingMessageWorkerResponse;
|
||||||
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
||||||
import cn.axzo.msg.center.utils.*;
|
import cn.axzo.msg.center.utils.*;
|
||||||
|
import cn.azxo.framework.common.model.CommonResponse;
|
||||||
import cn.azxo.framework.common.model.Page;
|
import cn.azxo.framework.common.model.Page;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -46,7 +52,10 @@ import org.apache.commons.collections.CollectionUtils;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -71,6 +80,17 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
|||||||
private final WorkspaceApi workspaceApi;
|
private final WorkspaceApi workspaceApi;
|
||||||
private final OrganizationalNodePractitionerWideApi organizationalNodePractitionerWideApi;
|
private final OrganizationalNodePractitionerWideApi organizationalNodePractitionerWideApi;
|
||||||
private final PendingCalendarCodeConfig calendarCodeConfig;
|
private final PendingCalendarCodeConfig calendarCodeConfig;
|
||||||
|
private final UserProfileServiceApi userProfileServiceApi;
|
||||||
|
|
||||||
|
private static final ImmutableSet<String> CLOCK_IN_TEMPLATES = ImmutableSet.of(
|
||||||
|
// todo wuyu 进场打卡code
|
||||||
|
"xxx"
|
||||||
|
);
|
||||||
|
|
||||||
|
private static final ImmutableSet<String> CONSTRUCTION_TEMPLATES = ImmutableSet.of(
|
||||||
|
"d1d4793c84e14d20ae1cbc399338efa3",
|
||||||
|
"367ba552bb374049a73e737ac3b8b08c"
|
||||||
|
);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PendingMessageStatisticDTO> groupStatistic(MessageGroupNodeStatisticParam param) {
|
public List<PendingMessageStatisticDTO> groupStatistic(MessageGroupNodeStatisticParam param) {
|
||||||
@ -166,16 +186,87 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PendingMessageResponse> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request) {
|
public List<PendingMessageWorkerResponse> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request1) {
|
||||||
|
PendingMessageFixedDTO request = new PendingMessageFixedDTO();
|
||||||
|
Long personId = ContextInfoHolder.get().getUserInfo().getPersonId();
|
||||||
|
request.setPersonId(personId);
|
||||||
|
buildTerminalInfo(request);
|
||||||
List<PendingMessageResponse> result = new ArrayList<>();
|
List<PendingMessageResponse> result = new ArrayList<>();
|
||||||
PendingCalendarCodeDTO calendarCodeDTO = buildCalendarCodesDTO(calendarCodeConfig);
|
PendingCalendarCodeDTO calendarCodeDTO = buildCalendarCodesDTO(calendarCodeConfig);
|
||||||
List<PendingMessageRecord> pendingMessageRecords = pendingMessageRecordMapper.queryByTemplateCodes(calendarCodeDTO,request.getWorkspaceId(),request.getSelectDate(),request.getPersonId());
|
Long selectDate = request.getSelectDate();
|
||||||
|
Date date = new Date(selectDate);
|
||||||
|
List<PendingMessageRecord> pendingMessageRecords = pendingMessageRecordMapper.queryByTemplateCodes(calendarCodeDTO,null,date,request.getPersonId());
|
||||||
List<MessageTemplateDTO> messageTemplates = messageTemplateNewService.listByTemplateCodes(calendarCodeConfig.getCalendarAllCodes());
|
List<MessageTemplateDTO> messageTemplates = messageTemplateNewService.listByTemplateCodes(calendarCodeConfig.getCalendarAllCodes());
|
||||||
result = pendingMessageRecords.stream()
|
result = pendingMessageRecords.stream()
|
||||||
.map(e -> convert(e, messageTemplates).toResponse(request.getTerminalType()))
|
.map(e -> convert(e, messageTemplates).toResponse(request.getTerminalType()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
// 构建分页结构返回
|
// 处理结果
|
||||||
return result;
|
List<Long> personIds = result.stream()
|
||||||
|
.map(PendingMessageResponse::getPromoterPersonId)
|
||||||
|
// 过滤掉系统类型的用户
|
||||||
|
.filter(e -> Objects.nonNull(e) && e > 0L)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, PersonProfileDto> personNameMap = listPersonProfiles(personIds);
|
||||||
|
List<PendingMessageWorkerResponse> result1 = result.stream()
|
||||||
|
.map(e -> {
|
||||||
|
PendingMessageWorkerResponse response = PendingMessageWorkerResponse.from(e);
|
||||||
|
response.setPendingMessageIcon("https://axzo-public.oss-cn-chengdu.aliyuncs.com/oms/test/1700117137592-IMG_0640.HEIC.JPG.JPG");
|
||||||
|
if(e.getState() == PendingMessageStateEnum.COMPLETED){
|
||||||
|
response.setPendingMessageStatus(1);
|
||||||
|
response.setButtonDesc("已完成");
|
||||||
|
}else if(e.getState() == PendingMessageStateEnum.HAS_BEEN_SENT){
|
||||||
|
response.setPendingMessageStatus(2);
|
||||||
|
response.setButtonDesc("去处理");
|
||||||
|
}else{
|
||||||
|
response.setPendingMessageStatus(1);
|
||||||
|
response.setButtonDesc("未知状态");
|
||||||
|
}
|
||||||
|
if (CONSTRUCTION_TEMPLATES.contains(e.getTemplateCode())) {
|
||||||
|
PersonProfileDto personProfile = personNameMap.get(e.getPromoterPersonId());
|
||||||
|
String avatarUrl = null;
|
||||||
|
if (Objects.nonNull(personProfile)) {
|
||||||
|
avatarUrl = personProfile.getAvatarUrl();
|
||||||
|
}
|
||||||
|
Long createTimestamp = e.getCreateTimestamp();
|
||||||
|
String desc = Instant.ofEpochMilli(createTimestamp).atZone(ZoneId.of("Asia/Shanghai")).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
response.setMessageCommonHandleInfo(PendingMessageWorkerResponse.MessageCommonHandleInfo.from(avatarUrl, desc, 1));
|
||||||
|
} else if (CLOCK_IN_TEMPLATES.contains(e.getTemplateCode())) {
|
||||||
|
// 进场打卡只展示 打卡时间
|
||||||
|
String desc = "打卡时间:xxx";
|
||||||
|
response.setMessageCommonHandleInfo(PendingMessageWorkerResponse.MessageCommonHandleInfo.from(null, desc, 1));
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
return result1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Long, PersonProfileDto> listPersonProfiles(List<Long> personIds) {
|
||||||
|
List<Long> subPersonIds = personIds.stream().filter(e -> e > 0L).collect(Collectors.toList());
|
||||||
|
if (subPersonIds.isEmpty()) {
|
||||||
|
log.info("there is not any valid person id.");
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
CommonResponse<List<PersonProfileDto>> personProfiles = userProfileServiceApi.getPersonProfiles(personIds);
|
||||||
|
List<PersonProfileDto> personProfileDto = personProfiles.getData();
|
||||||
|
if (null != personProfiles && CollectionUtils.isNotEmpty(personProfileDto)) {
|
||||||
|
return personProfileDto.stream()
|
||||||
|
.collect(Collectors.toMap(PersonProfileDto::getId, Function.identity()));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("通过自然人id获取姓名失败:{}", e.getMessage());
|
||||||
|
}
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buildTerminalInfo(PendingMessageFixedDTO request) {
|
||||||
|
TerminalTypeEnum terminalType = TerminalTypeEnum
|
||||||
|
.descOf(ContextInfoHolder.get().getSystemAndDeviceInfo().getSystemType());
|
||||||
|
request.setTerminalType(terminalType);
|
||||||
|
AppTerminalTypeEnum appTerminalType = AppTerminalHelper
|
||||||
|
.parseTerminalInfo(ContextInfoHolder.get().getTerminalInfo());
|
||||||
|
request.setAppTerminalType(appTerminalType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PendingCalendarCodeDTO buildCalendarCodesDTO(PendingCalendarCodeConfig calendarCodeConfig) {
|
private PendingCalendarCodeDTO buildCalendarCodesDTO(PendingCalendarCodeConfig calendarCodeConfig) {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import cn.axzo.msg.center.service.pending.client.fallback.PendingMessageClientFa
|
|||||||
import cn.axzo.msg.center.service.pending.request.*;
|
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.PendingMessageResponse;
|
||||||
import cn.axzo.msg.center.service.pending.response.PendingMessageStatisticResponse;
|
import cn.axzo.msg.center.service.pending.response.PendingMessageStatisticResponse;
|
||||||
|
import cn.axzo.msg.center.service.pending.response.PendingMessageWorkerResponse;
|
||||||
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
||||||
import cn.azxo.framework.common.model.CommonResponse;
|
import cn.azxo.framework.common.model.CommonResponse;
|
||||||
import cn.azxo.framework.common.model.Page;
|
import cn.azxo.framework.common.model.Page;
|
||||||
@ -67,7 +68,7 @@ public interface PendingMessageClient {
|
|||||||
* @return 代办列表
|
* @return 代办列表
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/pending-message/getPendingMessageByAppWorker", produces = {MediaType.APPLICATION_JSON_VALUE})
|
@PostMapping(value = "/pending-message/getPendingMessageByAppWorker", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||||
CommonResponse<List<PendingMessageResponse>> getPendingMessageByAppWorker(@RequestBody @Valid PendingMessageFixedTemplatePageRequest request);
|
CommonResponse<List<PendingMessageWorkerResponse>> getPendingMessageByAppWorker(@RequestBody @Valid PendingMessageFixedTemplatePageRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代办列表分页查询
|
* 代办列表分页查询
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import cn.axzo.msg.center.service.pending.client.PendingMessageClient;
|
|||||||
import cn.axzo.msg.center.service.pending.request.*;
|
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.PendingMessageResponse;
|
||||||
import cn.axzo.msg.center.service.pending.response.PendingMessageStatisticResponse;
|
import cn.axzo.msg.center.service.pending.response.PendingMessageStatisticResponse;
|
||||||
|
import cn.axzo.msg.center.service.pending.response.PendingMessageWorkerResponse;
|
||||||
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
import cn.axzo.msg.center.service.pending.response.PushPendingMessageDTO;
|
||||||
import cn.azxo.framework.common.model.CommonResponse;
|
import cn.azxo.framework.common.model.CommonResponse;
|
||||||
import cn.azxo.framework.common.model.Page;
|
import cn.azxo.framework.common.model.Page;
|
||||||
@ -44,7 +45,7 @@ public class PendingMessageClientFallback implements PendingMessageClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResponse<List<PendingMessageResponse>> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request) {
|
public CommonResponse<List<PendingMessageWorkerResponse>> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request) {
|
||||||
log.error("fall back while page queryByTemplateCodes pending message. req:{}", request);
|
log.error("fall back while page queryByTemplateCodes pending message. req:{}", request);
|
||||||
return CommonResponse.error("fall back while page queryByTemplateCodes pending message");
|
return CommonResponse.error("fall back while page queryByTemplateCodes pending message");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,34 @@
|
|||||||
|
package cn.axzo.msg.center.service.pending.request;
|
||||||
|
|
||||||
|
import cn.axzo.msg.center.service.enums.AppTerminalTypeEnum;
|
||||||
|
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description
|
||||||
|
* 代办记录分页查询参数的数模型
|
||||||
|
* @author cold_blade
|
||||||
|
* @date 2023/9/23
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
public class PendingMessageFixedDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 7172093131252325471L;
|
||||||
|
/**
|
||||||
|
* 筛选时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "date is required")
|
||||||
|
private Long selectDate;
|
||||||
|
|
||||||
|
private Long personId;
|
||||||
|
|
||||||
|
private TerminalTypeEnum terminalType;
|
||||||
|
|
||||||
|
private AppTerminalTypeEnum appTerminalType;
|
||||||
|
}
|
||||||
@ -1,16 +1,11 @@
|
|||||||
package cn.axzo.msg.center.service.pending.request;
|
package cn.axzo.msg.center.service.pending.request;
|
||||||
|
|
||||||
import cn.axzo.basics.common.page.PageRequest;
|
|
||||||
import cn.axzo.msg.center.service.enums.AppTerminalTypeEnum;
|
|
||||||
import cn.axzo.msg.center.service.enums.IdentityTypeEnum;
|
|
||||||
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description
|
* @description
|
||||||
@ -23,47 +18,12 @@ import java.util.Date;
|
|||||||
@Getter
|
@Getter
|
||||||
public class PendingMessageFixedTemplatePageRequest implements Serializable {
|
public class PendingMessageFixedTemplatePageRequest implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7172093131252325437L;
|
private static final long serialVersionUID = 7172093131252325471L;
|
||||||
/**
|
|
||||||
* 当前登录账户的自然id(前端不care)
|
|
||||||
*/
|
|
||||||
@NotNull(message = "personId is required")
|
|
||||||
private Long personId;
|
|
||||||
/**
|
|
||||||
* 当前登录账户的身份id(前端不care)
|
|
||||||
*/
|
|
||||||
private Long identityId;
|
|
||||||
/**
|
|
||||||
* 当前登录账户的身份类型(前端不care)
|
|
||||||
*/
|
|
||||||
private IdentityTypeEnum identityType;
|
|
||||||
/**
|
|
||||||
* 应用终端
|
|
||||||
*/
|
|
||||||
private AppTerminalTypeEnum appTerminalType;
|
|
||||||
/**
|
|
||||||
* 单位id
|
|
||||||
*/
|
|
||||||
private Long ouId;
|
|
||||||
/**
|
/**
|
||||||
* 筛选时间
|
* 筛选时间
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "date is required")
|
@NotNull(message = "date is required")
|
||||||
private Date selectDate;
|
private Long selectDate;
|
||||||
/**
|
|
||||||
* 工作台id
|
|
||||||
*/
|
|
||||||
private Long workspaceId;
|
|
||||||
/**
|
|
||||||
* APP终端类型(前端不care)
|
|
||||||
* WEB: web端页面
|
|
||||||
* MINI_PROGRAM: 安心筑小程序端页面
|
|
||||||
* IOS: 原生IOS端页面
|
|
||||||
* ANDROID: 原生Android端页面
|
|
||||||
* WEB_VIEW: H5页面
|
|
||||||
* WECHAT_MINI_PROGRAM: 微信小程序页面
|
|
||||||
*/
|
|
||||||
private TerminalTypeEnum terminalType;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
@ -0,0 +1,106 @@
|
|||||||
|
package cn.axzo.msg.center.service.pending.response;
|
||||||
|
|
||||||
|
import cn.axzo.core.utils.converter.BeanConverter;
|
||||||
|
import cn.axzo.msg.center.service.dto.DetailRouterDTO;
|
||||||
|
import cn.axzo.msg.center.service.dto.MessageCardContentItemDTO;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author cold_blade
|
||||||
|
* @date 2023/10/6
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PendingMessageWorkerResponse implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -8149077075270743771L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息的唯一标识
|
||||||
|
*/
|
||||||
|
private String identityCode;
|
||||||
|
/**
|
||||||
|
* 模板编码
|
||||||
|
*/
|
||||||
|
private String templateCode;
|
||||||
|
/**
|
||||||
|
* 消息标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
/**
|
||||||
|
* 消息内容
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 卡片内容
|
||||||
|
*/
|
||||||
|
private List<MessageCardContentItemDTO> cardItems;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代办记录通用信息处理 -- 包含头像、时间、打卡时间
|
||||||
|
*/
|
||||||
|
private MessageCommonHandleInfo messageCommonHandleInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作台id
|
||||||
|
*/
|
||||||
|
private Long workspaceId;
|
||||||
|
/**
|
||||||
|
* 工作台名称
|
||||||
|
*/
|
||||||
|
private String workspaceName;
|
||||||
|
/**
|
||||||
|
* 业务详情路由
|
||||||
|
*/
|
||||||
|
private DetailRouterDTO detailRouter;
|
||||||
|
/**
|
||||||
|
* 待办消息图标
|
||||||
|
*/
|
||||||
|
private String pendingMessageIcon;
|
||||||
|
/**
|
||||||
|
* 待办按钮文案 -- 去处理 | 已打卡 |已完成
|
||||||
|
*/
|
||||||
|
private String buttonDesc;
|
||||||
|
/**
|
||||||
|
* 待办状态 -- 1:已完成,2:未完成
|
||||||
|
*/
|
||||||
|
private Integer pendingMessageStatus;
|
||||||
|
|
||||||
|
public static PendingMessageWorkerResponse from(PendingMessageResponse response) {
|
||||||
|
return BeanConverter.convert(response, PendingMessageWorkerResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@Builder
|
||||||
|
public static class MessageCommonHandleInfo{
|
||||||
|
/**
|
||||||
|
* 通用头像
|
||||||
|
*/
|
||||||
|
private String commonIcon;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String desc;
|
||||||
|
/**
|
||||||
|
* 待办状态:1:今日待办 2:历史待办
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
public static MessageCommonHandleInfo from(String avatarUrl, String desc, int status) {
|
||||||
|
return MessageCommonHandleInfo.builder().commonIcon(avatarUrl).desc(desc).status(status).build(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return JSON.toJSONString(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -19,7 +19,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@MapperScan(value = {"cn.axzo.msg.center.dal"})
|
@MapperScan(value = {"cn.axzo.msg.center.dal"})
|
||||||
@SpringBootApplication(scanBasePackages = {"cn.axzo.msg"})
|
@SpringBootApplication(scanBasePackages = {"cn.axzo.msg"})
|
||||||
@EnableFeignClients(basePackages = "cn.axzo.log")
|
@EnableFeignClients(basePackages = "cn.axzo")
|
||||||
/*@EnableAsync*/
|
/*@EnableAsync*/
|
||||||
public class MsgCenterApplication {
|
public class MsgCenterApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user