Merge remote-tracking branch 'origin/develop' into develop

develop
Hoshi 2024-11-21 11:40:20 +08:00
commit 1d83f81a73
5 changed files with 41 additions and 30 deletions

View File

@ -34,7 +34,7 @@ public class YunKongGetAppSchedule {
JSONObject params = new JSONObject();
params.put("type", "user");
params.put("page", "0");
params.put("limit", "1000");
params.put("limit", "20");
JSONObject obj = ykUtils.call(YkInf.getAppList,params,JSONObject.class);
List<AppEntity> appList = JSONArray.parseArray(obj.getString("list"),AppEntity.class);

View File

@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import java.util.*;
@ -39,13 +40,13 @@ public class YunKongMessageSchedule {
private final MessageRepository messageRepository;
@Scheduled(cron = "${message.schedule:0 0/1 * * * ?}")
@Scheduled(cron = "${message.schedule:0 0/2 * * * ?}")
protected void schedule() {
if (!enable) return;
Map<String, Object> params = new HashMap<>();
params.put("page", 1);
params.put("limit", 1000);
params.put("limit", 15);
params.put("approve_status", 1);
params.put("userId", userId);
params.put("taskStatus", "");
@ -59,7 +60,7 @@ public class YunKongMessageSchedule {
String url = host + "/system/common/queryYKInterface";
HttpClient httpClient = new HttpClient(PostDataFormat.RAW);
log.info("curl -k -X POST -H 'Content-Type: application/json' -d '{}' '{}'", JSON.toJSONString(request), url);
log.info("【运控接口】curl -k -X POST -H 'Content-Type: application/json' -d '{}' '{}'", JSON.toJSONString(request), url);
Result result = httpClient.post(new HashMap<>(), request, url);
Assert.isTrue(result.isSuccess(), result.getMessage());
@ -70,6 +71,10 @@ public class YunKongMessageSchedule {
for (int i = 0; i < array.size(); i++) {
JSONObject item = array.getJSONObject(i);
String externalId = item.getString("record_id");
if (StringUtils.isEmpty(externalId)) {
// log.info("【运控接口】当前外部id为null" + item.toJSONString());
continue;
}
Message message = oldMessages.stream()
.filter(m -> externalId.equals(m.getExternalId()))
.findFirst().orElse(new Message());

View File

@ -50,10 +50,10 @@ public class IndexServiceImpl implements IndexService {
param.put("limit", pager.getRows());
String result = ykUtil.call(YkInfo.getTaskList, param, JSONArray.class);
JSONObject jsonObject = JSONArray.parseObject(result, JSONObject.class);
return new GeneralResult(true, jsonObject, "查询成功");
return new GeneralResult(true, jsonObject, "待办工单列表查询成功");
} catch (Exception e) {
log.info("查询失败", e);
return new GeneralResult(false, "查询失败");
log.info("待办工单列表查询失败", e);
return new GeneralResult(false, "待办工单列表查询失败");
}
}
@ -81,10 +81,10 @@ public class IndexServiceImpl implements IndexService {
resultMap.put("waitDoneTotal", jsonObject.getInteger("todoCount"));
resultMap.put("doneTotal", jsonObject.getInteger("doneCount"));
return new GeneralResult(true, resultMap, "查询成功");
return new GeneralResult(true, resultMap, "工单统计查询成功");
} catch (Exception e) {
log.info("查询失败", e);
return new GeneralResult(false, "查询失败");
log.info("工单统计查询失败", e);
return new GeneralResult(false, "工单统计查询失败");
}
}
@ -114,10 +114,10 @@ public class IndexServiceImpl implements IndexService {
List<JSONObject> list = JSONObject.parseObject(data, List.class);
return new GeneralResult(true, list, "查询成功");
return new GeneralResult(true, list, "获取用户数据权限申请数量查询成功");
} catch (Exception e) {
log.info("查询失败", e);
return new GeneralResult(false, "查询失败");
log.info("获取用户数据权限申请数量查询失败", e);
return new GeneralResult(false, "获取用户数据权限申请数量查询失败");
}
}
@ -130,7 +130,7 @@ public class IndexServiceImpl implements IndexService {
JSONObject param = new JSONObject();
param.put("type", "user");
param.put("page", 1);
param.put("limit", Integer.MAX_VALUE);
param.put("limit", 15);
String result = ykUtil.call(YkInfo.getAllAppList, param, JSONArray.class);
JSONObject allAppJson = JSONObject.parseObject(result, JSONObject.class);
List<JSONObject> allAppList = JSONObject.parseObject(allAppJson.getString("list"), List.class);
@ -158,10 +158,10 @@ public class IndexServiceImpl implements IndexService {
}
}
log.info("allAppList:{}", JSON.toJSONString(allAppList));
return new GeneralResult(true, allAppList, "查询成功");
return new GeneralResult(true, allAppList, "首页数据展示模块查询成功");
} catch (Exception e) {
log.error("查询失败", e);
return new GeneralResult(true,new ArrayList<>(),"查询失败");
log.error("首页数据展示模块查询失败", e);
return new GeneralResult(true,new ArrayList<>(),"首页数据展示模块查询失败");
}
}
@ -173,13 +173,13 @@ public class IndexServiceImpl implements IndexService {
JSONObject jsonObject = JSONObject.parseObject(result);
if (!"200".equals(jsonObject.getString("code"))) {
log.info("result:" + result);
return new GeneralResult(false, "查询失败");
return new GeneralResult(false, "近7日告警趋势查询失败");
}
JSONObject data = jsonObject.getJSONObject("data");
return new GeneralResult(true, data, "查询成功");
return new GeneralResult(true, data, "近7日告警趋势查询成功");
} catch (Exception e) {
log.info("查询失败", e);
return new GeneralResult(false, "查询失败");
log.info("近7日告警趋势查询失败", e);
return new GeneralResult(false, "近7日告警趋势查询失败");
}
}
@ -191,13 +191,13 @@ public class IndexServiceImpl implements IndexService {
JSONObject jsonObject = JSONObject.parseObject(result);
if (!"200".equals(jsonObject.getString("code"))) {
log.info("result:" + result);
return new GeneralResult(false, "查询失败");
return new GeneralResult(false, "单日告警统计查询失败");
}
JSONObject data = jsonObject.getJSONObject("data");
return new GeneralResult(true, data, "查询成功");
return new GeneralResult(true, data, "单日告警统计查询成功");
} catch (Exception e) {
log.info("查询失败", e);
return new GeneralResult(false, "查询失败");
log.info("单日告警统计查询失败", e);
return new GeneralResult(false, "单日告警统计查询失败");
}
}
@ -208,13 +208,13 @@ public class IndexServiceImpl implements IndexService {
JSONObject jsonObject = JSONObject.parseObject(result);
if (!"200".equals(jsonObject.getString("code"))) {
log.info("result:" + result);
return new GeneralResult(false, "查询失败");
return new GeneralResult(false, "单日告警统计查询失败");
}
List<JSONObject> data = JSONObject.parseObject(jsonObject.getString("data"), List.class);
return new GeneralResult(true, data, "查询成功");
return new GeneralResult(true, data, "单日告警统计查询成功");
} catch (Exception e) {
log.info("查询失败", e);
return new GeneralResult(false, "查询失败");
log.info("单日告警统计查询失败", e);
return new GeneralResult(false, "单日告警统计查询失败");
}
}

