Commit ffaca25e authored by 赵啸非's avatar 赵啸非

添加应用复选字段

parent 808cb2af
...@@ -22,4 +22,8 @@ public class SiteVo extends BaseEntityLong { ...@@ -22,4 +22,8 @@ public class SiteVo extends BaseEntityLong {
private String logoFullPath; private String logoFullPath;
/** 站点包含的模块 */ /** 站点包含的模块 */
private List<ModelEntity> modelList; private List<ModelEntity> modelList;
private Integer areaLevel;
} }
\ No newline at end of file
...@@ -50,6 +50,8 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> { ...@@ -50,6 +50,8 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
Rest< List<SiteAreaVo>> getAreaSitesBySite(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);
......
...@@ -483,6 +483,29 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -483,6 +483,29 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
return Rest.ok(list); return Rest.ok(list);
} }
/**
* @param query
* @param context
* @return
*/
@Override
public Rest<List<SiteEntity>> getAreaSitesByAreaLevel(SiteQuery query, Context context) {
//获取所有层级的区域
List<AreaEntity> areaEntities = areaService.find(new AreaQuery().areaLevel(query.getAreaLevel()));
List<SiteEntity> list = new ArrayList<>();
for (AreaEntity areaEntity : areaEntities) {
List<SiteEntity> siteEntityList = this.find(new SiteQuery().areaCode(areaEntity.getAreaCode()));
if(!ObjectUtils.isEmpty(siteEntityList)){
list.addAll(siteEntityList);
}
}
return Rest.ok(list);
}
private boolean getSite(String rootAreaCode, String areaCode, List<SiteEntity> siteList, SiteEntity siteEntity) { private boolean getSite(String rootAreaCode, String areaCode, List<SiteEntity> siteList, SiteEntity siteEntity) {
// AreaEntity areaTemp = areaService.getExtCache(siteEntity.getAreaCode()); // AreaEntity areaTemp = areaService.getExtCache(siteEntity.getAreaCode());
if (rootAreaCode.equals(areaCode)) { if (rootAreaCode.equals(areaCode)) {
......
...@@ -151,7 +151,6 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -151,7 +151,6 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
@UnAuth @UnAuth
public String getFlatSitesByAreaCode(@RequestBody SiteQuery site) { public String getFlatSitesByAreaCode(@RequestBody SiteQuery site) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = "根据区域编码查询站点列表" + this.getModuleDesc(); String busiDesc = "根据区域编码查询站点列表" + this.getModuleDesc();
try { try {
List<SiteEntity> siteEntityList = this.service.getFlatSitesByAreaCode(site.getAreaCode(), getContext()); List<SiteEntity> siteEntityList = this.service.getFlatSitesByAreaCode(site.getAreaCode(), getContext());
...@@ -175,7 +174,6 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -175,7 +174,6 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
@UnAuth @UnAuth
public String getFlatSitesByAreaIds(@RequestBody SiteQuery site) { public String getFlatSitesByAreaIds(@RequestBody SiteQuery site) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = "根据区域编码查询站点列表" + this.getModuleDesc(); String busiDesc = "根据区域编码查询站点列表" + this.getModuleDesc();
try { try {
String siteIds = site.getAreaCodeList().stream().flatMap(areaId -> String siteIds = site.getAreaCodeList().stream().flatMap(areaId ->
...@@ -241,6 +239,29 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -241,6 +239,29 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
} }
/**
* 根据区域等级查询当前区域所有站点
*/
@PostMapping(value = "getAreaSitesByAreaLevel")
@UnAuth
public String getAreaSitesByAreaLevel(@RequestBody SiteQuery site) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "根据区域等级查询当前区域所有站点" + this.getModuleDesc();
try {
Rest<List<SiteEntity>> rest = this.service.getAreaSitesByAreaLevel(site, getContext());
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_DATA, rest.getData());
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, busiDesc + "成功!");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
@Override @Override
protected int infoAfter(Long id, Map<String, Object> model, SiteEntity entity, Context context) throws AppException { protected int infoAfter(Long id, Map<String, Object> model, SiteEntity entity, Context context) throws AppException {
this.service.changeUrlPath(entity); this.service.changeUrlPath(entity);
......
...@@ -19,8 +19,7 @@ Content-Type: application/json ...@@ -19,8 +19,7 @@ Content-Type: application/json
{ {
"siteId":1, "siteId":1,
"idList": [2,10,5,14,13,3,7,9,1], "type": 2,
"type": 1,
"shelves": 1, "shelves": 1,
"page":1, "page":1,
"size":-1 "size":-1
......
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