Commit 2ee2803c authored by 赵啸非's avatar 赵啸非

添加初始化数据库脚本

parent 58539ab0
......@@ -31,6 +31,4 @@ public class SyncTreeSiteThread implements Runnable {
log.info("刷新用户站点树=》userID:{} siteTree:{}",context.getUser().getId(), JSON.toJSONString(siteService.getSiteTree(context)));
}
}
package com.mortals.xhx.module.site.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.ap.GlobalSysInfo;
......@@ -12,14 +10,11 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.common.utils.SyncTreeSiteThread;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery;
......@@ -34,7 +29,6 @@ import com.mortals.xhx.module.site.model.SiteTreeSelect;
import com.mortals.xhx.module.site.service.SiteService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -106,6 +100,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
//查詢指定的站點ids
log.info("siteQuery==>{}", JSON.toJSONString(siteQuery));
List<SiteEntity> siteList = this.find(siteQuery);
//如果是管理员 默认全部站点
if(context.getUser().isAdmin()){
siteList = this.find(new SiteQuery());
}
//turn to sitemap
Map<String, SiteEntity> siteMap = siteList.parallelStream().collect(Collectors.toMap(x -> x.getSiteCode(), y -> y, (o, n) -> n));
//遍历过滤站点树
......
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