Merge branch 'develop_master' into FOTON
This commit is contained in:
@@ -142,6 +142,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/convertDocAll_GNW");
|
||||
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/convertDocAll_QB");
|
||||
|
||||
// 操作日志导出
|
||||
addInterceptor.excludePathPatterns("/api/sysLog/sys-log/exportSysLogExcelVOExcelData");
|
||||
|
||||
|
||||
//// //测试接口使用
|
||||
// addInterceptor.excludePathPatterns("/api/**");
|
||||
|
||||
+19
-21
@@ -215,32 +215,30 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
BoolQueryBuilder boolQueryMust = QueryBuilders.boolQuery();
|
||||
|
||||
updateIndex(searchInfoEO.getSelectIndex());
|
||||
String sortField = "";
|
||||
String sortField1 = "";
|
||||
String sortField2 = "";
|
||||
String sortField3 = "";
|
||||
if("laws".equals(searchInfoEO.getSelectIndex())){
|
||||
sortField = "lawsYear";
|
||||
sortField1 = "lawsType";
|
||||
sortField2 = "lawsNumber";
|
||||
sortField1 = "lawsNumber";
|
||||
sortField2 = "lawsYear";
|
||||
sortField3 = "lawsType.keyword";
|
||||
}else {
|
||||
sortField = "standYear";
|
||||
sortField1 = "standSort";
|
||||
sortField2 = "standNumber";
|
||||
sortField1 = "standNumber";
|
||||
sortField2 = "standYear";
|
||||
sortField3 = "standSort.keyword";
|
||||
}
|
||||
searchRequestBuilder = client.prepareSearch(searchInfoEO.getSelectIndex())
|
||||
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
|
||||
.setFrom((searchInfoEO.getPage()-1)*searchInfoEO.getPageSize())
|
||||
.addSort(new ScoreSortBuilder().order(SortOrder.DESC))
|
||||
.addSort("standSortOrder", SortOrder.ASC)
|
||||
.addSort(sortField1, SortOrder.ASC)
|
||||
.addSort(sortField2, SortOrder.ASC)
|
||||
.addSort(sortField, SortOrder.DESC)
|
||||
.addSort(sortField2, SortOrder.DESC)
|
||||
.addSort(sortField3, SortOrder.ASC)
|
||||
.addSort("issue_time_data", SortOrder.DESC)
|
||||
.setSize(searchInfoEO.getPageSize());
|
||||
|
||||
if(StringUtils.isNotBlank(searchInfoEO.getSelectType()) && !"titleSearch".equals(searchInfoEO.getSelectType())) {
|
||||
if(StringUtils.isNotBlank(searchInfoEO.getSelectIndex())) {
|
||||
if(searchInfoEO.getSelectIndex().equals("stand")) {
|
||||
boolQueryShould = queryStandMsg(searchInfoEO,boolQueryMust,searchRequestBuilder);
|
||||
} else if(searchInfoEO.getSelectIndex().equals("laws")){
|
||||
@@ -1387,7 +1385,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
if("废止".equals(textStatus) || "被代替".equals(textStatus) || "作废".equals(textStatus) ){
|
||||
textStatusColor = "redClass";
|
||||
}else if("参考".equals(textStatus)){
|
||||
textStatusColor = "yellowClass";
|
||||
textStatusColor = "greenClass";
|
||||
}
|
||||
}
|
||||
//解析高亮字段
|
||||
@@ -1472,10 +1470,10 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
// }
|
||||
// }
|
||||
boolQueryShould
|
||||
.should(QueryBuilders.wildcardQuery("sortTitle.keyword", searchInfoEO.getSelectValue().toUpperCase() + "*").boost(1005f))
|
||||
.should(QueryBuilders.wildcardQuery("numberTitle.keyword", searchInfoEO.getSelectValue().toUpperCase() + "*").boost(1004f))
|
||||
.should(QueryBuilders.wildcardQuery("yearOrder.keyword", searchInfoEO.getSelectValue().toUpperCase() + "*").boost(1003f))
|
||||
.should(QueryBuilders.wildcardQuery("nameTitle.keyword", "*" + searchInfoEO.getSelectValue().toUpperCase() + "*").boost(1002f))
|
||||
.should(QueryBuilders.wildcardQuery("sortTitle.keyword", searchInfoEO.getSelectValue().toUpperCase()).boost(1005f))
|
||||
.should(QueryBuilders.termQuery("numberTitle", searchInfoEO.getSelectValue().toUpperCase()).boost(1004f))
|
||||
.should(QueryBuilders.wildcardQuery("yearOrder.keyword", searchInfoEO.getSelectValue().toUpperCase()).boost(1003f))
|
||||
.should(QueryBuilders.wildcardQuery("nameTitle.keyword", searchInfoEO.getSelectValue().toUpperCase()).boost(1002f))
|
||||
.should(QueryBuilders.wildcardQuery("title.keyword", "*" + searchInfoEO.getSelectValue().toUpperCase() + "*").boost(1000f));
|
||||
// queryBuilder1 = QueryBuilders.multiMatchQuery(searchInfoEO.getSelectValue(),
|
||||
// "sortTitle","numberTitle","yearOrder","nameTitle","title"
|
||||
@@ -1520,11 +1518,11 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
searchRequestBuilder = client.prepareSearch("fulltextserch")
|
||||
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
|
||||
.highlighter(hiBuilder)
|
||||
// .addSort(new ScoreSortBuilder().order(SortOrder.DESC))
|
||||
.addSort(new ScoreSortBuilder().order(SortOrder.DESC))
|
||||
.addSort("standTypeOrder",SortOrder.ASC)
|
||||
.addSort("standSortOrder",SortOrder.ASC)
|
||||
.addSort("numberTitle.keyword",SortOrder.ASC)
|
||||
.addSort("yearOrder",SortOrder.DESC)
|
||||
.addSort("numberTitle",SortOrder.ASC)
|
||||
.addSort("yearOrder.keyword",SortOrder.DESC)
|
||||
.addSort("sortTitle.keyword",SortOrder.ASC)
|
||||
.setFrom((searchInfoEO.getPage()-1)*searchInfoEO.getPageSize())
|
||||
.setSize(searchInfoEO.getPageSize());
|
||||
@@ -1545,7 +1543,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
// textStatusColor = "redClass";
|
||||
// break;
|
||||
// }else if("参考".equals(textStatus)){
|
||||
// textStatusColor = "yellowClass";
|
||||
// textStatusColor = "greenClass";
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
@@ -1558,7 +1556,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
if("废止".equals(textStatus) || "被代替".equals(textStatus) || "作废".equals(textStatus) ){
|
||||
textStatusColor = "redClass";
|
||||
}else if("参考".equals(textStatus)){
|
||||
textStatusColor = "yellowClass";
|
||||
textStatusColor = "greenClass";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1897,7 +1895,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
if("废止".equals(textStatus) || "被代替".equals(textStatus) || "作废".equals(textStatus) ){
|
||||
textStatusColor = "redClass";
|
||||
}else if("参考".equals(textStatus)){
|
||||
textStatusColor = "yellowClass";
|
||||
textStatusColor = "greenClass";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+34
-6
@@ -151,6 +151,13 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
|
||||
|
||||
//查询字典表,形成Hash映射提升速度
|
||||
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_id","dic_type_code", "dic_type_name","show_index");
|
||||
dicInfo = dicInfo.stream().filter(dicTypeEO -> {
|
||||
if(StringUtils.isNotBlank(dicTypeEO.getDicTypeCode())){
|
||||
dicTypeEO.setDicTypeCode(dicTypeEO.getDicTypeCode().replace(" ",""));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}).collect(Collectors.toList());
|
||||
Map<String, Integer> dicMap = dicInfo.stream()
|
||||
.filter(item-> ("2klxdk7fo3tvpvin70dk".equals(item.getDicId()) || "18mg1g4x0rwubcto7fdd".equals(item.getDicId()) || "08rerbsn8ucjfk13z2ci".equals(item.getDicId()) || "pnv0ik979yqogocqujwo".equals(item.getDicId())) && !item.getDicTypeCode().isEmpty())
|
||||
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getShowIndex,(value1, value2 )->value2));
|
||||
@@ -170,7 +177,11 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
|
||||
}
|
||||
if("stand".equals(attrInfoMap.get("type"))){
|
||||
// 标准全文
|
||||
fullTextSearchEO.put("title",attrInfoMap.get("numbershow")+" "+attrInfoMap.getOrDefault("nameshow",""));
|
||||
if(StringUtils.isNotBlank(attrInfoMap.getOrDefault("nameshow","").toString())){
|
||||
fullTextSearchEO.put("title",attrInfoMap.get("numbershow")+" "+attrInfoMap.getOrDefault("nameshow",""));
|
||||
}else{
|
||||
fullTextSearchEO.put("title",attrInfoMap.get("numbershow")+" "+attrInfoMap.getOrDefault("standEnName",""));
|
||||
}
|
||||
|
||||
for (String key : attrInfoMap.keySet()) {
|
||||
if (null == attrInfoMap.get(key) || "".equals(attrInfoMap.get(key))){
|
||||
@@ -267,6 +278,7 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
|
||||
fullTextSearchEO.put("sortTitle", String.valueOf(attrInfoMap.get("standSort")));
|
||||
fullTextSearchEO.put("numberTitle", String.valueOf(attrInfoMap.get("standNumber")));
|
||||
fullTextSearchEO.put("nameTitle", String.valueOf(attrInfoMap.get("standName")));
|
||||
fullTextSearchEO.put("nameEnTitle", String.valueOf(attrInfoMap.get("standEnName")));
|
||||
fullTextSearchEO.put("textStatusFull", attrInfoMap.getOrDefault("textStatusName",""));
|
||||
|
||||
|
||||
@@ -293,7 +305,12 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
|
||||
attrInfoMap.put(key, "null");
|
||||
}
|
||||
}
|
||||
fullTextSearchEO.put("title",attrInfoMap.get("lawsTypeName")+" "+attrInfoMap.getOrDefault("lawsNumber","")+" "+attrInfoMap.getOrDefault("lawsName",""));
|
||||
if(StringUtils.isNotBlank(attrInfoMap.getOrDefault("lawsName","").toString())){
|
||||
fullTextSearchEO.put("title",attrInfoMap.get("lawsTypeName")+" "+attrInfoMap.getOrDefault("lawsNumber","")+" "+attrInfoMap.getOrDefault("lawsName",""));
|
||||
}else{
|
||||
fullTextSearchEO.put("title",attrInfoMap.get("lawsTypeName")+" "+attrInfoMap.getOrDefault("lawsNumber","")+" "+attrInfoMap.getOrDefault("lawsEnName",""));
|
||||
}
|
||||
|
||||
StringBuilder contentBuilder = new StringBuilder();
|
||||
contentBuilder.append("政策分类: ").append(attrInfoMap.get("lawsTypeName")).append(" ");
|
||||
contentBuilder.append("政策编号: ").append(attrInfoMap.get("lawsNumber")).append(" ");
|
||||
@@ -348,6 +365,7 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
|
||||
fullTextSearchEO.put("sortTitle", String.valueOf(attrInfoMap.get("lawsTypeName")));
|
||||
fullTextSearchEO.put("numberTitle", String.valueOf(attrInfoMap.get("lawsNumber")));
|
||||
fullTextSearchEO.put("nameTitle", String.valueOf(attrInfoMap.get("lawsName")));
|
||||
fullTextSearchEO.put("nameEnTitle", String.valueOf(attrInfoMap.get("lawsEnName")));
|
||||
fullTextSearchEO.put("textStatusFull", attrInfoMap.getOrDefault("lawsTextStateName",""));
|
||||
|
||||
|
||||
@@ -365,7 +383,11 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
|
||||
attrInfoMap.put(key, "null");
|
||||
}
|
||||
}
|
||||
fullTextSearchEO.put("title",attrInfoMap.get("stand_code")+" "+attrInfoMap.getOrDefault("stand_name",""));
|
||||
if(StringUtils.isNotBlank(attrInfoMap.getOrDefault("stand_name","").toString())){
|
||||
fullTextSearchEO.put("title",attrInfoMap.get("stand_code")+" "+attrInfoMap.getOrDefault("stand_name",""));
|
||||
}else{
|
||||
fullTextSearchEO.put("title",attrInfoMap.get("stand_code")+" "+attrInfoMap.getOrDefault("stand_en_name",""));
|
||||
}
|
||||
StringBuilder contentBuilder = new StringBuilder();
|
||||
contentBuilder.append("企标类别:").append(attrInfoMap.get("standSort")).append(" ");
|
||||
contentBuilder.append("标准年份:").append(attrInfoMap.get("standYear")).append(" ");
|
||||
@@ -410,6 +432,7 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
|
||||
fullTextSearchEO.put("sortTitle", String.valueOf(attrInfoMap.get("standSort")));
|
||||
fullTextSearchEO.put("numberTitle", String.valueOf(attrInfoMap.get("standNumber")));
|
||||
fullTextSearchEO.put("nameTitle", String.valueOf(attrInfoMap.get("stand_name")));
|
||||
fullTextSearchEO.put("nameEnTitle", String.valueOf(attrInfoMap.get("stand_en_name")));
|
||||
fullTextSearchEO.put("textStatusFull", attrInfoMap.getOrDefault("textStatusBussName",""));
|
||||
|
||||
if (null != attrInfoMap.get("issueTime") && !"".equals(attrInfoMap.get("issueTime")) && !"null".equals(attrInfoMap.get("issueTime"))) {
|
||||
@@ -423,9 +446,14 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
|
||||
return fullTextSearchEO;
|
||||
}
|
||||
|
||||
private String esStateOrder(String data, Map<String,Integer> dicMap){
|
||||
if(StringUtils.isNotBlank(data) && dicMap.get(data.toUpperCase()) != null){
|
||||
return String.valueOf(dicMap.get(data.toUpperCase()));
|
||||
private String esStateOrder(String data, Map<String, Integer> dicMap){
|
||||
if(StringUtils.isNotBlank(data)){
|
||||
data = data.replace(" ","");
|
||||
if(dicMap.get(data.trim().toUpperCase()) != null){
|
||||
return String.valueOf(dicMap.get(data.trim().toUpperCase()));
|
||||
}else {
|
||||
return "99999";
|
||||
}
|
||||
}else {
|
||||
return "99999";
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import net.sf.json.JSONObject;
|
||||
@@ -121,7 +122,23 @@ public class SendBussMQService {
|
||||
saveMap.put("put_time_data",-1000000000000000000L);
|
||||
}
|
||||
|
||||
//查询字典表,形成Hash映射提升速度
|
||||
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_id","dic_type_code", "dic_type_name","show_index");
|
||||
dicInfo = dicInfo.stream().filter(dicTypeEO -> {
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(dicTypeEO.getDicTypeCode())){
|
||||
dicTypeEO.setDicTypeCode(dicTypeEO.getDicTypeCode().replace(" ",""));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}).collect(Collectors.toList());
|
||||
Map<String, Integer> dicMap = dicInfo.stream()
|
||||
.filter(item-> ("2klxdk7fo3tvpvin70dk".equals(item.getDicId()) || "18mg1g4x0rwubcto7fdd".equals(item.getDicId()) || "08rerbsn8ucjfk13z2ci".equals(item.getDicId()) || "pnv0ik979yqogocqujwo".equals(item.getDicId())) && !item.getDicTypeCode().isEmpty())
|
||||
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getShowIndex,(value1, value2 )->value2));
|
||||
|
||||
|
||||
saveMap.put("id",infoEO.getId());
|
||||
saveMap.put("standSortOrder",esStateOrder(String.valueOf(infoEO.getStandSort()),dicMap));
|
||||
|
||||
saveMap.put("standSort",infoEO.getStandSort());
|
||||
saveMap.put("stand_sort",infoEO.getStandSort());
|
||||
if(StringUtils.isNotEmpty(infoEO.getStandSort())){
|
||||
@@ -217,6 +234,19 @@ public class SendBussMQService {
|
||||
}
|
||||
}
|
||||
|
||||
private String esStateOrder(String data, Map<String, Integer> dicMap){
|
||||
if(StringUtils.isNotBlank(data)){
|
||||
data = data.replace(" ","");
|
||||
if(dicMap.get(data.trim().toUpperCase()) != null){
|
||||
return String.valueOf(dicMap.get(data.trim().toUpperCase()));
|
||||
}else {
|
||||
return "99999";
|
||||
}
|
||||
}else {
|
||||
return "99999";
|
||||
}
|
||||
}
|
||||
|
||||
private String filterStringIsNotBlank(String str,boolean boo){
|
||||
String f = ",";
|
||||
return (str == null || str.equals("") || str.equals("null")) ? "" : (boo ? str+f : str);
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.rabbitmq.client.Channel;
|
||||
@@ -85,6 +86,20 @@ public class SendLawsMQService {
|
||||
FZRQFSRQ = "1";
|
||||
}
|
||||
|
||||
//查询字典表,形成Hash映射提升速度
|
||||
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_id","dic_type_code", "dic_type_name","show_index");
|
||||
dicInfo = dicInfo.stream().filter(dicTypeEO -> {
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(dicTypeEO.getDicTypeCode())){
|
||||
dicTypeEO.setDicTypeCode(dicTypeEO.getDicTypeCode().replace(" ",""));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}).collect(Collectors.toList());
|
||||
Map<String, Integer> dicMap = dicInfo.stream()
|
||||
.filter(item-> ("2klxdk7fo3tvpvin70dk".equals(item.getDicId()) || "18mg1g4x0rwubcto7fdd".equals(item.getDicId()) || "08rerbsn8ucjfk13z2ci".equals(item.getDicId()) || "pnv0ik979yqogocqujwo".equals(item.getDicId())) && !item.getDicTypeCode().isEmpty())
|
||||
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getShowIndex,(value1, value2 )->value2));
|
||||
|
||||
|
||||
String sarStandAttrEOStr = infoEO.getSarStandAttrEOStr();
|
||||
Map<String,Object> attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
|
||||
Map<String,Object> infoMap = infoEO.getAttrInfoCaseMap();
|
||||
@@ -151,6 +166,7 @@ public class SendLawsMQService {
|
||||
List<String> valArr = Arrays.asList(infoEO.getLawsType().split(","));
|
||||
lawsTypeName = dicTypeEODao.getDicNamesByCodes(valArr,"");
|
||||
}
|
||||
saveMap.put("standSortOrder",esStateOrder(infoEO.getLawsType(),dicMap));
|
||||
saveMap.put("lawsType",infoEO.getLawsType());
|
||||
saveMap.put("lawsTypeName",lawsTypeName);
|
||||
saveMap.put("lawsNumber",infoEO.getLawsNumber());
|
||||
@@ -266,6 +282,19 @@ public class SendLawsMQService {
|
||||
}
|
||||
}
|
||||
|
||||
private String esStateOrder(String data, Map<String, Integer> dicMap){
|
||||
if(StringUtils.isNotBlank(data)){
|
||||
data = data.replace(" ","");
|
||||
if(dicMap.get(data.trim().toUpperCase()) != null){
|
||||
return String.valueOf(dicMap.get(data.trim().toUpperCase()));
|
||||
}else {
|
||||
return "99999";
|
||||
}
|
||||
}else {
|
||||
return "99999";
|
||||
}
|
||||
}
|
||||
|
||||
private String filterStringIsNotBlank(String str,boolean boo){
|
||||
String f = ",";
|
||||
return (str == null || str.equals("") || str.equals("null")) ? "" : (boo ? str+f : str);
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import net.sf.json.JSONObject;
|
||||
@@ -87,6 +88,20 @@ public class SendStandMQService {
|
||||
Map<String,Object> infoMap = infoEO.getAttrInfoMap();
|
||||
Map<String,String> infoEOMapItems = infoEO.getMapItems();
|
||||
|
||||
//查询字典表,形成Hash映射提升速度
|
||||
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_id","dic_type_code", "dic_type_name","show_index");
|
||||
dicInfo = dicInfo.stream().filter(dicTypeEO -> {
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(dicTypeEO.getDicTypeCode())){
|
||||
dicTypeEO.setDicTypeCode(dicTypeEO.getDicTypeCode().replace(" ",""));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}).collect(Collectors.toList());
|
||||
Map<String, Integer> dicMap = dicInfo.stream()
|
||||
.filter(item-> ("2klxdk7fo3tvpvin70dk".equals(item.getDicId()) || "18mg1g4x0rwubcto7fdd".equals(item.getDicId()) || "08rerbsn8ucjfk13z2ci".equals(item.getDicId()) || "pnv0ik979yqogocqujwo".equals(item.getDicId())) && !item.getDicTypeCode().isEmpty())
|
||||
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getShowIndex,(value1, value2 )->value2));
|
||||
|
||||
|
||||
// 往索引表中插入数据
|
||||
String getCodeName = "";
|
||||
Map<String,Object> saveMap = new HashMap<>();
|
||||
@@ -101,6 +116,7 @@ public class SendStandMQService {
|
||||
String codeName = sysInfoEOService.getDicNamesByCodes(infoEO.getCountry(),"RFRFRFSCXVB");
|
||||
saveMap.put("countryShow",codeName);
|
||||
}
|
||||
saveMap.put("standSortOrder",esStateOrder(String.valueOf(infoEO.getStandSort()),dicMap));
|
||||
saveMap.put("standSort",infoEO.getStandSort());
|
||||
saveMap.put("stand_sort",infoEO.getStandSort());
|
||||
if (StringUtils.isNotEmpty(infoEO.getStandSort())) {
|
||||
@@ -252,6 +268,19 @@ public class SendStandMQService {
|
||||
}
|
||||
}
|
||||
|
||||
private String esStateOrder(String data, Map<String, Integer> dicMap){
|
||||
if(StringUtils.isNotBlank(data)){
|
||||
data = data.replace(" ","");
|
||||
if(dicMap.get(data.trim().toUpperCase()) != null){
|
||||
return String.valueOf(dicMap.get(data.trim().toUpperCase()));
|
||||
}else {
|
||||
return "99999";
|
||||
}
|
||||
}else {
|
||||
return "99999";
|
||||
}
|
||||
}
|
||||
|
||||
private String filterStringIsNotBlank(String str,boolean boo){
|
||||
String f = ",";
|
||||
return (str == null || str.equals("") || str.equals("null")) ? "" : (boo ? str+f : str);
|
||||
|
||||
+1
-1
@@ -227,7 +227,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
sarStandMenuEO.setId(UUIDUtils.randomUUID20());
|
||||
sarBussStandMenuEODao.insertSelective(sarStandMenuEO);
|
||||
}
|
||||
int insertresult = sarBussionessStandEODao.insertSelective(sarBussionessStandEO);
|
||||
int insertresult = this.baseMapper.insert(sarBussionessStandEO);
|
||||
if (insertresult >= 1) {
|
||||
// 根据代替标准号 ,修改代替标准号标准中的,被代替标准号
|
||||
updateReplaceConnect(sarBussionessStandEO);
|
||||
|
||||
@@ -3,12 +3,20 @@ package com.adc.da.slrs.sysLog.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import com.adc.da.slrs.sysLog.entity.SysLogExcel;
|
||||
import com.adc.da.slrs.sysLog.service.ISysLogService;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqDTO;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqExportDTO;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -17,6 +25,9 @@ import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -35,6 +46,35 @@ public class SysLogController extends BaseController<SysLog> {
|
||||
@Autowired
|
||||
private ISysLogService sysLogService;
|
||||
|
||||
@ApiOperation(value = "|SysCorpEO|导出excel")
|
||||
@GetMapping(value = "/exportSysLogExcelVOExcelData")
|
||||
public void exportSysLogExcelVOExcelData(String exportJson, HttpServletResponse response,
|
||||
HttpServletRequest request) throws Exception {
|
||||
try {
|
||||
|
||||
SysLogReqExportDTO sysLogExcelVO = JSONObject.parseObject(exportJson,SysLogReqExportDTO.class);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
if(StringUtils.isBlank(sysLogExcelVO.getExportName()) || "null".equals(sysLogExcelVO.getExportName())){
|
||||
sysLogExcelVO.setExportName("操作日志");
|
||||
}
|
||||
String fileName = URLEncoder.encode(sysLogExcelVO.getExportName(), "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
List<SysLogExcel> data=sysLogService.getSysLogExcelVOExcelData(sysLogExcelVO);
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), SysLogExcel.class)
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||
.autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(data);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
// 重置response
|
||||
response.reset();
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.getWriter().println(JSON.toJSONString(Result.error()));
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("获取操作日志")
|
||||
@GetMapping("/getAllLog")
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.adc.da.slrs.sysLog.dao;
|
||||
|
||||
import com.adc.da.slrs.sysLog.entity.SysLog;
|
||||
import com.adc.da.slrs.sysLog.entity.SysLogExcel;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqDTO;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqExportDTO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,5 +21,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface SysLogDao extends BaseMapper<SysLog> {
|
||||
|
||||
List<SysLogExcel> getSysLogExcelVOExcelData(@Param("sysLogReqDTO") SysLogReqExportDTO sysLogReqDTO);
|
||||
|
||||
IPage<SysLog> queryAllLog(Page page,@Param("sysLogReqDTO") SysLogReqDTO sysLogReqDTO);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.slrs.sysLog.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-02-15
|
||||
*/
|
||||
@Data
|
||||
public class SysLogExcel{
|
||||
|
||||
@ExcelProperty("操作人")
|
||||
private String account;
|
||||
|
||||
@ExcelProperty("所属部门")
|
||||
private String dept;
|
||||
|
||||
@ExcelProperty("操作时间")
|
||||
private String operTime;
|
||||
|
||||
@ExcelProperty("操作类型")
|
||||
private String oper;
|
||||
|
||||
@ExcelProperty("操作内容")
|
||||
private String special;
|
||||
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.adc.da.slrs.sysLog.service;
|
||||
|
||||
import com.adc.da.slrs.sysLog.entity.SysLog;
|
||||
import com.adc.da.slrs.sysLog.entity.SysLogExcel;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqExportDTO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
@@ -17,4 +20,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
public interface ISysLogService extends IService<SysLog> {
|
||||
|
||||
IPage<SysLog> getAllLog(SysLogReqDTO sysLogReqDTO);
|
||||
|
||||
List<SysLogExcel> getSysLogExcelVOExcelData(SysLogReqExportDTO sysLogReqDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,13 +2,17 @@ package com.adc.da.slrs.sysLog.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sysLog.entity.SysLog;
|
||||
import com.adc.da.slrs.sysLog.dao.SysLogDao;
|
||||
import com.adc.da.slrs.sysLog.entity.SysLogExcel;
|
||||
import com.adc.da.slrs.sysLog.service.ISysLogService;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqDTO;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqExportDTO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
@@ -20,6 +24,11 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SysLogServiceImpl extends ServiceImpl<SysLogDao, SysLog> implements ISysLogService {
|
||||
|
||||
@Override
|
||||
public List<SysLogExcel> getSysLogExcelVOExcelData(SysLogReqExportDTO sysLogReqDTO) {
|
||||
return this.baseMapper.getSysLogExcelVOExcelData(sysLogReqDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SysLog> getAllLog(SysLogReqDTO sysLogReqDTO) {
|
||||
Page<SysLog> page = new Page<>(sysLogReqDTO.getPage(), sysLogReqDTO.getPageSize());
|
||||
|
||||
@@ -15,4 +15,10 @@ public class SysLogReqDTO extends BasePage {
|
||||
private String oper;
|
||||
|
||||
private String content;
|
||||
|
||||
private String exportType;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String exportName;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.adc.da.slrs.sysLog.vo;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SysLogReqExportDTO {
|
||||
|
||||
private String account;
|
||||
|
||||
private String sTime;
|
||||
|
||||
private String eTime;
|
||||
|
||||
private String oper;
|
||||
|
||||
private String content;
|
||||
|
||||
private String exportType;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String exportName;
|
||||
}
|
||||
@@ -2,6 +2,29 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sysLog.dao.SysLogDao">
|
||||
|
||||
<select id="getSysLogExcelVOExcelData" parameterType="com.adc.da.slrs.sysLog.vo.SysLogReqExportDTO" resultType="com.adc.da.slrs.sysLog.entity.SysLogExcel">
|
||||
select CONCAT('(',ts_user.account,')',ts_user.UNAME) as account,ts_user.UNAME as accountName,ts_institution.name dept,sys_log.oper_time,sys_log.oper,sys_log.special from sys_log
|
||||
left join ts_user on sys_log.user_id = ts_user.usid
|
||||
left join ts_institution on ts_user.institution_id = ts_institution.id
|
||||
WHERE 1=1 and sys_log.oper_time >= DATE_SUB(CURDATE(),INTERVAL 1 YEAR)
|
||||
<if test="sysLogReqDTO.account != null and sysLogReqDTO.account != ''">
|
||||
and ts_user.account = #{sysLogReqDTO.account}
|
||||
</if>
|
||||
<if test="sysLogReqDTO.sTime != null and sysLogReqDTO.sTime != ''">
|
||||
and sys_log.oper_time >= #{sysLogReqDTO.sTime}
|
||||
</if>
|
||||
<if test="sysLogReqDTO.eTime != null and sysLogReqDTO.eTime != ''">
|
||||
and sys_log.oper_time <= #{sysLogReqDTO.eTime}
|
||||
</if>
|
||||
<if test="sysLogReqDTO.oper != null and sysLogReqDTO.oper != ''">
|
||||
and sys_log.oper = #{sysLogReqDTO.oper}
|
||||
</if>
|
||||
<if test="sysLogReqDTO.content != null and sysLogReqDTO.content != ''">
|
||||
and sys_log.special like concat(concat('%',#{sysLogReqDTO.content}),'%')
|
||||
</if>
|
||||
order by sys_log.oper_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryAllLog" parameterType="com.adc.da.slrs.sysLog.vo.SysLogReqDTO" resultType="com.adc.da.slrs.sysLog.entity.SysLog">
|
||||
select ts_user.account,ts_user.UNAME as accountName,ts_institution.name dept,sys_log.oper_time,sys_log.oper,sys_log.special from sys_log
|
||||
left join ts_user on sys_log.user_id = ts_user.usid
|
||||
|
||||
@@ -3,6 +3,9 @@ bussstand/bussstand/_mapping?pretty&include_type_name=true
|
||||
{
|
||||
"bussstand": {
|
||||
"properties": {
|
||||
"standSortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
"BARQ": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
|
||||
@@ -75,6 +75,18 @@ fulltextserch/fulltextserch/_mapping?pretty&include_type_name=true
|
||||
},
|
||||
"fielddata": true
|
||||
},
|
||||
"nameEnTitle": {
|
||||
"type": "text",
|
||||
"analyzer": "ik_max_word",
|
||||
"search_analyzer": "ik_max_word",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 256
|
||||
}
|
||||
},
|
||||
"fielddata": true
|
||||
},
|
||||
"yearOrder": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
@@ -86,24 +98,10 @@ fulltextserch/fulltextserch/_mapping?pretty&include_type_name=true
|
||||
"fielddata": true
|
||||
},
|
||||
"standSortOrder": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 256
|
||||
}
|
||||
},
|
||||
"fielddata": true
|
||||
"type": "integer"
|
||||
},
|
||||
"standTypeOrder": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
"keyword": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 256
|
||||
}
|
||||
},
|
||||
"fielddata": true
|
||||
"type": "integer"
|
||||
},
|
||||
"textContent": {
|
||||
"type": "text",
|
||||
|
||||
@@ -3,6 +3,9 @@ laws/laws/_mapping?pretty&include_type_name=true
|
||||
{
|
||||
"laws": {
|
||||
"properties": {
|
||||
"standSortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
"BDTWJHLAWS": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
|
||||
@@ -3,6 +3,9 @@ stand/stand/_mapping?pretty&include_type_name=true
|
||||
{
|
||||
"stand": {
|
||||
"properties": {
|
||||
"standSortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
"BARQ": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
索引/_update_by_query
|
||||
|
||||
{
|
||||
"script": {
|
||||
"source": "ctx._source['standSortOrder']=51"
|
||||
},
|
||||
"query": {
|
||||
"bool": {
|
||||
"must": [
|
||||
{
|
||||
"match": {
|
||||
"sortTitle.keyword": "QC/T"
|
||||
}
|
||||
}
|
||||
],
|
||||
"must_not": [],
|
||||
"should": []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
根据是否存在"ipsub"字段,如果不存在,给信息增加字段"ipsub",并且赋值0
|
||||
POST my_index / _update_by_query
|
||||
|
||||
{
|
||||
"script": {
|
||||
"source": "ctx._source['standSortOrder']=0"
|
||||
},
|
||||
"query": {
|
||||
"bool": {
|
||||
"must_not": [{
|
||||
"exists": {
|
||||
"field": "standSortOrder"
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user