Merge branch 'feature/REQ-1634' into 'master'
Feature/req 1634 See merge request universal/infrastructure/backend/msg-center-plat!126
This commit is contained in:
commit
a271d56572
@ -0,0 +1,37 @@
|
||||
package cn.axzo.msg.center.inside.notices.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* 待办日历模版配置
|
||||
* @author cold_blade
|
||||
* @date 2023/8/31
|
||||
* @version 1.0
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
@RefreshScope
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "calendar.template")
|
||||
public class PendingCalendarCodeConfig {
|
||||
|
||||
private List<String> constructionCodes;
|
||||
private List<String> clockInCodes;
|
||||
private List<String> punchInCodes;
|
||||
|
||||
public List<String> getCalendarAllCodes() {
|
||||
return Arrays.asList(constructionCodes, clockInCodes, punchInCodes)
|
||||
.stream()
|
||||
.flatMap(List::stream)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@ -8,14 +8,9 @@ import cn.axzo.msg.center.message.domain.param.PendingMessagePushParam;
|
||||
import cn.axzo.msg.center.message.service.PendingMessageNewService;
|
||||
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.CompletePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.CompletePendingMessageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageCountUncompletedRequest;
|
||||
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.*;
|
||||
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;
|
||||
@ -61,6 +56,11 @@ public class PendingMessageNewController implements PendingMessageClient {
|
||||
return CommonResponse.success(pendingMessageNewService.pageQuery(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<List<PendingMessageResponse>> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request) {
|
||||
return CommonResponse.success(pendingMessageNewService.getPendingMessageByAppWorker(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Page<MessageDetailRes>> compatiblePageQuery(PendingMessagePageRequest request) {
|
||||
return CommonResponse.success(pendingMessageNewService.compatiblePageQuery(request));
|
||||
@ -101,6 +101,11 @@ public class PendingMessageNewController implements PendingMessageClient {
|
||||
return CommonResponse.success(pendingMessageNewService.revoke(requestNo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> revokeByMsgId(String msgId) {
|
||||
return CommonResponse.success(pendingMessageNewService.revokeByMsgId(msgId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> completeByTemplateCodeBizCode(CompletePendingMessageRequest param) {
|
||||
return CommonResponse.success(pendingMessageNewService.completeByTemplateCodeBizCode(param));
|
||||
@ -110,4 +115,19 @@ public class PendingMessageNewController implements PendingMessageClient {
|
||||
public CommonResponse<Boolean> revokeByTemplateCodeBizCode(CompletePendingMessageRequest param) {
|
||||
return CommonResponse.success(pendingMessageNewService.revokeByTemplateCodeBizCode(param));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> revokeById(RevokePendingMessageByIdRequest param) {
|
||||
return CommonResponse.success(pendingMessageNewService.revokeById(param));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Boolean> updateById(RevokePendingMessageByIdRequest param) {
|
||||
return CommonResponse.success(pendingMessageNewService.updateById(param));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<List<PendingMessageSimpleDTO>> getLatestByBizCode(PendingMessageByBizCodeRequest bizCode) {
|
||||
return CommonResponse.success(pendingMessageNewService.getLatestByBizCode(bizCode));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,20 +4,12 @@ import cn.axzo.msg.center.domain.entity.PendingMessageRecord;
|
||||
import cn.axzo.msg.center.service.dto.IdentityDTO;
|
||||
import cn.axzo.msg.center.service.dto.MessageCardContentItemDTO;
|
||||
import cn.axzo.msg.center.service.dto.PersonDTO;
|
||||
import cn.axzo.msg.center.service.enums.BizCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.BizFinalStateEnum;
|
||||
import cn.axzo.msg.center.service.enums.OrganizationTypeEnum;
|
||||
import cn.axzo.msg.center.service.enums.PendingMessageStateEnum;
|
||||
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
||||
import cn.axzo.msg.center.service.enums.*;
|
||||
import cn.axzo.msg.center.service.pending.response.PendingMessageResponse;
|
||||
import cn.axzo.msg.center.utils.DateFormatUtil;
|
||||
import cn.axzo.msg.center.utils.MessageRouterUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
@ -174,6 +166,7 @@ public class PendingMessageDTO implements Serializable {
|
||||
.updateTime(DateFormatUtil.toLocalDateTime(pendingMessageRecord.getUpdateAt()))
|
||||
.routerParam(pendingMessageRecord.getRouterParams())
|
||||
.bizFinalState(pendingMessageRecord.getBizFinalState())
|
||||
// .isOld(pendingMessageRecord.getIsOld())
|
||||
.build();
|
||||
}
|
||||
|
||||
@ -194,6 +187,7 @@ public class PendingMessageDTO implements Serializable {
|
||||
.subBizCode(this.subBizCode)
|
||||
.bizDesc(this.bizDesc)
|
||||
.bizFlag(this.bizFlag)
|
||||
.state(this.getState())
|
||||
.bizCategory(this.bizCategory)
|
||||
.workspaceId(this.workspaceId)
|
||||
.workspaceName(this.workspaceName)
|
||||
|
||||
@ -6,11 +6,9 @@ import cn.axzo.msg.center.message.domain.dto.PendingMessageStatisticDTO;
|
||||
import cn.axzo.msg.center.message.domain.param.MessageGroupNodeStatisticParam;
|
||||
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.CompletePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.CompletePendingMessageRequest;
|
||||
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.*;
|
||||
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;
|
||||
|
||||
@ -60,6 +58,14 @@ public interface PendingMessageNewService {
|
||||
*/
|
||||
Page<PendingMessageResponse> pageQuery(PendingMessagePageRequest request);
|
||||
|
||||
/**
|
||||
* 代办列表分页查询
|
||||
*
|
||||
* @param request 分页查询相关参数
|
||||
* @return 代办列表
|
||||
*/
|
||||
List<PendingMessageResponse> getPendingMessageByAppWorker(PendingMessageFixedTemplatePageRequest request);
|
||||
|
||||
/**
|
||||
* 代办列表分页查询
|
||||
*
|
||||
@ -117,6 +123,14 @@ public interface PendingMessageNewService {
|
||||
*/
|
||||
Boolean revoke(String requestNo);
|
||||
|
||||
/**
|
||||
* 通过ID撤销代办
|
||||
*
|
||||
* @param msgId 代办唯一标识
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
Boolean revokeByMsgId(String msgId);
|
||||
|
||||
/**
|
||||
* 通过业务编码和模版编码完成代办
|
||||
*
|
||||
@ -132,4 +146,27 @@ public interface PendingMessageNewService {
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
Boolean revokeByTemplateCodeBizCode(CompletePendingMessageRequest param);
|
||||
|
||||
/**
|
||||
* 通过ID撤销代办
|
||||
*
|
||||
* @param param
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
Boolean revokeById(RevokePendingMessageByIdRequest param);
|
||||
|
||||
/**
|
||||
* 通过ID编辑代办bizParam
|
||||
*
|
||||
* @param param
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
Boolean updateById(RevokePendingMessageByIdRequest param);
|
||||
|
||||
/**
|
||||
* 通过BizCode获取最新代办
|
||||
* @param bizCode
|
||||
* @return
|
||||
*/
|
||||
List<PendingMessageSimpleDTO> getLatestByBizCode(PendingMessageByBizCodeRequest bizCode);
|
||||
}
|
||||
|
||||
@ -15,12 +15,7 @@ import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@ -15,46 +15,27 @@ import cn.axzo.msg.center.common.exception.ServiceException;
|
||||
import cn.axzo.msg.center.common.utils.PageHelperUtil;
|
||||
import cn.axzo.msg.center.common.utils.PlaceholderResolver;
|
||||
import cn.axzo.msg.center.dal.PendingMessageRecordDao;
|
||||
import cn.axzo.msg.center.dal.mapper.PendingMessageRecordMapper;
|
||||
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.message.domain.dto.GroupTreeNodePathDTO;
|
||||
import cn.axzo.msg.center.message.domain.dto.MessageTemplateDTO;
|
||||
import cn.axzo.msg.center.message.domain.dto.MessageTemplateRouterDTO;
|
||||
import cn.axzo.msg.center.message.domain.dto.PendingMessageDTO;
|
||||
import cn.axzo.msg.center.message.domain.dto.PendingMessageStatisticDTO;
|
||||
import cn.axzo.msg.center.inside.notices.config.PendingCalendarCodeConfig;
|
||||
import cn.axzo.msg.center.message.domain.dto.*;
|
||||
import cn.axzo.msg.center.message.domain.param.MessageGroupNodeStatisticParam;
|
||||
import cn.axzo.msg.center.message.domain.param.PendingMessagePushParam;
|
||||
import cn.axzo.msg.center.message.service.MessageGroupNodeService;
|
||||
import cn.axzo.msg.center.message.service.MessageTemplateGroupService;
|
||||
import cn.axzo.msg.center.message.service.MessageTemplateNewService;
|
||||
import cn.axzo.msg.center.message.service.PendingMessageNewService;
|
||||
import cn.axzo.msg.center.service.dto.ButtonRouterDTO;
|
||||
import cn.axzo.msg.center.service.dto.DetailRouterDTO;
|
||||
import cn.axzo.msg.center.service.dto.IdentityDTO;
|
||||
import cn.axzo.msg.center.service.dto.MessageCardContentItemDTO;
|
||||
import cn.axzo.msg.center.service.dto.PersonDTO;
|
||||
import cn.axzo.msg.center.service.dto.QueryOrderByDTO;
|
||||
import cn.axzo.msg.center.service.enums.BizFinalStateEnum;
|
||||
import cn.axzo.msg.center.service.enums.IdentityTypeEnum;
|
||||
import cn.axzo.msg.center.service.enums.MessageGroupCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.OrganizationTypeEnum;
|
||||
import cn.axzo.msg.center.service.enums.PendingMessageRoleCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.PendingMessageStateEnum;
|
||||
import cn.axzo.msg.center.service.enums.RouterCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.TerminalTypeEnum;
|
||||
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.PendingMessagePageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageQueryRequest;
|
||||
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.DateFormatUtil;
|
||||
import cn.axzo.msg.center.utils.JSONObjectUtil;
|
||||
import cn.axzo.msg.center.utils.MessageCardUtil;
|
||||
import cn.axzo.msg.center.utils.MessageRouterUtil;
|
||||
import cn.axzo.msg.center.utils.OrderFieldParseUtil;
|
||||
import cn.axzo.msg.center.utils.UUIDUtil;
|
||||
import cn.axzo.msg.center.utils.*;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -67,15 +48,10 @@ import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -92,11 +68,13 @@ import java.util.stream.Collectors;
|
||||
public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
|
||||
private final PendingMessageRecordDao pendingMessageRecordDao;
|
||||
private final PendingMessageRecordMapper pendingMessageRecordMapper;
|
||||
private final MessageGroupNodeService messageGroupNodeService;
|
||||
private final MessageTemplateNewService messageTemplateNewService;
|
||||
private final MessageTemplateGroupService messageTemplateGroupService;
|
||||
private final WorkspaceApi workspaceApi;
|
||||
private final OrganizationalNodePractitionerWideApi organizationalNodePractitionerWideApi;
|
||||
private final PendingCalendarCodeConfig calendarCodeConfig;
|
||||
|
||||
@Override
|
||||
public List<PendingMessageStatisticDTO> groupStatistic(MessageGroupNodeStatisticParam param) {
|
||||
@ -191,6 +169,29 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
return Page.toPage(request.getPage(), request.getPageSize(), result.getTotal(), responseRecords);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
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<MessageTemplateDTO> messageTemplates = messageTemplateNewService.listByTemplateCodes(calendarCodeConfig.getCalendarAllCodes());
|
||||
result = pendingMessageRecords.stream()
|
||||
.map(e -> convert(e, messageTemplates).toResponse(request.getTerminalType()))
|
||||
.collect(Collectors.toList());
|
||||
// 构建分页结构返回
|
||||
return result;
|
||||
}
|
||||
|
||||
private PendingCalendarCodeDTO buildCalendarCodesDTO(PendingCalendarCodeConfig calendarCodeConfig) {
|
||||
return new PendingCalendarCodeDTO(calendarCodeConfig.getConstructionCodes(),calendarCodeConfig.getClockInCodes(),calendarCodeConfig.getPunchInCodes(),calendarCodeConfig.getCalendarAllCodes());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public Page<MessageDetailRes> compatiblePageQuery(PendingMessagePageRequest request) {
|
||||
@ -328,8 +329,13 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
@Override
|
||||
public Boolean completeById(CompletePendingMessageByIdRequest param) {
|
||||
log.info("the [{}] record is updated complete by id.", param);
|
||||
String bizExtParam = null;
|
||||
if(StringUtils.isNotBlank(param.getBizExtParams())){
|
||||
bizExtParam = param.getBizExtParams();
|
||||
}
|
||||
return pendingMessageRecordDao.lambdaUpdate()
|
||||
.set(PendingMessageRecord::getState, PendingMessageStateEnum.COMPLETED)
|
||||
.set(StringUtils.isNotBlank(bizExtParam),PendingMessageRecord::getBizExtParam,bizExtParam)
|
||||
.eq(PendingMessageRecord::getId, param.getId())
|
||||
.eq(PendingMessageRecord::getState, PendingMessageStateEnum.HAS_BEEN_SENT)
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
@ -351,6 +357,21 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean revokeByMsgId(String msgId) {
|
||||
if (StringUtils.isBlank(msgId)) {
|
||||
log.warn("the message msgId is blank.");
|
||||
return false;
|
||||
}
|
||||
log.info("the [{}] record is updated retract by id.", msgId);
|
||||
return pendingMessageRecordDao.lambdaUpdate()
|
||||
.set(PendingMessageRecord::getState, PendingMessageStateEnum.RETRACT)
|
||||
.eq(PendingMessageRecord::getId, msgId)
|
||||
.eq(PendingMessageRecord::getState, PendingMessageStateEnum.HAS_BEEN_SENT)
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean completeByTemplateCodeBizCode(CompletePendingMessageRequest param) {
|
||||
log.info("the [{}] record is completeByTemplateCodeBizCode retract.", param);
|
||||
@ -375,6 +396,40 @@ public class PendingMessageNewServiceImpl implements PendingMessageNewService {
|
||||
.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean revokeById(RevokePendingMessageByIdRequest param) {
|
||||
log.info("the [{}] record is RevokePendingMessageByIdRequest.", param);
|
||||
return pendingMessageRecordDao.lambdaUpdate()
|
||||
.set(PendingMessageRecord::getState, PendingMessageStateEnum.RETRACT)
|
||||
.eq(PendingMessageRecord::getId, param.getId())
|
||||
.eq(PendingMessageRecord::getState, PendingMessageStateEnum.HAS_BEEN_SENT)
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(RevokePendingMessageByIdRequest param) {
|
||||
log.info("the [{}] record is RevokePendingMessageByIdRequest.", param);
|
||||
return pendingMessageRecordDao.lambdaUpdate()
|
||||
.set(PendingMessageRecord::getBizExtParam, param.getBizParam())
|
||||
.eq(PendingMessageRecord::getId, param.getId())
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PendingMessageSimpleDTO> getLatestByBizCode(PendingMessageByBizCodeRequest param) {
|
||||
log.info("getLatestByBizCode param->{}", JSON.toJSONString(param));
|
||||
List<PendingMessageRecord> pendingMessageRecords = pendingMessageRecordDao.lambdaQuery()
|
||||
.in(PendingMessageRecord::getBizCode, param.getBizCodes())
|
||||
.eq(PendingMessageRecord::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.orderByDesc(PendingMessageRecord::getId)
|
||||
.groupBy(PendingMessageRecord::getBizCode)
|
||||
.list();
|
||||
List<PendingMessageSimpleDTO> pendingMessageSimpleDTOS = BeanUtil.copyToList(pendingMessageRecords, PendingMessageSimpleDTO.class);
|
||||
return pendingMessageSimpleDTOS;
|
||||
}
|
||||
|
||||
private PendingMessageDTO convert(PendingMessageRecord pendingMessageRecord, List<MessageTemplateDTO> messageTemplates) {
|
||||
PendingMessageDTO pendingMessage = PendingMessageDTO.from(pendingMessageRecord);
|
||||
// 对应模板的路由策略
|
||||
@ -625,7 +680,23 @@ 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;
|
||||
if (CollectionUtils.isNotEmpty(rawCardContentItems) && Objects.nonNull(record.getBizExtParam())
|
||||
&& !record.getBizExtParam().isEmpty()) {
|
||||
// 克隆,避免修改入参
|
||||
cardContentItems = cardContentItems.stream()
|
||||
.map(MessageCardContentItemDTO::deepClone)
|
||||
.collect(Collectors.toList());
|
||||
cardContentItems.forEach(e -> {
|
||||
String value = PlaceholderResolver.getDefaultResolver()
|
||||
.resolveByMap(e.getValue(), JSON.parseObject(record.getBizExtParam()));
|
||||
e.setValue(value);
|
||||
});
|
||||
record.setBizExtParam(JSON.toJSONString(cardContentItems));
|
||||
}
|
||||
record.setTitle(title);
|
||||
record.setContent(content);
|
||||
record.setTemplateCode(msgTemplate.getCode());
|
||||
|
||||
@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -36,10 +37,17 @@ public final class MessageCardUtil {
|
||||
JSONObject bizExtParam = JSON.parseObject(bizExtParamStr);
|
||||
// 复制一个副本,避免直接修改
|
||||
msgCardContentItems = BeanConvertUtils.copyList(msgCardContentItems, MessageCardContentItemDTO.class);
|
||||
List<MessageCardContentItemDTO> result = new ArrayList<>();
|
||||
msgCardContentItems.forEach(e -> {
|
||||
String modifiedValue = PlaceholderResolver.getDefaultResolver().resolveByMap(e.getValue(), bizExtParam);
|
||||
e.setValue(modifiedValue);
|
||||
// 过滤空值的卡片
|
||||
if(StringUtils.isNotBlank(modifiedValue) && !"null".equals(modifiedValue)){
|
||||
e.setValue(modifiedValue);
|
||||
result.add(e);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
return msgCardContentItems;
|
||||
}
|
||||
|
||||
@ -59,6 +59,10 @@ public class ButtonRouterDTO implements Serializable {
|
||||
* OVER_CARD: 按钮显示在卡片
|
||||
*/
|
||||
private List<ButtonStyleEnum> style;
|
||||
/**
|
||||
* 路由key
|
||||
*/
|
||||
private String key;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
package cn.axzo.msg.center.service.enums;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* 应用终端类型枚举
|
||||
* @author cold_blade
|
||||
* @date 2023/11/9
|
||||
* @version 1.0
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public enum PendingMessageTemplateEnum {
|
||||
|
||||
/**
|
||||
* 新任务模版
|
||||
*/
|
||||
NEW_TASK("新任务模版","d1d4793c84e14d20ae1cbc399338efa3","https://axzo-public.oss-cn-chengdu.aliyuncs.com/dece1ce149fa011e4c51ce11bb81d61e.png"),
|
||||
/**
|
||||
* 确认记工模版
|
||||
*/
|
||||
CONFIRM_TASK("确认记工模版","367ba552bb374049a73e737ac3b8b08c","https://axzo-public.oss-cn-chengdu.aliyuncs.com/f3520d6543f4629026ad5c6d00754942.png"),
|
||||
/**
|
||||
* 进场模版
|
||||
*/
|
||||
CLOCK_IN_TEMPLATES("进场模版","cb4c583b06fc428ab045d6cef5a1c64c","https://axzo-public.oss-cn-chengdu.aliyuncs.com/ec9f4a36cc836316c24e900544c5b55a.png"),
|
||||
/**
|
||||
* 出厂模版
|
||||
*/
|
||||
PUNCH_IN_CODES("出厂模版","2b9bb2da572f4236bfa39e3b714143d9","https://axzo-public.oss-cn-chengdu.aliyuncs.com/ec9f4a36cc836316c24e900544c5b55a.png"),
|
||||
;
|
||||
|
||||
private final String name;
|
||||
private final String code;
|
||||
private final String url;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -3,14 +3,9 @@ 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.CompletePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.CompletePendingMessageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageCountUncompletedRequest;
|
||||
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.*;
|
||||
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;
|
||||
@ -18,9 +13,7 @@ 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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@ -66,6 +59,15 @@ public interface PendingMessageClient {
|
||||
@PostMapping(value = "/pending-message/record/page", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Page<PendingMessageResponse>> pageQuery(@RequestBody @Valid PendingMessagePageRequest request);
|
||||
|
||||
/**
|
||||
* 指定几种代办模型列表分页查询
|
||||
*
|
||||
* @param request 分页查询相关参数
|
||||
* @return 代办列表
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/getPendingMessageByAppWorker", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<List<PendingMessageResponse>> getPendingMessageByAppWorker(@RequestBody @Valid PendingMessageFixedTemplatePageRequest request);
|
||||
|
||||
/**
|
||||
* 代办列表分页查询
|
||||
*
|
||||
@ -132,6 +134,15 @@ public interface PendingMessageClient {
|
||||
@PostMapping(value = "/pending-message/revoke", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Boolean> revoke(@RequestParam("requestNo") String requestNo);
|
||||
|
||||
/**
|
||||
* 通过ID撤销代办
|
||||
*
|
||||
* @param msgId 代办唯一标识
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/revoke/by-id", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Boolean> revokeByMsgId(@RequestParam("msgId") String msgId);
|
||||
|
||||
/**
|
||||
* 通过模版编号和业务编号完成代办
|
||||
*
|
||||
@ -149,4 +160,31 @@ public interface PendingMessageClient {
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/revoke/by-biz-code", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Boolean> revokeByTemplateCodeBizCode(@RequestBody @Valid CompletePendingMessageRequest param);
|
||||
|
||||
/**
|
||||
* 通过ID撤销代办
|
||||
*
|
||||
* @param param
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/revokeById", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Boolean> revokeById(RevokePendingMessageByIdRequest param);
|
||||
|
||||
/**
|
||||
* 通过ID撤销代办
|
||||
*
|
||||
* @param param
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/update/byId", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Boolean> updateById(@RequestBody @Valid RevokePendingMessageByIdRequest param);
|
||||
|
||||
/**
|
||||
* 通过BizCode获取最新代办
|
||||
*
|
||||
* @param pendingMessageByBizCodeRequest
|
||||
* @return 成功返回 {@code true} 失败返回 {@code false}
|
||||
*/
|
||||
@PostMapping(value = "/pending-message/latest/biz-code", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<List<PendingMessageSimpleDTO>> getLatestByBizCode(@RequestBody @Valid PendingMessageByBizCodeRequest pendingMessageByBizCodeRequest);
|
||||
}
|
||||
@ -3,14 +3,9 @@ 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.CompletePendingMessageByIdRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.CompletePendingMessageRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.PendingMessageCountUncompletedRequest;
|
||||
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.*;
|
||||
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;
|
||||
@ -49,6 +44,12 @@ public class PendingMessageClientFallback implements PendingMessageClient {
|
||||
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);
|
||||
@ -92,6 +93,12 @@ public class PendingMessageClientFallback implements PendingMessageClient {
|
||||
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);
|
||||
@ -103,4 +110,22 @@ public class PendingMessageClientFallback implements PendingMessageClient {
|
||||
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(RevokePendingMessageByIdRequest param) {
|
||||
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<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");
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,4 +21,15 @@ public class CompletePendingMessageByIdRequest {
|
||||
*/
|
||||
@NotNull(message = "消息ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 业务扩展参数,JSON字符串格式
|
||||
*/
|
||||
private String bizExtParams;
|
||||
|
||||
/**
|
||||
* 模板编码
|
||||
*/
|
||||
private String templateCode;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
package cn.axzo.msg.center.service.pending.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author haiyangjin
|
||||
* @date 2023/11/16
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PendingMessageByBizCodeRequest {
|
||||
/**
|
||||
* bizCodes
|
||||
*/
|
||||
@NotNull(message = "bizParam不能为空")
|
||||
private List<String> bizCodes;
|
||||
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
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 lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* 代办记录分页查询参数的数模型
|
||||
* @author cold_blade
|
||||
* @date 2023/9/23
|
||||
* @version 1.0
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public class PendingMessageFixedTemplatePageRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7172093131252325437L;
|
||||
/**
|
||||
* 当前登录账户的自然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")
|
||||
private Date 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
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.axzo.msg.center.service.pending.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author haiyangjin
|
||||
* @date 2023/11/16
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RevokePendingMessageByIdRequest {
|
||||
/**
|
||||
* 关联业务主键
|
||||
*/
|
||||
@NotNull(message = "消息ID不能为空")
|
||||
private Long id;
|
||||
/**
|
||||
* 关联业务主键
|
||||
*/
|
||||
@NotNull(message = "bizParam不能为空")
|
||||
private String bizParam;
|
||||
|
||||
}
|
||||
@ -5,12 +5,9 @@ import cn.axzo.msg.center.service.dto.DetailRouterDTO;
|
||||
import cn.axzo.msg.center.service.dto.IdentityDTO;
|
||||
import cn.axzo.msg.center.service.dto.MessageCardContentItemDTO;
|
||||
import cn.axzo.msg.center.service.enums.BizCategoryEnum;
|
||||
import cn.axzo.msg.center.service.enums.PendingMessageStateEnum;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
@ -103,6 +100,10 @@ public class PendingMessageResponse implements Serializable {
|
||||
* 待办发起人的企业id
|
||||
*/
|
||||
private Long ouId;
|
||||
/**
|
||||
* 待办状态
|
||||
*/
|
||||
private PendingMessageStateEnum state;
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
package cn.axzo.msg.center.dal.mapper;
|
||||
|
||||
import cn.axzo.msg.center.domain.dto.PendingCalendarCodeDTO;
|
||||
import cn.axzo.msg.center.domain.entity.PendingMessageRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description
|
||||
@ -11,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface PendingMessageRecordMapper extends BaseMapper<PendingMessageRecord> {
|
||||
List<PendingMessageRecord> queryByTemplateCodes(@Param("pendingCalendarCodeDTO") PendingCalendarCodeDTO pendingCalendarCodeDTO, @Param("workspaceId") Long workspaceId,
|
||||
@Param("selectDate") Date selectDate, @Param("personId") Long personId,@Param("isNowDay") Boolean isNowDay);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.axzo.msg.center.dal.mapper.PendingMessageRecordMapper">
|
||||
|
||||
<select id="queryByTemplateCodes" resultType="cn.axzo.msg.center.domain.entity.PendingMessageRecord">
|
||||
select * from pending_message_record where id in(SELECT
|
||||
id
|
||||
FROM
|
||||
(
|
||||
<if test="isNowDay">
|
||||
SELECT (@i:=@i+1) mi,aa.* FROM
|
||||
(SELECT
|
||||
old_undo.id,1 AS flag
|
||||
FROM
|
||||
(SELECT
|
||||
*
|
||||
FROM
|
||||
pending_message_record
|
||||
WHERE DATE(create_at) <![CDATA[<]]> DATE (#{selectDate})
|
||||
AND (state = ('HAS_BEEN_SENT'))
|
||||
AND is_delete = 0
|
||||
AND executor_person_id = #{personId}
|
||||
AND template_code IN <foreach collection="pendingCalendarCodeDTO.constructionCodes" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||||
ORDER BY create_at ASC) old_undo) aa,(SELECT (@i:=0))tt
|
||||
UNION
|
||||
ALL
|
||||
</if>
|
||||
SELECT (@i:=@i+1) mi,aa.* FROM
|
||||
(SELECT
|
||||
new_todo.id,2 AS flag
|
||||
FROM
|
||||
(SELECT
|
||||
*
|
||||
FROM
|
||||
pending_message_record
|
||||
WHERE DATE (create_at) = DATE (#{selectDate})
|
||||
AND state IN ('HAS_BEEN_SENT')
|
||||
AND is_delete = 0
|
||||
AND executor_person_id = #{personId}
|
||||
AND template_code IN <foreach collection="pendingCalendarCodeDTO.constructionCodes" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||||
ORDER BY create_at DESC) new_todo) aa,(SELECT (@i:=0))tt
|
||||
UNION
|
||||
ALL
|
||||
SELECT (@i:=@i+1) mi,aa.* FROM
|
||||
(SELECT
|
||||
new_todo_3.id,3 AS flag
|
||||
FROM
|
||||
(SELECT
|
||||
*
|
||||
FROM
|
||||
pending_message_record
|
||||
WHERE DATE (create_at) = DATE (#{selectDate})
|
||||
AND state IN ('HAS_BEEN_SENT')
|
||||
AND is_delete = 0
|
||||
AND executor_person_id = #{personId}
|
||||
AND template_code IN <foreach collection="pendingCalendarCodeDTO.punchInCodes" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||||
ORDER BY create_at DESC) new_todo_3) aa,(SELECT (@i:=0))tt
|
||||
UNION
|
||||
ALL
|
||||
SELECT (@i:=@i+1) mi,aa.* FROM
|
||||
(SELECT
|
||||
new_todo_4.id,4 AS flag
|
||||
FROM
|
||||
(SELECT
|
||||
*
|
||||
FROM
|
||||
pending_message_record
|
||||
WHERE DATE (create_at) = DATE (#{selectDate})
|
||||
AND state IN ('HAS_BEEN_SENT')
|
||||
AND is_delete = 0
|
||||
AND executor_person_id = #{personId}
|
||||
AND template_code IN <foreach collection="pendingCalendarCodeDTO.clockInCodes" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||||
ORDER BY create_at DESC) new_todo_4) aa,(SELECT (@i:=0))tt
|
||||
UNION
|
||||
ALL
|
||||
SELECT (@i:=@i+1) mi,aa.* FROM
|
||||
(SELECT
|
||||
all_new_do.id,5 AS flag
|
||||
FROM
|
||||
(SELECT
|
||||
*
|
||||
FROM
|
||||
pending_message_record
|
||||
WHERE (DATE(create_at) = DATE(#{selectDate}) <if test="isNowDay">
|
||||
OR (DATE(create_at) <![CDATA[<]]> DATE(#{selectDate}) AND state = ('COMPLETED') AND DATE(update_at) = DATE(#{selectDate})
|
||||
AND template_code IN <foreach collection="pendingCalendarCodeDTO.constructionCodes" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>)
|
||||
</if>)
|
||||
AND state = 'COMPLETED'
|
||||
AND is_delete = 0
|
||||
AND executor_person_id = #{personId}
|
||||
AND template_code IN <foreach collection="pendingCalendarCodeDTO.allCodes" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
|
||||
ORDER BY create_at DESC) all_new_do) aa,(SELECT (@i:=0))tt
|
||||
) ccc ORDER BY flag ASC,mi asc)
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,15 @@
|
||||
package cn.axzo.msg.center.domain.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class PendingCalendarCodeDTO{
|
||||
private List<String> constructionCodes;
|
||||
private List<String> clockInCodes;
|
||||
private List<String> punchInCodes;
|
||||
private List<String> allCodes;
|
||||
}
|
||||
@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user