REQ-2318: 调整缓存失效时间

This commit is contained in:
yanglin 2024-07-02 14:04:28 +08:00
parent e722b4e997
commit bfcf3f3402
3 changed files with 10 additions and 24 deletions

View File

@ -4,8 +4,8 @@ import cn.axzo.msg.center.dal.TodoBusinessDao;
import cn.axzo.msg.center.dal.TodoDao;
import cn.axzo.msg.center.domain.entity.Todo;
import cn.axzo.msg.center.domain.entity.TodoBusiness;
import cn.axzo.msg.center.message.service.impl.person.PersonService;
import cn.axzo.msg.center.service.pending.request.AnalysisInfo;
import cn.axzo.msg.center.service.pending.request.PendingMessagePageRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
@ -18,14 +18,13 @@ class AnalysisHelper {
private final TodoBusinessDao todoBusinessDao;
private final TodoDao todoDao;
private final PersonService personService;
TodoBusiness getAnalyzeBusiness(AnalysisInfo analysis) {
if (analysis == null) return null;
return todoBusinessDao.getById(analysis.getBusinessId());
}
Todo getAnalyzeTodo(AnalysisInfo analysis) {
Todo getAnalyzeTodo(PendingMessagePageRequest request, AnalysisInfo analysis) {
if (analysis.getTodoId() != null)
return todoDao.getById(analysis.getTodoId());
if (analysis.getTodoCode() != null)
@ -33,18 +32,12 @@ class AnalysisHelper {
.eq(Todo::getIdentityCode, analysis.getTodoCode())
.last("LIMIT 1")
.one();
AnalysisInfo.BizInfo biz = analysis.getBiz();
if (biz != null && biz.getBizCode() != null && (biz.getPersonId() != null || biz.getPhone() != null)) {
if (biz.getPhone() != null)
personService.getPersonIdByPhone(biz.getPhone())
.ifPresent(biz::setPersonId);
if (biz.getPersonId() != null) {
return todoDao.lambdaQuery()
.eq(Todo::getBizCode, biz.getBizCode())
.eq(Todo::getExecutorPersonId, biz.getPersonId())
.last("LIMIT 1")
.one();
}
if (analysis.getBizCode() != null) {
return todoDao.lambdaQuery()
.eq(Todo::getBizCode, analysis.getBizCode())
.eq(Todo::getExecutorPersonId, request.getPersonId())
.last("LIMIT 1")
.one();
}
return null;
}

View File

@ -183,7 +183,7 @@ public class TodoRangeQueryService {
AnalysisInfo analysis = request.getA();
Object analyzeItem = analysisHelper.getAnalyzeBusiness(analysis);
if (analyzeItem == null)
analyzeItem = analysisHelper.getAnalyzeTodo(analysis);
analyzeItem = analysisHelper.getAnalyzeTodo(request, analysis);
if (analyzeItem != null || analysis.isCollectSql())
CollectSQLInterceptor.enableCollectSQL(new CollectSqlConfig(true));
try {

View File

@ -11,14 +11,7 @@ public class AnalysisInfo {
private String todoCode;
private Long todoId;
private Long businessId;
private BizInfo biz;
private String bizCode;
private boolean collectSql;
@Data
public static class BizInfo {
private String bizCode;
private Long personId;
private String phone;
}
}