Browse Source

update config

xsr 4 months ago
parent
commit
397d1ffbc2

+ 3 - 1
src/main/java/com/gct/aoid/config/FeignConfig.java

@@ -31,6 +31,8 @@ public class FeignConfig implements RequestInterceptor {
31 31
     private String tokeAuthUrl;
32 32
     private static String token;
33 33
 
34
+    private static String lockStr = "token";
35
+
34 36
     @Bean(name = "restTemplate")
35 37
     RestTemplate getRestTemplate() {
36 38
         return new RestTemplate();
@@ -39,7 +41,7 @@ public class FeignConfig implements RequestInterceptor {
39 41
     @Override
40 42
     public void apply(RequestTemplate requestTemplate) {
41 43
         if (StringUtil.isBlankOrEmpty(token)) {
42
-            synchronized (token) {
44
+            synchronized (lockStr) {
43 45
                 if (StringUtil.isBlankOrEmpty(token)) {
44 46
                     List<String> hostList = Arrays.asList(tokeAuthUrl.split(","));
45 47
                     //手动获取RestTemplate 实例

+ 2 - 0
src/main/java/com/gct/aoid/controller/AoidDailyYieldController.java

@@ -266,5 +266,7 @@ public class AoidDailyYieldController {
266 266
 //        System.out.println("do run");
267 267
 //        System.exit(0);
268 268
 //    }
269
+
270
+
269 271
 }
270 272
 

+ 2 - 1
src/main/java/com/gct/aoid/service/impl/CalDiagramProductionService.java

@@ -1405,6 +1405,8 @@ public class CalDiagramProductionService {
1405 1405
 
1406 1406
         }
1407 1407
 
1408
+
1409
+
1408 1410
         //endregion
1409 1411
         //region step 2:
1410 1412
         AoidMsgValue.DiagnoseResult diagnoseResult = msg.getDiagnoseResult();
@@ -1494,7 +1496,6 @@ public class CalDiagramProductionService {
1494 1496
         //endregion
1495 1497
     }
1496 1498
 
1497
-
1498 1499
     public class ProDataForCalProductionValue {
1499 1500
 
1500 1501
         private Double bj;

+ 1 - 1
src/main/resources/application-dev.yml

@@ -94,7 +94,7 @@ gct:
94 94
         access-key: warn-msg-v1
95 95
         secret-key: warn-msg-v1
96 96
     aoid:
97
-      enable: false
97
+      enable: true
98 98
       topic: aoid-msg3
99 99
       tags: v3
100 100
       log-file-path: /home/lloyd/Desktop/log/task-aoid.json

+ 5 - 5
src/main/resources/application-test.yml

@@ -20,7 +20,7 @@ spring:
20 20
   cloud:
21 21
     nacos:
22 22
       ## 指定nacos server地址
23
-      server-addr: 192.168.31.252
23
+      server-addr: 192.168.31.101
24 24
     #      discovery:
25 25
     #        namespace: bcff0d3d-a340-448c-a2c8-4a195276807e
26 26
     #        group: DEV_GROUP
@@ -39,7 +39,7 @@ spring:
39 39
   datasource:
40 40
     ## Hikari连接池的设置 Hikari 时间单位都是毫秒
41 41
     type: com.zaxxer.hikari.HikariDataSource
42
-    url: jdbc:postgresql://192.168.31.252:54321/calliquid
42
+    url: jdbc:postgresql://192.168.31.101:54321/calliquid
43 43
     username: root
44 44
     password: 123456
45 45
     driver-class-name: org.postgresql.Driver
@@ -94,7 +94,7 @@ gct:
94 94
         access-key: warn-msg-v1
95 95
         secret-key: warn-msg-v1
96 96
     aoid:
97
-      enable: false
97
+      enable: true
98 98
       topic: aoid-msg3
99 99
       tags: v3
100 100
       log-file-path: /home/lloyd/Desktop/log/task-aoid.json
@@ -102,7 +102,7 @@ gct:
102 102
         group: aoid3
103 103
         access-key: aoid-msg-v3
104 104
         secret-key: aoid-msg-v3
105
-      name-server: 192.168.31.252:9876
105
+      name-server: 192.168.31.101:9876
106 106
       consumer:
107 107
         group: aoid3
108 108
         access-key: aoid-msg-v3
@@ -181,7 +181,7 @@ feign:
181 181
         ReadTimeOut: 50000
182 182
 #token 认证中心主机地址
183 183
 auth:
184
-  hostList: 192.168.31.252:9001
184
+  hostList: 192.168.31.101:9001
185 185
 
186 186
 mybatis-plus:
187 187
   global-config:

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -1,7 +1,7 @@
1 1
 spring:
2 2
   ## 切换配置文件
3 3
   profiles:
4
-    active: dev   # dev 开发环境    /   pro  生产环境    / test   测试环境
4
+    active: test   # dev 开发环境    /   pro  生产环境    / test   测试环境
5 5
 
6 6
   application:
7 7
     name: production-calculation

+ 3 - 81
src/test/java/com/gct/aoid/MyTest.java

@@ -15,6 +15,7 @@ import com.gct.aoid.service.AoidDailyYieldService;
15 15
 import com.gct.aoid.service.AoidSinglegtYieldService;
16 16
 import com.gct.aoid.service.EnableOrPauseService;
17 17
 import com.gct.aoid.service.LiqProdDailyCalService;
18
+import com.gct.aoid.service.impl.AoidDailyYieldServiceImpl;
18 19
 import com.gct.aoid.service.impl.CalDiagramProductionService;
19 20
 import com.gct.aoid.service.impl.CalibrationParameterService;
20 21
 import com.gct.common.util.DateTimeUtil;
@@ -46,92 +47,13 @@ import java.util.stream.Collectors;
46 47
 @RunWith(SpringRunner.class)
47 48
 @ContextConfiguration
48 49
 public class MyTest {
49
-    @Autowired
50
-    CalDiagramProductionService calDiagramProductionService ;
51
-    @Autowired
52
-    BaseDataClient client;
53
-    @Autowired
54
-    DiagnoseClient diagnoseClient;
55
-    @Autowired
56
-    AoidSinglegtYieldService aoidSinglegtYieldService;
57
-    @Autowired
58
-    AoidDailyYieldService aoidDailyYieldService;
59
-    @Autowired
60
-    AoidSinglegtYieldController aoidSinglegtYieldController;
61
-    @Autowired
62
-    AoidSinglegtYieldMapper aoidSinglegtYieldMapper;
63
-    @Autowired
64
-    LiqProdDailyCalService liqProdDailyCalService;
65
-//    @Autowired
66
-//    SumDataTaskMapper sumDataTaskMapper;
67
-//    @Autowired
68
-//    AoidParamSettingService aoidParamSettingService;
69
-//    @Autowired
70
-//    AoidLiquidAbnormalService aoidLiquidAbnormalService;
71
-//    private static final  Logger reload = (Logger) LoggerFactory.getLogger("reload");
72
-//    @Test
73
-//    public void test() {
74
-//        List<AoidParamSetting> aoidParamSetting = aoidParamSettingService.getAoidParamSetting();
75
-//        aoidLiquidAbnormalService.addAoidLiquidAbnormalNew(DateTimeUtil.formatDateTime("2021-08-18 00:00:00"),aoidParamSetting);
76
-//    }
77
-@Autowired
78
-    EnableOrPauseService enableOrPauseService;
79
-
80
-    @Test
81
-    public void test1() throws InvocationTargetException, IllegalAccessException, InstantiationException, NoSuchMethodException {
82
-        String[] x = {"27"};
83
-        String starDate = "2022-07-05";
84
-        String time = "16:00:00";
85
-        liqProdDailyCalService.calculate(x,starDate,time);
86
-    }
87 50
 
88 51
     @Autowired
89
-    AoidSinglegtYieldMapper singlegtYieldMapper;
90
-    @Test
91
-    //@Scheduled
92
-    public void test2(){
93
-        LiqWarringVo liqWarringVo = new LiqWarringVo()
94
-                .setWellId("CHW04").setPordDate("2021-08-17 00:00:00");
95
-
96
-        System.out.println(aoidDailyYieldService.getLiqWarring(liqWarringVo));
97
-    }
98
-
52
+    AoidDailyYieldServiceImpl aoidDailyYieldService;
99 53
 
100 54
     @Autowired
101
-    CalibrationParameterService calibrationParameterService;
102
-
103
-    @Test
104
-    public void testXs(){
105
-        double sumArea = 0;
106
-        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
107
-        List<AoidSinglegtYield> results = aoidSinglegtYieldService.list(new QueryWrapper<AoidSinglegtYield>().eq("well_id", "车峰15")
108
-                .between("prod_date", LocalDateTime.parse("2022-10-03 16:00:00",df)
109
-                        , LocalDateTime.parse("2022-10-04 16:00:00",df)));
110
-        String[] sgts = results.stream().map(AoidSinglegtYield::getSgt).collect(Collectors.toList()).toArray(new String[]{});
111
-
112
-        for (int y = 0; y < sgts.length; y++) {
55
+    AoidSinglegtYieldService aoidSinglegtYieldService;
113 56
 
114
-            List<List<Double>> sgtList = new ArrayList<>();
115
-            if (Objects.nonNull(sgts[y])) {
116
-                sgtList = SGTUtil.encodeToUseList(sgts[y]);
117
-                if (Objects.nonNull(sgtList) && sgtList.size() > 1) {
118
-                    sgtList.remove(sgtList.size() - 1);
119
-                    sgtList.add(sgtList.get(0));
120
-                }
121
-                Double[][] sgtValue = JSONObject.parseObject(sgtList.toString(), Double[][].class);
122
-                double areaReal = CardAreaAlgorithm.calArea(sgtValue);
123
-                if (areaReal>0)
124
-                {
125
-                    sumArea += areaReal;
126
-                }
127
-            }
128 57
 
129
-        }
130
-        double areaAvg = sumArea/sgts.length;
131
-        if (areaAvg<200)
132
-        {
133
-            System.out.println(calibrationParameterService.coefficientValue(0,results));
134
-        }
135
-    }
136 58
     
137 59
 }