feat: There is no way the, Es

This commit is contained in:
super_liu
2022-06-08 11:40:47 +08:00
parent 5911efd8d6
commit 1735f95b4a
10 changed files with 60 additions and 11 deletions
@@ -1411,7 +1411,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
// .addSort(new ScoreSortBuilder().order(SortOrder.DESC))
.addSort("standTypeOrder",SortOrder.ASC)
.addSort("standSortOrder",SortOrder.ASC)
.addSort("numberTitle",SortOrder.ASC)
.addSort("numberTitle.keyword",SortOrder.ASC)
.addSort("yearOrder",SortOrder.DESC)
.addSort("sortTitle.keyword",SortOrder.ASC)
.setFrom((searchInfoEO.getPage()-1)*searchInfoEO.getPageSize())
@@ -14,6 +14,7 @@ import com.adc.da.slrs.sarStandItems.dao.SarStandItemsDao;
import com.adc.da.sys.dao.DicTypeEODao;
import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.adc.da.utils.util.Utils;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
@@ -179,7 +180,10 @@ public class UpdateStateBussSyncFz implements Runnable {
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
if(org.apache.commons.lang.StringUtils.isNotBlank(entry.getValue().toString())){
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if(json instanceof org.json.JSONArray){
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(),String.class);
}else {
@@ -14,6 +14,7 @@ import com.adc.da.slrs.sarStandItems.dao.SarStandItemsDao;
import com.adc.da.sys.dao.DicTypeEODao;
import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.adc.da.utils.util.Utils;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
@@ -204,7 +205,10 @@ public class UpdateStateBussSyncSsAndYx implements Runnable {
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
if(org.apache.commons.lang.StringUtils.isNotBlank(entry.getValue().toString())){
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if(json instanceof org.json.JSONArray){
valArr = JSONObject.parseArray(entry.getValue().toString(),String.class);
}else {
@@ -16,6 +16,7 @@ import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.sys.dao.DicTypeEODao;
import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.adc.da.utils.util.Utils;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
@@ -289,7 +290,10 @@ public class UpdateStateStandSyncFz implements Runnable {
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
if (StringUtils.isNotBlank(entry.getValue().toString())) {
Object json = new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if (json instanceof org.json.JSONArray) {
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(), String.class);
} else {
@@ -16,6 +16,7 @@ import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.sys.dao.DicTypeEODao;
import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.adc.da.utils.util.Utils;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
@@ -238,7 +239,10 @@ public class UpdateStateStandSyncSsAndYx implements Runnable {
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
if (StringUtils.isNotBlank(entry.getValue().toString())) {
Object json = new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if (json instanceof org.json.JSONArray) {
valArr = JSONObject.parseArray(entry.getValue().toString(), String.class);
} else {
@@ -31,8 +31,10 @@ import com.adc.da.util.http.Result;
import com.adc.da.utils.util.DateUtil;
import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.adc.da.utils.util.Utils;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.client.transport.TransportClient;
import org.json.JSONTokener;
@@ -504,7 +506,10 @@ public class ResetSearchCenterService {
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
if (StringUtils.isNotBlank(entry.getValue().toString())) {
Object json = new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if (json instanceof org.json.JSONArray) {
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(), String.class);
} else {
@@ -825,7 +830,10 @@ public class ResetSearchCenterService {
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
if(org.apache.commons.lang.StringUtils.isNotBlank(entry.getValue().toString())){
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if(json instanceof org.json.JSONArray){
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(),String.class);
}else {
@@ -1071,7 +1079,10 @@ public class ResetSearchCenterService {
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
if(org.apache.commons.lang.StringUtils.isNotBlank(entry.getValue().toString())){
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if(json instanceof org.json.JSONArray){
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(),String.class);
}else {
@@ -54,6 +54,7 @@ import com.adc.da.util.UUIDUtils;
import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.adc.da.utils.util.SarAdvanceSearchUtil;
import com.adc.da.utils.util.Utils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.sf.json.JSONObject;
@@ -1466,7 +1467,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
if(StringUtils.isNotBlank(entry.getValue().toString())){
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if(json instanceof org.json.JSONArray){
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(),String.class);
}else {
@@ -58,6 +58,7 @@ import com.adc.da.util.UUIDUtils;
import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.adc.da.utils.util.SarAdvanceSearchUtil;
import com.adc.da.utils.util.Utils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.sf.json.JSONObject;
@@ -769,7 +770,10 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
if(StringUtils.isNotBlank(entry.getValue().toString())){
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if(json instanceof org.json.JSONArray){
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(),String.class);
}else {
@@ -1025,7 +1025,10 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
if (StringUtils.isNotBlank(entry.getValue().toString())) {
Object json = new JSONTokener(entry.getValue().toString()).nextValue();
Object json = null;
if(Utils.isJson(entry.getValue().toString())){
json = new JSONTokener(entry.getValue().toString()).nextValue();
}
if (json instanceof JSONArray) {
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(), String.class);
} else {
@@ -1,5 +1,6 @@
package com.adc.da.utils.util;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
@@ -18,6 +19,16 @@ public class Utils {
return MessageFormat.format(value, paras);
}
public static boolean isJson(String string) {
try {
JSONObject.parseObject(string);
return true;
} catch (Exception e) {
return false;
}
}
//判断row是否为空 空返回true
public static boolean isRowEmpty(Row row) {
if (null == row) {