Commit 832141da authored by suhuiguang's avatar suhuiguang

1.增加管辖机构树获取功能,便于运维人员更新管辖机构树json

2.bug 企业注册时,管辖机构中错误出现非监管机构单位
parent c5cd9b62
......@@ -300,6 +300,14 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/refresh")
@ApiOperation(httpMethod = "GET", value = "更新管辖分局树缓存,运维人员使用", notes = "更新管辖分局树缓存,运维人员使用")
public ResponseModel<Object> refreshTree(){
return ResponseHelper.buildResponse(equipmentCategoryService.creatTree());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getTable")
@ApiOperation(httpMethod = "GET", value = "设备认领和设备管理通用接口", notes = "设备认领和设备管理通用接口")
public ResponseModel<Page<Map<String,Object>>> getTable(@RequestParam Map<String,Object> map) {
......
......@@ -25,17 +25,9 @@ import com.yeejoin.amos.boot.module.tcm.flc.api.feign.PrivilegeFeginService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
......@@ -122,7 +114,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private String code;
@Autowired
RestHighLevelClient restHighLevelClient;
RestHighLevelClient restHighLevelClient;
@Autowired
private RedisUtils redisUtils;
......@@ -256,7 +248,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
//生成码
Map<String, String> codeMap;
synchronized (EquipmentCategoryServiceImpl.class) {
codeMap = creatCode(city, county, equipCategory, null,null);
codeMap = creatCode(city, county, equipCategory, null, null);
}
if (ObjectUtils.isEmpty(codeMap)) {
return new HashMap<>();
......@@ -276,7 +268,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
List<CategoryOtherInfo> categoryOtherInfo = categoryOtherInfoMapper.selectList(new QueryWrapper<CategoryOtherInfo>().eq("SUPERVISORY_CODE", supervisorCode));
if (categoryOtherInfo.size() > 0) {
// categoryOtherInfoMapper.updateCode(supervisorCode, equState);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode()));
supervisoryCodeInfoMapper.update(supervisoryCodeInfo, new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisoryCodeInfo.getSupervisoryCode()));
} else {
supervisoryCodeInfo.setStatus(equState);
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
......@@ -298,7 +290,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Override
public List<LinkedHashMap> creatTree() {
FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(),RequestContext.getAppKey(),RequestContext.getProduct());
FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> treeData = deleteRegulatorTreeData(result);
List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList());
......@@ -337,15 +329,27 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* @return 筛选过滤后不包含使用单位的管辖机构树
*/
private List<LinkedHashMap> deleteRegulatorTreeData(List<LinkedHashMap> result) {
// 需排除的公司类型
String excludeCompanyType = "检验检测机构";
Iterator it = result.iterator();
while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next();
//删除使用单位
if ("company".equals(e.get("level"))) {
it.remove();
// 一行数据可能 满足几个remove,所以需要删除后,继续下一循环
continue;
}
// 删除检验检测机构类似公司
if(excludeCompanyType.equals(e.get("companyType"))){
it.remove();
// 一行数据可能 满足几个remove,所以需要删除后,继续下一循环
continue;
}
if (e.get("companyName").toString().contains("行政审批局")) {
it.remove();
// 一行数据可能 满足几个remove,所以需要删除后,继续下一循环
continue;
}
if (!ObjectUtils.isEmpty(e.get("children"))) {
deleteRegulatorTreeData((List<LinkedHashMap>) e.get("children"));
......@@ -474,7 +478,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
/**
* 具体生成监管码和电梯96333识别码逻辑
*/
private synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333,String supervisionCode) {
private synchronized Map<String, String> creatCode(String city, String county, String equipCategory, String code96333, String supervisionCode) {
Map<String, String> resultMap = new HashMap<>();
StringBuilder supervisorCode = new StringBuilder();
StringBuilder elevatorCode = new StringBuilder();
......@@ -483,24 +487,24 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
//判断是否需要生成96333电梯码
if (equipCategory.startsWith("3") && !XIAN.equals(city)) {
//判断数据是否携带96333电梯码,携带则使用,不携带则生成
if("null".equals(code96333)){
if ("null".equals(code96333)) {
prefix = getPrefix(EquipmentCategoryEnum.XZQHDT.getCode(), city);
//查询未使用的电梯码
categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode());
//如果存在未使用的电梯码则启用未使用的否则创建
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(city, county) : categoryOtherInfo.getCode();
if(!ObjectUtils.isEmpty(categoryOtherInfo)){
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333",categoryOtherInfo.getCode()));
if (!ObjectUtils.isEmpty(categoryOtherInfo)) {
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333", categoryOtherInfo.getCode()));
}
elevatorCode.append(elevator);
resultMap.put("creatStatus",CREATE);
resultMap.put("creatStatus", CREATE);
} else {
elevatorCode.append(code96333);
resultMap.put("creatStatus",NOT_CREATE);
resultMap.put("creatStatus", NOT_CREATE);
}
}
//判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成
if("null".equals(supervisionCode)){
if ("null".equals(supervisionCode)) {
String supervisor = createSupervisorCode(city, county, equipCategory);
supervisorCode.append(supervisor);
} else {
......@@ -519,12 +523,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
supervisoryCodeInfo.setCreateStatus(resultMap.get("creatStatus"));
supervisoryCodeInfo.setSupervisoryCode(String.valueOf(supervisorCode));
supervisoryCodeInfo.setStatus(equState);
if(ObjectUtils.isEmpty(selectOne)){
if (ObjectUtils.isEmpty(selectOne)) {
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
} else {
selectOne.setCode96333(String.valueOf(elevatorCode));
supervisoryCodeInfoMapper.update(selectOne,
new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",selectOne.getSupervisoryCode()));
new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", selectOne.getSupervisoryCode()));
}
resultMap.put("superviseCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
resultMap.put("code96333", ObjectUtils.isEmpty(elevatorCode) ? null : elevatorCode.toString());
......@@ -792,7 +796,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return list;
}
public List<EquipExportVo> getEquipExportData(EquipExportDto dto){
public List<EquipExportVo> getEquipExportData(EquipExportDto dto) {
ArrayList<EquipExportVo> list = new ArrayList<>();
List<JSONObject> objectList = getCompanyType();
if (!ValidationUtil.isEmpty(dto.getEQU_STATE())) {
......@@ -811,7 +815,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
dto.setORG_BRANCH_CODE(orgCode);
}
List<EquipExportVo> equipExportData = equipmentCategoryMapper.getEquipExportData(dto);
if (!ObjectUtils.isEmpty(equipExportData) ) {
if (!ObjectUtils.isEmpty(equipExportData)) {
list.addAll(equipExportData);
}
}
......@@ -851,23 +855,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
@Override
@Async
public void createEquipmentCategoryData() {
if(log.isInfoEnabled()){
if (log.isInfoEnabled()) {
log.info("初始化一码通总览数据开始");
}
equipmentCategoryDataService.remove(new QueryWrapper<>());
getCategoryData(null,null);
getCategoryData(null, null);
}
private List<EquipmentCategoryData> getCategoryData(List<String> unitCodes,List<String> orgBranchCodes) {
private List<EquipmentCategoryData> getCategoryData(List<String> unitCodes, List<String> orgBranchCodes) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
List<EquipmentCategoryData> list = new ArrayList<>();
// 查询所有单位
List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCodes,orgBranchCodes);
List<Map<String, Object>> allUnitList = equipmentCategoryMapper.getAllUnit(unitCodes, orgBranchCodes);
// 统计查询不同单位、不同装备定义、不同状态下的设备数量
List<UseUnitCreditCodeCategoryDto> equipCountList = equipmentCategoryMapper.useUnitCreditCodeCategoryCount();
// 查询8大类设备定义
......@@ -875,31 +878,31 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
// 组织EquipmentCategoryData表数据
for (Map<String, Object> map : allUnitList) {
EquipmentCategoryData equipmentCategoryData = new EquipmentCategoryData();
if(ObjectUtils.isEmpty(map.get("supervise_org_code")) || ObjectUtils.isEmpty(map.get(USE_CODE))){
if (ObjectUtils.isEmpty(map.get("supervise_org_code")) || ObjectUtils.isEmpty(map.get(USE_CODE))) {
continue;
}
equipmentCategoryData.setOrgBranchCode(map.get("supervise_org_code").toString());
equipmentCategoryData.setUnitCode(map.get(USE_CODE).toString());
// 指定单位的设备统计信息
List<UseUnitCreditCodeCategoryDto> unitEquipCountList = equipCountList.stream().filter(r->r.getUseUnitCreditCode().equals(map.get(USE_CODE).toString())).collect(Collectors.toList());
unitEquipCountList = unitEquipCountList.stream().filter(r->r.getOrgBranchCode().equals(map.get(ORG_BRANCH_CODE).toString())).collect(Collectors.toList());
List<UseUnitCreditCodeCategoryDto> unitEquipCountList = equipCountList.stream().filter(r -> r.getUseUnitCreditCode().equals(map.get(USE_CODE).toString())).collect(Collectors.toList());
unitEquipCountList = unitEquipCountList.stream().filter(r -> r.getOrgBranchCode().equals(map.get(ORG_BRANCH_CODE).toString())).collect(Collectors.toList());
for (EquipmentCategory category : equipmentCategories) {
Map<String, Object> data = new HashMap<>();
data.put("waitClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.DRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("alreadyClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("refuseClaim", unitEquipCountList.stream().filter(r->r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YJL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("waitClaim", unitEquipCountList.stream().filter(r -> r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.DRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("alreadyClaim", unitEquipCountList.stream().filter(r -> r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YRL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
data.put("refuseClaim", unitEquipCountList.stream().filter(r -> r.getEquList().equals(category.getCode()) && EquipmentCategoryEnum.YJL.getName().equals(r.getClaimStatus())).collect(Collectors.summarizingLong(UseUnitCreditCodeCategoryDto::getTotal)).getSum());
this.set8CategoryCountData(equipmentCategoryData, category, data);
}
equipmentCategoryData.setRecDate(new Date());
list.add(equipmentCategoryData);
}
if(!ObjectUtils.isEmpty(unitCodes)){
equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>().in("unit_code",unitCodes));
if (!ObjectUtils.isEmpty(unitCodes)) {
equipmentCategoryDataMapper.delete(new QueryWrapper<EquipmentCategoryData>().in("unit_code", unitCodes));
}
equipmentCategoryDataService.saveOrUpdateBatch(list);
stopWatch.stop();
if(log.isInfoEnabled()){
log.info("总览数据刷新结束,耗时:{} 秒",stopWatch.getTotalTimeSeconds());
if (log.isInfoEnabled()) {
log.info("总览数据刷新结束,耗时:{} 秒", stopWatch.getTotalTimeSeconds());
}
return list;
}
......@@ -938,19 +941,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private List<EquipmentCategory> getEquipmentCategories() {
LambdaQueryWrapper<EquipmentCategory> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.likeLeft(EquipmentCategory::getCode,"000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode,"7000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode,"F000");
lambdaQueryWrapper.likeLeft(EquipmentCategory::getCode, "000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode, "7000");
lambdaQueryWrapper.ne(EquipmentCategory::getCode, "F000");
return equipmentCategoryMapper.selectList(lambdaQueryWrapper);
}
private List<EquipmentCategoryData> updateEquipmentCategoryData(String unitCode,String orgBranchCode) {
private List<EquipmentCategoryData> updateEquipmentCategoryData(String unitCode, String orgBranchCode) {
List<String> unitCodeList = new ArrayList<>();
unitCodeList.add(unitCode);
List<String> orgBranchCodeList = new ArrayList<>();
orgBranchCodeList.add(orgBranchCode);
List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList,null);
List<EquipmentCategoryData> equipmentCategoryData = getCategoryData(unitCodeList, null);
return equipmentCategoryData;
}
......@@ -961,7 +964,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
List<String> records = new ArrayList<>();
List<ESEquipmentCategoryDto> list = new ArrayList<>();
if(recordList.toString().contains("[")){
if (recordList.toString().contains("[")) {
for (String record : (List<String>) recordList) {
records.add(record);
ESEquipmentCategoryDto esEquipmentCategoryDto = new ESEquipmentCategoryDto();
......@@ -984,15 +987,15 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
orgBranchCodeList.add(String.valueOf(objectMap.get("orgBranchCode")));
}
if(!ObjectUtils.isEmpty(superviseCodeList)){
if (!ObjectUtils.isEmpty(superviseCodeList)) {
supervisoryCodeInfoMapper.updateStatus(superviseCodeList);
}
//删除涉及的19张表的数据
superviseInfoMapper.deleteDataAll(records);
// 根据统一信用代码更新总览表
if(!ObjectUtils.isEmpty(unitCodeList)){
getCategoryData(unitCodeList,orgBranchCodeList);
if (!ObjectUtils.isEmpty(unitCodeList)) {
getCategoryData(unitCodeList, orgBranchCodeList);
}
//删除es中的数据
esEquipmentCategory.deleteAll(list);
......@@ -1054,11 +1057,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
responseModel = idxFeignService.batchUpdate(null, null, map);
}
stopWatch.stop();
if(log.isInfoEnabled()){
log.info("通用提交耗时:{} 秒",stopWatch.getTotalTimeSeconds());
if (log.isInfoEnabled()) {
log.info("通用提交耗时:{} 秒", stopWatch.getTotalTimeSeconds());
}
} catch (Exception e) {
log.error(e.getMessage(),e);
log.error(e.getMessage(), e);
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.BF.getCode());
ResponseModel<Object> response = new ResponseModel<>();
response.setDevMessage(e.getMessage());
......@@ -1067,8 +1070,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
response.setStatus(HttpStatus.BAD_REQUEST.value());
return response;
} finally {
updateEquipmentCategoryData(unitCode,orgBranchCode);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo,new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code",supervisoryCodeInfo.getSupervisoryCode()));
updateEquipmentCategoryData(unitCode, orgBranchCode);
supervisoryCodeInfoMapper.update(supervisoryCodeInfo, new QueryWrapper<SupervisoryCodeInfo>().eq("supervisory_code", supervisoryCodeInfo.getSupervisoryCode()));
}
return responseModel;
}
......@@ -1100,6 +1103,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Long count = bizJdbcTemplate.queryForObject(countSql, Long.class);
return count;
}
/**
* es数据同步
*
......@@ -1176,10 +1180,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/
public ESEquipmentCategoryDto saveESEquipmentCategory(Map<String, Object> map) {
//处理时间问题
String recDate1 = map.get("REC_DATE").toString().substring(0,19);
String recDate1 = map.get("REC_DATE").toString().substring(0, 19);
long time = Timestamp.valueOf(recDate1).getTime();
map.put("REC_DATE",time);
map.put("REC_DATE", time);
ESEquipmentCategoryDto dto = JSONObject.parseObject(toJSONString(map), ESEquipmentCategoryDto.class);
ESEquipmentCategoryDto save = esEquipmentCategory.save(dto);
if (!ObjectUtils.isEmpty(save)) {
......@@ -1191,6 +1195,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
return save;
}
public Page<JSONObject> queryByKeys(JSONObject map) {
// //根据当前登录人查询
if (!ValidationUtil.isEmpty(map.get(EQUSTATE))) {
......@@ -1219,12 +1224,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
//SEQUENCE_NBR
if (!ObjectUtils.isEmpty(map.getString("SEQUENCE_NBR"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("SEQUENCE_NBR", "*"+map.getString("SEQUENCE_NBR")+"*"));
meBuilder.must(QueryBuilders.matchPhraseQuery("SEQUENCE_NBR", "*" + map.getString("SEQUENCE_NBR") + "*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_NAME"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("ORG_BRANCH_NAME", "*"+map.getString("ORG_BRANCH_NAME")+"*" ));
query.must(QueryBuilders.matchPhraseQuery("ORG_BRANCH_NAME", "*" + map.getString("ORG_BRANCH_NAME") + "*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) {
......@@ -1234,12 +1239,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_NAME"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.matchPhraseQuery("USE_UNIT_NAME", "*"+map.getString("USE_UNIT_NAME")+"*"));
query.must(QueryBuilders.matchPhraseQuery("USE_UNIT_NAME", "*" + map.getString("USE_UNIT_NAME") + "*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("USE_UNIT_CREDIT_CODE", "*"+map.getString("USE_UNIT_CREDIT_CODE")+"*"));
meBuilder.must(QueryBuilders.matchPhraseQuery("USE_UNIT_CREDIT_CODE", "*" + map.getString("USE_UNIT_CREDIT_CODE") + "*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_LIST_CODE"))) {
......@@ -1249,23 +1254,23 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
if (!ObjectUtils.isEmpty(map.getString("EQU_LIST"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_LIST", "*"+map.getString("EQU_LIST")+"*"));
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_LIST", "*" + map.getString("EQU_LIST") + "*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_CATEGORY"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_CATEGORY", "*"+map.getString("EQU_CATEGORY")+"*"));
meBuilder.must(QueryBuilders.matchPhraseQuery("EQU_CATEGORY", "*" + map.getString("EQU_CATEGORY") + "*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("USE_ORG_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"+map.getString("USE_ORG_CODE").toLowerCase()+"*"));
meBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*" + map.getString("USE_ORG_CODE").toLowerCase() + "*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("CODE96333"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("CODE96333", "*"+map.getString("CODE96333").toLowerCase()+"*"));
meBuilder.must(QueryBuilders.wildcardQuery("CODE96333", "*" + map.getString("CODE96333").toLowerCase() + "*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_CODE"))) {
......@@ -1276,7 +1281,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if (!ObjectUtils.isEmpty(map.getString("SUPERVISORY_CODE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.wildcardQuery("SUPERVISORY_CODE", "*"+map.getString("SUPERVISORY_CODE").toLowerCase()+"*"));
meBuilder.must(QueryBuilders.wildcardQuery("SUPERVISORY_CODE", "*" + map.getString("SUPERVISORY_CODE").toLowerCase() + "*"));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("USE_PLACE"))) {
......@@ -1289,14 +1294,14 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
query.must(QueryBuilders.matchPhraseQuery("ADDRESS", "*" + map.getString("ADDRESS") + "*"));
boolMust.must(query);
}
if (!ObjectUtils.isEmpty(map.getString("EQU_STATE")) ) {
if (!ObjectUtils.isEmpty(map.getString("EQU_STATE"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchQuery("EQU_STATE", map.getLong("EQU_STATE")));
boolMust.must(meBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("STATUS"))) {
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", "*"+map.getString("STATUS")+"*"));
meBuilder.must(QueryBuilders.matchPhraseQuery("STATUS", "*" + map.getString("STATUS") + "*"));
boolMust.must(meBuilder);
}
builder.query(boolMust);
......
......@@ -159,8 +159,6 @@ public class RegUnitInfoController extends BaseController {
return ResponseHelper.buildResponse(iRegUnitInfoService.getDictionaryWithTreeFillId(type));
}
// @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/management-unit/tree")
@ApiOperation(httpMethod = "GET", value = "管辖机构树", notes = "管辖机构树")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment