zhao.renji vor 8 Monaten
Commit
f2863f7eb3
100 geänderte Dateien mit 8653 neuen und 0 gelöschten Zeilen
  1. 33 0
      .gitignore
  2. 147 0
      pom.xml
  3. 28 0
      yujing-common/pom.xml
  4. 326 0
      yujing-common/src/main/java/com/cn/tianji/common/CommonConstant.java
  5. 151 0
      yujing-common/src/main/java/com/cn/tianji/common/CommonUtils.java
  6. 46 0
      yujing-common/src/main/java/com/cn/tianji/common/Constants.java
  7. 281 0
      yujing-common/src/main/java/com/cn/tianji/common/HttpUtil.java
  8. 548 0
      yujing-common/src/main/java/com/cn/tianji/common/RedisUtil.java
  9. 182 0
      yujing-common/src/main/java/com/cn/tianji/common/Result.java
  10. 83 0
      yujing-common/src/main/java/com/cn/tianji/common/ResultInfo.java
  11. 34 0
      yujing-common/src/main/java/com/cn/tianji/common/Status.java
  12. 655 0
      yujing-common/src/main/java/com/cn/tianji/common/StringUtils.java
  13. 21 0
      yujing-common/src/main/java/com/cn/tianji/config/ConfigBean.java
  14. 24 0
      yujing-common/src/main/java/com/cn/tianji/config/MyBatisPlusConfig.java
  15. 44 0
      yujing-common/src/main/java/com/cn/tianji/config/RedisConfig.java
  16. 31 0
      yujing-common/src/main/java/com/cn/tianji/config/RocketMqConfig.java
  17. 69 0
      yujing-common/src/main/java/com/cn/tianji/entity/Ajh.java
  18. 59 0
      yujing-common/src/main/java/com/cn/tianji/entity/ComprehensiveLog.java
  19. 180 0
      yujing-common/src/main/java/com/cn/tianji/entity/HookLoadWarnLog.java
  20. 79 0
      yujing-common/src/main/java/com/cn/tianji/entity/OperatingConditionThreshold.java
  21. 98 0
      yujing-common/src/main/java/com/cn/tianji/entity/PumpingPressureWarnLog.java
  22. 39 0
      yujing-common/src/main/java/com/cn/tianji/entity/SyncRecord.java
  23. 132 0
      yujing-common/src/main/java/com/cn/tianji/entity/TorqueWarnLog.java
  24. 136 0
      yujing-common/src/main/java/com/cn/tianji/entity/TotalPoolVolumeWarnLog.java
  25. 192 0
      yujing-common/src/main/java/com/cn/tianji/entity/WarnHistory.java
  26. 559 0
      yujing-common/src/main/java/com/cn/tianji/entity/WellDrilling.java
  27. 766 0
      yujing-common/src/main/java/com/cn/tianji/entity/WellDrillingSICP.java
  28. 25 0
      yujing-common/src/main/java/com/cn/tianji/entity/WellName.java
  29. 43 0
      yujing-common/src/main/java/com/cn/tianji/entity/WorkingConditionCalculationLog.java
  30. 100 0
      yujing-common/src/main/java/com/cn/tianji/enums/DrillingConditionDeterminationEnum.java
  31. 87 0
      yujing-common/src/main/java/com/cn/tianji/enums/TrippingConditionDeterminationEnum.java
  32. 8 0
      yujing-common/src/main/java/com/cn/tianji/mapper/AjhMapper.java
  33. 14 0
      yujing-common/src/main/java/com/cn/tianji/mapper/ComprehensiveLogMapper.java
  34. 14 0
      yujing-common/src/main/java/com/cn/tianji/mapper/HookLoadWarnLogMapper.java
  35. 9 0
      yujing-common/src/main/java/com/cn/tianji/mapper/OperatingConditionThresholdMapper.java
  36. 14 0
      yujing-common/src/main/java/com/cn/tianji/mapper/PumpingPressureWarnLogMapper.java
  37. 35 0
      yujing-common/src/main/java/com/cn/tianji/mapper/SyncRecordMapper.java
  38. 7 0
      yujing-common/src/main/java/com/cn/tianji/mapper/TorqueWarnLogMapper.java
  39. 14 0
      yujing-common/src/main/java/com/cn/tianji/mapper/TotalPoolVolumeWarnLogMapper.java
  40. 19 0
      yujing-common/src/main/java/com/cn/tianji/mapper/WarnHistoryMapper.java
  41. 39 0
      yujing-common/src/main/java/com/cn/tianji/mapper/WellDrillingMapper.java
  42. 25 0
      yujing-common/src/main/java/com/cn/tianji/mapper/WellDrillingSICPMapper.java
  43. 17 0
      yujing-common/src/main/java/com/cn/tianji/mapper/WlwmroDataMapper.java
  44. 19 0
      yujing-common/src/main/java/com/cn/tianji/mapper/WorkingConditionCalculationLogMapper.java
  45. 9 0
      yujing-common/src/main/java/com/cn/tianji/service/AjhService.java
  46. 8 0
      yujing-common/src/main/java/com/cn/tianji/service/ComprehensiveLogService.java
  47. 70 0
      yujing-common/src/main/java/com/cn/tianji/service/HookLoadWarnLogService.java
  48. 7 0
      yujing-common/src/main/java/com/cn/tianji/service/OperatingConditionThresholdService.java
  49. 18 0
      yujing-common/src/main/java/com/cn/tianji/service/PullDataSICPService.java
  50. 58 0
      yujing-common/src/main/java/com/cn/tianji/service/PumpingPressureWarnLogService.java
  51. 17 0
      yujing-common/src/main/java/com/cn/tianji/service/SyncRecordService.java
  52. 70 0
      yujing-common/src/main/java/com/cn/tianji/service/TorqueWarnLogService.java
  53. 62 0
      yujing-common/src/main/java/com/cn/tianji/service/TotalPoolVolumeWarnLogService.java
  54. 17 0
      yujing-common/src/main/java/com/cn/tianji/service/WarnHistoryService.java
  55. 22 0
      yujing-common/src/main/java/com/cn/tianji/service/WellDrillingSICPService.java
  56. 24 0
      yujing-common/src/main/java/com/cn/tianji/service/WellDrillingService.java
  57. 14 0
      yujing-common/src/main/java/com/cn/tianji/service/WlwmroDataService.java
  58. 7 0
      yujing-common/src/main/java/com/cn/tianji/service/WorkingConditionCalculationLogService.java
  59. 93 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/AjhServiceImpl.java
  60. 18 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/ComprehensiveLogServiceImpl.java
  61. 242 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/HookLoadWarnLogServiceImpl.java
  62. 14 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/OperatingConditionThresholdServiceImpl.java
  63. 303 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/PullDataSICPServiceImpl.java
  64. 120 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/PumpingPressureWarnLogServiceImpl.java
  65. 31 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/SyncRecordServiceImpl.java
  66. 171 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/TorqueWarnLogServiceImpl.java
  67. 136 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/TotalPoolVolumeWarnLogServiceImpl.java
  68. 21 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/WarnHistoryServiceImpl.java
  69. 89 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/WellDrillingSICPServiceImpl.java
  70. 66 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/WellDrillingServiceImpl.java
  71. 35 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/WlwmroDataServiceImpl.java
  72. 20 0
      yujing-common/src/main/java/com/cn/tianji/service/impl/WorkingConditionCalculationLogServiceImpl.java
  73. 211 0
      yujing-common/src/main/java/com/cn/tianji/util/CommonUtil.java
  74. 6 0
      yujing-common/src/main/resources/mapper/AjhMapper.xml
  75. 6 0
      yujing-common/src/main/resources/mapper/ComprehensiveLogMapper.xml
  76. 6 0
      yujing-common/src/main/resources/mapper/HookLoadWarnLogMapper.xml
  77. 6 0
      yujing-common/src/main/resources/mapper/PumpingPressureWarnLogMapper.xml
  78. 6 0
      yujing-common/src/main/resources/mapper/SyncRecordMapper.xml
  79. 6 0
      yujing-common/src/main/resources/mapper/TorqueWarnLogMapper.xml
  80. 6 0
      yujing-common/src/main/resources/mapper/TotalPoolVolumeWarnLogMapper.xml
  81. 66 0
      yujing-common/src/main/resources/mapper/WellDrillingMapper.xml
  82. 75 0
      yujing-common/src/main/resources/mapper/WellDrillingSICPMapper.xml
  83. 32 0
      yujing-common/src/main/resources/mapper/WlwmroDataMapper.xml
  84. 57 0
      yujing-condition-identification/pom.xml
  85. 16 0
      yujing-condition-identification/src/main/java/com/cn/tianji/ConditionIdentificationApplication.java
  86. 33 0
      yujing-condition-identification/src/main/java/com/cn/tianji/config/AsyncConfig.java
  87. 19 0
      yujing-condition-identification/src/main/java/com/cn/tianji/config/CorsConfig.java
  88. 23 0
      yujing-condition-identification/src/main/java/com/cn/tianji/controller/WorkingConditionCalculationController.java
  89. 405 0
      yujing-condition-identification/src/main/java/com/cn/tianji/service/Impl/WorkingConditionCalculationServiceImpl.java
  90. 13 0
      yujing-condition-identification/src/main/java/com/cn/tianji/service/WorkingConditionCalculationService.java
  91. 52 0
      yujing-condition-identification/src/main/resources/config/application-dev.yml
  92. 52 0
      yujing-condition-identification/src/main/resources/config/application-local.yml
  93. 54 0
      yujing-condition-identification/src/main/resources/config/application-prod.yml
  94. 41 0
      yujing-condition-identification/src/main/resources/config/application.yml
  95. 103 0
      yujing-condition-identification/src/main/resources/logback.xml
  96. 53 0
      yujing-hook-load-warning/pom.xml
  97. 15 0
      yujing-hook-load-warning/src/main/java/com/cn/tianji/HookLoadWarningApplication.java
  98. 33 0
      yujing-hook-load-warning/src/main/java/com/cn/tianji/config/AsyncConfig.java
  99. 18 0
      yujing-hook-load-warning/src/main/java/com/cn/tianji/config/CorsConfig.java
  100. 46 0
      yujing-hook-load-warning/src/main/java/com/cn/tianji/rocketMq/ConsumerClient.java

+ 33 - 0
.gitignore

@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/

+ 147 - 0
pom.xml

