Merge branch 'feature/REQ-1634' into 'dev'
Feature/req 1634 See merge request universal/infrastructure/backend/msg-center-plat!105
This commit is contained in:
commit
b97056cee7
@ -10,6 +10,7 @@ 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;
|
||||
@ -119,4 +120,9 @@ public class PendingMessageNewController implements PendingMessageClient {
|
||||
public CommonResponse<Boolean> updateById(RevokePendingMessageByIdRequest param) {
|
||||
return CommonResponse.success(pendingMessageNewService.updateById(param));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<PendingMessageSimpleDTO> getLatestByBizCode(String bizCode) {
|
||||
return CommonResponse.success(pendingMessageNewService.getLatestByBizCode(bizCode));
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.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.PushPendingMessageDTO;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
|
||||
@ -153,4 +154,11 @@ public interface PendingMessageNewService {
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
Boolean updateById(RevokePendingMessageByIdRequest param);
|
||||
|
||||
/**
|
||||
* 通过BizCode获取最新代办
|
||||
* @param bizCode
|
||||
* @return
|
||||
*/
|
||||
PendingMessageSimpleDTO getLatestByBizCode(String bizCode);
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@ import cn.axzo.msg.center.service.dto.*;
|
||||
import cn.axzo.msg.center.service.enums.*;
|
||||
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.PushPendingMessageDTO;
|
||||
import cn.axzo.msg.center.utils.*;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
@ -44,9 +45,12 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@ -168,6 +172,11 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
@Override
|
||||
public List<PendingMessageResponse> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request) {
|
||||
List<PendingMessageResponse> result = new ArrayList<>();
|
||||
// 未来无待办
|
||||
LocalDate localDate = request.getSelectDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
if(localDate.isAfter(LocalDate.now())) {
|
||||
return result;
|
||||
}
|
||||
PendingCalendarCodeDTO calendarCodeDTO = buildCalendarCodesDTO(calendarCodeConfig);
|
||||
List<PendingMessageRecord> pendingMessageRecords = pendingMessageRecordMapper.queryByTemplateCodes(calendarCodeDTO,request.getWorkspaceId(),request.getSelectDate(),request.getPersonId());
|
||||
List<MessageTemplateDTO> messageTemplates = messageTemplateNewService.listByTemplateCodes(calendarCodeConfig.getCalendarAllCodes());
|
||||
@ -338,12 +347,13 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
cardContentItems = cardContentItems.stream()
|
||||
.map(MessageCardContentItemDTO::deepClone)
|
||||
.collect(Collectors.toList());
|
||||
Map<String,String> result = new HashMap<>();
|
||||
cardContentItems.forEach(e -> {
|
||||
String value = PlaceholderResolver.getDefaultResolver()
|
||||
.resolveByMap(e.getValue(), JSON.parseObject(param.getBizExtParams()));
|
||||
e.setValue(value);
|
||||
result.put(e.getLabel(),value);
|
||||
});
|
||||
bizExtParam = JSON.toJSONString(cardContentItems);
|
||||
bizExtParam = JSON.toJSONString(result);
|
||||
}
|
||||
}
|
||||
return pendingMessageRecordDao.lambdaUpdate()
|
||||
@ -415,6 +425,20 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PendingMessageSimpleDTO getLatestByBizCode(String bizCode) {
|
||||
log.info("getLatestByBizCode param->{}", bizCode);
|
||||
PendingMessageRecord pendingMessageRecord = pendingMessageRecordDao.lambdaQuery()
|
||||
.eq(PendingMessageRecord::getBizCode, bizCode)
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.orderByDesc(PendingMessageRecord::getBizCode)
|
||||
.last("limit 1")
|
||||
.one();
|
||||
PendingMessageSimpleDTO result = new PendingMessageSimpleDTO();
|
||||
BeanUtils.copyProperties(pendingMessageRecord, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
private PendingMessageDTO convert(PendingMessageRecord pendingMessageRecord, List<MessageTemplateDTO> messageTemplates) {
|
||||
PendingMessageDTO pendingMessage = PendingMessageDTO.from(pendingMessageRecord);
|
||||
// 对应模板的路由策略
|
||||
|
||||
@ -25,7 +25,7 @@ public enum PendingMessageTemplateEnum {
|
||||
/**
|
||||
* 确认记工模版
|
||||
*/
|
||||
CONFIRM_TASK("确认记工模版","367ba552bb374049a73e737ac3b8b08c2","https://axzo-public.oss-cn-chengdu.aliyuncs.com/f3520d6543f4629026ad5c6d00754942.png"),
|
||||
CONFIRM_TASK("确认记工模版","367ba552bb374049a73e737ac3b8b08c","https://axzo-public.oss-cn-chengdu.aliyuncs.com/f3520d6543f4629026ad5c6d00754942.png"),
|
||||
/**
|
||||
* 进场模版
|
||||
*/
|
||||
@ -43,5 +43,9 @@ public enum PendingMessageTemplateEnum {
|
||||
public static List<String> getConstructionTemplates() {
|
||||
return Arrays.asList(NEW_TASK.code, CONFIRM_TASK.code);
|
||||
}
|
||||
public static List<String> getAttendanceTemplates() {
|
||||
return Arrays.asList(CLOCK_IN_TEMPLATES.code, PUNCH_IN_CODES.code);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ 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.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;
|
||||
@ -169,5 +170,14 @@ public interface PendingMessageClient {
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/update/byId", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Boolean> updateById(RevokePendingMessageByIdRequest param);
|
||||
CommonResponse<Boolean> updateById(@RequestBody @Valid RevokePendingMessageByIdRequest param);
|
||||
|
||||
/**
|
||||
* 通过BizCode获取最新代办
|
||||
*
|
||||
* @param bizCode
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/latest/biz-code", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<PendingMessageSimpleDTO> getLatestByBizCode(String bizCode);
|
||||
}
|
||||
@ -5,6 +5,7 @@ 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;
|
||||
@ -115,4 +116,10 @@ public class PendingMessageClientFallback implements PendingMessageClient {
|
||||
log.error("fall back while revoking pending message update by ID. param:[{}]", param);
|
||||
return CommonResponse.error("fall back while revoking pending message update by ID");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<PendingMessageSimpleDTO> getLatestByBizCode(String 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");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,136 @@
|
||||
package cn.axzo.msg.center.service.pending.response;
|
||||
|
||||
import cn.axzo.msg.center.service.enums.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author haiyangjin
|
||||
* @date 2023/11/15
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PendingMessageSimpleDTO {
|
||||
/**
|
||||
* 消息的唯一标识
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* 重试次数
|
||||
*/
|
||||
private Integer retryCount;
|
||||
/**
|
||||
* 最终失败原因
|
||||
*/
|
||||
private String failCause;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user