View File

@ -70,6 +70,7 @@ public class TrxServiceImpl implements TrxService {
log.info("调用天融信获取随机字符串接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
HttpResponse response = httpRequest.execute();
result = JSONObject.parseObject(response.body());
log.info("调用天融信获取随机字符串接口, 响应信息:" + JSONObject.toJSONString(result));
if ("-1".equals(result.getString("result"))) {
return new GeneralResult(false, "获取随机数失败" + result.getString("errmsg"));
}
@ -95,6 +96,7 @@ public class TrxServiceImpl implements TrxService {
log.info("调用天融信获取随机字符串接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
HttpResponse response = httpRequest.execute();
result = JSONObject.parseObject(response.body());
log.info("调用天融信获取随机字符串接口, 响应信息:" + JSONObject.toJSONString(result));
if ("-1".equals(result.getString("result"))) {
return new GeneralResult(false, "获取随机数失败" + result.getString("errmsg"));
}
@ -146,6 +148,7 @@ public class TrxServiceImpl implements TrxService {
log.info("调用天融信用户登录接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
HttpResponse response = httpRequest.execute();
result = JSONObject.parseObject(response.body());
log.info("调用天融信用户登录接口, 响应信息:" + JSONObject.toJSONString(result));
if (!"0".equals(result.getString("result"))) {
return new GeneralResult(false, "用户登录天融信失败" + result.getString("errmsg"));
}
@ -194,8 +197,9 @@ public class TrxServiceImpl implements TrxService {
log.info("调用天融信用户软key登录接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
HttpResponse response = httpRequest.execute();
result = JSONObject.parseObject(response.body());
log.info("调用天融信用户软key登录接口, 响应信息:" + JSONObject.toJSONString(result));
if (!"0".equals(result.getString("result"))) {
return new GeneralResult(false, "用户登录天融信失败" + result.getString("errmsg"));
return new GeneralResult(false, "天融信登录返回失败:" + result.getString("errmsg"));
}
String trxToken = result.getString("token");
String userId = result.getString("user_id");
@ -319,6 +323,7 @@ public class TrxServiceImpl implements TrxService {
log.info("调用天融信下线接口, 请求信息:" + JSONObject.toJSONString(httpRequest));
HttpResponse response = httpRequest.execute();
JSONObject result = JSONObject.parseObject(response.body());
log.info("调用天融信下线接口, 响应信息: " + JSONObject.toJSONString(result));
if (!"0".equals(result.getString("result"))) {
return new GeneralResult(false, "下线失败" + result.getString("msg"));
}

View File

@ -36,6 +36,7 @@ public class QxUtils {
String str = JSONObject.toJSONString(qxReqVo);
logger.info("call method[{}] req params[{}]",url,str);
JSONObject result = JSONObject.parseObject(HttpUtil.post(url,str, 10000));
logger.info("调用权限系统接口响应信息" + result.toJSONString());
if (!"200".equals(result.getString("status"))) {
throw new IllegalArgumentException("调用权限系统接口异常" + result.getString("msg"));
}