Commit 5277abb0 authored by 赵啸非's avatar 赵啸非

添加窗口无人值守

parent 53095de0
...@@ -37,8 +37,8 @@ import java.util.Map; ...@@ -37,8 +37,8 @@ import java.util.Map;
* @author: zxfei * @author: zxfei
* @date: 2022/4/20 9:24 * @date: 2022/4/20 9:24
*/ */
@Aspect //@Aspect
@Component //@Component
@Slf4j @Slf4j
//@Order(1) //@Order(1)
@Profile({"default", "develop", "test"}) @Profile({"default", "develop", "test"})
......
package com.mortals.xhx.base.framework.exception; package com.mortals.xhx.base.framework.exception;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
...@@ -13,30 +14,29 @@ import com.mortals.framework.exception.AppException; ...@@ -13,30 +14,29 @@ import com.mortals.framework.exception.AppException;
* 统一异常处理 * 统一异常处理
*/ */
@ControllerAdvice @ControllerAdvice
@Slf4j
public class ExceptionHandle { public class ExceptionHandle {
private final static Logger log = LoggerFactory.getLogger(ExceptionHandle.class); public static final String KEY_RESULT_CODE = "code";
public static final String KEY_RESULT_MSG = "msg";
public static final String KEY_RESULT_DATA = "data";
public static final int VALUE_RESULT_FAILURE = -1;
public static final String KEY_RESULT_CODE = "code"; @ExceptionHandler(value = Exception.class)
public static final String KEY_RESULT_MSG = "msg"; @ResponseBody
public static final String KEY_RESULT_DATA = "data"; public String handle(Exception e) {
public static final int VALUE_RESULT_FAILURE = -1; JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
@ExceptionHandler(value = Exception.class) if (e instanceof AppException) {
@ResponseBody StackTraceElement stack = e.getStackTrace()[0];
public String handle(Exception e) { log.error("[business error]=========stack message[{}],[{},method:{},line{}][{}]", e.getMessage(),
JSONObject ret = new JSONObject(); stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName());
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); AppException ex = (AppException) e;
if (e instanceof AppException) { ret.put(KEY_RESULT_MSG, ex.getMessage());
StackTraceElement stack = e.getStackTrace()[0]; } else {
log.error("[business error]=========stack message[{}],[{},method:{},line{}][{}]", e.getMessage(), log.error("[system error]", e);
stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName()); ret.put(KEY_RESULT_MSG, "未知错误!");
AppException ex = (AppException) e; }
ret.put(KEY_RESULT_MSG, ex.getMessage()); return ret.toJSONString();
} else { }
log.error("[system error]", e);
ret.put(KEY_RESULT_MSG, "未知错误!");
}
return ret.toJSONString();
}
} }
...@@ -49,12 +49,13 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -49,12 +49,13 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
@Override @Override
protected void findAfter(SiteBusinessEntity params, PageInfo pageInfo, Context context, List<SiteBusinessEntity> list) throws AppException { protected void findAfter(SiteBusinessEntity params, PageInfo pageInfo, Context context, List<SiteBusinessEntity> list) throws AppException {
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
if (!ObjectUtils.isEmpty(params.getIdNotList())) { if (!ObjectUtils.isEmpty(params.getIdNotList())) {
//排除掉已经存在的ids //排除掉已经存在的ids
log.info("idNotList:{}", JSON.toJSONString(params.getIdNotList())); log.info("idNotList:{}", JSON.toJSONString(params.getIdNotList()));
Iterator<SiteBusinessEntity> iterator = list.iterator(); Iterator<SiteBusinessEntity> iterator = list.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
SiteBusinessEntity item = iterator.next(); SiteBusinessEntity item = iterator.next();
siteBusinessQuery.siteId(item.getSiteId()); siteBusinessQuery.siteId(item.getSiteId());
siteBusinessQuery.setParentId(item.getBusinessId()); siteBusinessQuery.setParentId(item.getBusinessId());
...@@ -76,6 +77,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -76,6 +77,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
} }
} else { } else {
list.stream().peek(item -> { list.stream().peek(item -> {
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
List<SiteBusinessEntity> childs = this.find(siteBusinessQuery.siteId(item.getSiteId()).parentId(item.getBusinessId())); List<SiteBusinessEntity> childs = this.find(siteBusinessQuery.siteId(item.getSiteId()).parentId(item.getBusinessId()));
childs.stream().forEach(item1 -> { childs.stream().forEach(item1 -> {
buildChildBusiness(item1); buildChildBusiness(item1);
......
...@@ -4,10 +4,10 @@ POST {{baseUrl}}/site/business/list ...@@ -4,10 +4,10 @@ POST {{baseUrl}}/site/business/list
Content-Type: application/json Content-Type: application/json
{ {
"idNotList": [11,12,17,18,19,20], "idNotList": [15,16,63,27,28,29,35,34,17,18,19,20,21,23,24,25,41,42,43,44,45,46,47,70,71,72,73,61,60,59,57,56,55,54,53,85,86,87,88,89,90,91,92,93,94],
"siteId": 1, "siteId": 1,
"page":1, "page":3,
"size":5 "size":10
} }
###站点业务列表 ###站点业务列表
......
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