Commit 789e649ba918b7fab42993b43cf30df890240d0f
1 parent
5370daa9
bf
Showing
5 changed files
with
83 additions
and
34 deletions
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/impl/BsthTLineServiceImpl.java
| ... | ... | @@ -308,21 +308,26 @@ public class BsthTLineServiceImpl implements IBsthTLineService |
| 308 | 308 | |
| 309 | 309 | @Override |
| 310 | 310 | public void sendKFK(BsthTLineKFK bsthTLine){ |
| 311 | - Map<String, Object> map = new HashMap<>(); | |
| 312 | - map.put("datatype", "PDGJ_XLDA"); | |
| 313 | - map.put("datas", bsthTLine); | |
| 314 | - JSON j=new cn.hutool.json.JSONObject(map); | |
| 315 | - String json =j.toString(); | |
| 316 | - ListenableFuture<SendResult<String, String>> future = kafkaTemplate.send("XLJC", json); | |
| 317 | - future.addCallback(new ListenableFutureCallback<SendResult<String, String>>() { | |
| 318 | - @Override | |
| 319 | - public void onSuccess(SendResult<String, String> result) { | |
| 320 | - } | |
| 321 | - @Override | |
| 322 | - public void onFailure(Throwable ex) { | |
| 323 | - logger.error("kafka发送线路数据异常", ex); | |
| 324 | - } | |
| 325 | - }); | |
| 311 | + try { | |
| 312 | + Map<String, Object> map = new HashMap<>(); | |
| 313 | + map.put("datatype", "XLJC"); | |
| 314 | + map.put("datas", bsthTLine); | |
| 315 | + JSON j=new cn.hutool.json.JSONObject(map); | |
| 316 | + String json =j.toString(); | |
| 317 | + ListenableFuture<SendResult<String, String>> future = kafkaTemplate.send("PDGJ_XLDA", json); | |
| 318 | + future.addCallback(new ListenableFutureCallback<SendResult<String, String>>() { | |
| 319 | + @Override | |
| 320 | + public void onSuccess(SendResult<String, String> result) { | |
| 321 | + } | |
| 322 | + @Override | |
| 323 | + public void onFailure(Throwable ex) { | |
| 324 | + logger.error("kafka发送线路数据异常", ex); | |
| 325 | + } | |
| 326 | + }); | |
| 327 | + } catch (Exception e) { | |
| 328 | + System.out.println("111"); | |
| 329 | + e.printStackTrace(); | |
| 330 | + } | |
| 326 | 331 | } |
| 327 | 332 | |
| 328 | 333 | @Override | ... | ... |
bsthLineProfiles/src/main/resources/application-druid.yml
| ... | ... | @@ -5,15 +5,15 @@ spring: |
| 5 | 5 | driverClassName: com.mysql.cj.jdbc.Driver |
| 6 | 6 | druid: |
| 7 | 7 | # 主库数据源 |
| 8 | + master: | |
| 9 | + url: jdbc:mysql://192.168.101.111:3306/bsth_line_profiles?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | |
| 10 | + username: xldasys | |
| 11 | + password: bsth@pj2021 | |
| 12 | + # 主库数据源 | |
| 8 | 13 | # master: |
| 9 | -# url: jdbc:mysql://localhost:3306/linedata?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | |
| 14 | +# url: jdbc:mysql://localhost:3306/bsth_line_profiles?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | |
| 10 | 15 | # username: root |
| 11 | -# password: Aa123456 | |
| 12 | - # 主库数据源 | |
| 13 | - master: | |
| 14 | - url: jdbc:mysql://localhost:3306/bsth_line_profiles?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | |
| 15 | - username: root | |
| 16 | - password: 1995627a | |
| 16 | +# password: 1995627a | |
| 17 | 17 | # 从库数据源 |
| 18 | 18 | slave: |
| 19 | 19 | # 从数据源开关/默认关闭 | ... | ... |
bsthLineProfiles/src/main/resources/application.yml
| ... | ... | @@ -102,6 +102,19 @@ spring: |
| 102 | 102 | # 令牌有效期(默认30分钟) |
| 103 | 103 | expireTime: 30 |
| 104 | 104 | |
| 105 | + kafka: | |
| 106 | + bootstrap-servers: 47.106.82.232:9092 | |
| 107 | + producer: | |
| 108 | + key-serializer: org.apache.kafka.common.serialization.StringSerializer | |
| 109 | + value-serializer: org.apache.kafka.common.serialization.StringSerializer | |
| 110 | + buffer-memory: 33554432 | |
| 111 | + acks: all | |
| 112 | + consumer: | |
| 113 | + enable-auto-commit: true | |
| 114 | + group-id: test | |
| 115 | + key-serializer: org.apache.kafka.common.serialization.StringSerializer | |
| 116 | + value-serializer: org.apache.kafka.common.serialization.StringSerializer | |
| 117 | + | |
| 105 | 118 | # MyBatis |
| 106 | 119 | mybatis: |
| 107 | 120 | # 搜索指定包别名 |
| ... | ... | @@ -179,15 +192,4 @@ gen: |
| 179 | 192 | # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) |
| 180 | 193 | tablePrefix: sys_ |
| 181 | 194 | |
| 182 | -kafka: | |
| 183 | - bootstrap-servers: 47.106.82.232:9092 | |
| 184 | - producer: | |
| 185 | - key-serializer: org.apache.kafka.common.serialization.StringSerializer | |
| 186 | - value-serializer: org.apache.kafka.common.serialization.StringSerializer | |
| 187 | - buffer-memory: 33554432 | |
| 188 | - acks: all | |
| 189 | - consumer: | |
| 190 | - enable-auto-commit: true | |
| 191 | - group-id: test | |
| 192 | - key-serializer: org.apache.kafka.common.serialization.StringSerializer | |
| 193 | - value-serializer: org.apache.kafka.common.serialization.StringSerializer | |
| 195 | + | ... | ... |
bsthLineProfiles/src/main/resources/logback.xml
| ... | ... | @@ -34,6 +34,29 @@ |
| 34 | 34 | <onMismatch>DENY</onMismatch> |
| 35 | 35 | </filter> |
| 36 | 36 | </appender> |
| 37 | + | |
| 38 | + <!-- 系统日志输出 --> | |
| 39 | + <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| 40 | + <file>${log.path}/sys-debug.log</file> | |
| 41 | + <!-- 循环政策:基于时间创建日志文件 --> | |
| 42 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
| 43 | + <!-- 日志文件名格式 --> | |
| 44 | + <fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern> | |
| 45 | + <!-- 日志最大的历史 60天 --> | |
| 46 | + <maxHistory>60</maxHistory> | |
| 47 | + </rollingPolicy> | |
| 48 | + <encoder> | |
| 49 | + <pattern>${log.pattern}</pattern> | |
| 50 | + </encoder> | |
| 51 | + <filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
| 52 | + <!-- 过滤的级别 --> | |
| 53 | + <level>DEBUG</level> | |
| 54 | + <!-- 匹配时的操作:接收(记录) --> | |
| 55 | + <onMatch>ACCEPT</onMatch> | |
| 56 | + <!-- 不匹配时的操作:拒绝(不记录) --> | |
| 57 | + <onMismatch>DENY</onMismatch> | |
| 58 | + </filter> | |
| 59 | + </appender> | |
| 37 | 60 | |
| 38 | 61 | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 39 | 62 | <file>${log.path}/sys-error.log</file> | ... | ... |
bsthLineProfiles/src/main/resources/templates/system/lineExamine/line.html
| ... | ... | @@ -379,6 +379,11 @@ |
| 379 | 379 | yes: function () { |
| 380 | 380 | var url=prefix+'/examine' |
| 381 | 381 | var data={'id':id,'examineType':examineType,'examineStatus':'2'} |
| 382 | + layer.msg('正在处理中,请稍后...', { | |
| 383 | + icon: 16 | |
| 384 | + ,shade: 0.3 | |
| 385 | + ,time: false | |
| 386 | + }); | |
| 382 | 387 | $.post(url, data, function(result) { |
| 383 | 388 | if (result.code == web_status.SUCCESS) { |
| 384 | 389 | $.modal.closeAll(); |
| ... | ... | @@ -392,6 +397,11 @@ |
| 392 | 397 | btn2:function () { |
| 393 | 398 | var url=prefix+'/examine' |
| 394 | 399 | var data={'id':id,'examineType':examineType,'examineStatus':'3'} |
| 400 | + layer.msg('正在处理中,请稍后...', { | |
| 401 | + icon: 16 | |
| 402 | + ,shade: 0.3 | |
| 403 | + ,time: false | |
| 404 | + }); | |
| 395 | 405 | $.post(url, data, function(result) { |
| 396 | 406 | if (result.code == web_status.SUCCESS) { |
| 397 | 407 | $.table.refresh(); |
| ... | ... | @@ -404,6 +414,15 @@ |
| 404 | 414 | }); |
| 405 | 415 | layer.full(index); |
| 406 | 416 | } |
| 417 | + /*beforeSend: function () { | |
| 418 | + $.modal.loading("正在处理中,请稍后..."); | |
| 419 | + }, | |
| 420 | + success: function(result) { | |
| 421 | + if (typeof callback == "function") { | |
| 422 | + callback(result); | |
| 423 | + } | |
| 424 | + $.operate.ajaxSuccess(result); | |
| 425 | + }*/ | |
| 407 | 426 | |
| 408 | 427 | $("input[name='createTimeStr']").datetimepicker({ |
| 409 | 428 | format: "yyyy-mm-dd", | ... | ... |