Bläddra i källkod

feature(页面数据排序): 页面数据排序

页面数据排序
mazq 2 år sedan
förälder
incheckning
3164ebecb2

+ 2 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/AuthApplyBusiness.java

@@ -60,6 +60,7 @@ import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
 import org.springframework.stereotype.Component;
 import org.springframework.web.context.request.RequestAttributes;
 import org.springframework.web.context.request.RequestContextHolder;
@@ -588,6 +589,7 @@ public class AuthApplyBusiness implements IAuthApplyBusiness {
     @Override
     public Page<RedListRiskLogVo> redListApplyLog(SearchDTO searchDTO) {
         Searchable searchable = Searchable.toSearchable(searchDTO);
+        searchable.addSort(Sort.Direction.DESC, "logSendTime");
         Page<RedListRiskLog> page = redListRiskLogService.pageSearch(searchable);
         if (page.isEmpty()) {
             return new PageImpl<>(new ArrayList<>(), searchable.getPage(),0L);

+ 2 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/element/business/impl/EnvElementBusiness.java

@@ -12,6 +12,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageImpl;
+import org.springframework.data.domain.Sort;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -43,6 +44,7 @@ public class EnvElementBusiness implements IEnvElementBusiness {
     @Override
     public Page<RespEnvElementVo> pageSearch(SearchDTO searchDTO) {
         Searchable searchable = Searchable.toSearchable(searchDTO);
+        searchable.addSort(Sort.Direction.DESC, "createTime");
         Page<EnvElement> page = envElementService.page(searchable);
         if (page.isEmpty()) {
             return new PageImpl<>(new ArrayList<>(), searchable.getPage(), 0L);