Commit 66652be9 authored by 赵啸非's avatar 赵啸非

修改根据业务查询部门逻辑

parent 7d7587b7
...@@ -368,8 +368,16 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -368,8 +368,16 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
private List<SiteTreeSelect> getSiteTreeSelects(String userId) { private List<SiteTreeSelect> getSiteTreeSelects(String userId) {
String siteTreeSelectStr = cacheService.hget(USER_SITE_TREE, userId, String.class); String siteTreeSelectStr = cacheService.hget(USER_SITE_TREE, userId, String.class);
log.info("userId:{},siteTreeSelectStr:{}",userId,siteTreeSelectStr);
//反序列化树对象 //反序列化树对象
if(ObjectUtils.isEmpty(siteTreeSelectStr)){
return new ArrayList<>();
}
JSONArray jsonArray = JSON.parseArray(siteTreeSelectStr); JSONArray jsonArray = JSON.parseArray(siteTreeSelectStr);
if(ObjectUtils.isEmpty(jsonArray)){
return new ArrayList<>();
}
List<SiteTreeSelect> collect = jsonArray.stream().map(item -> { List<SiteTreeSelect> collect = jsonArray.stream().map(item -> {
SiteTreeSelect siteTreeSelect = JSON.parseObject(item.toString(), SiteTreeSelect.class); SiteTreeSelect siteTreeSelect = JSON.parseObject(item.toString(), SiteTreeSelect.class);
return siteTreeSelect; return siteTreeSelect;
......
...@@ -91,8 +91,11 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -91,8 +91,11 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
if (ObjectUtils.isEmpty(windowId)) { if (ObjectUtils.isEmpty(windowId)) {
throw new AppException("请选择对应窗口"); throw new AppException("请选择对应窗口");
} }
List<Long> businessIdList = Arrays.asList(businessIds.split(",")).stream().map(Long::parseLong).collect(Collectors.toList()); List<Long> businessIdList =new ArrayList<>();
WindowBusinessQuery windowBusinessQuery = new WindowBusinessQuery(); if(!ObjectUtils.isEmpty(businessIds)){
businessIdList = Arrays.asList(businessIds.split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
}
WindowBusinessQuery windowBusinessQuery = new WindowBusinessQuery();
//windowBusinessQuery.setSiteBusinessIdList(businessIdList); //windowBusinessQuery.setSiteBusinessIdList(businessIdList);
//先删除后再新增 //先删除后再新增
...@@ -104,7 +107,6 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -104,7 +107,6 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
} }
WindowEntity windowEntity = this.get(windowId, context); WindowEntity windowEntity = this.get(windowId, context);
List<WindowBusinessEntity> windowBusinessEntities = businessIdList.stream().map(id -> { List<WindowBusinessEntity> windowBusinessEntities = businessIdList.stream().map(id -> {
WindowBusinessEntity windowBusinessEntity = new WindowBusinessEntity(); WindowBusinessEntity windowBusinessEntity = new WindowBusinessEntity();
windowBusinessEntity.initAttrValue(); windowBusinessEntity.initAttrValue();
...@@ -122,7 +124,7 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W ...@@ -122,7 +124,7 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
return null; return null;
} }
return windowBusinessEntity; return windowBusinessEntity;
}).collect(Collectors.toList()); }).filter(f->f!=null).collect(Collectors.toList());
windowBusinessService.save(windowBusinessEntities, context); windowBusinessService.save(windowBusinessEntities, context);
} }
......
...@@ -4,7 +4,7 @@ POST {{baseUrl}}/site/business/list ...@@ -4,7 +4,7 @@ POST {{baseUrl}}/site/business/list
Content-Type: application/json Content-Type: application/json
{ {
"idNotList": [11,12,17,18,19,20,21], "idNotList": [11,12,17,18,19,20],
"siteId": 1, "siteId": 1,
"page":1, "page":1,
"size":5 "size":5
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
<profiles.log.level>INFO</profiles.log.level> <profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<package.environment>yibin</package.environment> <package.environment>yibin</package.environment>
<skipUi>false</skipUi> <skipUi>true</skipUi>
</properties> </properties>
</profile> </profile>
......
...@@ -249,7 +249,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered { ...@@ -249,7 +249,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
String originalResponseContentType = exchange.getAttribute(ServerWebExchangeUtils.ORIGINAL_RESPONSE_CONTENT_TYPE_ATTR); String originalResponseContentType = exchange.getAttribute(ServerWebExchangeUtils.ORIGINAL_RESPONSE_CONTENT_TYPE_ATTR);
if (ObjectUtil.equal(this.getStatusCode(), HttpStatus.OK) if (ObjectUtil.equal(this.getStatusCode(), HttpStatus.OK)
&& StringUtils.isNotBlank(originalResponseContentType)) { && StringUtils.isNotBlank(originalResponseContentType)) {
accessLogPdu.setRequestData(JSON.toJSONString(Rest.ok())); accessLogPdu.setResponseData(JSON.toJSONString(Rest.ok()));
/* Flux<? extends DataBuffer> fluxBody = Flux.from(body); /* Flux<? extends DataBuffer> fluxBody = Flux.from(body);
return super.writeWith(fluxBody.buffer().map(dataBuffers -> { return super.writeWith(fluxBody.buffer().map(dataBuffers -> {
// 合并多个流集合,解决返回体分段传输 // 合并多个流集合,解决返回体分段传输
...@@ -265,7 +265,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered { ...@@ -265,7 +265,7 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
return bufferFactory.wrap(content); return bufferFactory.wrap(content);
}));*/ }));*/
}else { }else {
accessLogPdu.setRequestData(JSON.toJSONString(Rest.fail())); accessLogPdu.setResponseData(JSON.toJSONString(Rest.fail()));
} }
} }
// if body is not a flux. never got there. // if body is not a flux. never got there.
......
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