全文检索、标题检索去掉废止状态

This commit is contained in:
梁琦涛
2024-03-20 18:57:41 +08:00
parent 6037aac925
commit f77ac7c3b9
2 changed files with 30 additions and 7 deletions
@@ -21,7 +21,7 @@
end as standard_state_order,
standard_class,dynamic_type,applicable_vehicle,standard_property,standard_state,null as standard_code,null as grade_classification,
implementation_date
from laws_domestic_standard where del_flag = 0
from laws_domestic_standard where del_flag = 0 and standard_state != 7
union all
select id,'2' as resource_type,CONCAT_WS(' ',standard_number,standard_name) AS standard_name,create_time,7 as standard_type_order,
case when standard_state = 5 then 2
@@ -30,7 +30,7 @@
else 4
end as standard_state_order,
standard_class,null,applicable_vehicle,null,standard_state,null,null,implementation_date
from laws_overseas_standard where del_flag = 0
from laws_overseas_standard where del_flag = 0 and standard_state != 7
union all
select id,'3' as resource_type,CONCAT_WS(' ',standard_number,standard_name) AS standard_name,create_time,6 as standard_type_order,
case when standard_state = 5 then 2
@@ -39,7 +39,7 @@
else 4
end as standard_state_order,
null,null,null,null,standard_state,standard_code,grade_classification,implementation_date
from laws_enterprise_standard where del_flag = 0
from laws_enterprise_standard where del_flag = 0 and standard_state != 9
union all
select l1.id,'4' as resource_type,dynamic_heading as standard_name,create_time,9 as standard_type_order,
4 AS standard_state_order,
@@ -492,16 +492,19 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
switch (lawsHomeNormalSearchDTO.getResourceType()){
case LawsHomeSearchCommon.LAWS_DOMESTIC_STANDARD:
queryWrapper.ne("standard_state",7);
List<LawsHomeNormalSearchCountVO> list1 = lawsHomeSearchMapper.getCount1(queryWrapper);
setDict(list1);
count1(list1,obj);
break;
case LawsHomeSearchCommon.LAWS_OVERSEAS_STANDARD:
queryWrapper.ne("standard_state",7);
List<LawsHomeNormalSearchCountVO> list2 = lawsHomeSearchMapper.getCount2(queryWrapper);
setDict(list2);
count2(list2,obj);
break;
case LawsHomeSearchCommon.LAWS_ENTERPRISE_STANDARD:
queryWrapper.ne("standard_state",9);
List<LawsHomeNormalSearchCountVO> list3 = lawsHomeSearchMapper.getCount3(queryWrapper);
setDict(list3);
count3(list3,obj);
@@ -526,6 +529,7 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
// 标准状态
List<LawsHomeNormalSearchStatisticsObjVO> list2 = addLawsHomeNormalSearchStatistics(list, ENTERPRISE_STANDARD_STATE, STANDARD_STATE);
if(!CollectionUtils.isEmpty(list2)){
list2.removeIf(o->Objects.equals(o.getItemValue(),"9"));
obj.setEnterpriseStandardState(list2);
}
// 标准等级分类
@@ -549,6 +553,7 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
// 状态
List<LawsHomeNormalSearchStatisticsObjVO> list3 = addLawsHomeNormalSearchStatistics(list, STANDARD_STATE, STANDARD_STATE);
if(!CollectionUtils.isEmpty(list3)){
list3.removeIf(o->Objects.equals(o.getItemValue(),"7"));
obj.setStandardState(list3);
}
}
@@ -577,6 +582,7 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
// 状态
List<LawsHomeNormalSearchStatisticsObjVO> list5 = addLawsHomeNormalSearchStatistics(list,STANDARD_STATE, STANDARD_STATE);
if(!CollectionUtils.isEmpty(list5)){
list5.removeIf(o->Objects.equals(o.getItemValue(),"7"));
obj.setStandardState(list5);
}
}
@@ -1096,7 +1102,13 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
while (startIndex < listIds.size()) {
int endIndex = getEndIndex(startIndex, batchCount, listIds);
List<String> listIdsSub = listIds.subList(startIndex, endIndex);
List<LawsDomesticStandard> listLawsDomesticStandard = lawsDomesticStandardService.listByIds(listIdsSub);
LambdaQueryWrapper<LawsDomesticStandard> query = new LambdaQueryWrapper<>();
query.in(LawsDomesticStandard::getId,listIdsSub);
query.ne(LawsDomesticStandard::getStandardState,"7");
List<LawsDomesticStandard> listLawsDomesticStandard = lawsDomesticStandardService.list(query);
if(CollectionUtils.isEmpty(listLawsDomesticStandard)){
continue;
}
CompletableFuture.runAsync(()->{
for (LawsDomesticStandard lawsDomesticStandard : listLawsDomesticStandard) {
createData(resourceType, opType, lawsDomesticStandard);
@@ -1209,7 +1221,13 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
while (startIndex < listIds.size()) {
int endIndex = getEndIndex(startIndex, batchCount, listIds);
List<String> listIdsSub = listIds.subList(startIndex, endIndex);
List<LawsOverseasStandard> listLawsOverseasStandard = lawsOverseasStandardService.listByIds(listIdsSub);
LambdaQueryWrapper<LawsOverseasStandard> query = new LambdaQueryWrapper<>();
query.in(LawsOverseasStandard::getId,listIdsSub);
query.ne(LawsOverseasStandard::getStandardState,"7");
List<LawsOverseasStandard> listLawsOverseasStandard = lawsOverseasStandardService.list(query);
if(CollectionUtils.isEmpty(listLawsOverseasStandard)){
continue;
}
CompletableFuture.runAsync(()->{
for (LawsOverseasStandard lawsOverseasStandard : listLawsOverseasStandard) {
try {
@@ -1217,7 +1235,6 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
obj.setId(lawsOverseasStandard.getId());
obj.setTitle(lawsOverseasStandard.getStandardNumber() + " " + lawsOverseasStandard.getStandardName());
obj.setResourceType(resourceType);
obj.setStandardTypeOrder("7");
switch (lawsOverseasStandard.getStandardState()){
case "5": obj.setStandardStateOrder("2");break;
@@ -1295,7 +1312,13 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
while (startIndex < listIds.size()) {
int endIndex = getEndIndex(startIndex, batchCount, listIds);
List<String> listIdsSub = listIds.subList(startIndex, endIndex);
List<LawsEnterpriseStandard> listLawsEnterpriseStandard = lawsEnterpriseStandardService.listByIds(listIdsSub);
LambdaQueryWrapper<LawsEnterpriseStandard> query = new LambdaQueryWrapper<>();
query.in(LawsEnterpriseStandard::getId,listIdsSub);
query.ne(LawsEnterpriseStandard::getStandardState,"9");
List<LawsEnterpriseStandard> listLawsEnterpriseStandard = lawsEnterpriseStandardService.list(query);
if(CollectionUtils.isEmpty(listLawsEnterpriseStandard)){
continue;
}
CompletableFuture.runAsync(()->{
for (LawsEnterpriseStandard lawsEnterpriseStandard : listLawsEnterpriseStandard) {
try {