From 6418b2978c9cc4049c735b239efb223e20d33858 Mon Sep 17 00:00:00 2001 From: wuzeyu <1223318623@qq.com> Date: 星期一, 02 九月 2024 16:02:32 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/CommandP206V202404Ctrl.java | 91 ++++++++++++++++-------------- pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/ComSupportP206V202404.java | 6 + pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/resources/log4j2.yml | 73 ++++++++++++++++++++++++ pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java | 2 4 files changed, 126 insertions(+), 46 deletions(-) diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java index 0dcd9cc..8adc863 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/web/com/CommandCtrl.java @@ -189,7 +189,7 @@ } /** - * 鏈湴璋冪敤锛屼緥濡傞噸浠诲姟鏍戜腑鏌愪釜浠诲姟涓嬪彂鐨勫懡浠わ紙濡傛竻绌哄懡浠わ級 + * 鏈湴璋冪敤锛屼緥濡備换鍔℃爲涓煇涓换鍔′笅鍙戠殑鍛戒护锛堝娓呯┖鍛戒护锛� * @param com * @return */ diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/ComSupportP206V202404.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/ComSupportP206V202404.java index d9198ea..285cd06 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/ComSupportP206V202404.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/ComSupportP206V202404.java @@ -19,8 +19,10 @@ * @Description */ public class ComSupportP206V202404 { - protected static final String mwIp = "romq9311819.vicp.fun" ; //http://romq9311819.vicp.fun:16583 - protected static final String mwPort = "16583" ; + //protected static final String mwIp = "romq9311819.vicp.fun" ; //http://romq9311819.vicp.fun:16583 + //protected static final String mwPort = "16583" ; + protected static final String mwIp = "127.0.0.1" ; + protected static final String mwPort = "8071" ; protected static String mwUrlTest = "http://" + mwIp + ":" + mwPort + "/rtuMw/com/test" ; protected static String mwUrlSendCom = "http://" + mwIp + ":" + mwPort + "/rtuMw/com/send" ; diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/CommandP206V202404Ctrl.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/CommandP206V202404Ctrl.java index 1a4430f..28fa373 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/CommandP206V202404Ctrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V202404test/CommandP206V202404Ctrl.java @@ -18,53 +18,58 @@ public class CommandP206V202404Ctrl extends ComSupportP206V202404 { @GetMapping(path = "test") - public BaseResponse<String> test(String com) { + public BaseResponse<String> test(String rtuAddr, String com) { BaseResponse<String> rt = null ; - if(com == null){ + if(rtuAddr == null || rtuAddr.trim().equals("")){ rt = this.connect() ;//杩炴帴閫氫俊涓棿浠舵祴璇� }else{ - try{ - if(com.equals("10")){ - rt = this.cd10() ; - }else if(com.equals("15")){ - rt = this.cd15() ; - }else if(com.equals("16")){ - rt = this.cd16() ; - }else if(com.equals("21")){ - rt = this.cd21() ; - }else if(com.equals("22")){ - rt = this.cd22() ; - }else if(com.equals("23")){ - rt = this.cd23() ; - }else if(com.equals("24")){ - rt = this.cd24() ; - }else if(com.equals("26")){ - rt = this.cd26() ; - }else if(com.equals("31")){ - rt = this.cd31() ; - }else if(com.equals("55")){ - rt = this.cd55(1) ; - }else if(com.equals("65")){ - rt = this.cd65(1) ; - }else if(com.equals("86")){ - rt = this.cd86() ; - }else if(com.equals("87")){ - rt = this.cd87() ; - }else if(com.equals("92")){ - rt = this.cd92() ; - }else if(com.equals("93")){ - rt = this.cd93() ; - }else if(com.equals("9C")){ - rt = this.cd9C() ; - }else if(com.equals("A2")){ - rt = this.cdA2() ; - }else if(com.equals("A3")){ - rt = this.cdA3() ; - }else{ - rt = this.cdXY(com) ;//鍙戦�佸浐瀹氬弬鏁癤Y鐨勫懡浠�, 渚嬪懡浠odeV202404.cd_9C + this.rtuAddr = rtuAddr ; + if(com == null || com.trim().equals("")){ + rt = this.connect() ;//杩炴帴閫氫俊涓棿浠舵祴璇� + }else{ + try{ + if(com.equals("10")){ + rt = this.cd10() ; + }else if(com.equals("15")){ + rt = this.cd15() ; + }else if(com.equals("16")){ + rt = this.cd16() ; + }else if(com.equals("21")){ + rt = this.cd21() ; + }else if(com.equals("22")){ + rt = this.cd22() ; + }else if(com.equals("23")){ + rt = this.cd23() ; + }else if(com.equals("24")){ + rt = this.cd24() ; + }else if(com.equals("26")){ + rt = this.cd26() ; + }else if(com.equals("31")){ + rt = this.cd31() ; + }else if(com.equals("55")){ + rt = this.cd55(1) ; + }else if(com.equals("65")){ + rt = this.cd65(1) ; + }else if(com.equals("86")){ + rt = this.cd86() ; + }else if(com.equals("87")){ + rt = this.cd87() ; + }else if(com.equals("92")){ + rt = this.cd92() ; + }else if(com.equals("93")){ + rt = this.cd93() ; + }else if(com.equals("9C")){ + rt = this.cd9C() ; + }else if(com.equals("A2")){ + rt = this.cdA2() ; + }else if(com.equals("A3")){ + rt = this.cdA3() ; + }else{ + rt = this.cdXY(com) ;//鍙戦�佸浐瀹氬弬鏁癤Y鐨勫懡浠�, 渚嬪懡浠odeV202404.cd_9C + } + }catch (Exception e){ + e.printStackTrace(); } - }catch (Exception e){ - e.printStackTrace(); } } return rt ; diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/resources/log4j2.yml b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/resources/log4j2.yml new file mode 100644 index 0000000..d17e36c --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/resources/log4j2.yml @@ -0,0 +1,73 @@ +Configuration: + #status锛岃繖涓敤浜庤缃甽og4j2鑷韩鍐呴儴鐨勪俊鎭緭鍑猴紝鍙互涓嶈缃紝褰撹缃垚trace鏃讹紝浣犱細鐪嬪埌log4j2鍐呴儴鍚勭璇︾粏杈撳嚭锛涘彲浠ヨ缃垚Off(鍏抽棴)鎴朎rror(鍙緭鍑洪敊璇俊鎭�) + status: Error + + Properties: # 瀹氫箟鍏ㄥ眬鍙橀噺 + Property: + #鏃ュ織鏂囦欢瀛樺偍鐨勭洰褰� + - name: log.path + value: ./logs + #鏃ュ織鏂囦欢瀛樺偍鍚嶇О + - name: project.name + value: mwTestWeb + + #瀹氫箟杈撳嚭鍣紝鍙互杈撳嚭鍒版帶鍒跺彴鍜屾枃浠�. + Appenders: + #杈撳嚭鍒版帶鍒跺彴 + Console: + #Appender鍛藉悕 + name: CONSOLE + target: SYSTEM_OUT + ThresholdFilter: + level: debug #杈撳嚭鏃ュ織绾у埆锛岃緭鍑烘棩蹇楁椂锛岄鍏堢敱Loggers.Root.level鎴朙oggers.Logger.level鍒ゆ柇鏄惁杈撳嚭锛岀劧鍚庡啀鐢辨湰level鍒ゆ柇鏄惁杈撳嚭 + onMatch: ACCEPT #onMatch=ACCEPT 澶т簬绛変簬 "level" 閰嶇疆鐨勭瓑绾у湴鏃ュ織杈撳嚭 + onMismatch: DENY #onMismatch=DENY 灏忎簬 "level" 閰嶇疆鐨勭瓑绾у湴鏃ュ織涓嶈緭鍑� + #鏃ュ織鍐呭鏍峰紡 + PatternLayout: + #%n-鎹㈣ + #%m-鏃ュ織鍐呭锛岃緭鍑轰唬鐮佷腑鎸囧畾鐨勬棩蹇椾俊鎭� + #%p-杈撳嚭浼樺厛绾э紝鍗矰EBUG,INFO,WARN,ERROR,FATAL + #%r-绋嬪簭鍚姩鍒扮幇鍦ㄧ殑姣鏁� + #%%- 杈撳嚭涓�涓�"%" 瀛楃 + #%t-褰撳墠绾跨▼鍚� + #%d-鏃ユ湡鍜屾椂闂�, 甯哥敤鐨勬牸寮忔湁%d{DATE},%d{ABSOLUTE},%d{HH:mm:ss,SSS},%d{ddMMyyyyHH:mm:ss,SSS} + #%l-鍚�%F%L%C%M + #%F-java婧愭枃浠跺悕 + #%L-java婧愮爜琛屾暟 + #%C-java绫诲悕,%C{1}杈撳嚭鏈�鍚庝竴涓厓绱� + #%M-java鏂规硶鍚� + pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%C.%M:%L) - %m%n" + # 杈撳嚭鍒版枃浠讹紝瓒呰繃10MB褰掓。 + RollingFile: + - name: ROLLING_FILE + ignoreExceptions: false + fileName: ${log.path}/${project.name}.log + filePattern: "${log.path}/$${date:yyyy-MM}/${project.name}-%d{yyyy-MM-dd}-%i.log.gz" + ThresholdFilter: + level: error #杈撳嚭鏃ュ織绾у埆锛岃緭鍑烘棩蹇楁椂锛岄鍏堢敱Loggers.Root.level鎴朙oggers.Logger.level鍒ゆ柇鏄惁杈撳嚭锛岀劧鍚庡啀鐢辨湰level鍒ゆ柇鏄惁杈撳嚭 + onMatch: ACCEPT #onMatch=ACCEPT 澶т簬绛変簬 "level" 閰嶇疆鐨勭瓑绾у湴鏃ュ織杈撳嚭 + onMismatch: DENY #onMismatch=DENY 灏忎簬 "level" 閰嶇疆鐨勭瓑绾у湴鏃ュ織涓嶈緭鍑� + #鏃ュ織鍐呭鏍峰紡 + PatternLayout: + pattern: "%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%C.%M:%L) - %m%n" + Policies: + SizeBasedTriggeringPolicy: + size: "10 MB" + DefaultRolloverStrategy: + max: 1000 + + Loggers: + Root: + level: info #鏃ュ織杈撳嚭绾у埆锛屽叡鏈�8涓骇鍒紝鎸夌収浠庝綆鍒伴珮涓猴細all < trace < debug < info < warn < error < fatal < off + AppenderRef: #Root鐨勫瓙鑺傜偣锛岀敤鏉ユ寚瀹氳鏃ュ織杈撳嚭鍒板摢涓狝ppender. + - ref: CONSOLE #杈撳嚭鏃ュ織鏃讹紝棣栧厛鐢辨湰level鍒ゆ柇鏄惁杈撳嚭锛岀劧鍚庡啀鐢变笂闈㈢殑Appenders.Console.ThresholdFilter.level鍒ゆ柇鏄惁杈撳嚭 + - ref: ROLLING_FILE #杈撳嚭鏃ュ織鏃讹紝棣栧厛鐢辨湰level鍒ゆ柇鏄惁杈撳嚭锛岀劧鍚庡啀鐢变笂闈㈢殑Appenders.RollingFile.ThresholdFilter.level鍒ゆ柇鏄惁杈撳嚭 + # 涓哄寘閰嶇疆鐗规畩鐨凩og绾у埆锛屾柟渚胯皟璇曪紝 + # 涓嶅彈Loggers.Root.level闄愬埗 + Logger: + - name: com.dy.pipIrrGlobal.daoBa + additivity: false #鍘婚櫎閲嶅鐨刲og + level: debug #杈撳嚭鏃ュ織绾у埆 + AppenderRef: + - ref: CONSOLE #杈撳嚭鏃ュ織鏃讹紝棣栧厛鐢辨湰.level鍒ゆ柇鏄惁杈撳嚭锛岀劧鍚庡啀鐢变笂闈㈢殑Appenders.Console.ThresholdFilter.level鍒ゆ柇鏄惁杈撳嚭 + - ref: ROLLING_FILE #杈撳嚭鏃ュ織鏃讹紝棣栧厛鐢辨湰level鍒ゆ柇鏄惁杈撳嚭锛岀劧鍚庡啀鐢变笂闈㈢殑Appenders.RollingFile.ThresholdFilter.level鍒ゆ柇鏄惁杈撳嚭 -- Gitblit v1.8.0