From c21d2ffd90d6543e1992c9e6c318579afd8bfa56 Mon Sep 17 00:00:00 2001 From: zhangjing <924187658@qq.com> Date: Wed, 1 Apr 2026 16:09:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E3=80=90=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9=E3=80=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fkzy/warn/common/util/DailyTask.java | 13 ++++-- src/main/java/com/fkzy/warn/common/util/Demo.java | 6 +-- .../com/fkzy/warn/common/util/LawResearchUtil.java | 6 +-- .../fkzy/warn/controller/DataCenterController.java | 11 ++++- .../warn/service/impl/AlarmCaseServiceImpl.java | 53 ++++++++++++---------- .../fkzy/warn/service/impl/LawCaseServiceImpl.java | 6 ++- src/main/resources/bootstrap-prod.yml | 4 +- src/main/resources/bootstrap.yml | 2 +- 8 files changed, 61 insertions(+), 40 deletions(-) diff --git a/src/main/java/com/fkzy/warn/common/util/DailyTask.java b/src/main/java/com/fkzy/warn/common/util/DailyTask.java index 71da9a2..23d126a 100644 --- a/src/main/java/com/fkzy/warn/common/util/DailyTask.java +++ b/src/main/java/com/fkzy/warn/common/util/DailyTask.java @@ -5,6 +5,7 @@ package com.fkzy.warn.common.util; * @date 2025/07/08 19:29 * @description */ + import com.fkzy.warn.model.AlarmCase; import com.fkzy.warn.service.AlarmCaseService; import com.fkzy.warn.service.MonitorUsersService; @@ -25,21 +26,23 @@ public class DailyTask { AlarmCaseService alarmCaseService; @Resource MonitorUsersService monitorUsersService; + /** - * 在每年的3月、6月、9月、12月的1号凌晨2点执行。 + * 在每年的 1、4、7、10 月的 1 号凌晨 2 点执行。 * Cron表达式: 秒 分 时 日 月 周 */ - @Scheduled(cron = "0 0 2 1 3,6,9,12 ?") + @Scheduled(cron = "0 0 2 1 4,7,10,1 ?") public void executeQuarterlyTask() { reportService.quarterlyReport(); System.out.println("每季度定时任务开始执行,当前时间: " + new Date()); } -// 北京时间 - @Scheduled(cron = "0 0 1 * * ?", zone = "Asia/Shanghai") + + // 北京时间 + @Scheduled(cron = "0 0 9 * * ?", zone = "Asia/Shanghai") public void executeAtOneAMInShanghai() { alarmCaseService.getAlarmInfo(); - System.out.println("【北京时间】每天凌晨1点执行:" + new Date()); + System.out.println("【北京时间】每天早9点执行:" + new Date()); } // @Scheduled(cron = "0 0/5 * * * ?") // public void executeEveryFiveMinutes() { diff --git a/src/main/java/com/fkzy/warn/common/util/Demo.java b/src/main/java/com/fkzy/warn/common/util/Demo.java index 4527f7b..c6d4404 100644 --- a/src/main/java/com/fkzy/warn/common/util/Demo.java +++ b/src/main/java/com/fkzy/warn/common/util/Demo.java @@ -23,13 +23,13 @@ import java.util.*; public class Demo { public static void main(String[] args) { LawResearchUtil law = new LawResearchUtil(); - law.querySxx("河南省资源环境调查五院", "12410000415802064U",null); +// law.querySxx("河南省资源环境调查五院", "12410000415802064U",null); // law.queryDishonest(null, null,null,null); // law.queryLimitConsumption(null, null,null,null); // law.monitorQuery(null, null); // law.delcompany(null); -// law.queryMonitorCases(null,null,null); - law.addpublic(null); + law.queryMonitorCases(null,null,null); +// law.addpublic(null); } diff --git a/src/main/java/com/fkzy/warn/common/util/LawResearchUtil.java b/src/main/java/com/fkzy/warn/common/util/LawResearchUtil.java index d5a101d..5b85afa 100644 --- a/src/main/java/com/fkzy/warn/common/util/LawResearchUtil.java +++ b/src/main/java/com/fkzy/warn/common/util/LawResearchUtil.java @@ -749,7 +749,7 @@ public class LawResearchUtil { public static InvocationRecord addpublic(String name) { //默认测试数据 if (name == null) { - name = "丰县城市建设投资集团有限公司"; + name = "河南中豫建设投资集团股份有限公司"; // creditCode = "91110108551385082Q"; } JSONObject jsonObject = new JSONObject(); @@ -802,7 +802,7 @@ public class LawResearchUtil { //默认测试数据 if (pageIndex == null) { pageIndex = 1; - pageSize = 20; + pageSize = 1000; } JSONObject jsonObject = new JSONObject(); jsonObject.put("pageIndex", pageIndex); @@ -828,7 +828,7 @@ public class LawResearchUtil { //默认测试数据 if (queryDate == null) { // queryDate="2022-07-06"; - queryDate="2026-03-19"; + queryDate="2026-03-26"; // pageIndex = 1; // pageSize = 20; } diff --git a/src/main/java/com/fkzy/warn/controller/DataCenterController.java b/src/main/java/com/fkzy/warn/controller/DataCenterController.java index 34de5f4..c3c32cf 100644 --- a/src/main/java/com/fkzy/warn/controller/DataCenterController.java +++ b/src/main/java/com/fkzy/warn/controller/DataCenterController.java @@ -1,10 +1,12 @@ package com.fkzy.warn.controller; +import com.alibaba.fastjson2.JSONObject; import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.response.ApiResponse; import com.fkzy.warn.model.AImessage; import com.fkzy.warn.model.params.AILawParams; import com.fkzy.warn.model.params.LawGroupParam; +import com.fkzy.warn.service.AlarmCaseService; import com.fkzy.warn.service.FyApiService; import com.fkzy.warn.service.LawCaseService; import io.swagger.annotations.Api; @@ -34,6 +36,8 @@ public class DataCenterController { @Resource private LawCaseService lawCaseService; @Resource + private AlarmCaseService alarmCaseService; + @Resource private FyApiService fyApiService; @RequestMapping(value = "judicialModelSave", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @@ -41,7 +45,12 @@ public class DataCenterController { public ApiResponse judicialModelSave() { ApiResponse apiResponse = new ApiResponse(); try { - lawCaseService.judicialModelSave(null); +// lawCaseService.judicialModelSave(null); + +// JSONObject jsonObject = new JSONObject(); +// jsonObject.put("creditCode","91410000MA9LPPEA8U"); +// lawCaseService.caseStatistics(jsonObject); + alarmCaseService.getAlarmInfo(); } catch (Exception e) { log.error("查询错误,errMsg==={}", e.getMessage()); e.printStackTrace(); diff --git a/src/main/java/com/fkzy/warn/service/impl/AlarmCaseServiceImpl.java b/src/main/java/com/fkzy/warn/service/impl/AlarmCaseServiceImpl.java index e4df109..5ae1eee 100644 --- a/src/main/java/com/fkzy/warn/service/impl/AlarmCaseServiceImpl.java +++ b/src/main/java/com/fkzy/warn/service/impl/AlarmCaseServiceImpl.java @@ -60,9 +60,10 @@ public class AlarmCaseServiceImpl extends ServiceImpl monitorUsersList = new ArrayList<>(); - if (arr != null && !arr.isEmpty()) { - List alarmCaseList = arr.toJavaList(AlarmCase.class); - if (alarmCaseList != null && !alarmCaseList.isEmpty()) { - alarmCaseList.forEach(item -> { - MonitorUsers monitorUsers = monitorUsersService.getOne(new LambdaQueryWrapper() - .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 alarmCaseList = arr.toJavaList(AlarmCase.class); + if (alarmCaseList != null && !alarmCaseList.isEmpty()) { + alarmCaseList.forEach(item -> { + MonitorUsers monitorUsers = monitorUsersService.getOne(new LambdaQueryWrapper() + .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); + }); - } } diff --git a/src/main/java/com/fkzy/warn/service/impl/LawCaseServiceImpl.java b/src/main/java/com/fkzy/warn/service/impl/LawCaseServiceImpl.java index 89310a9..56d717c 100644 --- a/src/main/java/com/fkzy/warn/service/impl/LawCaseServiceImpl.java +++ b/src/main/java/com/fkzy/warn/service/impl/LawCaseServiceImpl.java @@ -3,6 +3,7 @@ package com.fkzy.warn.service.impl; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fkzy.warn.common.constants.EntityConstants; @@ -194,7 +195,10 @@ public class LawCaseServiceImpl extends ServiceImpl impl enterpriseProvinceQueue.eq("credit_code",creditCode); enterpriseProvinceService.remove(enterpriseProvinceQueue); enterpriseProvinceService.saveBatch(enterpriseProvinceList); - enterpriseAlarmInfoService.saveOrUpdate(data); + enterpriseAlarmInfoService.remove(new LambdaQueryWrapper() + .eq(EnterpriseAlarmInfo::getCreditCode,creditCode) + ); + enterpriseAlarmInfoService.save(data); } @Override diff --git a/src/main/resources/bootstrap-prod.yml b/src/main/resources/bootstrap-prod.yml index 8f1af55..e6d97ed 100644 --- a/src/main/resources/bootstrap-prod.yml +++ b/src/main/resources/bootstrap-prod.yml @@ -5,7 +5,7 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://127.0.0.1:33066/fkzy_operation?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2b8&allowMultiQueries=true + url: jdbc:mysql://8.140.252.221:33066/fkzy_operation?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2b8&allowMultiQueries=true username: root password: Zjtc!@#0804 druid: @@ -20,7 +20,7 @@ spring: #Redis redis: - host: 127.0.0.1 + host: 8.140.252.221 port: 63799 password: zjtc321! pool: diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml index ee15cd1..f5802f7 100644 --- a/src/main/resources/bootstrap.yml +++ b/src/main/resources/bootstrap.yml @@ -26,7 +26,7 @@ spring: maxFileSize: 200MB maxRequestSize: 200MB profiles: - active: dev + active: prod application: name: fxzy_warn