搜索中心功能开发
This commit is contained in:
+4
-4
@@ -7,13 +7,13 @@
|
||||
select id,'1' as resource_type,standard_number,standard_name,
|
||||
case when standard_class = 'GB' then 2
|
||||
when standard_class = 'GB/T' then 1 end as standard_type
|
||||
from laws_domestic_standard
|
||||
from laws_domestic_standard where del_flag = 0
|
||||
union all
|
||||
select id,'2' as resource_type,standard_number,standard_name,0 as standard_type from laws_overseas_standard
|
||||
select id,'2' as resource_type,standard_number,standard_name,0 as standard_type from laws_overseas_standard where del_flag = 0
|
||||
union all
|
||||
select id,'3' as resource_type,standard_number,standard_name,0 as standard_type from laws_enterprise_standard
|
||||
select id,'3' as resource_type,standard_number,standard_name,0 as standard_type from laws_enterprise_standard where del_flag = 0
|
||||
union all
|
||||
select id,'4' as resource_type,'' as standard_number,dynamic_heading as standard_name,0 as standard_type from laws_news_feed
|
||||
select id,'4' as resource_type,'' as standard_number,dynamic_heading as standard_name,0 as standard_type from laws_news_feed where del_flag = 0
|
||||
) as all_data
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
|
||||
+42
-5
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.laws.home.common.LawsHomeSearchCommon;
|
||||
import com.jero.modules.laws.home.dto.LawsHomeNormalSearchDTO;
|
||||
@@ -29,10 +30,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
@@ -54,6 +52,8 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
||||
private ILawsEnterpriseStandardService lawsEnterpriseStandardService;
|
||||
@Resource
|
||||
private ILawsNewsFeedService lawsNewsFeedService;
|
||||
@Resource
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
@@ -127,8 +127,10 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
||||
List<LawsOverseasStandard> finalListLawsOverseasStandard = listLawsOverseasStandard;
|
||||
List<LawsEnterpriseStandard> finalListLawsEnterpriseStandard = listLawsEnterpriseStandard;
|
||||
List<LawsNewsFeed> finalListLawsNewsFeed = listLawsNewsFeed;
|
||||
// Map<String,String> = sysBaseAPI.getDictItems("");
|
||||
|
||||
|
||||
list.parallelStream().forEach(p->{
|
||||
// todo 名词回显高亮
|
||||
switch (p.getResourceType()){
|
||||
case LawsHomeSearchCommon.LAWS_DOMESTIC_STANDARD:
|
||||
if(!CollectionUtils.isEmpty(finalListLawsDomesticStandard)){
|
||||
@@ -136,7 +138,30 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
||||
if(op.isPresent()){
|
||||
LawsDomesticStandard obj = op.get();
|
||||
p.setTitle(obj.getStandardNumber().replace(searchContent,searchContentSpan) + " " + obj.getStandardName().replace(searchContent,searchContentSpan));
|
||||
p.setReleaseDate(obj.getReleaseDate());
|
||||
// todo 生成正文
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.append("标准性质:").append(obj.getStandardProperty()).append(" ");
|
||||
content.append("标准类别:").append(obj.getStandardClass()).append(" ");
|
||||
content.append("年代号:").append(obj.getYearNumber()).append(" ");
|
||||
content.append("标准编号:").append(obj.getStandardNumber()).append(" ");
|
||||
content.append("标准名称:").append(obj.getStandardName()).append(" ");
|
||||
content.append("标准英文名称:").append(obj.getStandardEnglishName()).append(" ");
|
||||
content.append("标准体系:").append(obj.getStandardSystem()).append(" ");
|
||||
content.append("发布日期:").append(obj.getReleaseDate()).append(" ");
|
||||
content.append("实施日期:").append(obj.getImplementationDate()).append(" ");
|
||||
content.append("在产车实施日期:").append(obj.getOnTheProductionDate()).append(" ");
|
||||
content.append("新车型实施日期:").append(obj.getNewModelImplementationDate()).append(" ");
|
||||
content.append("废止日期:").append(obj.getAnnulmentDate()).append(" ");
|
||||
content.append("标准状态:").append(obj.getStandardState()).append(" ");
|
||||
content.append("归口管理部门:").append(obj.getCentralizedManagementDepartments()).append(" ");
|
||||
content.append("分标委:").append(obj.getBiddingCommittee()).append(" ");
|
||||
content.append("责任部门:").append(obj.getResponsibleDepartment()).append(" ");
|
||||
content.append("责任部门负责人:").append(obj.getResponsibleDepartmentUser()).append(" ");
|
||||
content.append("零部件名称:").append(obj.getPartName()).append(" ");
|
||||
content.append("适用认证:").append(obj.getApplicableCertification()).append(" ");
|
||||
content.append("适用车型:").append(obj.getApplicableVehicle()).append(" ");
|
||||
content.append("动力类型:").append(obj.getDynamicType());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -147,7 +172,9 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
||||
if(op.isPresent()){
|
||||
LawsOverseasStandard obj = op.get();
|
||||
p.setTitle(obj.getStandardNumber().replace(searchContent,searchContentSpan) + " " + obj.getStandardName().replace(searchContent,searchContentSpan));
|
||||
p.setReleaseDate(obj.getReleaseDate());
|
||||
// todo 生成正文
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -157,6 +184,7 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
||||
if(op.isPresent()){
|
||||
LawsEnterpriseStandard obj = op.get();
|
||||
p.setTitle(obj.getStandardNumber().replace(searchContent,searchContentSpan) + " " + obj.getStandardName().replace(searchContent,searchContentSpan));
|
||||
p.setReleaseDate(obj.getReleaseDate());
|
||||
// todo 生成正文
|
||||
}
|
||||
}
|
||||
@@ -167,12 +195,21 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
||||
if(op.isPresent()){
|
||||
LawsNewsFeed obj = op.get();
|
||||
p.setTitle(obj.getDynamicHeading().replace(searchContent,searchContentSpan));
|
||||
p.setReleaseDate(obj.getReleaseTime());
|
||||
// todo 生成正文
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
pageList.setRecords(list);
|
||||
}
|
||||
|
||||
private String isNull(String str){
|
||||
if(StringUtils.isBlank(str)){
|
||||
str = "--";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-1
@@ -1,9 +1,12 @@
|
||||
package com.jero.modules.laws.home.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
@@ -36,5 +39,7 @@ public class LawsHomeNormalSearchVO implements Serializable {
|
||||
* 发布日期
|
||||
*/
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
private String releaseDate;
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date releaseDate;
|
||||
}
|
||||
|
||||
+4
@@ -129,6 +129,10 @@ public class LawsDomesticStandard implements Serializable {
|
||||
@Excel(name = "责任部门", width = 15)
|
||||
@ApiModelProperty(value = "责任部门")
|
||||
private java.lang.String responsibleDepartment;
|
||||
/**责任部门负责人*/
|
||||
@Excel(name = "责任部门负责人", width = 15)
|
||||
@ApiModelProperty(value = "责任部门负责人")
|
||||
private java.lang.String responsibleDepartmentUser;
|
||||
/**企业参与情况*/
|
||||
@Excel(name = "企业参与情况", width = 15)
|
||||
@ApiModelProperty(value = "企业参与情况")
|
||||
|
||||
Reference in New Issue
Block a user