@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>pom</packaging>
+    <modules>
+        <!--预警公共模块-->
+        <module>yujing-common</module>
+        <!--算法模块-->
+        <module>yujing-warning-calculation</module>
+        <!--工况和重新计算模块-->
+        <module>yujing-condition-identification</module>
+
+        <!--数据诊断某开-->
+        <module>yujing-hook-load-warning</module>
+        <module>yujing-total-pool-volume</module>
+        <module>yujing-pumping-pressure</module>
+        <module>yujing-torque</module>
+        <!--数据发送模块-->
+        <module>yujing-send-message</module>
+
+
+        <!--数据采集模块-->
+        <module>yujing-pull</module>
+    </modules>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.6.1</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.cn.tianji</groupId>
+    <artifactId>yujing-calculate</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>yujing-calculate</name>
+    <description>yujing-calculate</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <redisson.version>3.16.1</redisson.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+            <version>2.3.28</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.73</version>
+        </dependency>
+        <dependency>
+            <groupId>org.redisson</groupId>
+            <artifactId>redisson</artifactId>
+            <version>${redisson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>2.9.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <!-- mybatis-plus相关-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.5.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>3.5.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-core</artifactId>
+            <version>2.3</version>
+        </dependency>
+        <dependency>
+            <groupId>com.oracle</groupId>
+            <artifactId>ojdbc6</artifactId>
+            <version>12.1.0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.7.25</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.quartz-scheduler</groupId>
+            <artifactId>quartz</artifactId>
+            <version>2.3.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.rocketmq</groupId>
+            <artifactId>rocketmq-spring-boot-starter</artifactId>
+            <version>2.1.1</version>
+        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.aliyun.openservices</groupId>-->
+<!--            <artifactId>ons-client</artifactId>-->
+<!--            <version>1.8.4.Final</version>-->
+<!--        </dependency>-->
+        <!-- hutool工具类-->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.12</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+
+    <build>
+
+<!--        <plugins>-->
+<!--            <plugin>-->
+<!--                <groupId>org.springframework.boot</groupId>-->
+<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
+<!--            </plugin>-->
+<!--        </plugins>-->
+    </build>
+
+</project>

+ 28 - 0
yujing-common/pom.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>yujing-calculate</artifactId>
+        <groupId>com.cn.tianji</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>yujing-common</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+
+    <build>
+<!--        <plugins>-->
+<!--            <plugin>-->
+<!--                <groupId>org.springframework.boot</groupId>-->
+<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
+<!--            </plugin>-->
+<!--        </plugins>-->
+    </build>
+
+</project>

+ 326 - 0
yujing-common/src/main/java/com/cn/tianji/common/CommonConstant.java

@@ -0,0 +1,326 @@
+package com.cn.tianji.common;
+
+public interface CommonConstant {
+    /**
+     * 正常状态
+     */
+    public static final Integer STATUS_NORMAL = 0;
+
+    /**
+     * 禁用状态
+     */
+    public static final Integer STATUS_DISABLE = -1;
+
+    /**
+     * 删除标志
+     */
+    public static final Integer DEL_FLAG_1 = 1;
+
+    /**
+     * 未删除
+     */
+    public static final Integer DEL_FLAG_0 = 0;
+
+    /**
+     * 系统日志类型: 登录
+     */
+    public static final int LOG_TYPE_1 = 1;
+
+    /**
+     * 系统日志类型: 操作
+     */
+    public static final int LOG_TYPE_2 = 2;
+
+    /**
+     * 操作日志类型: 查询
+     */
+    public static final int OPERATE_TYPE_1 = 1;
+
+    /**
+     * 操作日志类型: 添加
+     */
+    public static final int OPERATE_TYPE_2 = 2;
+
+    /**
+     * 操作日志类型: 更新
+     */
+    public static final int OPERATE_TYPE_3 = 3;
+
+    /**
+     * 操作日志类型: 删除
+     */
+    public static final int OPERATE_TYPE_4 = 4;
+
+    /**
+     * 操作日志类型: 倒入
+     */
+    public static final int OPERATE_TYPE_5 = 5;
+
+    /**
+     * 操作日志类型: 导出
+     */
+    public static final int OPERATE_TYPE_6 = 6;
+
+
+    /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
+    public static final Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
+    /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
+    public static final Integer SC_OK_200 = 200;
+
+    /**访问权限认证未通过 510*/
+    public static final Integer SC_JEECG_NO_AUTHZ=510;
+
+    /** 登录用户Shiro权限缓存KEY前缀 */
+    public static String PREFIX_USER_SHIRO_CACHE  = "shiro:cache:org.jeecg.config.shiro.ShiroRealm.authorizationCache:";
+    /** 登录用户Token令牌缓存KEY前缀 */
+    public static final String PREFIX_USER_TOKEN  = "prefix_user_token_";
+    /** Token缓存时间:3600秒即一小时 */
+    public static final int  TOKEN_EXPIRE_TIME  = 3600;
+
+
+    /**
+     *  0:一级菜单
+     */
+    public static final Integer MENU_TYPE_0  = 0;
+    /**
+     *  1:子菜单
+     */
+    public static final Integer MENU_TYPE_1  = 1;
+    /**
+     *  2:按钮权限
+     */
+    public static final Integer MENU_TYPE_2  = 2;
+
+    /**通告对象类型(USER:指定用户,ALL:全体用户)*/
+    public static final String MSG_TYPE_UESR  = "USER";
+    public static final String MSG_TYPE_ALL  = "ALL";
+
+    /**发布状态(0未发布,1已发布,2已撤销)*/
+    public static final String NO_SEND  = "0";
+    public static final String HAS_SEND  = "1";
+    public static final String HAS_CANCLE  = "2";
+
+    /**阅读状态(0未读,1已读)*/
+    public static final String HAS_READ_FLAG  = "1";
+    public static final String NO_READ_FLAG  = "0";
+
+    /**优先级(L低,M中,H高)*/
+    public static final String PRIORITY_L  = "L";
+    public static final String PRIORITY_M  = "M";
+    public static final String PRIORITY_H  = "H";
+
+    /**
+     * 短信模板方式  0 .登录模板、1.注册模板、2.忘记密码模板
+     */
+    public static final String SMS_TPL_TYPE_0  = "0";
+    public static final String SMS_TPL_TYPE_1  = "1";
+    public static final String SMS_TPL_TYPE_2  = "2";
+
+    /**
+     * 状态(0无效1有效)
+     */
+    public static final String STATUS_0 = "0";
+    public static final String STATUS_1 = "1";
+
+    /**
+     * 同步工作流引擎1同步0不同步
+     */
+    public static final Integer ACT_SYNC_1 = 1;
+    public static final Integer ACT_SYNC_0 = 0;
+
+    /**
+     * 消息类型1:通知公告2:系统消息
+     */
+    public static final String MSG_CATEGORY_1 = "1";
+    public static final String MSG_CATEGORY_2 = "2";
+
+    /**
+     * 是否配置菜单的数据权限 1是0否
+     */
+    public static final Integer RULE_FLAG_0 = 0;
+    public static final Integer RULE_FLAG_1 = 1;
+
+    /**
+     * 是否用户已被冻结 1正常(解冻) 2冻结
+     */
+    public static final Integer USER_UNFREEZE = 1;
+    public static final Integer USER_FREEZE = 2;
+
+    /**字典翻译文本后缀*/
+    public static final String DICT_TEXT_SUFFIX = "_dictText";
+
+    /**
+     * 表单设计器主表类型
+     */
+    public static final Integer DESIGN_FORM_TYPE_MAIN = 1;
+
+    /**
+     * 表单设计器子表表类型
+     */
+    public static final Integer DESIGN_FORM_TYPE_SUB = 2;
+
+    /**
+     * 表单设计器URL授权通过
+     */
+    public static final Integer DESIGN_FORM_URL_STATUS_PASSED = 1;
+
+    /**
+     * 表单设计器URL授权未通过
+     */
+    public static final Integer DESIGN_FORM_URL_STATUS_NOT_PASSED = 2;
+
+    /**
+     * 表单设计器新增 Flag
+     */
+    public static final String DESIGN_FORM_URL_TYPE_ADD = "add";
+    /**
+     * 表单设计器修改 Flag
+     */
+    public static final String DESIGN_FORM_URL_TYPE_EDIT = "edit";
+    /**
+     * 表单设计器详情 Flag
+     */
+    public static final String DESIGN_FORM_URL_TYPE_DETAIL = "detail";
+    /**
+     * 表单设计器复用数据 Flag
+     */
+    public static final String DESIGN_FORM_URL_TYPE_REUSE = "reuse";
+    /**
+     * 表单设计器编辑 Flag (已弃用)
+     */
+    public static final String DESIGN_FORM_URL_TYPE_VIEW = "view";
+
+    /**
+     * online参数值设置(是:Y, 否:N)
+     */
+    public static final String ONLINE_PARAM_VAL_IS_TURE = "Y";
+    public static final String ONLINE_PARAM_VAL_IS_FALSE = "N";
+
+    /**
+     * 文件上传类型(本地:local,Minio:minio,阿里云:alioss)
+     */
+    public static final String UPLOAD_TYPE_LOCAL = "local";
+    public static final String UPLOAD_TYPE_MINIO = "minio";
+    public static final String UPLOAD_TYPE_OSS = "alioss";
+
+    /**
+     * 文档上传自定义桶名称
+     */
+    public static final String UPLOAD_CUSTOM_BUCKET = "eoafile";
+    /**
+     * 文档上传自定义路径
+     */
+    public static final String UPLOAD_CUSTOM_PATH = "eoafile";
+    /**
+     * 文件外链接有效天数
+     */
+    public static final Integer UPLOAD_EFFECTIVE_DAYS = 1;
+
+    /**
+     * 员工身份 (1:普通员工  2:上级)
+     */
+    public static final Integer USER_IDENTITY_1 = 1;
+    public static final Integer USER_IDENTITY_2 = 2;
+
+    /** sys_user 表 username 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_USER_USERNAME = "uniq_sys_user_username";
+    /** sys_user 表 work_no 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_USER_WORK_NO = "uniq_sys_user_work_no";
+    /** sys_user 表 phone 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_USER_PHONE = "uniq_sys_user_phone";
+    /** sys_user 表 email 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_USER_EMAIL = "uniq_sys_user_email";
+    /** sys_quartz_job 表 job_class_name 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_JOB_CLASS_NAME = "uniq_job_class_name";
+    /** sys_position 表 code 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_CODE = "uniq_code";
+    /** sys_role 表 code 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_SYS_ROLE_CODE = "uniq_sys_role_role_code";
+    /** sys_depart 表 code 唯一键索引 */
+    public static final String SQL_INDEX_UNIQ_DEPART_ORG_CODE = "uniq_depart_org_code";
+    /**
+     * 在线聊天 是否为默认分组
+     */
+    public static final String IM_DEFAULT_GROUP = "1";
+    /**
+     * 在线聊天 图片文件保存路径
+     */
+    public static final String IM_UPLOAD_CUSTOM_PATH = "imfile";
+    /**
+     * 在线聊天 用户状态
+     */
+    public static final String IM_STATUS_ONLINE = "online";
+
+    /**
+     * 在线聊天 SOCKET消息类型
+     */
+    public static final String IM_SOCKET_TYPE = "chatMessage";
+
+    /**
+     * 在线聊天 是否开启默认添加好友 1是 0否
+     */
+    public static final String IM_DEFAULT_ADD_FRIEND = "1";
+
+    /**
+     * 在线聊天 用户好友缓存前缀
+     */
+    public static final String IM_PREFIX_USER_FRIEND_CACHE = "sys:cache:im:im_prefix_user_friend_";
+
+    /**
+     * 考勤补卡业务状态 (1:同意  2:不同意)
+     */
+    public static final String SIGN_PATCH_BIZ_STATUS_1 = "1";
+    public static final String SIGN_PATCH_BIZ_STATUS_2 = "2";
+
+    /**
+     * 公文文档上传自定义路径
+     */
+    public static final String UPLOAD_CUSTOM_PATH_OFFICIAL = "officialdoc";
+    /**
+     * 公文文档下载自定义路径
+     */
+    public static final String DOWNLOAD_CUSTOM_PATH_OFFICIAL = "officaldown";
+
+    /**
+     * WPS存储值类别(1 code文号 2 text(WPS模板还是公文发文模板))
+     */
+    public static final String WPS_TYPE_1="1";
+    public static final String WPS_TYPE_2="2";
+
+
+    public final static String X_ACCESS_TOKEN = "X-Access-Token";
+    public final static String X_SIGN = "X-Sign";
+    public final static String X_TIMESTAMP = "X-TIMESTAMP";
+    public final static String TOKEN_IS_INVALID_MSG = "Token失效,请重新登录!";
+
+    /**
+     * 多租户 请求头
+     */
+    public final static String TENANT_ID = "tenant-id";
+
+    /**
+     * 微服务读取配置文件属性 服务地址
+     */
+    public final static String CLOUD_SERVER_KEY = "spring.cloud.nacos.discovery.server-addr";
+
+    /**
+     * 第三方登录 验证密码/创建用户 都需要设置一个操作码 防止被恶意调用
+     */
+    public final static String THIRD_LOGIN_CODE = "third_login_code";
+
+    /**
+     * 第三方APP同步方向:本地 --> 第三方APP
+     */
+    String THIRD_SYNC_TO_APP = "SYNC_TO_APP";
+    /**
+     * 第三方APP同步方向:第三方APP --> 本地
+     */
+    String THIRD_SYNC_TO_LOCAL = "SYNC_TO_LOCAL";
+
+    /** 系统通告消息状态:0=未发布 */
+    String ANNOUNCEMENT_SEND_STATUS_0 = "0";
+    /** 系统通告消息状态:1=已发布 */
+    String ANNOUNCEMENT_SEND_STATUS_1 = "1";
+    /** 系统通告消息状态:2=已撤销 */
+    String ANNOUNCEMENT_SEND_STATUS_2 = "2";
+}

+ 151 - 0
yujing-common/src/main/java/com/cn/tianji/common/CommonUtils.java

@@ -0,0 +1,151 @@
+package com.cn.tianji.common;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.EnumUtils;
+
+import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+
+@Slf4j
+public class CommonUtils {
+    /**
+     * 计算时间差
+     * @param startTime 开始时间
+     * @param endTime 结束时间
+     * @return 秒
+     */
+    public static long timeDifference(Date startTime, Date endTime) {
+        return timeDifference_(startTime,endTime) / 1000;
+    }
+
+    /**
+     * 计算时间差
+     * @param startTime
+     * @param endTime
+     * @return 毫秒
+     */
+    public static long timeDifference_(Date startTime, Date endTime) {
+        return (endTime.getTime() - startTime.getTime()) ;
+    }
+
+
+    public static BigDecimal calculateAverage(List<BigDecimal> numbers) {
+        if (numbers == null || numbers.isEmpty()) {
+            throw new IllegalArgumentException("List of numbers cannot be null or empty.");
+        }
+
+        // 使用Stream API计算总和和元素数量
+        BigDecimal sum = numbers.stream()
+                .reduce(BigDecimal.ZERO, BigDecimal::add);
+        long count = numbers.size();
+
+        // 计算平均值
+        return sum.divide(new BigDecimal(count), 2, RoundingMode.HALF_UP);
+    }
+
+    /**
+     * 计算数组最大值最小值差值
+     * @param list
+     * @return
+     */
+    public static  BigDecimal calculateDifference(List<BigDecimal> list){
+        Optional<BigDecimal> maxOptional = list.stream().max(BigDecimal::compareTo);
+        Optional<BigDecimal> minOptional = list.stream().min(BigDecimal::compareTo);
+        BigDecimal difference=BigDecimal.ZERO;
+        if (maxOptional.isPresent() && minOptional.isPresent()) {
+            BigDecimal max = maxOptional.get();
+            BigDecimal min = minOptional.get();
+             difference = max.subtract(min);
+//            System.out.println("最大值: " + max);
+//            System.out.println("最小值: " + min);
+//            System.out.println("差值: " + difference);
+        } else {
+            System.out.println("列表为空或无法计算最大值/最小值");
+        }
+        return difference;
+    }
+    /**
+     * 去除时间字符串中的毫秒部分
+     *
+     * @param timeString 包含毫秒的时间字符串
+     * @return 去除毫秒后的时间字符串
+     */
+    public static String removeMilliseconds(String timeString) {
+        // 查找毫秒部分的起始位置(小数点)
+        int dotIndex = timeString.indexOf('.');
+
+        // 如果没有找到小数点,说明没有毫秒部分,直接返回原字符串
+        if (dotIndex == -1) {
+            return timeString;
+        }
+
+        // 毫秒部分的起始位置是小数点之后,所以返回小数点之前的子字符串
+        return timeString.substring(0, dotIndex);
+    }
+
+    /**
+     * 井表名转化井号
+     * @param jhTableName 井表名
+     * @return 井号
+     */
+    public static String getJh(String jhTableName){
+        String s = jhTableName.replace('_', '-').toUpperCase();
+        return s.replace("LTD-", "");
+    }
+
+    /**
+     * 井号转化井表名
+     * @param jh 井号
+     * @return 井表名
+     */
+    public static String getJhTableName(String jh){
+        String s = jh.replace('-', '_').toUpperCase();
+        return "LTD_" + s ;
+    }
+
+
+    /**
+     * 计算指定时间前/后时间
+     * @param startDate 开始时间
+     * @param type Calendar.HOUR/HOUR_OF_DAY/MINUTE/SECOND
+     * @param timeDiff
+     * @return
+     */
+    public static Date getSpecifiedTime(Date startDate,Integer type, Integer timeDiff){
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(startDate); // 设置Calendar的时间为指定时间
+//        Calendar.SECOND
+        // 在Calendar中减去10秒
+        calendar.add(type, timeDiff);
+        // 获取调整后的时间
+        return calendar.getTime();
+    }
+
+    /**
+     * 判断某个枚举是否包某个value值
+     * @param enumClass 需要判断是否存在那个枚举类中
+     * @param action 需要判断的值
+     * @return 包含返回true,否则返回false
+     */
+    public static boolean  diagnosisWarnAction(Class enumClass, String action){
+        List enumList = EnumUtils.getEnumList(enumClass);
+        for (int i = 0;i<enumList.size(); i++){
+            Object en = enumList.get(i);
+            Class<?> enClass = en.getClass();
+            try {
+                // 需要与枚举类方法对应
+                Method method = enClass.getMethod("getValue");
+                Object invoke = method.invoke(en, null);
+                if(Objects.equals(invoke.toString(), action)) {
+                    return true;
+                }
+            }catch (Exception e){
+                log.error("枚举执行getCode方法失败...");
+            }
+        }
+        return false;
+    }
+
+}

+ 46 - 0
yujing-common/src/main/java/com/cn/tianji/common/Constants.java

@@ -0,0 +1,46 @@
+package com.cn.tianji.common;
+
+import java.util.Locale;
+
+public class Constants {
+    /**
+     * UTF-8 字符集
+     */
+    public static final String UTF8 = "UTF-8";
+
+    /**
+     * GBK 字符集
+     */
+    public static final String GBK = "GBK";
+
+    /**
+     * 系统语言
+     */
+    public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE;
+
+    /**
+     * www主域
+     */
+    public static final String WWW = "www.";
+
+    /**
+     * http请求
+     */
+    public static final String HTTP = "http://";
+
+    /**
+     * https请求
+     */
+    public static final String HTTPS = "https://";
+
+    /**
+     * 通用成功标识
+     */
+    public static final String SUCCESS = "0";
+
+    /**
+     * 通用失败标识
+     */
+    public static final String FAIL = "1";
+
+}

+ 281 - 0
yujing-common/src/main/java/com/cn/tianji/common/HttpUtil.java

@@ -0,0 +1,281 @@
+package com.cn.tianji.common;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.*;
+import java.net.*;
+import java.nio.charset.StandardCharsets;
+import java.security.cert.X509Certificate;
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+@Slf4j
+public class HttpUtil {
+
+    /**
+     * 向指定 URL 发送GET方法的请求
+     *
+     * @param url 发送请求的 URL
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendGet(String url)
+    {
+        return sendGet(url, StringUtils.EMPTY);
+    }
+
+    /**
+     * 向指定 URL 发送GET方法的请求
+     *
+     * @param url 发送请求的 URL
+     * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendGet(String url, String param)
+    {
+        return sendGet(url, param, Constants.UTF8);
+    }
+
+    /**
+     * 向指定 URL 发送GET方法的请求
+     *
+     * @param url 发送请求的 URL
+     * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @param contentType 编码类型
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendGet(String url, String param, String contentType)
+    {
+        StringBuilder result = new StringBuilder();
+        BufferedReader in = null;
+        try
+        {
+            String urlNameString = StringUtils.isNotBlank(param) ? url + "?" + param : url;
+            log.info("sendGet - {}", urlNameString);
+            URL realUrl = new URL(urlNameString);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "*/*");
+            connection.setRequestProperty("connection", "Keep-Alive");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
+            connection.connect();
+            in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType));
+            String line;
+            while ((line = in.readLine()) != null)
+            {
+                result.append(line);
+            }
+            //log.info("recv - {}", result);
+        }
+        catch (ConnectException e)
+        {
+            log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
+        }
+        catch (SocketTimeoutException e)
+        {
+            log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e);
+        }
+        catch (IOException e)
+        {
+            log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e);
+        }
+        catch (Exception e)
+        {
+            log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e);
+        }
+        finally
+        {
+            try
+            {
+                if (in != null)
+                {
+                    in.close();
+                }
+            }
+            catch (Exception ex)
+            {
+                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
+            }
+        }
+        return result.toString();
+    }
+
+    /**
+     * 向指定 URL 发送POST方法的请求
+     *
+     * @param url 发送请求的 URL
+     * @param param 请求参数,请求参数应该是 "{\"key\":\"value\"}" 的形式。
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendPost(String url, String param)
+    {
+        PrintWriter out = null;
+        BufferedReader in = null;
+        StringBuilder result = new StringBuilder();
+        try
+        {
+            log.info("sendPost - {}", url);
+            URL realUrl = new URL(url);
+            HttpURLConnection conn = (HttpURLConnection) realUrl.openConnection();
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
+            conn.setRequestProperty("Accept-Charset", "utf-8");
+            conn.setRequestProperty("Content-Type", "application/json");
+            // 设置请求方法
+            conn.setRequestMethod("POST");
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            // 设置不使用缓存
+            conn.setUseCaches(false);
+            // 允许输出流写入数据
+            try (OutputStream os = conn.getOutputStream()) {
+                BufferedOutputStream bos = new BufferedOutputStream(os);
+                // 假设我们要发送的JSON数据
+                //"{\"key\":\"value\"}";
+                String jsonInputString = param;
+                // 写入数据
+                byte[] input = jsonInputString.getBytes("utf-8");
+                bos.write(input, 0, input.length);
+                // 刷新输出流
+                bos.flush();
+            }
+//            out = new PrintWriter(conn.getOutputStream());
+//            out.print(param);
+//            out.flush();
+            // 读取响应
+            int responseCode = conn.getResponseCode();
+            System.out.println("POST Response Code : " + responseCode);
+            if(responseCode == HttpURLConnection.HTTP_OK){
+                in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
+                String line;
+                while ((line = in.readLine()) != null)
+                {
+                    result.append(line);
+                }
+               // log.info("recv - {}", result);
+            }
+        }
+        catch (ConnectException e)
+        {
+            log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
+        }
+        catch (SocketTimeoutException e)
+        {
+            log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
+        }
+        catch (IOException e)
+        {
+            log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
+        }
+        catch (Exception e)
+        {
+            log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
+        }
+        finally
+        {
+            try
+            {
+                if (out != null)
+                {
+                    out.close();
+                }
+                if (in != null)
+                {
+                    in.close();
+                }
+            }
+            catch (IOException ex)
+            {
+                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
+            }
+        }
+        return result.toString();
+    }
+
+    public static String sendSSLPost(String url, String param)
+    {
+        StringBuilder result = new StringBuilder();
+        String urlNameString = url + "?" + param;
+        try
+        {
+            log.info("sendSSLPost - {}", urlNameString);
+            SSLContext sc = SSLContext.getInstance("SSL");
+            sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
+            URL console = new URL(urlNameString);
+            HttpsURLConnection conn = (HttpsURLConnection) console.openConnection();
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
+            conn.setRequestProperty("Accept-Charset", "utf-8");
+            conn.setRequestProperty("contentType", "utf-8");
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+
+            conn.setSSLSocketFactory(sc.getSocketFactory());
+            conn.setHostnameVerifier(new TrustAnyHostnameVerifier());
+            conn.connect();
+            InputStream is = conn.getInputStream();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is));
+            String ret = "";
+            while ((ret = br.readLine()) != null)
+            {
+                if (ret != null && !"".equals(ret.trim()))
+                {
+                    result.append(new String(ret.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8));
+                }
+            }
+            //log.info("recv - {}", result);
+            conn.disconnect();
+            br.close();
+        }
+        catch (ConnectException e)
+        {
+            log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e);
+        }
+        catch (SocketTimeoutException e)
+        {
+            log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e);
+        }
+        catch (IOException e)
+        {
+            log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e);
+        }
+        catch (Exception e)
+        {
+            log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e);
+        }
+        return result.toString();
+    }
+
+    private static class TrustAnyTrustManager implements X509TrustManager
+    {
+        @Override
+        public void checkClientTrusted(X509Certificate[] chain, String authType)
+        {
+        }
+
+        @Override
+        public void checkServerTrusted(X509Certificate[] chain, String authType)
+        {
+        }
+
+        @Override
+        public X509Certificate[] getAcceptedIssuers()
+        {
+            return new X509Certificate[] {};
+        }
+    }
+
+    private static class TrustAnyHostnameVerifier implements HostnameVerifier
+    {
+        @Override
+        public boolean verify(String hostname, SSLSession session)
+        {
+            return true;
+        }
+    }
+}

+ 548 - 0
yujing-common/src/main/java/com/cn/tianji/common/RedisUtil.java

@@ -0,0 +1,548 @@
+package com.cn.tianji.common;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+@Component
+public class RedisUtil {
+
+    @Resource
+    private RedisTemplate<String, Object> redisTemplate;
+    /**
+     * 指定缓存失效时间
+     *
+     * @param key  键
+     * @param time 时间(秒)
+     */
+    public boolean expire(String key, long time) {
+        try {
+            if (time > 0) {
+                redisTemplate.expire(key, time, TimeUnit.SECONDS);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 根据key 获取过期时间
+     *
+     * @param key 键 不能为null
+     * @return 时间(秒) 返回0代表为永久有效
+     */
+    public long getExpire(String key) {
+        return redisTemplate.getExpire(key, TimeUnit.SECONDS);
+    }
+
+    /**
+     * 判断key是否存在
+     *
+     * @param key 键
+     * @return true 存在 false不存在
+     */
+    public boolean hasKey(String key) {
+        try {
+            return redisTemplate.hasKey(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 删除缓存
+     *
+     * @param key 可以传一个值 或多个
+     */
+    @SuppressWarnings("unchecked")
+    public void del(String... key) {
+        if (key != null && key.length > 0) {
+            if (key.length == 1) {
+                redisTemplate.delete(key[0]);
+            } else {
+                redisTemplate.delete((Collection<String>) CollectionUtils.arrayToList(key));
+            }
+        }
+    }
+    // ============================String=============================
+
+    /**
+     * 普通缓存获取
+     *
+     * @param key 键
+     * @return 值
+     */
+    public Object get(String key) {
+        return key == null ? null : redisTemplate.opsForValue().get(key);
+    }
+
+    /**
+     * 普通缓存放入
+     *
+     * @param key   键
+     * @param value 值
+     * @return true成功 false失败
+     */
+    public boolean set(String key, Object value) {
+        try {
+
+            redisTemplate.opsForValue().set(key, value, 30,TimeUnit.MINUTES);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 普通缓存放入并设置时间
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒) time要大于0 如果time小于等于0 将设置无限期
+     * @return true成功 false 失败
+     */
+    public boolean set(String key, Object value, long time) {
+        try {
+            if (time > 0) {
+                redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
+            } else {
+                set(key, value);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 递增
+     *
+     * @param key   键
+     * @param delta 要增加几(大于0)
+     */
+    public long incr(String key, long delta) {
+        if (delta < 0) {
+            throw new RuntimeException("递增因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, delta);
+    }
+
+    /**
+     * 递减
+     *
+     * @param key   键
+     * @param delta 要减少几(小于0)
+     */
+    public long decr(String key, long delta) {
+        if (delta < 0) {
+            throw new RuntimeException("递减因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, -delta);
+    }
+    // ================================Map=================================
+
+    /**
+     * HashGet
+     *
+     * @param key  键 不能为null
+     * @param item 项 不能为null
+     */
+    public Object hget(String key, String item) {
+        return redisTemplate.opsForHash().get(key, item);
+    }
+
+    /**
+     * 获取hashKey对应的所有键值
+     *
+     * @param key 键
+     * @return 对应的多个键值
+     */
+    public Map<Object, Object> hmget(String key) {
+        return redisTemplate.opsForHash().entries(key);
+    }
+
+    /**
+     * HashSet
+     *
+     * @param key 键
+     * @param map 对应多个键值
+     */
+    public boolean hmset(String key, Map<String, Object> map) {
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * HashSet 并设置时间
+     *
+     * @param key  键
+     * @param map  对应多个键值
+     * @param time 时间(秒)
+     * @return true成功 false失败
+     */
+    public boolean hmset(String key, Map<String, Object> map, long time) {
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     *
+     * @param key   键
+     * @param item  项
+     * @param value 值
+     * @return true 成功 false失败
+     */
+    public boolean hset(String key, String item, Object value) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     *
+     * @param key   键
+     * @param item  项
+     * @param value 值
+     * @param time  时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
+     * @return true 成功 false失败
+     */
+    public boolean hset(String key, String item, Object value, long time) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 删除hash表中的值
+     *
+     * @param key  键 不能为null
+     * @param item 项 可以使多个 不能为null
+     */
+    public void hdel(String key, Object... item) {
+        redisTemplate.opsForHash().delete(key, item);
+    }
+
+    /**
+     * 判断hash表中是否有该项的值
+     *
+     * @param key  键 不能为null
+     * @param item 项 不能为null
+     * @return true 存在 false不存在
+     */
+    public boolean hHasKey(String key, String item) {
+        return redisTemplate.opsForHash().hasKey(key, item);
+    }
+
+    /**
+     * hash递增 如果不存在,就会创建一个 并把新增后的值返回
+     *
+     * @param key  键
+     * @param item 项
+     * @param by   要增加几(大于0)
+     */
+    public double hincr(String key, String item, double by) {
+        return redisTemplate.opsForHash().increment(key, item, by);
+    }
+
+    /**
+     * hash递减
+     *
+     * @param key  键
+     * @param item 项
+     * @param by   要减少记(小于0)
+     */
+    public double hdecr(String key, String item, double by) {
+        return redisTemplate.opsForHash().increment(key, item, -by);
+    }
+    // ============================set=============================
+
+    /**
+     * 根据key获取Set中的所有值
+     *
+     * @param key 键
+     */
+    public Set<Object> sGet(String key) {
+        try {
+            return redisTemplate.opsForSet().members(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 根据value从一个set中查询,是否存在
+     *
+     * @param key   键
+     * @param value 值
+     * @return true 存在 false不存在
+     */
+    public boolean sHasKey(String key, Object value) {
+        try {
+            return redisTemplate.opsForSet().isMember(key, value);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将数据放入set缓存
+     *
+     * @param key    键
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    public long sSet(String key, Object... values) {
+        try {
+            return redisTemplate.opsForSet().add(key, values);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 将set数据放入缓存
+     *
+     * @param key    键
+     * @param time   时间(秒)
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    public long sSetAndTime(String key, long time, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().add(key, values);
+            if (time > 0)
+                expire(key, time);
+            return count;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 获取set缓存的长度
+     *
+     * @param key 键
+     */
+    public long sGetSetSize(String key) {
+        try {
+            return redisTemplate.opsForSet().size(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 移除值为value的
+     *
+     * @param key    键
+     * @param values 值 可以是多个
+     * @return 移除的个数
+     */
+    public long setRemove(String key, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().remove(key, values);
+            return count;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+    // ===============================list=================================
+
+    /**
+     * 获取list缓存的内容
+     *
+     * @param key   键
+     * @param start 开始
+     * @param end   结束 0 到 -1代表所有值
+     */
+    public List<Object> lGet(String key, long start, long end) {
+        try {
+            return redisTemplate.opsForList().range(key, start, end);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 获取list缓存的长度
+     *
+     * @param key 键
+     */
+    public long lGetListSize(String key) {
+        try {
+            return redisTemplate.opsForList().size(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 通过索引 获取list中的值
+     *
+     * @param key   键
+     * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
+     */
+    public Object lGetIndex(String key, long index) {
+        try {
+            return redisTemplate.opsForList().index(key, index);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     */
+    public boolean lSet(String key, Object value) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     */
+    public boolean lSet(String key, Object value, long time) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            if (time > 0)
+                expire(key, time);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @return
+     */
+    public boolean lSet(String key, List<Object> value) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+    public boolean lSet(String key, List<Object> value, long time) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            if (time > 0)
+                expire(key, time);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 根据索引修改list中的某条数据
+     *
+     * @param key   键
+     * @param index 索引
+     * @param value 值
+     * @return
+     */
+    public boolean lUpdateIndex(String key, long index, Object value) {
+        try {
+            redisTemplate.opsForList().set(key, index, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 移除N个值为value
+     *
+     * @param key   键
+     * @param count 移除多少个
+     * @param value 值
+     * @return 移除的个数
+     */
+    public long lRemove(String key, long count, Object value) {
+        try {
+            Long remove = redisTemplate.opsForList().remove(key, count, value);
+            return remove;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+}

+ 182 - 0
yujing-common/src/main/java/com/cn/tianji/common/Result.java

@@ -0,0 +1,182 @@
+package com.cn.tianji.common;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *   接口返回数据格式
+ * @author zrj
+ */
+@Data
+public class Result<T> implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 数据total
+     */
+//	@ApiModelProperty(value = "数据total")
+    private Integer total = 0;
+    /**
+     * 成功标志
+     */
+//	@ApiModelProperty(value = "成功标志")
+    private boolean success = true;
+
+    /**
+     * 返回处理消息
+     */
+//	@ApiModelProperty(value = "返回处理消息")
+    private String message = "";
+
+    /**
+     * 返回代码
+     */
+//	@ApiModelProperty(value = "返回代码")
+    private Integer code = 0;
+
+    /**
+     * 返回数据对象 data
+     */
+//	@ApiModelProperty(value = "返回数据对象")
+    private T result;
+
+    /**
+     * 时间戳
+     */
+//	@ApiModelProperty(value = "时间戳")
+    private long timestamp = System.currentTimeMillis();
+
+    public Result() {
+    }
+
+    /**
+     * 兼容VUE3版token失效不跳转登录页面
+     * @param code
+     * @param message
+     */
+    public Result(Integer code,String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public Result<T> success(String message) {
+        this.message = message;
+        this.code = CommonConstant.SC_OK_200;
+        this.success = true;
+        return this;
+    }
+
+    @Deprecated
+    public static Result<Object> ok() {
+        Result<Object> r = new Result<Object>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        return r;
+    }
+
+    @Deprecated
+    public static Result<Object> ok(String msg) {
+        Result<Object> r = new Result<Object>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setMessage(msg);
+        return r;
+    }
+
+    @Deprecated
+    public static Result<Object> ok(Object data) {
+        Result<Object> r = new Result<Object>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setResult(data);
+        return r;
+    }
+
+    public static<T> Result<T> OK() {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        return r;
+    }
+
+    public static<T> Result<T> OK(String msg) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setMessage(msg);
+        //Result OK(String msg)方法会造成兼容性问题 issues/I4IP3D
+        r.setResult((T) msg);
+        return r;
+    }
+
+    public static void total(Integer total) {
+        Result r = new Result();
+        r.setTotal(total);
+    }
+
+    public static<T> Result<T> OKH(T data,Integer total) {
+        Result<T> r = new Result<T>();
+        r.setTotal(total);
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setResult(data);
+        return r;
+    }
+
+    public static<T> Result<T> OK(T data) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setResult(data);
+        return r;
+    }
+
+    public static<T> Result<T> OK(String msg, T data) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(true);
+        r.setCode(CommonConstant.SC_OK_200);
+        r.setMessage(msg);
+        r.setResult(data);
+        return r;
+    }
+
+    public static<T> Result<T> error(String msg, T data) {
+        Result<T> r = new Result<T>();
+        r.setSuccess(false);
+        r.setCode(CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
+        r.setMessage(msg);
+        r.setResult(data);
+        return r;
+    }
+
+    public static Result<Object> error(String msg) {
+        return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
+    }
+
+    public static Result<Object> error(int code, String msg) {
+        Result<Object> r = new Result<Object>();
+        r.setCode(code);
+        r.setMessage(msg);
+        r.setSuccess(false);
+        return r;
+    }
+
+    public Result<T> error500(String message) {
+        this.message = message;
+        this.code = CommonConstant.SC_INTERNAL_SERVER_ERROR_500;
+        this.success = false;
+        return this;
+    }
+    /**
+     * 无权限访问返回结果
+     */
+    public static Result<Object> noauth(String msg) {
+        return error(CommonConstant.SC_JEECG_NO_AUTHZ, msg);
+    }
+
+    @JsonIgnore
+    private String onlTable;
+}

+ 83 - 0
yujing-common/src/main/java/com/cn/tianji/common/ResultInfo.java

@@ -0,0 +1,83 @@
+package com.cn.tianji.common;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class ResultInfo  implements Serializable {
+    // 状态码
+    private Integer code;
+    // 消息
+    private String message;
+    // 数据对象
+    private Object result;
+
+    private Integer total;
+
+
+    /**
+     * 无参构造器
+     */
+    public ResultInfo() {
+        super();
+    }
+
+    public ResultInfo(Status status) {
+        super();
+        this.code = status.code;
+        this.message = status.message;
+    }
+
+    public ResultInfo result(Object result) {
+        this.result = result;
+        return this;
+    }
+
+    public ResultInfo message(String message) {
+        this.message = message;
+        return this;
+    }
+    public ResultInfo total(Integer total) {
+        this.total = total;
+        return this;
+    }
+
+    /**
+     * 只返回状态,状态码,消息
+     *
+     * @param code
+     * @param message
+     */
+    public ResultInfo(Integer code, String message) {
+        super();
+        this.code = code;
+        this.message = message;
+    }
+
+    /**
+     * 只返回状态,状态码,数据对象
+     *
+     * @param code
+     * @param result
+     */
+    public ResultInfo(Integer code, Object result) {
+        super();
+        this.code = code;
+        this.result = result;
+    }
+
+    /**
+     * 返回全部信息即状态,状态码,消息,数据对象
+     *
+     * @param code
+     * @param message
+     * @param result
+     */
+    public ResultInfo(Integer code, String message, Object result) {
+        super();
+        this.code = code;
+        this.message = message;
+        this.result = result;
+    }
+}

+ 34 - 0
yujing-common/src/main/java/com/cn/tianji/common/Status.java

@@ -0,0 +1,34 @@
+package com.cn.tianji.common;
+
+/**
+ * 枚举类对象
+ * @author Zhao RenJi
+ */
+public enum Status {
+    SUCCESS(2000, "成功"),
+    UNKNOWN_ERROR(9998,"未知异常"),
+    SYSTEM_ERROR(9999, "系统异常"),
+
+
+    INSUFFICIENT_PERMISSION(4003, "权限不足"),
+
+    WARN(9000, "失败"),
+    REQUEST_PARAMETER_ERROR(1002, "请求参数错误"),
+
+    // 登录
+    LOGIN_EXPIRE(2001, "未登录或者登录失效"),
+    LOGIN_CODE_ERROR(2002, "登录验证码错误"),
+    LOGIN_ERROR(2003, "用户名不存在或密码错误"),
+    LOGIN_USER_STATUS_ERROR(2004, "用户状态不正确"),
+    LOGOUT_ERROR(2005, "退出失败,token不存在"),
+    LOGIN_USER_NOT_EXIST(2006, "该用户不存在"),
+    LOGIN_USER_EXIST(2007, "该用户已存在");
+
+    public int code;
+    public String message;
+
+    Status(int code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+}

+ 655 - 0
yujing-common/src/main/java/com/cn/tianji/common/StringUtils.java

@@ -0,0 +1,655 @@
+package com.cn.tianji.common;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.springframework.util.AntPathMatcher;
+
+public class StringUtils extends org.apache.commons.lang3.StringUtils{
+    /** 空字符串 */
+    private static final String NULLSTR = "";
+
+    /** 下划线 */
+    private static final char SEPARATOR = '_';
+
+    /** 星号 */
+    private static final char ASTERISK = '*';
+
+    /**
+     * 获取参数不为空值
+     *
+     * @param value defaultValue 要判断的value
+     * @return value 返回值
+     */
+    public static <T> T nvl(T value, T defaultValue)
+    {
+        return value != null ? value : defaultValue;
+    }
+
+    /**
+     * * 判断一个Collection是否为空, 包含List,Set,Queue
+     *
+     * @param coll 要判断的Collection
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Collection<?> coll)
+    {
+        return isNull(coll) || coll.isEmpty();
+    }
+
+    /**
+     * * 判断一个Collection是否非空,包含List,Set,Queue
+     *
+     * @param coll 要判断的Collection
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Collection<?> coll)
+    {
+        return !isEmpty(coll);
+    }
+
+    /**
+     * * 判断一个对象数组是否为空
+     *
+     * @param objects 要判断的对象数组
+     ** @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Object[] objects)
+    {
+        return isNull(objects) || (objects.length == 0);
+    }
+
+    /**
+     * * 判断一个对象数组是否非空
+     *
+     * @param objects 要判断的对象数组
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Object[] objects)
+    {
+        return !isEmpty(objects);
+    }
+
+    /**
+     * * 判断一个Map是否为空
+     *
+     * @param map 要判断的Map
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(Map<?, ?> map)
+    {
+        return isNull(map) || map.isEmpty();
+    }
+
+    /**
+     * * 判断一个Map是否为空
+     *
+     * @param map 要判断的Map
+     * @return true:非空 false:空
+     */
+    public static boolean isNotEmpty(Map<?, ?> map)
+    {
+        return !isEmpty(map);
+    }
+
+    /**
+     * * 判断一个字符串是否为空串
+     *
+     * @param str String
+     * @return true:为空 false:非空
+     */
+    public static boolean isEmpty(String str)
+    {
+        return isNull(str) || NULLSTR.equals(str.trim());
+    }
+
+    /**
+     * * 判断一个字符串是否为非空串
+     *
+     * @param str String
+     * @return true:非空串 false:空串
+     */
+    public static boolean isNotEmpty(String str)
+    {
+        return !isEmpty(str);
+    }
+
+    /**
+     * * 判断一个对象是否为空
+     *
+     * @param object Object
+     * @return true:为空 false:非空
+     */
+    public static boolean isNull(Object object)
+    {
+        return object == null;
+    }
+
+    /**
+     * * 判断一个对象是否非空
+     *
+     * @param object Object
+     * @return true:非空 false:空
+     */
+    public static boolean isNotNull(Object object)
+    {
+        return !isNull(object);
+    }
+
+    /**
+     * * 判断一个对象是否是数组类型(Java基本型别的数组)
+     *
+     * @param object 对象
+     * @return true:是数组 false:不是数组
+     */
+    public static boolean isArray(Object object)
+    {
+        return isNotNull(object) && object.getClass().isArray();
+    }
+
+    /**
+     * 去空格
+     */
+    public static String trim(String str)
+    {
+        return (str == null ? "" : str.trim());
+    }
+
+    /**
+     * 替换指定字符串的指定区间内字符为"*"
+     *
+     * @param str 字符串
+     * @param startInclude 开始位置(包含)
+     * @param endExclude 结束位置(不包含)
+     * @return 替换后的字符串
+     */
+    public static String hide(CharSequence str, int startInclude, int endExclude)
+    {
+        if (isEmpty(str))
+        {
+            return NULLSTR;
+        }
+        final int strLength = str.length();
+        if (startInclude > strLength)
+        {
+            return NULLSTR;
+        }
+        if (endExclude > strLength)
+        {
+            endExclude = strLength;
+        }
+        if (startInclude > endExclude)
+        {
+            // 如果起始位置大于结束位置,不替换
+            return NULLSTR;
+        }
+        final char[] chars = new char[strLength];
+        for (int i = 0; i < strLength; i++)
+        {
+            if (i >= startInclude && i < endExclude)
+            {
+                chars[i] = ASTERISK;
+            }
+            else
+            {
+                chars[i] = str.charAt(i);
+            }
+        }
+        return new String(chars);
+    }
+
+    /**
+     * 截取字符串
+     *
+     * @param str 字符串
+     * @param start 开始
+     * @return 结果
+     */
+    public static String substring(final String str, int start)
+    {
+        if (str == null)
+        {
+            return NULLSTR;
+        }
+
+        if (start < 0)
+        {
+            start = str.length() + start;
+        }
+
+        if (start < 0)
+        {
+            start = 0;
+        }
+        if (start > str.length())
+        {
+            return NULLSTR;
+        }
+
+        return str.substring(start);
+    }
+
+    /**
+     * 截取字符串
+     *
+     * @param str 字符串
+     * @param start 开始
+     * @param end 结束
+     * @return 结果
+     */
+    public static String substring(final String str, int start, int end)
+    {
+        if (str == null)
+        {
+            return NULLSTR;
+        }
+
+        if (end < 0)
+        {
+            end = str.length() + end;
+        }
+        if (start < 0)
+        {
+            start = str.length() + start;
+        }
+
+        if (end > str.length())
+        {
+            end = str.length();
+        }
+
+        if (start > end)
+        {
+            return NULLSTR;
+        }
+
+        if (start < 0)
+        {
+            start = 0;
+        }
+        if (end < 0)
+        {
+            end = 0;
+        }
+
+        return str.substring(start, end);
+    }
+
+    /**
+     * 判断是否为空,并且不是空白字符
+     *
+     * @param str 要判断的value
+     * @return 结果
+     */
+    public static boolean hasText(String str)
+    {
+        return (str != null && !str.isEmpty() && containsText(str));
+    }
+
+    private static boolean containsText(CharSequence str)
+    {
+        int strLen = str.length();
+        for (int i = 0; i < strLen; i++)
+        {
+            if (!Character.isWhitespace(str.charAt(i)))
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+
+    /**
+     * 是否为http(s)://开头
+     *
+     * @param link 链接
+     * @return 结果
+     */
+    public static boolean ishttp(String link)
+    {
+        return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);
+    }
+
+    /**
+     * 字符串转set
+     *
+     * @param str 字符串
+     * @param sep 分隔符
+     * @return set集合
+     */
+    public static final Set<String> str2Set(String str, String sep)
+    {
+        return new HashSet<String>(str2List(str, sep, true, false));
+    }
+
+    /**
+     * 字符串转list
+     *
+     * @param str 字符串
+     * @param sep 分隔符
+     * @param filterBlank 过滤纯空白
+     * @param trim 去掉首尾空白
+     * @return list集合
+     */
+    public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim)
+    {
+        List<String> list = new ArrayList<String>();
+        if (StringUtils.isEmpty(str))
+        {
+            return list;
+        }
+
+        // 过滤空白字符串
+        if (filterBlank && StringUtils.isBlank(str))
+        {
+            return list;
+        }
+        String[] split = str.split(sep);
+        for (String string : split)
+        {
+            if (filterBlank && StringUtils.isBlank(string))
+            {
+                continue;
+            }
+            if (trim)
+            {
+                string = string.trim();
+            }
+            list.add(string);
+        }
+
+        return list;
+    }
+
+    /**
+     * 判断给定的collection列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value
+     *
+     * @param collection 给定的集合
+     * @param array 给定的数组
+     * @return boolean 结果
+     */
+    public static boolean containsAny(Collection<String> collection, String... array)
+    {
+        if (isEmpty(collection) || isEmpty(array))
+        {
+            return false;
+        }
+        else
+        {
+            for (String str : array)
+            {
+                if (collection.contains(str))
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+    }
+
+    /**
+     * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写
+     *
+     * @param cs 指定字符串
+     * @param searchCharSequences 需要检查的字符串数组
+     * @return 是否包含任意一个字符串
+     */
+    public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences)
+    {
+        if (isEmpty(cs) || isEmpty(searchCharSequences))
+        {
+            return false;
+        }
+        for (CharSequence testStr : searchCharSequences)
+        {
+            if (containsIgnoreCase(cs, testStr))
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 驼峰转下划线命名
+     */
+    public static String toUnderScoreCase(String str)
+    {
+        if (str == null)
+        {
+            return null;
+        }
+        StringBuilder sb = new StringBuilder();
+        // 前置字符是否大写
+        boolean preCharIsUpperCase = true;
+        // 当前字符是否大写
+        boolean curreCharIsUpperCase = true;
+        // 下一字符是否大写
+        boolean nexteCharIsUpperCase = true;
+        for (int i = 0; i < str.length(); i++)
+        {
+            char c = str.charAt(i);
+            if (i > 0)
+            {
+                preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
+            }
+            else
+            {
+                preCharIsUpperCase = false;
+            }
+
+            curreCharIsUpperCase = Character.isUpperCase(c);
+
+            if (i < (str.length() - 1))
+            {
+                nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
+            }
+
+            if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase)
+            {
+                sb.append(SEPARATOR);
+            }
+            else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase)
+            {
+                sb.append(SEPARATOR);
+            }
+            sb.append(Character.toLowerCase(c));
+        }
+
+        return sb.toString();
+    }
+
+    /**
+     * 是否包含字符串
+     *
+     * @param str 验证字符串
+     * @param strs 字符串组
+     * @return 包含返回true
+     */
+    public static boolean inStringIgnoreCase(String str, String... strs)
+    {
+        if (str != null && strs != null)
+        {
+            for (String s : strs)
+            {
+                if (str.equalsIgnoreCase(trim(s)))
+                {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
+     *
+     * @param name 转换前的下划线大写方式命名的字符串
+     * @return 转换后的驼峰式命名的字符串
+     */
+    public static String convertToCamelCase(String name)
+    {
+        StringBuilder result = new StringBuilder();
+        // 快速检查
+        if (name == null || name.isEmpty())
+        {
+            // 没必要转换
+            return "";
+        }
+        else if (!name.contains("_"))
+        {
+            // 不含下划线,仅将首字母大写
+            return name.substring(0, 1).toUpperCase() + name.substring(1);
+        }
+        // 用下划线将原始字符串分割
+        String[] camels = name.split("_");
+        for (String camel : camels)
+        {
+            // 跳过原始字符串中开头、结尾的下换线或双重下划线
+            if (camel.isEmpty())
+            {
+                continue;
+            }
+            // 首字母大写
+            result.append(camel.substring(0, 1).toUpperCase());
+            result.append(camel.substring(1).toLowerCase());
+        }
+        return result.toString();
+    }
+
+    /**
+     * 驼峰式命名法
+     * 例如:user_name->userName
+     */
+    public static String toCamelCase(String s)
+    {
+        if (s == null)
+        {
+            return null;
+        }
+        if (s.indexOf(SEPARATOR) == -1)
+        {
+            return s;
+        }
+        s = s.toLowerCase();
+        StringBuilder sb = new StringBuilder(s.length());
+        boolean upperCase = false;
+        for (int i = 0; i < s.length(); i++)
+        {
+            char c = s.charAt(i);
+
+            if (c == SEPARATOR)
+            {
+                upperCase = true;
+            }
+            else if (upperCase)
+            {
+                sb.append(Character.toUpperCase(c));
+                upperCase = false;
+            }
+            else
+            {
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
+     *
+     * @param str 指定字符串
+     * @param strs 需要检查的字符串数组
+     * @return 是否匹配
+     */
+    public static boolean matches(String str, List<String> strs)
+    {
+        if (isEmpty(str) || isEmpty(strs))
+        {
+            return false;
+        }
+        for (String pattern : strs)
+        {
+            if (isMatch(pattern, str))
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 判断url是否与规则配置:
+     * ? 表示单个字符;
+     * * 表示一层路径内的任意字符串,不可跨层级;
+     * ** 表示任意层路径;
+     *
+     * @param pattern 匹配规则
+     * @param url 需要匹配的url
+     * @return
+     */
+    public static boolean isMatch(String pattern, String url)
+    {
+        AntPathMatcher matcher = new AntPathMatcher();
+        return matcher.match(pattern, url);
+    }
+
+    @SuppressWarnings("unchecked")
+    public static <T> T cast(Object obj)
+    {
+        return (T) obj;
+    }
+
+    /**
+     * 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。
+     *
+     * @param num 数字对象
+     * @param size 字符串指定长度
+     * @return 返回数字的字符串格式,该字符串为指定长度。
+     */
+    public static final String padl(final Number num, final int size)
+    {
+        return padl(num.toString(), size, '0');
+    }
+
+    /**
+     * 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。
+     *
+     * @param s 原始字符串
+     * @param size 字符串指定长度
+     * @param c 用于补齐的字符
+     * @return 返回指定长度的字符串,由原字符串左补齐或截取得到。
+     */
+    public static final String padl(final String s, final int size, final char c)
+    {
+        final StringBuilder sb = new StringBuilder(size);
+        if (s != null)
+        {
+            final int len = s.length();
+            if (s.length() <= size)
+            {
+                for (int i = size - len; i > 0; i--)
+                {
+                    sb.append(c);
+                }
+                sb.append(s);
+            }
+            else
+            {
+                return s.substring(len - size, len);
+            }
+        }
+        else
+        {
+            for (int i = size; i > 0; i--)
+            {
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+}

+ 21 - 0
yujing-common/src/main/java/com/cn/tianji/config/ConfigBean.java

@@ -0,0 +1,21 @@
+package com.cn.tianji.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ *
+ * @ClassName: Configbean
+ * @Description:
+ * @author: zrj
+ * @date: 2021-07-21 15:40
+ */
+@Configuration
+public class ConfigBean { //@Configuration 相当于 spring中的 application.xml
+
+    @Bean
+    RestTemplate restTemplate(){
+        return new RestTemplate();
+    }
+}

+ 24 - 0
yujing-common/src/main/java/com/cn/tianji/config/MyBatisPlusConfig.java

@@ -0,0 +1,24 @@
+package com.cn.tianji.config;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @author Zhao RenJi
+ */
+@Configuration
+//扫描mapper接口所在的包
+@MapperScan("com.cn.tianji.mapper")
+public class MyBatisPlusConfig {
+    @Bean
+    public MybatisPlusInterceptor mybatisPlusInterceptor(){
+        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+        //添加分页插件
+        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
+        return interceptor;
+    }
+}

+ 44 - 0
yujing-common/src/main/java/com/cn/tianji/config/RedisConfig.java

@@ -0,0 +1,44 @@
+package com.cn.tianji.config;
+
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+/**
+ * redis配置
+ */
+@Configuration
+@EnableCaching
+public class RedisConfig {
+    @Bean
+    @SuppressWarnings("all")
+    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
+
+        RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
+        template.setConnectionFactory(factory);
+        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+        ObjectMapper om = new ObjectMapper();
+        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+        jackson2JsonRedisSerializer.setObjectMapper(om);
+        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+        // key采用String的序列化方式
+        template.setKeySerializer(stringRedisSerializer);
+        // hash的key也采用String的序列化方式
+        template.setHashKeySerializer(stringRedisSerializer);
+        // value序列化方式采用jackson
+        template.setValueSerializer(jackson2JsonRedisSerializer);
+        // hash的value序列化方式采用jackson
+        template.setHashValueSerializer(jackson2JsonRedisSerializer);
+        template.afterPropertiesSet();
+        return template;
+    }
+}

+ 31 - 0
yujing-common/src/main/java/com/cn/tianji/config/RocketMqConfig.java

@@ -0,0 +1,31 @@
+//package com.cn.tianji.config;
+//
+//import com.aliyun.openservices.ons.api.PropertyKeyConst;
+//import lombok.Data;
+//import org.springframework.boot.context.properties.ConfigurationProperties;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//
+//import java.util.Properties;
+//
+//@Data
+//@Configuration
+//@ConfigurationProperties(prefix = "rocketmq")
+//public class RocketMqConfig {
+//
+//    private String nameServer;
+//
+//    private String accessKey;
+//
+//    private String secretKey;
+//
+//    @Bean
+//    public Properties build() {
+//        Properties properties = new Properties();
+//        properties.setProperty(PropertyKeyConst.AccessKey, accessKey);
+//        properties.setProperty(PropertyKeyConst.SecretKey, secretKey);
+//        properties.setProperty(PropertyKeyConst.NAMESRV_ADDR, nameServer);
+//        return properties;
+//    }
+//
+//}

+ 69 - 0
yujing-common/src/main/java/com/cn/tianji/entity/Ajh.java

@@ -0,0 +1,69 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+@TableName("a_jh")
+public class Ajh implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @TableField(value = "ID")
+    private String ID;
+    @TableField(value = "DH")
+    private String DH;
+    @TableField(value = "ZJY")
+    private int zjy;
+    @TableField(value = "SGYQ")
+    private String SGYQ;
+    @TableField(value = "SJDW")
+    private String SJDW;
+    @TableField(value = "KZRQ")
+    private String KZRQ;
+    @TableField(value = "ZJYDAY")
+    private String zjyDay;
+    @TableField(value = "DT")
+    private String DT;
+    @TableField(value = "EJDW")
+    private String EJDW;
+    @TableField(value = "JJRQ")
+    private String JJRQ;
+    @TableField(value = "LTD")
+    private int ltd;
+    @TableField(value = "LTDDAY")
+    private String ltdDay;
+    @TableField(value = "JH")
+    private String JH;
+    @TableField(value = "FOCUS")
+    private String FOCUS;
+
+    @TableField(value = "JFDW")
+    private String JFDW;
+    @TableField(value = "SGDD")
+    private String SGDD;
+    @TableField(value = "JB")
+    private String JB;
+    @TableField(value = "JX")
+    private String JX;
+    @TableField(value = "NOTFOUND")
+    private String NOTFOUND;
+    @TableField(value = "DSSJ")
+    private String DSSJ;
+    @TableField(value = "SJJS")
+    private String SJJS;
+
+    @TableField(value = "WARNTIME")
+    private String WARNTIME;
+
+    @TableField(value = "WARNCOUNT")
+    private BigDecimal WARNCOUNT;
+
+    @TableField(value = "IS_WARN")
+    private String isWarn;
+}

+ 59 - 0
yujing-common/src/main/java/com/cn/tianji/entity/ComprehensiveLog.java

@@ -0,0 +1,59 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@TableName("comprehensive_log")
+@Data
+public class ComprehensiveLog implements Serializable, Cloneable {
+
+    /**
+     * 主键
+     */
+    @TableId
+    private String id;
+    /**
+     * 井号
+     */
+    private String jh;
+    /**
+     * 预警时间
+     */
+    private String warnTime;
+    /**
+     * 预警类别:卡钻、溢流、井漏
+     */
+    private String warnType;
+    /**
+     * 预警内容
+     */
+    private String warnContent;
+    /**
+     * 预警级别
+     */
+    private BigDecimal warnLevel;
+    /**
+     * 预警主键
+     */
+    private String warnIds;
+    /**
+     * 预警点工况
+     */
+    private String workingCondition;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+}

+ 180 - 0
yujing-common/src/main/java/com/cn/tianji/entity/HookLoadWarnLog.java

@@ -0,0 +1,180 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 钩载预警数据表;
+ *
+ * @author : http://www.chiner.pro
+ * @date : 2024-5-29
+ */
+@TableName("HOOK_LOAD_WARN_LOG")
+@Data
+public class HookLoadWarnLog implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 主键
+     */
+    @TableId
+    private String id;
+
+    /**
+     * 井号
+     */
+    private String jh;
+
+    /**
+     * 预警点动作
+     */
+    private String motion;
+
+    /**
+     * 预警点工况
+     */
+    private String workingCondition;
+
+    /**
+     * 预警点工况类别:起钻、下钻、起钻——活动钻具、下钻-活动钻具、钻进活动钻具
+     */
+    private String workingConditionType;
+
+    /**
+     * 预警点时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date warnTime;
+
+    /**
+     * 预警点钩载
+     */
+    private BigDecimal warnWoh;
+
+    /**
+     * 预警点大钩高度
+     */
+    private BigDecimal warnHkh;
+
+    /**
+     * 预警点钻头位置
+     */
+    private BigDecimal warnBitdepth;
+
+    /**
+     * 活动钻具钩载
+     */
+    private BigDecimal mobilDrillingToolsWoh;
+
+    /**
+     * 活动钻具起点时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date mobilDrillingToolsStartTime;
+
+    /**
+     * 活动钻具结束时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date mobilDrillingToolsEndTime;
+
+    /**
+     * 活动钻具最大值
+     */
+    private BigDecimal mobilDrillingToolsMaxWoh;
+
+    /**
+     * 活动钻具最小值
+     */
+    private BigDecimal mobilDrillingToolsMinWoh;
+
+    /**
+     * 参考值起点时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date referenceStartTime;
+
+    /**
+     * 参考值结束时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date referenceEndTime;
+
+    /**
+     * 参考柱钩载最大值
+     */
+    private BigDecimal referenceMaxWoh;
+
+    /**
+     * 参考柱钩载最小值
+     */
+    private BigDecimal referenceMinWoh;
+
+    /**
+     * 参考柱钩载值
+     */
+    private BigDecimal referenceWoh;
+
+    /**
+     * 钻杆重量
+     */
+    private BigDecimal columnWeight;
+
+    /**
+     * 预警阈值
+     */
+    private BigDecimal warnValue;
+
+    /**
+     * 描述
+     */
+    private String warnDes;
+
+
+    /**
+     * 备注
+     */
+    private String remake;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+
+    /**
+     * 活动钻具大钩起点位置
+     */
+    private BigDecimal hkhStart;
+
+    /**
+     * 活动钻具大钩结束位置
+     */
+    private BigDecimal hkhEnd;
+
+    /**
+     * 钻头位置差值
+     */
+    private BigDecimal hkhSub;
+
+    /**
+     * 钩载波动值除以钻头位置差值
+     */
+    private BigDecimal hkhWoh;
+}

+ 79 - 0
yujing-common/src/main/java/com/cn/tianji/entity/OperatingConditionThreshold.java

@@ -0,0 +1,79 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author Zhao RenJi
+ */
+@Data
+public class OperatingConditionThreshold implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 任务ID */
+    @TableId("id")
+    private String id;
+
+    /**
+     * 井号
+     */
+    private String jh;
+
+    /**
+     * 到达地面阈值
+     * (可编辑)
+     */
+    private BigDecimal approachingSurface;
+
+    /**
+     * 坐卡阈值
+     * (可编辑)
+     */
+    private BigDecimal woh;
+
+    /**
+     * 在井底阈值
+     * (可编辑)
+     */
+    private BigDecimal onBottom;
+
+    /**
+     * 停转阈值
+     */
+    private BigDecimal isRotationOff;
+
+    /**
+     * 游车静止阈值
+     */
+    private BigDecimal blockldle;
+
+    /**
+     * 停泵阈值
+     */
+    private BigDecimal noFlow;
+
+    /**
+     * 立压为0阈值
+     * (可编辑)
+     */
+    private BigDecimal pressureZero;
+
+    /**
+     * 钻头上行阈值
+     */
+    private BigDecimal bitMovingUp;
+
+    /**
+     * 游车上行阈值
+     */
+    private BigDecimal blockMovingUp;
+
+    /**
+     * 离开井底阈值
+     */
+    private BigDecimal farBottom;
+}

+ 98 - 0
yujing-common/src/main/java/com/cn/tianji/entity/PumpingPressureWarnLog.java

@@ -0,0 +1,98 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 泵压预警数据;
+ *
+ * @author : http://www.chiner.pro
+ * @date : 2024-6-6
+ */
+@TableName("PUMPING_PRESSURE_WARN_LOG")
+@Data
+public class PumpingPressureWarnLog implements Serializable {
+
+    @TableId
+    private String id;
+    /**
+     * 井号
+     */
+    private String jh;
+    /**
+     * 预警点动作
+     */
+    private String motion;
+    /**
+     * 预警点工况
+     */
+    private String workingCondition;
+    /**
+     * 预警点时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date warnTime;
+    /**
+     * 预警点立管压力
+     */
+    private BigDecimal warnSpp;
+    /**
+     * 预警点总泵冲
+     */
+    private BigDecimal warnTotalPump;
+    /**
+     * 预警点时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date referenceTime;
+    /**
+     * 参考点立管压力
+     */
+    private BigDecimal referenceSpp;
+    /**
+     * 参考点总泵冲
+     */
+    private BigDecimal referenceTotalPump;
+    /**
+     * 立管压力阈值
+     */
+    private BigDecimal sppWarnValue;
+    /**
+     * 总泵冲阈值
+     */
+    private BigDecimal pumpWarnValue;
+
+    /**
+     * 泵冲差值
+     */
+    private BigDecimal totalPumpSub;
+    /**
+     * 立管压力差值
+     */
+    private BigDecimal sppSub;
+
+    /**
+     * 预警描述
+     */
+    private String warnDes;
+
+    /**
+     * 数据类别:0:起点 1结束点
+     */
+    private String dataType;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+}

+ 39 - 0
yujing-common/src/main/java/com/cn/tianji/entity/SyncRecord.java

@@ -0,0 +1,39 @@
+package com.cn.tianji.entity;
+
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@Accessors(chain = true)
+@TableName("sync_record")
+public class SyncRecord implements Serializable {
+
+    private static final long serialVersionUID = 3623141357792435967L;
+
+    @TableId
+    private String id;
+
+    @TableField("TABLE_NAME")
+    private String tableName;
+
+    @TableField("COLLECT_TIME")
+    private String collectTime;
+
+    private String working;
+
+    @TableField("TABLE_TYPE")
+    private String tableType;
+
+
+    @TableField(exist = false)
+    private String startTime;
+
+    @TableField(exist = false)
+    private String endTime;
+}

+ 132 - 0
yujing-common/src/main/java/com/cn/tianji/entity/TorqueWarnLog.java

@@ -0,0 +1,132 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 扭矩预警日志表;
+ *
+ * @author : http://www.chiner.pro
+ * @date : 2024-6-13
+ */
+@TableName("TORQUE_WARN_LOG")
+@Data
+public class TorqueWarnLog implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId
+    private String id;
+    /**
+     * 井号
+     */
+    private String jh;
+    /**
+     * 预警点动作
+     */
+    private String motion;
+    /**
+     * 预警点工况
+     */
+    private String workingCondition;
+    /**
+     * 预警取值开始时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date warnStartTime;
+    /**
+     * 预警取值结束时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date warnEndTime;
+    /**
+     * 预警点扭矩
+     */
+    private BigDecimal warnTorque;
+    /**
+     * 预警点扭矩均值
+     */
+    private BigDecimal warnMeanValue;
+    /**
+     * 预警点扭矩波动值
+     */
+    private BigDecimal warnFluctuatedValue;
+    /**
+     * 预警点钻头位置
+     */
+    private BigDecimal warnBitdepth;
+    /**
+     * 预警点井深
+     */
+    private BigDecimal warnDepth;
+    /**
+     * 参考值起点时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date referenceStartTime;
+    /**
+     * 参考值结束时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date referenceEndTime;
+    /**
+     * 参考值扭矩均值
+     */
+    private BigDecimal referenceMeanValue;
+    /**
+     * 参考值扭矩波动值
+     */
+    private BigDecimal referenceFluctuatedValue;
+
+    /**
+     * 均值计算结果值
+     */
+    private BigDecimal resMeanValue;
+    /**
+     * 波动值计算结果值
+     */
+    private BigDecimal resFluctuatedValue;
+    /**
+     * 均值阈值
+     */
+    private BigDecimal thresholdMeanValue;
+    /**
+     * 波动值阈值
+     */
+    private BigDecimal thresholdFluctuatedValue;
+
+    /**
+     *是否均值报警 0否 1是
+     */
+    private String isMeanWarn;
+
+    /**
+     * 是否波动报警 0否 1是
+     */
+    private String isFluctuatedWarn;
+
+    /**
+     * 预警描述
+     */
+    private String warnDes;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+}

+ 136 - 0
yujing-common/src/main/java/com/cn/tianji/entity/TotalPoolVolumeWarnLog.java

@@ -0,0 +1,136 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 总池体积预警数据日志表;
+ *
+ * @author : http://www.chiner.pro
+ * @date : 2024-6-4
+ */
+@TableName("TOTAL_POOL_VOLUME_WARN_LOG")
+@Data
+public class TotalPoolVolumeWarnLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 主键
+     */
+    @TableId
+    private String id;
+
+    /**
+     * 井号
+     */
+    private String jh;
+
+    /**
+     * 预警点动作
+     */
+    private String motion;
+
+    /**
+     * 预警点工况
+     */
+    private String workingCondition;
+
+    /**
+     * 预警类别:溢流、井漏
+     */
+    private String totalWarnType;
+
+    /**
+     * 预警点时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date warnTime;
+
+    /**
+     * 预警点总池体积
+     */
+    private BigDecimal warnPittotal;
+
+    /**
+     * 总池体积参考值
+     */
+    private BigDecimal referenceValue;
+
+    /**
+     * 参考值起点时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date referenceStartTime;
+
+    /**
+     * 参考值结束时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date referenceEndTime;
+
+    /**
+     * 总池体积速率参考值
+     */
+    private BigDecimal rateStartPittotal;
+
+    /**
+     * 速率起点时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date rateStartTime;
+
+    /**
+     * 速率结束时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date rateEndTime;
+
+    /**
+     * 参考总池体积差值
+     */
+    private BigDecimal pittotalSub;
+
+    /**
+     * 速率总池体积差值
+     */
+    private BigDecimal ratePittotalSub;
+
+    /**
+     * 参考值预警值
+     */
+    private BigDecimal referenceWarnValue;
+
+    /**
+     * 速率预警值
+     */
+    private BigDecimal rateWarnValue;
+
+    /**
+     * 预警描述
+     */
+    private String warnDes;
+
+    /**
+     * 数据类别:0:起点 1结束点
+     */
+    private String dataType;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+}

+ 192 - 0
yujing-common/src/main/java/com/cn/tianji/entity/WarnHistory.java

@@ -0,0 +1,192 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+
+@Data
+public class WarnHistory implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(type = IdType.ASSIGN_ID)
+    private String id;
+
+    /**
+     * 井号
+     */
+    @TableField("jh")
+    private String jh;
+
+
+    /**
+     * 大钩位置
+     */
+    @TableField("warn_hkh")
+    private Float warnHkh;
+
+    /**
+     * 报警钻头位置
+     */
+    @TableField("warn_bitdepth")
+    private Float warnBitdepth;
+    /**
+     * 大钩负荷
+     */
+    @TableField("warn_woh")
+    private Float warnWoh;
+
+    /**
+     * 报警类型
+     */
+    @TableField("warn_type")
+    private String warnType;
+
+    /**
+     * 报警点时间
+     */
+    @TableField("warn_time")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private java.util.Date warnTime;
+
+    /**
+     * 报警点工况
+     */
+    @TableField("warn_condition")
+    private String warnCondition;
+
+    /**
+     * 整体工况
+     */
+    @TableField("whole_condition")
+    private String wholeCondition;
+
+    /**
+     * 正常柱起始时间
+     */
+    @TableField("normal_startime")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private java.util.Date normalStartime;
+
+    /**
+     * 正常柱结束时间
+     */
+    @TableField("normal_endtime")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private java.util.Date normalEndtime;
+
+    /**
+     * 正常柱钩载最值
+     */
+    @TableField("normal_woh")
+    private Float normalWoh;
+
+    /**
+     * 间隔正常柱数量
+     */
+    @TableField("normal_num")
+    private Integer normalNum;
+
+    /**
+     * 报警阈值
+     */
+    @TableField("warn_threshold")
+    private Float warnThreshold;
+
+
+    /**
+     * 钻头监测阈值
+     */
+    @TableField("bitdepth")
+    private Float bitdepth;
+
+    /**
+     * 钻杆重量
+     */
+    @TableField("column_weight")
+    private Float columnWeight;
+
+    /**
+     * 报警阈值
+     */
+    @TableField("warn_value")
+    private Float warnValue;
+
+    /**
+     * 大钩变化
+     */
+    @TableField("hkh_rang")
+    private Float hkhRang;
+
+    /**
+     *
+     */
+    @TableField("loop_drilling_pump")
+    private Float loopDrillingPump;
+
+    @TableField("loop_drilling_spp")
+    private Float loopDrillingSpp;
+
+    @TableField("per_spp")
+    private Float perSpp;
+    /**
+     * 扭矩上一点井深
+     */
+    @TableField("torquepreviousjs")
+    private Float torquepreviousjs;
+
+    /**
+     * 波动取值时间范围
+     */
+    @TableField("torguetimes")
+    private Integer torguetimes;
+
+    /**
+     * 扭矩变化量阈值
+     */
+    @TableField("torgue_variation_threshold")
+    private Float torgueVariationThreshold;
+
+    /**
+     * 扭矩波动阈值
+     */
+    @TableField("torgue_wave_threshold")
+    private Float torgueWaveThreshold;
+
+    @TableField("warn_des")
+    private String warnDes;
+
+    /**
+     * 扭矩变化量上一点时间
+     */
+    @TableField("njbhl_per_time")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private java.util.Date njbhlPerTime;
+
+    /**
+     * 上一点扭矩
+     */
+    @TableField("njbhl_per_torBig")
+    private Float njbhlPerTorBig;
+
+    @TableField("pit_start_time")
+    private java.util.Date pitStartTime;
+
+    @TableField("pit_start")
+    private Float pitStart;
+
+    @TableField("pit_sub")
+    private Float pitSub;
+
+    @TableField("pit_value")
+    private Float pitValue;
+}

+ 559 - 0
yujing-common/src/main/java/com/cn/tianji/entity/WellDrilling.java

@@ -0,0 +1,559 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * LTD录井数据实体类
+ * @author Zhao RenJi
+ */
+@Data
+public class WellDrilling implements Serializable {
+
+    /**
+     *井号
+     */
+    private String jh;
+
+    private String tid;
+
+    @TableId
+    private String time;
+
+    private BigDecimal id;
+
+    /**
+     *井深
+     */
+    private BigDecimal depth;
+
+    /**
+     *垂直井深
+     */
+    private BigDecimal vdepth;
+
+    /**
+     *状态
+     */
+    private BigDecimal stat;
+
+    /**
+     *迟到时间
+     */
+    private BigDecimal lagtime;
+
+    /**
+     *迟到泵冲
+     */
+    private BigDecimal lagstrokes;
+
+    /**
+     *迟到井深
+     */
+    private BigDecimal lagdepth;
+
+    /**
+     *钻头位置
+     */
+    private BigDecimal bitdepth;
+
+    /**
+     *井底上空
+     */
+    private BigDecimal bitoff;
+
+    /**
+     *方入
+     */
+    private BigDecimal kellyin;
+
+    /**
+     *大钩高度
+     */
+    private BigDecimal hkh;
+
+    /**
+     *大钩速度
+     */
+    private BigDecimal hks;
+
+    /**
+     *大钩负荷
+     */
+    private BigDecimal woh;
+
+    /**
+     *计算大钩负荷
+     */
+    private BigDecimal wohCalc;
+
+    /**
+     *钻具视重
+     */
+    private BigDecimal floatWeight;
+
+    /**
+     *转盘转速
+     */
+    private BigDecimal rpm;
+
+    /**
+     *瞬间钻时
+     */
+    private BigDecimal ropInst;
+
+    /**
+     *上米钻时
+     */
+    private BigDecimal ropMavg;
+
+    /**
+     *钻压
+     */
+    private BigDecimal wob;
+
+    /**
+     *扭矩
+     */
+    private BigDecimal torque;
+
+    /**
+     *顶驱扭矩
+     */
+    private BigDecimal tdTorque;
+
+    /**
+     *立管压力
+     */
+    private BigDecimal spp;
+
+    /**
+     *套管压力
+     */
+    private BigDecimal whp;
+
+    /**
+     *1#泵冲
+     */
+    private BigDecimal pump1;
+
+    /**
+     *2#泵冲
+     */
+    private BigDecimal pump2;
+
+    /**
+     *3#泵冲
+     */
+    private BigDecimal pump3;
+
+    /**
+     *总泵冲
+     */
+    private BigDecimal pumptotal;
+
+    /**
+     *泵冲1累计数
+     */
+    private BigDecimal strokes1;
+
+    /**
+     *泵冲2累计数
+     */
+    private BigDecimal strokes2;
+
+    /**
+     *泵冲3累计数
+     */
+    private BigDecimal strokes3;
+
+    /**
+     *总泵冲累计数
+     */
+    private BigDecimal strokestotal;
+
+    /**
+     *瞬间钻速
+     */
+    private BigDecimal vopInst;
+
+    /**
+     *上米钻速
+     */
+    private BigDecimal vopMavg;
+
+    /**
+     *入口流量
+     */
+    private BigDecimal flowin;
+
+    /**
+     *出口流量
+     */
+    private BigDecimal flowout;
+
+    /**
+     *出口流量% 百分比
+     */
+    private BigDecimal flowoutpercent;
+
+    /**
+     *入口密度
+     */
+    private BigDecimal mwin;
+
+    /**
+     *出口密度
+     */
+    private BigDecimal mwout;
+
+    /**
+     *入口温度
+     */
+    private BigDecimal tempin;
+
+    /**
+     *出口温度
+     */
+    private BigDecimal tempout;
+
+    /**
+     *入口电导
+     */
+    private BigDecimal condin;
+
+    /**
+     *出口电导
+     */
+    private BigDecimal condout;
+
+    /**
+     *当量密度
+     */
+    private BigDecimal ecd;
+
+    /**
+     *1#池体积
+     */
+    private BigDecimal pit1;
+
+    /**
+     *2#池体积
+     */
+    private BigDecimal pit2;
+
+    /**
+     *3#池体积
+     */
+    private BigDecimal pit3;
+
+    /**
+     *4#池体积
+     */
+    private BigDecimal pit4;
+
+    /**
+     *5#池体积
+     */
+    private BigDecimal pit5;
+
+    /**
+     *6#池体积
+     */
+    private BigDecimal pit6;
+
+    /**
+     *7#池体积
+     */
+    private BigDecimal pit7;
+
+    /**
+     *8#池体积
+     */
+    private BigDecimal pit8;
+
+    /**
+     *9#池体积
+     */
+    private BigDecimal pit9;
+
+    /**
+     *10#池体积
+     */
+    private BigDecimal pit10;
+
+    /**
+     *11#池体积
+     */
+    private BigDecimal pit11;
+
+    /**
+     *12#池体积
+     */
+    private BigDecimal pit12;
+
+    /**
+     *起下钻池体积
+     */
+    private BigDecimal triptandvol;
+
+    /**
+     *活动池体积
+     */
+    private BigDecimal actpittotal;
+
+    /**
+     *总池体积
+     */
+    private BigDecimal pittotal;
+
+    /**
+     *泥浆溢漏
+     */
+    private BigDecimal gainlossvol;
+
+    /**
+     *甲烷
+     */
+    private BigDecimal c1;
+
+    /**
+     *乙烷
+     */
+    private BigDecimal c2;
+
+    /**
+     *丙烷
+     */
+    private BigDecimal c3;
+
+    /**
+     *异丁烷
+     */
+    private BigDecimal ic4;
+
+    /**
+     *正丁烷
+     */
+    private BigDecimal nc4;
+
+    /**
+     *异戊烷
+     */
+    private BigDecimal ic5;
+
+    /**
+     *正戊烷
+     */
+    private BigDecimal nc5;
+
+    /**
+     *新戊烷
+     */
+    private BigDecimal ec5;
+
+    /**
+     *异己烷
+     */
+    private BigDecimal ic6;
+
+    /**
+     *正己烷
+     */
+    private BigDecimal nc6;
+
+    /**
+     *总烃
+     */
+    private BigDecimal tg;
+
+    /**
+     *二氧化碳
+     */
+    private BigDecimal co2;
+
+    /**
+     *氢气
+     */
+    private BigDecimal h2;
+
+    /**
+     *硫化氢1
+     */
+    private BigDecimal h2s1;
+
+    /**
+     *硫化氢2
+     */
+    private BigDecimal h2s2;
+
+    /**
+     *硫化氢3
+     */
+    private BigDecimal h2s3;
+
+    /**
+     *硫化氢4
+     */
+    private BigDecimal h2s4;
+
+    /**
+     *硫化氢5
+     */
+    private BigDecimal h2s5;
+
+    /**
+     *硫化氢6
+     */
+    private BigDecimal h2s6;
+
+    /**
+     *硫化氢7
+     */
+    private BigDecimal h2s7;
+
+    /**
+     *硫化氢8
+     */
+    private BigDecimal h2s8;
+
+    /**
+     *钻具总长
+     */
+    private BigDecimal stringlen;
+
+    /**
+     *当前单根
+     */
+    private BigDecimal curpipe;
+
+    /**
+     *钻头序号
+     */
+    private BigDecimal bitno;
+
+    /**
+     *钻头尺寸
+     */
+    private BigDecimal bitsize;
+
+    /**
+     *钻头类型
+     */
+    private BigDecimal bittype;
+
+    /**
+     *钻头进尺
+     */
+    private BigDecimal bitrun;
+
+    /**
+     *钻头入井时间
+     */
+    private BigDecimal bittime;
+
+    /**
+     *纯钻时间
+     */
+    private BigDecimal bitdrilltime;
+
+    /**
+     *钻进成本
+     */
+    private BigDecimal bitcost;
+
+    /**
+     *钻井天数
+     */
+    private BigDecimal totaldays;
+
+    /**
+     *已提下立柱数
+     */
+    private BigDecimal standsdone;
+
+    /**
+     *未提下立柱数
+     */
+    private BigDecimal standstogo;
+
+    /**
+     *提钻超拉
+     */
+    private BigDecimal tripoverpull;
+
+    /**
+     *DC指数
+     */
+    private BigDecimal dc;
+
+    /**
+     *Sigma指数
+     */
+    private BigDecimal sigma;
+
+    private BigDecimal free95;
+
+    private BigDecimal free96;
+
+    private BigDecimal free97;
+
+    private BigDecimal free98;
+
+    private BigDecimal free99;
+
+    private BigDecimal free100;
+
+    private BigDecimal free101;
+
+    private BigDecimal free102;
+
+    private BigDecimal free103;
+
+    private BigDecimal free104;
+
+    private BigDecimal free105;
+
+    private BigDecimal free106;
+
+    private BigDecimal free107;
+
+    private BigDecimal free108;
+
+    private BigDecimal free109;
+
+    private BigDecimal free110;
+
+    private BigDecimal free111;
+
+    private BigDecimal free112;
+
+    private BigDecimal free113;
+
+    private BigDecimal free114;
+
+    private BigDecimal free115;
+
+    private BigDecimal free116;
+
+    private BigDecimal free117;
+
+    private BigDecimal free118;
+
+    private BigDecimal free119;
+
+    private BigDecimal free120;
+
+    /**
+     * 工况
+     */
+    private String operatingMode;
+
+    /**
+     * 动作
+     */
+    private String motion;
+}

+ 766 - 0
yujing-common/src/main/java/com/cn/tianji/entity/WellDrillingSICP.java

@@ -0,0 +1,766 @@
+package com.cn.tianji.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * SICP 录井数据实体类  经纬公司
+ * @author Zhao RenJi
+ */
+@Data
+public class WellDrillingSICP implements Serializable {
+
+    /**
+     *井号
+     */
+    @JSONField(name = "jh")
+    private String jh;
+
+    /**
+     *施工单位
+     */
+    @JSONField(name = "sgdw")
+    private String sgdw;
+
+    /**
+     *工况
+     */
+    @JSONField(name = "gk")
+    private String gk;
+
+    /**
+     *井标识
+     */
+    @JSONField(name = "jid")
+    private String JID;
+
+    /**
+     *井眼标识
+     */
+    @JSONField(name = "jyid")
+    private String JYID;
+
+    /**
+     *作业标识
+     */
+    @JSONField(name = "zyid")
+    private String ZYID;
+
+    /**
+     *记录标识
+     */
+    @JSONField(name = "rid")
+    private String RID;
+
+    /**
+     *序列标识
+     */
+    @JSONField(name = "sqid")
+    private String SQID;
+
+    /**
+     *时间
+     */
+    @JSONField(name = "time")
+    private String TIME;
+
+    /**
+     *活动码
+     */
+    @JSONField(name = "actc")
+    private String ACTC;
+
+    /**
+     *钻头深度(测量)
+     */
+    @JSONField(name = "dbtm")
+    private String DBTM;
+
+    /**
+     *钻头深度(垂直)
+     */
+    @JSONField(name = "dbtv")
+    private String DBTV;
+
+    /**
+     *井眼深度(测量)
+     */
+    @JSONField(name = "dmea")
+    private String DMEA;
+
+    /**
+     *井眼深度(垂直)
+     */
+    @JSONField(name = "dver")
+    private String DVER;
+
+    /**
+     *大钩位置
+     */
+    @JSONField(name = "bpos")
+    private String BPOS;
+
+    /**
+     *机械钻速(平均)
+     */
+    @JSONField(name = "ropa")
+    private String ROPA;
+
+    /**
+     *大钩负荷(平均)
+     */
+    @JSONField(name = "hkla")
+    private String HKLA;
+
+    /**
+     *大钩负荷(最大)
+     */
+    @JSONField(name = "hklx")
+    private String HKLX;
+
+    /**
+     *钻压(地面,平均)
+     */
+    @JSONField(name = "woba")
+    private String WOBA;
+
+    /**
+     *钻压(地面,最大)
+     */
+    @JSONField(name = "wobx")
+    private String WOBX;
+
+    /**
+     *转盘扭矩(地面,平均)
+     */
+    @JSONField(name = "tqa")
+    private String TQA;
+
+    /**
+     *转盘扭矩(地面,最大)
+     */
+    @JSONField(name = "tqx")
+    private String TQX;
+
+    /**
+     *转盘速度(地面,平均)
+     */
+    @JSONField(name = "rpma")
+    private String RPMA;
+
+    /**
+     *立管压力(平均)
+     */
+    @JSONField(name = "sppa")
+    private String SPPA;
+
+    /**
+     *套管压力
+     */
+    @JSONField(name = "chkp")
+    private String CHKP;
+
+    /**
+     *1#泵冲速
+     */
+    @JSONField(name = "spm1")
+    private String SPM1;
+
+    /**
+     *2#泵冲速
+     */
+    @JSONField(name = "spm2")
+    private String SPM2;
+
+    /**
+     *3#泵冲速
+     */
+    @JSONField(name = "spm3")
+    private String SPM3;
+
+    /**
+     *泥浆池体积(活动)
+     */
+    @JSONField(name = "tva")
+    private String TVA;
+
+    /**
+     *泥浆池体积变化(活动)
+     */
+    @JSONField(name = "tvca")
+    private String TVCA;
+
+    /**
+     *出口泥浆流量%
+     */
+    @JSONField(name = "mfop")
+    private String MFOP;
+
+    /**
+     *出口泥浆流量(平均)
+     */
+    @JSONField(name = "mfoa")
+    private String MFOA;
+
+    /**
+     *入口泥浆流量(平均)
+     */
+    @JSONField(name = "mfia")
+    private String MFIA;
+
+    /**
+     *出口泥浆密度(平均)
+     */
+    @JSONField(name = "mdoa")
+    private String MDOA;
+
+    /**
+     *入口泥浆密度(平均)
+     */
+    @JSONField(name = "mdia")
+    private String MDIA;
+
+    /**
+     *出口泥浆温度(平均)
+     */
+    @JSONField(name = "mtoa")
+    private String MTOA;
+
+    /**
+     *入口泥浆温度(平均)
+     */
+    @JSONField(name = "mtia")
+    private String MTIA;
+
+    /**
+     *出口泥浆电导率(平均)
+     */
+    @JSONField(name = "mcoa")
+    private String MCOA;
+
+    /**
+     *入口泥浆电导率(平均)
+     */
+    @JSONField(name = "mcia")
+    private String MCIA;
+
+    /**
+     *泵冲数(总计)
+     */
+    @JSONField(name = "stkc")
+    private String STKC;
+
+    /**
+     *迟到泵冲
+     */
+    @JSONField(name = "lstk")
+    private String LSTK;
+
+    /**
+     *迟到井深(测量)
+     */
+    @JSONField(name = "drtm")
+    private String DRTM;
+
+    /**
+     *全烃(平均)
+     */
+    @JSONField(name = "gasa")
+    private String GASA;
+
+    /**
+     *迟到时间
+     */
+    @JSONField(name = "trtt")
+    private String TRTT;
+
+    /**
+     *大钩速度
+     */
+    @JSONField(name = "bspd")
+    private String BSPD;
+
+    /**
+     *顶驱转速
+     */
+    @JSONField(name = "trpma")
+    private String TRPMA;
+
+    /**
+     *顶驱扭矩(平均)
+     */
+    @JSONField(name = "ttqa")
+    private String TTQA;
+
+    /**
+     *顶驱扭矩(最大)
+     */
+    @JSONField(name = "ttqx")
+    private String TTQX;
+
+    /**
+     *二氧化碳(平均)
+     */
+    @JSONField(name = "co2a")
+    private String CO2A;
+
+    /**
+     *硫化氢1(平均)
+     */
+    @JSONField(name = "hs1a")
+    private String HS1A;
+
+    /**
+     *硫化氢2(平均)
+     */
+    @JSONField(name = "hs2a")
+    private String HS2A;
+
+    /**
+     *硫化氢3(平均)
+     */
+    @JSONField(name = "hs3a")
+    private String HS3A;
+
+    /**
+     *硫化氢4(平均)
+     */
+    @JSONField(name = "hs4a")
+    private String HS4A;
+
+    /**
+     *硫化氢5(平均)
+     */
+    @JSONField(name = "hs4a")
+    private String HS5A;
+
+    /**
+     *硫化氢6(平均)
+     */
+    @JSONField(name = "hs6a")
+    private String HS6A;
+
+    /**
+     *硫化氢7(平均)
+     */
+    @JSONField(name = "hs7a")
+    private String HS7A;
+
+    /**
+     *硫化氢8(平均)
+     */
+    @JSONField(name = "hs8a")
+    private String HS8A;
+
+    /**
+     *可燃气1
+     */
+    @JSONField(name = "cbg1a")
+    private String CBG1A;
+
+    /**
+     *可燃气2
+     */
+    @JSONField(name = "cbg2a")
+    private String CBG2A;
+
+    /**
+     *可燃气3
+     */
+    @JSONField(name = "cbg3a")
+    private String CBG3A;
+
+    /**
+     *可燃气4
+     */
+    @JSONField(name = "cbg4a")
+    private String CBG4A;
+
+    /**
+     *提钻超拉
+     */
+    @JSONField(name = "trip_over_pull")
+    private String TRIP_OVER_PULL;
+
+    /**
+     *DC指数
+     */
+    @JSONField(name = "dc")
+    private String DC;
+
+    /**
+     *SIGMA指数
+     */
+    @JSONField(name = "sigma")
+    private String SIGMA;
+
+    /**
+     *方入
+     */
+    @JSONField(name = "kellyin")
+    private String KELLYIN;
+
+    /**
+     *钻具视重
+     */
+    @JSONField(name = "float_weight")
+    private String FLOAT_WEIGHT;
+
+    /**
+     *瞬时钻时
+     */
+    @JSONField(name = "rop_inst")
+    private String ROP_INST;
+
+    /**
+     *上米钻时
+     */
+    @JSONField(name = "rop_mavg")
+    private String ROP_MAVG;
+
+    /**
+     *钻时
+     */
+    @JSONField(name = "rop")
+    private String ROP;
+
+    /**
+     *瞬间钻速
+     */
+    @JSONField(name = "vop_inst")
+    private String VOP_INST;
+
+    /**
+     *上米钻速
+     */
+    @JSONField(name = "vop_mavg")
+    private String VOP_MAVG;
+
+    /**
+     *总泵冲
+     */
+    @JSONField(name = "tspm")
+    private String TSPM;
+
+    /**
+     *泵冲1累计数
+     */
+    @JSONField(name = "strokes1")
+    private String STROKES1;
+
+    /**
+     *泵冲2累计数
+     */
+    @JSONField(name = "strokes2")
+    private String STROKES2;
+
+    /**
+     *泵冲3累计数
+     */
+    @JSONField(name = "strokes3")
+    private String STROKES3;
+
+    /**
+     *等效循环密度
+     */
+    @JSONField(name = "ecd")
+    private String ECD;
+
+    /**
+     *起下钻池体积
+     */
+    @JSONField(name = "triptandvol")
+    private String TRIPTANDVOL;
+
+    /**
+     *氢气
+     */
+    @JSONField(name = "h2")
+    private String H2;
+
+    /**
+     *已提下立柱数
+     */
+    @JSONField(name = "standsdone")
+    private String STANDSDONE;
+
+    /**
+     *未提下立柱数
+     */
+    @JSONField(name = "standstogo")
+    private String STANDSTOGO;
+
+    /**
+     *D指数
+     */
+    @JSONField(name = "d")
+    private String D;
+
+    /**
+     *湿度比
+     */
+    @JSONField(name = "sdb")
+    private String SDB;
+
+    /**
+     *平衡比
+     */
+    @JSONField(name = "phb")
+    private String PHB;
+
+    /**
+     *特性比
+     */
+    @JSONField(name = "txb")
+    private String TXB;
+
+    /**
+     *h2s百分含量-line(ppm)
+     */
+    @JSONField(name = "lhqbfhlline")
+    private String LHQBFHLLINE;
+
+    /**
+     *井号
+     */
+    @JSONField(name = "dcsn")
+    private String DCSN;
+
+    /**
+     *sigma趋向
+     */
+    @JSONField(name = "sigmaqx")
+    private String SIGMAQX;
+
+    /**
+     *sigma孔隙度
+     */
+    @JSONField(name = "sigmakxd")
+    private String SIGMAKXD;
+
+    /**
+     *dcs孔隙度
+     */
+    @JSONField(name = "dcskxd")
+    private String DCSKXD;
+
+    /**
+     *sigma地压梯度(g/cm3)
+     */
+    @JSONField(name = "sigmadytd")
+    private String SIGMADYTD;
+
+    /**
+     *sigma破压梯度(g/cm3)
+     */
+    @JSONField(name = "sigmapytd")
+    private String SIGMAPYTD;
+
+    /**
+     *地层孔隙压力梯度估价(kg/m3
+     */
+    @JSONField(name = "fppg")
+    private String FPPG;
+
+    /**
+     *地层破裂压力梯度估价(kg/m3)
+     */
+    @JSONField(name = "ffpg")
+    private String FFPG;
+
+    /**
+     *进入时间
+     */
+    @JSONField(name = "jrtime")
+    private String JRTIME;
+
+    /**
+     *来源单位
+     */
+    @JSONField(name = "sourceunit")
+    private String SOURCEUNIT;
+
+    /**
+     *起下钻1号池体积(m3)
+     */
+    @JSONField(name = "ttv1")
+    private String TTV1;
+
+    /**
+     *起下钻2号池体积(m3)
+     */
+    @JSONField(name = "ttv2")
+    private String TTV2;
+
+    /**
+     *池体积(总计)(m3)
+     */
+    @JSONField(name = "tvt")
+    private String TVT;
+
+    /**
+     *1号池体积(m3)
+     */
+    @JSONField(name = "tv01")
+    private String TV01;
+
+    /**
+     *2号池体积(m3)
+     */
+    @JSONField(name = "tv02")
+    private String TV02;
+
+    /**
+     *3号池体积(m3)
+     */
+    @JSONField(name = "tv03")
+    private String TV03;
+
+    /**
+     *4号池体积(m3)
+     */
+    @JSONField(name = "tv04")
+    private String TV04;
+
+    /**
+     *5号池体积(m3)
+     */
+    @JSONField(name = "tv05")
+    private String TV05;
+
+    /**
+     *6号池体积(m3)
+     */
+    @JSONField(name = "tv06")
+    private String TV06;
+
+    /**
+     *7号池体积(m3)
+     */
+    @JSONField(name = "tv07")
+    private String TV07;
+
+    /**
+     *8号池体积(m3)
+     */
+    @JSONField(name = "tv08")
+    private String TV08;
+
+    /**
+     *9号池体积(m3)
+     */
+    @JSONField(name = "tv09")
+    private String TV09;
+
+    /**
+     *10号池体积(m3)
+     */
+    @JSONField(name = "tv10")
+    private String TV10;
+
+    /**
+     *11号池体积(m3)
+     */
+    @JSONField(name = "tv11")
+    private String TV11;
+
+    /**
+     *12号池体积(m3)
+     */
+    @JSONField(name = "tv12")
+    private String TV12;
+
+    /**
+     *甲烷(C1)(%)
+     */
+    @JSONField(name = "meth")
+    private String METH;
+
+    /**
+     *乙烷(C2)(%)
+     */
+    @JSONField(name = "eth")
+    private String ETH;
+
+    /**
+     *丙烷(C3)(%)
+     */
+    @JSONField(name = "prp")
+    private String PRP;
+
+    /**
+     *异丁烷(iC4)(%)
+     */
+    @JSONField(name = "ibut")
+    private String IBUT;
+
+    /**
+     *正丁烷(NC4)(%)
+     */
+    @JSONField(name = "nbut")
+    private String NBUT;
+
+    /**
+     *异戊烷(iC5)(%)
+     */
+    @JSONField(name = "ipen")
+    private String IPEN;
+
+    /**
+     *正戊烷(NC5)(%)
+     */
+    @JSONField(name = "npen")
+    private String NPEN;
+
+    /**
+     *新戊烷(EC5)(%)
+     */
+    @JSONField(name = "epen")
+    private String EPEN;
+
+    /**
+     *异己烷(iC6)(%)
+     */
+    @JSONField(name = "ihex")
+    private String IHEX;
+
+    /**
+     *正己烷(NC6)(%)
+     */
+    @JSONField(name = "nhex")
+    private String NHEX;
+
+    /**
+     *备用1
+     */
+    @JSONField(name = "spr1")
+    private String SPR1;
+
+    /**
+     *备用2
+     */
+    @JSONField(name = "spr2")
+    private String SPR2;
+
+    /**
+     *备用3
+     */
+    @JSONField(name = "spr3")
+    private String SPR3;
+
+    /**
+     *备用4
+     */
+    @JSONField(name = "spr4")
+    private String SPR4;
+
+    /**
+     *备用5
+     */
+    @JSONField(name = "spr5")
+    private String SPR5;
+
+
+}

+ 25 - 0
yujing-common/src/main/java/com/cn/tianji/entity/WellName.java

@@ -0,0 +1,25 @@
+package com.cn.tianji.entity;
+
+import lombok.Data;
+
+/**
+ * 井号名实体类
+ * @author Zhao RenJi
+ */
+@Data
+public class WellName {
+    /**
+     * 井名
+     */
+    private String wellName;
+
+    /**
+     * sicp井表名
+     */
+    private String wellTableNameSicp;
+
+    /**
+     * ltd井表名
+     */
+    private String wellTableNameLtd;
+}

+ 43 - 0
yujing-common/src/main/java/com/cn/tianji/entity/WorkingConditionCalculationLog.java

@@ -0,0 +1,43 @@
+package com.cn.tianji.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 钻井工况计算日志表;
+ * @author : http://www.chiner.pro
+ * @date : 2024-5-15
+ */
+@TableName("working_condition_calculation_log")
+@Data
+public class WorkingConditionCalculationLog  implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /** 主键 */
+    @TableId
+    private String id;
+    /** 井号 */
+    private String jh;
+    /** 是否正在计算 */
+    private String isCalculate;
+    /** 开始时间 */
+    private String startTime;
+    /** 结束时间 */
+    private String endTime;
+    /** 正在计算时间 */
+    private String calTime;
+    /** 计算类别: 0:工况计算 1:预警计算 */
+    private String calculateType;
+
+    /**是否清除缓存数据 0:是 1:否**/
+    private String isDelRedis;
+
+    /** 创建时间 */
+    private Date createTime;
+
+
+
+}

+ 100 - 0
yujing-common/src/main/java/com/cn/tianji/enums/DrillingConditionDeterminationEnum.java

@@ -0,0 +1,100 @@
+package com.cn.tianji.enums;
+
+import lombok.Getter;
+
+/**
+ * 钻进工况动作枚举
+ * @author Zhao RenJi
+ */
+@Getter
+public enum DrillingConditionDeterminationEnum {
+    /**
+     *坐卡
+     */
+    InSlips("坐卡"),
+
+    /**
+     *待命
+     */
+    Standby("待命"),
+
+    /**
+     *干钻
+     */
+    DryDrill("干钻"),
+
+    /**
+     *滑动钻进
+     */
+    SlidingDrilling("滑动钻进"),
+
+    /**
+     *旋转钻进
+     */
+    RotaryDrilling("旋转钻进"),
+
+    /**
+     *停待
+     */
+    StopAndWait("停待"),
+
+    /**
+     *停泵空转
+     */
+    StopPumpAndIdle("停泵空转"),
+
+    /**
+     *静止循环
+     */
+    StationaryCycle("静止循环"),
+
+    /**
+     *循环空转
+     */
+    CycleIdle("循环空转"),
+
+    /**
+     *上提钻具
+     */
+    LiftingDrillingTools("上提钻具"),
+
+    /**
+     *干倒划
+     */
+    DryInvertedScratch("干倒划"),
+
+    /**
+     *边提边循环
+     */
+    LoopWhileLifting("边提边循环"),
+
+    /**
+     *倒划眼
+     */
+    BackReaming("倒划眼"),
+
+    /**
+     *下放钻具
+     */
+    LoweringDrillingTools("下放钻具"),
+    /**
+     *干划眼
+     */
+    DryEyeScratching("干划眼"),
+
+    /**
+     *坐卡
+     */
+    LoopWhilePlacing("边放边循环"),
+
+    /**
+     *待命
+     */
+    Reaming("划眼");
+
+    private final String value;
+
+    DrillingConditionDeterminationEnum(String value) {
+        this.value = value;
+    }
+}

+ 87 - 0
yujing-common/src/main/java/com/cn/tianji/enums/TrippingConditionDeterminationEnum.java

@@ -0,0 +1,87 @@
+package com.cn.tianji.enums;
+
+import lombok.Getter;
+
+/**
+ * 起下钻工况动作枚举
+ * @author Zhao RenJi
+ */
+@Getter
+public enum TrippingConditionDeterminationEnum {
+    /**
+     *在地面
+     */
+    AtSurface("在地面"),
+
+    /**
+     *坐卡
+     */
+    InSlips("坐卡"),
+
+    /**
+     *停待
+     */
+    StopAndWait("停待"),
+
+    /**
+     *空转
+     */
+    Idling("空转"),
+
+    /**
+     *中途循环
+     */
+    MidwayLoop("中途循环"),
+
+    /**
+     *定点转转盘循环
+     */
+    FixedPointTurntableCycle("定点转转盘循环"),
+
+
+    /**
+     *上提钻具
+     */
+    LiftingDrillingTools("上提钻具"),
+
+    /**
+     *干倒划
+     */
+    DryInvertedScratch("干倒划"),
+
+    /**
+     *边提边循环
+     */
+    LoopWhileLifting("边提边循环"),
+
+    /**
+     *倒划
+     */
+    ReversesStroke("倒划"),
+
+    /**
+     *下放钻具
+     */
+    LoweringDrillingTools("下放钻具"),
+
+    /**
+     *干划
+     */
+    DrysScratch("干划"),
+
+    /**
+     *边放边循环
+     */
+    LoopWhilePlacing("边放边循环"),
+
+    /**
+     *划眼
+     */
+    Reaming("划眼");
+
+    private final String value;
+
+    TrippingConditionDeterminationEnum(String value) {
+        this.value = value;
+    }
+}

+ 8 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/AjhMapper.java

@@ -0,0 +1,8 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.Ajh;
+
+public interface AjhMapper extends BaseMapper<Ajh> {
+
+}

+ 14 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/ComprehensiveLogMapper.java

@@ -0,0 +1,14 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.ComprehensiveLog;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 综合异常日志信息;(comprehensive_log)表数据库访问层
+ * @author : zrj
+ * @date : 2024-9-18
+ */
+@Mapper
+public interface ComprehensiveLogMapper extends BaseMapper<ComprehensiveLog> {
+}

+ 14 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/HookLoadWarnLogMapper.java

@@ -0,0 +1,14 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.HookLoadWarnLog;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 钩载预警数据表;(hook_load_warn_log)表数据库访问层
+ * @author : http://www.chiner.pro
+ * @date : 2024-5-29
+ */
+@Mapper
+public interface HookLoadWarnLogMapper  extends BaseMapper<HookLoadWarnLog> {
+}

+ 9 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/OperatingConditionThresholdMapper.java

@@ -0,0 +1,9 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.OperatingConditionThreshold;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface OperatingConditionThresholdMapper extends BaseMapper<OperatingConditionThreshold> {
+}

+ 14 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/PumpingPressureWarnLogMapper.java

@@ -0,0 +1,14 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.PumpingPressureWarnLog;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 泵压预警数据;(pumping_pressure_warn_log)表数据库访问层
+ * @author : http://www.chiner.pro
+ * @date : 2024-6-6
+ */
+@Mapper
+public interface PumpingPressureWarnLogMapper  extends BaseMapper<PumpingPressureWarnLog> {
+}

+ 35 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/SyncRecordMapper.java

@@ -0,0 +1,35 @@
+package com.cn.tianji.mapper;
+
+
+import java.util.List;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.SyncRecord;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+@DS("yjDataSource")
+public interface SyncRecordMapper extends BaseMapper<SyncRecord> {
+
+    @Override
+    @Insert({"insert into sync_record (id,table_name,collect_time,working) values(#{record.id,jdbcType=VARCHAR},#{record.tableName,jdbcType=VARCHAR},#{record.collectTime,jdbcType=VARCHAR},#{record.working,jdbcType=VARCHAR})"})
+    int insert(@Param("record") SyncRecord paramSyncRecord);
+
+    @Update({"truncate table sync_record"})
+    void truncate();
+
+    @Select({"select id,table_name as tableName,collect_time as collectTime from sync_record"})
+    List<SyncRecord> selectList();
+
+    @Update({"update sync_record set collect_time=#{record.collectTime} where id=#{record.id}"})
+    int updateTimeById(@Param("record") SyncRecord paramSyncRecord);
+
+    @Delete({"delete from sync_record where id=#{id}"})
+    void deleteById(@Param("id") String paramString);
+
+
+}

+ 7 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/TorqueWarnLogMapper.java

@@ -0,0 +1,7 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.TorqueWarnLog;
+
+public interface TorqueWarnLogMapper  extends BaseMapper<TorqueWarnLog> {
+}

+ 14 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/TotalPoolVolumeWarnLogMapper.java

@@ -0,0 +1,14 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.TotalPoolVolumeWarnLog;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 总池体积预警数据日志表;(total_pool_volume_warn_log)表数据库访问层
+ * @author : http://www.chiner.pro
+ * @date : 2024-6-4
+ */
+@Mapper
+public interface TotalPoolVolumeWarnLogMapper   extends BaseMapper<TotalPoolVolumeWarnLog> {
+}

+ 19 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/WarnHistoryMapper.java

@@ -0,0 +1,19 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.WarnHistory;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 报警历史数据表 Mapper 接口
+ * </p>
+ *
+ * @author zrj
+ * @since 2022-12-09
+ */
+@DS("chartDataSource")
+@Mapper
+public interface WarnHistoryMapper  extends BaseMapper<WarnHistory> {
+}

+ 39 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/WellDrillingMapper.java

@@ -0,0 +1,39 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.WellDrilling;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+@DS("yjDataSource")
+@Mapper
+public interface WellDrillingMapper extends BaseMapper<WellDrilling> {
+
+    void createTable(@Param("tableName") String paramString, @Param("timeStamp") long paramLong);
+
+    @Select({"select table_name from USER_TABLES"})
+    List<String> tableNames();
+
+    @Select(" select * from "+"\"${jhTableName}\""+"  ${ew.customSqlSegment} ")
+    List<WellDrilling> selectListOrcale(@Param("jhTableName")String jhTableName, @Param("ew") QueryWrapper<WellDrilling> queryWrapper);
+
+    /**
+     * @param jhTableName
+     * @param motion
+     * @param operatingMode
+     * @param queryWrapper
+     */
+    @Update("UPDATE "+"\"${jhTableName}\""+"  SET motion="+"'${motion}'"+",operating_mode="+"'${operatingMode}'"+"  ${ew.customSqlSegment}")
+    void updateByTimeOrcale(@Param("jhTableName")String jhTableName,@Param("motion")String motion,
+                          @Param("operatingMode")String operatingMode,@Param("ew") QueryWrapper<WellDrilling> queryWrapper);
+
+    int insertTableBatch(@Param("tableName") String tableName,@Param("dataList") List<WellDrilling> dataList);
+
+    String getLastDateByJh(@Param("tableName") String tableName);
+}

+ 25 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/WellDrillingSICPMapper.java

@@ -0,0 +1,25 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cn.tianji.entity.WellDrilling;
+import com.cn.tianji.entity.WellDrillingSICP;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+@DS("yjDataSource")
+public interface WellDrillingSICPMapper extends BaseMapper<WellDrillingSICP> {
+
+    void createTable(@Param("tableName") String paramString, @Param("timeStamp") long paramLong);
+
+    int insertTableBatch(@Param("tableName") String tableName, @Param("dataList") List<WellDrillingSICP> dataList);
+
+    @Select(" select * from "+"\"${jhTableName}\""+"  ${ew.customSqlSegment} ")
+    List<WellDrillingSICP> selectListOrcale(@Param("jhTableName")String jhTableName, @Param("ew") QueryWrapper<WellDrillingSICP> queryWrapper);
+
+    String selectMaxTime(@Param("jh") String paramString);
+
+}

+ 17 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/WlwmroDataMapper.java

@@ -0,0 +1,17 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+@DS("wlwmroDataSource")
+public interface WlwmroDataMapper {
+
+    List<Map<String,String>> selectAllJh();
+
+    List<Map<String,String>> selectZjrb3ByJh(@Param("jh") String jh);
+
+    List<Map<String,String>> selectZjrbByJh(@Param("jh") String jh);
+}

+ 19 - 0
yujing-common/src/main/java/com/cn/tianji/mapper/WorkingConditionCalculationLogMapper.java

@@ -0,0 +1,19 @@
+package com.cn.tianji.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.cn.tianji.entity.WorkingConditionCalculationLog;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 钻井工况计算日志表;(working_condition_calculation_log)表数据库访问层
+ * @author : http://www.chiner.pro
+ * @date : 2024-5-15
+ */
+@Mapper
+public interface WorkingConditionCalculationLogMapper  extends BaseMapper<WorkingConditionCalculationLog> {
+
+}

+ 9 - 0
yujing-common/src/main/java/com/cn/tianji/service/AjhService.java

@@ -0,0 +1,9 @@
+package com.cn.tianji.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.Ajh;
+import com.cn.tianji.entity.OperatingConditionThreshold;
+
+public interface AjhService  extends IService<Ajh> {
+    void saveData(String jh);
+}

+ 8 - 0
yujing-common/src/main/java/com/cn/tianji/service/ComprehensiveLogService.java

@@ -0,0 +1,8 @@
+package com.cn.tianji.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.ComprehensiveLog;
+import com.cn.tianji.entity.OperatingConditionThreshold;
+
+public interface ComprehensiveLogService extends IService<ComprehensiveLog> {
+}

+ 70 - 0
yujing-common/src/main/java/com/cn/tianji/service/HookLoadWarnLogService.java

@@ -0,0 +1,70 @@
+package com.cn.tianji.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.HookLoadWarnLog;
+import com.cn.tianji.entity.WellDrilling;
+
+import java.math.BigDecimal;
+
+/**
+ * 钩载预警数据表;(hook_load_warn_log)表服务接口
+ * @author : zrj
+ * @date : 2024-5-29
+ */
+public interface HookLoadWarnLogService extends IService<HookLoadWarnLog> {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    HookLoadWarnLog queryById(String id);
+    /**
+     * 新增数据
+     *
+     * @param hookLoadWarnLog 实例对象
+     * @return 实例对象
+     */
+    HookLoadWarnLog insert(HookLoadWarnLog hookLoadWarnLog);
+    /**
+     * 更新数据
+     *
+     * @param hookLoadWarnLog 实例对象
+     * @return 实例对象
+     */
+    HookLoadWarnLog update(HookLoadWarnLog hookLoadWarnLog);
+
+    void saveHookLoadWarnLog(WellDrilling nowPoint, String workingCondition, String workingConditionType, String motion,
+                             String referenceStartTime, String referenceEndTime, BigDecimal referenceWoh, BigDecimal referenceMaxWoh, BigDecimal referenceMinWoh,
+                             BigDecimal columnWeight, BigDecimal warnValue);
+
+    void saveMobilDrillingToolsHookLoadWarnLog(String jh,String workingCondition,String workingConditionType,String motion,
+                                               String mobilDrillingToolsStartTime,String mobilDrillingToolsEndTime,BigDecimal mobilDrillingToolsWoh,BigDecimal mobilDrillingToolsMaxWoh,BigDecimal mobilDrillingToolsMinWoh,
+                                               String referenceStartTime,String referenceEndTime,BigDecimal referenceWoh, BigDecimal referenceMaxWoh,BigDecimal referenceMinWoh,
+                                               BigDecimal warnValue);
+
+    /**
+     * 生成新的活动钻具算法预警实体类
+     * @param jh 井号
+     * @param workingCondition 工况
+     * @param workingConditionType 预警点工况类别:起钻、下钻、起钻——活动钻具、下钻-活动钻具、钻进活动钻具
+     * @param motion 动作
+     * @param mobilDrillingToolsWoh 活动钻具钩载波动值
+     * @param hkhSub 钻头位置差值
+     * @param mobilDrillingToolsStartTime 活动钻具开始时间
+     * @param mobilDrillingToolsMaxWoh 活动钻具钩载最大值
+     * @param mobilDrillingToolsMinWoh 活动钻具钩载最小值
+     * @param mobilDrillingToolsEndTime 活动钻具结束时间
+     * @param hkhStart 钻头起点位置
+     * @param hkhEnd 钻头结束位置
+     * @param wohHkhRes 钩载除以钻头位置值
+     * @param warnValue 预警值
+     * @return HookLoadWarnLog
+     */
+    HookLoadWarnLog creatNewMobilDrillingToolsHookLoadWarnLog(String jh,String workingCondition,String workingConditionType,String motion,
+                                                  BigDecimal mobilDrillingToolsWoh,BigDecimal hkhSub,String mobilDrillingToolsStartTime,
+                                                  BigDecimal mobilDrillingToolsMaxWoh,BigDecimal mobilDrillingToolsMinWoh,
+                                                  String mobilDrillingToolsEndTime,BigDecimal hkhStart,BigDecimal hkhEnd,
+                                                  BigDecimal wohHkhRes,BigDecimal warnValue);
+}

+ 7 - 0
yujing-common/src/main/java/com/cn/tianji/service/OperatingConditionThresholdService.java

@@ -0,0 +1,7 @@
+package com.cn.tianji.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.OperatingConditionThreshold;
+
+public interface OperatingConditionThresholdService extends IService<OperatingConditionThreshold> {
+}

+ 18 - 0
yujing-common/src/main/java/com/cn/tianji/service/PullDataSICPService.java

@@ -0,0 +1,18 @@
+package com.cn.tianji.service;
+
+import com.cn.tianji.entity.WellDrillingSICP;
+import com.cn.tianji.entity.WellName;
+
+import java.util.List;
+
+public interface PullDataSICPService {
+
+    /**
+     * 更新采集井数据列表
+     */
+    void updatePullJhList();
+
+    List<WellName> getAllJhSicp();
+
+    List<WellDrillingSICP> getSicpWellDataByJhTime(String jh, String startTime);
+}

+ 58 - 0
yujing-common/src/main/java/com/cn/tianji/service/PumpingPressureWarnLogService.java

@@ -0,0 +1,58 @@
+package com.cn.tianji.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.PumpingPressureWarnLog;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 泵压预警数据;(pumping_pressure_warn_log)表服务接口
+ * @author : http://www.chiner.pro
+ * @date : 2024-6-6
+ */
+public interface PumpingPressureWarnLogService  extends IService<PumpingPressureWarnLog> {
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param jh 主键
+     * @return 实例对象
+     */
+    PumpingPressureWarnLog queryById(String jh);
+
+    /**
+     * 新增数据
+     *
+     * @param pumpingPressureWarnLog 实例对象
+     * @return 实例对象
+     */
+    PumpingPressureWarnLog insert(PumpingPressureWarnLog pumpingPressureWarnLog);
+    /**
+     * 更新数据
+     *
+     * @param pumpingPressureWarnLog 实例对象
+     * @return 实例对象
+     */
+    PumpingPressureWarnLog update(PumpingPressureWarnLog pumpingPressureWarnLog);
+
+    /**
+     * 生成泵压预警日志数据实体类
+     * @param jh 井号
+     * @param workingCondition 工况
+     * @param motion 动作
+     * @param warnTime 预警点时间
+     * @param warnSpp 预警点立管压力
+     * @param warnTotalPump 预警点总泵冲
+     * @param referenceTime 参考点时间
+     * @param referenceSpp 参考点立管压力
+     * @param referenceTotalPump 参考点总泵冲
+     * @param totalPumpSub 立管压力差值
+     * @param sppSub 立管压力差值
+     * @param sppWarnValue 立管压力阈值
+     * @param pumpWarnValue 总泵冲阈值
+     * @return PumpingPressureWarnLog
+     */
+    PumpingPressureWarnLog createPumpingPressureWarnLog(String jh, String workingCondition , String motion, Date warnTime, BigDecimal warnSpp,BigDecimal warnTotalPump,
+                                                        Date referenceTime,BigDecimal referenceSpp,BigDecimal referenceTotalPump,BigDecimal totalPumpSub,BigDecimal sppSub,
+                                                        BigDecimal sppWarnValue,BigDecimal pumpWarnValue);
+}

+ 17 - 0
yujing-common/src/main/java/com/cn/tianji/service/SyncRecordService.java

@@ -0,0 +1,17 @@
+package com.cn.tianji.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.SyncRecord;
+
+/**
+ * @author Zhao RenJi
+ */
+
+@DS("yjDataSource")
+public interface SyncRecordService  extends IService<SyncRecord> {
+
+    int insert(SyncRecord paramSyncRecord);
+
+    int updateTimeById( SyncRecord paramSyncRecord);
+}

+ 70 - 0
yujing-common/src/main/java/com/cn/tianji/service/TorqueWarnLogService.java

@@ -0,0 +1,70 @@
+package com.cn.tianji.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.TorqueWarnLog;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 扭矩预警日志表;(torque_warn_log)表服务接口
+ * @author : http://www.chiner.pro
+ * @date : 2024-6-13
+ */
+public interface TorqueWarnLogService extends IService<TorqueWarnLog> {
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    TorqueWarnLog queryById(String id);
+    /**
+     * 新增数据
+     *
+     * @param torqueWarnLog 实例对象
+     * @return 实例对象
+     */
+    TorqueWarnLog insert(TorqueWarnLog torqueWarnLog);
+    /**
+     * 更新数据
+     *
+     * @param torqueWarnLog 实例对象
+     * @return 实例对象
+     */
+    TorqueWarnLog update(TorqueWarnLog torqueWarnLog);
+
+    /**
+     * 生成扭矩预警日志数据实体类
+     *
+     * @param jh 井号
+     * @param workingCondition 预警点工况
+     * @param motion 预警点动作
+     * @param warnStartTime 预警取值开始时间
+     * @param warnEndTime 预警取值结束时间
+     * @param warnTorque 预警点扭矩
+     * @param warnMeanValue 预警点扭矩均值
+     * @param warnFluctuatedValue 预警点扭矩波动值
+     * @param warnBitdepth 预警点钻头位置
+     * @param warnDepth 预警点井深
+     * @param referenceStartTime 参考值起点时间
+     * @param referenceEndTime 参考值结束时间
+     * @param referenceMeanValue 参考值扭矩均值
+     * @param referenceFluctuatedValue 参考值扭矩波动值
+     * @param resMeanValue 均值计算结果值
+     * @param resFluctuatedValue 波动值计算结果值
+     * @param thresholdMeanValue 均值阈值
+     * @param thresholdFluctuatedValue 波动值阈值
+     * @return
+     */
+    TorqueWarnLog createTorqueWarnLog(String jh, String workingCondition , String motion, Date warnStartTime, Date warnEndTime, BigDecimal warnTorque, BigDecimal warnMeanValue, BigDecimal warnFluctuatedValue,
+                                      BigDecimal warnBitdepth, BigDecimal warnDepth, Date referenceStartTime, Date referenceEndTime, BigDecimal referenceMeanValue, BigDecimal referenceFluctuatedValue, BigDecimal resMeanValue,
+                                      BigDecimal resFluctuatedValue, BigDecimal thresholdMeanValue, BigDecimal thresholdFluctuatedValue,String isMeanWarn,String isFluctuatedWarn
+    );
+
+    /**
+     *  新增扭矩预警日志
+     * @param model 扭矩实体类数据
+     */
+    void saveTorqueWarnLog(TorqueWarnLog model);
+}

+ 62 - 0
yujing-common/src/main/java/com/cn/tianji/service/TotalPoolVolumeWarnLogService.java

@@ -0,0 +1,62 @@
+package com.cn.tianji.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.TotalPoolVolumeWarnLog;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 总池体积预警数据日志表;(total_pool_volume_warn_log)表服务接口
+ * @author : zrj
+ * @date : 2024-6-4
+ */
+public interface TotalPoolVolumeWarnLogService extends IService<TotalPoolVolumeWarnLog> {
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    TotalPoolVolumeWarnLog queryById(String id);
+
+    /**
+     * 新增数据
+     *
+     * @param totalPoolVolumeWarnLog 实例对象
+     * @return 实例对象
+     */
+    TotalPoolVolumeWarnLog insert(TotalPoolVolumeWarnLog totalPoolVolumeWarnLog);
+    /**
+     * 更新数据
+     *
+     * @param totalPoolVolumeWarnLog 实例对象
+     * @return 实例对象
+     */
+    TotalPoolVolumeWarnLog update(TotalPoolVolumeWarnLog totalPoolVolumeWarnLog);
+
+    /**
+     * 生成总池体积预警日志数据实体类
+     *
+     * @param jh 井号
+     * @param workingCondition 工况
+     * @param motion 动作
+     * @param warnType 预警类别
+     * @param warnTime 预警点时间
+     * @param warnPittotal 预警点总池体积
+     * @param referenceValue 5分钟总池体积变化参考值
+     * @param referenceStartTime  5分钟总池体积变化开始时间
+     * @param referenceEndTime 5分钟总池体积变化结束时间
+     * @param rateStartPittotal 30秒总池体积变化参考值
+     * @param rateStartTime 30秒总池体积变化开始时间
+     * @param rateEndTime 30秒总池体积变化结束时间
+     * @param pittotalSub  5分钟总池体积变化与当前点总池体积差值
+     * @param ratePittotalSub 30秒总池体积变化与当前点总池体积差值
+     * @param referenceWarnValue 5分钟总池体积变化预警阈值
+     * @param rateWarnValue 30秒总池体积变化预警阈值
+     * @param sizeStr 大于/小于
+     */
+    TotalPoolVolumeWarnLog createTotalPoolVolumeWarnLog(String jh, String workingCondition , String motion, String warnType, Date warnTime, BigDecimal warnPittotal, BigDecimal referenceValue, Date referenceStartTime,
+                                                        Date referenceEndTime, BigDecimal rateStartPittotal, Date rateStartTime, Date rateEndTime, BigDecimal pittotalSub, BigDecimal ratePittotalSub, BigDecimal referenceWarnValue,
+                                                        BigDecimal rateWarnValue, String sizeStr);
+}

+ 17 - 0
yujing-common/src/main/java/com/cn/tianji/service/WarnHistoryService.java

@@ -0,0 +1,17 @@
+package com.cn.tianji.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.WarnHistory;
+
+/**
+ * <p>
+ * 报警历史数据表 服务类
+ * </p>
+ *
+ * @author zrj
+ * @since 2022-12-09
+ */
+@DS("chartDataSource")
+public interface WarnHistoryService  extends IService<WarnHistory> {
+}

+ 22 - 0
yujing-common/src/main/java/com/cn/tianji/service/WellDrillingSICPService.java

@@ -0,0 +1,22 @@
+package com.cn.tianji.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.cn.tianji.entity.WellDrillingSICP;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@DS("yjDataSource")
+public interface WellDrillingSICPService {
+
+    List<String> getTablesFromDb();
+
+    void createTable(String paramString,long paramLong);
+
+    List<WellDrillingSICP> selectListOrcale(String jhTableName, QueryWrapper<WellDrillingSICP> queryWrapper);
+
+    String selectMaxTime(String jh);
+
+    int insertTableBatch(String tableName,  List<WellDrillingSICP> dataList);
+}

+ 24 - 0
yujing-common/src/main/java/com/cn/tianji/service/WellDrillingService.java

@@ -0,0 +1,24 @@
+package com.cn.tianji.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.WellDrilling;
+
+import java.util.List;
+
+public interface WellDrillingService extends IService<WellDrilling> {
+
+    public List<WellDrilling> selectListOrcale(String jhTableName, QueryWrapper<WellDrilling> queryWrapper);
+
+    public String getTableCode(String AJH);
+
+    void updateByTimeOrcale(String jhTableName, String motion,String operatingMode, QueryWrapper<WellDrilling> queryWrapper);
+
+    int insertTableBatch(String tableName,List<WellDrilling> dataList);
+
+    List<String> tableNames();
+
+    String getLastDateByJh(String tableName);
+
+    void createTable(String paramString, long paramLong);
+}

+ 14 - 0
yujing-common/src/main/java/com/cn/tianji/service/WlwmroDataService.java

@@ -0,0 +1,14 @@
+package com.cn.tianji.service;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+
+import java.util.List;
+import java.util.Map;
+@DS("wlwmroDataSource")
+public interface WlwmroDataService {
+    List<Map<String,String>> getAllJh();
+
+    List<Map<String,String>> selectZjrb3ByJh(String jh);
+
+    List<Map<String,String>> selectZjrbByJh(String jh);
+}

+ 7 - 0
yujing-common/src/main/java/com/cn/tianji/service/WorkingConditionCalculationLogService.java

@@ -0,0 +1,7 @@
+package com.cn.tianji.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.cn.tianji.entity.WorkingConditionCalculationLog;
+
+public interface WorkingConditionCalculationLogService  extends IService<WorkingConditionCalculationLog> {
+}

+ 93 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/AjhServiceImpl.java

@@ -0,0 +1,93 @@
+package com.cn.tianji.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.common.StringUtils;
+import com.cn.tianji.entity.Ajh;
+import com.cn.tianji.mapper.AjhMapper;
+import com.cn.tianji.service.AjhService;
+import com.cn.tianji.service.WlwmroDataService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.management.Query;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Zhao RenJi
+ */
+@Service
+@Slf4j
+public class AjhServiceImpl extends ServiceImpl<AjhMapper, Ajh> implements AjhService {
+
+    @Resource
+    private WlwmroDataService wlwmroDataService;
+
+
+    @Override
+    public void saveData(String jh) {
+        log.info("开始更新井号:{}", jh);
+        QueryWrapper<Ajh> wrapper = new QueryWrapper<>();
+        wrapper.lambda().eq(Ajh::getJH, jh);
+        Ajh one = this.getOne(wrapper);
+        if (StringUtils.isNull(one)) {
+            List<Map<String, String>> zjrb3Maps = wlwmroDataService.selectZjrb3ByJh(jh);
+            log.info("钻井日报数据:{}",zjrb3Maps);
+            if (zjrb3Maps != null) {
+                if (zjrb3Maps.size() > 0) {
+                    Map<String, String> zjrb3Map = zjrb3Maps.get(0);
+                    Ajh saveModel = getAjhModel(jh, zjrb3Map);
+                    log.info("要存的井号数据1:{}", saveModel);
+                    this.save(saveModel);
+                }else{
+                    Ajh saveModel = getAjhModelNull(jh);
+                    log.info("要存的井号数据2:{}", saveModel);
+                    this.save(saveModel);
+                }
+            }else{
+                Ajh saveModel = getAjhModelNull(jh);
+                log.info("要存的井号数据2:{}", saveModel);
+                this.save(saveModel);
+            }
+        } else {
+            log.info("井号已存在:{}", jh);
+        }
+    }
+
+    public Ajh getAjhModel(String jh, Map<String, String> zjrb3Map) {
+        Ajh saveModel = new Ajh();
+        saveModel.setJH(jh);
+        saveModel.setZjy(0);
+        saveModel.setLtd(1);
+        saveModel.setDH(zjrb3Map.get("DH")==null?"":zjrb3Map.get("DH"));
+        saveModel.setSGYQ(zjrb3Map.get("SGYQ")==null?"":zjrb3Map.get("SGYQ").toString());
+        saveModel.setSJDW(zjrb3Map.get("DWMC")==null?"":zjrb3Map.get("DWMC").toString());
+        saveModel.setKZRQ(zjrb3Map.get("KZRQ")==null?"":zjrb3Map.get("KZRQ").toString());
+        saveModel.setZjyDay("");
+        saveModel.setDT(zjrb3Map.get("DT")==null?"":zjrb3Map.get("DT").toString());
+        saveModel.setEJDW(zjrb3Map.get("DWMC")==null?"":zjrb3Map.get("DWMC").toString());
+        saveModel.setJJRQ("");
+        saveModel.setLtdDay(zjrb3Map.get("RQ")==null?"":zjrb3Map.get("RQ").toString());
+        saveModel.setFOCUS("");
+        saveModel.setJFDW(zjrb3Map.get("JFDW")==null?"":zjrb3Map.get("JFDW").toString());
+        saveModel.setSGDD(zjrb3Map.get("SGDD")==null?"":zjrb3Map.get("SGDD").toString());
+        saveModel.setJB(zjrb3Map.get("JB")==null?"":zjrb3Map.get("JB").toString());
+        saveModel.setJB(zjrb3Map.get("JX")==null?"":zjrb3Map.get("JX").toString());
+        saveModel.setNOTFOUND("0");
+        saveModel.setDSSJ(zjrb3Map.get("DSJS")==null?"":zjrb3Map.get("DSJS").toString());
+        saveModel.setSJJS(zjrb3Map.get("SJJS")==null?"":zjrb3Map.get("SJJS").toString());
+        return saveModel;
+    }
+    public Ajh getAjhModelNull(String jh) {
+        Ajh saveModel = new Ajh();
+        saveModel.setJH(jh);
+        saveModel.setZjy(0);
+        saveModel.setLtd(1);
+        saveModel.setSJDW("其他");
+        saveModel.setEJDW("其他");
+        return saveModel;
+    }
+
+}

+ 18 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/ComprehensiveLogServiceImpl.java

@@ -0,0 +1,18 @@
+package com.cn.tianji.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.ComprehensiveLog;
+import com.cn.tianji.entity.OperatingConditionThreshold;
+import com.cn.tianji.mapper.ComprehensiveLogMapper;
+import com.cn.tianji.mapper.OperatingConditionThresholdMapper;
+import com.cn.tianji.service.ComprehensiveLogService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 综合异常日志信息;(comprehensive_log)表服务实现类
+ * @author : http://www.chiner.pro
+ * @date : 2024-9-18
+ */
+@Service
+public class ComprehensiveLogServiceImpl extends ServiceImpl<ComprehensiveLogMapper, ComprehensiveLog> implements ComprehensiveLogService {
+}

+ 242 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/HookLoadWarnLogServiceImpl.java

@@ -0,0 +1,242 @@
+package com.cn.tianji.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.HookLoadWarnLog;
+import com.cn.tianji.entity.WellDrilling;
+import com.cn.tianji.mapper.HookLoadWarnLogMapper;
+import com.cn.tianji.service.HookLoadWarnLogService;
+import lombok.SneakyThrows;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@Service
+public class HookLoadWarnLogServiceImpl  extends ServiceImpl<HookLoadWarnLogMapper, HookLoadWarnLog> implements HookLoadWarnLogService {
+
+    @Autowired
+    private HookLoadWarnLogMapper hookLoadWarnLogMapper;
+
+    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    @Override
+    public HookLoadWarnLog queryById(String id){
+        return hookLoadWarnLogMapper.selectById(id);
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param hookLoadWarnLog 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public HookLoadWarnLog insert(HookLoadWarnLog hookLoadWarnLog){
+        hookLoadWarnLogMapper.insert(hookLoadWarnLog);
+        return hookLoadWarnLog;
+    }
+
+    /**
+     * 更新数据
+     *
+     * @param hookLoadWarnLog 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public HookLoadWarnLog update(HookLoadWarnLog hookLoadWarnLog){
+        //1. 根据条件动态更新
+        LambdaUpdateChainWrapper<HookLoadWarnLog> chainWrapper = new LambdaUpdateChainWrapper<HookLoadWarnLog>(hookLoadWarnLogMapper);
+        if(StrUtil.isNotBlank(hookLoadWarnLog.getJh())){
+            chainWrapper.eq(HookLoadWarnLog::getJh, hookLoadWarnLog.getJh());
+        }
+        if(StrUtil.isNotBlank(hookLoadWarnLog.getMotion())){
+            chainWrapper.eq(HookLoadWarnLog::getMotion, hookLoadWarnLog.getMotion());
+        }
+        if(StrUtil.isNotBlank(hookLoadWarnLog.getWorkingCondition())){
+            chainWrapper.eq(HookLoadWarnLog::getWorkingCondition, hookLoadWarnLog.getWorkingCondition());
+        }
+        if(StrUtil.isNotBlank(hookLoadWarnLog.getWarnDes())){
+            chainWrapper.eq(HookLoadWarnLog::getWarnDes, hookLoadWarnLog.getWarnDes());
+        }
+        if(StrUtil.isNotBlank(hookLoadWarnLog.getRemake())){
+            chainWrapper.eq(HookLoadWarnLog::getRemake, hookLoadWarnLog.getRemake());
+        }
+        //2. 设置主键,并更新
+        chainWrapper.set(HookLoadWarnLog::getId, hookLoadWarnLog.getId());
+        boolean ret = chainWrapper.update();
+        //3. 更新成功了,查询最最对象返回
+        if(ret){
+            return queryById(hookLoadWarnLog.getId());
+        }else{
+            return hookLoadWarnLog;
+        }
+    }
+
+    /**
+     * 插入预警数据
+     * @param nowPoint 当前点数据
+     * @param workingCondition 工况
+     * @param workingConditionType 预警点工况类别:起钻、下钻、起钻——活动钻具、下钻-活动钻具、钻进活动钻具
+     * @param motion 动作
+     * @param referenceStartTime 参考柱起点时间
+     * @param referenceEndTime 参考柱结束时间
+     * @param referenceMaxWoh 参考柱钩载最大值
+     * @param referenceMinWoh 参考柱钩载最小值
+     * @param referenceWoh 参考柱钩载值
+     * @param columnWeight 钻杆重量
+     * @param warnValue 预警值
+     */
+    @SneakyThrows
+    @Override
+    public void saveHookLoadWarnLog(WellDrilling nowPoint, String workingCondition, String workingConditionType, String motion,
+                                    String referenceStartTime, String referenceEndTime, BigDecimal referenceWoh, BigDecimal referenceMaxWoh, BigDecimal referenceMinWoh,
+                                    BigDecimal columnWeight, BigDecimal warnValue){
+        String warnDesc="符合钩载变化异常预警条件:"+
+                " <br> 当前点时间" + nowPoint.getTime()+"; 当前点大钩负荷:" + nowPoint.getWoh() + " KN,"  +
+                ",<br> 参考柱起点时间:" + referenceStartTime + ",参考柱结束时间:" + referenceEndTime +",参考柱钩载:" + referenceWoh + " KN, "+
+                ",钻杆重量:" + columnWeight + " KN,<br> 大于预警值:" + warnValue + " KN ";
+        HookLoadWarnLog model=new HookLoadWarnLog();
+        model.setWarnTime(sdf.parse(nowPoint.getTime()));
+        model.setWarnWoh(nowPoint.getWoh());
+        model.setWarnHkh(nowPoint.getHkh());
+        model.setWarnBitdepth(nowPoint.getBitdepth());
+        model.setWorkingCondition(workingCondition);
+        model.setWorkingConditionType(workingConditionType);
+        model.setJh(nowPoint.getJh());
+        model.setMotion(motion);
+        model.setReferenceStartTime(sdf.parse(referenceStartTime));
+        model.setReferenceEndTime(sdf.parse(referenceEndTime));
+        model.setReferenceWoh(referenceWoh);
+        model.setReferenceMaxWoh(referenceMaxWoh);
+        model.setReferenceMinWoh(referenceMinWoh);
+        model.setColumnWeight(columnWeight);
+        model.setWarnValue(warnValue);
+        model.setWarnDes(warnDesc);
+        model.setCreateTime(new Date());
+        hookLoadWarnLogMapper.insert(model);
+    }
+
+    /**
+     * 插入活动钻具钩载预警数据
+     * @param jh 井号
+     * @param workingCondition 工况
+     * @param workingConditionType 预警点工况类别:起钻、下钻、起钻——活动钻具、下钻-活动钻具、钻进活动钻具
+     * @param motion 动作
+     * @param mobilDrillingToolsStartTime 活动钻具起点时间
+     * @param mobilDrillingToolsEndTime 活动钻具结束时间
+     * @param mobilDrillingToolsWoh 活动钻具钩载
+     * @param mobilDrillingToolsMaxWoh 活动钻具钩载最大值
+     * @param mobilDrillingToolsMinWoh 活动组那句钩载最小值
+     * @param referenceStartTime 参考柱起点时间
+     * @param referenceEndTime 参考柱结束时间
+     * @param referenceWoh 参考柱钩载值
+     * @param referenceMaxWoh 参考柱钩载最大值
+     * @param referenceMinWoh 参考柱钩载最小值
+     * @param warnValue 预警值
+     */
+    @SneakyThrows
+    @Override
+    public void saveMobilDrillingToolsHookLoadWarnLog(String jh,String workingCondition,String workingConditionType,String motion,
+                                                      String mobilDrillingToolsStartTime,String mobilDrillingToolsEndTime,BigDecimal mobilDrillingToolsWoh,BigDecimal mobilDrillingToolsMaxWoh,BigDecimal mobilDrillingToolsMinWoh,
+                                                      String referenceStartTime,String referenceEndTime,BigDecimal referenceWoh, BigDecimal referenceMaxWoh,BigDecimal referenceMinWoh,
+                                                      BigDecimal warnValue){
+        String warnDesc="符合钩载变化异常预警条件 "+
+                "<br> 活动钻具钩载波动值:"+ mobilDrillingToolsWoh +" KN, 活动钻具起点时间:"+mobilDrillingToolsStartTime+" ,活动钻具结束时间:"+mobilDrillingToolsEndTime+
+                ",<br> 活动钻具参考钩载:" + referenceWoh + " KN,参考柱起点时间:" + referenceStartTime + ",参考柱结束时间:" + referenceEndTime +
+                ",<br> 大于预警值:" + warnValue + " KN ";
+        HookLoadWarnLog model=new HookLoadWarnLog();
+        model.setMobilDrillingToolsStartTime(sdf.parse(mobilDrillingToolsStartTime));
+        model.setMobilDrillingToolsEndTime(sdf.parse(mobilDrillingToolsEndTime));
+        model.setMobilDrillingToolsWoh(mobilDrillingToolsWoh);
+        model.setMobilDrillingToolsMaxWoh(mobilDrillingToolsMaxWoh);
+        model.setMobilDrillingToolsMinWoh(mobilDrillingToolsMinWoh);
+
+        model.setJh(jh);
+        model.setWarnTime(sdf.parse(mobilDrillingToolsEndTime));
+        model.setMotion(motion);
+        model.setWorkingCondition(workingCondition);
+        model.setWorkingConditionType(workingConditionType);
+        model.setReferenceStartTime(sdf.parse(referenceStartTime));
+        model.setReferenceStartTime(sdf.parse(referenceEndTime));
+        model.setReferenceMaxWoh(referenceMaxWoh);
+        model.setReferenceMinWoh(referenceMinWoh);
+        model.setReferenceWoh(referenceWoh);
+        model.setWarnValue(warnValue);
+        model.setWarnDes(warnDesc);
+        model.setCreateTime(new Date());
+        hookLoadWarnLogMapper.insert(model);
+    }
+
+    /**
+     * 生成新的活动钻具算法预警实体类
+     * @param jh 井号
+     * @param workingCondition 工况
+     * @param workingConditionType 预警点工况类别:起钻、下钻、起钻——活动钻具、下钻-活动钻具、钻进活动钻具
+     * @param motion 动作
+     * @param mobilDrillingToolsWoh 活动钻具钩载波动值
+     * @param hkhSub 钻头位置差值
+     * @param mobilDrillingToolsStartTime 活动钻具开始时间
+     * @param mobilDrillingToolsMaxWoh 活动钻具钩载最大值
+     * @param mobilDrillingToolsMinWoh 活动钻具钩载最小值
+     * @param mobilDrillingToolsEndTime 活动钻具结束时间
+     * @param hkhStart 钻头起点位置
+     * @param hkhEnd 钻头结束位置
+     * @param wohHkhRes 钩载除以钻头位置值
+     * @param warnValue 预警值
+     * @return HookLoadWarnLog
+     */
+    @Override
+    @SneakyThrows
+    public HookLoadWarnLog creatNewMobilDrillingToolsHookLoadWarnLog(String jh,String workingCondition,String workingConditionType,String motion,
+                                                         BigDecimal mobilDrillingToolsWoh,BigDecimal hkhSub,String mobilDrillingToolsStartTime,
+                                                         BigDecimal mobilDrillingToolsMaxWoh,BigDecimal mobilDrillingToolsMinWoh,
+                                                         String mobilDrillingToolsEndTime,BigDecimal hkhStart,BigDecimal hkhEnd,
+                                                         BigDecimal wohHkhRes,BigDecimal warnValue){
+        HookLoadWarnLog model=new HookLoadWarnLog();
+        String warnDesc="符合钩载变化异常预警条件 (活动钻具):"+
+                "<br> 钩载波动值:"+mobilDrillingToolsWoh+" KN ;  钻头位置差值: "+hkhSub+" m ;"+
+                "<br> 活动钻具起点时间:"+mobilDrillingToolsStartTime+"; 活动钻具结束时间"+mobilDrillingToolsEndTime+
+                "<br> 大钩起点位置:"+hkhStart+" m ; 活动钻具结束位置"+hkhEnd+" m;"+
+                "<br> 钩载波动值/钻头位置差值:"+wohHkhRes+" KN/m ; 预警值"+warnValue+" KN/m ;";
+        model.setJh(jh);
+        model.setMotion(motion);
+        model.setWorkingCondition(workingCondition);
+        model.setWorkingConditionType(workingConditionType);
+
+        if(!StrUtil.isEmpty(mobilDrillingToolsEndTime)){
+            model.setWarnTime(sdf.parse(mobilDrillingToolsEndTime));
+        }
+        model.setWarnWoh(mobilDrillingToolsWoh);
+        model.setWarnBitdepth(hkhEnd);
+
+        if(!StrUtil.isEmpty(mobilDrillingToolsStartTime)) {
+            model.setMobilDrillingToolsStartTime(sdf.parse(mobilDrillingToolsStartTime));
+        }
+        if(!StrUtil.isEmpty(mobilDrillingToolsEndTime)) {
+            model.setMobilDrillingToolsEndTime(sdf.parse(mobilDrillingToolsEndTime));
+        }
+        model.setMobilDrillingToolsWoh(mobilDrillingToolsWoh);
+        model.setMobilDrillingToolsMaxWoh(mobilDrillingToolsMaxWoh);
+        model.setMobilDrillingToolsMinWoh(mobilDrillingToolsMinWoh);
+
+        model.setHkhStart(hkhStart);
+        model.setHkhEnd(hkhEnd);
+        model.setHkhSub(hkhSub);
+        model.setHkhWoh(wohHkhRes);
+
+        model.setWarnValue(warnValue);
+        model.setWarnDes(warnDesc);
+        model.setCreateTime(new Date());
+        return model;
+    }
+}

+ 14 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/OperatingConditionThresholdServiceImpl.java

@@ -0,0 +1,14 @@
+package com.cn.tianji.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.OperatingConditionThreshold;
+import com.cn.tianji.mapper.OperatingConditionThresholdMapper;
+import com.cn.tianji.service.OperatingConditionThresholdService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author Zhao RenJi
+ */
+@Service
+public class OperatingConditionThresholdServiceImpl  extends ServiceImpl<OperatingConditionThresholdMapper, OperatingConditionThreshold> implements OperatingConditionThresholdService {
+}

+ 303 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/PullDataSICPServiceImpl.java

@@ -0,0 +1,303 @@
+package com.cn.tianji.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.cn.tianji.common.CommonUtils;
+import com.cn.tianji.common.HttpUtil;
+import com.cn.tianji.entity.SyncRecord;
+import com.cn.tianji.entity.WellDrillingSICP;
+import com.cn.tianji.entity.WellName;
+import com.cn.tianji.service.PullDataSICPService;
+import com.cn.tianji.service.SyncRecordService;
+import com.cn.tianji.service.WellDrillingSICPService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.stream.Collectors;
+
+/**
+ * SICP数据采集业务逻辑层
+ *
+ * @author Zhao RenJi
+ */
+@Service
+@Slf4j
+public class PullDataSICPServiceImpl implements PullDataSICPService {
+
+    @Resource
+    private WellDrillingSICPService wellDrillingSICPService;
+
+    @Resource
+    private SyncRecordService syncRecordService;
+
+    SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+    @Autowired
+    private ApplicationContext context;
+
+
+
+    /**
+     * 更新采集井数据列表
+     */
+    @Override
+    public void updatePullJhList(){
+        //获取最新在线井数据
+        List<WellName> allJhSicp = getAllJhSicp();
+        //获取数据库中所有井表名
+        List<String> tablesFromDbAll = wellDrillingSICPService.getTablesFromDb();
+        //log.info("所有的数据表:{}",tablesFromDbAll);
+        //根据前缀筛选表名数据
+        List<String> tablesFromDb =filterEntitiesByPrefix(tablesFromDbAll,"SICP");
+        //tablesFromDb.forEach(item->{item.replace("\"","");});
+        log.info("数据库SICP_表名:{}",tablesFromDb);
+        allJhSicp.forEach(item->{
+            String sicpTableName=item.getWellTableNameSicp();
+            //log.info("sicpTableName:{}",sicpTableName);
+            if(!tablesFromDb.contains(("\""+sicpTableName+"\""))){
+                //数据库中不存在该井表创建该井表数据
+                log.info("创建井表:{}",sicpTableName);
+                wellDrillingSICPService.createTable("\""+sicpTableName+"\"",System.currentTimeMillis());
+                //插入该井采集数据;当前时间减去3分钟
+                Date nowDate=new Date();
+                Date specifiedTime = CommonUtils.getSpecifiedTime(nowDate, Calendar.MINUTE, -3);
+                SyncRecord model =new SyncRecord();
+                model.setId(UUID.randomUUID().toString());
+                model.setCollectTime(sdf.format(specifiedTime));
+                model.setTableType("SICP");
+                model.setTableName(sicpTableName);
+                log.info("新增采集sicp井数据:{}",model);
+                syncRecordService.save(model);
+            }
+        });
+        //批量采集数据
+        //collectWelLogBatch(allJhSicp);
+        listGrouping(allJhSicp);
+    }
+
+
+    /**
+     * 对数据进行分组,每10条数据为一组
+     * @param allList
+     */
+    public void listGrouping(List<WellName> allList){
+         ExecutorService fifoThreadPool=(ThreadPoolExecutor)context.getBean("fifoThreadPool");
+        List<List<WellName>> groupData = groupData(allList, 10);
+        groupData.forEach(item->{
+            fifoThreadPool.submit(() -> {
+                log.info("执行任务executed by:{}"  , Thread.currentThread().getName());
+                collectWelLogBatch(allList);
+            });
+        });
+    }
+
+    /**
+     * 数据分组方法
+     * @param dataList
+     * @param groupSize
+     * @return
+     */
+    public static List<List<WellName>> groupData(List<WellName> dataList, int groupSize) {
+        List<List<WellName>> groupedData = new ArrayList<>();
+        for (int i = 0; i < dataList.size(); i += groupSize) {
+            int end = Math.min(i + groupSize, dataList.size());
+            groupedData.add(dataList.subList(i, end));
+        }
+        return groupedData;
+    }
+
+    /**
+     * 批量采集录井数据
+     */
+    public void collectWelLogBatch(List<WellName> allList){
+        log.info("分组数据:{}",allList);
+        Date startDate=new Date();
+        log.info("开始时间:{}",sdf.format(startDate));
+        //根据井表名批量查询本次所有采集井上次采集时间数据
+//        allList.forEach(i->{i.setWellTableNameSicp("\""+i.getWellTableNameSicp()+"\"");});
+        List<String> jhTables = allList.stream().map(WellName::getWellTableNameSicp).collect(Collectors.toList());
+        List<SyncRecord> syncRecordList = getSyncRecordList(jhTables);
+        //循环所有得井
+        allList.forEach(item->{
+            //根据井名查询数据采集表该井上次数据采集时间
+            List<SyncRecord> syncRecords = syncRecordList.stream().filter(items -> items.getTableName().equals(item.getWellTableNameSicp())).collect(Collectors.toList());
+            //判断该井是否存在数据采集时间
+            SyncRecord syncRecord = new SyncRecord();
+            String collectTime="";
+            //该井表是否存在最新采集时间
+            if(syncRecords.size()>0){
+                syncRecord=syncRecords.get(0);
+                collectTime = syncRecord.getCollectTime();
+            }else{
+                //不存在查询该井表最新采集时间
+                String jhTableName=item.getWellTableNameSicp().replace("\"","");
+                String maxTime = wellDrillingSICPService.selectMaxTime(jhTableName);
+                if(maxTime != null){
+                    collectTime=maxTime;
+                }else{
+                    Date nowDate=new Date();
+                    Date specifiedTime = CommonUtils.getSpecifiedTime(nowDate, Calendar.MINUTE, -3);
+                    collectTime= sdf.format(specifiedTime);
+                }
+                syncRecord.setId(UUID.randomUUID().toString());
+                syncRecord.setTableType("SICP");
+                syncRecord.setTableName(item.getWellTableNameSicp());
+                syncRecord.setCollectTime(collectTime);
+                log.info("新增采集sicp井数据:{}",syncRecord);
+                syncRecordService.save(syncRecord);
+            }
+            //根据井号获取该井录井数据
+            List<WellDrillingSICP> sicpWellDataByJhTime = getSicpWellDataByJhTime(item.getWellName(), collectTime);
+            log.info("采集井:井号:{},时间:{}",item.getWellTableNameSicp(),collectTime);
+            if(sicpWellDataByJhTime.size()>0){
+                //批量插入录井数据
+                int i = wellDrillingSICPService.insertTableBatch(item.getWellTableNameSicp(), sicpWellDataByJhTime);
+                //更新采集时间
+                if(sicpWellDataByJhTime.size()>0){
+                    WellDrillingSICP wellDrillingSICP = sicpWellDataByJhTime.get(sicpWellDataByJhTime.size() - 1);
+                    String time = wellDrillingSICP.getTIME();
+                    syncRecord.setCollectTime(time);
+                }
+            }
+            //更新采集时间
+            log.info("更新采集时间:{};井号:{}",syncRecord.getCollectTime(),syncRecord.getTableName());
+            syncRecordService.updateById(syncRecord);
+
+        });
+        Date endDate=new Date();
+        long l = CommonUtils.timeDifference(startDate, endDate);
+        log.info("结束时间:{};耗时:{}秒",sdf.format(endDate),l);
+    }
+
+
+    public List<SyncRecord> getSyncRecordList(List<String> jhTables){
+        QueryWrapper<SyncRecord> wrapper=new QueryWrapper<>();
+        wrapper.lambda().in(SyncRecord::getTableName,jhTables).eq(SyncRecord::getTableType,"SICP");
+        return syncRecordService.list(wrapper);
+    }
+    /**
+     * 获取所有井数据
+     *
+     * @return
+     */
+    @Override
+    public List<WellName> getAllJhSicp() {
+        String url = "http://10.68.224.20:15221/v1/structuredData/serviceData/SICPALLJH?app_key=SICP";
+        log.info("请求获取井号地址:{}", url);
+        JSONObject params = new JSONObject();
+        JSONObject data = postHttpData(url, params);
+        List<WellName> wellNameList = new ArrayList<>();
+        JSONArray rows = data.getJSONArray("rows");
+        JSONObject o = JSONObject.parseObject(String.valueOf(rows.get(0)));
+        String alljh = o.getString("alljh");
+        String[] split = alljh.split("、");
+        for (String jh : split) {
+            WellName model = new WellName();
+            model.setWellName(jh);
+            model.setWellTableNameSicp(getJhTableByType(jh, "SICP"));
+            model.setWellTableNameLtd(getJhTableByType(jh, "LTD"));
+            wellNameList.add(model);
+        }
+        return wellNameList;
+    }
+
+
+    /**
+     * 根据井号及时间采集单井录井数据
+     *
+     * @param jh
+     * @param startTime
+     */
+    @Override
+    public List<WellDrillingSICP> getSicpWellDataByJhTime(String jh, String startTime) {
+        String url = "http://10.68.224.20:15221/v1/structuredData/serviceData/SICP3M?app_key=YF";
+        JSONObject params = new JSONObject();
+        JSONObject conditionJh = new JSONObject();
+        conditionJh.put("condition", jh);
+        JSONObject conditionTime = new JSONObject();
+        conditionTime.put("condition", startTime);
+        params.put("jh", conditionJh);
+        params.put("kssj", conditionTime);
+        JSONObject data = postHttpData(url, params);
+        JSONArray rows = data.getJSONArray("rows");
+        List<WellDrillingSICP> list = new ArrayList<>();
+        for (Object item : rows) {
+            // 打印传递的消息
+            WellDrillingSICP model = JSONObject.parseObject(String.valueOf(item), WellDrillingSICP.class);
+            String jrtime = model.getJRTIME();
+            String time = model.getTIME();
+            if (jrtime.contains("+")) {
+                int i = jrtime.indexOf("+");
+                String jrtimes = jrtime.substring(0, i);
+                model.setJRTIME(jrtimes);
+            }
+            if (time.contains("+")) {
+                int i = time.indexOf("+");
+                String times = time.substring(0, i);
+                model.setTIME(times);
+            }
+            list.add(model);
+        }
+        return list;
+    }
+
+    /**
+     * post请求获取数据
+     *
+     * @param url
+     * @param params
+     * @return
+     */
+    public JSONObject postHttpData(String url, JSONObject params) {
+        String resultJson = HttpUtil.sendPost(url, String.valueOf(params));
+        JSONObject obj = JSONObject.parseObject(resultJson);
+        String statusCode = obj.getString("statusCode");
+        JSONObject res = new JSONObject();
+        if ("000".equals(statusCode)) {
+            res = obj.getJSONObject("data");
+        }
+        return res;
+    }
+
+
+    /**
+     * 根据类别将类别加到井号前缀
+     * @param jh 井号
+     * @param type 类别
+     * @return 井表名:LTD(SICP)_jh
+     */
+    public String getJhTableByType(String jh, String type) {
+        return type + "_" + jh.replace("-", "_");
+    }
+
+    /**
+     * 根据前缀筛选实体列表
+     *
+     * @param entities 原始实体列表
+     * @param prefix   要筛选的前缀
+     * @return 筛选后的实体列表
+     */
+    public List<String> filterEntitiesByPrefix(List<String> entities, String prefix) {
+        log.info("筛选前的数据:{}",entities);
+        log.info("筛选前的前缀:{}",prefix);
+//        // 过滤出以prefix开头的字符串 收集结果到新的列表中
+//        entities.stream().forEach(item->{
+//            log.info(item.replace("\"",""));
+//            log.info(String.valueOf(item.replace("\"","").startsWith("SICP")));
+//        });
+        List<String> filteredList = entities.stream().filter(item -> item.replace("\"","").startsWith(prefix)).collect(Collectors.toList());
+        log.info("筛选后的数据:{}",filteredList);
+        filteredList.forEach(item->item.replace("\"",""));
+        return filteredList;
+    }
+
+
+}

+ 120 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/PumpingPressureWarnLogServiceImpl.java

@@ -0,0 +1,120 @@
+package com.cn.tianji.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.PumpingPressureWarnLog;
+import com.cn.tianji.mapper.PumpingPressureWarnLogMapper;
+import com.cn.tianji.service.PumpingPressureWarnLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 泵压预警数据;(pumping_pressure_warn_log)表服务实现类
+ * @author : http://www.chiner.pro
+ * @date : 2024-6-6
+ */
+@Service
+public class PumpingPressureWarnLogServiceImpl  extends ServiceImpl<PumpingPressureWarnLogMapper, PumpingPressureWarnLog> implements PumpingPressureWarnLogService {
+
+    @Autowired
+    private PumpingPressureWarnLogMapper pumpingPressureWarnLogMapper;
+
+    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param jh 主键
+     * @return 实例对象
+     */
+    @Override
+    public PumpingPressureWarnLog queryById(String jh){
+        return pumpingPressureWarnLogMapper.selectById(jh);
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param pumpingPressureWarnLog 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public PumpingPressureWarnLog insert(PumpingPressureWarnLog pumpingPressureWarnLog){
+        pumpingPressureWarnLogMapper.insert(pumpingPressureWarnLog);
+        return pumpingPressureWarnLog;
+    }
+
+    /**
+     * 更新数据
+     *
+     * @param pumpingPressureWarnLog 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public PumpingPressureWarnLog update(PumpingPressureWarnLog pumpingPressureWarnLog){
+        //1. 根据条件动态更新
+        LambdaUpdateChainWrapper<PumpingPressureWarnLog> chainWrapper = new LambdaUpdateChainWrapper<PumpingPressureWarnLog>(pumpingPressureWarnLogMapper);
+        if(StrUtil.isNotBlank(pumpingPressureWarnLog.getId())){
+            chainWrapper.eq(PumpingPressureWarnLog::getId, pumpingPressureWarnLog.getId());
+        }
+        if(StrUtil.isNotBlank(pumpingPressureWarnLog.getMotion())){
+            chainWrapper.eq(PumpingPressureWarnLog::getMotion, pumpingPressureWarnLog.getMotion());
+        }
+        if(StrUtil.isNotBlank(pumpingPressureWarnLog.getWorkingCondition())){
+            chainWrapper.eq(PumpingPressureWarnLog::getWorkingCondition, pumpingPressureWarnLog.getWorkingCondition());
+        }
+        //2. 设置主键,并更新
+        chainWrapper.set(PumpingPressureWarnLog::getJh, pumpingPressureWarnLog.getJh());
+        boolean ret = chainWrapper.update();
+        //3. 更新成功了,查询最最对象返回
+        if(ret){
+            return queryById(pumpingPressureWarnLog.getJh());
+        }else{
+            return pumpingPressureWarnLog;
+        }
+    }
+
+    /**
+     * 生成泵压预警日志数据实体类
+     * @param jh 井号
+     * @param workingCondition 工况
+     * @param motion 动作
+     * @param warnTime 预警点时间
+     * @param warnSpp 预警点立管压力
+     * @param warnTotalPump 预警点总泵冲
+     * @param referenceTime 参考点时间
+     * @param referenceSpp 参考点立管压力
+     * @param referenceTotalPump 参考点总泵冲
+     * @param totalPumpSub 立管压力差值
+     * @param sppSub 立管压力差值
+     * @param sppWarnValue 立管压力阈值
+     * @param pumpWarnValue 总泵冲阈值
+     * @return PumpingPressureWarnLog
+     */
+    @Override
+    public PumpingPressureWarnLog createPumpingPressureWarnLog(String jh, String workingCondition , String motion, Date warnTime, BigDecimal warnSpp,BigDecimal warnTotalPump,
+                                             Date referenceTime,BigDecimal referenceSpp,BigDecimal referenceTotalPump,BigDecimal totalPumpSub,BigDecimal sppSub,BigDecimal sppWarnValue,BigDecimal pumpWarnValue){
+        PumpingPressureWarnLog model=new PumpingPressureWarnLog();
+        String warnDes="符合泵压变化异常预警条件:<br>当前点立压:"+warnSpp+" Mpa,当前点时间:"+ sdf.format(warnTime)+";<br>参考点立压:"+referenceSpp+" Mpa,参考点时间:"+sdf.format(referenceTime)+";<br> 泵压差值:"+sppSub+" Mpa;满足阈值:"+sppWarnValue+"%)";
+        model.setJh(jh);
+        model.setWorkingCondition(workingCondition);
+        model.setMotion(motion);
+        model.setWarnTime(warnTime);
+        model.setWarnSpp(warnSpp);
+        model.setWarnTotalPump(warnTotalPump);
+        model.setReferenceTime(referenceTime);
+        model.setReferenceSpp(referenceSpp);
+        model.setReferenceTotalPump(referenceTotalPump);
+        model.setSppWarnValue(sppWarnValue);
+        model.setPumpWarnValue(pumpWarnValue);
+        model.setTotalPumpSub(totalPumpSub);
+        model.setSppSub(sppSub);
+        model.setWarnDes(warnDes);
+        model.setCreateTime(new Date());
+        return model;
+    }
+}

+ 31 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/SyncRecordServiceImpl.java

@@ -0,0 +1,31 @@
+package com.cn.tianji.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.PumpingPressureWarnLog;
+import com.cn.tianji.entity.SyncRecord;
+import com.cn.tianji.mapper.PumpingPressureWarnLogMapper;
+import com.cn.tianji.mapper.SyncRecordMapper;
+import com.cn.tianji.service.PumpingPressureWarnLogService;
+import com.cn.tianji.service.SyncRecordService;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author Zhao RenJi
+ */
+@Service
+@DS("yjDataSource")
+public class SyncRecordServiceImpl extends ServiceImpl<SyncRecordMapper, SyncRecord> implements SyncRecordService {
+
+    @Override
+    public int insert(SyncRecord paramSyncRecord) {
+        return baseMapper.insert(paramSyncRecord);
+    }
+
+    @Override
+    public int updateTimeById( SyncRecord paramSyncRecord){
+        return baseMapper.updateTimeById(paramSyncRecord);
+    };
+
+}

+ 171 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/TorqueWarnLogServiceImpl.java

@@ -0,0 +1,171 @@
+package com.cn.tianji.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.TorqueWarnLog;
+import com.cn.tianji.mapper.TorqueWarnLogMapper;
+import com.cn.tianji.service.TorqueWarnLogService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 扭矩预警日志表;(torque_warn_log)表服务实现类
+ * @author : http://www.chiner.pro
+ * @date : 2024-6-13
+ */
+@Service
+@Slf4j
+public class TorqueWarnLogServiceImpl  extends ServiceImpl<TorqueWarnLogMapper, TorqueWarnLog> implements TorqueWarnLogService {
+
+    @Resource
+    private TorqueWarnLogMapper torqueWarnLogMapper;
+    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    @Override
+    public TorqueWarnLog queryById(String id){
+        return torqueWarnLogMapper.selectById(id);
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param torqueWarnLog 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public TorqueWarnLog insert(TorqueWarnLog torqueWarnLog){
+        torqueWarnLogMapper.insert(torqueWarnLog);
+        return torqueWarnLog;
+    }
+
+    /**
+     * 更新数据
+     *
+     * @param torqueWarnLog 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public TorqueWarnLog update(TorqueWarnLog torqueWarnLog){
+        //1. 根据条件动态更新
+        LambdaUpdateChainWrapper<TorqueWarnLog> chainWrapper = new LambdaUpdateChainWrapper<TorqueWarnLog>(torqueWarnLogMapper);
+        if(StrUtil.isNotBlank(torqueWarnLog.getJh())){
+            chainWrapper.eq(TorqueWarnLog::getJh, torqueWarnLog.getJh());
+        }
+        if(StrUtil.isNotBlank(torqueWarnLog.getMotion())){
+            chainWrapper.eq(TorqueWarnLog::getMotion, torqueWarnLog.getMotion());
+        }
+        if(StrUtil.isNotBlank(torqueWarnLog.getWorkingCondition())){
+            chainWrapper.eq(TorqueWarnLog::getWorkingCondition, torqueWarnLog.getWorkingCondition());
+        }
+        //2. 设置主键,并更新
+        chainWrapper.set(TorqueWarnLog::getId, torqueWarnLog.getId());
+        boolean ret = chainWrapper.update();
+        //3. 更新成功了,查询最最对象返回
+        if(ret){
+            return queryById(torqueWarnLog.getId());
+        }else{
+            return torqueWarnLog;
+        }
+    }
+
+    /**
+     * 生成扭矩预警日志数据实体类
+     *
+     * @param jh 井号
+     * @param workingCondition 预警点工况
+     * @param motion 预警点动作
+     * @param warnStartTime 预警取值开始时间
+     * @param warnEndTime 预警取值结束时间
+     * @param warnTorque 预警点扭矩
+     * @param warnMeanValue 预警点扭矩均值
+     * @param warnFluctuatedValue 预警点扭矩波动值
+     * @param warnBitdepth 预警点钻头位置
+     * @param warnDepth 预警点井深
+     * @param referenceStartTime 参考值起点时间
+     * @param referenceEndTime 参考值结束时间
+     * @param referenceMeanValue 参考值扭矩均值
+     * @param referenceFluctuatedValue 参考值扭矩波动值
+     * @param resMeanValue 均值计算结果值
+     * @param resFluctuatedValue 波动值计算结果值
+     * @param thresholdMeanValue 均值阈值
+     * @param thresholdFluctuatedValue 波动值阈值
+     * @return
+     */
+    @Override
+    public TorqueWarnLog createTorqueWarnLog(String jh, String workingCondition , String motion, Date warnStartTime, Date warnEndTime, BigDecimal warnTorque,BigDecimal warnMeanValue,BigDecimal warnFluctuatedValue,
+                                             BigDecimal warnBitdepth,BigDecimal warnDepth,Date referenceStartTime,Date referenceEndTime,BigDecimal referenceMeanValue,BigDecimal referenceFluctuatedValue, BigDecimal resMeanValue,
+                                             BigDecimal resFluctuatedValue,BigDecimal thresholdMeanValue,BigDecimal thresholdFluctuatedValue,String isMeanWarn,String isFluctuatedWarn
+                                             ){
+        TorqueWarnLog model=new TorqueWarnLog();
+        model.setJh(jh);
+        model.setWorkingCondition(workingCondition);
+        model.setMotion(motion);
+        model.setWarnStartTime(warnStartTime);
+        model.setWarnEndTime(warnEndTime);
+        model.setWarnTorque(warnTorque);
+        model.setWarnMeanValue(warnMeanValue);
+        model.setWarnFluctuatedValue(warnFluctuatedValue);
+        model.setWarnBitdepth(warnBitdepth);
+        model.setWarnDepth(warnDepth);
+        model.setReferenceStartTime(referenceStartTime);
+        model.setReferenceEndTime(referenceEndTime);
+        model.setReferenceMeanValue(referenceMeanValue);
+        model.setReferenceFluctuatedValue(referenceFluctuatedValue);
+        model.setResMeanValue(resMeanValue);
+        model.setResFluctuatedValue(resFluctuatedValue);
+        model.setThresholdMeanValue(thresholdMeanValue);
+        model.setThresholdFluctuatedValue(thresholdFluctuatedValue);
+        model.setCreateTime(new Date());
+        model.setIsMeanWarn(isMeanWarn);
+        model.setIsFluctuatedWarn(isFluctuatedWarn);
+        return model;
+    }
+
+    /**
+     * 新增扭矩预警日志
+     * @param model
+     */
+    @Override
+    public void saveTorqueWarnLog(TorqueWarnLog model){
+        String warnDes="";
+        String warnStart="符合扭矩变化异常预警条件";
+        String warnContent="预警点扭矩:"+model.getWarnTorque().setScale(2, RoundingMode.HALF_UP)+"KN; <br>预警取值起点时间:"+sdf.format(model.getWarnStartTime())+
+                "; 预警取值结束时间:"+sdf.format(model.getWarnEndTime())+"; <br>预警扭矩均值:"+model.getWarnMeanValue().setScale(2,RoundingMode.HALF_UP)+"KN; <br>预警扭矩波动值"+model.getWarnFluctuatedValue().setScale(2,RoundingMode.HALF_UP)+"KN; ";
+        String warnType="";
+        //参考值通用描述
+        String referenceContent="(参考值)取值起点时间:"+sdf.format(model.getReferenceStartTime())+"; 取值结束时间:"+sdf.format(model.getReferenceEndTime());
+        //均值参考值描述
+        String referenceMeanContent="(变化量)扭矩均值:"+model.getReferenceMeanValue().setScale(2,RoundingMode.HALF_UP)+"KN;  均值计算结果值:"+model.getResMeanValue().multiply(BigDecimal.valueOf(100)).setScale(2,RoundingMode.HALF_UP)+"%; 均值阈值:"+model.getThresholdMeanValue().multiply(BigDecimal.valueOf(100)).setScale(2,RoundingMode.HALF_UP)+"%。";
+        //拨动值参考值描述
+        String referenceFluctuatedContent="(波动幅度)扭矩波动值:"+model.getReferenceFluctuatedValue().setScale(2,RoundingMode.HALF_UP)+"KN; 波动值计算结果值:"+model.getResFluctuatedValue().multiply(BigDecimal.valueOf(100)).setScale(2,RoundingMode.HALF_UP)+"%; 波动值阈值:"+model.getThresholdFluctuatedValue().multiply(BigDecimal.valueOf(100)).setScale(2,RoundingMode.HALF_UP)+"%。 ";
+        String endContent="";
+        if("1".equals(model.getIsMeanWarn())&&"1".equals(model.getIsFluctuatedWarn())){
+            warnType="(变化量及波动异常)";
+            warnDes= warnStart+warnType+"<br>"+warnContent+"<br>"+referenceContent+"<br>"+referenceMeanContent+"<br>"+referenceFluctuatedContent+"<br>"+endContent;
+        }else{
+            if("1".equals(model.getIsMeanWarn())){
+                warnType="(变化量异常)";
+                warnDes= warnStart+warnType+"<br>"+warnContent+"<br>"+referenceContent+"<br>"+referenceMeanContent+"<br>"+endContent;
+            }else if("1".equals(model.getIsFluctuatedWarn())){
+                warnType="(波动异常)";
+                warnDes= warnStart+warnType+"<br>"+warnContent+"<br>"+referenceContent+"<br>"+referenceFluctuatedContent+"<br>"+endContent;
+            }
+        }
+        log.info(warnDes);
+        model.setWarnDes(warnDes);
+        insert(model);
+    }
+}

+ 136 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/TotalPoolVolumeWarnLogServiceImpl.java

@@ -0,0 +1,136 @@
+package com.cn.tianji.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.TotalPoolVolumeWarnLog;
+import com.cn.tianji.mapper.TotalPoolVolumeWarnLogMapper;
+import com.cn.tianji.service.TotalPoolVolumeWarnLogService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.xml.crypto.Data;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 总池体积预警数据日志表;(total_pool_volume_warn_log)表服务实现类
+ * @author : zrj
+ * @date : 2024-6-4
+ */
+@Slf4j
+@Service
+public class TotalPoolVolumeWarnLogServiceImpl  extends ServiceImpl<TotalPoolVolumeWarnLogMapper, TotalPoolVolumeWarnLog> implements TotalPoolVolumeWarnLogService {
+    @Autowired
+    private TotalPoolVolumeWarnLogMapper totalPoolVolumeWarnLogMapper;
+    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    @Override
+    public TotalPoolVolumeWarnLog queryById(String id){
+        return totalPoolVolumeWarnLogMapper.selectById(id);
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param totalPoolVolumeWarnLog 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public TotalPoolVolumeWarnLog insert(TotalPoolVolumeWarnLog totalPoolVolumeWarnLog){
+        totalPoolVolumeWarnLogMapper.insert(totalPoolVolumeWarnLog);
+        return totalPoolVolumeWarnLog;
+    }
+
+    /**
+     * 更新数据
+     *
+     * @param totalPoolVolumeWarnLog 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public TotalPoolVolumeWarnLog update(TotalPoolVolumeWarnLog totalPoolVolumeWarnLog){
+        //1. 根据条件动态更新
+        LambdaUpdateChainWrapper<TotalPoolVolumeWarnLog> chainWrapper = new LambdaUpdateChainWrapper<TotalPoolVolumeWarnLog>(totalPoolVolumeWarnLogMapper);
+        if(StrUtil.isNotBlank(totalPoolVolumeWarnLog.getJh())){
+            chainWrapper.eq(TotalPoolVolumeWarnLog::getJh, totalPoolVolumeWarnLog.getJh());
+        }
+        if(StrUtil.isNotBlank(totalPoolVolumeWarnLog.getMotion())){
+            chainWrapper.eq(TotalPoolVolumeWarnLog::getMotion, totalPoolVolumeWarnLog.getMotion());
+        }
+        if(StrUtil.isNotBlank(totalPoolVolumeWarnLog.getWorkingCondition())){
+            chainWrapper.eq(TotalPoolVolumeWarnLog::getWorkingCondition, totalPoolVolumeWarnLog.getWorkingCondition());
+        }
+        if(StrUtil.isNotBlank(totalPoolVolumeWarnLog.getTotalWarnType())){
+            chainWrapper.eq(TotalPoolVolumeWarnLog::getTotalWarnType, totalPoolVolumeWarnLog.getTotalWarnType());
+        }
+        //2. 设置主键,并更新
+        chainWrapper.set(TotalPoolVolumeWarnLog::getId, totalPoolVolumeWarnLog.getId());
+        boolean ret = chainWrapper.update();
+        //3. 更新成功了,查询最最对象返回
+        if(ret){
+            return queryById(totalPoolVolumeWarnLog.getId());
+        }else{
+            return totalPoolVolumeWarnLog;
+        }
+    }
+
+    /**
+     * 生成总池体积预警日志数据实体类
+     *
+     * @param jh 井号
+     * @param workingCondition 工况
+     * @param motion 动作
+     * @param warnType 预警类别
+     * @param warnTime 预警点时间
+     * @param warnPittotal 预警点总池体积
+     * @param referenceValue 5分钟总池体积变化参考值
+     * @param referenceStartTime  5分钟总池体积变化开始时间
+     * @param referenceEndTime 5分钟总池体积变化结束时间
+     * @param rateStartPittotal 30秒总池体积变化参考值
+     * @param rateStartTime 30秒总池体积变化开始时间
+     * @param rateEndTime 30秒总池体积变化结束时间
+     * @param pittotalSub  5分钟总池体积变化与当前点总池体积差值
+     * @param ratePittotalSub 30秒总池体积变化与当前点总池体积差值
+     * @param referenceWarnValue 5分钟总池体积变化预警阈值
+     * @param rateWarnValue 30秒总池体积变化预警阈值
+     * @param sizeStr 大于/小于
+     */
+    @Override
+    public TotalPoolVolumeWarnLog createTotalPoolVolumeWarnLog(String jh, String workingCondition , String motion, String warnType, Date warnTime, BigDecimal warnPittotal, BigDecimal referenceValue, Date referenceStartTime,
+                                           Date referenceEndTime,BigDecimal rateStartPittotal,Date rateStartTime,Date rateEndTime,BigDecimal pittotalSub,BigDecimal ratePittotalSub,BigDecimal referenceWarnValue,
+                                           BigDecimal rateWarnValue,String sizeStr){
+        TotalPoolVolumeWarnLog model=new TotalPoolVolumeWarnLog();
+        String warnDes="符合总池体积变化异常预警条件("+warnType+")"+"<br>"+"当前点时间:"+sdf.format(warnTime)+";当前点总池体积:"+warnPittotal.setScale(2, RoundingMode.HALF_UP)+"m³; "+
+                "<br>与参考平均值:"+referenceValue.setScale(2, RoundingMode.HALF_UP)+"m³ ;"+"<br>"+"(参考值开始时间:"+sdf.format(referenceStartTime)+";参考值结束时间:"+sdf.format(referenceEndTime)+"); 计算差值:"+pittotalSub+"m³;"+sizeStr+"预警值:"+referenceWarnValue+"m³ ; "+
+                "<br>且与(30秒内)参考波动值:"+rateStartPittotal.setScale(2, RoundingMode.HALF_UP)+"m³ ;<br>(参考值开始时间 : "+sdf.format(rateStartTime)+" ; 参考值结束时间 : "+sdf.format(rateEndTime)+"); 计算差值"+ratePittotalSub+"m³;"+sizeStr+"预警值:"+rateWarnValue+"m³";
+        log.info(warnDes);
+        model.setJh(jh);
+        model.setWorkingCondition(workingCondition);
+        model.setMotion(motion);
+        model.setTotalWarnType(warnType);
+        model.setWarnTime(warnTime);
+        model.setWarnPittotal(warnPittotal.setScale(2, RoundingMode.HALF_UP));
+        model.setReferenceValue(referenceValue.setScale(2, RoundingMode.HALF_UP));
+        model.setReferenceStartTime(referenceStartTime);
+        model.setReferenceEndTime(referenceEndTime);
+        model.setRateStartPittotal(rateStartPittotal.setScale(2, RoundingMode.HALF_UP));
+        model.setRateStartTime(rateStartTime);
+        model.setRateEndTime(rateEndTime);
+        model.setPittotalSub(pittotalSub);
+        model.setRatePittotalSub(ratePittotalSub);
+        model.setReferenceWarnValue(referenceWarnValue);
+        model.setRateWarnValue(rateWarnValue);
+        model.setWarnDes(warnDes);
+        model.setCreateTime(new Date());
+        return model;
+    }
+}

+ 21 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/WarnHistoryServiceImpl.java

@@ -0,0 +1,21 @@
+package com.cn.tianji.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.WarnHistory;
+import com.cn.tianji.mapper.WarnHistoryMapper;
+import com.cn.tianji.service.WarnHistoryService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 报警历史数据表 服务实现类
+ * </p>
+ *
+ * @author zrj
+ * @since 2022-12-09
+ */
+@Service
+@DS("chartDataSource")
+public class WarnHistoryServiceImpl  extends ServiceImpl<WarnHistoryMapper, WarnHistory> implements WarnHistoryService {
+}

+ 89 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/WellDrillingSICPServiceImpl.java

@@ -0,0 +1,89 @@
+package com.cn.tianji.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.cn.tianji.entity.WellDrilling;
+import com.cn.tianji.entity.WellDrillingSICP;
+import com.cn.tianji.entity.WellName;
+import com.cn.tianji.mapper.WellDrillingSICPMapper;
+import com.cn.tianji.service.WellDrillingSICPService;
+import com.cn.tianji.service.WellDrillingService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@DS("yjDataSource")
+@Service
+@Slf4j
+public class WellDrillingSICPServiceImpl implements WellDrillingSICPService {
+
+    @Resource
+    private WellDrillingSICPMapper mapper;
+
+    @Resource
+    private WellDrillingService wellDrillingService;
+
+    @Override
+    public List<WellDrillingSICP> selectListOrcale(String jhTableName, QueryWrapper<WellDrillingSICP> queryWrapper) {
+        return mapper.selectListOrcale(jhTableName, queryWrapper);
+    }
+
+    @Override
+    public String selectMaxTime(String jh) {
+        return mapper.selectMaxTime("\""+jh+"\"");
+    }
+
+    //筛选不包含在所有井表名中的数组中
+    //创建SICP表
+
+    /**
+     * 批量创建SICP井表
+     */
+    public void createTableBatch(List<WellName> list){
+        //井表名处理
+        list.forEach(item->{
+            String wellName = item.getWellName().replace('-', '_').toUpperCase().trim();
+            String wellNameLtd= "LTD_"+wellName;
+            String wellNameSicp= "SICP_"+wellName;
+            item.setWellTableNameLtd(wellNameLtd);
+            item.setWellTableNameSicp(wellNameSicp);
+        });
+        //已有井表数据
+        List<String> tablesFromDb = getTablesFromDb();
+        //筛选未创建的井表
+        list.forEach(item->{
+            if(!tablesFromDb.contains(item.getWellTableNameSicp())){
+                //根据井表名创建井表
+                createTable(item.getWellTableNameSicp(),System.currentTimeMillis());
+            }
+        });
+    }
+
+    @Override
+    public List<String> getTablesFromDb() {
+        //查询数据库所有井表名
+        List<String> jhList = wellDrillingService.tableNames();
+        jhList.remove("SYNC_RECORD");
+        jhList.remove("WELL_MATH_TIME");
+        jhList.remove("WELL_NEW_TABLE");
+        jhList.remove("WELL_MATH_UP_TIME");
+        jhList.remove("DRILLING_CONDITIONS_LOG");
+        return (List<String>) jhList.stream().map(it -> "\"" + it + "\"").collect(Collectors.toList());
+    }
+
+    //单表创建
+    @Override
+    public void createTable(String paramString,long paramLong){
+         mapper.createTable(paramString,paramLong);
+    }
+
+    @Override
+    public  int insertTableBatch(String tableName,  List<WellDrillingSICP> dataList){
+        log.info("批量插入数据:表名{};数据量:{}",tableName,dataList.size());
+        return mapper.insertTableBatch( "\"" +tableName+ "\"",dataList);
+    }
+}

+ 66 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/WellDrillingServiceImpl.java

@@ -0,0 +1,66 @@
+package com.cn.tianji.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.WellDrilling;
+import com.cn.tianji.mapper.WellDrillingMapper;
+import com.cn.tianji.service.WellDrillingService;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Zhao RenJi
+ */
+@Service
+public class WellDrillingServiceImpl extends ServiceImpl<WellDrillingMapper, WellDrilling> implements WellDrillingService {
+
+    @Resource
+    private WellDrillingMapper mapper;
+
+    @Override
+    public List<WellDrilling> selectListOrcale(String jhTableName, QueryWrapper<WellDrilling> queryWrapper) {
+        return mapper.selectListOrcale(jhTableName, queryWrapper);
+    }
+
+    /**
+     * 根据井号名称获得表代码
+     *
+     * @param AJH
+     * @return
+     */
+    @Override
+    public String getTableCode(String AJH) {
+        //井号预处理
+        String s = AJH.replace('-', '_').toUpperCase();
+        return "\"LTD_" + s ;
+    }
+
+    @Override
+    public void updateByTimeOrcale(String jhTableName, String motion,
+                                String operatingMode, QueryWrapper<WellDrilling> queryWrapper){
+        mapper.updateByTimeOrcale(jhTableName, motion,operatingMode,queryWrapper);
+    }
+
+    @Override
+    public  int insertTableBatch(String tableName,List<WellDrilling> dataList){
+        return mapper.insertTableBatch(tableName, dataList);
+    }
+
+    @Override
+    public  List<String> tableNames(){
+        return mapper.tableNames();
+    }
+    @Override
+    public String getLastDateByJh( String tableName){
+        return mapper.getLastDateByJh(tableName);
+    };
+
+    @Override
+    public void createTable(String paramString, long paramLong){
+       mapper.createTable(paramString,paramLong);
+    };
+}

+ 35 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/WlwmroDataServiceImpl.java

@@ -0,0 +1,35 @@
+package com.cn.tianji.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.cn.tianji.mapper.WlwmroDataMapper;
+import com.cn.tianji.service.WlwmroDataService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Service
+@Slf4j
+@DS("wlwmroDataSource")
+public class WlwmroDataServiceImpl implements WlwmroDataService {
+
+    @Resource
+    private WlwmroDataMapper wlwmroDataMapper;
+
+    @Override
+    public List<Map<String,String>> getAllJh(){
+        return wlwmroDataMapper.selectAllJh();
+    }
+
+    @Override
+    public  List<Map<String,String>> selectZjrb3ByJh( String jh){
+        return wlwmroDataMapper.selectZjrb3ByJh(jh);
+    }
+
+    @Override
+    public  List<Map<String,String>> selectZjrbByJh(String jh){
+        return wlwmroDataMapper.selectZjrbByJh(jh);
+    }
+}

+ 20 - 0
yujing-common/src/main/java/com/cn/tianji/service/impl/WorkingConditionCalculationLogServiceImpl.java

@@ -0,0 +1,20 @@
+package com.cn.tianji.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.cn.tianji.entity.WorkingConditionCalculationLog;
+import com.cn.tianji.mapper.WorkingConditionCalculationLogMapper;
+import com.cn.tianji.service.WorkingConditionCalculationLogService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+/**
+ * 钻井工况计算日志表;(working_condition_calculation_log)表服务实现类
+ * @author : http://www.chiner.pro
+ * @date : 2024-5-15
+ */
+@Service
+public class WorkingConditionCalculationLogServiceImpl extends ServiceImpl<WorkingConditionCalculationLogMapper, WorkingConditionCalculationLog> implements WorkingConditionCalculationLogService {
+
+    @Resource
+    private WorkingConditionCalculationLogMapper workingConditionCalculationLogMapper;
+}

+ 211 - 0
yujing-common/src/main/java/com/cn/tianji/util/CommonUtil.java

@@ -0,0 +1,211 @@
+package com.cn.tianji.util;
+
+import com.cn.tianji.common.StringUtils;
+
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.*;
+
+public class CommonUtil {
+    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
+    /**
+     * 根据字段名称获取实体类该字段的数据
+     *
+     * @param obj 实体类对象
+     * @param fieldName 字段名称
+     * @return 字段的值,如果字段不存在或无法访问则返回null
+     */
+    public static Object getFieldValue(Object obj, String fieldName) {
+        if (obj == null || fieldName == null || fieldName.isEmpty()) {
+            return null;
+        }
+
+        Class<?> clazz = obj.getClass();
+        try {
+            // 获取字段对象,设置为可访问(即使它是私有的)
+            Field field = clazz.getDeclaredField(fieldName);
+            field.setAccessible(true);
+            // 获取字段的值
+            return field.get(obj);
+        } catch (NoSuchFieldException e) {
+            // 如果字段不存在
+            System.err.println("Field not found: " + fieldName);
+            return null;
+        } catch (IllegalAccessException e) {
+            // 如果字段无法访问(理论上不应该发生,因为我们已经设置了setAccessible(true))
+            System.err.println("Field access exception: " + fieldName);
+            return null;
+        }
+    }
+
+    /**
+     * Object 转 BigDecimal
+     * @param obj
+     * @return
+     */
+    public static BigDecimal convertToBigDecimal(Object obj) {
+        if (obj == null) {
+            return null;  // 或者你可以抛出一个异常,根据你的需求
+        }
+
+        try {
+            // 假设 obj 是一个字符串或其他可以转换为 BigDecimal 的类型
+            // 这里使用 String 作为示例,因为 String 是常见的输入类型
+            if (obj instanceof String) {
+                return new BigDecimal((String) obj);
+            } else if (obj instanceof BigDecimal) {
+                return (BigDecimal) obj;
+            } else if (obj instanceof Number) {
+                return BigDecimal.valueOf(((Number) obj).doubleValue());
+            } else {
+                throw new IllegalArgumentException("Unsupported object type: " + obj.getClass().getName());
+            }
+        } catch (NumberFormatException e) {
+            throw new IllegalArgumentException("Cannot convert object to BigDecimal: " + obj, e);
+        }
+    }
+
+    /**
+     * 将对象转换为字符串,如果对象为null则返回空字符串
+     *
+     * @param obj 要转换的对象
+     * @return 转换后的字符串,如果对象为null则返回空字符串
+     */
+    public static String convertToString(Object obj) {
+        if (obj == null) {
+            return "";
+        } else {
+            return obj.toString();
+        }
+    }
+
+    public static Date convertToDate(Object obj) {
+        // 判断对象是否为空
+        if (obj == null) {
+            return null;
+        }
+
+        // 尝试将对象转换为字符串
+        String dateStr = obj.toString();
+
+        try {
+            // 尝试解析字符串为日期
+            return dateFormat.parse(dateStr);
+        } catch (ParseException e) {
+            // 如果解析失败,返回 null
+            return null;
+        }
+    }
+
+    public static BigDecimal convertStringToBigDecimal(String str) throws ParseException {
+        boolean empty = StringUtils.isEmpty(str);
+        if(empty){
+            return BigDecimal.valueOf(-999.25);
+        }
+        // 定义DecimalFormat以确保字符串为有效的数字格式
+        DecimalFormat decimalFormat = new DecimalFormat("#.##########");
+        //启用对BigDecimal的解析
+        decimalFormat.setParseBigDecimal(true);
+
+        // 使用DecimalFormat将字符串解析为BigDecimal
+        BigDecimal bigDecimal = (BigDecimal) decimalFormat.parse(str);
+
+        // 设置比例和舍入模式
+        bigDecimal = bigDecimal.setScale(2, RoundingMode.HALF_UP);
+        return bigDecimal;
+    }
+
+    /**
+     * 根据分钟数 高于30分钟则加分钟数满足下一整点时间 低于30分钟 只减去当前分钟数满足当前整点时间
+     * @param currentTime
+     * @return
+     */
+    public static LocalTime adjustTimeToNearestHour(LocalTime currentTime) {
+        int minute = currentTime.getMinute();
+
+        if (minute >= 30) {
+            // 如果分钟数 >= 30,则加到下一个整点
+            LocalTime nextHour = currentTime.plusHours(1);
+            return nextHour.truncatedTo(ChronoUnit.HOURS);
+        } else {
+            // 如果分钟数 < 30,则减到当前整点
+            return currentTime.truncatedTo(ChronoUnit.HOURS);
+        }
+    }
+
+
+    /**
+     * 日期字符串减去天数返回减去天数的日期
+     * @param dateString
+     * @param daysToSubtract
+     * @return
+     */
+    public static String subtractDaysFromDate(String dateString, int daysToSubtract) {
+        // Define the date format
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+
+        // Parse the input date string to LocalDate
+        LocalDate date = LocalDate.parse(dateString, formatter);
+
+        // Subtract the specified number of days
+        LocalDate resultDate = date.minus(daysToSubtract, ChronoUnit.DAYS);
+
+        // Format the result date back to string
+        return resultDate.format(formatter);
+    }
+
+
+    public static  String timeSub(String time,long minutesToSubtract){
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        // 减去的分钟数
+//        long minutesToSubtract = 5;
+
+        // 解析字符串为LocalDateTime对象
+        LocalDateTime dateTime = LocalDateTime.parse(time, formatter);
+
+        // 减去指定的分钟数
+        LocalDateTime newDateTime = dateTime.minusMinutes(minutesToSubtract);
+
+        // 格式化并输出新的日期时间
+        String newDateTimeStr = newDateTime.format(formatter);
+        return newDateTimeStr;
+    }
+
+    /**
+     * Objec转 List<Map<String, Object>>
+     * @param objects
+     * @param <T>
+     * @return
+     * @throws IllegalAccessException
+     */
+    public static <T> List<Map<String, Object>> convertToListOfMaps(List<T> objects) throws IllegalAccessException {
+        List<Map<String, Object>> result = new ArrayList<>();
+        for (T object : objects) {
+            result.add(convertToMap(object));
+        }
+        return result;
+    }
+
+    public static <T> Map<String, Object> convertToMap(T object) throws IllegalAccessException {
+        Map<String, Object> result = new HashMap<>();
+        if (object == null) {
+            return result;
+        }
+        Class<?> clazz = object.getClass();
+        Field[] fields = clazz.getDeclaredFields();
+        for (Field field : fields) {
+            field.setAccessible(true); // To access private fields
+            result.put(field.getName(), field.get(object));
+        }
+        return result;
+    }
+}

+ 6 - 0
yujing-common/src/main/resources/mapper/AjhMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.cn.tianji.mapper.AjhMapper">
+
+</mapper>

+ 6 - 0
yujing-common/src/main/resources/mapper/ComprehensiveLogMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.cn.tianji.mapper.ComprehensiveLogMapper">
+
+</mapper>

+ 6 - 0
yujing-common/src/main/resources/mapper/HookLoadWarnLogMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.cn.tianji.mapper.HookLoadWarnLogMapper">
+
+</mapper>

+ 6 - 0
yujing-common/src/main/resources/mapper/PumpingPressureWarnLogMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.cn.tianji.mapper.PumpingPressureWarnLogMapper">
+
+</mapper>

+ 6 - 0
yujing-common/src/main/resources/mapper/SyncRecordMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.cn.tianji.mapper.SyncRecordMapper">
+
+</mapper>

+ 6 - 0
yujing-common/src/main/resources/mapper/TorqueWarnLogMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.cn.tianji.mapper.TorqueWarnLogMapper">
+
+</mapper>

+ 6 - 0
yujing-common/src/main/resources/mapper/TotalPoolVolumeWarnLogMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.cn.tianji.mapper.TotalPoolVolumeWarnLogMapper">
+
+</mapper>

+ 66 - 0
yujing-common/src/main/resources/mapper/WellDrillingMapper.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.cn.tianji.mapper.WellDrillingMapper">
+
+    <update id="createTable" >
+        create table ${tableName} (jh VARCHAR2(40)not null, tid VARCHAR2(24)not null, time VARCHAR2(24)not null,id NUMBER(12), depth VARCHAR2(40),
+                                   vdepth VARCHAR2(40), stat VARCHAR2(40), lagtime VARCHAR2(40), lagstrokes VARCHAR2(40), lagdepth VARCHAR2(40), bitdepth VARCHAR2(40),
+                                   bitoff VARCHAR2(40), kellyin VARCHAR2(40), hkh VARCHAR2(40), hks VARCHAR2(40), woh VARCHAR2(40), woh_calc VARCHAR2(40), float_weight VARCHAR2(40),
+                                   rpm VARCHAR2(40), rop_inst VARCHAR2(40), rop_mavg VARCHAR2(40), wob VARCHAR2(40), torque VARCHAR2(40), td_torque VARCHAR2(40), spp VARCHAR2(40),
+                                   whp VARCHAR2(40), pump1 VARCHAR2(40), pump2 VARCHAR2(40), pump3 VARCHAR2(40), pumptotal VARCHAR2(40), strokes1 VARCHAR2(40), strokes2 VARCHAR2(40),
+                                   strokes3 VARCHAR2(40), strokestotal VARCHAR2(40), vop_inst VARCHAR2(40), vop_mavg VARCHAR2(40), flowin VARCHAR2(40), flowout VARCHAR2(40),
+                                   flowoutpercent VARCHAR2(40), mwin VARCHAR2(40), mwout VARCHAR2(40), tempin VARCHAR2(40), tempout VARCHAR2(40), condin VARCHAR2(40), condout VARCHAR2(40),
+                                   ecd VARCHAR2(40), pit1 VARCHAR2(40), pit2 VARCHAR2(40), pit3 VARCHAR2(40), pit4 VARCHAR2(40), pit5 VARCHAR2(40), pit6 VARCHAR2(40), pit7 VARCHAR2(40),
+                                   pit8 VARCHAR2(40), pit9 VARCHAR2(40), pit10 VARCHAR2(40), pit11 VARCHAR2(40), pit12 VARCHAR2(40), triptandvol VARCHAR2(40), actpittotal VARCHAR2(40),
+                                   pittotal VARCHAR2(40), gainlossvol VARCHAR2(40), c1 VARCHAR2(40), c2 VARCHAR2(40), c3 VARCHAR2(40), ic4 VARCHAR2(40), nc4 VARCHAR2(40), ic5 VARCHAR2(40),
+                                   nc5 VARCHAR2(40), ec5 VARCHAR2(40), ic6 VARCHAR2(40), nc6 VARCHAR2(40), tg VARCHAR2(40), co2 VARCHAR2(40), h2 VARCHAR2(40), h2s1 VARCHAR2(40),
+                                   h2s2 VARCHAR2(40), h2s3 VARCHAR2(40), h2s4 VARCHAR2(40), h2s5 VARCHAR2(40), h2s6 VARCHAR2(40), h2s7 VARCHAR2(40), h2s8 VARCHAR2(40), stringlen VARCHAR2(40),
+                                   curpipe VARCHAR2(40), bitno VARCHAR2(40), bitsize VARCHAR2(40), bittype VARCHAR2(40), bitrun VARCHAR2(40), bittime VARCHAR2(40), bitdrilltime VARCHAR2(40),
+                                   bitcost VARCHAR2(40), totaldays VARCHAR2(40), standsdone VARCHAR2(40), standstogo VARCHAR2(40), tripoverpull VARCHAR2(40), dc VARCHAR2(40),
+                                   sigma VARCHAR2(40), free95 VARCHAR2(40), free96 VARCHAR2(40), free97 VARCHAR2(40), free98 VARCHAR2(40), free99 VARCHAR2(40), free100 VARCHAR2(40),
+                                   free101 VARCHAR2(40), free102 VARCHAR2(40), free103 VARCHAR2(40), free104 VARCHAR2(40), free105 VARCHAR2(40), free106 VARCHAR2(40), free107 VARCHAR2(40),
+                                   free108 VARCHAR2(40), free109 VARCHAR2(40), free110 VARCHAR2(40), free111 VARCHAR2(40), free112 VARCHAR2(40), free113 VARCHAR2(40), free114 VARCHAR2(40),
+                                   free115 VARCHAR2(40), free116 VARCHAR2(40), free117 VARCHAR2(40), free118 VARCHAR2(40), free119 VARCHAR2(40), free120 VARCHAR2(40),
+                                   operating_mode VARCHAR2(40),motion VARCHAR2(40),
+                                   constraint pk_${timeStamp} primary key(time) )
+    </update>
+
+    <insert id="insertTableBatch">
+        insert into ${tableName} (JH,TID,TIME,ID,DEPTH,VDEPTH,STAT,LAGTIME,LAGSTROKES,LAGDEPTH,
+        BITDEPTH,BITOFF,KELLYIN,HKH,HKS,WOH,WOH_CALC,FLOAT_WEIGHT,RPM,ROP_INST,
+        ROP_MAVG,WOB,TORQUE,TD_TORQUE,SPP,WHP,PUMP1,PUMP2,PUMP3,PUMPTOTAL,STROKES1,
+        STROKES2,STROKES3,STROKESTOTAL,VOP_INST,VOP_MAVG,FLOWIN,FLOWOUT,FLOWOUTPERCENT,
+        MWIN,MWOUT,TEMPIN,TEMPOUT,CONDIN,CONDOUT,ECD,PIT1,PIT2,PIT3,PIT4,PIT5,
+        PIT6,PIT7,PIT8,PIT9,PIT10,PIT11,PIT12,TRIPTANDVOL,ACTPITTOTAL,PITTOTAL,
+        GAINLOSSVOL,C1,C2,C3,IC4,NC4,IC5,NC5,EC5,IC6,NC6,TG,CO2,
+        H2,H2S1,H2S2,H2S3,H2S4,H2S5,H2S6,H2S7,H2S8,STRINGLEN,CURPIPE,
+        BITNO,BITSIZE,BITTYPE,BITRUN,BITTIME,BITDRILLTIME,BITCOST,TOTALDAYS,STANDSDONE,
+        STANDSTOGO,TRIPOVERPULL,DC,SIGMA,FREE95,FREE96,FREE97,FREE98,FREE99,FREE100,
+        FREE101,FREE102,FREE103,FREE104,FREE105,FREE106,FREE107,FREE108,FREE109,FREE110,
+        FREE111,FREE112,FREE113,FREE114,FREE115,FREE116,FREE117,FREE118,FREE119,FREE120,
+        operating_mode,motion )
+
+        <foreach collection="dataList" item="item" separator="UNION ALL">
+            (
+            SELECT
+            #{item.jh},#{item.tid},#{item.time},#{item.id},#{item.depth},#{item.vdepth},#{item.stat},#{item.lagtime},#{item.lagstrokes},#{item.lagdepth},
+            #{item.bitdepth},#{item.bitoff},#{item.kellyin},#{item.hkh},#{item.hks},#{item.woh},#{item.wohCalc},#{item.floatWeight},#{item.rpm},#{item.ropInst},
+            #{item.ropMavg},#{item.wob},#{item.torque},#{item.tdTorque},#{item.spp},#{item.whp},#{item.pump1},#{item.pump2},#{item.pump3},#{item.pumptotal},#{item.strokes1},
+            #{item.strokes2},#{item.strokes3},#{item.strokestotal},#{item.vopInst},#{item.vopMavg},#{item.flowin},#{item.flowout},#{item.flowoutpercent},
+            #{item.mwin},#{item.mwout},#{item.tempin},#{item.tempout},#{item.condin},#{item.condout},#{item.ecd},#{item.pit1},#{item.pit2},#{item.pit3},#{item.pit4},#{item.pit5},
+            #{item.pit6},#{item.pit7},#{item.pit8},#{item.pit9},#{item.pit10},#{item.pit11},#{item.pit12},#{item.triptandvol},#{item.actpittotal},#{item.pittotal},
+            #{item.gainlossvol},#{item.c1},#{item.c2},#{item.c3},#{item.ic4},#{item.nc4},#{item.ic5},#{item.nc5},#{item.ec5},#{item.ic6},#{item.nc6},#{item.tg},#{item.co2},
+            #{item.h2},#{item.h2s1},#{item.h2s2},#{item.h2s3},#{item.h2s4},#{item.h2s5},#{item.h2s6},#{item.h2s7},#{item.h2s8},#{item.stringlen},#{item.curpipe},
+            #{item.bitno},#{item.bitsize},#{item.bittype},#{item.bitrun},#{item.bittime},#{item.bitdrilltime},#{item.bitcost},#{item.totaldays},#{item.standsdone},
+            #{item.standstogo},#{item.tripoverpull},#{item.dc},#{item.sigma},#{item.free95},#{item.free96},#{item.free97},#{item.free98},#{item.free99},#{item.free100},
+            #{item.free101},#{item.free102},#{item.free103},#{item.free104},#{item.free105},#{item.free106},#{item.free107},#{item.free108},#{item.free109},#{item.free110},
+            #{item.free111},#{item.free112},#{item.free113},#{item.free114},#{item.free115},#{item.free116},#{item.free117},#{item.free118},#{item.free119},#{item.free120},
+            #{item.operatingMode},#{item.motion} FROM DUAL
+            )
+        </foreach>
+    </insert>
+
+    <select id="getLastDateByJh" resultType="string">
+        select max(TIME) from ${tableName}
+    </select>
+</mapper>

+ 75 - 0
yujing-common/src/main/resources/mapper/WellDrillingSICPMapper.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.cn.tianji.mapper.WellDrillingSICPMapper">
+
+    <select id="selectMaxTime" resultType="string">
+        SELECT MAX (TIME) AS time FROM ${jh}
+    </select>
+
+    <update id="createTable" >
+        create table ${tableName} (
+            JH VARCHAR2(40) not null,SGDW VARCHAR2(40),GK VARCHAR2(40),JID VARCHAR2(40),JYID VARCHAR2(40),ZYID VARCHAR2(40),RID VARCHAR2(40), SQID VARCHAR2(40),TIME VARCHAR2(24),
+            ACTC VARCHAR2(40),DBTM VARCHAR2(40),DBTV VARCHAR2(40),DMEA VARCHAR2(40),DVER VARCHAR2(40),BPOS VARCHAR2(40),ROPA VARCHAR2(40),HKLA VARCHAR2(40),HKLX VARCHAR2(40),
+            WOBA VARCHAR2(40),WOBX VARCHAR2(40),TQA VARCHAR2(40),TQX VARCHAR2(40),RPMA VARCHAR2(40),SPPA VARCHAR2(40),CHKP VARCHAR2(40),SPM1 VARCHAR2(40),SPM2 VARCHAR2(40),
+            SPM3 VARCHAR2(40),TVA VARCHAR2(40),TVCA VARCHAR2(40),MFOP VARCHAR2(40),MFOA VARCHAR2(40),MFIA VARCHAR2(40), MDOA VARCHAR2(40),MDIA VARCHAR2(40),MTOA VARCHAR2(40),
+            MTIA VARCHAR2(40),MCOA VARCHAR2(40),MCIA VARCHAR2(40),STKC VARCHAR2(40),LSTK VARCHAR2(40),DRTM VARCHAR2(40),GASA VARCHAR2(40),TRTT VARCHAR2(40),BSPD VARCHAR2(40),
+            TRPMA VARCHAR2(40),TTQA VARCHAR2(40),TTQX VARCHAR2(40),CO2A VARCHAR2(40),HS1A VARCHAR2(40),HS2A VARCHAR2(40),HS3A VARCHAR2(40),HS4A VARCHAR2(40),HS5A VARCHAR2(40),
+            HS6A VARCHAR2(40),HS7A VARCHAR2(40),HS8A VARCHAR2(40),CBG1A VARCHAR2(40),CBG2A VARCHAR2(40),CBG3A VARCHAR2(40),CBG4A VARCHAR2(40),TRIP_OVER_PULL VARCHAR2(40),
+            DC VARCHAR2(40),SIGMA VARCHAR2(40),KELLYIN VARCHAR2(40),FLOAT_WEIGHT VARCHAR2(40),ROP_INST VARCHAR2(40),ROP_MAVG VARCHAR2(40),ROP VARCHAR2(40),VOP_INST VARCHAR2(40),
+            VOP_MAVG VARCHAR2(40),TSPM VARCHAR2(40),STROKES1 VARCHAR2(40),STROKES2 VARCHAR2(40),STROKES3 VARCHAR2(40),ECD VARCHAR2(40),TRIPTANDVOL VARCHAR2(40),H2 VARCHAR2(40),
+            STANDSDONE VARCHAR2(40),STANDSTOGO VARCHAR2(40),D VARCHAR2(40),SDB VARCHAR2(40),PHB VARCHAR2(40),TXB VARCHAR2(40),LHQBFHLLINE VARCHAR2(40),DCSN VARCHAR2(40),
+            SIGMAQX VARCHAR2(40),SIGMAKXD VARCHAR2(40),DCSKXD VARCHAR2(40),SIGMADYTD VARCHAR2(40),SIGMAPYTD VARCHAR2(40),FPPG VARCHAR2(40),FFPG VARCHAR2(40),JRTIME VARCHAR2(40),
+            SOURCEUNIT VARCHAR2(40),TTV1 VARCHAR2(40),TTV2 VARCHAR2(40),TVT VARCHAR2(40),TV01 VARCHAR2(40),TV02 VARCHAR2(40),TV03 VARCHAR2(40),TV04 VARCHAR2(40),
+            TV05 VARCHAR2(40),TV06 VARCHAR2(40),TV07 VARCHAR2(40),TV08 VARCHAR2(40),TV09 VARCHAR2(40),TV10 VARCHAR2(40),TV11 VARCHAR2(40),TV12 VARCHAR2(40),METH VARCHAR2(40),
+            ETH VARCHAR2(40),PRP VARCHAR2(40),IBUT VARCHAR2(40),NBUT VARCHAR2(40),IPEN VARCHAR2(40),NPEN VARCHAR2(40),EPEN VARCHAR2(40),IHEX VARCHAR2(40),NHEX VARCHAR2(40),
+            SPR1 VARCHAR2(40),SPR2 VARCHAR2(40),SPR3 VARCHAR2(40),SPR4 VARCHAR2(40),SPR5 VARCHAR2(40),constraint pk_${timeStamp} primary key(TIME)
+                                  )
+    </update>
+
+    <insert id="insertTableBatch">
+        insert into ${tableName} (
+        JH,SGDW,GK,JID,JYID,ZYID,RID,SQID,TIME,ACTC,DBTM,DBTV,DMEA,DVER,BPOS,ROPA,HKLA,HKLX,WOBA,WOBX,TQA,TQX,RPMA,SPPA,CHKP,
+        SPM1,SPM2,SPM3,TVA,TVCA,MFOP,MFOA,MFIA,MDOA,MDIA,MTOA,MTIA,MCOA,MCIA,STKC,LSTK,DRTM,GASA,TRTT,BSPD,TRPMA,TTQA,TTQX,CO2A,
+        HS1A,HS2A,HS3A,HS4A,HS5A,HS6A,HS7A,HS8A,CBG1A,CBG2A,CBG3A,CBG4A,TRIP_OVER_PULL,DC,SIGMA,KELLYIN,FLOAT_WEIGHT,ROP_INST,ROP_MAVG,
+        ROP,VOP_INST,VOP_MAVG,TSPM,STROKES1,STROKES2,STROKES3,ECD,TRIPTANDVOL,H2,STANDSDONE,STANDSTOGO,D,SDB,PHB,TXB,LHQBFHLLINE,DCSN,
+       SIGMAQX,SIGMAKXD,DCSKXD,SIGMADYTD,SIGMAPYTD,FPPG,FFPG,JRTIME,SOURCEUNIT,TTV1,TTV2,TVT,TV01,TV02,TV03,TV04,TV05,TV06,TV07,TV08,TV09,
+        TV10,TV11,TV12,METH,ETH,PRP,IBUT,NBUT,IPEN,NPEN,EPEN,IHEX,NHEX,SPR1,SPR2,SPR3,SPR4,SPR5 )
+        <foreach collection="dataList" item="item" separator="UNION ALL">
+            (
+            SELECT
+            #{item.jh, jdbcType=VARCHAR},#{item.sgdw, jdbcType=VARCHAR},#{item.gk, jdbcType=VARCHAR},#{item.JID, jdbcType=VARCHAR},#{item.JYID, jdbcType=VARCHAR},
+            #{item.ZYID, jdbcType=VARCHAR},#{item.RID, jdbcType=VARCHAR},#{item.SQID, jdbcType=VARCHAR},#{item.TIME, jdbcType=VARCHAR},#{item.ACTC, jdbcType=VARCHAR},
+            #{item.DBTM, jdbcType=VARCHAR},#{item.DBTV, jdbcType=VARCHAR},#{item.DMEA, jdbcType=VARCHAR},#{item.DVER, jdbcType=VARCHAR},#{item.BPOS, jdbcType=VARCHAR},
+            #{item.ROPA, jdbcType=VARCHAR},#{item.HKLA, jdbcType=VARCHAR},#{item.HKLX, jdbcType=VARCHAR},#{item.WOBA, jdbcType=VARCHAR},#{item.WOBX, jdbcType=VARCHAR},
+            #{item.TQA, jdbcType=VARCHAR},#{item.TQX, jdbcType=VARCHAR},#{item.RPMA, jdbcType=VARCHAR},#{item.SPPA, jdbcType=VARCHAR},#{item.CHKP, jdbcType=VARCHAR},
+            #{item.SPM1, jdbcType=VARCHAR},#{item.SPM2, jdbcType=VARCHAR},#{item.SPM3, jdbcType=VARCHAR},#{item.TVA, jdbcType=VARCHAR},#{item.TVCA, jdbcType=VARCHAR},
+            #{item.MFOP, jdbcType=VARCHAR},
+            #{item.MFOA, jdbcType=VARCHAR},#{item.MFIA, jdbcType=VARCHAR},#{item.MDOA, jdbcType=VARCHAR},#{item.MDIA, jdbcType=VARCHAR},#{item.MTOA, jdbcType=VARCHAR},
+            #{item.MTIA, jdbcType=VARCHAR},#{item.MCOA, jdbcType=VARCHAR},#{item.MCIA, jdbcType=VARCHAR},#{item.STKC, jdbcType=VARCHAR},#{item.LSTK, jdbcType=VARCHAR},
+            #{item.DRTM, jdbcType=VARCHAR},#{item.GASA, jdbcType=VARCHAR},
+            #{item.TRTT, jdbcType=VARCHAR},#{item.BSPD, jdbcType=VARCHAR},#{item.TRPMA, jdbcType=VARCHAR},#{item.TTQA, jdbcType=VARCHAR},#{item.TTQX, jdbcType=VARCHAR},
+            #{item.CO2A, jdbcType=VARCHAR},#{item.HS1A, jdbcType=VARCHAR},#{item.HS2A, jdbcType=VARCHAR},#{item.HS3A, jdbcType=VARCHAR},#{item.HS4A, jdbcType=VARCHAR},
+            #{item.HS5A, jdbcType=VARCHAR},#{item.HS6A, jdbcType=VARCHAR},
+            #{item.HS7A, jdbcType=VARCHAR},#{item.HS8A, jdbcType=VARCHAR},#{item.CBG1A, jdbcType=VARCHAR},#{item.CBG2A, jdbcType=VARCHAR},#{item.CBG3A, jdbcType=VARCHAR},
+            #{item.CBG4A, jdbcType=VARCHAR},#{item.TRIP_OVER_PULL, jdbcType=VARCHAR},#{item.DC, jdbcType=VARCHAR},#{item.SIGMA, jdbcType=VARCHAR},
+            #{item.KELLYIN, jdbcType=VARCHAR},#{item.FLOAT_WEIGHT, jdbcType=VARCHAR},
+            #{item.ROP_INST, jdbcType=VARCHAR},#{item.ROP_MAVG, jdbcType=VARCHAR},#{item.ROP, jdbcType=VARCHAR},#{item.VOP_INST, jdbcType=VARCHAR},#{item.VOP_MAVG, jdbcType=VARCHAR},
+            #{item.TSPM, jdbcType=VARCHAR},#{item.STROKES1, jdbcType=VARCHAR},#{item.STROKES2, jdbcType=VARCHAR}, #{item.STROKES3, jdbcType=VARCHAR},
+            #{item.ECD, jdbcType=VARCHAR},
+            #{item.TRIPTANDVOL, jdbcType=VARCHAR},#{item.H2, jdbcType=VARCHAR},#{item.STANDSDONE, jdbcType=VARCHAR},#{item.STANDSTOGO, jdbcType=VARCHAR},#{item.D, jdbcType=VARCHAR},
+            #{item.SDB, jdbcType=VARCHAR},#{item.PHB, jdbcType=VARCHAR},#{item.TXB, jdbcType=VARCHAR},#{item.LHQBFHLLINE, jdbcType=VARCHAR},#{item.DCSN, jdbcType=VARCHAR},
+            #{item.SIGMAQX, jdbcType=VARCHAR},
+            #{item.SIGMAKXD, jdbcType=VARCHAR},#{item.DCSKXD, jdbcType=VARCHAR},#{item.SIGMADYTD, jdbcType=VARCHAR},#{item.SIGMAPYTD, jdbcType=VARCHAR},#{item.FPPG, jdbcType=VARCHAR},
+            #{item.FFPG, jdbcType=VARCHAR},#{item.JRTIME, jdbcType=VARCHAR}, #{item.SOURCEUNIT, jdbcType=VARCHAR},#{item.TTV1, jdbcType=VARCHAR},#{item.TTV2, jdbcType=VARCHAR},
+            #{item.TVT, jdbcType=VARCHAR},
+            #{item.TV01, jdbcType=VARCHAR},#{item.TV02, jdbcType=VARCHAR},#{item.TV03, jdbcType=VARCHAR},#{item.TV04, jdbcType=VARCHAR},#{item.TV05, jdbcType=VARCHAR},
+            #{item.TV06, jdbcType=VARCHAR},#{item.TV07, jdbcType=VARCHAR},#{item.TV08, jdbcType=VARCHAR},#{item.TV09, jdbcType=VARCHAR},#{item.TV10, jdbcType=VARCHAR},
+            #{item.TV11, jdbcType=VARCHAR},#{item.TV12, jdbcType=VARCHAR},
+            #{item.METH, jdbcType=VARCHAR},#{item.ETH, jdbcType=VARCHAR},#{item.PRP, jdbcType=VARCHAR},#{item.IBUT, jdbcType=VARCHAR},#{item.NBUT, jdbcType=VARCHAR},
+            #{item.IPEN, jdbcType=VARCHAR},#{item.NPEN, jdbcType=VARCHAR},#{item.EPEN, jdbcType=VARCHAR},#{item.IHEX, jdbcType=VARCHAR},
+            #{item.NHEX, jdbcType=VARCHAR},#{item.SPR1, jdbcType=VARCHAR},#{item.SPR2, jdbcType=VARCHAR},
+            #{item.SPR3, jdbcType=VARCHAR},#{item.SPR4, jdbcType=VARCHAR}, #{item.SPR5, jdbcType=VARCHAR} FROM DUAL
+            )
+        </foreach>
+    </insert>
+</mapper>

+ 32 - 0
yujing-common/src/main/resources/mapper/WlwmroDataMapper.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.cn.tianji.mapper.WlwmroDataMapper">
+
+    <select id="selectAllJh" resultType="java.util.Map">
+        select jh
+        from V_YW_ZJRB3 t
+        group by jh
+    </select>
+
+    <select id="selectZjrb3ByJh" resultType="java.util.Map">
+        select *
+        from (
+                 select *
+                 from V_YW_ZJRB3 t
+                 where t.jh = #{jh}
+                 order by rq desc
+             )
+        where ROWNUM = 1
+    </select>
+
+    <select id="selectZjrbByJh" resultType="java.util.Map">
+        select *
+        from (
+                 select *
+                 from V_YW_ZJRB t
+                 where t.jh = #{jh}
+                 order by rq desc
+             )
+        where ROWNUM = 1
+    </select>
+</mapper>

+ 57 - 0
yujing-condition-identification/pom.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>yujing-calculate</artifactId>
+        <groupId>com.cn.tianji</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <!-- 打包格式 -->
+    <packaging>jar</packaging>
+
+    <artifactId>yujing-condition-identification</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.cn.tianji</groupId>
+            <artifactId>yujing-common</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.cn.tianji</groupId>
+            <artifactId>yujing-warning-calculation</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+
+    <!-- 打包插件 -->
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <executable>true</executable>
+                    <layout>JAR</layout>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                        <configuration>
+                            <attach>false</attach>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 16 - 0
yujing-condition-identification/src/main/java/com/cn/tianji/ConditionIdentificationApplication.java

@@ -0,0 +1,16 @@
+package com.cn.tianji;
+
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @author Zhao RenJi
+ */
+@SpringBootApplication
+public class ConditionIdentificationApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(ConditionIdentificationApplication.class, args);
+        System.out.println("ConditionIdentification启动");
+    }
+}

+ 33 - 0
yujing-condition-identification/src/main/java/com/cn/tianji/config/AsyncConfig.java

@@ -0,0 +1,33 @@
+package com.cn.tianji.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadPoolExecutor;
+
+@Configuration
+@EnableAsync
+public class AsyncConfig implements AsyncConfigurer {
+
+    @Bean(name = "workingConditionCalculationTaskExecutor")
+    public Executor taskExecutor() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(10); // 设置核心线程数
+        executor.setMaxPoolSize(20); // 设置最大线程数
+        executor.setQueueCapacity(500); // 设置队列容量
+        executor.setKeepAliveSeconds(60); // 线程空闲时间
+        executor.setThreadNamePrefix("WorkingConditionCalculationThread-"); // 设置线程名前缀
+        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy()); // 拒绝策略
+        executor.initialize();
+        return executor;
+    }
+
+    @Override
+    public Executor getAsyncExecutor() {
+        return taskExecutor();
+    }
+}

+ 19 - 0
yujing-condition-identification/src/main/java/com/cn/tianji/config/CorsConfig.java

@@ -0,0 +1,19 @@
+package com.cn.tianji.config;
+
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+@Configuration
+public class CorsConfig implements WebMvcConfigurer {
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**") // 所有接口
+                .allowCredentials(true) // 是否发送 Cookie
+                .allowedOriginPatterns("*") // 支持域
+                .allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"}) // 支持方法
+                .allowedHeaders("*")
+                .exposedHeaders("*");
+    }
+}

+ 23 - 0
yujing-condition-identification/src/main/java/com/cn/tianji/controller/WorkingConditionCalculationController.java

@@ -0,0 +1,23 @@
+package com.cn.tianji.controller;
+
+
+import com.cn.tianji.common.Result;
+import com.cn.tianji.service.WorkingConditionCalculationService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/workingConditionCalculation")
+public class WorkingConditionCalculationController {
+    @Resource
+    private WorkingConditionCalculationService workingConditionCalculationService;
+
+    @GetMapping
+    public Result<?> workingConditionCalculation(@RequestParam("workingConditionCalculationLogId") String workingConditionCalculationLogId){
+       return workingConditionCalculationService.workingConditionCalculation(workingConditionCalculationLogId);
+    }
+}

+ 405 - 0
yujing-condition-identification/src/main/java/com/cn/tianji/service/Impl/WorkingConditionCalculationServiceImpl.java

@@ -0,0 +1,405 @@
+package com.cn.tianji.service.Impl;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.cn.tianji.common.CommonUtils;
+import com.cn.tianji.common.RedisUtil;
+import com.cn.tianji.common.Result;
+import com.cn.tianji.dto.ConditionDeterminationDto;
+import com.cn.tianji.entity.*;
+import com.cn.tianji.service.*;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+@Service
+@Slf4j
+public class WorkingConditionCalculationServiceImpl implements WorkingConditionCalculationService {
+    @Resource
+    private WellDrillingService wellDrillingService;
+
+    @Resource
+    private ConditionIdentificationService conditionIdentificationService;
+
+    @Resource
+    private OperatingConditionThresholdService operatingConditionThresholdService;
+
+    @Resource
+    private WorkingConditionCalculationLogService workingConditionCalculationLogService;
+
+    @Resource
+    private DrillingHookloadService drillingHookloadService;
+
+    @Resource
+    private DrillingOutHookLoadService drillingOutHookLoadService;
+
+    @Resource
+    private HookLoadWarnLogService hookLoadWarnLogService;
+
+    @Resource
+    private TotalPoolVolumeService totalPoolVolumeService;
+
+    @Resource
+    private TotalPoolVolumeWarnLogService totalPoolVolumeWarnLogService;
+
+    @Resource
+    private PumpingPressureService pumpingPressureService;
+
+    @Resource
+    private PumpingPressureWarnLogService pumpingPressureWarnLogService;
+
+    @Resource
+    private TorqueService torqueService;
+
+    @Resource
+    private TorqueWarnLogService torqueWarnLogService;
+
+    @Resource
+    private RedisUtil redisUtil;
+    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+    /**
+     * 根据井号,开始结束时间重新计算钻井工况动作
+     *
+     * @param workingConditionCalculationLogId
+     */
+    @Override
+    public Result<?> workingConditionCalculation(String workingConditionCalculationLogId) {
+        WorkingConditionCalculationLog workingConditionCalculationLogModel = workingConditionCalculationLogService.getById(workingConditionCalculationLogId);
+        String jh= workingConditionCalculationLogModel.getJh();
+        String startTime = workingConditionCalculationLogModel.getStartTime();
+        String endTime = workingConditionCalculationLogModel.getEndTime();
+        String calculateType = workingConditionCalculationLogModel.getCalculateType();
+         String isDelRedis=workingConditionCalculationLogModel.getIsDelRedis();
+        Result<Object> res = new Result<>();
+        switch (calculateType) {
+            case "0":
+                //从开始时间往前取10秒的时间作为开始时间
+                try {
+                    Date startTimeDate = sdf.parse(startTime);
+                    Date specifiedTime = CommonUtils.getSpecifiedTime(startTimeDate, Calendar.SECOND, -10);
+                    startTime = sdf.format(specifiedTime);
+                } catch (ParseException e) {
+                    e.printStackTrace();
+                }
+                QueryWrapper<OperatingConditionThreshold> operatingConditionThresholdQueryWrapper = new QueryWrapper<>();
+                operatingConditionThresholdQueryWrapper.lambda().eq(OperatingConditionThreshold::getJh, jh);
+                OperatingConditionThreshold one = operatingConditionThresholdService.getOne(operatingConditionThresholdQueryWrapper);
+                if (one != null) {
+                    calWorkingCondition(jh, startTime, endTime, one, workingConditionCalculationLogModel);
+                    res = Result.OK();
+                } else {
+                    res = Result.error("计算失败,无设置参数数据");
+                }
+
+                break;
+            case "1":
+                //钩载重新计算
+                hookLoadWarningCalculation(jh, startTime, endTime, workingConditionCalculationLogModel, isDelRedis);
+                res = Result.OK();
+                break;
+            case "2":
+                //总池体积重新计算
+                totalPoolVolumeWarningCalculation(jh, startTime, endTime, workingConditionCalculationLogModel, isDelRedis);
+                res = Result.OK();
+                break;
+            case "3":
+                //扭矩重新计算
+                torqueWarningCalculation(jh, startTime, endTime, workingConditionCalculationLogModel, isDelRedis);
+                res = Result.OK();
+                break;
+            case "4":
+                //泵压重新计算
+                pumpingPressureWarningCalculation(jh, startTime, endTime, workingConditionCalculationLogModel, isDelRedis);
+                res = Result.OK();
+                break;
+            default:
+                res = Result.error("计算失败,无计算类型");
+                break;
+        }
+        return res;
+    }
+
+    /**
+     * 计算工况动作并更新该点位数据
+     *
+     * @param jh
+     * @param startTime
+     * @param endTime
+     * @param one
+     */
+//    @Async("workingConditionCalculationTaskExecutor")
+    public void calWorkingCondition(String jh, String startTime, String endTime, OperatingConditionThreshold one, WorkingConditionCalculationLog workingConditionCalculationLogModel) {
+        Thread currentThread = Thread.currentThread();
+        String threadName = currentThread.getName();
+        long threadId = currentThread.getId();
+        Thread.State threadState = currentThread.getState();
+        System.out.println("当前线程名称: " + threadName);
+        System.out.println("当前线程ID: " + threadId);
+        System.out.println("当前线程状态: " + threadState);
+        //根据主键获取计算开始和结束时间
+        //  WorkingConditionCalculationLog workingConditionCalculationLogModel = workingConditionCalculationLogService.getById(workingConditionCalculationLogId);
+        //根据开始结束获取钻井数据
+        List<WellDrilling> list = queryList(jh, startTime, endTime);
+        String jhTableName = CommonUtils.getJhTableName(jh);
+        for (int i = 2; i < list.size(); i++) {
+            List<WellDrilling> calList = new ArrayList<>();
+            WellDrilling nowPoint = list.get(i);
+            WellDrilling perPoint = list.get(i - 2);
+            calList.add(nowPoint);
+            calList.add(perPoint);
+            ConditionDeterminationDto conditionDeterminationDto = conditionIdentificationService.conditionDetermination(calList, one);
+            nowPoint.setMotion(conditionDeterminationDto.getMotion());
+            nowPoint.setOperatingMode(conditionDeterminationDto.getOperatingMode());
+            log.info("更新点位时间:{};工况:{},动作:{}",nowPoint.getTime(),nowPoint.getMotion(),nowPoint.getOperatingMode());
+            QueryWrapper<WellDrilling> wrapper1 = new QueryWrapper<>();
+            wrapper1.apply("TO_DATE(SUBSTR(TIME, 1, 19), 'yyyy-MM-dd HH24:mi:ss') = to_date({0},'yyyy-mm-dd hh24:mi:ss')", nowPoint.getTime());
+            wellDrillingService.updateByTimeOrcale(jhTableName,conditionDeterminationDto.getMotion(), conditionDeterminationDto.getOperatingMode(), wrapper1);
+            if ("1".equals(workingConditionCalculationLogModel.getIsCalculate())) {
+                workingConditionCalculationLogModel.setIsCalculate("2");
+            }
+            ;
+            if (i == (list.size() - 1)) {
+                workingConditionCalculationLogModel.setIsCalculate("3");
+            }
+            workingConditionCalculationLogModel.setCalTime(nowPoint.getTime());
+            workingConditionCalculationLogService.updateById(workingConditionCalculationLogModel);
+        }
+    }
+
+    /**
+     * 钩载预警重新计算
+     *
+     * @param jh        井号
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     */
+    @SneakyThrows
+    @Async("workingConditionCalculationTaskExecutor")
+    public void hookLoadWarningCalculation(String jh, String startTime, String endTime, WorkingConditionCalculationLog workingConditionCalculationLogModel, String isDelRedis) {
+        Thread currentThread = Thread.currentThread();
+        String threadName = currentThread.getName();
+        long threadId = currentThread.getId();
+        Thread.State threadState = currentThread.getState();
+        System.out.println("当前线程名称: " + threadName);
+        System.out.println("当前线程ID: " + threadId);
+        System.out.println("当前线程状态: " + threadState);
+//        //根据主键获取计算开始和结束时间
+//        WorkingConditionCalculationLog workingConditionCalculationLogModel = workingConditionCalculationLogService.getById(workingConditionCalculationLogId);
+        BigDecimal warnValue = BigDecimal.valueOf(100);
+        BigDecimal rodWeight = BigDecimal.valueOf(7.73);
+        //根据开始结束获取钻井数据
+        List<WellDrilling> list = queryList(jh, startTime, endTime);
+        QueryWrapper<HookLoadWarnLog> hookLoadWarnLogQueryWrapper = new QueryWrapper<>();
+        // hookLoadWarnLogQueryWrapper.lambda().between(HookLoadWarnLog::getWarnTime,sdf.parse(startTime),sdf.parse(endTime));
+        // hookLoadWarnLogService.list(hookLoadWarnLogQueryWrapper);
+        hookLoadWarnLogQueryWrapper.apply("WARN_TIME <= to_date({0},'yyyy-mm-dd hh24:mi:ss')", endTime);
+        hookLoadWarnLogQueryWrapper.apply("WARN_TIME >= to_date({0},'yyyy-mm-dd hh24:mi:ss')", startTime);
+        hookLoadWarnLogService.remove(hookLoadWarnLogQueryWrapper);
+        redisUtil.del(jh + "_hook_load_recalculate");
+        redisUtil.del(jh + "_drilling_hook_load_recalculate");
+        for (int i = 0; i < list.size() - 1; i++) {
+            WellDrilling nowPoint = list.get(i);
+            String operatingMode = nowPoint.getOperatingMode();
+            BigDecimal bitdepth = nowPoint.getBitdepth();
+            int bitdepthThreshold = bitdepth.compareTo(BigDecimal.valueOf(500));
+            if (bitdepthThreshold >= 0) {
+                String redisHasKey = "";
+                log.info("钩载预警计算,当前点井深{};时间:{}", nowPoint.getBitdepth(), nowPoint.getTime());
+                if ("起下钻".equals(operatingMode)) {
+                    redisHasKey = jh + "_hook_load_recalculate";
+                    drillingOutHookLoadService.hookLoadWarnCalculate(nowPoint, redisHasKey, warnValue, rodWeight);
+                } else {
+                    redisHasKey = jh + "_drilling_hook_load_recalculate";
+                    drillingHookloadService.hookLoadWarnCalculate(nowPoint, redisHasKey, warnValue);
+                }
+            }else {
+                log.info("钩载预警计算,钻头位置小于500米;当前点井深{};时间:{}", nowPoint.getBitdepth(), nowPoint.getTime());
+            }
+            if ("1".equals(workingConditionCalculationLogModel.getIsCalculate())) {
+                workingConditionCalculationLogModel.setIsCalculate("2");
+            }
+            ;
+            if (i == (list.size() - 2)) {
+                workingConditionCalculationLogModel.setIsCalculate("3");
+            }
+            workingConditionCalculationLogModel.setCalTime(nowPoint.getTime());
+            workingConditionCalculationLogService.updateById(workingConditionCalculationLogModel);
+
+        }
+    }
+
+    /**
+     * 总池体积预警重新计算
+     *
+     * @param jh        井号
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     */
+    @SneakyThrows
+    @Async("workingConditionCalculationTaskExecutor")
+    public void totalPoolVolumeWarningCalculation(String jh, String startTime, String endTime, WorkingConditionCalculationLog workingConditionCalculationLogModel, String isDelRedis) {
+        Thread currentThread = Thread.currentThread();
+        String threadName = currentThread.getName();
+        long threadId = currentThread.getId();
+        Thread.State threadState = currentThread.getState();
+        System.out.println("当前线程名称: " + threadName);
+        System.out.println("当前线程ID: " + threadId);
+        System.out.println("当前线程状态: " + threadState);
+//        BigDecimal warnValue = BigDecimal.valueOf(100);
+//        BigDecimal rodWeight = BigDecimal.valueOf(7.73);
+        //根据开始结束获取钻井数据
+        List<WellDrilling> list = queryList(jh, startTime, endTime);
+        QueryWrapper<TotalPoolVolumeWarnLog> totalPoolVolumeWarnLogQueryWrapper = new QueryWrapper<>();
+        totalPoolVolumeWarnLogQueryWrapper.apply("WARN_TIME <= to_date({0},'yyyy-mm-dd hh24:mi:ss')", endTime);
+        totalPoolVolumeWarnLogQueryWrapper.apply("WARN_TIME >= to_date({0},'yyyy-mm-dd hh24:mi:ss')", startTime);
+        totalPoolVolumeWarnLogService.remove(totalPoolVolumeWarnLogQueryWrapper);
+        String redisHasKey = jh + "_total_pool_volume_recalculate";
+        if ("0".equals(isDelRedis)) {
+            redisUtil.del(redisHasKey);
+        }
+        for (int i = 0; i < list.size() - 1; i++) {
+            WellDrilling nowPoint = list.get(i);
+            // String operatingMode = nowPoint.getOperatingMode();
+            BigDecimal bitdepth = nowPoint.getBitdepth();
+            int bitdepthThreshold = bitdepth.compareTo(BigDecimal.valueOf(500));
+            if (bitdepthThreshold >= 0) {
+                try {
+                    totalPoolVolumeService.totalPoolVolumeWarn(nowPoint, redisHasKey);
+                } catch (ParseException e) {
+                    e.printStackTrace();
+                }
+            }
+            if ("1".equals(workingConditionCalculationLogModel.getIsCalculate())) {
+                workingConditionCalculationLogModel.setIsCalculate("2");
+            }
+            ;
+            if (i == (list.size() - 2)) {
+                workingConditionCalculationLogModel.setIsCalculate("3");
+            }
+            workingConditionCalculationLogModel.setCalTime(nowPoint.getTime());
+            workingConditionCalculationLogService.updateById(workingConditionCalculationLogModel);
+
+        }
+    }
+
+    /**
+     * 泵压预警重新计算
+     *
+     * @param jh        井号
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     */
+    @SneakyThrows
+    @Async("workingConditionCalculationTaskExecutor")
+    public void pumpingPressureWarningCalculation(String jh, String startTime, String endTime, WorkingConditionCalculationLog workingConditionCalculationLogModel, String isDelRedis) {
+        Thread currentThread = Thread.currentThread();
+        String threadName = currentThread.getName();
+        long threadId = currentThread.getId();
+        Thread.State threadState = currentThread.getState();
+        System.out.println("当前线程名称: " + threadName);
+        System.out.println("当前线程ID: " + threadId);
+        System.out.println("当前线程状态: " + threadState);
+        List<WellDrilling> list = queryList(jh, startTime, endTime);
+        String redisHasKey = jh + "_pumping_pressure_recalculate";
+        QueryWrapper<PumpingPressureWarnLog> pumpingPressureWarnLogQueryWrapper = new QueryWrapper<>();
+        pumpingPressureWarnLogQueryWrapper.apply("WARN_TIME <= to_date({0},'yyyy-mm-dd hh24:mi:ss')", endTime);
+        pumpingPressureWarnLogQueryWrapper.apply("WARN_TIME >= to_date({0},'yyyy-mm-dd hh24:mi:ss')", startTime);
+        pumpingPressureWarnLogService.remove(pumpingPressureWarnLogQueryWrapper);
+        if ("0".equals(isDelRedis)) {
+            redisUtil.del(redisHasKey);
+        }
+        for (int i = 0; i < list.size() - 1; i++) {
+            WellDrilling nowPoint = list.get(i);
+            BigDecimal bitdepth = nowPoint.getBitdepth();
+            int bitdepthThreshold = bitdepth.compareTo(BigDecimal.valueOf(500));
+            if (bitdepthThreshold >= 0) {
+                pumpingPressureService.pumpingPressureCalculate(nowPoint, redisHasKey);
+            }
+            if ("1".equals(workingConditionCalculationLogModel.getIsCalculate())) {
+                workingConditionCalculationLogModel.setIsCalculate("2");
+            }
+            ;
+            if (i == (list.size() - 2)) {
+                workingConditionCalculationLogModel.setIsCalculate("3");
+            }
+            workingConditionCalculationLogModel.setCalTime(nowPoint.getTime());
+            workingConditionCalculationLogService.updateById(workingConditionCalculationLogModel);
+        }
+    }
+
+    /**
+     * 扭矩预警重新计算
+     *
+     * @param jh        井号
+     * @param startTime 开始时间
+     * @param endTime   结束时间
+     */
+    @SneakyThrows
+    @Async("workingConditionCalculationTaskExecutor")
+    public void torqueWarningCalculation(String jh, String startTime, String endTime, WorkingConditionCalculationLog workingConditionCalculationLogModel, String isDelRedis) {
+        Thread currentThread = Thread.currentThread();
+        String threadName = currentThread.getName();
+        long threadId = currentThread.getId();
+        Thread.State threadState = currentThread.getState();
+        System.out.println("当前线程名称: " + threadName);
+        System.out.println("当前线程ID: " + threadId);
+        System.out.println("当前线程状态: " + threadState);
+        List<WellDrilling> list = queryList(jh, startTime, endTime);
+        QueryWrapper<TorqueWarnLog> torqueWarnLogQueryWrapper = new QueryWrapper<>();
+        torqueWarnLogQueryWrapper.apply("WARN_START_TIME <= to_date({0},'yyyy-mm-dd hh24:mi:ss')", endTime);
+        torqueWarnLogQueryWrapper.apply("WARN_START_TIME >= to_date({0},'yyyy-mm-dd hh24:mi:ss')", startTime);
+        torqueWarnLogService.remove(torqueWarnLogQueryWrapper);
+        String redisHasKey = jh + "_torque_recalculate";
+        if ("0".equals(isDelRedis)) {
+            redisUtil.del(redisHasKey);
+        }
+
+        for (int i = 0; i < list.size() - 1; i++) {
+            WellDrilling nowPoint = list.get(i);
+            BigDecimal bitdepth = nowPoint.getBitdepth();
+            int bitdepthThreshold = bitdepth.compareTo(BigDecimal.valueOf(500));
+            if (bitdepthThreshold >= 0) {
+                log.info("当前点井深{};时间:{}", nowPoint.getBitdepth(), nowPoint.getTime());
+                BigDecimal varianceWarnValue = BigDecimal.valueOf(0.5);
+                BigDecimal fluctuateWarn = BigDecimal.valueOf(0.5);
+                torqueService.torqueCalculate(nowPoint, redisHasKey,varianceWarnValue,fluctuateWarn);
+            } else {
+                log.info("钻头位置小于500米;当前点井深{};时间:{}", nowPoint.getBitdepth(), nowPoint.getTime());
+            }
+            if ("1".equals(workingConditionCalculationLogModel.getIsCalculate())) {
+                workingConditionCalculationLogModel.setIsCalculate("2");
+            }
+            ;
+            if (i == (list.size() - 2)) {
+                workingConditionCalculationLogModel.setIsCalculate("3");
+            }
+            workingConditionCalculationLogModel.setCalTime(nowPoint.getTime());
+            workingConditionCalculationLogService.updateById(workingConditionCalculationLogModel);
+        }
+    }
+
+    public List<WellDrilling> queryList(String jh, String startTime, String endTime) {
+        QueryWrapper<WellDrilling> wrapper = new QueryWrapper<>();
+        wrapper.apply("TO_DATE(SUBSTR(TIME, 1, 19), 'yyyy-MM-dd HH24:mi:ss') <= to_date({0},'yyyy-mm-dd hh24:mi:ss')", endTime);
+        wrapper.apply("TO_DATE(SUBSTR(TIME, 1, 19), 'yyyy-MM-dd HH24:mi:ss') >= to_date({0},'yyyy-mm-dd hh24:mi:ss')", startTime);
+        wrapper.orderByAsc("TIME");
+        String jhTableName = CommonUtils.getJhTableName(jh);
+        return wellDrillingService.selectListOrcale(jhTableName, wrapper);
+    }
+
+//    public void calWorkingCondition(String jhTableName,List<WellDrilling> list,OperatingConditionThreshold one,WorkingConditionCalculationLog workingConditionCalculationLogModel){
+//
+//    }
+
+}

+ 13 - 0
yujing-condition-identification/src/main/java/com/cn/tianji/service/WorkingConditionCalculationService.java

@@ -0,0 +1,13 @@
+package com.cn.tianji.service;
+
+import com.cn.tianji.common.Result;
+
+public interface WorkingConditionCalculationService {
+
+    /**
+     *根据井号,开始结束时间重新计算钻井工况动作
+     *
+     * @param jh
+     */
+    public Result<?> workingConditionCalculation(String workingConditionCalculationLogId);
+}

+ 52 - 0
yujing-condition-identification/src/main/resources/config/application-dev.yml

@@ -0,0 +1,52 @@
+spring:
+  datasource:
+    dynamic:
+      primary: master
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+        # 连接池的配置信息
+        # 初始化大小,最小,最大
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        # 打开PSCache,并且指定每个连接上PSCache的大小
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,wall,slf4j
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        master:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//10.66.116.46:1521/JT_ZJ
+          username: jtznyj
+          password: jtznyj#2021
+        chartDataSource:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//10.66.116.46/jt
+          username: jtgcyth2018
+          password: Sljtyw_2018
+        yjDataSource:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//10.66.116.46:1521/JT_LJ
+          username: tj_zjgc
+          password: zjgc@2024
+        zjyDataSource:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//10.66.116.46:1521/JT_ZJ
+          username: zjycs
+          password: Zjy_2019

+ 52 - 0
yujing-condition-identification/src/main/resources/config/application-local.yml

@@ -0,0 +1,52 @@
+spring:
+  datasource:
+    dynamic:
+      primary: master
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+        # 连接池的配置信息
+        # 初始化大小,最小,最大
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        # 打开PSCache,并且指定每个连接上PSCache的大小
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,wall,slf4j
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        master:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//192.168.31.147:1521/orcle
+          username: JT
+          password: TjJt123456
+        chartDataSource:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//192.168.31.147:1521/orcle
+          username: JT
+          password: TjJt123456
+        yjDataSource:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//192.168.31.147:1521/orcle
+          username: JT
+          password: TjJt123456
+        zjyDataSource:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//192.168.31.147:1521/orcle
+          username: JT
+          password: TjJt123456

+ 54 - 0
yujing-condition-identification/src/main/resources/config/application-prod.yml

@@ -0,0 +1,54 @@
+spring:
+  datasource:
+    dynamic:
+      primary: master
+      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
+        # 连接池的配置信息
+        # 初始化大小,最小,最大
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        # 打开PSCache,并且指定每个连接上PSCache的大小
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+        filters: stat,wall,slf4j
+        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        master:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//10.66.116.46:1521/JT_ZJ
+          username: jtznyj
+          password: jtznyj#2021
+        chartDataSource:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//10.66.116.46/jt
+          username: jtgcyth2018
+          password: Sljtyw_2018
+        yjDataSource:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//10.66.116.46:1521/JT_LJ
+          username: tj_zjgc
+          password: ZjgcTJ#zjgc@2024
+        zjyDataSource:
+          validationQuery: SELECT 1 FROM DUAL
+          driver-class-name: oracle.jdbc.OracleDriver
+          url: jdbc:oracle:thin:@//10.66.116.46:1521/JT_ZJ
+          username: zjycs
+          password: Zjy_2019
+#rocketmq:
+#  name-server: localhost:9876	 # 这里需要换成自己的 rocketMq 的地址

+ 41 - 0
yujing-condition-identification/src/main/resources/config/application.yml

@@ -0,0 +1,41 @@
+server:
+  port: 8907
+  address: 0.0.0.0
+
+spring:
+  profiles:
+    active: prod #prod #local
+  application:
+    name: yujing-condition-identification
+  mvc:
+    static-path-pattern: /**
+    jackson:
+      time-zone: GMT+8
+      date-format: "yyyy-MM-dd HH:mm:ss"
+  redis:
+    database: 0
+    host: localhost
+    lettuce:
+      pool:
+        max-active: 8   #最大连接数据库连接数,设 -1 为没有限制
+        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
+        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
+      shutdown-timeout: 100ms
+    password: 123
+    port: 6379
+logging:
+  config: classpath:logback.xml
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0

+ 103 - 0
yujing-condition-identification/src/main/resources/logback.xml

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration debug="false">
+    <!--定义日志文件的存储地址 -->
+    <property name="LOG_HOME" value="../condition-logs" />
+
+    <!--<property name="COLOR_PATTERN" value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta( %replace(%caller{1}){'\t|Caller.{1}0|\r\n', ''})- %gray(%msg%xEx%n)" />-->
+    <!-- 控制台输出 -->
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>-->
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}:%L) - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 按照每天生成日志文件 -->
+    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 -->
+            <FileNamePattern>${LOG_HOME}/condition-identification-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
+            <!--日志文件保留天数 -->
+            <MaxHistory>30</MaxHistory>
+            <maxFileSize>10MB</maxFileSize>
+        </rollingPolicy>
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <!--设置日志级别,过滤掉info日志,只输入error日志-->
+            <level>INFO</level>
+        </filter>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
+        </encoder>
+    </appender>
+    <!-- 按照每天生成日志文件 -->
+    <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 -->
+            <FileNamePattern>${LOG_HOME}/error/condition-identification-error-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
+            <!--日志文件保留天数 -->
+            <MaxHistory>30</MaxHistory>
+            <maxFileSize>10MB</maxFileSize>
+        </rollingPolicy>
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <!--设置日志级别,过滤掉info日志,只输入error日志-->
+            <level>ERROR</level>
+        </filter>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
+        </encoder>
+    </appender>
+    <!-- 生成 error html格式日志开始 -->
+    <appender name="HTML" class="ch.qos.logback.core.FileAppender">
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <!--设置日志级别,过滤掉info日志,只输入error日志-->
+            <level>ERROR</level>
+        </filter>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="ch.qos.logback.classic.html.HTMLLayout">
+                <pattern>%p%d%msg%M%F{32}%L</pattern>
+            </layout>
+        </encoder>
+        <file>${LOG_HOME}/error-html/condition-identification-error-log.html</file>
+    </appender>
+    <!-- 生成 error html格式日志结束 -->
+
+    <!-- 每天生成一个html格式的日志开始 -->
+    <appender name="FILE_HTML" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 -->
+            <FileNamePattern>${LOG_HOME}/html/condition-identification-%d{yyyy-MM-dd}.%i.html</FileNamePattern>
+            <!--日志文件保留天数 -->
+            <MaxHistory>30</MaxHistory>
+            <MaxFileSize>10MB</MaxFileSize>
+        </rollingPolicy>
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <!--设置日志级别,过滤掉info日志,只输入error日志-->
+            <level>INFO</level>
+        </filter>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="ch.qos.logback.classic.html.HTMLLayout">
+                <pattern>%p%d%msg%M%F{32}%L</pattern>
+            </layout>
+        </encoder>
+    </appender>
+    <!-- 每天生成一个html格式的日志结束 -->
+
+    <!--myibatis log configure -->
+    <logger name="com.apache.ibatis" level="TRACE" />
+    <logger name="java.sql.Connection" level="DEBUG" />
+    <logger name="java.sql.Statement" level="DEBUG" />
+    <logger name="java.sql.PreparedStatement" level="DEBUG" />
+
+    <!-- 日志输出级别 -->
+    <root level="INFO">
+        <appender-ref ref="STDOUT" />
+        <appender-ref ref="FILE" />
+        <appender-ref ref="ERROR_FILE" />
+<!--        <appender-ref ref="HTML" />-->
+<!--        <appender-ref ref="FILE_HTML" />-->
+    </root>
+
+</configuration>

+ 53 - 0
yujing-hook-load-warning/pom.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>yujing-calculate</artifactId>
+        <groupId>com.cn.tianji</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <!-- 打包格式 -->
+    <packaging>jar</packaging>
+    <artifactId>yujing-hook-load-warning</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>com.cn.tianji</groupId>
+            <artifactId>yujing-common</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.cn.tianji</groupId>
+            <artifactId>yujing-warning-calculation</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+    <!-- 打包插件 -->
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <executable>true</executable>
+                    <layout>JAR</layout>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                        <configuration>
+                            <attach>false</attach>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 15 - 0
yujing-hook-load-warning/src/main/java/com/cn/tianji/HookLoadWarningApplication.java

@@ -0,0 +1,15 @@
+package com.cn.tianji;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @author Zhao RenJi
+ */
+@SpringBootApplication
+public class HookLoadWarningApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(HookLoadWarningApplication.class, args);
+        System.out.println("HookLoadWarning启动");
+    }
+}

+ 33 - 0
yujing-hook-load-warning/src/main/java/com/cn/tianji/config/AsyncConfig.java

@@ -0,0 +1,33 @@
+package com.cn.tianji.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadPoolExecutor;
+
+@Configuration
+@EnableAsync
+public class AsyncConfig  implements AsyncConfigurer {
+
+    @Bean(name = "hookLoadTaskExecutor")
+    public Executor taskExecutor() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(10); // 设置核心线程数
+        executor.setMaxPoolSize(20); // 设置最大线程数
+        executor.setQueueCapacity(500); // 设置队列容量
+        executor.setKeepAliveSeconds(60); // 线程空闲时间
+        executor.setThreadNamePrefix("HookLoadThread-"); // 设置线程名前缀
+        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.DiscardPolicy()); // 拒绝策略
+        executor.initialize();
+        return executor;
+    }
+
+    @Override
+    public Executor getAsyncExecutor() {
+        return taskExecutor();
+    }
+}

+ 18 - 0
yujing-hook-load-warning/src/main/java/com/cn/tianji/config/CorsConfig.java

@@ -0,0 +1,18 @@
+package com.cn.tianji.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+@Configuration
+public class CorsConfig implements WebMvcConfigurer {
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**") // 所有接口
+                .allowCredentials(true) // 是否发送 Cookie
+                .allowedOriginPatterns("*") // 支持域
+                .allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"}) // 支持方法
+                .allowedHeaders("*")
+                .exposedHeaders("*");
+    }
+}

+ 46 - 0
yujing-hook-load-warning/src/main/java/com/cn/tianji/rocketMq/ConsumerClient.java

@@ -0,0 +1,46 @@
+//package com.cn.tianji.rocketMq;
+//
+//import com.aliyun.openservices.ons.api.MessageListener;
+//import com.aliyun.openservices.ons.api.PropertyKeyConst;
+//import com.aliyun.openservices.ons.api.bean.ConsumerBean;
+//import com.aliyun.openservices.ons.api.bean.Subscription;
+//import com.cn.tianji.config.RocketMqConfig;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//
+//import java.util.HashMap;
+//import java.util.Map;
+//import java.util.Properties;
+//
+//@Configuration
+//public class ConsumerClient {
+//    @Autowired
+//    RocketMqConfig rocketMqConfig;
+//    @Autowired
+//    private HookLoadRocketMessageListener messageListener;
+//
+//    @Bean(initMethod = "start", destroyMethod = "shutdown")
+//    public ConsumerBean buildConsumer() {
+//
+//        //消费者对象bean
+//        ConsumerBean consumerBean = new ConsumerBean();
+//        //配置文件
+//        Properties properties = rocketMqConfig.build();
+//        //设置组id
+//        properties.setProperty(PropertyKeyConst.GROUP_ID, "YuJing_Group_C_Hook");
+//        //将消费者线程数固定为20个 20为默认值
+////        properties.setProperty(PropertyKeyConst.ConsumeThreadNums, threadNum);
+//        consumerBean.setProperties(properties);
+//
+//        //配置订阅关系
+//        Map<Subscription, MessageListener> subscriptionTable = new HashMap<>();
+//        //当前为订阅一个主题配置(订阅多个topic一样设置)
+//        Subscription subscription = new Subscription();
+//        subscription.setTopic("topic-well_log");
+//        subscription.setExpression("*");
+//        subscriptionTable.put(subscription, messageListener);
+//        consumerBean.setSubscriptionTable(subscriptionTable);
+//        return consumerBean;
+//    }
+//}

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.