update:优化查询速度
This commit is contained in:
+25
-21
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.adc.da.login.util.UserUtils.getUserName;
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
@@ -68,6 +69,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
.updateTime(new Date())
|
||||
.updatePeople(addDetailedDto.getUpdatePeople())
|
||||
.remark(addDetailedDto.getRemark())
|
||||
.updatePeople(getUserName())
|
||||
.build();
|
||||
switch (addDetailedDto.getSortKey()) {
|
||||
case "1":
|
||||
@@ -113,34 +115,36 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
wrapper.eq("sort_key",sortKey);
|
||||
Page<SarLawsDetailedList> page = new Page<>(pages, size);
|
||||
IPage<SarLawsDetailedList> userIPage = sarLawsDetailedListDao.selectPage(page, wrapper);
|
||||
Map<String,Object> map= iDicTypeEOService.getDicTypeListCode();
|
||||
List<SarLawsDetailedList> list= userIPage.getRecords();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>)map.get("COUNTRY");
|
||||
for (SarLawsDetailedList list1:list){
|
||||
if (list1.getCountryArea().contains(",")){
|
||||
String[] split = list1.getCountryArea().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s:split){
|
||||
if ("1".equals(sortKey)){
|
||||
Map<String,Object> map= iDicTypeEOService.getDicTypeListCode();
|
||||
List<SarLawsDetailedList> list= userIPage.getRecords();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>)map.get("COUNTRY");
|
||||
for (SarLawsDetailedList list1:list){
|
||||
if (StringUtils.isNotBlank(list1.getCountryArea()) && list1.getCountryArea().contains(",")){
|
||||
String[] split = list1.getCountryArea().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s:split){
|
||||
for (Map<String,String> map1:arr) {
|
||||
if (map1.get("value").equals(s)){
|
||||
s=map1.get("label");
|
||||
builder.append(s+",");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
list1.setCountryArea(completedString);
|
||||
}else {
|
||||
for (Map<String,String> map1:arr) {
|
||||
if (map1.get("value").equals(s)){
|
||||
s=map1.get("label");
|
||||
builder.append(s+",");
|
||||
if (map1.get("value").equals(list1.getCountryArea())){
|
||||
list1.setCountryArea(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
list1.setCountryArea(completedString);
|
||||
}else {
|
||||
for (Map<String,String> map1:arr) {
|
||||
if (map1.get("value").equals(list1.getCountryArea())){
|
||||
list1.setCountryArea(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
userIPage.setRecords(list);
|
||||
}
|
||||
userIPage.setRecords(list);
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
return userIPage;
|
||||
|
||||
Reference in New Issue
Block a user