|
|
@ -60,9 +60,10 @@ public class AlarmCaseServiceImpl extends ServiceImpl |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void getAlarmInfo() { |
|
|
public void getAlarmInfo() { |
|
|
|
|
|
|
|
|
InvocationRecord result = LawResearchUtil.queryMonitorCases(TimeUtil.formatTimeStr(new Date()), null, null); |
|
|
InvocationRecord result = LawResearchUtil.queryMonitorCases(TimeUtil.formatTimeStr(new Date()), null, null); |
|
|
invocationRecordService.saveModel(result); |
|
|
invocationRecordService.saveModel(result); |
|
|
if (result.getApiResult() == null||result.getIsSuccess().equals(0)) { |
|
|
|
|
|
|
|
|
if (result.getApiResult() == null) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
JSONObject jsonObject = new JSONObject().parseObject(result.getApiResult()); |
|
|
JSONObject jsonObject = new JSONObject().parseObject(result.getApiResult()); |
|
|
@ -71,34 +72,38 @@ public class AlarmCaseServiceImpl extends ServiceImpl |
|
|
} |
|
|
} |
|
|
JSONObject object = jsonObject.getJSONObject("data"); |
|
|
JSONObject object = jsonObject.getJSONObject("data"); |
|
|
JSONArray arr = object.getJSONArray("records"); |
|
|
JSONArray arr = object.getJSONArray("records"); |
|
|
|
|
|
|
|
|
|
|
|
if (arr == null || arr.isEmpty()) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
List<MonitorUsers> monitorUsersList = new ArrayList<>(); |
|
|
List<MonitorUsers> monitorUsersList = new ArrayList<>(); |
|
|
if (arr != null && !arr.isEmpty()) { |
|
|
|
|
|
List<AlarmCase> alarmCaseList = arr.toJavaList(AlarmCase.class); |
|
|
|
|
|
if (alarmCaseList != null && !alarmCaseList.isEmpty()) { |
|
|
|
|
|
alarmCaseList.forEach(item -> { |
|
|
|
|
|
MonitorUsers monitorUsers = monitorUsersService.getOne(new LambdaQueryWrapper<MonitorUsers>() |
|
|
|
|
|
.eq(MonitorUsers::getCompanyName, item.getName()) |
|
|
|
|
|
); |
|
|
|
|
|
item.setCompanyName(monitorUsers != null ? monitorUsers.getCompanyName() : null); |
|
|
|
|
|
item.setCreditCode(monitorUsers != null ? monitorUsers.getCreditCode() : null); |
|
|
|
|
|
item.setAlarmDate(new Date()); |
|
|
|
|
|
monitorUsersList.add(monitorUsers); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
this.saveBatch(alarmCaseList); |
|
|
|
|
|
|
|
|
|
|
|
//如果有预警,需要再查司法全量数据有待考虑,先存预警信息 |
|
|
|
|
|
monitorUsersList.forEach(item -> { |
|
|
|
|
|
InvocationRecord lawResult = LawResearchUtil.querySxx(item.getCompanyName(), item.getCreditCode(),null); |
|
|
|
|
|
invocationRecordService.saveModel(result); |
|
|
|
|
|
JSONObject resultObj = JSONObject.parseObject(lawResult.getApiResult()); |
|
|
|
|
|
lawCaseService.judicialModelSave(resultObj); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AlarmCase> alarmCaseList = arr.toJavaList(AlarmCase.class); |
|
|
|
|
|
if (alarmCaseList != null && !alarmCaseList.isEmpty()) { |
|
|
|
|
|
alarmCaseList.forEach(item -> { |
|
|
|
|
|
MonitorUsers monitorUsers = monitorUsersService.getOne(new LambdaQueryWrapper<MonitorUsers>() |
|
|
|
|
|
.eq(MonitorUsers::getCompanyName, item.getName()) |
|
|
|
|
|
); |
|
|
|
|
|
if (monitorUsers != null) { |
|
|
|
|
|
item.setNAjbs(item.getNAjbs() + ":" + monitorUsers.getCreditCode()); |
|
|
|
|
|
item.setCompanyName(monitorUsers.getCompanyName()); |
|
|
|
|
|
item.setCreditCode(monitorUsers.getCreditCode()); |
|
|
|
|
|
} |
|
|
|
|
|
item.setAlarmDate(new Date()); |
|
|
|
|
|
monitorUsersList.add(monitorUsers); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
this.saveBatch(alarmCaseList); |
|
|
|
|
|
|
|
|
|
|
|
//如果有预警,需要再查司法全量数据有待考虑,先存预警信息 |
|
|
|
|
|
monitorUsersList.forEach(item -> { |
|
|
|
|
|
InvocationRecord lawResult = LawResearchUtil.querySxx(item.getCompanyName(), item.getCreditCode(), null); |
|
|
|
|
|
invocationRecordService.saveModel(result); |
|
|
|
|
|
JSONObject resultObj = JSONObject.parseObject(lawResult.getApiResult()); |
|
|
|
|
|
lawCaseService.judicialModelSave(resultObj); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|