Commit f8d81b45 authored by tianyiming's avatar tianyiming

1、行政审批局树、监管机构树修改

2、启用停用列表地址修改
parent bae1c453
......@@ -16,7 +16,7 @@
jri.PRODUCT_NAME as productName,
use.USE_UNIT_NAME as useUnitName,
jed.receive_org_name as receiveOrgName,
concat(use."PROVINCE_NAME", '-', use."CITY_NAME", '-', use."COUNTY_NAME", '-', use."STREET_NAME", '-', use."ADDRESS") as address,
concat(use."PROVINCE_NAME", '', use."CITY_NAME", '', use."COUNTY_NAME", '', use."STREET_NAME", '', use."ADDRESS") as address,
use."USE_INNER_CODE" as useInnerCode,
jed.audit_status as auditStatus,
date_format(jed.audit_pass_date, '%Y-%m-%d') as auditPassDate,
......
......@@ -110,6 +110,12 @@ public class CommonServiceImpl implements ICommonService {
//行政审批局redis缓存key
private static final String ADMINISTRATION_UNIT_TREE = "ADMINISTRATION_UNIT_TREE";
//管辖机构
private static final String REGULATOR_UNIT = "监管机构";
//行政审批局
private static final String ADMINISTRATION_UNIT = "行政审批局";
@Value("${regulator.unit.code}")
private String code;
......@@ -280,7 +286,7 @@ public class CommonServiceImpl implements ICommonService {
public List<LinkedHashMap> creatTree() {
FeignClientResult tree = privilegeFeginService.queryAgencyTreeForCache(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> treeData = deleteRegulatorTreeData(result);
List<LinkedHashMap> treeData = deleteTreeData(result, REGULATOR_UNIT);
List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList());
List<LinkedHashMap> resultTree = updateNullChildren(supervisionTree);
redisUtils.set(REGULATOR_UNIT_TREE, resultTree);
......@@ -307,7 +313,7 @@ public class CommonServiceImpl implements ICommonService {
FeignClientResult tree = privilegeFeginService.queryAgencyTreeForCache(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> children = (List<LinkedHashMap>) result.get(0).get("children");
List<LinkedHashMap> treeData = deleteTreeData(children);
List<LinkedHashMap> treeData = deleteTreeData(children,REGULATOR_UNIT);
List<LinkedHashMap> resultTree = updateNullChildren(treeData);
redisUtils.set(ADMINISTRATION_UNIT_TREE, resultTree);
return resultTree;
......@@ -319,16 +325,16 @@ public class CommonServiceImpl implements ICommonService {
return resourceJson.get(type);
}
private List<LinkedHashMap> deleteTreeData(List<LinkedHashMap> result) {
private List<LinkedHashMap> deleteTreeData(List<LinkedHashMap> result,String companyType) {
Iterator it = result.iterator();
while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next();
// 删除非行政审批局
if (!e.get("companyType").toString().contains("行政审批局")) {
if (!e.get("companyType").toString().contains(companyType)) {
it.remove();
}
if (!ObjectUtils.isEmpty(e.get("children"))) {
deleteTreeData((List<LinkedHashMap>) e.get("children"));
deleteTreeData((List<LinkedHashMap>) e.get("children"),companyType);
}
}
return result;
......
......@@ -365,6 +365,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private final static String CHECK_CODE_EQU_CODE = "EQU_CODE_";
//一码通checkCode中使用登记证编号redis key
private final static String CHECK_CODE_USE_ORG_CODE = "USE_ORG_CODE_";
//管辖机构
private static final String REGULATOR_UNIT = "监管机构";
//一码通checkCode中redis key过期时间
private long time = 300l;
......@@ -524,13 +527,28 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
public List<LinkedHashMap> creatTree() {
FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> treeData = deleteRegulatorTreeData(result);
List<LinkedHashMap> treeData = deleteTreeData(result,REGULATOR_UNIT);
List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList());
List<LinkedHashMap> resultTree = updateNullChildren(supervisionTree);
redisUtils.set(REGULATOR_UNIT_TREE, resultTree);
return resultTree;
}
private List<LinkedHashMap> deleteTreeData(List<LinkedHashMap> result,String companyType) {
Iterator it = result.iterator();
while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next();
// 删除非对应类型
if (!e.get("companyType").toString().contains(companyType)) {
it.remove();
}
if (!ObjectUtils.isEmpty(e.get("children"))) {
deleteTreeData((List<LinkedHashMap>) e.get("children"),companyType);
}
}
return result;
}
/**
* 将管辖机构树中children为[]的修改为null
*
......
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