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

添加窗口无人值守

parent 53095de0
......@@ -37,8 +37,8 @@ import java.util.Map;
* @author: zxfei
* @date: 2022/4/20 9:24
*/
@Aspect
@Component
//@Aspect
//@Component
@Slf4j
//@Order(1)
@Profile({"default", "develop", "test"})
......
package com.mortals.xhx.base.framework.exception;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;
......@@ -13,30 +14,29 @@ import com.mortals.framework.exception.AppException;
* 统一异常处理
*/
@ControllerAdvice
@Slf4j
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";
public static final String KEY_RESULT_MSG = "msg";
public static final String KEY_RESULT_DATA = "data";
public static final int VALUE_RESULT_FAILURE = -1;
@ExceptionHandler(value = Exception.class)
@ResponseBody
public String handle(Exception e) {
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
if (e instanceof AppException) {
StackTraceElement stack = e.getStackTrace()[0];
log.error("[business error]=========stack message[{}],[{},method:{},line{}][{}]", e.getMessage(),
stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName());
AppException ex = (AppException) e;
ret.put(KEY_RESULT_MSG, ex.getMessage());
} else {
log.error("[system error]", e);
ret.put(KEY_RESULT_MSG, "未知错误!");
}
return ret.toJSONString();
}
@ExceptionHandler(value = Exception.class)
@ResponseBody
public String handle(Exception e) {
JSONObject ret = new JSONObject();
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
if (e instanceof AppException) {
StackTraceElement stack = e.getStackTrace()[0];
log.error("[business error]=========stack message[{}],[{},method:{},line{}][{}]", e.getMessage(),
stack.getClassName(), stack.getMethodName(), stack.getLineNumber(), e.getClass().getName());
AppException ex = (AppException) e;
ret.put(KEY_RESULT_MSG, ex.getMessage());
} else {
log.error("[system error]", e);
ret.put(KEY_RESULT_MSG, "未知错误!");
}
return ret.toJSONString();
}
}
......@@ -49,12 +49,13 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
@Override
protected void findAfter(SiteBusinessEntity params, PageInfo pageInfo, Context context, List<SiteBusinessEntity> list) throws AppException {
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
if (!ObjectUtils.isEmpty(params.getIdNotList())) {
//排除掉已经存在的ids
log.info("idNotList:{}", JSON.toJSONString(params.getIdNotList()));
Iterator<SiteBusinessEntity> iterator = list.iterator();
while (iterator.hasNext()) {
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
SiteBusinessEntity item = iterator.next();
siteBusinessQuery.siteId(item.getSiteId());
siteBusinessQuery.setParentId(item.getBusinessId());
......@@ -76,6 +77,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
}
} else {
list.stream().peek(item -> {
SiteBusinessQuery siteBusinessQuery = new SiteBusinessQuery();
List<SiteBusinessEntity> childs = this.find(siteBusinessQuery.siteId(item.getSiteId()).parentId(item.getBusinessId()));
childs.stream().forEach(item1 -> {
buildChildBusiness(item1);
......
......@@ -4,10 +4,10 @@ POST {{baseUrl}}/site/business/list
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,
"page":1,
"size":5
"page":3,
"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