Commit dab23bd2 authored by 张俊's avatar 张俊

判断查询数据为空就无需发起请求

parent ddfb5535
......@@ -152,19 +152,16 @@ public class DeptInfoUpdateService {
public String deptInfoUpdatePush() {
// 调oracle存储过程拿到进度推进的数据集合
List<BusinessProcessing> collDwxxbgList = collDeptInfoUpdate();
if (CollectionUtils.isEmpty(collDwxxbgList)) {
return "0";
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("state", "1");
if (!CollectionUtils.isEmpty(collDwxxbgList)) {
jsonObject.put("timestamp", collDwxxbgList.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getTime());
jsonObject.put("busId", collDwxxbgList.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getBusId());
} else {
jsonObject.put("timestamp", "");
jsonObject.put("busId", "");
}
jsonObject.put("departCode", "10");
jsonObject.put("nodeList", collDwxxbgList);
String str = jsonObject.toString();
//(测试环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
String forObject = restTemplate.postForObject(businessProcessing, str, String.class);
log.info("前置机返回第三方解压之后的进度推送结果:{}", forObject);
......
......@@ -121,19 +121,16 @@ public class DeptLogoutService {
public String deptLogoutPush() {
// 调oracle存储过程拿到进度推进的数据集合
List<BusinessProcessing> collDwxhList = collDeptLogout();
if (CollectionUtils.isEmpty(collDwxhList)) {
return "0";
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("state", "1");
if (!CollectionUtils.isEmpty(collDwxhList)) {
jsonObject.put("timestamp", collDwxhList.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getTime());
jsonObject.put("busId", collDwxhList.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getBusId());
} else {
jsonObject.put("timestamp", "");
jsonObject.put("busId", "");
}
jsonObject.put("departCode", "10");
jsonObject.put("nodeList", collDwxhList);
String str = jsonObject.toString();
//(测试环境)调用前置机将业务机封装的业务json数据发给前置机,让前置机去请求第三方的公积金系统服务接口
String forObject = restTemplate.postForObject(businessProcessing, str, String.class);
log.info("前置机返回第三方解压之后的进度推送结果:{}", forObject);
......
......@@ -280,20 +280,13 @@ public class OpenAccountService {
} catch (Exception e) {
logger.error("{}", e);
}
logger.info("调第二个接口了存储过程返回的list" + list);
if (CollectionUtils.isEmpty(list)) {
return "0";
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("state", "1");
if (!list.isEmpty()) {
jsonObject.put("timestamp", list.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getTime());
} else {
jsonObject.put("timestamp", "");
}
if (!list.isEmpty()) {
jsonObject.put("busId", list.stream().min(Comparator.comparing(BusinessProcessing::getTime)).get().getBusId());
} else {
jsonObject.put("busId", "");
}
jsonObject.put("departCode", "10");
jsonObject.put("nodeList", list);
String str = jsonObject.toString();
......
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