Commit 6d6ba6f1 authored by 赵啸非's avatar 赵啸非

添加应用分类列表

parent 7cf58b88
...@@ -37,6 +37,11 @@ public class SiteTreeSelect implements Serializable { ...@@ -37,6 +37,11 @@ public class SiteTreeSelect implements Serializable {
*/ */
private String siteCode; private String siteCode;
/**
* 站点详细地址
*/
private String detailAddress;
/** /**
* 节点名称 * 节点名称
*/ */
...@@ -45,6 +50,12 @@ public class SiteTreeSelect implements Serializable { ...@@ -45,6 +50,12 @@ public class SiteTreeSelect implements Serializable {
* 区域编码 * 区域编码
*/ */
private String areaCode; private String areaCode;
/**
* 为区域时 层级
*/
private Integer level;
/** /**
* 是否叶子节点 * 是否叶子节点
*/ */
...@@ -79,7 +90,6 @@ public class SiteTreeSelect implements Serializable { ...@@ -79,7 +90,6 @@ public class SiteTreeSelect implements Serializable {
public SiteTreeSelect(AreaEntity entity) { public SiteTreeSelect(AreaEntity entity) {
//如果是站点,则替换名称和id //如果是站点,则替换名称和id
this.id = entity.getIid(); this.id = entity.getIid();
this.label = entity.getName(); this.label = entity.getName();
if ("False".equalsIgnoreCase(entity.getHaveSonArea())) { if ("False".equalsIgnoreCase(entity.getHaveSonArea())) {
...@@ -103,6 +113,7 @@ public class SiteTreeSelect implements Serializable { ...@@ -103,6 +113,7 @@ public class SiteTreeSelect implements Serializable {
this.siteCode = collect.stream().map(item -> item.getSiteCode()).collect(Collectors.joining(",")); this.siteCode = collect.stream().map(item -> item.getSiteCode()).collect(Collectors.joining(","));
this.type = "site"; this.type = "site";
this.icon = "el-icon-wind-power"; this.icon = "el-icon-wind-power";
this.detailAddress=collect.stream().map(item -> item.getDetailAddress()).collect(Collectors.joining(","));
this.longitude = collect.stream().findFirst().map(item -> item.getLongitude()).orElseGet(() -> ""); this.longitude = collect.stream().findFirst().map(item -> item.getLongitude()).orElseGet(() -> "");
this.latitude = collect.stream().findFirst().map(item -> item.getLatitude()).orElseGet(() -> ""); this.latitude = collect.stream().findFirst().map(item -> item.getLatitude()).orElseGet(() -> "");
} else { } else {
...@@ -111,6 +122,7 @@ public class SiteTreeSelect implements Serializable { ...@@ -111,6 +122,7 @@ public class SiteTreeSelect implements Serializable {
this.type = "area"; this.type = "area";
this.icon = "el-icon-place"; this.icon = "el-icon-place";
} }
this.level=entity.getAreaLevel();
if ("False".equalsIgnoreCase(entity.getHaveSonArea())) { if ("False".equalsIgnoreCase(entity.getHaveSonArea())) {
this.isLeaf = true; this.isLeaf = true;
//this.children = new ArrayList(); //this.children = new ArrayList();
...@@ -120,7 +132,6 @@ public class SiteTreeSelect implements Serializable { ...@@ -120,7 +132,6 @@ public class SiteTreeSelect implements Serializable {
} }
this.areaCode = entity.getAreaCode(); this.areaCode = entity.getAreaCode();
} }
// 反序列化器 // 反序列化器
......
...@@ -44,25 +44,27 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> { ...@@ -44,25 +44,27 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
*/ */
List<SiteTreeSelect> getSiteTree(Context context); List<SiteTreeSelect> getSiteTree(Context context);
List<SiteEntity> getFlatSitesByAreaCode(String areaCode,Context context); List<SiteEntity> getFlatSitesByAreaCode(String areaCode, Context context);
List<SiteEntity> getFlatSitesBySiteId(Long siteId,Context context); List<SiteEntity> getFlatSitesBySiteId(Long siteId, Context context);
Rest< List<SiteAreaVo>> getAreaSitesBySite(SiteQuery query, Context context); Integer countSitesByArea(SiteQuery query, Context context);
Rest< List<SiteEntity>> getAreaSitesByAreaLevel(SiteQuery query, Context context); Rest<List<SiteAreaVo>> getAreaSitesBySite(SiteQuery query, Context context);
Rest<List<SiteEntity>> getAreaSitesByAreaLevel(SiteQuery query, Context context);
void setSiteTree(List<SiteTreeSelect> list, Context context); void setSiteTree(List<SiteTreeSelect> list, Context context);
void removeSiteTree(List<SiteTreeSelect> list, Context context); void removeSiteTree(List<SiteTreeSelect> list, Context context);
List<SiteEntity> getListAllInfoByQuery(SiteQuery query,Context context) throws AppException; List<SiteEntity> getListAllInfoByQuery(SiteQuery query, Context context) throws AppException;
void changeUrlPath(SiteEntity siteEntity); void changeUrlPath(SiteEntity siteEntity);
Rest<List<MatterEntity>> getMatterAllListByGOV(Map<String,String> params,Integer pageNum, Context context); Rest<List<MatterEntity>> getMatterAllListByGOV(Map<String, String> params, Integer pageNum, Context context);
Rest<String> syncMatterBySiteId(SiteEntity siteEntity, Context context); Rest<String> syncMatterBySiteId(SiteEntity siteEntity, Context context);
void deleteBysiteIdAndSource(Long siteId,Integer source, Context context); void deleteBysiteIdAndSource(Long siteId, Integer source, Context context);
} }
\ No newline at end of file
...@@ -448,12 +448,33 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -448,12 +448,33 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
return siteList; return siteList;
} }
/**
* @param query
* @param context
* @return
*/
@Override
public Integer countSitesByArea(SiteQuery query, Context context) {
List<SiteEntity> siteList = new ArrayList<>();
AreaEntity areaEntity = areaService.getExtCache(query.getAreaCode());
if (ObjectUtils.isEmpty(areaEntity)) {
throw new AppException(String.format("区域不存在!区域编码:%s", query.getAreaCode()));
}
String matchCode = query.getAreaCode().replaceAll("(0)+$", "");
SiteQuery siteQuery = new SiteQuery();
siteQuery.setAreaCode(matchCode + "%");
List<SiteEntity> siteEntities = this.find(siteQuery);
if (!ObjectUtils.isEmpty(siteEntities)) {
siteList.addAll(siteEntities);
}
return siteList.size();
}
@Override @Override
public Rest<List<SiteAreaVo>> getAreaSitesBySite(SiteQuery query, Context context) { public Rest<List<SiteAreaVo>> getAreaSitesBySite(SiteQuery query, Context context) {
List<SiteAreaVo> list = new ArrayList<>(); List<SiteAreaVo> list = new ArrayList<>();
SiteAreaVo siteAreaVo = new SiteAreaVo(); SiteAreaVo siteAreaVo = new SiteAreaVo();
//获取当前节点的第一层子节点 //获取当前节点的第一层子节点
if (ObjectUtils.isEmpty(query.getAreaName())) { if (ObjectUtils.isEmpty(query.getAreaName())) {
throw new AppException("区域名称查询参数不能为空!"); throw new AppException("区域名称查询参数不能为空!");
......
...@@ -255,6 +255,24 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -255,6 +255,24 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
return jsonObject.toJSONString(); return jsonObject.toJSONString();
} }
/**
* 根据区域获取子站点数量
*/
@PostMapping(value = "countSitesByArea")
@UnAuth
public Rest<Integer> countSitesByArea(@RequestBody SiteQuery site) {
String busiDesc = "根据站点id查询站点列表子集" + this.getModuleDesc();
try {
Integer count = this.service.countSitesByArea(site, getContext());
recordSysLog(request, busiDesc + " 【成功】");
return Rest.ok(count);
} catch (Exception e) {
log.error("获取异常", e);
return Rest.fail(e.getMessage());
}
}
/** /**
* 根据站点id查询站点列表子集,包含当前站点,二层结构 * 根据站点id查询站点列表子集,包含当前站点,二层结构
* {rootname:} * {rootname:}
......
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