Commit 99e7b937 authored by “yiyousong”'s avatar “yiyousong”
parents 6c6aca1f 852163d1
......@@ -67,13 +67,18 @@
<profiles.active>product</profiles.active>
<profiles.server.port>17211</profiles.server.port>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>192.168.0.250</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>info</profiles.log.level>
<package.environment>build</package.environment>
<skipUi>false</skipUi>
<skipUi>true</skipUi>
<profiles.holidayUrl>https://timor.tech/api/holiday/year/</profiles.holidayUrl>
</properties>
</profile>
......
......@@ -26,4 +26,8 @@ public class SiteVo extends BaseEntityLong {
private Integer areaLevel;
private Integer total =0;
private List<SiteEntity> subList=new ArrayList<>();
}
\ No newline at end of file
......@@ -390,7 +390,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
public List<SiteTreeSelect> getSiteTree(Context context) {
// List<SiteTreeSelect> siteTreeSelects = siteTreeMap.get(context.getUser().getId());
List<SiteTreeSelect> collect = getSiteTreeSelects(context.getUser().getId().toString());
// log.info("siteTree:{}", JSON.toJSONString(collect));
// log.info("siteTree:{}", JSON.toJSONString(collect));
if (!ObjectUtils.isEmpty(collect)) {
return collect;
} else {
......@@ -572,12 +572,20 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
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);
}
}
list.stream().forEach(item -> {
AreaEntity areaEntity = areaService.getCache(item.getAreaCode());
if (!ObjectUtils.isEmpty(areaEntity)) {
item.setAreaLevel(areaEntity.getAreaLevel());
} else {
item.setAreaLevel(0);
}
});
return Rest.ok(list);
}
......@@ -865,7 +873,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
String matchCode = "511530000000".replaceAll("(0)+$", "");
System.out.println(matchCode);
matchCode=StrUtil.padAfter(matchCode,7,"0");
matchCode = StrUtil.padAfter(matchCode, 7, "0");
System.out.println(matchCode);
......
......@@ -12,6 +12,8 @@ import com.mortals.framework.util.ThreadPool;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.common.code.AreaLevelEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.keys.RedisCacheKeys;
import com.mortals.xhx.common.utils.SyncDeptThread;
import com.mortals.xhx.common.utils.SyncGovMatterDetailThread;
......@@ -247,6 +249,69 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
return jsonObject.toJSONString();
}
/**
* 根据区域编码查询站点分组列表
*/
@PostMapping(value = "getFlatSitesGroupByAreaCode")
@UnAuth
public String getFlatSitesGroupByAreaCode(@RequestBody SiteQuery site) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "根据区域编码查询站点列表" + this.getModuleDesc();
List<SiteEntity> group = new ArrayList<>();
Map<String, List<SiteEntity>> collect = new HashMap<>();
try {
if (ObjectUtils.isEmpty(site.getAreaName()) && ObjectUtils.isEmpty(site.getAreaCode())) {
List<SiteEntity> siteEntities = this.service.find(new SiteQuery());
collect = siteEntities.stream().collect(Collectors.groupingBy(SiteEntity::getAreaCode));
} else {
if (!ObjectUtils.isEmpty(site.getSiteName())) {
List<SiteEntity> siteEntities = this.service.find(new SiteQuery().siteName(site.getSiteName()));
if (!ObjectUtils.isEmpty(siteEntities)) {
site.setAreaCodeList(siteEntities.stream().map(i -> i.getAreaCode()).collect(Collectors.toList()));
}
}
if (!ObjectUtils.isEmpty(site.getAreaName())) {
List<AreaEntity> areaEntities = areaService.find(new AreaQuery().name(site.getAreaName()));
if (!ObjectUtils.isEmpty(areaEntities)) {
site.setAreaCodeList(areaEntities.stream().map(i -> i.getAreaCode()).collect(Collectors.toList()));
}
}
if (ObjectUtils.isEmpty(site.getAreaCodeList())) {
site.setAreaCodeList(Arrays.asList(site.getAreaCode()));
}
List<SiteEntity> siteEntityList = site.getAreaCodeList().stream()
.flatMap(areaCode -> this.service.getFlatSitesByAreaCode(areaCode, getContext()).stream())
.distinct()
.collect(Collectors.toList());
collect = siteEntityList.stream().collect(Collectors.groupingBy(x -> x.getAreaCode()));
}
group = collect.entrySet().stream().map(item -> {
AreaEntity areaEntity = areaService.getCache(item.getKey());
SiteEntity siteEntity = new SiteEntity();
siteEntity.setAreaName(areaEntity.getName());
siteEntity.setAreaCode(areaEntity.getAreaCode());
siteEntity.setSubList(item.getValue());
siteEntity.setTotal(item.getValue().size());
return siteEntity;
}).sorted(Comparator.comparing(SiteEntity::getAreaCode)).collect(Collectors.toList());
jsonObject.put(KEY_RESULT_DATA, group);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "查询站点分组列表成功!");
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
recordSysLog(request, 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();
}
/**
* 根据区域获取子站点数量
......@@ -312,6 +377,58 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
}
/**
* 根据区域等级查询当前区域所有站点
*/
@PostMapping(value = "getSitesGroupByAreaLevel")
@UnAuth
public String getSitesGroupByAreaLevel(@RequestBody SiteQuery site) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "根据区域等级查询当前区域所有站点" + this.getModuleDesc();
Map<Integer, List<SiteEntity>> collect = new HashMap<>();
List<SiteEntity> groupList = new ArrayList<>();
try {
if (ObjectUtils.isEmpty(site.getAreaLevel())) {
//全部
for (int i = 1; i <= 5; i++) {
site.setAreaLevel(i);
Rest<List<SiteEntity>> rest = this.service.getAreaSitesByAreaLevel(site, getContext());
// String areaName = AreaLevelEnum.getByValue(i).getDesc();
collect.put(i, rest.getData());
}
} else {
Rest<List<SiteEntity>> rest = this.service.getAreaSitesByAreaLevel(site, getContext());
if (YesNoEnum.YES.getValue() == rest.getCode()) {
collect = rest.getData().stream().collect(Collectors.groupingBy(x -> x.getAreaLevel()));
jsonObject.put(KEY_RESULT_DATA, collect);
}
}
//排序统计
for (int i = 1; i <= 5; i++) {
List<SiteEntity> siteEntities = collect.get(i);
SiteEntity siteEntity = new SiteEntity();
siteEntity.setAreaName(AreaLevelEnum.getByValue(i).getDesc());
if (!ObjectUtils.isEmpty(siteEntities)) {
siteEntity.setTotal(siteEntities.size());
siteEntity.setSubList(siteEntities);
}
groupList.add(siteEntity);
}
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_DATA, groupList);
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
protected int infoAfter(Long id, Map<String, Object> model, SiteEntity entity, Context context) throws AppException {
this.service.changeUrlPath(entity);
......
......@@ -28,6 +28,16 @@ Content-Type: application/json
"source": ""
}
###基础事项列表
POST {{baseUrl}}/matter/list
Content-Type: application/json
{
"page": 1,
"size": 10,
"deptCode":"4445589607496884224"
}
###微官网事项列表
POST {{baseUrl}}/micro/matter/list
Content-Type: application/json
......
......@@ -98,7 +98,7 @@ POST {{baseUrl}}/site/getAreaSitesByAreaLevel
Content-Type: application/json
{
"siteName":"%高新%"
"areaLevel":2
}
###站点列表
......@@ -128,3 +128,14 @@ Content-Type: application/json
}
###站点区分组列表
POST {{baseUrl}}/site/getFlatSitesGroupByAreaCode
Content-Type: application/json
{}
###站点区域分组列表
POST {{baseUrl}}/site/getSitesGroupByAreaLevel
Content-Type: application/json
{"areaLevel":2}
......@@ -57,13 +57,18 @@
<profiles.active>product</profiles.active>
<profiles.server.path>/zwfw</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.rabbitmq.host>192.168.0.250</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>192.168.0.250:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<package.environment>build</package.environment>
<skipUi>false</skipUi>
<skipUi>true</skipUi>
</properties>
</profile>
<profile>
......
package com.mortals.xhx.base.framework.security;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.service.IAuthTokenService;
......@@ -36,7 +35,6 @@ import java.util.Set;
*/
@Service
@Order(1)
@Slf4j
public class AuthTokenServiceImpl implements IAuthTokenService {
// 令牌自定义标识
......
......@@ -25,6 +25,7 @@ import com.mortals.xhx.module.role.model.RoleAuthEntity;
import com.mortals.xhx.module.role.model.RoleAuthQuery;
import com.mortals.xhx.module.role.service.RoleAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -49,6 +50,7 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
private ICacheService cacheService;
@Autowired
@Lazy
private RoleAuthService roleAuthService;
@Override
......
......@@ -20,6 +20,7 @@ import com.mortals.xhx.module.menu.model.vo.MenuNodeVO;
import com.mortals.xhx.module.role.service.RoleModelService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.menu.dao.MenuDao;
......@@ -41,9 +42,8 @@ import java.util.stream.Collectors;
public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity, Long> implements MenuService {
@Autowired
@Lazy
private IApiModelFeign apiModelFeign;
@Autowired
private RoleModelService roleModelService;
@Override
public int remove(Long[] ids, Context context) throws AppException {
......
......@@ -15,6 +15,7 @@ import com.mortals.xhx.module.role.service.RoleModelService;
import com.mortals.xhx.module.role.service.RoleUserService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -25,12 +26,11 @@ import java.util.stream.Collectors;
public class RoleAuthServiceImpl extends AbstractCRUDServiceImpl<RoleAuthDao, RoleAuthEntity, Long> implements RoleAuthService {
@Autowired
@Lazy
private MenuService menuService;
@Autowired
private RoleModelService roleModelService;
@Autowired
private RoleUserService roleUserService;
@Autowired
private ICacheService cacheService;
......
......@@ -13,19 +13,13 @@ import com.mortals.framework.model.Result;
import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.*;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.utils.SendSubSystemTask;
import com.mortals.xhx.common.utils.Solution;
import com.mortals.xhx.feign.area.IApiAreaFeign;
import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.feign.skin.ISkinFillFeign;
import com.mortals.xhx.feign.skin.ISkinSampleFeign;
import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.service.AreaService;
import com.mortals.xhx.module.menu.service.MenuService;
import com.mortals.xhx.module.role.model.RoleQuery;
import com.mortals.xhx.module.role.model.RoleUserEntity;
import com.mortals.xhx.module.role.model.RoleUserQuery;
......@@ -36,7 +30,6 @@ import com.mortals.xhx.module.user.dao.UserPwdRecordDao;
import com.mortals.xhx.module.user.model.*;
import com.mortals.xhx.module.user.service.UserService;
import org.apache.commons.collections4.CollectionUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -54,8 +47,7 @@ import java.util.stream.Collectors;
*/
@Service("userService")
public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserEntity, Long> implements UserService {
@Autowired
private MenuService menuService;
@Autowired
private RoleUserService roleUserService;
@Autowired
......@@ -69,15 +61,6 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Autowired
private UserPwdRecordDao userPwdRecordDao;
@Autowired
private IApiAreaFeign apiAreaFeign;
@Autowired
private IDeviceFeign deviceFeign;
@Autowired
private ISkinSampleFeign skinSampleFeign;
@Autowired
private ISkinFillFeign skinFillFeign;
/**
* @param data
* @return
......
......@@ -58,6 +58,11 @@
<id>product</id>
<properties>
<profiles.active>yibin</profiles.active>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
......
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