From d6670149331bbdeda4b0573927c13d36225a09c1 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期一, 04 十二月 2023 15:52:08 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pom.xml | 2 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java | 6 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java | 27 pipIrr-platform/pipIrr-web/pipIrr-web-gis/src/main/resources/application.yml | 2 pipIrr-platform/pipIrr-web/pipIrr-web-gis/pom.xml | 118 -- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java | 4 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuUpTask.java | 6 pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml | 9 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockSv.java | 1 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/AsciiPic.java | 2 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java | 46 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml | 2 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDivide.java | 9 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/PipIrrMwAcceptApplication.java | 1 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/MidResultActionToRtu.java | 2 pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/resources/application.yml | 2 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnitConfigVo.java | 6 pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/resources/application.yml | 2 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultFromRtu.java | 5 pipIrr-platform/pipIrr-web/pipIrr-web-remote/pom.xml | 119 -- pipIrr-platform/pipIrr-web/pipIrr-web-statistics/pom.xml | 119 -- pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java | 103 + pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml | 2 pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/resources/application.yml | 2 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoSessionAttrIdIsRtuAddr.java | 2 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/ServerProperties.java | 8 pipIrr-platform/pipIrr-web/pipIrr-web-sso/pom.xml | 120 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/DriverParserDataCallback.java | 16 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRTU.java | 109 ++ pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java | 15 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultError.java | 6 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLine.java | 6 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/resources/config.xml | 37 pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/resources/application.yml | 2 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaClient.java | 2 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/ToRtuConstantTask.java | 46 pipIrr-platform/文档/在线需求文件访问地址.txt | 3 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Data.java | 11 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java | 14 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java | 47 + pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreThread.java | 6 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuDownTask.java | 11 pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml | 15 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java | 2 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java | 22 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/TreadPoolFactory.java | 17 pipIrr-platform/文档/增加一个应用机构.docx | 0 pipIrr-platform/pipIrr-web/pipIrr-web-demo/pom.xml | 118 -- pipIrr-platform/pipIrr-global/pom.xml | 132 +- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Driver.java | 14 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDistrict.java | 4 pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandObj.java | 4 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultToRtu.java | 5 pipIrr-platform/pipIrr-web/pom.xml | 52 + /dev/null | 0 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java | 244 ++++- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java | 444 +++++----- pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictVo.java | 4 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLineHandle.java | 6 pipIrr-platform/pipIrr-web/pipIrr-web-base/pom.xml | 120 --- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaIntake.java | 122 +++ pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java | 6 pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java | 5 63 files changed, 1,042 insertions(+), 1,352 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java index 753420c..e57c5dc 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/fastjson/FastJsonConfig.java @@ -20,7 +20,7 @@ /** * 閰嶇疆fastjson杈撳嚭鏍煎紡 **/ - @SuppressWarnings("unused") + @Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { // 1. 閰嶇疆fastjson com.alibaba.fastjson2.support.config.FastJsonConfig config = new com.alibaba.fastjson2.support.config.FastJsonConfig(); diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoSessionAttrIdIsRtuAddr.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoSessionAttrIdIsRtuAddr.java index 0d3eb64..3bd48c5 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoSessionAttrIdIsRtuAddr.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/channel/tcp/TcpIoSessionAttrIdIsRtuAddr.java @@ -7,5 +7,5 @@ */ public class TcpIoSessionAttrIdIsRtuAddr { - public static final String sessionArrIdKey = "key_rtuAddr" ; //杩欎釜key瀛樺偍鐨勬槸Rtu鍦板潃 + public static final String sessionArrIdKey = "key_rtuAddr" ; //杩欎釜key瀛樺偍鐨勬槸IMEI鍙� } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreThread.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreThread.java index 124c735..46341fe 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreThread.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/core/CoreThread.java @@ -10,7 +10,7 @@ private static CoreThread instance = new CoreThread() ; - private static Long sleepBigBusy = 100L ;//澶у繖鏃讹紙闄や簡鎭掍箙浠诲姟锛岃繕鏈夊叾浠栦换鍔★級锛屾牳蹇冪嚎绋嬫殏鍋滈棿闅� + private static Long sleepBigBusy = 100L ;//澶у繖鏃讹紙闄や簡鎭掍箙浠诲姟锛岃繕鏄叾浠栦换鍔★級锛屾牳蹇冪嚎绋嬫殏鍋滈棿闅� private static Long sleepSmallBusy = 500L ;//灏忓繖鏃讹紙鍙湁鎭掍箙浠诲姟锛屾棤鍏朵粬浠诲姟锛夛紝鏍稿績绾跨▼鏆傚仠闂撮殧 private CoreThread(){ @@ -22,8 +22,8 @@ /** * 璁剧疆鏆傚仠鏃堕暱 - * @param sleepBigBusy 澶у繖鏃讹紙闄や簡鎭掍箙浠诲姟锛岃繕鏈夊叾浠栦换鍔★級锛屾牳蹇冪嚎绋嬫殏鍋滈棿闅� - * @param sleepSmallBusy 灏忓繖鏃讹紙鍙湁鎭掍箙浠诲姟锛屾棤鍏朵粬浠诲姟锛夛紝鏍稿績绾跨▼鏆傚仠闂撮殧 + * @param sleepWorking + * @param sleepIdel */ public void setSleep(Long sleepBigBusy, Long sleepSmallBusy){ CoreThread.sleepBigBusy = sleepBigBusy ; diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java index 2b3aa3a..f4ec4cb 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/AnnotationScan.java @@ -65,9 +65,9 @@ int onLineDataMinLength; int headMinLength ; - HashMap<String, AnnotationDriverVo> driverMap = ProtocolCache.getDriverMap() ; - HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCache.getPrefixedDataAvailableMap() ; - HashMap<String, AnnotationOnLineVo> onLineMap = ProtocolCache.getOnLineMap() ; + HashMap<String, AnnotationDriverVo> driverMap = ProtocolCach.getDriverMap() ; + HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCach.getPrefixedDataAvailableMap() ; + HashMap<String, AnnotationOnLineVo> onLineMap = ProtocolCach.getOnLineMap() ; for(String cName : classNames){ String className = cName.substring(0, cName.lastIndexOf('.')) ; diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java index 2449b3b..39bd450 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Command.java @@ -32,7 +32,25 @@ * RTU 鍦板潃 */ public String rtuAddr ; - + + /** + * 姘磋〃鍙� + * 搴旂敤鐢典俊骞冲彴鏃舵湁鏁� + */ + public String meterNo ; + + /** + * 鐢典俊骞冲彴涓婄殑浜у搧ID锛屽綋涓嶅湪鐢典俊骞冲彴涓婅繍琛屾椂锛屼负null + * 搴旂敤鐢典俊骞冲彴鏃舵湁鏁� + */ + public Integer productId ; + + /** + * 鐢典俊骞冲彴涓婄殑璁惧ID锛屽綋涓嶅湪鐢典俊骞冲彴涓婅繍琛屾椂锛屼负null + * 搴旂敤鐢典俊骞冲彴鏃舵湁鏁� + */ + public String deviceId ; + /** * 鍛戒护绫诲瀷:Rtu鍛戒护銆侀拡瀵圭洃鎺т腑闂翠欢鐨勫懡浠� * 鐢眂om.dy.common.mw.protocol.CommandType绫诲畾涔� @@ -62,7 +80,14 @@ public String toString(){ String s = "鍛戒护id=" + id + "\n" ; s += (protocol == null ? "" : ("鍗忚=" + protocol + "\n")); - s += (rtuAddr == null ? "" : ("Rtu鍦板潃=" + rtuAddr + "\n")); + s += (rtuAddr == null ? "" : ("IMEI鍙�=" + rtuAddr + "\n")); + s += (meterNo == null ? "" : ("姘磋〃鍙�=" + meterNo + "\n")); + if(productId != null){ + s += "鐢典俊骞冲彴浜у搧ID=" + productId + "\n" ; + } + if(deviceId != null && !deviceId.trim().equals("")){ + s += "鐢典俊骞冲彴璁惧ID=" + deviceId + "\n" ; + } s += "鍛戒护绫诲瀷=" + (type.equals(CommandType.innerCommand)?"鍐呴儴鍛戒护":"缁堢鍛戒护") + "\n" ; s += (code == null ? "" : ("鍔熻兘鐮�=" + code + "\n")) ; s += "杩斿洖涓棿浠跺鍛戒护澶勭悊缁撴灉=" + (noRtMwDealRes == null?"杩斿洖":(noRtMwDealRes?"涓嶈繑鍥�":"杩斿洖") + "\n") ; @@ -174,6 +199,24 @@ public void setProtocol(String protocol) { this.protocol = protocol; } + public String getMeterNo() { + return meterNo; + } + public void setMeterNo(String meterNo) { + this.meterNo = meterNo; + } + public Integer getProductId() { + return productId; + } + public void setProductId(Integer productId) { + this.productId = productId; + } + public String getDeviceId() { + return deviceId; + } + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } public String getType() { return type; } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Data.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Data.java index 3402f09..3df78c2 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Data.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Data.java @@ -6,6 +6,7 @@ /** * 鏁版嵁鏍� + * @author Administrator * */ public class Data implements java.io.Serializable{ @@ -14,6 +15,7 @@ private String commandId ;//鍛戒护ID锛屽彲鑳戒负null private String rtuAddr ;//缁堢鍦板潃 + private String meterNo ;//姘磋〃鍙� private String protocol ;//鏁版嵁鎵�瀵瑰簲鐨勫崗璁悕绉� private String code ;//鏁版嵁鎵�瀵瑰簲鐨勫姛鑳界爜: private Object subData ;//瀵瑰簲鍚勪釜鍔熻兘鐮佺殑鍏蜂綋鏁版嵁 @@ -22,7 +24,8 @@ public String toString() { StringBuilder sb = new StringBuilder() ; sb.append("涓婅鎶ユ枃(鍗佸叚杩涘埗): ").append((hex == null?"":hex)).append("\n") ; // - sb.append("Rtu鍦板潃 : ").append((rtuAddr==null?"":rtuAddr)).append("\n") ; + sb.append("IMEI鍙� : ").append((rtuAddr==null?"":rtuAddr)).append("\n") ; + sb.append("姘磋〃鍙� : ").append((meterNo==null?"":meterNo)).append("\n") ; if(commandId != null){ sb.append("鍛戒护ID : ").append(commandId).append("\n") ; //鍛戒护ID } @@ -83,6 +86,12 @@ this.rtuAddr = rtuAddr; } + public String getMeterNo() { + return meterNo; + } + public void setMeterNo(String meterNo) { + this.meterNo = meterNo; + } public String getCode() { return code; } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Driver.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Driver.java index 9f29d8c..4b607f3 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Driver.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/Driver.java @@ -142,7 +142,7 @@ return codeParse ; } /** - * 瑙f瀽鐢典俊骞冲彴涓婅鏁版嵁 + * 瑙f瀽涓婅鏁版嵁 * @param isLowPower 鏄惁鍦ㄤ綆鍔熻�楃幆澧冧笅杩愯 * @param rtuAddr 鎺у埗鍣ㄥ湴鍧� * @param upBuffer 瀛楄妭鏁扮粍 @@ -151,6 +151,18 @@ * @return MidResult[] */ public abstract MidResult[] parseData(Boolean isLowPower, String rtuAddr, byte[] upBuffer, String upHex, DriverParserDataCallback callback, Object... params) ; + /** + * 瑙f瀽鐢典俊骞冲彴涓婅鏁版嵁 + * @param isLowPower 鏄惁鍦ㄤ綆鍔熻�楃幆澧冧笅杩愯 + * @param rtuAddr 鎺у埗鍣ㄥ湴鍧� + * @param productId 鐢典俊骞冲彴浜у搧ID锛屽綋涓嶅湪鐢典俊骞冲彴涓繍琛屾椂锛屼负null + * @param deviceId 鐢典俊骞冲彴璁惧ID锛屽綋涓嶅湪鐢典俊骞冲彴涓繍琛屾椂锛屼负null + * @param upBuffer 瀛楄妭鏁扮粍 + * @param upHex 瀛楄妭鏁扮粍16杩涘埗褰㈠紡 + * @param callback 鍥炶皟 + * @return MidResult[] + */ + public abstract MidResult[] parseData(Boolean isLowPower, String rtuAddr, Integer productId, String deviceId, byte[] upBuffer, String upHex, DriverParserDataCallback callback, Object... params) ; /** * 鏋勯�犱笅琛屾暟鎹紙鍛戒护锛� diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/DriverParserDataCallback.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/DriverParserDataCallback.java index 30f219a..5ca3e20 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/DriverParserDataCallback.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/DriverParserDataCallback.java @@ -4,19 +4,23 @@ /** * 瑙f瀽涓婅鏁版嵁鍚庡洖璋� - * @param rtuAddr 涓婅鏁版嵁鍗忚澶翠腑RtuAddr + * @param rtuAddr 涓婅鏁版嵁鍗忚澶翠腑鐨処MEI鍙� + * @param meterNo 涓婅鏁版嵁鍗忚澶翠腑鐨勬按琛ㄥ彿 * @param code 涓婅鏁版嵁 鍔熻兘鐮� * @param upHex 涓婅鏁版嵁 * @param reportOrResponse_trueOrFalse 涓婅鏁版嵁鏄富鍔ㄤ笂鎶ヨ繕鏄懡浠ょ粨鏋� * @param parseFail 涓婅鏁版嵁瑙f瀽鏄惁澶辫触 - * @param rtuAddrInData 涓婅鏁版嵁涓湪鍗忚鏁版嵁涓殑Rtu鍦板潃锛� - * 鈥滀慨鏀筊TU缁堢绠$悊閰嶇疆鍙傛暟鈥濆懡浠ょ殑杩斿洖鏁版嵁锛屽叾鍗忚澶翠腑鐨凴tu鍦板潃涓庢暟鎹腑鐨凴tu鍦板潃涓嶄竴鏍凤紝 - * 濡傛灉RTU涓嶈兘鍏抽棴缃戠粶锛岄偅涔坰essionCach涓殑Rtu鍦板潃鎬绘槸鐢ㄤ慨鏀瑰墠鐨凴tu鍦板潃锛屼娇寰椾互鍚庝笂琛屾暟鎹殑涓嶈兘鎵惧埌缂撳瓨涓殑Session + * @param rtuAddrInData 涓婅鏁版嵁涓湪鍗忚鏁版嵁涓殑IMEI鍙凤紝 + * @param meterNoInData 涓婅鏁版嵁涓湪鍗忚鏁版嵁涓殑姘磋〃鍙凤紝 + * 鈥滀慨鏀筊TU缁堢绠$悊閰嶇疆鍙傛暟鈥濆懡浠ょ殑杩斿洖鏁版嵁锛屽叾鍗忚澶翠腑鐨処MEI鍙蜂笌鏁版嵁涓殑IMEI鍙蜂笉涓�鏍凤紝 + * 濡傛灉RTU涓嶈兘鍏抽棴缃戠粶锛岄偅涔坰essionCach涓殑IMEI鍙锋�绘槸鐢ㄤ慨鏀瑰墠鐨処MEI鍙凤紝浣垮緱浠ュ悗涓婅鏁版嵁鐨勪笉鑳芥壘鍒扮紦瀛樹腑鐨凷ession */ void callback(String rtuAddr, - String code, + String meterNo, + String code, String upHex, Boolean reportOrResponse_trueOrFalse, boolean parseFail, - String rtuAddrInData) ; + String rtuAddrInData, + String meterNoInData) ; } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultError.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultError.java index bdbb7a0..0a71d84 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultError.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultError.java @@ -11,13 +11,15 @@ } public String protocolName ;//鍗忚鍚嶇О - public String rtuAddr ;//Rtu鍦板潃锛屾敞鎰弐tuAddr鍙兘涓簄ull + public String rtuAddr ;//IMEI鍙凤紝娉ㄦ剰rtuAddr鍙兘涓簄ull + public String meterNo ;//姘磋〃鍙凤紝娉ㄦ剰meterNo鍙兘涓簄ull public String message ;//鍑洪敊娑堟伅 public Exception e ;//寮傚父 - public MidResultError(String protocolName, String rtuAddr, String message, Exception e){ + public MidResultError(String protocolName, String rtuAddr, String meterNo, String message, Exception e){ this.protocolName = protocolName ; this.rtuAddr = rtuAddr ; + this.meterNo = meterNo ; this.message = message ; this.e = e ; } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultFromRtu.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultFromRtu.java index 4813115..50562ef 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultFromRtu.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultFromRtu.java @@ -13,7 +13,10 @@ public String commandId ;//鍙戦�佸懡浠ょ殑ID锛屽鏋滄槸鍛戒护缁撴灉锛屽苟涓斿尮閰嶄簡涓嬪彂鍛戒护锛屾鍊间笉涓虹┖ public String protocolName ;//鍗忚鍚嶇О - public String rtuAddr ;//Rtu鍦板潃 + public String rtuAddr ;//IMEI鍙� + public String meterNo ;//姘磋〃鍙� + public Integer productId ;//鐢典俊骞冲彴浜у搧ID锛屽綋涓嶅湪鐢典俊骞冲彴杩愯鏃讹紝涓簄ull + public String deviceId ;//鐢典俊骞冲彴璁惧ID锛屽綋涓嶅湪鐢典俊骞冲彴杩愯鏃讹紝涓簄ull public String upCode ;//涓婅鏁版嵁涓殑鍔熻兘鐮� public String upHex ;//涓婅鏁版嵁鍗佸叚杩涘埗褰㈠紡 public byte[] upBuffer ;//涓婅鏁版嵁瀛楄妭鏁扮粍 diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultToRtu.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultToRtu.java index 087aa53..4c58abe 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultToRtu.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/MidResultToRtu.java @@ -11,7 +11,10 @@ } public String protocolName ;//鍗忚鍚嶇О - public String rtuAddr ;//Rtu鍦板潃 + public String rtuAddr ;//IMEI鍙�(鐢典俊骞冲彴IMEI) + public String meterNo ;//姘磋〃鍙� + public Integer productId ;//鐢典俊骞冲彴浜у搧ID + public String deviceId ;//鐢典俊骞冲彴璁惧ID public String commandId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉 public String downCode ;//涓嬭鍛戒护鍔熻兘鐮�; public byte[] downBuffer ;//涓嬭鍛戒护鏁版嵁 diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLine.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLine.java index 746e926..f8b693b 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLine.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLine.java @@ -16,17 +16,19 @@ class OnLineResult{ public int result ;//鍒嗘瀽缁撴灉 public String protocolName ;//鍗忚鍚嶇О - public String rtuAddr ;//Rtu鍦板潃 + public String rtuAddr ;//IMEI鍙� + public String meterNo ;//姘磋〃鍙� public byte[] remoteData;//闇�瑕佸悜Rtu鍥炲啓鐨勬暟鎹� public OnLineResult(){ result = OnLineAction_fail ; rtuAddr = null ; + meterNo = null ; remoteData = null ; } } int OnLineAction_fail = 0; //鍒嗘瀽涓婄嚎鏁版嵁澶辫触锛屽鎻愪緵鐨勬暟鎹负null绛夊師鍥� - int OnLineAction_success = 1; //鍒嗘瀽涓婄嚎鏁版嵁鎴愬姛锛屽苟鑳藉緱鍒癛tu鍦板潃 + int OnLineAction_success = 1; //鍒嗘瀽涓婄嚎鏁版嵁鎴愬姛锛屽苟鑳藉緱鍒癐MEI鍙� int OnLineAction_success_noMe = 2; //鍒嗘瀽涓婄嚎鏁版嵁鎴愬姛锛岃瘑鍒嚭涓嶆槸鏈崗璁暟鎹� int OnLineAction_success_response = 3; //鍒嗘瀽涓婄嚎鏁版嵁鎴愬姛锛屽苟闇�瑕佸悜Rtu鍥炲啓鏁版嵁 diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLineHandle.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLineHandle.java index a3c306b..825588f 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLineHandle.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/OnLineHandle.java @@ -6,13 +6,13 @@ public class OnLineHandle { /** - * 瑙f瀽涓婄嚎鏁版嵁锛屽緱鍒癛tuAddr + * 瑙f瀽涓婄嚎鏁版嵁锛屽緱鍒癐MEI鍙� * @param bs 瀛楄妭鏁扮粍 * @return OnLine.OnLineResult */ public OnLine.OnLineResult parse(byte[] bs)throws Exception{ OnLine.OnLineResult rs = null ; - HashMap<String, AnnotationOnLineVo> onLineMap = ProtocolCache.getOnLineMap() ; + HashMap<String, AnnotationOnLineVo> onLineMap = ProtocolCach.getOnLineMap() ; Collection<AnnotationOnLineVo> set = onLineMap.values() ; if(set.size() == 0){ throw new Exception("澶勭悊涓婄嚎鏃讹紝寰楀埌鐨勫崗璁泦鍚堜负绌恒��") ; @@ -47,7 +47,7 @@ } } if(rs == null){ - throw new Exception("澶勭悊涓婄嚎鏃跺嚭閿欙紝鏈兘鎴愬姛鍒嗘瀽鍑篟tu鍦板潃锛�") ; + throw new Exception("澶勭悊涓婄嚎鏃跺嚭閿欙紝鏈兘鎴愬姛鍒嗘瀽鍑篒MEI鍙凤紒") ; } return rs ; } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java index 30864ee..56d32fc 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/PrefixedDataAvailableHandleImp.java @@ -30,18 +30,18 @@ try{ PrefixedDataAvailableStatus pds = null ; - HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCache.getPrefixedDataAvailableMap() ; + HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCach.getPrefixedDataAvailableMap() ; Collection<AnnotationPrefixedDataAvailableVo> set = prefixedDataAvailableMap.values() ; if(set.size() == 0){ throw new Exception("涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ユ椂锛屽緱鍒扮殑鍗忚瀹屾暣鎬ф鏌ョ被闆嗗悎涓虹┖銆�") ; } - int priority = ProtocolConstant.firstPriority ; + int prority = ProtocolConstant.firstPriority ; while(true){ - Object[] objs = this.getClassObjAndAnnotationVo(priority, set) ; + Object[] objs = this.getClassObjAndAnnotationVo(prority, set) ; PrefixedDataAvailable pda = (PrefixedDataAvailable)objs[0] ; - if(pda == null && priority == ProtocolConstant.firstPriority){ - throw new Exception("涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ユ椂锛屾湭寰楀埌浼樺厛绾т负" + priority + "涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ョ被锛�") ; + if(pda == null && prority == ProtocolConstant.firstPriority){ + throw new Exception("涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ユ椂锛屾湭寰楀埌浼樺厛绾т负" + prority + "涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ョ被锛�") ; }else if(pda == null){ //璇存槑涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ョ被闆嗗悎宸茬粡閬嶅巻瀹屼簡銆� break ; @@ -53,7 +53,7 @@ if(pds == null){ //璇存槑涓嶆槸瀵瑰簲鐨勫崗璁暟鎹紝闇�瑕佸彟澶栫殑鍗忚鏉ュ鐞嗕笂绾� //寰幆缁х画 - priority++ ; + prority++ ; }else{ //鍋滄寰幆锛岃繑鍥炵粨鏋� break ; @@ -90,7 +90,7 @@ try{ PrefixedDataAvailableStatus pds = null ; - HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCache.getPrefixedDataAvailableMap() ; + HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCach.getPrefixedDataAvailableMap() ; Collection<AnnotationPrefixedDataAvailableVo> set = prefixedDataAvailableMap.values() ; if(set.size() == 0){ throw new Exception("涓婄嚎鏁版嵁瀹屾暣鎬ф鏌ユ椂锛屽緱鍒扮殑鍗忚闆嗗悎涓虹┖銆�") ; diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolCache.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolCache.java deleted file mode 100644 index a8815d9..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolCache.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.dy.common.mw.protocol; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class ProtocolCache { - - //鏈郴缁熶腑锛孌river鍦ㄥ崟绾跨▼涓繍琛岋紝鎵�浠ュ彧鐢ㄤ竴涓疄渚� - private static final HashMap<String, Driver> drivers = new HashMap<>() ; - //娉ㄨВ涓庡鐞嗙被鐨勬槧灏� - private static final HashMap<String, AnnotationDriverVo> driverMap = new HashMap<>() ; - private static final HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = new HashMap<>() ; - private static final HashMap<String, AnnotationOnLineVo> onLineMap = new HashMap<>() ; - - - /** - * 鍦ㄥ崟绾跨▼鐜涓繍琛� - * 閫氳繃鍗忚椹卞姩鐨勭被鍚嶏紝寰楀埌绫诲崟渚� - * @param protocolName 鍗忚鍚嶇О - * @return 椹卞姩 - * @throws Exception 寮傚父 - */ - public static Driver getDriver(String protocolName) throws Exception{ - Driver dri = drivers.get(protocolName); - if(dri == null){ - AnnotationDriverVo vo = driverMap.get(protocolName) ; - if(vo != null && vo.clazz != null){ - dri = (Driver)vo.clazz.getDeclaredConstructor().newInstance(); - //dri = (Driver)vo.clazz.newInstance() ; - drivers.put(protocolName, dri) ; - } - } - return dri ; - } - - /** - * 寰楀埌椹卞姩鐨勬暟閲忥紝鍗充腑闂翠欢鏀寔鐨勫崗璁暟閲� - * @return 椹卞姩鎬绘暟 - */ - public static int driverCount(){ - if(drivers.size() == 0){ - return 0 ; - }else{ - return drivers.size() ; - } - } - - /** - * 寰楀埌绗竴涓┍鍔� - * @return 椹卞姩 - */ - public static Driver getFirstDriver(){ - Driver dri = null ; - if(drivers.size() > 0){ - Map.Entry<String, Driver> ent = drivers.entrySet().iterator().next() ; - dri = ent.getValue(); - } - return dri ; - } - - /** - * 寰楀埌鎵�鏈夊崗璁悕绉� - * @return 鍗忚鍚嶇О闆嗗悎 - */ - @SuppressWarnings("unused") - public static List<String> getProtocolList() { - return new ArrayList<>(driverMap.keySet()) ; - } - - protected static HashMap<String, AnnotationDriverVo> getDriverMap() { - return driverMap; - } - protected static HashMap<String, AnnotationPrefixedDataAvailableVo> getPrefixedDataAvailableMap() { - return prefixedDataAvailableMap; - } - protected static HashMap<String, AnnotationOnLineVo> getOnLineMap() { - return onLineMap; - } - - /* - public static void main(String[] args){ - HashMap<String, Integer> mp = new HashMap<>() ; - mp.put("a1", 1) ; - mp.put("a2", 2) ; - List<String> list = new ArrayList<>(mp.keySet()) ; - System.out.println(list); - } - */ -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java index 0e280fb..71dea2a 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/ProtocolUnit.java @@ -44,7 +44,7 @@ AnnotationScan.getIntance() ; //鍚勪釜鍗忚椹卞姩绫绘壂鎻忚嚜宸辩殑鍔熻兘鐮佹敞瑙� - HashMap<String, AnnotationDriverVo> drivers = ProtocolCache.getDriverMap() ; + HashMap<String, AnnotationDriverVo> drivers = ProtocolCach.getDriverMap() ; Collection<String> colDrivers = drivers.keySet() ; StringBuilder totalProtocols = new StringBuilder() ; for(String protocolName : colDrivers){ @@ -52,7 +52,7 @@ totalProtocols.append("锛�") ; } totalProtocols.append(protocolName) ; - Driver dri = ProtocolCache.getDriver(protocolName) ; + Driver dri = ProtocolCach.getDriver(protocolName) ; if(dri != null){ dri.scanAnnotationCode(); } @@ -70,7 +70,7 @@ */ @SuppressWarnings("unused") public boolean isOnlyOneProtocol(){ - HashMap<String, AnnotationDriverVo> drivers = ProtocolCache.getDriverMap() ; + HashMap<String, AnnotationDriverVo> drivers = ProtocolCach.getDriverMap() ; return drivers.size() == 1 ; } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CodeV1_0_1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CodeV1_0_1.java deleted file mode 100644 index faa8770..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/CodeV1_0_1.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -public class CodeV1_0_1 { - //鍔熻兘鐮佷负瀛楃涓诧紝鍗佸叚杩涘埗鏁版嵁 - public static final String cd_02 = "02" ;//閬ユ祴绔欓摼璺娴� - public static final String cd_C0 = "C0" ;//閬ユ祴绔欒嚜鎶ュ疄鏃舵暟鎹� - public static final String cd_83 = "83" ;//閬ユ祴绔欏紑鍏抽榾鑷姤 - public static final String cd_84 = "84" ;//寮�闃�宸ヤ綔鎶� - public static final String cd_71 = "71" ;//鏌ヨ闃�闂ㄧ姸鎬� - - public static String getCodeName(String code) { - String name = (code.equals(cd_02) ? "閾捐矾妫�娴�" : - (code.equals(cd_C0) ? "鑷姤瀹炴椂鏁版嵁" : - (code.equals(cd_83) ? "寮�鍏抽榾鑷姤" : - (code.equals(cd_84) ? "寮�闃�宸ヤ綔鎶�" : - (code.equals(cd_71) ? "鏌ヨ闃�闂ㄧ姸鎬�" : - ""))))) ; - return name ; - } - - /** - * 鏄惁涓烘湁鏁堝姛鑳界爜 - * @param code 鍔熻兘鐮� - * @return 鏈夋晥true锛屾棤鏁坒alse - */ - public static boolean isValid(String code){ - String name = getCodeName(code) ; - if(name != null && !name.equals("")){ - return true ; - } - return false ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataAlarmVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataAlarmVo.java deleted file mode 100644 index 3accdc0..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataAlarmVo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -import lombok.Data; - -@Data -public class DataAlarmVo { - public Byte batteryVolt ;// 钃勭數姹犵數鍘� - public Byte loss ;//婕忔崯 - public Byte meter ;//浠〃 - public Byte valve ;//闃�闂� - - public String toString(){ - StringBuilder str = new StringBuilder() ; - str.append(" 鎶ヨ:\n"); - str.append(" 钃勭數姹犵數鍘嬶細"); - str.append(batteryVolt==null?"":(batteryVolt==1?"鎶ヨ":"姝e父")); - str.append("\n"); - str.append(" 婕忔崯锛�"); - str.append(loss==null?"":(loss==1?"鎶ヨ":"姝e父")); - str.append("\n"); - str.append(" 浠〃锛�"); - str.append(meter==null?"":(meter==1?"鎶ヨ":"姝e父")); - str.append("\n"); - str.append(" 闃�闂細"); - str.append(valve==null?"":(valve==1?"鎶ヨ":"姝e父")); - return str.toString() ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd02Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd02Vo.java deleted file mode 100644 index edd5ccd..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd02Vo.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -import lombok.Data; - -//閾捐矾妫�娴� -@Data -public class DataCd02Vo { - - public String status ;//F0 鐧诲綍锛孎1 閫�鍑虹櫥褰曪紝F2 鍦ㄧ嚎淇濇寔 - - public String toString(){ - StringBuffer sb = new StringBuffer() ; - sb.append(" 閾捐矾妫�娴� : \n") ; - sb.append(" 璇锋眰鐘舵�� : ") ; - sb.append(status == null?"":(status.equals("F0")?"鐧诲綍":(status.equals("F1")?"閫�鍑虹櫥褰�":(status.equals("F2")?"鍦ㄧ嚎淇濇寔":status)))) ; - sb.append("\n") ; - return sb.toString() ; - } - -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd71Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd71Vo.java deleted file mode 100644 index 405a121..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd71Vo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -import lombok.Data; - -@Data -public class DataCd71Vo { - - public Byte state ;//闃�闂ㄧ姸鎬佺爜锛�0锛氶榾闂ㄥ叧闂姸鎬侊紱1锛氶榾闂ㄦ墦寮�鐘舵�侊級 - public String stateName ; - - public String toString(){ - StringBuilder sb = new StringBuilder() ; - sb.append(" 鏌ヨ璁惧闃�闂ㄧ姸鎬佸簲绛�:\n"); - sb.append(" 闃�闂ㄧ姸鎬侊細"); - sb.append(state==null?"":state); - sb.append(stateName==null?"":("(" + stateName + ")")); - sb.append("\n"); - - return sb.toString() ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd83CloseVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd83CloseVo.java deleted file mode 100644 index 5d93ebd..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd83CloseVo.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -import lombok.Data; - -@Data -public class DataCd83CloseVo { - // 寮�鍏抽榾绫诲瀷锛� - // 1銆佸埛鍗″紑闃�锛�2鍒峰崱鍏抽榾锛�3銆佷腑蹇冪珯寮�闃�锛�4銆佷腑蹇冪珯鍏抽榾锛�5銆佹瑺璐瑰叧闃�锛� - // 6銆佹祦閲忚鏁呴殰鍏抽榾锛�7銆佺揣鎬ュ叧闃�锛�8銆佺敤鎴疯繙绋嬪紑闃�锛�9銆佺敤鎴疯繙绋嬪叧闃�锛� - public Byte type ; - public Double totalAmount; //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - public String clientNum ;//鍐滄埛缂栧彿 - public String icAddr ;//ic鍗″湴鍧� - public Double remainMoney ;//鍓╀綑閲戦锛氱敤鎴蜂綑棰�4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏� - public String openDt ;//鐢ㄦ按鎴风敤姘村紑濮嬫椂闂达細6瀛楄妭BCD鐮侊紝椤哄簭鏄勾鏈堟棩鏃跺垎绉掞紝鍏朵腑鍏厓骞�=2000+骞淬�� - public String closeDt ;//鐢ㄦ按鎴风敤姘寸粨鏉熸椂闂达細6瀛楄妭BCD鐮侊紝椤哄簭鏄勾鏈堟棩鏃跺垎绉掞紝鍏朵腑鍏厓骞�=2000+骞淬�� - public Double thisAmount ;//鐢ㄦ按鎴锋湰娆$敤姘撮噺锛氱疮璁℃祦閲�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - public Double thisMoney ;//鐢ㄦ按鎴锋湰娆℃秷璐归噾棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦�� - public Integer thisTime ;//鐢ㄦ按鎴锋湰娆$敤姘存椂闀匡細鐢ㄦ按鏃堕暱2瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999锛屽崟浣嶄负鍒嗛挓銆� - public String rtuDt ;//鎺у埗鍣ㄦ椂閽� - - public String toString(){ - StringBuilder sb = new StringBuilder() ; - sb.append(" 缁堢鍏抽榾鑷姤:\n"); - sb.append(" 鍏抽榾绫诲瀷锛�"); - sb.append(CommonV1_0_1.openCloseValveType(type)) ; - sb.append("\n"); - sb.append(" 绱娴侀噺锛�"); - sb.append(totalAmount==null?"":totalAmount); - sb.append("\n"); - sb.append(" 鍐滄埛缂栧彿锛�"); - sb.append(clientNum); - sb.append("\n"); - sb.append(" ic鍗″湴鍧�锛�"); - sb.append(icAddr); - sb.append("\n"); - sb.append(" 鍓╀綑閲戦锛堝厓锛夛細"); - sb.append(remainMoney ==null?"": remainMoney); - sb.append("\n"); - sb.append(" 寮�闃�鏃堕棿锛�"); - sb.append(openDt); - sb.append("\n"); - sb.append(" 鍏抽榾鏃堕棿锛�"); - sb.append(closeDt); - sb.append("\n"); - sb.append(" 鏈鐢ㄦ按閲忥細"); - sb.append(thisAmount==null?"":thisAmount); - sb.append("\n"); - sb.append(" 鏈鑺辫垂閲戦锛堝厓锛夛細"); - sb.append(thisMoney==null?"":thisMoney); - sb.append("\n"); - sb.append(" 鏈鐢ㄦ按鏃堕暱锛堝垎閽燂級锛�"); - sb.append(thisTime==null?"":thisTime); - sb.append("\n"); - sb.append(" 鎺у埗鍣ㄦ椂閽燂細"); - sb.append(rtuDt==null?"":rtuDt); - sb.append("\n"); - - return sb.toString() ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd83OpenVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd83OpenVo.java deleted file mode 100644 index 6b8da04..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd83OpenVo.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - - -import lombok.Data; - -@Data -public class DataCd83OpenVo { - // 寮�鍏抽榾绫诲瀷锛� - // 1銆佸埛鍗″紑闃�锛�2鍒峰崱鍏抽榾锛�3銆佷腑蹇冪珯寮�闃�锛�4銆佷腑蹇冪珯鍏抽榾锛�5銆佹瑺璐瑰叧闃�锛� - // 6銆佹祦閲忚鏁呴殰鍏抽榾锛�7銆佺揣鎬ュ叧闃�锛�8銆佺敤鎴疯繙绋嬪紑闃�锛�9銆佺敤鎴疯繙绋嬪叧闃�锛� - public Byte type ; - public Double totalAmount; //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - public String clientNum ;//鍐滄埛缂栧彿 - public String icAddr ;//ic鍗″湴鍧� - public Double remainMoney;//鍓╀綑閲戦锛氱敤鎴蜂綑棰�4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏� - public String openDt ;//鐢ㄦ按鎴峰紑闃�鏃堕棿锛�6瀛楄妭BCD鐮侊紝椤哄簭鏄勾鏈堟棩鏃跺垎绉掞紝鍏朵腑鍏厓骞�=2000+骞淬�� - public String rtuDt ;//鎺у埗鍣ㄦ椂閽� - - public String toString(){ - StringBuilder sb = new StringBuilder() ; - sb.append(" 缁堢寮�闃�鑷姤:\n"); - sb.append(" 寮�闃�绫诲瀷锛�"); - sb.append(CommonV1_0_1.openCloseValveType(type)) ; - sb.append("\n"); - sb.append(" 绱娴侀噺锛�"); - sb.append(totalAmount==null?"":totalAmount); - sb.append("\n"); - sb.append(" 鍐滄埛缂栧彿锛�"); - sb.append(clientNum); - sb.append("\n"); - sb.append(" ic鍗″湴鍧�锛�"); - sb.append(icAddr); - sb.append("\n"); - sb.append(" 鍓╀綑閲戦锛堝厓锛夛細"); - sb.append(remainMoney ==null?"": remainMoney); - sb.append("\n"); - sb.append(" 寮�闃�鏃堕棿锛�"); - sb.append(openDt); - sb.append("\n"); - sb.append(" 鎺у埗鍣ㄦ椂閽燂細"); - sb.append(rtuDt==null?"":rtuDt); - sb.append("\n"); - - return sb.toString() ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd84Vo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd84Vo.java deleted file mode 100644 index 789350f..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataCd84Vo.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -import lombok.Data; - -@Data -public class DataCd84Vo { - public String clientNum ;//鍐滄埛缂栧彿 - public Double remainMoney ;//鍓╀綑閲戦锛氱敤鎴蜂綑棰�4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏� - public Double totalAmount; //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - public Double instantAmount; //鐬椂娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999.999锛屽崟浣嶄负m3/h銆� - public String rtuDt ;//鎺у埗鍣ㄦ椂閽� - - public String toString(){ - StringBuilder sb = new StringBuilder() ; - sb.append(" 缁堢寮�闃�宸ヤ綔鎶�:\n"); - sb.append(" 鍐滄埛缂栧彿锛�"); - sb.append(clientNum); - sb.append("\n"); - sb.append(" 鍓╀綑閲戦锛堝厓锛夛細"); - sb.append(remainMoney==null?"":remainMoney); - sb.append("\n"); - sb.append(" 绱娴侀噺锛�"); - sb.append(totalAmount==null?"":totalAmount); - sb.append("\n"); - sb.append(" 鐬椂娴侀噺锛�"); - sb.append(instantAmount==null?"":instantAmount); - sb.append("\n"); - sb.append(" 鎺у埗鍣ㄦ椂閽燂細"); - sb.append(rtuDt==null?"":rtuDt); - sb.append("\n"); - return sb.toString() ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataStateVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataStateVo.java deleted file mode 100644 index 08bfef9..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DataStateVo.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -import lombok.Data; - -@Data -public class DataStateVo { - public Byte idCard ;// 钃勭數姹犵數鍘� - public Byte work;//宸ヤ綔鐘舵�� - public Byte valve ;//闃�闂� - - public String toString(){ - StringBuilder str = new StringBuilder() ; - str.append(" 鐘舵��:\n"); - str.append(" IC 鍗″姛鑳斤細"); - str.append(idCard==null?"":(idCard==1?"鏈夋晥":"鏃犳晥")); - str.append("\n"); - str.append(" 宸ヤ綔鐘舵�侊細"); - str.append(work ==null?"":(work==1?"鍚姩":"鍋滄")); - str.append("\n"); - str.append(" 闃�闂細"); - str.append(valve==null?"":(valve==1?"鎵撳紑":"鍏抽棴")); - return str.toString() ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/OnLineV1_0_1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/OnLineV1_0_1.java deleted file mode 100644 index 69d63a1..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/OnLineV1_0_1.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -import com.dy.common.mw.protocol.AnnotationOnLine; -import com.dy.common.mw.protocol.OnLine; - -@AnnotationOnLine( - protocolName = ProtocolConstantV206V1_0_0.protocolName, - priority = ProtocolConstantV206V1_0_0.priority) -@SuppressWarnings("unused") -public class OnLineV1_0_1 implements OnLine{ - - /** - * 瀵逛笂绾挎暟鎹繘琛屽垎鏋� - * @param upBuf 涓婅鏁版嵁 - * @return - */ - @Override - public OnLineResult parse(byte[] upBuf)throws Exception { - OnLineResult olr = new OnLineResult() ; - CommonV1_0_1 cp = new CommonV1_0_1() ; - Boolean flag = cp.isThisProtocolHead(upBuf) ; - if(flag == null){ - //鍑洪敊 - olr.result = OnLine.OnLineAction_fail ; - olr.rtuAddr = null ; - }else if(!flag.booleanValue()){ - //涓嶆槸鏈崗璁暟鎹� - olr.result = OnLine.OnLineAction_success_noMe ; - olr.rtuAddr = null ; - }else{ - //鏄湰鍗忚鏁版嵁 - olr.result = OnLine.OnLineAction_success ; - olr.rtuAddr = cp.parseRtuAddr(upBuf) ; - olr.protocolName = ProtocolConstantV206V1_0_0.protocolName ; - } - return olr; - } - -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/ParseParamsForDownV1_0_1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/ParseParamsForDownV1_0_1.java deleted file mode 100644 index a0f2caa..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/ParseParamsForDownV1_0_1.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -import com.dy.common.mw.protocol.CodeParseParams; - -public class ParseParamsForDownV1_0_1 implements CodeParseParams{ - - public String protocolName ; - public String rtuAddr ;//鎺у埗鍣ㄥ湴鍧� - public String commandId ; - public String commandCode ; - public Object param ; - public Object attachment ; - - public ParseParamsForDownV1_0_1(){} - - public void clear(){ - this.protocolName = null ; - this.rtuAddr = null ; - this.commandId = null ; - this.commandCode = null ; - this.param = null ; - this.attachment = null ; - } - - public void setValue( - String protocolName, - String rtuAddr, - String commandId, - String commandCode, - Object param, - Object attachment ){ - this.protocolName = protocolName ; - this.rtuAddr = rtuAddr ; - this.commandId = commandId ; - this.commandCode = commandCode ; - this.param = param ; - this.attachment = attachment ; - } - -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/ParseParamsForUpV1_0_1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/ParseParamsForUpV1_0_1.java deleted file mode 100644 index 58d58c9..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/ParseParamsForUpV1_0_1.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0; - -import com.dy.common.mw.protocol.CodeParseParams; -import com.dy.common.mw.protocol.Data; - -public class ParseParamsForUpV1_0_1 implements CodeParseParams{ - - public String protocolName ;//鍗忚鍚嶇О - public String rtuAddr ;//鎺у埗鍣ㄥ潃 - public String upCode ;//涓婅鎶ユ枃鏁版嵁涓殑鍔熻兘鐮� - public String upHex ;//琛屾姤鏂囨暟鎹崄鍏繘鍒跺舰寮� - public byte[] upBuffer ;//琛屾姤鏂囨暟鎹瓧鑺傛暟缁� - public Data data ;//瑙f瀽鍚庣殑鏁版嵁 - - public ParseParamsForUpV1_0_1(){} - - public void clear(){ - this.protocolName = null ; - this.rtuAddr = null ; - this.upCode = null ; - this.upHex = null ; - this.upBuffer = null ; - this.data = null ; - } - - public void setValue(String protocolName, - String rtuAddr, - String upCode, - String upHex, - byte[] upBuffer, - Data data){ - this.protocolName = protocolName ; - this.rtuAddr = rtuAddr ; - this.upCode = upCode ; - this.upHex = upHex ; - this.upBuffer = upBuffer ; - this.data = data ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_02_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_02_Up.java deleted file mode 100644 index dd96f44..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_02_Up.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0.parse; - - -import com.dy.common.mw.protocol.*; -import com.dy.common.util.ByteUtil; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import com.dy.common.mw.protocol.p206V1_0_0.*; - -@AnnotationCodeUp(ifAny={ - CodeV1_0_1.cd_02 -}) -@SuppressWarnings("unused") -public class Cd_02_Up implements CodeParse{ - - private static final Logger log = LogManager.getLogger(Cd_02_Up.class); - - /** - * 鍒嗘瀽涓婅鏁版嵁 - */ - @Override - public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception { - ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ; - int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ; - if(bsLen > 0){ - this.doParse(para.upBuffer, - bsLen, - para.upCode, - para.data) ; - } - log.info("鍒嗘瀽涓婅鏁版嵁<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU鍦板潃=" + para.rtuAddr + ">:\n" + para.data.toString()); - - MidResultFromRtu midRs = new MidResultFromRtu() ; - midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О - midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 - midRs.upCode = para.upCode ;//涓婅鏁版嵁涓殑鍔熻兘鐮� - midRs.upHex = para.upHex ;//涓婅鏁版嵁鍗佸叚杩涘埗褰㈠紡 - midRs.upBuffer = para.upBuffer ;//涓婅鏁版嵁瀛楄妭鏁扮粍 - midRs.data = para.data ;//瑙f瀽鍚庣殑鏁版嵁 - - midRs.reportOrResponse_trueOrFalse = true ;//涓诲姩涓婃姤 - - String confirmComCode = para.upCode ; - ParseParamsForDownV1_0_1 downCpParams = new ParseParamsForDownV1_0_1() ; - downCpParams.setValue( - ProtocolConstantV206V1_0_0.protocolName, - para.rtuAddr, - Command.defaultId, - confirmComCode, - null, - null); - //鏋勯�犲簲绛� - byte[] data = new Cd_02_Down().doParse(downCpParams) ; - - MidResultToRtu confirmCommand = new MidResultToRtu() ; - confirmCommand.protocolName = para.protocolName ;//鍗忚鍚嶇О - confirmCommand.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 - confirmCommand.commandId = Command.defaultId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉 - confirmCommand.downCode = confirmComCode ;//涓嬭鍛戒护鍔熻兘鐮�; - confirmCommand.downBuffer = data ;//涓嬭鍛戒护鏁版嵁 - confirmCommand.downBufHex = ByteUtil.bytes2Hex(data, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡 - confirmCommand.hasResponse = false ;//鏄惁鏈夊簲绛� - confirmCommand.maxSendTimes = 1 ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�2娆�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆 - confirmCommand.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨 - - confirmCommand.isSendFirst = true ;//纭鍛戒护锛屼紭鍏堝彂閫� - if(isLowPower != null && isLowPower.booleanValue()){ - //浣庡姛鑰楁椂锛屽敖蹇彂閫� - confirmCommand.isQuickSend = true ; - } - callback.callback(midRs.reportOrResponse_trueOrFalse); - return new MidResult[]{midRs, confirmCommand} ; - } - /** - * 鎵ц鍒嗘瀽 - * @param bs 瀛楄妭鏁扮粍 - * @param bsLen 瀛楄妭闀垮害锛堟�诲寘闀匡紝鍖呮嫭鍖呭ご鍜屽寘灏撅級 - * @param dataCode 鍔熻兘鐮� - * @param data 鏁版嵁 - * @throws Exception 寮傚父 - */ - protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { - DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; - DataCd02Vo cdData = new DataCd02Vo() ; - dV1.dataCd02Vo = cdData ; - cdData.status = ByteUtil.bytes2Hex(bs, false, ProtocolConstantV206V1_0_0.dataIndex, 1) ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_71_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_71_Up.java deleted file mode 100644 index 69e36a4..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_71_Up.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0.parse; - -import com.dy.common.mw.protocol.*; -import com.dy.common.mw.protocol.p206V1_0_0.*; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -@AnnotationCodeUp(ifAny={ - CodeV1_0_1.cd_71 -}) -@SuppressWarnings("unused") -public class Cd_71_Up implements CodeParse { - - private static final Logger log = LogManager.getLogger(Cd_71_Up.class); - - /** - * 鍒嗘瀽涓婅鏁版嵁 - */ - @Override - public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception { - ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ; - int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ; - if(bsLen > 0){ - this.doParse(para.upBuffer, - bsLen, - para.upCode, - para.data) ; - } - log.info("鍒嗘瀽涓婅鏁版嵁<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU鍦板潃=" + para.rtuAddr + ">:\n" + para.data.toString()); - - MidResultFromRtu midRs = new MidResultFromRtu() ; - midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О - midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 - midRs.upCode = para.upCode ;//涓婅鏁版嵁涓殑鍔熻兘鐮� - midRs.upHex = para.upHex ;//涓婅鏁版嵁鍗佸叚杩涘埗褰㈠紡 - midRs.upBuffer = para.upBuffer ;//涓婅鏁版嵁瀛楄妭鏁扮粍 - midRs.data = para.data ;//瑙f瀽鍚庣殑鏁版嵁 - - midRs.reportOrResponse_trueOrFalse = false ;//涓诲姩涓婃姤 - - callback.callback(midRs.reportOrResponse_trueOrFalse); - return new MidResult[]{midRs} ; - } - /** - * 鎵ц鍒嗘瀽 - * @param bs 瀛楄妭鏁扮粍 - * @param bsLen 瀛楄妭闀垮害锛堟�诲寘闀匡紝鍖呮嫭鍖呭ご鍜屽寘灏撅級 - * @param dataCode 鍔熻兘鐮� - * @param data 鏁版嵁 - * @throws Exception 寮傚父 - */ - protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { - DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; - DataCd71Vo cdData = new DataCd71Vo() ; - dV1.dataCd71Vo = cdData ; - cdData.state = bs[ProtocolConstantV206V1_0_0.dataIndex] ; - if(cdData.state == 0){ - cdData.stateName = "闃�闂ㄥ叧闂�" ; - }else if(cdData.state == 1){ - cdData.stateName = "闃�闂ㄦ墦寮�" ; - }else{ - cdData.stateName = "鏈煡" ; - } - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java deleted file mode 100644 index 15ff9f1..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_83_Up.java +++ /dev/null @@ -1,253 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0.parse; - -import com.dy.common.mw.protocol.*; -import com.dy.common.mw.protocol.p206V1_0_0.*; -import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlParse; -import com.dy.common.util.ByteUtil; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -@AnnotationCodeUp(ifAny={ - CodeV1_0_1.cd_83 -}) -@SuppressWarnings("unused") -public class Cd_83_Up implements CodeParse { - - private static final Logger log = LogManager.getLogger(Cd_83_Up.class); - - /** - * 鍒嗘瀽涓婅鏁版嵁 - */ - @Override - public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception { - ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ; - int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ; - if(bsLen > 0){ - this.doParse(para.upBuffer, - bsLen, - para.upCode, - para.data) ; - } - log.info("鍒嗘瀽涓婅鏁版嵁<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU鍦板潃=" + para.rtuAddr + ">:\n" + para.data.toString()); - - MidResultFromRtu midRs = new MidResultFromRtu() ; - midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О - midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 - midRs.upCode = para.upCode ;//涓婅鏁版嵁涓殑鍔熻兘鐮� - midRs.upHex = para.upHex ;//涓婅鏁版嵁鍗佸叚杩涘埗褰㈠紡 - midRs.upBuffer = para.upBuffer ;//涓婅鏁版嵁瀛楄妭鏁扮粍 - midRs.data = para.data ;//瑙f瀽鍚庣殑鏁版嵁 - - midRs.reportOrResponse_trueOrFalse = true ;//涓诲姩涓婃姤 - - String confirmComCode = para.upCode ; - ParseParamsForDownV1_0_1 downCpParams = new ParseParamsForDownV1_0_1() ; - downCpParams.setValue( - ProtocolConstantV206V1_0_0.protocolName, - para.rtuAddr, - Command.defaultId, - confirmComCode, - null, - null); - //鏋勯�犲簲绛� - byte[] data = new Cd_83_Down().doParse(downCpParams) ; - - MidResultToRtu confirmCommand = new MidResultToRtu() ; - confirmCommand.protocolName = para.protocolName ;//鍗忚鍚嶇О - confirmCommand.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 - confirmCommand.commandId = Command.defaultId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉 - confirmCommand.downCode = confirmComCode ;//涓嬭鍛戒护鍔熻兘鐮�; - confirmCommand.downBuffer = data ;//涓嬭鍛戒护鏁版嵁 - confirmCommand.downBufHex = ByteUtil.bytes2Hex(data, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡 - confirmCommand.hasResponse = false ;//鏄惁鏈夊簲绛� - confirmCommand.maxSendTimes = 1 ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�2娆�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆 - confirmCommand.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨 - - confirmCommand.isSendFirst = true ;//纭鍛戒护锛屼紭鍏堝彂閫� - if(isLowPower != null && isLowPower.booleanValue()){ - //浣庡姛鑰楁椂锛屽敖蹇彂閫� - confirmCommand.isQuickSend = true ; - } - - callback.callback(midRs.reportOrResponse_trueOrFalse); - return new MidResult[]{midRs, confirmCommand} ; - } - /** - * 鎵ц鍒嗘瀽 - * @param bs 瀛楄妭鏁扮粍 - * @param bsLen 瀛楄妭闀垮害锛堟�诲寘闀匡紝鍖呮嫭鍖呭ご鍜屽寘灏撅級 - * @param dataCode 鍔熻兘鐮� - * @param data 鏁版嵁 - * @throws Exception 寮傚父 - */ - protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { - short index = ProtocolConstantV206V1_0_0.dataIndex ; - byte opType = bs[ProtocolConstantV206V1_0_0.dataIndex]; - if(opType == 1 || opType == 3 || opType == 8){ - this.doParseOpen(opType, bs, bsLen, dataCode, data); - }else{ - this.doParseClose(opType, bs, bsLen, dataCode, data); - } - } - private void doParseOpen(byte opType, byte[] bs, int bsLen, String dataCode, Data data) throws Exception { - DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; - DataCd83OpenVo cdData = new DataCd83OpenVo() ; - dV1.dataCd83OpenVo = cdData ; - - cdData.type = opType ; - - short index = ProtocolConstantV206V1_0_0.dataIndex + 1 ; - //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - cdData.totalAmount = 0.0D ; - int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 10000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 1000000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 100000000.0 ; - - //鐢ㄦ按鎴峰彿鏁版嵁鏍煎紡锛�5瀛楄妭BCD鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛�� - cdData.clientNum = ByteUtil.BCD2String_LE(bs, index, index + 4) ; - index += 5 ; - - //IC鍗″彿鏍煎紡锛�4瀛楄妭HEX鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛�� - cdData.clientNum = ByteUtil.bytesToHex(bs, index, index + 3) ; - index += 4 ; - - //鐢ㄦ按鎴蜂綑棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦�� - cdData.remainMoney = 0.0D ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt/100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt * 10000.0 ; - - //鐢ㄦ按鎴风敤姘村紑濮嬫椂闂达細6瀛楄妭BCD鐮侊紝椤哄簭鏄勾鏈堟棩鏃跺垎绉掞紝鍏朵腑鍏厓骞�=2000+骞淬�� - cdData.openDt = GlParse.parseTp(bs, index) ; - index += 6 ; - - //鎺у埗鍣ㄦ椂閽� - cdData.rtuDt = GlParse.parseTp(bs, index) ; - //index += 6 ; - } - - private void doParseClose(byte opType, byte[] bs, int bsLen, String dataCode, Data data) throws Exception { - DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; - DataCd83CloseVo cdData = new DataCd83CloseVo() ; - dV1.dataCd83CloseVo = cdData ; - - cdData.type = opType ; - - short index = ProtocolConstantV206V1_0_0.dataIndex + 1 ; - //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - cdData.totalAmount = 0.0D ; - int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 10000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 1000000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 100000000.0 ; - - //鐢ㄦ按鎴峰彿鏁版嵁鏍煎紡锛�5瀛楄妭BCD鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛�� - cdData.clientNum = ByteUtil.BCD2String_LE(bs, index, index + 4) ; - index += 5 ; - - //IC鍗″彿鏍煎紡锛�4瀛楄妭HEX鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛�� - cdData.clientNum = ByteUtil.bytesToHex(bs, index, index + 3) ; - index += 4 ; - - //鐢ㄦ按鎴蜂綑棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦�� - cdData.remainMoney = 0.0D ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt/100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt * 10000.0 ; - - //鐢ㄦ按鎴风敤姘村紑濮嬫椂闂达細6瀛楄妭BCD鐮侊紝椤哄簭鏄勾鏈堟棩鏃跺垎绉掞紝鍏朵腑鍏厓骞�=2000+骞淬�� - cdData.openDt = GlParse.parseTp(bs, index) ; - index += 6 ; - - //鐢ㄦ按鎴风敤姘寸粨鏉熸椂闂达細6瀛楄妭BCD鐮侊紝椤哄簭鏄勾鏈堟棩鏃跺垎绉掞紝鍏朵腑鍏厓骞�=2000+骞淬�� - cdData.closeDt = GlParse.parseTp(bs, index) ; - index += 6 ; - - //鐢ㄦ按鎴锋湰娆$敤姘撮噺锛氱疮璁℃祦閲�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - cdData.thisAmount = 0.0D ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisAmount += tpInt/100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisAmount += tpInt ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisAmount += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisAmount += tpInt * 10000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisAmount += tpInt * 1000000.0 ; - - //鐢ㄦ按鎴锋湰娆℃秷璐归噾棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦�� - cdData.thisMoney = 0.0D ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisMoney += tpInt/100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisMoney += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisMoney += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisMoney += tpInt * 10000.0 ; - - //鐢ㄦ按鎴锋湰娆$敤姘存椂闀匡細鐢ㄦ按鏃堕暱2瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999锛屽崟浣嶄负鍒嗛挓銆� - cdData.thisTime = 0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisTime += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.thisTime += tpInt * 100 ; - - //鎺у埗鍣ㄦ椂閽� - cdData.rtuDt = GlParse.parseTp(bs, index) ; - //index += 6 ; - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Up.java deleted file mode 100644 index a14fc36..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_84_Up.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0.parse; - -import com.dy.common.mw.protocol.*; -import com.dy.common.mw.protocol.p206V1_0_0.*; -import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlParse; -import com.dy.common.util.ByteUtil; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -@AnnotationCodeUp(ifAny={ - CodeV1_0_1.cd_84 -}) -@SuppressWarnings("unused") -public class Cd_84_Up implements CodeParse { - - private static final Logger log = LogManager.getLogger(Cd_84_Up.class); - - /** - * 鍒嗘瀽涓婅鏁版嵁 - */ - @Override - public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception { - ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ; - int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ; - if(bsLen > 0){ - this.doParse(para.upBuffer, - bsLen, - para.upCode, - para.data) ; - } - log.info("鍒嗘瀽涓婅鏁版嵁<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU鍦板潃=" + para.rtuAddr + ">:\n" + para.data.toString()); - - MidResultFromRtu midRs = new MidResultFromRtu() ; - midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О - midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 - midRs.upCode = para.upCode ;//涓婅鏁版嵁涓殑鍔熻兘鐮� - midRs.upHex = para.upHex ;//涓婅鏁版嵁鍗佸叚杩涘埗褰㈠紡 - midRs.upBuffer = para.upBuffer ;//涓婅鏁版嵁瀛楄妭鏁扮粍 - midRs.data = para.data ;//瑙f瀽鍚庣殑鏁版嵁 - - midRs.reportOrResponse_trueOrFalse = true ;//涓诲姩涓婃姤 - - String confirmComCode = para.upCode ; - ParseParamsForDownV1_0_1 downCpParams = new ParseParamsForDownV1_0_1() ; - downCpParams.setValue( - ProtocolConstantV206V1_0_0.protocolName, - para.rtuAddr, - Command.defaultId, - confirmComCode, - null, - null); - //鏋勯�犲簲绛� - byte[] data = new Cd_84_Down().doParse(downCpParams) ; - - MidResultToRtu confirmCommand = new MidResultToRtu() ; - confirmCommand.protocolName = para.protocolName ;//鍗忚鍚嶇О - confirmCommand.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 - confirmCommand.commandId = Command.defaultId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉 - confirmCommand.downCode = confirmComCode ;//涓嬭鍛戒护鍔熻兘鐮�; - confirmCommand.downBuffer = data ;//涓嬭鍛戒护鏁版嵁 - confirmCommand.downBufHex = ByteUtil.bytes2Hex(data, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡 - confirmCommand.hasResponse = false ;//鏄惁鏈夊簲绛� - confirmCommand.maxSendTimes = 1 ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�2娆�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆 - confirmCommand.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨 - - confirmCommand.isSendFirst = true ;//纭鍛戒护锛屼紭鍏堝彂閫� - if(isLowPower != null && isLowPower.booleanValue()){ - //浣庡姛鑰楁椂锛屽敖蹇彂閫� - confirmCommand.isQuickSend = true ; - } - - callback.callback(midRs.reportOrResponse_trueOrFalse); - return new MidResult[]{midRs, confirmCommand} ; - } - /** - * 鎵ц鍒嗘瀽 - * @param bs 瀛楄妭鏁扮粍 - * @param bsLen 瀛楄妭闀垮害锛堟�诲寘闀匡紝鍖呮嫭鍖呭ご鍜屽寘灏撅級 - * @param dataCode 鍔熻兘鐮� - * @param data 鏁版嵁 - * @throws Exception 寮傚父 - */ - protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { - DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; - DataCd84Vo cdData = new DataCd84Vo() ; - dV1.dataCd84Vo = cdData ; - - short index = ProtocolConstantV206V1_0_0.dataIndex ; - //鐢ㄦ按鎴峰彿鏁版嵁鏍煎紡锛�5瀛楄妭BCD鐮佷綆浣嶅湪鍓嶉珮浣嶅湪鍚庛�� - cdData.clientNum = ByteUtil.BCD2String_LE(bs, index, index + 4) ; - index += 5 ; - - //鐢ㄦ按鎴蜂綑棰濓細鐢ㄦ埛浣欓4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0.00~999999.99锛屽崟浣嶄负鍏冦�� - cdData.remainMoney = 0.0D ; - int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt/100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.remainMoney += tpInt * 10000.0 ; - - //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - cdData.totalAmount = 0.0D ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 10000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 1000000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 100000000.0 ; - - //鐬椂娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999.999锛屽崟浣嶄负m3/h銆� - cdData.instantAmount = 0.0D ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt/1000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt/10.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt * 10.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt * 1000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt * 100000.0 ; - - //鎺у埗鍣ㄦ椂閽� - cdData.rtuDt = GlParse.parseTp(bs, index) ; - //index += 6 ; - } - -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_C0_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_C0_Up.java deleted file mode 100644 index dd61198..0000000 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_C0_Up.java +++ /dev/null @@ -1,224 +0,0 @@ -package com.dy.common.mw.protocol.p206V1_0_0.parse; - -import com.dy.common.mw.protocol.*; -import com.dy.common.mw.protocol.p206V1_0_0.*; -import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlParse; -import com.dy.common.util.ByteUtil; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -@AnnotationCodeUp(ifAny={ - CodeV1_0_1.cd_C0 -}) -@SuppressWarnings("unused") -public class Cd_C0_Up implements CodeParse { - - private static final Logger log = LogManager.getLogger(Cd_C0_Up.class); - - /** - * 鍒嗘瀽涓婅鏁版嵁 - */ - @Override - public MidResult[] parse(Boolean isLowPower, CodeParseParams params, CodeParseCallback callback)throws Exception { - ParseParamsForUpV1_0_1 para = (ParseParamsForUpV1_0_1)params ; - int bsLen = new CommonV1_0_1().parseDataLen(para.upBuffer) ; - if(bsLen > 0){ - this.doParse(para.upBuffer, - bsLen, - para.upCode, - para.data) ; - } - log.info("鍒嗘瀽涓婅鏁版嵁<" + CodeV1_0_1.getCodeName(para.upCode) + " RTU鍦板潃=" + para.rtuAddr + ">:\n" + para.data.toString()); - - MidResultFromRtu midRs = new MidResultFromRtu() ; - midRs.protocolName = para.protocolName ;//鍗忚鍚嶇О - midRs.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 - midRs.upCode = para.upCode ;//涓婅鏁版嵁涓殑鍔熻兘鐮� - midRs.upHex = para.upHex ;//涓婅鏁版嵁鍗佸叚杩涘埗褰㈠紡 - midRs.upBuffer = para.upBuffer ;//涓婅鏁版嵁瀛楄妭鏁扮粍 - midRs.data = para.data ;//瑙f瀽鍚庣殑鏁版嵁 - - midRs.reportOrResponse_trueOrFalse = true ;//涓诲姩涓婃姤 - - String confirmComCode = para.upCode ; - ParseParamsForDownV1_0_1 downCpParams = new ParseParamsForDownV1_0_1() ; - downCpParams.setValue( - ProtocolConstantV206V1_0_0.protocolName, - para.rtuAddr, - Command.defaultId, - confirmComCode, - null, - null); - //鏋勯�犲簲绛� - byte[] data = new Cd_02_Down().doParse(downCpParams) ; - - MidResultToRtu confirmCommand = new MidResultToRtu() ; - confirmCommand.protocolName = para.protocolName ;//鍗忚鍚嶇О - confirmCommand.rtuAddr = para.rtuAddr ;//Rtu鍦板潃 - confirmCommand.commandId = Command.defaultId ;//鍛戒护ID锛屽彂璧峰懡浠ょ殑瀹㈡埛绔�(web绔�)鐢熸垚锛屼互鍖归厤鍛戒护缁撴灉 - confirmCommand.downCode = confirmComCode ;//涓嬭鍛戒护鍔熻兘鐮�; - confirmCommand.downBuffer = data ;//涓嬭鍛戒护鏁版嵁 - confirmCommand.downBufHex = ByteUtil.bytes2Hex(data, true) ;//涓嬭鍛戒护鏁版嵁鍗佸叚杩涘埗褰㈠紡 - confirmCommand.hasResponse = false ;//鏄惁鏈夊簲绛� - confirmCommand.maxSendTimes = 1 ;//鍛戒护鏈�澶у彂閫佹鏁�(褰撴敹涓嶅埌搴旂瓟鏃讹紝灏嗛噸鍙�2娆�)锛屽鏋滀笉璁剧疆锛屽懡浠ょ紦瀛樺櫒杩涜琛ュ厖璁剧疆 - confirmCommand.isCachForOffLine = false ;//RTU涓嶅湪绾匡紝鍛戒护鏄惁缂撳瓨 - - confirmCommand.isSendFirst = true ;//纭鍛戒护锛屼紭鍏堝彂閫� - if(isLowPower != null && isLowPower.booleanValue()){ - //浣庡姛鑰楁椂锛屽敖蹇彂閫� - confirmCommand.isQuickSend = true ; - } - - callback.callback(midRs.reportOrResponse_trueOrFalse); - return new MidResult[]{midRs, confirmCommand} ; - } - /** - * 鎵ц鍒嗘瀽 - * @param bs 瀛楄妭鏁扮粍 - * @param bsLen 瀛楄妭闀垮害锛堟�诲寘闀匡紝鍖呮嫭鍖呭ご鍜屽寘灏撅級 - * @param dataCode 鍔熻兘鐮� - * @param data 鏁版嵁 - * @throws Exception 寮傚父 - */ - protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { - DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; - DataCdC0Vo cdData = new DataCdC0Vo() ; - dV1.dataCdC0Vo = cdData ; - - boolean hasWaterAmount = false ;//鏄惁鏈夋祦閲忔暟鎹� - boolean hasWaterPress = false ;//鏄惁鏈夋按鍘嬫暟鎹� - boolean hasEleVolt = false ;//鏄惁鏈夌數鍘嬫暟鎹� - boolean hasSignal = false ;//鏄惁鏈変俊鍙峰己搴︽暟鎹� - boolean hasAlarmStatus = false ;//鏄惁鏈夋暟鎹� - - short index = ProtocolConstantV206V1_0_0.dataIndex ; - - byte tmpBt1 = bs[index] ; - index++ ; - if(((tmpBt1 & 4) >> 2) == 1){ - hasWaterAmount = true ; - } - - byte tmpBt2 = bs[index] ; - index++ ; - if(((tmpBt2 & 0x10) >> 4) == 1){ - hasAlarmStatus = true ; - } - if(((tmpBt2 & 0x20) >> 5) == 1){ - hasWaterPress = true ; - } - if(((tmpBt2 & 0x40) >> 6) == 1){ - hasEleVolt = true ; - } - if(((tmpBt2 & 0x80) >> 7) == 1){ - hasSignal = true ; - } - - if(hasWaterAmount){ - //鐬椂娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999.999锛屽崟浣嶄负m3/h銆� - cdData.instantAmount = 0.0D ; - int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt/1000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt/10.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt * 10.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt * 1000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.instantAmount += tpInt * 100000.0 ; - - //绱娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - cdData.totalAmount = 0.0D ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 10000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 1000000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.totalAmount += tpInt * 100000000.0 ; - - //鎹熷け娴侀噺锛�5瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~9999999999锛屽崟浣嶄负m3銆� - cdData.lossAmount = 0.0D ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.lossAmount += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.lossAmount += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.lossAmount += tpInt * 10000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.lossAmount += tpInt * 1000000.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.lossAmount += tpInt * 100000000.0 ; - } - if(hasWaterPress){ - //姘村帇锛�4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~999999.99锛屽崟浣嶄负KPa銆� - cdData.waterPress = 0.0D ; - int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.waterPress += tpInt/100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.waterPress += tpInt; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.waterPress += tpInt * 100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.waterPress += tpInt * 10000.0 ; - } - if(hasEleVolt){ - //鐢垫睜鐢靛帇锛�4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~99.99锛屽崟浣嶄负V銆� - cdData.batteryVolt = 0.0D ;//钃勭數姹犵數鍘� - cdData.sunVolt = 0.0D ;//澶槼鑳界數鍘� - int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.batteryVolt += tpInt/100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.batteryVolt += tpInt; - //澶槼鑳界數鍘嬶細4瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~99.99锛屽崟浣嶄负V銆� - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.sunVolt += tpInt/100.0 ; - tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.sunVolt += tpInt; - } - if(hasSignal){ - //淇″彿寮哄害锛�1瀛楄妭BCD鐮侊紝鍙栧�艰寖鍥�0~99銆� - cdData.signal = 0 ; - int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; - index++ ; - cdData.signal += tpInt ; - } - if(hasAlarmStatus){ - //鎶ヨ鏁版嵁 - cdData.alarmVo = GlParse.parseAlarm(bs, index) ; - index += 2 ; - //鐘舵�佹暟鎹� - cdData.stateVo = GlParse.parseState(bs, index) ; - index += 2 ; - } - cdData.rtuDt = GlParse.parseTp(bs, index) ; - - } -} diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java index 4bd6941..ea7216e 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java @@ -39,36 +39,31 @@ public void start(UnitStartedCallbackInterface callback) throws Exception { if(!started){ started = true ; - if(confVo.enableShortThreadPool) { - TreadPoolFactory.initThreadPoolShort("鐭换鍔″伐浣滅嚎绋嬫睜", - this.confVo.short_maxThread, - this.confVo.short_minThread, - this.confVo.short_freeTimeout, + if(confVo.enableThreadPool){ + TreadPoolFactory.initThreadPoolShort("鐭换鍔″伐浣滅嚎绋嬫睜", + this.confVo.short_maxThread, + this.confVo.short_minThread, + this.confVo.short_freeTimeout, this.confVo.short_busyTimeout); - }else{ - System.out.println("鐭嚎绋嬫睜閰嶇疆涓嶅惎鍔�"); - } - if(confVo.enableLongThreadPool) { - TreadPoolFactory.initThreadPoolLong("闀夸换鍔″伐浣滅嚎绋嬫睜", - this.confVo.long_maxThread, - this.confVo.long_minThread, - this.confVo.long_freeTimeout, + TreadPoolFactory.initThreadPoolLong("闀夸换鍔″伐浣滅嚎绋嬫睜", + this.confVo.long_maxThread, + this.confVo.long_minThread, + this.confVo.long_freeTimeout, this.confVo.long_busyTimeout); - }else{ - System.out.println("闀跨嚎绋嬫睜閰嶇疆涓嶅惎鍔�"); + + if(this.confVo.showStartInfo){ + System.out.println("绾跨▼姹犳ā鍧楁垚鍔熷惎鍔�"); + } } - if(this.confVo.showStartInfo){ - System.out.println("绾跨▼姹犳ā鍧楁垚鍔熷惎鍔�"); - } + callback.call(null); } - callback.call(null); } @Override - public void stop(UnitStartedCallbackInterface callback) { + public void stop(UnitStartedCallbackInterface callback) throws Exception { } - /* + public static void main(String[] args) throws Exception{ SupportUnitConfigVo supVo = new SupportUnitConfigVo() ; //鐭伐浣滄椂闀跨嚎绋嬫睜锛岀嚎绋嬭礋璐g敤鏃惰緝鐭殑宸ヤ綔浠诲姟 @@ -87,9 +82,8 @@ supVo.long_busyTimeout = -1 ; } - supVo.enableShortThreadPool = true ; - supVo.enableLongThreadPool = true ; - + supVo.enableThreadPool = true ; + supVo.showStartInfo = true ; SupportUnit supUnit = SupportUnit.getInstance() ; @@ -100,7 +94,6 @@ supUnit.start(obj -> { }); } - private static class AdapterImp_SupportUnit implements SupportUnitAdapter { private SupportUnitConfigVo configVo = null ; @@ -113,6 +106,7 @@ public void setConfig(SupportUnitConfigVo configVo) { this.configVo = configVo; } + + } - */ } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnitConfigVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnitConfigVo.java index fd6cd57..9bf912c 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnitConfigVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnitConfigVo.java @@ -1,10 +1,8 @@ package com.dy.common.mw.support; public class SupportUnitConfigVo { - - public boolean enableShortThreadPool ; - - public boolean enableLongThreadPool ; + + public boolean enableThreadPool ; //鐭换鍔$嚎绋嬫睜 public int short_maxThread ; diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java index 13114af..cfa77d5 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java @@ -4,7 +4,7 @@ import org.apache.logging.log4j.Logger; /** - * 闃熷垪锛屽厛杩涘厛鍑猴紝闈炵嚎绋嬪畨鍏� + * 闃熷垪锛屽厛杩涘厛鍑� */ public class Queue { @SuppressWarnings("unfinal") @@ -62,7 +62,6 @@ */ @SuppressWarnings("unused") public void pushHead(NodeObj obj)throws Exception{ - //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 synchronized(synObj){ if(obj == null){ return ; @@ -90,7 +89,6 @@ * @param obj 鍏ュ垪鐨勫璞� */ public void pushTail(NodeObj obj)throws Exception{ - //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 synchronized(synObj){ if(obj == null){ return ; @@ -118,7 +116,6 @@ * @return 鍑哄垪瀵硅薄 */ public NodeObj pop(){ - //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 synchronized(synObj){ NodeObj obj = null ; if(this.size > 0){ @@ -142,14 +139,11 @@ */ @SuppressWarnings("unused") public Node getFirstNode(){ - //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 - synchronized(synObj) { - Node node = this.head.next; - if (node != this.tail) { - return node; - } - return null; + Node node = this.head.next ; + if(node != this.tail){ + return node ; } + return null ; } /** * 寰楀埌鏈�鍚庝竴涓妭鐐癸紝浣嗕笉鎶婅妭鐐逛粠闃熷垪涓竻闄� @@ -157,14 +151,11 @@ */ @SuppressWarnings("unused") public Node getLastNode(){ - //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣 - synchronized(synObj) { - Node node = this.tail.pre; - if (node != this.head) { - return node; - } - return null; + Node node = this.tail.pre ; + if(node != this.head){ + return node ; } + return null ; } /** diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/TreadPoolFactory.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/TreadPoolFactory.java index cbdc7ba..040913d 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/TreadPoolFactory.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/TreadPoolFactory.java @@ -8,9 +8,9 @@ /** * 鍒濆鍖栫嚎绋嬫睜 - * @param poolName 绾跨▼姹犲拰绾跨▼鍚嶇О - * @param maxNum 绾跨▼姹犳渶澶х嚎绋嬫暟 锛岃嫢涓�-1锛屼笉鍙楅檺鍒� - * @param minNum 绾跨▼姹犳渶灏忕嚎绋嬫暟锛屾垨鍒濆绾跨▼鏁� + * @param threadPoolName 绾跨▼姹犲拰绾跨▼鍚嶇О + * @param maxThreadNum 绾跨▼姹犳渶澶х嚎绋嬫暟 锛岃嫢涓�-1锛屼笉鍙楅檺鍒� + * @param minThreadNum 绾跨▼姹犳渶灏忕嚎绋嬫暟锛屾垨鍒濆绾跨▼鏁� * @param freeTimeout 绌洪棽绾跨▼瓒呮椂鏃堕暱(绉�) * @param busyTimeout 蹇欑绾跨▼瓒呮椂鏃堕暱(绉�)锛岃嫢涓�-1锛屼笉鍙楅檺鍒� * @return 绾跨▼姹犲疄渚� @@ -30,9 +30,9 @@ /** * 鍒濆鍖栫嚎绋嬫睜 - * @param poolName 绾跨▼姹犲拰绾跨▼鍚嶇О - * @param maxNum 绾跨▼姹犳渶澶х嚎绋嬫暟锛岃嫢涓�-1锛屼笉鍙楅檺鍒� - * @param minNum 绾跨▼姹犳渶灏忕嚎绋嬫暟锛屾垨鍒濆绾跨▼鏁� + * @param threadPoolName 绾跨▼姹犲拰绾跨▼鍚嶇О + * @param maxThreadNum 绾跨▼姹犳渶澶х嚎绋嬫暟锛岃嫢涓�-1锛屼笉鍙楅檺鍒� + * @param minThreadNum 绾跨▼姹犳渶灏忕嚎绋嬫暟锛屾垨鍒濆绾跨▼鏁� * @param freeTimeout 绌洪棽绾跨▼瓒呮椂鏃堕暱(绉�) * @param busyTimeout 蹇欑绾跨▼瓒呮椂鏃堕暱(绉�)锛岃嫢涓�-1锛屼笉鍙楅檺鍒� * @return 绾跨▼姹犲疄渚� @@ -51,6 +51,8 @@ } /** * 寰楀埌鍞竴绾跨▼姹犲疄渚� + * @param dataSourceName + * @return * @throws Exception */ public final static ThreadPool.Pool getThreadPoolShort() @@ -62,6 +64,9 @@ } /** * 寰楀埌鍞竴绾跨▼姹犲疄渚� + * @param dataSourceName + * @return + * @throws Exception */ public final static ThreadPool.Pool getThreadPoolLong() throws Exception { diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/AsciiPic.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/AsciiPic.java index f1e4a93..53f71b7 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/AsciiPic.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/AsciiPic.java @@ -81,7 +81,6 @@ } } - /* public static void main(final String[] args) { try { AsciiPic.createAsciiPic(toBufferedImage(creatImage("DY.png"))); @@ -89,5 +88,4 @@ e.printStackTrace(); } } - */ } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java index 31a6248..7b06e4d 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/ByteUtil.java @@ -9,7 +9,7 @@ * 灏嗗瓧鑺傛暟缁勫悎骞跺埌瀛楄妭鏁扮粍涓� * @param bGroup1 琚悎骞舵暟缁� * @param bGroup2 鍚堝苟鏁扮粍 - * @return 杩斿洖 鍚堝苟鍚庢暟缁� + * @return 鍚堝苟鍚庢暟缁� */ public static byte[] bytesMerge(byte[] bGroup1, byte[] bGroup2){ if(bGroup1 == null && bGroup2 == null){ @@ -29,11 +29,11 @@ /** * 鍒ゆ柇鎵�鏈夊瓧鑺傛槸鍚︿负0xFF - * @param bs 瀛楄妭鏁扮粍 - * @param index 涓嬫爣浣� - * @param len 闀垮害 - * @return 杩斿洖 杩斿洖 - * @throws Exception 寮傚父 + * @param bs + * @param index + * @param len + * @return + * @throws Exception */ public static boolean bytesIsAll0xFF(byte[] bs, int index, int len)throws Exception { int count = 0 ; @@ -42,14 +42,14 @@ count++ ; } } - return count == len; + return count==len?true:false ; } - + /** * 浜岃繘鍒惰浆鍗佽繘鍒舵暟 * @param str - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static int binary2Int(String str) throws Exception { int cnt=0; @@ -69,13 +69,13 @@ return sum; } - + /** * 瀛楄妭杞瓨浜岃繘鍒� - * + * * @param b byte - * @throws Exception 寮傚父 - * @return 杩斿洖 String + * @throws Exception + * @return String */ public static String byte2Binary(byte b) throws Exception { int n = (b + 256) % 256 + 256; @@ -87,11 +87,11 @@ } /** * 瀛楄妭杞瓨8浣嶄簩杩涘埗 - * + * * @param b * byte - * @throws Exception 寮傚父 - * @return 杩斿洖 String + * @throws Exception + * @return String */ public static String byte2bit8Binary(byte b) throws Exception { String s = byte2Binary(b); @@ -101,13 +101,13 @@ } return s; } - + /** * 瀛楄妭鍙朾it * @param b - * @param b - * @throws Exception 寮傚父 - * @return 杩斿洖 String + * @param index + * @throws Exception + * @return String */ public static byte[] getBit(byte b) throws Exception { byte[] bs = new byte[8] ; @@ -125,9 +125,9 @@ /** * 瀛楄妭鍙朾it * @param b - * @param index 涓嬫爣浣� - * @throws Exception 寮傚父 - * @return 杩斿洖 String + * @param index + * @throws Exception + * @return String */ public static byte getBit(byte b, byte index) throws Exception { if(index == 0){ @@ -153,11 +153,11 @@ /** * 涓�涓瓧鑺傝浆姝f暣鏁� - * + * * @param b * byte - * @throws Exception 寮傚父 - * @return 杩斿洖 String + * @throws Exception + * @return String */ public static Short byte2PlusInt(byte b) throws Exception { short v = b ; @@ -167,13 +167,13 @@ return v ; } - + /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * double杞崲byte - * @param bs 瀛楄妭鏁扮粍 byte[] + * @param bs byte[] * @param value double double绫诲瀷鐨勫弬鏁� - * @param from 寮�濮嬩綅 int + * @param from int */ public static void double2Bytes_BE(byte[] bs, double value, int from)throws Exception { boolean b = isOutOfArrLength(bs.length, (from - 1) + 8); @@ -188,9 +188,9 @@ /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * double杞崲byte锛屽瓧鑺傞『搴忔槸鍊掔殑 - * @param bs 瀛楄妭鏁扮粍 byte[] + * @param bs byte[] * @param value double double绫诲瀷鐨勫弬鏁� - * @param from 寮�濮嬩綅 int + * @param from int */ public static void double2Bytes_LE(byte[] bs, double value, int from)throws Exception { boolean b = isOutOfArrLength(bs.length, (from - 1) + 8); @@ -205,8 +205,8 @@ /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * byte杞崲double - * @param bs 瀛楄妭鏁扮粍 byte[] - * @param from 寮�濮嬩綅 int + * @param bs byte[] + * @param from int */ public static double bytes2Double_BE(byte[] bs, int from) throws Exception { long l = bytes2Long_BE(bs, from); @@ -216,8 +216,8 @@ /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * byte杞崲double锛屽瓧鑺傞『搴忔槸鍊掔殑 - * @param bs 瀛楄妭鏁扮粍 byte[] - * @param from 寮�濮嬩綅 int + * @param bs byte[] + * @param from int */ public static double bytes2Double_LE(byte[] bs, int from) throws Exception { long l = bytes2Long_LE(bs, from); @@ -306,7 +306,7 @@ /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� - * 杞崲long鍨嬩负byte鏁扮粍 + * 杞崲long鍨嬩负byte鏁扮粍 * @value bs byte[] * @value value long * @value from int @@ -315,8 +315,8 @@ boolean b = isOutOfArrLength(bs.length, (from - 1) + 8); if (b) { for (int i = 0; i < 8; i++) { - bs[from + i] = Long.valueOf(value & 0xff).byteValue(); - value = value >> 8; + bs[from + i] = Long.valueOf(value & 0xff).byteValue(); + value = value >> 8; if(value == 0){ break ; } @@ -325,12 +325,12 @@ throw new Exception("long2Bytes鏃舵暟缁勮秺鐣�"); } } - + /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨� - * @param bs 瀛楄妭鏁扮粍 byte[] - * @return 杩斿洖 + * @param bs byte[] + * @return */ public static long bytes2Long_BE(byte[] bs) { int len = bs.length ; @@ -347,16 +347,16 @@ l = l | ls[i] ; } return l; - } + } return 0L ; } - + /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨� - * @param bs 瀛楄妭鏁扮粍 byte[] - * @param from 寮�濮嬩綅 int - * @return 杩斿洖 + * @param bs byte[] + * @param from int + * @return */ public static long bytes2Long_BE(byte[] bs, int from) throws Exception { boolean b = isOutOfArrLength(bs.length, (from - 1) + 8); @@ -388,10 +388,10 @@ /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨� - * @param bs 瀛楄妭鏁扮粍 byte[] - * @param from 寮�濮嬩綅 int + * @param bs byte[] + * @param from int * @param end int - * @return 杩斿洖 + * @return */ public static long bytes2Long_BE(byte[] bs, int from, int end) throws Exception { boolean b = isOutOfArrLength(bs.length, end); @@ -414,13 +414,13 @@ } } - - + + /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨� - * @param bs 瀛楄妭鏁扮粍 byte[] - * @return 杩斿洖 + * @param bs byte[] + * @return */ public static long bytes2Long_LE(byte[] bs) { int len = bs.length ; @@ -437,16 +437,16 @@ l = l | ls[i] ; } return l; - } + } return 0L ; } /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� - * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨� - * @param bs 瀛楄妭鏁扮粍 byte[] - * @param from 寮�濮嬩綅 int - * @return 杩斿洖 + * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨� + * @param bs byte[] + * @param from int + * @return */ public static long bytes2Long_LE(byte[] bs, int from) throws Exception { boolean b = isOutOfArrLength(bs.length, (from - 1) + 8); @@ -479,10 +479,10 @@ /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * 8浣嶅瓧鑺傛暟缁勮浆鎹负闀挎暣鍨� - * @param bs 瀛楄妭鏁扮粍 byte[] - * @param from 寮�濮嬩綅 int + * @param bs byte[] + * @param from int * @param end int - * @return 杩斿洖 + * @return */ public static long bytes2Long_LE(byte[] bs, int from, int end) throws Exception { boolean b = isOutOfArrLength(bs.length, end); @@ -551,9 +551,8 @@ /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 4浣嶅瓧鑺傛暟缁勮浆鎹负鏁村瀷 - * @param bs 瀛楄妭鏁扮粍 - * @param from 寮�濮嬩綅 - * @return 杩斿洖 + * @param b + * @return */ public static int bytes2Int_BE(byte[] bs, int from) throws Exception { boolean b = isOutOfArrLength(bs.length, (from - 1) + 4); @@ -574,13 +573,13 @@ throw new Exception("byte2Int鏃舵暟缁勮秺鐣�"); } } - + /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * 4浣嶅瓧鑺傛暟缁勮浆鎹负鏁村瀷锛屽瓧鑺傞『搴忔槸鍊掔殑 - * @param bs 瀛楄妭鏁扮粍 瀛楄妭鏁扮粍 - * @return 杩斿洖 + * @param b + * @return */ public static int bytes2Int_LE(byte[] bs, int from) throws Exception { boolean b = isOutOfArrLength(bs.length, (from - 1) + 4); @@ -601,7 +600,7 @@ throw new Exception("byte2Int鏃舵暟缁勮秺鐣�"); } } - + /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� @@ -675,14 +674,14 @@ /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 2浣嶅瓧鑺傛暟缁勮浆鎹负鐭暣鍨� - * @param bs 瀛楄妭鏁扮粍 瀛楄妭鏁扮粍 - * @return 杩斿洖 + * @param b + * @return */ public static short bytes2Short_BE(byte[] bs, int from) throws Exception { boolean b = isOutOfArrLength(bs.length, (from - 1) + 2); if (b) { int s = 0; - int s0 = bs[from + 0] ; + int s0 = bs[from + 0] ; int s1 = bs[from + 1] ; // s1涓嶅彉 @@ -698,14 +697,14 @@ /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * 2浣嶅瓧鑺傛暟缁勮浆鎹负鐭暣鍨嬶紝瀛楄妭椤哄簭鏄�掔殑 - * @param bs 瀛楄妭鏁扮粍 瀛楄妭鏁扮粍 - * @return 杩斿洖 + * @param b + * @return */ public static short bytes2Short_LE(byte[] bs, int from) throws Exception { boolean b = isOutOfArrLength(bs.length, (from - 1) + 2); if (b) { int s = 0; - int s0 = bs[from + 0] ; + int s0 = bs[from + 0] ; int s1 = bs[from + 1] ; // s0涓嶅彉 @@ -719,11 +718,11 @@ } /** * 瀛楃鍒颁竴瀛楄妭杞崲 - * + * * @value bs byte[] * @value ch char char绫诲瀷鐨勫弬鏁� * @value index int - * @return 杩斿洖 + * @return */ public static void char2Bytes(byte[] bs, char ch, int index)throws Exception { boolean b = isOutOfArrLength(bs.length, index); @@ -736,9 +735,10 @@ /** * 涓�瀛楄妭杞崲涓哄瓧绗� - * @param bs 瀛楄妭鏁扮粍 瀛楄妭鏁扮粍 + * + * @param b * @value index int - * @return 杩斿洖 + * @return */ public static char bytes2Char(byte[] bs, int index) throws Exception { boolean b = isOutOfArrLength(bs.length, index); @@ -751,13 +751,13 @@ /** * 瀛楃涓插瀷鏁板瓧杞垚byte - * + * * @param s - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static byte string2byte(String s) throws Exception { - int n ; + int n = 0; try { n = Integer.parseInt(s); } catch (Exception e) { @@ -772,7 +772,7 @@ * @value bs byte[] * @value str String * @value from int - * @return 杩斿洖 + * @return * @throws java.io.UnsupportedEncodingException */ public static int string2Bytes_BE(byte[] bs, String str, int from, int end)throws Exception { @@ -798,7 +798,7 @@ * @value bs byte[] * @value str String * @value from int - * @return 杩斿洖 + * @return * @throws java.io.UnsupportedEncodingException */ public static int string2Bytes_LE(byte[] bs, String str, int from, int end)throws Exception { @@ -824,7 +824,7 @@ * @value bs byte[] * @value str String * @value from int - * @return 杩斿洖 + * @return * @throws java.io.UnsupportedEncodingException */ public static int string2Bytes_BE(byte[] bs, String str, int from)throws Exception { @@ -846,7 +846,7 @@ * @value bs byte[] * @value str String * @value from int - * @return 杩斿洖 + * @return * @throws java.io.UnsupportedEncodingException */ public static int string2Bytes_LE(byte[] bs, String str, int from)throws Exception { @@ -898,10 +898,10 @@ /** * 鍒ゆ柇鏁扮粍涓嬫爣鏄惁瓒婄晫 - * + * * @value bsLength 鏁扮粍鎬婚暱搴� * @value toSite 鏁扮粍鍋忕Щ閲� - * @return 杩斿洖 + * @return */ private static boolean isOutOfArrLength(int bsLength, int toSite) { if (bsLength > toSite) { @@ -911,104 +911,104 @@ } } - + /** - * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓� - * - * @param src byte[] + * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓� + * + * @param b byte[] * @param hasBlank 16杩涘埗鏄惁鐢ㄧ┖鏍煎垎闅� - * @return 杩斿洖 String + * @return String */ - public static String bytes2Hex(byte[] src, boolean hasBlank){ - StringBuilder stringBuilder = new StringBuilder(""); - if (src == null || src.length <= 0) { - return null; - } - for (int i = 0; i < src.length; i++) { - int v = src[i] & 0xFF; - String str = Integer.toHexString(v); - if (str.length() < 2) { + public static String bytes2Hex(byte[] src, boolean hasBlank){ + StringBuilder stringBuilder = new StringBuilder(""); + if (src == null || src.length <= 0) { + return null; + } + for (int i = 0; i < src.length; i++) { + int v = src[i] & 0xFF; + String str = Integer.toHexString(v); + if (str.length() < 2) { str = "0" + str; - } + } if (hasBlank) { if (i == 0) { - stringBuilder.append(str); + stringBuilder.append(str); } else { - stringBuilder.append(" " + str); + stringBuilder.append(" " + str); } } else { - stringBuilder.append(str); + stringBuilder.append(str); } - } + } return stringBuilder.toString().toUpperCase(Locale.US); - } + } /** - * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓� - * - * @param src byte[] + * 瀛楄妭鏁扮粍杞崲鎴愬崄鍏繘鍒剁殑瀛楃涓� + * + * @param b byte[] * @param hasBlank 16杩涘埗鏄惁鐢ㄧ┖鏍煎垎闅� - * @param from 寮�濮嬩綅 - * @param len 闀垮害 - * @return 杩斿洖 String + * @param from + * @param len + * @return String */ - public static String bytes2Hex(byte[] src, boolean hasBlank, int from, int len){ - if (src == null || src.length <= 0 || src.length < from + len) { - return null; - } + public static String bytes2Hex(byte[] src, boolean hasBlank, int from, int len){ + if (src == null || src.length <= 0 || src.length < from + len) { + return null; + } byte[] bb = new byte[len]; for (int i = 0 ; i < len; i++) { bb[i] = src[from + i]; } return bytes2Hex(bb, hasBlank) ; - } - /** + } + /** * 鍗佸叚杩涘埗杞瓧鑺傛暟缁� - * @param hex the hex string - * @return 杩斿洖 byte[] - */ - public static byte[] hex2Bytes(String hex) { - if (hex == null || hex.equals("")) { - return null; - } - hex = hex.toUpperCase(Locale.ENGLISH); - int length = hex.length() / 2; - char[] hexChars = hex.toCharArray(); - byte[] d = new byte[length]; - for (int i = 0; i < length; i++) { - int pos = i * 2; - d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1])); - } - return d; - } - /** + * @param hexString the hex string + * @return byte[] + */ + public static byte[] hex2Bytes(String hex) { + if (hex == null || hex.equals("")) { + return null; + } + hex = hex.toUpperCase(Locale.ENGLISH); + int length = hex.length() / 2; + char[] hexChars = hex.toCharArray(); + byte[] d = new byte[length]; + for (int i = 0; i < length; i++) { + int pos = i * 2; + d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1])); + } + return d; + } + /** * 鍗佸叚杩涘埗杞瓧鑺傛暟缁� - * @param hex the hex string - * @return 杩斿洖 byte[] - */ - public static int hex2Bytes(String hex, byte[] bs, int fromIndex) { - if (hex == null || hex.equals("")) { - return fromIndex; - } - hex = hex.toUpperCase(Locale.ENGLISH); - int length = hex.length() / 2; - char[] hexChars = hex.toCharArray(); - byte[] d = new byte[length]; - for (int i = 0; i < length; i++) { - int pos = i * 2; - d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1])); + * @param hexString the hex string + * @return byte[] + */ + public static int hex2Bytes(String hex, byte[] bs, int fromIndex) { + if (hex == null || hex.equals("")) { + return fromIndex; + } + hex = hex.toUpperCase(Locale.ENGLISH); + int length = hex.length() / 2; + char[] hexChars = hex.toCharArray(); + byte[] d = new byte[length]; + for (int i = 0; i < length; i++) { + int pos = i * 2; + d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1])); } for(int i = 0 ; i < d.length; i++){ bs[fromIndex++] = d[i] ; } - return fromIndex ; - } + return fromIndex ; + } private static final char[] HEX_CHAR = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; /** * 灏哹yte[]杞崲涓�16杩涘埗瀛楃涓� * * @param bytes 寰呰浆鎹yte[] - * @return 杩斿洖 杞崲鍚庣殑瀛楃涓� + * @return 杞崲鍚庣殑瀛楃涓� */ public static String bytesToHex(byte[] bytes) { //涓�涓猙yte涓�8浣嶏紝鍙敤涓や釜鍗佸叚杩涘埗浣嶆爣璇� @@ -1027,40 +1027,12 @@ } return new String(buf); } - /** - * 灏哹yte[]杞崲涓�16杩涘埗瀛楃涓� - * - * @param bytes 寰呰浆鎹yte[] - * @return 杩斿洖 杞崲鍚庣殑瀛楃涓� - */ - public static String bytesToHex(byte[] bytes, int startIndex, int endIndex) { - byte[] bs = new byte[endIndex - startIndex + 1] ; - byte j = 0 ; - for(int i = startIndex; i <= endIndex; i++){ - bs[j++] = bytes[i] ; - } - //涓�涓猙yte涓�8浣嶏紝鍙敤涓や釜鍗佸叚杩涘埗浣嶆爣璇� - char[] buf = new char[bs.length * 2]; - int a = 0; - int index = 0; - for (byte b : bs) { // 浣跨敤闄や笌鍙栦綑杩涜杞崲 - if (b < 0) { - a = 256 + b; - } else { - a = b; - } - - buf[index++] = HEX_CHAR[a / 16]; - buf[index++] = HEX_CHAR[a % 16]; - } - return new String(buf); - } /** * 灏�16杩涘埗瀛楃涓茶浆鎹负byte[] * * @param str 寰呰浆鎹㈠瓧绗︿覆 - * @return 杩斿洖 杞崲鍚庣殑byte[] + * @return 杞崲鍚庣殑byte[] */ public static byte[] hexToBytes(String str) { if (str == null || "".equals(str.trim())) { @@ -1079,18 +1051,18 @@ /** * Convert char to byte * @param c char - * @return 杩斿洖 byte + * @return byte */ private static byte charToByte(char c) { return (byte) "0123456789ABCDEF".indexOf(c); - } - + } + /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 鏁村舰杞垚BCD缂栫爜 - * @param i - * @return 杩斿洖 + * @param l + * @return */ public static byte[] int2BCD_BE(int i)throws Exception { String str = "" + i; @@ -1107,8 +1079,8 @@ /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * 鏁村舰杞垚BCD缂栫爜锛屽瓧鑺傞『搴忔槸鍊掔殑 - * @param i - * @return 杩斿洖 + * @param l + * @return */ public static byte[] int2BCD_LE(int i)throws Exception { String str = "" + i; @@ -1127,7 +1099,7 @@ * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 闀挎暣褰㈣浆鎴怋CD缂栫爜 * @param l - * @return 杩斿洖 + * @return */ public static byte[] long2BCD_BE(long l)throws Exception { String str = "" + l; @@ -1146,7 +1118,7 @@ * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * 闀挎暣褰㈣浆鎴怋CD缂栫爜锛屽瓧鑺傞『搴忔槸鍊掔殑 * @param l - * @return 杩斿洖 + * @return */ public static byte[] long2BCD_LE(long l) throws Exception { String str = "" + l; @@ -1165,30 +1137,30 @@ * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 瀛楃涓插瀷鏁板瓧杞垚BCD缂栫爜 * @param s - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static byte[] string2BCD_BE(String s) throws Exception { - byte[] b ; + byte[] b = null; if (s.length() % 2 == 0) { b = new byte[s.length() / 2]; } else { b = new byte[(s.length() / 2) + 1]; } - + encodeBCD_BE(s, b, 0, b.length); return b ; } - + /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 瀛楃涓茶浆鎹㈡垚byte鏁扮粍 * @value bs byte[] * @value str String * @value fromIndex int - * @return 杩斿洖 - * @throws Exception 寮傚父 寮傚父 + * @return + * @throws java.io.Exception */ public static int string2BCD_BE(byte[] bs, String str, int fromIndex)throws Exception { byte[] bb = string2BCD_BE(str); @@ -1207,8 +1179,8 @@ * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * 瀛楃涓插瀷鏁板瓧杞垚BCD缂栫爜锛屽瓧鑺傞『搴忔槸鍊掔殑 * @param s - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static byte[] string2BCD_LE(String s) throws Exception { byte[] b = null; @@ -1221,15 +1193,15 @@ return b; } - + /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * 瀛楃涓茶浆鎹㈡垚byte鏁扮粍 * @value bs byte[] * @value str String * @value fromIndex int - * @return 杩斿洖 - * @throws Exception 寮傚父 寮傚父 + * @return + * @throws java.io.Exception */ public static int string2BCD_LE(byte[] bs, String str, int fromIndex)throws Exception { byte[] bb = string2BCD_LE(str); @@ -1249,8 +1221,10 @@ * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� * BCD缂栫爜杞垚鏁村瀷 * @param b - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @param startIndex + * @param endIndex + * @return + * @throws Exception */ public static int BCD2Int_BE(byte b) throws Exception { String str = ""; @@ -1263,8 +1237,10 @@ * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� * BCD缂栫爜杞垚鏁村瀷锛屽瓧鑺傞『搴忔槸鍊掔殑 * @param b - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @param startIndex + * @param endIndex + * @return + * @throws Exception */ public static int BCD2Int_LE(byte b) throws Exception { String str = ""; @@ -1279,8 +1255,8 @@ * @param b * @param startIndex * @param endIndex - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static int BCD2Int_BE(byte[] b, int startIndex, int endIndex)throws Exception { String str = ""; @@ -1295,8 +1271,8 @@ * @param b * @param startIndex * @param endIndex - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static int BCD2Int_LE(byte[] b, int startIndex, int endIndex)throws Exception { String str = ""; @@ -1311,8 +1287,8 @@ * @param b * @param startIndex * @param endIndex - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static long BCD2Long_BE(byte[] b, int startIndex, int endIndex)throws Exception { String str = ""; @@ -1328,8 +1304,8 @@ * @param b * @param startIndex * @param endIndex - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static long BCD2Long_LE(byte[] b, int startIndex, int endIndex)throws Exception { String str = ""; @@ -1344,8 +1320,8 @@ * @param b * @param startIndex * @param endIndex - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static String BCD2String_BE(byte[] b, int startIndex, int endIndex) throws Exception { return decodeBCD_BE(b, startIndex, endIndex - startIndex + 1); @@ -1357,8 +1333,8 @@ * @param b * @param startIndex * @param endIndex - * @return 杩斿洖 - * @throws Exception 寮傚父 + * @return + * @throws Exception */ public static String BCD2String_LE(byte[] b, int startIndex, int endIndex) throws Exception { return decodeBCD_LE(b, startIndex, endIndex - startIndex + 1); @@ -1366,17 +1342,17 @@ /** * 澶х妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍楂樺瓧鑺傘�� - * 缂栫爜BCD锛屼緥濡�1387缂栫爜鎴� 13 87锛岄『搴忔槸姝g殑 + * 缂栫爜BCD锛屼緥濡�1387缂栫爜鎴� 13 87锛岄『搴忔槸姝g殑 * @param value * @param dest * @param startIndex - * @param length 闀垮害 + * @param length */ private static void encodeBCD_BE(String value, byte[] dest, int startIndex, int length)throws Exception { if (value == null || !value.matches("\\d*")) { throw new Exception("鏁板瓧杞垚BCD缂栫爜鏃跺嚭閿欙紝涓嶆槸鍚堟硶鏁板瓧:" + value, null); } - + int[] tmpInts = new int[2 * length]; int index = value.length() - 1; for (int i = tmpInts.length - 1; i >= 0 && index >= 0; i--, index--) { @@ -1386,20 +1362,20 @@ dest[i] = (byte) (tmpInts[2 * j] * 16 + tmpInts[2 * j + 1]); } } - + /** * 灏忕妯″紡銆婃暟鎹綆浣嶅湪鏁扮粍浣庡瓧鑺傘�� - * 缂栫爜BCD锛屼緥濡�1387缂栫爜鎴� 87 13锛岄『搴忔槸鍊掔殑 + * 缂栫爜BCD锛屼緥濡�1387缂栫爜鎴� 87 13锛岄『搴忔槸鍊掔殑 * @param value * @param dest * @param startIndex - * @param length 闀垮害 + * @param length */ private static void encodeBCD_LE(String value, byte[] dest, int startIndex, int length)throws Exception { if (value == null || !value.matches("\\d*")) { throw new Exception("鏁板瓧杞垚BCD缂栫爜鏃跺嚭閿欙紝涓嶆槸鍚堟硶鏁板瓧:" + value, null); } - + int[] tmpInts = new int[2 * length]; int index = value.length() - 1; for (int i = 0; i <= tmpInts.length - 1 && index >= 0; i++, index--) { @@ -1417,8 +1393,8 @@ * 瑙g爜BCD锛岄『搴忔槸姝g殑 * @param src * @param startIndex - * @param length 闀垮害 - * @return 杩斿洖 + * @param length + * @return */ private static String decodeBCD_BE(byte[] src, int startIndex, int length)throws Exception { StringBuilder sb = new StringBuilder(); @@ -1439,8 +1415,8 @@ * 缂栫爜BCD锛岄『搴忔槸鍊掔殑 * @param src * @param startIndex - * @param length 闀垮害 - * @return 杩斿洖 + * @param length + * @return */ private static String decodeBCD_LE(byte[] src, int startIndex, int length)throws Exception { StringBuilder sb = new StringBuilder(); @@ -1486,7 +1462,6 @@ // System.out.println(v5); // // } - /* public static void main(String[] args) throws Exception { byte[] bs = new byte[]{0x38, 0x36, 0x39, 0x31} ; String s = bytes2String_BE(bs, 0, 3) ; @@ -1500,6 +1475,5 @@ } System.out.println(v); } - */ } diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java index 158a591..1e04eeb 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/util/DateTime.java @@ -1619,7 +1619,7 @@ } - /* + public static void main(String[] args){ Long now = getTime() ; System.out.println(now); @@ -1631,6 +1631,6 @@ String s = yyyy_MM_dd_HH_mm_ss(dt); System.out.println(s); } - */ + } diff --git a/pipIrr-platform/pipIrr-global/pom.xml b/pipIrr-platform/pipIrr-global/pom.xml index 1131ab6..1bc1879 100644 --- a/pipIrr-platform/pipIrr-global/pom.xml +++ b/pipIrr-platform/pipIrr-global/pom.xml @@ -21,19 +21,23 @@ <groupId>com.dy</groupId> <artifactId>pipIrr-common</artifactId> <version>1.0.0</version> - <scope>provided</scope> - <!-- optional=true锛屼笉浼犻�掍緷璧栵紝鍗硃ipIrr-web-base渚濊禆pipIrr-global锛屼絾涓嶄細浼犻�掍緷璧栧埌pipIrr-common --> - <optional>true</optional> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + <version>3.1.3</version> <exclusions> <exclusion> - <!-- 鎺掗櫎鎺塸ipIrr-common鐨勬墍鏈変緷璧栵紝鏈ā鍧楄嚜宸卞畾涔変緷璧� --> - <groupId>*</groupId> - <artifactId>*</artifactId> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-json</artifactId> + </exclusion> + <exclusion> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> </dependency> - - <!-- 杈撳叆鍙傛暟鎹獙璇� --> <dependency> <groupId>org.springframework.boot</groupId> @@ -49,19 +53,47 @@ <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-devtools</artifactId> + <version>3.1.3</version> + <scope>runtime</scope> + </dependency> <!-- lombok --> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.28</version> </dependency> - + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>1.9.20</version> + </dependency> + <!--log4j2鏃ュ織--> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-log4j2</artifactId> + <version>2.7.9</version> + </dependency> + <!-- 鐢ㄤ簬杈ㄨlog4j2.yml鏂囦欢 --> + <dependency> + <groupId>com.fasterxml.jackson.dataformat</groupId> + <artifactId>jackson-dataformat-yaml</artifactId> + <version>2.15.2</version> + </dependency> + <!--mybatis-plus-spring-boot--> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.5.3.2</version> </dependency> <!-- 闃块噷fastjson --> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + <version>3.3.0</version> + </dependency> <dependency> <groupId>com.alibaba.fastjson2</groupId> <artifactId>fastjson2</artifactId> @@ -86,81 +118,27 @@ <version>1.5.5.Final</version> <scope>compile</scope> </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </dependency> </dependencies> - <build> <plugins> <plugin> - <!-- 璇ユ彃浠朵笉浼氬皢椤圭洰涓紩鍏ョ殑渚濊禆鎵撹繘鏈�缁堢殑 Jar 鏂囦欢 --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> + <!-- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 --> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> <configuration> - <archive> - <!-- 鐢熸垚鐨刯ar涓紝涓嶈鍖呭惈pom.xml鍜宲om.properties杩欎袱涓枃浠� --> - <addMavenDescriptor>false</addMavenDescriptor> - <!-- 杩欓儴鍒嗗彲鏈夊彲鏃�,鍔犱笂鐨勮瘽鍒欑洿鎺ョ敓鎴愬彲杩愯jar鍖� - <manifest> - <mainClass>com.dy.Main</mainClass> - <useUniqueVersions>false</useUniqueVersions> - <addClasspath>true</addClasspath> - <classpathPrefix>lib/</classpathPrefix> - </manifest> - --> - <!-- manifestEntries鐨勪綔鐢ㄦ槸鎸囧畾鏈湴锛堣嚜宸变笅杞界殑lib涓嬬殑锛塲ar鍖呮坊鍔犲埌MANIFEST.MF鏂囦欢涓幓 - <manifestEntries> - <Class-Path>.lib/alipay-sdk.java.jar</Class-Path> - </manifestEntries> - --> - </archive> - <!-- 鎺掗櫎鏌愪釜鏂囦欢 <excludes> - <exclude>com/dy/App.class</exclude> + <exclude> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </exclude> </excludes> - --> - <!-- 鍙墽琛宩ar杩涜鍛藉悕銆傝繖鏍蜂細鎵撳寘鎴愪袱涓猨ar鍖咃紝涓嶄細瀵规櫘閫歫ar閲嶆柊鍛藉悕銆� - <classifier>exec</classifier> - --> </configuration> </plugin> - <plugin> - <!-- 褰撻」鐩腑渚濊禆姣旇緝澶氭椂锛屾垜浠彲浠ュ�熷姪 maven-dependency-plugin 鎻掍欢鑷姩甯垜浠笅杞戒緷璧栫殑 Jar 鏂囦欢锛屾帹鑽愬皢璇ユ彃浠剁粦瀹氬埌package鐢熷懡鍛ㄦ湡涓� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <!-- 缁戝畾鐢熷懡鍛ㄦ湡 --> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <!-- 璁剧疆渚濊禆鐨勫瓨鏀捐矾寰� --> - <configuration> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <!-- 璁剧疆java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <!-- source锛� 婧愪唬鐮佺紪璇戠増鏈紱target锛� 鐩爣骞冲彴缂栬瘧鐗堟湰锛沞ncoding锛� 瀛楃闆嗙紪鐮併�� --> - <configuration> - <source>${java.version}</source> - <target>${java.version}</target> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- 瑙e喅璧勬簮鏂囦欢鐨勭紪鐮侀棶棰� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <configuration> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 --> <groupId>org.apache.maven.plugins</groupId> @@ -169,7 +147,11 @@ <skipTests>true</skipTests> </configuration> </plugin> - + <plugin> + <!-- 寮哄埗璁惧畾 java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> </plugins> </build> </project> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaClient.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaClient.java index 8650633..af0402b 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaClient.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaClient.java @@ -95,7 +95,7 @@ * 缂栧彿 */ @Schema(description = "鍐滄埛缂栧彿(绯荤粺鑷姩鐢熸垚)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String num ; + public Integer num; /** * 鎵嬫満鍙� diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDistrict.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDistrict.java index 083d580..d88ab02 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDistrict.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDistrict.java @@ -55,9 +55,9 @@ /** * 琛屾斂鍖虹紪鍙� */ - @Schema(description = "琛屾斂鍖虹紪鍙�(鐪佸競鍘�2浣嶏紝闀囨潙3浣�)", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "琛屾斂鍖虹紪鍙�", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "琛屾斂鍖虹紪鍙蜂笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null - @Max(message = "琛屾斂鍖虹紪鍙蜂笉澶т簬99", value = 999) + @Max(message = "琛屾斂鍖虹紪鍙蜂笉澶т簬99", value = 99) @Min(message = "琛屾斂鍖虹紪鍙蜂笉灏忎簬0",value = 0) public String num; diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDivide.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDivide.java index 50685b6..6d3deed 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDivide.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaDivide.java @@ -9,6 +9,7 @@ import com.dy.common.po.BaseEntity; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import lombok.*; import org.hibernate.validator.constraints.Length; @@ -36,7 +37,7 @@ */ @JSONField(serializeUsing= ObjectWriterImplToString.class) @Schema(description = "鎵�鍦ㄥ幙ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "鎵�鍦ㄥ幙涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @NotNull(message = "鎵�鍦ㄥ幙涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null public Long countyId; /** @@ -44,7 +45,7 @@ */ @JSONField(serializeUsing= ObjectWriterImplToString.class) @Schema(description = "鎵�鍦ㄩ晣ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "鎵�鍦ㄩ晣涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @NotNull(message = "鎵�鍦ㄩ晣涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null public Long townId; /** @@ -52,7 +53,7 @@ */ @JSONField(serializeUsing= ObjectWriterImplToString.class) @Schema(description = "鎵�鍦ㄦ潙ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "鎵�鍦ㄦ潙涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @NotNull(message = "鎵�鍦ㄦ潙涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null public Long villageId; /** @@ -60,7 +61,7 @@ */ @JSONField(serializeUsing= ObjectWriterImplToString.class) @Schema(description = "鎵�鍦ㄧ墖鍖篒D", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "鎵�鍦ㄧ墖鍖轰笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @NotNull(message = "鎵�鍦ㄧ墖鍖轰笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null public Long blockId; /** diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaIntake.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaIntake.java new file mode 100644 index 0000000..a7d833b --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaIntake.java @@ -0,0 +1,122 @@ +package com.dy.pipIrrGlobal.pojoBa; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dy.common.po.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.*; +import org.hibernate.validator.constraints.Length; + +/** + * 鍙栨按鍙e疄浣� + */ +@TableName(value = "ba_intake", autoResultMap = true) +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "鍙栨按鍙e疄浣�") +public class BaIntake implements BaseEntity { + + public static final long serialVersionUID = 202312010953001L; + + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + @Schema(description = "瀹炰綋id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Long id; + + /** + * 鍙栨按鍙e悕绉版垨缂栧彿 + */ + @Schema(description = "鍙栨按鍙e悕绉版垨缂栧彿", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鍙栨按鍙e悕绉版垨缂栧彿涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍙栨按鍙e悕绉版垨缂栧彿涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String name; + + /** + * 澶栭敭锛屾寚鍚戠墖鍖� + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄧ墖鍖篒D", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄧ墖鍖轰笉鑳戒负绌�") //涓嶈兘涓簄ull + public Long blockId; + + /** + * 澶栭敭锛屾寚鍚戝垎姘村彛 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄥ垎姘村彛ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄥ垎姘村彛涓嶈兘涓虹┖") //涓嶈兘涓簄ull + public Long divideId; + + /** + * 璐熻矗浜� + */ + @Schema(description = "璐熻矗浜�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "璐熻矗浜轰笉澶т簬{max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String header; + + /** + * 鑱旂郴鐢佃瘽 + */ + @Schema(description = "鑱旂郴鐢佃瘽", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鑱旂郴鐢佃瘽涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鑱旂郴鐢佃瘽蹇呴』{max}浣嶆暟鎹�", min = 11, max = 11) + public String phone; + + /** + * 澶栭敭锛屾寚鍚戣鏀垮尯 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄥ幙ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄥ幙涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public Long countyId; + + /** + * 澶栭敭锛屾寚鍚戣鏀垮尯 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄩ晣ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄩ晣涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public Long townId; + + /** + * 澶栭敭锛屾寚鍚戣鏀垮尯 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄦ潙ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄦ潙涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + public Long villageId; + + /** + * 缁忓害 + */ + @Schema(description = "缁忓害", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lng; + + /** + * 绾害 + */ + @Schema(description = "绾害", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Double lat; + + /** + * 澶囨敞 + */ + @Schema(description = "澶囨敞", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "澶囨敞涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 50) + public String remark; + + /** + * 鍒犻櫎鏍囧織 + */ + @Schema(description = "鍒犻櫎鏍囪瘑锛岃〃鍗曚笉鐢ㄥ~鍐�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Byte deleted; + +} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRTU.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRTU.java new file mode 100644 index 0000000..0f4841a --- /dev/null +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaRTU.java @@ -0,0 +1,109 @@ +package com.dy.pipIrrGlobal.pojoBa; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.dy.common.po.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import lombok.*; +import org.hibernate.validator.constraints.Length; + +/** + * 鎺у埗鍣ㄥ疄浣擄紝RTU闃�鎺т竴浣撴満 + */ +@TableName(value = "ba_intake", autoResultMap = true) +@Data +@Builder +@ToString +@NoArgsConstructor +@AllArgsConstructor +@Schema(name = "RTU闃�鎺т竴浣撴満瀹炰綋") +public class BaRTU implements BaseEntity { + + public static final long serialVersionUID = 202312011021001L; + + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @TableId(type = IdType.INPUT) + @Schema(description = "瀹炰綋id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Long id; + + /** + * 鎺у埗鍣ㄧ紪鍙� + */ + @Schema(description = "鎺у埗鍣ㄧ紪鍙�", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鎺у埗鍣ㄧ紪鍙蜂笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鎺у埗鍣ㄧ紪鍙蜂笉澶т簬{max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String num; + + /** + * 澶栭敭锛屾寚鍚戝彇姘村彛 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�鍦ㄥ彇姘村彛ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�鍦ㄥ彇姘村彛涓嶈兘涓虹┖") //涓嶈兘涓簄ull + public Long intakeId; + + /** + * 澶栭敭锛屾寚鍚戝啘鎴凤紙鐢ㄦ按鎴凤級 + */ + @JSONField(serializeUsing = ObjectWriterImplToString.class) + @Schema(description = "鎵�灞炲啘鎴稩D", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "鎵�灞炲啘鎴蜂笉鑳戒负绌�") //涓嶈兘涓簄ull + public Long clientId; + + /** + * 璐熻矗浜� + */ + @Schema(description = "璐熻矗浜�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "璐熻矗浜轰笉澶т簬{max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String header; + + /** + * 鑱旂郴鐢佃瘽 + */ + @Schema(description = "鑱旂郴鐢佃瘽", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "鑱旂郴鐢佃瘽涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鑱旂郴鐢佃瘽蹇呴』{max}浣嶆暟鎹�", min = 11, max = 11) + public String phone; + + /** + * 寮�鍏抽榾 + */ + @Schema(description = "寮�鍏抽榾", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "0鍏抽榾锛�1寮�闃�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鑱旂郴鐢佃瘽蹇呴』{max}浣嶆暟鎹�", min = 1, max = 1) + public Byte isOpen; + + /** + * 鎺у埗鍣ㄥ悕绉� + */ + @Schema(description = "鎺у埗鍣ㄥ悕绉�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @NotEmpty(message = "鎺у埗鍣ㄥ悕绉伴潪蹇呭~") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鎺у埗鍣ㄥ悕绉颁笉澶т簬{max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String name; + + /** + * 鍘傚鍚嶇О + */ + @Schema(description = "鍘傚鍚嶇О", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @NotEmpty(message = "鍘傚鍚嶇О闈炲繀濉�") //涓嶈兘涓虹┖涔熶笉鑳戒负null + @Length(message = "鍘傚鍚嶇О涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 25) + public String manufacturer; + + /** + * 澶囨敞 + */ + @Schema(description = "澶囨敞", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @Length(message = "澶囨敞涓嶅ぇ浜巤max}瀛楋紝涓嶅皬浜巤min}瀛�", min = 1, max = 50) + public String remark; + + /** + * 鍒犻櫎鏍囧織 + */ + @Schema(description = "鍒犻櫎鏍囪瘑锛岃〃鍗曚笉鐢ㄥ~鍐�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public Byte deleted; +} diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java index 561b660..bb7bf2a 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoBa/BaUser.java @@ -2,13 +2,14 @@ import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.writer.ObjectWriterImplToString; -import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.dy.common.mybatis.envm.Deleted; import com.dy.common.mybatis.envm.Disabled; import com.dy.common.po.BaseEntity; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; import jakarta.validation.constraints.NotEmpty; import lombok.*; import org.hibernate.validator.constraints.Length; @@ -94,8 +95,6 @@ * 鏄惁绂佺敤 0:鍚�,1:鏄� */ @Schema(description = "鏄惁绂佺敤", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @Max(message = "鏄惁绂佺敤鍙兘0鎴�1", value = 1) - @Min(message = "鏄惁绂佺敤鍙兘0鎴�1",value = 0) public Disabled disabled; /** @@ -117,4 +116,10 @@ @TableField(exist = false) public List<Integer> privileges; //public transient List<Integer> privileges;//姝ょ鏂瑰紡鍙橀噺涓嶅瓨搴擄紝 涔熶笉鍙備笌搴忓垪鍖栦簡 + + /** + * 鐢ㄦ埛鎵�灞炶鑹睮d + */ + @TableField(exist = false) + public String[] roleIds ; } \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java index 29a674b..4e210ff 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/DistrictLevel.java @@ -15,7 +15,6 @@ */ public enum DistrictLevel implements IEnum { - Province((byte)0, "鐪�"), City((byte)1, "甯�"), County((byte)2, "鍘�"), Town((byte)3, "闀�"), @@ -53,9 +52,7 @@ } public static DistrictLevel get(Byte code){ - if(code.byteValue() == Province.code.byteValue()){ - return Province ; - }if(code.byteValue() == City.code.byteValue()){ + if(code.byteValue() == City.code.byteValue()){ return City ; }else if(code.byteValue() == County.code.byteValue()){ return County ; diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml b/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml index 72b6ac0..d189a60 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/application-global.yml @@ -77,7 +77,7 @@ commandCallback: http://127.0.0.1:8079/remote/rtu/comCallback webPort: 8070 actutorPort: 9070 - idSuffix: 0 #姝ゅ鍙槸鍗犱綅锛屽叿浣撹缃湪閫氫俊涓棿浠剁殑config.xml涓缃� + idSuffix: 0 sso: checkUrl: http://127.0.0.1:8079/sso/sso/ssoCheck webPort: 8079 diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml b/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml index 0eaec32..6259b52 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/init-config.xml @@ -4,12 +4,9 @@ <!-- 澶氫釜缁勭粐锛岀敤缂栧彿鍖哄垎锛岀紪鍙蜂粠1寮�濮� --> <org1 name="ym"> <districts> - <!-- 鐪佺骇琛屾斂鍖哄湪涓氬姟闇�姹備腑娌℃湁浣撶幇锛屽彧鍦ㄧ帇姹熸捣IC鍗¤璁′腑鐢ㄥ埌锛屾墍浠ヨ繖閲屾妸鍏秎evel璁剧疆涓�0 --> - <province name="浜戝崡鐪�" num="53" level="0"> - <city name="妤氶泟褰濇棌鑷不宸�" num="23" level="1"> - <country name="鍏冭皨鍘�" num="28" level="2" /> - </city> - </province> + <city name="妤氶泟褰濇棌鑷不宸�" num="23" level="1"> + <country name="鍏冭皨鍘�" num="28" level="2" /> + </city> </districts> <user name="瓒呯骇绠$悊鍛�" phone="admin" password="admin" supperAdmin="1" /> </org1> diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml index bb53f2c..6be18b6 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml @@ -12,7 +12,7 @@ <result column="divideId" jdbcType="BIGINT" property="divideId" /> <result column="typeId" jdbcType="BIGINT" property="typeId" /> <result column="name" jdbcType="VARCHAR" property="name" /> - <result column="num" jdbcType="VARCHAR" property="num" /> + <result column="num" jdbcType="INTEGER" property="num" /> <result column="phone" jdbcType="VARCHAR" property="phone" /> <result column="idCard" jdbcType="VARCHAR" property="idcard" /> <result column="area" jdbcType="FLOAT" property="area" /> @@ -29,9 +29,8 @@ </sql> <sql id="part_Column_List"> <!--@mbg.generated--> - ${alias}.id, ${alias}.countyId, ${alias}.townId, ${alias}.villageId, ${alias}.blockId, ${alias}.divideId, ${alias}.typeId, - ${alias}.`name`, ${alias}.num, ${alias}.phone, ${alias}.idCard, ${alias}.area, ${alias}.district,${alias}.address, - ${alias}.remark, ${alias}.disabled + ${alias}.id, ${alias}.countyId, ${alias}.townId, ${alias}.villageId, ${alias}.blockId, ${alias}.divideId, ${alias}.typeId, ${alias}.name, ${alias}.num, ${alias}.phone, ${alias}.idCard, ${alias}.area, ${alias}.district,${alias}.address, ${alias}.remark, + ${alias}.disabled </sql> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> @@ -130,7 +129,7 @@ values (#{id,jdbcType=BIGINT}, #{countyId,jdbcType=BIGINT}, #{townId,jdbcType=BIGINT}, #{villageId,jdbcType=BIGINT}, #{blockId,jdbcType=BIGINT}, #{divideId,jdbcType=BIGINT}, #{typeId,jdbcType=BIGINT}, - #{name,jdbcType=VARCHAR}, #{num,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, #{phone,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR}, #{area,jdbcType=FLOAT}, #{district,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR}, @@ -220,7 +219,7 @@ #{name,jdbcType=VARCHAR}, </if> <if test="num != null"> - #{num,jdbcType=VARCHAR}, + #{num,jdbcType=INTEGER}, </if> <if test="phone != null"> #{phone,jdbcType=VARCHAR}, @@ -273,7 +272,7 @@ 'name' = #{name,jdbcType=VARCHAR}, </if> <if test="num != null"> - num = #{num,jdbcType=VARCHAR}, + num = #{num,jdbcType=INTEGER}, </if> <if test="phone != null"> phone = #{phone,jdbcType=VARCHAR}, @@ -313,7 +312,7 @@ blockId = #{blockId,jdbcType=BIGINT}, typeId = #{typeId,jdbcType=BIGINT}, `name` = #{name,jdbcType=VARCHAR}, - num = #{num,jdbcType=VARCHAR}, + num = #{num,jdbcType=INTEGER}, phone = #{phone,jdbcType=VARCHAR}, idcard = #{idcard,jdbcType=VARCHAR}, area = #{area,jdbcType=FLOAT}, diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/PipIrrMwAcceptApplication.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/PipIrrMwAcceptApplication.java index 4b4ec0c..e0b836f 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/PipIrrMwAcceptApplication.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/PipIrrMwAcceptApplication.java @@ -6,6 +6,7 @@ import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.EnableAspectJAutoProxy; diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/ServerProperties.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/ServerProperties.java index 670ef33..84a9a42 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/ServerProperties.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/ServerProperties.java @@ -25,12 +25,6 @@ public static Long lastUpDataTimeLive = 1000L ; //鏁版嵁搴撴暟鎹甶d鐢熸垚鍣ㄧ殑id鍚庣紑锛�0鏄粯璁ょ殑鍚庣紑锛屼竴鑸瑆eb绯荤粺搴旂敤锛屾暟鎹腑闂翠欢id鍚庣紑澶т簬绛変簬1 - public static Integer dbDataIdSuffix = 1 ; - - //涓婁笅琛屾暟鎹紦瀛橀槦鍒椾腑缂撳瓨鏁版嵁涓暟鐨勬姤璀﹂噺锛岃繖涓笌瀹炰綋椤圭洰鎵�鎺ユ按琛ㄦ暟鐩稿叧 - public static Integer cacheUpDownDataWarnCount = 1000000 ; - - //涓婁笅琛屾暟鎹紦瀛橀槦鍒椾腑缂撳瓨鏁版嵁涓暟鐨勬渶澶у�硷紝杩欎釜涓庡疄浣撻」鐩墍鎺ユ按琛ㄦ暟鐩稿叧 - public static Integer cacheUpDownDataMaxCount = 1100000 ; + public static Integer dbDataIdSuffix = 1 ; } diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/MidResultActionToRtu.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/MidResultActionToRtu.java index e8d0d3c..33e2417 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/MidResultActionToRtu.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/MidResultActionToRtu.java @@ -15,7 +15,7 @@ if(result != null && result instanceof MidResultToRtu){ try { MidResultToRtu resToRtu = (MidResultToRtu)result ; - TcpDownCommandCache.cacheCommand(resToRtu); + TcpDownCommandCach.cachCommand(resToRtu); log.info("涓嬭鍛戒护(toRtu)" + resToRtu.downCode + "涓棿缁撴灉宸茬粡鏀惧叆涓嬭鍛戒护缂撳瓨涓�"); } catch (Exception e) { log.error(e); diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCache.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCache.java deleted file mode 100644 index 7a0cf8b..0000000 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandCache.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.dy.aceMw.server.forTcp; - - -import com.dy.common.queue.Node; -import com.dy.common.queue.Queue; -import com.dy.common.mw.protocol.MidResultFromRtu; -import com.dy.common.mw.protocol.MidResultToRtu; -import com.dy.aceMw.server.ServerProperties; - -/** - * 闈炵嚎绋嬪畨鍏ㄧ殑锛屽彧鑳藉湪鍗曠嚎绋嬩腑杩愯 - */ -public class TcpDownCommandCache { - - //TCP涓嬭鍛戒护缂撳瓨闃熷垪 - private static Queue cacheQueue = new Queue("tcpDownCommandQueue") ; - - private static TcpDownCommandCache instance = new TcpDownCommandCache() ; - - private TcpDownCommandCache(){ - cacheQueue.setLimit(ServerProperties.cacheUpDownDataWarnCount, ServerProperties.cacheUpDownDataMaxCount); - } - - public static TcpDownCommandCache getInstance(){ - return instance ; - } - - /** - * 缂撳瓨鍛戒护 - * @param result - * @throws Exception - */ - public static void cacheCommand(MidResultToRtu result) throws Exception{ - if(result != null){ - if(result.maxSendTimes == null){ - //璁剧疆鏈�澶у彂閫佹鏁� - result.maxSendTimes = ServerProperties.downComandMaxResendTimes ; - } - if(result.isSendFirst){ - cacheQueue.pushHead(new TcpDownCommandObj(result)); - }else{ - cacheQueue.pushTail(new TcpDownCommandObj(result)); - } - } - } - - /** - * 鍖归厤鍛戒护缁撴灉 - * @param rsFromRtu - * @return - */ - public static MidResultToRtu matchFromHead(MidResultFromRtu rsFromRtu){ - MidResultToRtu res = null ; - TcpDownCommandObj obj = null ; - Node node = cacheQueue.getFirstNode() ; - while(node != null && node.obj != null){ - obj = (TcpDownCommandObj)node.obj; - res = obj.result ; - if(res != null - && res.rtuAddr.equals(rsFromRtu.rtuAddr) - && res.downCode.equals(rsFromRtu.upCode)){ - obj.onceReceivedResult = true ;//鏍囪瘑宸茬粡鏀跺埌鍛戒护缁撴灉 - return res ; - }else{ - node = node.pre ; - } - } - - return null ; - } - - /** - * 鍖归厤鍛戒护缁撴灉 - * @param rsFromRtu - * @return - */ - public static MidResultToRtu matchFromTail(MidResultFromRtu rsFromRtu){ - MidResultToRtu res = null ; - TcpDownCommandObj obj = null ; - Node node = cacheQueue.getLastNode() ; - while(node != null && node.obj != null){ - obj = (TcpDownCommandObj)node.obj; - res = obj.result ; - if(res != null - && res.rtuAddr.equals(rsFromRtu.rtuAddr) - && res.downCode.equals(rsFromRtu.upCode)){ - obj.onceReceivedResult = true ;//鏍囪瘑宸茬粡鏀跺埌鍛戒护缁撴灉 - return res ; - }else{ - node = node.pre ; - } - } - - return null ; - } - - /** - * 寰楀埌绗竴涓妭鐐� - * @return - */ - public static Node getFirstQueueNode(){ - return cacheQueue.getFirstNode() ; - } - - /** - * 寰楀埌鏈�鍚庝竴涓妭鐐� - * @return - */ - public static Node getLastQueueNode(){ - return cacheQueue.getLastNode() ; - } - - /** - * 绉婚櫎鑺傜偣 - * @param node - */ - public static void removeNode(Node node){ - cacheQueue.remove(node); - } - - /** - * 缂撳瓨鐨勮妭鐐规暟 - * @Return 缂撳瓨鑺傜偣鏁� - */ - public static Integer size(){ - return cacheQueue.size() ; - } - -} diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandObj.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandObj.java index ae05e4f..40dad55 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandObj.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/forTcp/TcpDownCommandObj.java @@ -73,8 +73,8 @@ } Long lastSendStamp = tcpSe.lastDownComTime ; - if(this.result.isQuickSend || lastSendStamp == null || (now - lastSendStamp >= ServerProperties.commandSendInterval)){ - //鏈敹鍒板懡浠ょ粨鏋滐紝鏈揪鍒版渶澶у彂閫佹鏁帮紝RTU鍦ㄧ嚎锛岄�熷彂鍛戒护鎴栬秴杩囧懡浠や笅鍙戦棿闅旓紝浠ヤ笂婊¤冻鍙戦�佸懡浠ゆ潯浠讹紝鎵ц鍙戦�佸懡浠� + if(lastSendStamp == null || (now - lastSendStamp >= ServerProperties.commandSendInterval)){ + //鏈敹鍒板懡浠ょ粨鏋滐紝鏈揪鍒版渶澶у彂閫佹鏁帮紝RTU鍦ㄧ嚎锛岃秴杩囧懡浠ら棿涓嬪彂闂撮殧锛屼互涓婃弧瓒冲彂閫佸懡浠ゆ潯浠讹紝鎵ц鍙戦�佸懡浠� tcpSe.ioSession.write(this.result.downBuffer) ; tcpSe.lastDownComTime = now ; if(!this.result.hasResponse){ diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuDownTask.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuDownTask.java index 64891d0..410f43c 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuDownTask.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuDownTask.java @@ -7,7 +7,7 @@ import com.dy.common.mw.protocol.MidResult; import com.dy.common.mw.protocol.Command; import com.dy.common.mw.protocol.Driver; -import com.dy.common.mw.protocol.ProtocolCache; +import com.dy.common.mw.protocol.ProtocolCach; import com.dy.aceMw.server.ServerProperties; import com.dy.aceMw.server.forTcp.TcpSessionCach; @@ -34,7 +34,8 @@ /** * 澶勭悊鍛戒护 - * @param com 鍛戒护 + * @param webJgroupName + * @param com * @throws Exception */ private void deal(Command com) throws Exception{ @@ -44,13 +45,13 @@ String protocolName = TcpSessionCach.getTcpProtocolName(rtuAddr) ; if(protocolName == null){ //RTU鏈浘涓婄嚎 - int count = ProtocolCache.driverCount() ; + int count = ProtocolCach.driverCount() ; if(count == 1){ //鍙湁涓�涓崗璁� - dri = ProtocolCache.getFirstDriver() ; + dri = ProtocolCach.getFirstDriver() ; } }else{ - dri = ProtocolCache.getDriver(protocolName) ; + dri = ProtocolCach.getDriver(protocolName) ; } if(dri == null){ log.error("涓ラ噸閿欒锛屾湭鑳藉緱鍒板崗璁�" + protocolName + "椹卞姩绫诲疄渚嬶紒"); diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuUpTask.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuUpTask.java index c27241f..16418cf 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuUpTask.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/RtuUpTask.java @@ -14,7 +14,7 @@ import com.dy.common.mw.protocol.Driver; import com.dy.common.mw.protocol.OnLine; import com.dy.common.mw.protocol.OnLineHandle; -import com.dy.common.mw.protocol.ProtocolCache; +import com.dy.common.mw.protocol.ProtocolCach; import com.dy.aceMw.server.ServerProperties; import com.dy.aceMw.server.forTcp.RtuLogDealer; import com.dy.aceMw.server.forTcp.RtuStatusDealer; @@ -144,13 +144,13 @@ * @throws Exception 寮傚父 */ private void dealUpData(IoSession session, String rtuAddrAtHead, String protocolName, boolean isOnLine, byte[] upBuf, String upHex) throws Exception{ - Driver dri = ProtocolCache.getDriver(protocolName) ; + Driver dri = ProtocolCach.getDriver(protocolName) ; if(dri == null){ log.error("涓ラ噸閿欒锛屾湭鑳藉緱鍒板崗璁�" + protocolName + "椹卞姩绫诲疄渚嬶紒"); }else{ MidResult[] midRs = dri.parseData(ServerProperties.isLowPower, rtuAddrAtHead, upBuf, upHex, new DriverParserDataCallback(){ @Override - public void callback(String rtuAddrAtHead, String code, String upHex, Boolean reportOrResponse_trueOrFalse, boolean parseFail, String rtuAddrInData) { + public void callback(String rtuAddrAtHead, String meterNoAtHead, String code, String upHex, Boolean reportOrResponse_trueOrFalse, boolean parseFail, String rtuAddrInData, String meterNoInData) { //鏇存柊缁堢鐘舵�� if(rtuAddrInData != null && !rtuAddrInData.equals(rtuAddrAtHead)){ //鏁版嵁澶翠腑鐨凴TU鍦板潃涓庢暟鎹腑鐨凴TU鍦板潃涓嶄竴鑷达紝鏇存崲鎴愭暟鎹腑鐨凴TU鍦板潃 diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/ToRtuConstantTask.java b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/ToRtuConstantTask.java index d042ef3..08721c8 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/ToRtuConstantTask.java +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/server/tasks/ToRtuConstantTask.java @@ -5,7 +5,7 @@ import com.dy.common.queue.Node; import com.dy.common.mw.core.CoreTask; -import com.dy.aceMw.server.forTcp.TcpDownCommandCache; +import com.dy.aceMw.server.forTcp.TcpDownCommandCach; import com.dy.aceMw.server.forTcp.TcpDownCommandObj; import com.dy.aceMw.server.forTcp.TcpSessionCach; @@ -40,12 +40,16 @@ * 澶勭悊涓嬭鍛戒护 */ public Integer dealDownCommand(Long now) { - Node first = TcpDownCommandCache.getFirstQueueNode() ; - if(first != null){ - Integer count = TcpDownCommandCache.size() ; - Node last = TcpDownCommandCache.getLastQueueNode() ; - this.doDealDownCommand(now, first, last); - return count ; + try{ + Node first = TcpDownCommandCach.getFirstQueueNode() ; + if(first != null){ + Integer count = TcpDownCommandCach.size() ; + Node last = TcpDownCommandCach.getLastQueueNode() ; + this.doDealDownCommand(now, first, last); + return count ; + } + }catch(Exception e){ + log.error(e); } return null ; } @@ -53,9 +57,9 @@ * 澶勭悊缂撳瓨鐨勪笅琛屽懡浠よ妭鐐� * @param now 褰撳墠鏃跺埢 * @param first 绗竴涓妭鐐� - * @param last 鏈�鍚庝竴涓妭鐐� + * @param last 鏄悗涓�涓妭鐐� */ - private void doDealDownCommand1(Long now, Node first, Node last){ + private void doDealDownCommand(Long now, Node first, Node last){ if(first != null){ //鍦╠ealNode鏂规硶涓紝鍙兘瑕佹妸first浠庨槦鍒椾腑绉婚櫎锛岃繖鏃秄irst.next涓虹┖锛屾墍浠ユ彁鍓嶆妸first.next鍙栧嚭鏉� Node next = first.next ; @@ -70,28 +74,6 @@ } } } - - /** - * 澶勭悊缂撳瓨鐨勪笅琛屽懡浠よ妭鐐� - * @param now 褰撳墠鏃跺埢 - * @param first 绗竴涓妭鐐� - * @param last 鏈�鍚庝竴涓妭鐐� - */ - private void doDealDownCommand(Long now, Node first, Node last){ - if(last != null){ - //鍦╠ealNode鏂规硶涓紝鍙兘瑕佹妸last浠庨槦鍒椾腑绉婚櫎锛岃繖鏃秎ast.pre涓虹┖锛屾墍浠ユ彁鍓嶆妸last.pre鍙栧嚭鏉� - Node pre = last.pre ; - dealNode(now, last) ; - if(first != null && first != last){ - doDealDownCommand(now, first, pre) ; - }else if(first != null && first == last){ - //鍋滄 - }else if(first == null){ - //杩欑鎯呭喌涓嶄細瀛樺湪 - doDealDownCommand(now, null, pre) ; - } - } - } /** * 澶勭悊涓�涓妭鐐� @@ -102,7 +84,7 @@ TcpDownCommandObj obj = (TcpDownCommandObj)node.obj ; boolean removeNode = obj.dealSelf(now) ; if(removeNode){ - TcpDownCommandCache.removeNode(node); + TcpDownCommandCach.removeNode(node); } } diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/resources/config.xml b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/resources/config.xml index 8530fff..230a69b 100644 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/resources/config.xml +++ b/pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/resources/config.xml @@ -14,24 +14,20 @@ offLineCachTimeout: 涓嶅湪绾跨紦瀛樼殑鍛戒护鏈�澶х紦瀛樻椂闀�(绉�) lastUpDataTimeLive: TCP涓婅鏁版嵁鏃跺埢缂撳瓨鏃堕暱(绉�)锛屽綋杈惧埌鏃堕暱鏃讹紝TCP涓婅鏁版嵁鏃跺埢琚竻绌猴紝閲囩敤TCP涓婅鏁版嵁鏃跺埢鐩殑鏄紝闃绘涓婅鏁版嵁鍚屾椂涓嬪彂鏁版嵁锛屽洜涓篟TU澶勭悊涓嶈繃鏉�(缁忓垵娆″疄楠岋紝1绉掕繕鏄湁闂锛�2绉掓棤闂) dbDataIdSuffix锛氭暟鎹簱鏁版嵁id鐢熸垚鍣ㄧ殑id鍚庣紑锛�0鏄粯璁ょ殑鍚庣紑锛屼竴鑸瑆eb绯荤粺搴旂敤锛屾暟鎹腑闂翠欢id鍚庣紑澶т簬绛変簬1 - cacheUpDownDataWarnCount锛氫笂涓嬭鏁版嵁缂撳瓨闃熷垪涓紦瀛樻暟鎹釜鏁扮殑鎶ヨ閲忥紝杩欎釜涓庣幇瀹為」鐩墍鎺ユ按琛ㄦ暟鐩稿叧 - cacheUpDownDataMaxCount锛氫笂涓嬭鏁版嵁缂撳瓨闃熷垪涓紦瀛樻暟鎹釜鏁扮殑鏈�澶у�硷紝杩欎釜涓庣幇瀹為」鐩墍鎺ユ按琛ㄦ暟鐩稿叧 --> <base isLowPower="false" onlyOneProtocol="true" - downComandMaxResendTimes="3" + downComandMaxResendTimes="1" commandSendInterval="3" cachWaitResultTimeout="60" offLineCachTimeout="86400" lastUpDataTimeLive="1" - dbDataIdSuffix="0" - cacheUpDownDataWarnCount="100000" - cacheUpDownDataMaxCount="110000" + dbDataIdSuffix="1" /> <!-- - centerAddr: 涓績鍦板潃锛屽綋鍓嶏紝centerAddr鏈敤鍒� + centerAddr: 涓績鍦板潃锛屽綋鍓嶏紝鍦ㄦ埛琛ㄧ郴缁熶腑鐨勶紝centerAddr鏈敤鍒� synchroRtuClock: 鏄惁瀵筊TU鏍℃椂 synchroRtuClockTimepieces锛氬綋RTU涓庢湇鍔″櫒鏃堕挓鐩稿樊涓�瀹氭绉掞紙閰嶇疆鏂囦欢鏄閽燂級鍚庯紝杩涜鏍℃椂 --> @@ -45,7 +41,7 @@ <!-- 杞欢鍗囩骇 --> <updateRtuSoft enable="true"> <soft1 enable="true" oldVersionName="meter_v2_0,meter_v1_0" > - <newVersion newVersionName="meter_v3_0" file="rtuSoft/meter_v3_0.txt"> </newVersion> + <newVersion newVersionName="meter_v3_0" file="rtuSoft/meter_v3_0.txt"></newVersion> </soft1> <!-- <soft2 enable="false" oldVersionName="rtu_v1_0,rtu_v2_0,rtu_v3_0" > @@ -57,28 +53,27 @@ <!-- 鏀寔妯″潡 鐭伐浣滄椂闀跨嚎绋嬫睜锛岀嚎绋嬭礋璐g敤鏃惰緝鐭殑宸ヤ綔浠诲姟 - short_maxThread锛� 姹犱腑鏈�澶х嚎绋嬫暟涓烘墍鏈塁PU鏍告暟+1锛坰hort姹犱笌long姹犲悇鍒嗕竴鍗婏級锛岃嫢涓�-1锛屼笉鍙楅檺鍒� 锛岃缃负0锛岃〃绀轰笉鍚姩绾跨▼姹� - short_minThread锛� 姹犱腑鏈�灏忕嚎绋嬫暟锛岃嫢涓�-1锛屼笉鍙楅檺鍒讹紝璁剧疆涓�0锛岃〃绀轰笉鍚姩绾跨▼姹� + short_maxThread锛� 姹犱腑鏈�澶х嚎绋嬫暟涓烘墍鏈塁PU鏍告暟+1 + short_minThread锛� 姹犱腑鏈�灏忕嚎绋嬫暟 short_freeTimeout锛� 绾跨▼鏁扮┖闂叉椂闀匡紝鑻ユ睜涓嚎绋嬫暟閲忓ぇ浜巑inThread锛屼笖鏈夌殑绾跨▼绌洪棽鏃堕暱瓒呰繃freeTimeout锛屽垯娓呴櫎璇ョ嚎绋嬶紝涓轰簡涓嶆竻闄わ紝鎶妋inThread涓巑axThread璁剧疆鐩哥瓑 short_busyTimeout锛氱嚎绋嬩笉闂存柇宸ヤ綔鏃堕暱锛堝崟浣嶄负绉�)瓒呮椂闄愶紝璁や负绾跨▼宸茬粡浜嗗穿婧冿紝灏嗗己鍒舵竻闄わ紝鐭伐浣滄椂闀胯缃负5绉� - 闀垮伐浣滄椂闀跨嚎绋嬫睜锛岀嚎绋嬭礋璐g敤鏃惰緝闀跨殑宸ヤ綔浠诲姟锛屼緥濡傛暟鎹簱瀛樺彇鎿嶄綔 - long_maxThread锛� 姹犱腑鏈�澶х嚎绋嬫暟涓烘墍鏈塁PU鏍告暟+1锛坰hort姹犱笌long姹犲悇鍒嗕竴鍗婏級锛岃嫢涓�-1锛屼笉鍙楅檺鍒讹紝璁剧疆涓�0锛岃〃绀轰笉鍚姩绾跨▼姹� - long_minThread锛� 姹犱腑鏈�灏忕嚎绋嬫暟锛岃嫢涓�-1锛屼笉鍙楅檺鍒讹紝璁剧疆涓�0锛岃〃绀轰笉鍚姩绾跨▼姹� + 闀垮伐浣滄椂闀跨嚎绋嬫睜锛岀嚎绋嬭礋璐g敤鏃惰緝闀跨殑宸ヤ綔浠诲姟锛屼緥濡備粠Redis涓彇缂撳瓨鐨凴TU涓婅鏁版嵁 + long_maxThread锛� 姹犱腑鏈�澶х嚎绋嬫暟,鑻ヤ负-1锛屼笉鍙楅檺鍒� + long_minThread锛� 姹犱腑鏈�灏忕嚎绋嬫暟 long_freeTimeout锛� 绾跨▼鏁扮┖闂叉椂闀匡紝鑻ユ睜涓嚎绋嬫暟閲忓ぇ浜巑inThread锛屼笖鏈夌殑绾跨▼绌洪棽鏃堕暱瓒呰繃freeTimeout锛屽垯娓呴櫎璇ョ嚎绋� long_busyTimeout锛氱嚎绋嬩笉闂存柇宸ヤ綔鏃堕暱锛堝崟浣嶄负绉�)瓒呮椂闄愶紝鑻ヤ负-1锛屼笉鍙楅檺鍒� enableThreadPool锛氭槸鍚﹀惎鐢ㄧ嚎绋嬫睜 --> - <!-- 褰撳墠瀹炵幇锛屽啓rtu鏃ュ織銆丷MI鏁版嵁澶勭悊鐢ㄥ埌浜嗙煭绾跨▼姹� --> - <!-- 褰撳墠瀹炵幇锛宺tu涓婅鏁版嵁澶勭悊锛堣鍐欐暟鎹級鐢ㄥ埌浜嗙绾跨▼姹� --> <support - short_maxThread="6" - short_minThread="6" + short_maxThread="100" + short_minThread="5" short_freeTimeout="60" short_busyTimeout="5" - long_maxThread="6" - long_minThread="6" + long_maxThread="200" + long_minThread="0" long_freeTimeout="60" long_busyTimeout="-1" + enableThreadPool="true" /> <!-- @@ -110,10 +105,14 @@ <!-- sleepBigBusy锛氫富绾跨▼澶у繖鏃舵瘡娆℃墽琛岄棿闅旀椂闀匡紙姣锛� sleepSmallBusy锛氫富绾跨▼灏忓繖鏃舵瘡娆℃墽琛岄棿闅旀椂闀匡紙姣锛� + queueWarnSize: 缂撳瓨闃熷垪鑺傜偣鏁拌鍛婃暟閲� + queueMaxSize: 缂撳瓨闃熷垪鑺傜偣鏁版渶澶ф暟閲� --> <core sleepBigBusy="100" sleepSmallBusy="500" + queueWarnSize="100000" + queueMaxSize="300000" /> <!-- diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/AdapterImp_RmiUnit.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/AdapterImp_RmiUnit.java deleted file mode 100644 index de59d8c..0000000 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/AdapterImp_RmiUnit.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.dy.testServer; - -import com.dy.common.mw.channel.rmi.RmiConfigVo; -import com.dy.common.mw.channel.rmi.RmiRequestCallback; -import com.dy.common.mw.channel.rmi.RmiUnitAdapter; -import com.dy.testServer.forRmi.RmiRequestedCallback; - -public class AdapterImp_RmiUnit implements RmiUnitAdapter { - - private RmiConfigVo configVo ; - - @Override - public RmiConfigVo getConfig() { - return configVo; - } - - public void setConfig(RmiConfigVo configVo){ - this.configVo = configVo ; - } - - @Override - public RmiRequestCallback newRequestCallback() { - return new RmiRequestedCallback(); - } - -} diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/ResRegisterVo.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/ResRegisterVo.java deleted file mode 100644 index 7a71d33..0000000 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/ResRegisterVo.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.dy.testServer.forRmi; - - -import com.alibaba.fastjson2.JSON; - -public class ResRegisterVo { - - public String token ; - - /** - * 瀵硅薄杞垚json - * @return json - * @throws Exception 寮傚父 - */ - public String toJson()throws Exception{ - try{ - return JSON.toJSONString(this) ; - //return new JSONSerializer().exclude(new String[]{"class", "*.class"}).deepSerialize(this); - }catch(Exception e){ - throw new Exception(e.getMessage() , e ) ; - } - } - /** - * json杞垚瀵硅薄 - * @param json 鍙傛暟 - * @return 瀵硅薄 - * @throws Exception 寮傚父 - */ - public static ResRegisterVo jsonToObject(String json)throws Exception{ - try{ - return JSON.parseObject(json, ResRegisterVo.class) ; - //return new JSONDeserializer<ResRegisterVo>().deserialize(json, ResRegisterVo.class) ; - }catch(Exception e){ - throw new Exception(e.getMessage() , e ) ; - } - } - - public String getToken() { - return token; - } - - public void setToken(String id) { - this.token = id; - } - -} diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/ResStartVo.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/ResStartVo.java deleted file mode 100644 index ce87eb6..0000000 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/ResStartVo.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.dy.testServer.forRmi; - - -import com.alibaba.fastjson2.JSON; - -public class ResStartVo { - - public boolean success = true ; - - public String errorInfo ; - - public boolean start ; - - - /** - * 瀵硅薄杞垚json - * @return json - * @throws Exception 寮傚父 - */ - public String toJson()throws Exception{ - try{ - return JSON.toJSONString(this) ; - //return new JSONSerializer().exclude(new String[]{"class", "*.class"}).deepSerialize(this); - }catch(Exception e){ - throw new Exception(e.getMessage() , e ) ; - } - } - /** - * json杞垚瀵硅薄 - * @param json 鍙傛暟 - * @return 瀵硅薄 - * @throws Exception 寮傚父 - */ - public static ResStartVo jsonToObject(String json)throws Exception{ - try{ - return JSON.parseObject(json, ResStartVo.class) ; - //return new JSONDeserializer<ResStartVo>().deserialize(json, ResStartVo.class) ; - }catch(Exception e){ - throw new Exception(e.getMessage() , e ) ; - } - } - - public boolean isSuccess() { - return success; - } - public void setSuccess(boolean success) { - this.success = success; - } - public String getErrorInfo() { - return errorInfo; - } - public void setErrorInfo(String errorInfo) { - this.errorInfo = errorInfo; - } - public boolean isStart() { - return start; - } - - public void setStart(boolean start) { - this.start = start; - } - -} diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/RmiRequestedCallback.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/RmiRequestedCallback.java deleted file mode 100644 index da9d2b2..0000000 --- a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/RmiRequestedCallback.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dy.testServer.forRmi; - -import java.rmi.RemoteException; - -import com.dy.common.mw.channel.rmi.RmiRequestCallback; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -public class RmiRequestedCallback implements RmiRequestCallback { - - @SuppressWarnings("unused") - private static Logger log = LogManager.getLogger(RmiRequestedCallback.class.getName()) ; - - @Override - public Object syncRequest(Object obj) throws RemoteException { - String json ; - try { - json = Manager.dealRequest(obj); - } catch (Exception e) { - throw new RemoteException("鏈嶅姟绔紓甯�" , e) ; - } - return json ; - } - - @Override - public String asyncRequest(Object obj) throws RemoteException { - String json ; - try { - json = Manager.dealRequest(obj); - } catch (Exception e) { - throw new RemoteException("鏈嶅姟绔紓甯�" , e) ; - } - return json ; - } - -} diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/pom.xml b/pipIrr-platform/pipIrr-web/pipIrr-web-base/pom.xml index 77f0653..02bf348 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/pom.xml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/pom.xml @@ -15,124 +15,4 @@ <name>pipIrr-web-base</name> <description>web鍩虹淇℃伅绯荤粺</description> - - <build> - <plugins> - <!-- 鐢熸垚涓嶅寘鍚緷璧杍ar鐨勫彲鎵цjar鍖� - <plugin> - !- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 - - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - !- - <goals> - <goal>repackage</goal> - </goals> - - - <configuration> - !- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - - <classifier>execute</classifier> - !- 涓嶆寚瀹氱敓鎴愯矾寰勭殑璇�, 榛樿淇濆瓨鍦� ${build.directory} 涓� - - <outputDirectory>${project.build.directory}/execute</outputDirectory> - <finalName>${artifactId}-${version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - - </plugin> - --> - <!-- 鎷疯礉渚濊禆鐨刯ar鍖呭埌lib鐩綍--> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <configuration> - <!-- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - <classifier>execute</classifier> - --> - <!-- ${project.build.directory}鏄痬aven鍙橀噺锛屽唴缃殑锛岃〃绀簍arget鐩綍,濡傛灉涓嶅啓锛屽皢鍦ㄦ牴鐩綍涓嬪垱寤�/lib --> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - <!-- excludeTransitive:鏄惁涓嶅寘鍚棿鎺ヤ緷璧栧寘锛屾瘮濡傛垜浠緷璧朅锛屼絾鏄疉鍙堜緷璧栦簡B锛屾垜浠槸鍚︿篃瑕佹妸B鎵撹繘鍘� 榛樿涓嶆墦--> - <excludeTransitive>false</excludeTransitive> - <!-- 澶嶅埗鐨刯ar鏂囦欢鍘绘帀鐗堟湰淇℃伅 --> - <stripVersion>false</stripVersion> - <finalName>${project.artifactId}-${project.version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <!-- 璁剧疆java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <!-- source锛� 婧愪唬鐮佺紪璇戠増鏈紱target锛� 鐩爣骞冲彴缂栬瘧鐗堟湰锛沞ncoding锛� 瀛楃闆嗙紪鐮併�� --> - <configuration> - <source>${java.version}</source> - <target>${java.version}</target> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- 瑙e喅璧勬簮鏂囦欢鐨勭紪鐮侀棶棰� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <configuration> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - <plugin> - <!-- 涓嬮潰瑙e喅锛氬綋杩涜Maven Lifecycle package鏃舵姤閿欙細Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)--> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <extensions>true</extensions> - </plugin> - </plugins> - </build> </project> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockSv.java index cd9577e..7dbd4c4 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockSv.java @@ -3,6 +3,7 @@ import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.daoBa.BaBlockMapper; import com.dy.pipIrrGlobal.pojoBa.BaBlock; +import com.dy.pipIrrGlobal.pojoBa.BaClientType; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.beans.factory.annotation.Autowired; diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictVo.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictVo.java index f6c38f7..1f712ff 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictVo.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/district/DistrictVo.java @@ -23,9 +23,9 @@ @Length(message = "琛屾斂鍖哄悕绉板皬浜巤max}瀛�", min = 1, max = 25) public String name ; - @Schema(description = "琛屾斂鍖虹紪鍙�(鐪佸競鍘�2浣嶏紝闀囨潙3浣�)", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "琛屾斂鍖虹紪鍙�", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "琛屾斂鍖虹紪鍙蜂笉鑳戒负绌�") //涓嶈兘涓虹┖涔熶笉鑳戒负null - @Length(message = "琛屾斂鍖虹紪鍙锋槸涓�浣嶆垨涓や綅鏁�", min = 2, max = 3) + @Length(message = "琛屾斂鍖虹紪鍙锋槸涓�浣嶆垨涓や綅鏁�", min = 1, max = 2) public String num ; @Schema(description = "琛屾斂鍖虹骇鍒�", requiredMode = Schema.RequiredMode.NOT_REQUIRED) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java index cf8637e..3bfc625 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java @@ -21,6 +21,7 @@ import jakarta.validation.Valid; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.MediaType; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; @@ -31,19 +32,23 @@ @Slf4j @Tag(name = "鐢ㄦ埛绠$悊", description = "鐢ㄦ埛澧炲垹鏀规煡绛夋搷浣�") @RestController -@RequestMapping(path="user") +@RequestMapping(path = "user") @SuppressWarnings("unchecked")//java鐗堟湰瓒婇珮锛屽娉涘瀷绾︽潫瓒婁弗锛屾墍浠ラ厤缃甋uppressWarnings("unchecked") public class UserCtrl { - private UserSv sv ; + private UserSv sv; + + @Value("${user.defaultPassword:ABC123}") + private String defaultPassword; @Autowired - private void setSv(UserSv sv){ - this.sv = sv ; + private void setSv(UserSv sv) { + this.sv = sv; } /** * 瀹㈡埛绔姹傚緱鍒版墍鏈夌敤鎴锋暟鎹� + * * @return 鎵�鏈夌敤鎴锋暟鎹� */ @Operation(summary = "鑾峰緱涓�椤电敤鎴�", description = "杩斿洖涓�椤电敤鎴锋暟鎹�") @@ -57,18 +62,19 @@ }) @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE) @SsoAop("-1") - public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody @Parameter(description = "鏌ヨform琛ㄥ崟json鏁版嵁", required = true) @Valid QueryVo vo){ + public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody @Parameter(description = "鏌ヨform琛ㄥ崟json鏁版嵁", required = true) @Valid QueryVo vo) { try { - QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo) ; + QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo); return BaseResponseUtils.buildSuccess(res); } catch (Exception e) { log.error("鏌ヨ鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } } /** * 寰楀埌涓�涓敤鎴锋暟鎹� + * * @return 涓�涓敤鎴锋暟鎹� */ @Operation(summary = "涓�涓敤鎴�", description = "寰楀埌涓�涓敤鎴锋暟鎹�") @@ -82,12 +88,13 @@ }) @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE) @SsoAop("-1") - public BaseResponse<BaUser> one(@Parameter(description = "瀹炰綋id", required = true) String id){ + public BaseResponse<BaUser> one(@Parameter(description = "瀹炰綋id", required = true) String id) { return BaseResponseUtils.buildSuccess(this.sv.selectById(Long.parseLong(id))); } /** * 淇濆瓨鐢ㄦ埛 + * * @param po 淇濆瓨鐢ㄦ埛form琛ㄥ崟瀵硅薄 * @return 鏄惁鎴愬姛 */ @@ -102,37 +109,42 @@ }) @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE) @SsoAop("-1")//@SsoAop(power = "-1") - public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult){ - if(bindingResult != null && bindingResult.hasErrors()){ + public BaseResponse<Boolean> save(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult) { + if (bindingResult != null && bindingResult.hasErrors()) { return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } - po.id = null ; + po.id = null; int count; + int count1; try { - po.disabled = Disabled.NO ;//榛樿涓嶇鐢� - po.deleted = Deleted.NO ;//榛樿涓嶅垹闄� - po.orgTag = DataSourceContext.get() ;//鏈烘瀯鏍囩 - if(!StringUtils.isNullOrEmpty(po.password)){ + po.disabled = Disabled.NO;//榛樿涓嶇鐢� + po.deleted = Deleted.NO;//榛樿涓嶅垹闄� + po.orgTag = DataSourceContext.get();//鏈烘瀯鏍囩 + if (!StringUtils.isNullOrEmpty(po.password)) { /* 濡傛灉鍓嶇杩涜浜哹ase64鍔犲瘑 po.password = new String(Base64.getDecoder().decode(po.password)) ; */ - po.password = MD5.encrypt(po.password) ;//杩涜鍔犲瘑鐮� + po.password = MD5.encrypt(po.password);//杩涜鍔犲瘑鐮� + } else { + po.password = MD5.encrypt(defaultPassword); } count = this.sv.save(po); + count1 = this.sv.setRoles(String.valueOf(po.id), po.roleIds); } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - if(count <= 0){ - return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; - }else{ - return BaseResponseUtils.buildSuccess(true) ; + if (count <= 0 || count1 <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); } } /** * 缂栬緫淇敼鐢ㄦ埛 + * * @param po 淇濆瓨鐢ㄦ埛form琛ㄥ崟瀵硅薄 * @return 鏄惁鎴愬姛 */ @@ -147,32 +159,33 @@ }) @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) @SsoAop("-1")//@SsoAop(power = "-1") - public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult){ - if(bindingResult != null && bindingResult.hasErrors()){ + public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid BaUser po, @Parameter(hidden = true) BindingResult bindingResult) { + if (bindingResult != null && bindingResult.hasErrors()) { return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); } - if(po.id == null){ - return BaseResponseUtils.buildFail("鏃犳暟鎹疄浣揑D") ; + if (po.id == null) { + return BaseResponseUtils.buildFail("鏃犳暟鎹疄浣揑D"); } int count; try { - po.deleted = null ;//璁剧疆涓簄ull锛屼笉鍋氭洿鏂� - po.orgTag = null ;//璁剧疆涓簄ull锛屼笉鍋氭洿鏂� + po.deleted = null;//璁剧疆涓簄ull锛屼笉鍋氭洿鏂� + po.orgTag = null;//璁剧疆涓簄ull锛屼笉鍋氭洿鏂� count = this.sv.update(po); } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - if(count <= 0){ - return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; - }else{ - return BaseResponseUtils.buildSuccess(true) ; + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); } } /** * 淇敼瀵嗙爜 + * * @param id 鐢ㄦ埛ID * @return 鏄惁鎴愬姛 */ @@ -189,51 +202,137 @@ @SsoAop("-1")//@SsoAop(power = "-1") public BaseResponse<Boolean> changePassword(@Parameter(description = "瀹炰綋id", required = true) String id, @Parameter(description = "鏃у瘑鐮�", required = true) String oldPassword, - @Parameter(description = "鏂板瘑鐮�", required = true) String newPassword) throws Exception{ - if(id == null){ - return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖") ; + @Parameter(description = "鏂板瘑鐮�", required = true) String newPassword) throws Exception { + if (id == null) { + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖"); } - if(StringUtils.isNullOrEmpty(oldPassword)){ - return BaseResponseUtils.buildFail("鏃у瘑鐮佷笉鑳戒负绌�") ; + if (StringUtils.isNullOrEmpty(oldPassword)) { + return BaseResponseUtils.buildFail("鏃у瘑鐮佷笉鑳戒负绌�"); } - if(StringUtils.isNullOrEmpty(newPassword)){ - return BaseResponseUtils.buildFail("鏂板瘑鐮佷笉鑳戒负绌�") ; + if (StringUtils.isNullOrEmpty(newPassword)) { + return BaseResponseUtils.buildFail("鏂板瘑鐮佷笉鑳戒负绌�"); } /* 濡傛灉鍓嶇杩涜浜哹ase64鍔犲瘑 oldPassword = new String(Base64.getDecoder().decode(oldPassword)) ; newPassword = new String(Base64.getDecoder().decode(newPassword)) ; */ - oldPassword = MD5.encrypt(oldPassword) ;//杩涜鍔犲瘑鐮� - newPassword = MD5.encrypt(newPassword) ;//杩涜鍔犲瘑鐮� + oldPassword = MD5.encrypt(oldPassword);//杩涜鍔犲瘑鐮� + newPassword = MD5.encrypt(newPassword);//杩涜鍔犲瘑鐮� - Long idLg = Long.parseLong(id) ; - int count ; + Long idLg = Long.parseLong(id); + int count; try { BaUser po = this.sv.selectById(idLg); - if(Objects.isNull(po)){ - return BaseResponseUtils.buildFail("鏈緱鍒扮敤鎴凤紝璇锋眰澶辫触") ; - }else{ - if(!po.password.equalsIgnoreCase(oldPassword)){ - return BaseResponseUtils.buildFail("鏃у瘑鐮佷笉姝g‘锛岃姹傚け璐�") ; - }else{ - count = this.sv.changePassword(idLg, newPassword) ; + if (Objects.isNull(po)) { + return BaseResponseUtils.buildFail("鏈緱鍒扮敤鎴凤紝璇锋眰澶辫触"); + } else { + if (!po.password.equalsIgnoreCase(oldPassword)) { + return BaseResponseUtils.buildFail("鏃у瘑鐮佷笉姝g‘锛岃姹傚け璐�"); + } else { + count = this.sv.changePassword(idLg, newPassword); } } } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - if(count <= 0){ - return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; - }else{ - return BaseResponseUtils.buildSuccess(true) ; + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); + } + } + + /** + * 閲嶇疆瀵嗙爜涓洪粯璁ゅ�� + * + * @param id 鐢ㄦ埛ID + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "閲嶇疆瀵嗙爜", description = "鎻愪氦鐢ㄦ埛ID") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @GetMapping(path = "resetPassword", consumes = MediaType.TEXT_PLAIN_VALUE) + @SsoAop("-1")//@SsoAop(power = "-1") + public BaseResponse<Boolean> resetPassword(@Parameter(description = "瀹炰綋id", required = true) String id) throws Exception { + if (id == null) { + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖"); + } + String password = MD5.encrypt(defaultPassword);//杩涜鍔犲瘑鐮� + Long idLg = Long.parseLong(id); + int count; + try { + BaUser po = this.sv.selectById(idLg); + if (Objects.isNull(po)) { + return BaseResponseUtils.buildFail("鏈緱鍒扮敤鎴凤紝璇锋眰澶辫触"); + } else { + count = this.sv.changePassword(idLg, password); + } + } catch (Exception e) { + log.error("淇濆瓨鐢ㄦ埛寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); + } + } + + /** + * 閲嶇疆瀵嗙爜涓洪殢鏈烘暟瀛楀姞瀛楁瘝 + * + * @param id 鐢ㄦ埛ID + * @return 鏄惁鎴愬姛 + */ + @Operation(summary = "閲嶇疆瀵嗙爜", description = "鎻愪氦鐢ㄦ埛ID") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "鎿嶄綔缁撴灉锛歵rue锛氭垚鍔燂紝false锛氬け璐ワ紙BaseResponse.content锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = Boolean.class))} + ) + }) + @GetMapping(path = "resetPassword1", consumes = MediaType.TEXT_PLAIN_VALUE) + @SsoAop("-1")//@SsoAop(power = "-1") + public BaseResponse<String> resetPassword1(@Parameter(description = "瀹炰綋id", required = true) String id) throws Exception { + if (id == null) { + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖"); + } + String randomPassword = this.sv.getStringRandom(6); + String password = MD5.encrypt(randomPassword);//杩涜鍔犲瘑鐮� + Long idLg = Long.parseLong(id); + int count; + try { + BaUser po = this.sv.selectById(idLg); + if (Objects.isNull(po)) { + return BaseResponseUtils.buildFail("鏈緱鍒扮敤鎴凤紝璇锋眰澶辫触"); + } else { + count = this.sv.changePassword(idLg, password); + } + } catch (Exception e) { + log.error("淇濆瓨鐢ㄦ埛寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()); + } + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(randomPassword); } } /** * 璁剧疆鐢ㄦ埛瑙掕壊 + * * @param id 鐢ㄦ埛ID * @return 鏄惁鎴愬姛 */ @@ -249,27 +348,28 @@ @GetMapping(path = "setRoles", consumes = MediaType.TEXT_PLAIN_VALUE) @SsoAop("-1")//@SsoAop(power = "-1") public BaseResponse<Boolean> setRoles(@Parameter(description = "瀹炰綋id", required = true) String id, - @Parameter(description = "瑙掕壊id鏁扮粍") String[] roleIds){ - Long[] roleId_lg = null ; - if(roleIds != null && roleIds.length > 0){ - roleId_lg = new Long[roleIds.length] ; - int index = 0 ; - for(String roleId : roleIds){ - roleId_lg[index++] = Long.parseLong(roleId) ; + @Parameter(description = "瑙掕壊id鏁扮粍") String[] roleIds) { + Long[] roleId_lg = null; + if (roleIds != null && roleIds.length > 0) { + roleId_lg = new Long[roleIds.length]; + int index = 0; + for (String roleId : roleIds) { + roleId_lg[index++] = Long.parseLong(roleId); } } try { this.sv.setRoles(Long.parseLong(id), roleId_lg); } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - return BaseResponseUtils.buildSuccess(true) ; + return BaseResponseUtils.buildSuccess(true); } /** * 鍒犻櫎鐢ㄦ埛 + * * @param id 鐢ㄦ埛ID * @return 鏄惁鎴愬姛 */ @@ -284,21 +384,21 @@ }) @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE) @SsoAop("-1")//@SsoAop(power = "-1") - public BaseResponse<Boolean> delete(@Parameter(description = "瀹炰綋id", required = true) String id){ - if(id == null){ - return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖") ; + public BaseResponse<Boolean> delete(@Parameter(description = "瀹炰綋id", required = true) String id) { + if (id == null) { + return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖"); } int count; try { count = this.sv.delete(Long.parseLong(id)); } catch (Exception e) { log.error("淇濆瓨鐢ㄦ埛寮傚父", e); - return BaseResponseUtils.buildException(e.getMessage()) ; + return BaseResponseUtils.buildException(e.getMessage()); } - if(count <= 0){ - return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�") ; - }else{ - return BaseResponseUtils.buildSuccess(true) ; + if (count <= 0) { + return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); + } else { + return BaseResponseUtils.buildSuccess(true); } } } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java index ed562ae..79c975b 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserSv.java @@ -7,14 +7,14 @@ import com.dy.pipIrrGlobal.pojoBa.BaUser; import com.dy.pipIrrGlobal.pojoBa.BaUserRole; import lombok.extern.slf4j.Slf4j; +import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; - -import org.apache.dubbo.common.utils.PojoUtils ; -import org.springframework.transaction.annotation.Transactional; +import java.util.Random; @Slf4j @Service @@ -24,41 +24,43 @@ private BaUserRoleMapper urDao; @Autowired - private void setDao(BaUserMapper dao){ + private void setDao(BaUserMapper dao) { this.dao = dao; } @Autowired - private void setDao(BaUserRoleMapper dao){ + private void setDao(BaUserRoleMapper dao) { this.urDao = dao; } /** * 寰楀埌涓�涓敤鎴� + * * @param id 鐢ㄦ埛ID * @return 鐢ㄦ埛瀹炰綋 */ - public BaUser selectById(Long id){ - return this.dao.selectById(id) ; + public BaUser selectById(Long id) { + return this.dao.selectById(id); } /** * 寰楀埌涓�涓敤鎴� + * * @param vo 鏌ヨ鏉′欢鍊煎璞� * @return 鐢ㄦ埛瀹炰綋 */ @SuppressWarnings("unchecked") - public QueryResultVo<List<BaUser>> selectSome(QueryVo vo){ - Map<String, Object> params = (Map<String, Object>)PojoUtils.generalize(vo) ; - Long itemTotal = this.dao.selectTotal(params) ; + public QueryResultVo<List<BaUser>> selectSome(QueryVo vo) { + Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo); + Long itemTotal = this.dao.selectTotal(params); - QueryResultVo<List<BaUser>> rsVo = new QueryResultVo<>() ; - rsVo.pageSize = vo.pageSize ; - rsVo.pageCurr = vo.pageCurr ; + QueryResultVo<List<BaUser>> rsVo = new QueryResultVo<>(); + rsVo.pageSize = vo.pageSize; + rsVo.pageCurr = vo.pageCurr; rsVo.calculateAndSet(itemTotal, params); - rsVo.obj = this.dao.selectSome(params) ; + rsVo.obj = this.dao.selectSome(params); - return rsVo ; + return rsVo; } /** @@ -77,35 +79,55 @@ * @return 褰卞搷璁板綍鏁伴噺 */ @Transactional - public int update(BaUser po){ - return this.dao.updateByPrimaryKeySelective(po) ; + public int update(BaUser po) { + return this.dao.updateByPrimaryKeySelective(po); } /** * 淇敼瀵嗙爜 - * @param id 鐢ㄦ埛ID + * + * @param id 鐢ㄦ埛ID * @param password 鏂板瘑鐮� * @return 褰卞搷璁板綍鏁伴噺 */ - public int changePassword(Long id, String password){ - return this.dao.changePassword(id, password) ; + public int changePassword(Long id, String password) { + return this.dao.changePassword(id, password); } /** * 璁剧疆鐢ㄦ埛瑙掕壊 - * @param userId 鐢ㄦ埛id + * + * @param userId 鐢ㄦ埛id * @param roleIds 閫夋嫨鐨勮鑹瞚d闆嗗悎 * @return 鎻掑叆鐢ㄦ埛涓庤鑹插叧鑱旇褰曟暟閲� */ - public int setRoles(Long userId, Long[] roleIds){ - this.urDao.deleteByUserId(userId) ; - int count = 0 ; - if(roleIds != null && roleIds.length > 0){ - for(Long roleId : roleIds){ - count += this.urDao.insertSelective(new BaUserRole(userId,roleId)) ; + public int setRoles(Long userId, Long[] roleIds) { + this.urDao.deleteByUserId(userId); + int count = 0; + if (roleIds != null && roleIds.length > 0) { + for (Long roleId : roleIds) { + count += this.urDao.insertSelective(new BaUserRole(userId, roleId)); } } return count ; + } + + /** + * 璁剧疆鐢ㄦ埛瑙掕壊 + * + * @param userId 鐢ㄦ埛id + * @param roleIds 閫夋嫨鐨勮鑹瞚d闆嗗悎 + * @return 鎻掑叆鐢ㄦ埛涓庤鑹插叧鑱旇褰曟暟閲� + */ + public int setRoles(String userId, String[] roleIds) { + this.urDao.deleteByUserId(Long.parseLong(userId)); + int count = 0; + if (roleIds != null && roleIds.length > 0) { + for (String roleId : roleIds) { + count += this.urDao.insertSelective(new BaUserRole(Long.parseLong(userId), Long.parseLong(roleId))); + } + } + return count; } /** @@ -114,8 +136,31 @@ * @return 褰卞搷璁板綍鏁伴噺 */ @Transactional - public int delete(Long id){ - return this.dao.deleteLogicById(id) ; + public int delete(Long id) { + return this.dao.deleteLogicById(id); } + + /** + * 鐢熸垚鎸囧畾浣嶆暟闅忔満鏁板瓧瀵嗙爜 + * + * @param length 澶氶暱闅忔満鏁� + * @return 闅忔満鏁� + */ + public String getStringRandom(int length) { + String val = ""; + Random random = new Random(); + for (int i = 0; i < length; i++) { + String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num"; + if ("char".equalsIgnoreCase(charOrNum)) { + int temp = random.nextInt(2) % 2 == 0 ? 65 : 97; + val += (char) (random.nextInt(26) + temp); + } else if ("num".equalsIgnoreCase(charOrNum)) { + val += String.valueOf(random.nextInt(10)); + } + } + return val; + } + + } diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java index 713f350..a6ead7d 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/util/InitListener.java @@ -83,27 +83,6 @@ //璁剧疆鏁版嵁婧� DataSourceContext.set(orgTag); if(!this.existDistricts()){ - if(configXml.existElement(doc, "config.orgs.org" + num + ".districts.province")){ - String distriName = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province","name", null, false, null) ; - String distriNum = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province","num", null, false, null) ; - Integer distriLevel = configXml.getSetAttrPlusInt(doc, "config.orgs.org" + num + ".districts.province","level", null, 0, 99,null) ; - Long supperId = this.saveDistrict(null, distriName, distriNum, distriLevel); - if(supperId != null && configXml.existElement(doc, "config.orgs.org" + num + ".districts.province.city")){ - if(configXml.existElement(doc, "config.orgs.org" + num + ".districts.province.city")){ - distriName = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province.city","name", null, false, null) ; - distriNum = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province.city","num", null, false, null) ; - distriLevel = configXml.getSetAttrPlusInt(doc, "config.orgs.org" + num + ".districts.province.city","level", null, 1, 99,null) ; - supperId = this.saveDistrict(supperId, distriName, distriNum, distriLevel); - if(supperId != null && configXml.existElement(doc, "config.orgs.org" + num + ".districts.province.city.country")){ - distriName = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province.city.country","name", null, false, null) ; - distriNum = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.province.city.country","num", null, false, null) ; - distriLevel = configXml.getSetAttrPlusInt(doc, "config.orgs.org" + num + ".districts.province.city.country","level", null, 1, 99,null) ; - this.saveDistrict(supperId, distriName, distriNum, distriLevel); - } - } - } - } - /* 2023-11-23 涓嬮潰鏄渶鍒濆疄鐜帮紝鍚庢弧瓒矷C鍗′腑瀛樺湪鐪佺殑瑕佹眰锛屽鍔犵渷绾ц鏀垮尯鍒� if(configXml.existElement(doc, "config.orgs.org" + num + ".districts.city")){ String distriName = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.city","name", null, false, null) ; String distriNum = configXml.getSetAttrTxt(doc, "config.orgs.org" + num + ".districts.city","num", null, false, null) ; @@ -116,7 +95,6 @@ this.saveDistrict(supperId, distriName, distriNum, distriLevel); } } - */ } if(!this.existUsers()){ if(configXml.existElement(doc, "config.orgs.org" + num + ".user")){ diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml index 9639536..2162083 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/resources/application.yml @@ -1,6 +1,8 @@ spring: profiles: include: global, database, database-ym, database-pj +user: + defaultPassword: "ABC123" #actutor鐨剋eb绔彛 management: diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-demo/pom.xml b/pipIrr-platform/pipIrr-web/pipIrr-web-demo/pom.xml index 84d7f0d..ae0ed8e 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-demo/pom.xml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-demo/pom.xml @@ -15,123 +15,5 @@ <name>pipIrr-web-demo</name> <description>web寮�鍙戞紨绀虹郴缁燂紝婕旂ず绀轰緥</description> - <build> - <plugins> - <!-- 鐢熸垚涓嶅寘鍚緷璧杍ar鐨勫彲鎵цjar鍖� - <plugin> - !- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 - - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - !- - <goals> - <goal>repackage</goal> - </goals> - - - <configuration> - !- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - - <classifier>execute</classifier> - !- 涓嶆寚瀹氱敓鎴愯矾寰勭殑璇�, 榛樿淇濆瓨鍦� ${build.directory} 涓� - - <outputDirectory>${project.build.directory}/execute</outputDirectory> - <finalName>${artifactId}-${version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - --> - <!-- 鎷疯礉渚濊禆鐨刯ar鍖呭埌lib鐩綍--> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <configuration> - <!-- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - <classifier>execute</classifier> - --> - <!-- ${project.build.directory}鏄痬aven鍙橀噺锛屽唴缃殑锛岃〃绀簍arget鐩綍,濡傛灉涓嶅啓锛屽皢鍦ㄦ牴鐩綍涓嬪垱寤�/lib --> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - <!-- excludeTransitive:鏄惁涓嶅寘鍚棿鎺ヤ緷璧栧寘锛屾瘮濡傛垜浠緷璧朅锛屼絾鏄疉鍙堜緷璧栦簡B锛屾垜浠槸鍚︿篃瑕佹妸B鎵撹繘鍘� 榛樿涓嶆墦--> - <excludeTransitive>false</excludeTransitive> - <!-- 澶嶅埗鐨刯ar鏂囦欢鍘绘帀鐗堟湰淇℃伅 --> - <stripVersion>false</stripVersion> - <finalName>${project.artifactId}-${project.version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrDemo.PipIrrDemoApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <!-- 璁剧疆java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <!-- source锛� 婧愪唬鐮佺紪璇戠増鏈紱target锛� 鐩爣骞冲彴缂栬瘧鐗堟湰锛沞ncoding锛� 瀛楃闆嗙紪鐮併�� --> - <configuration> - <source>${java.version}</source> - <target>${java.version}</target> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- 瑙e喅璧勬簮鏂囦欢鐨勭紪鐮侀棶棰� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <configuration> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - <plugin> - <!-- 涓嬮潰瑙e喅锛氬綋杩涜Maven Lifecycle package鏃舵姤閿欙細Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)--> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <extensions>true</extensions> - </plugin> - </plugins> - </build> </project> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/resources/application.yml b/pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/resources/application.yml index 78ca9b8..c03d2cc 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/resources/application.yml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-demo/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - include: global, database, database-ym, database-pj + include: global, database #actutor鐨剋eb绔彛 management: diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-gis/pom.xml b/pipIrr-platform/pipIrr-web/pipIrr-web-gis/pom.xml index 2abaa94..10d9c51 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-gis/pom.xml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-gis/pom.xml @@ -15,123 +15,5 @@ <name>pipIrr-web-gis</name> <description>web鐢靛瓙鍦板浘绯荤粺</description> - <build> - <plugins> - <!-- 鐢熸垚涓嶅寘鍚緷璧杍ar鐨勫彲鎵цjar鍖� - <plugin> - !- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 - - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - !- - <goals> - <goal>repackage</goal> - </goals> - - - <configuration> - !- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - - <classifier>execute</classifier> - !- 涓嶆寚瀹氱敓鎴愯矾寰勭殑璇�, 榛樿淇濆瓨鍦� ${build.directory} 涓� - - <outputDirectory>${project.build.directory}/execute</outputDirectory> - <finalName>${artifactId}-${version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - --> - <!-- 鎷疯礉渚濊禆鐨刯ar鍖呭埌lib鐩綍--> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <configuration> - <!-- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - <classifier>execute</classifier> - --> - <!-- ${project.build.directory}鏄痬aven鍙橀噺锛屽唴缃殑锛岃〃绀簍arget鐩綍,濡傛灉涓嶅啓锛屽皢鍦ㄦ牴鐩綍涓嬪垱寤�/lib --> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - <!-- excludeTransitive:鏄惁涓嶅寘鍚棿鎺ヤ緷璧栧寘锛屾瘮濡傛垜浠緷璧朅锛屼絾鏄疉鍙堜緷璧栦簡B锛屾垜浠槸鍚︿篃瑕佹妸B鎵撹繘鍘� 榛樿涓嶆墦--> - <excludeTransitive>false</excludeTransitive> - <!-- 澶嶅埗鐨刯ar鏂囦欢鍘绘帀鐗堟湰淇℃伅 --> - <stripVersion>false</stripVersion> - <finalName>${project.artifactId}-${project.version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrGis.PipIrrGisApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <!-- 璁剧疆java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <!-- source锛� 婧愪唬鐮佺紪璇戠増鏈紱target锛� 鐩爣骞冲彴缂栬瘧鐗堟湰锛沞ncoding锛� 瀛楃闆嗙紪鐮併�� --> - <configuration> - <source>${java.version}</source> - <target>${java.version}</target> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- 瑙e喅璧勬簮鏂囦欢鐨勭紪鐮侀棶棰� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <configuration> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - <plugin> - <!-- 涓嬮潰瑙e喅锛氬綋杩涜Maven Lifecycle package鏃舵姤閿欙細Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)--> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <extensions>true</extensions> - </plugin> - </plugins> - </build> </project> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-gis/src/main/resources/application.yml b/pipIrr-platform/pipIrr-web/pipIrr-web-gis/src/main/resources/application.yml index 9945c2b..e777640 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-gis/src/main/resources/application.yml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-gis/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - include: global, database, database-ym, database-pj + include: global, database #actutor鐨剋eb绔彛 management: diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/pom.xml b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/pom.xml index 1363c26..d98b6bf 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/pom.xml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/pom.xml @@ -15,123 +15,4 @@ <name>pipIrr-web-remote</name> <description>web杩滅▼鎿嶄綔淇℃伅绯荤粺</description> - <build> - <plugins> - <!-- 鐢熸垚涓嶅寘鍚緷璧杍ar鐨勫彲鎵цjar鍖� - <plugin> - !- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 - - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - !- - <goals> - <goal>repackage</goal> - </goals> - - - <configuration> - !- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - - <classifier>execute</classifier> - !- 涓嶆寚瀹氱敓鎴愯矾寰勭殑璇�, 榛樿淇濆瓨鍦� ${build.directory} 涓� - - <outputDirectory>${project.build.directory}/execute</outputDirectory> - <finalName>${artifactId}-${version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - - </plugin> - --> - <!-- 鎷疯礉渚濊禆鐨刯ar鍖呭埌lib鐩綍--> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <configuration> - <!-- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - <classifier>execute</classifier> - --> - <!-- ${project.build.directory}鏄痬aven鍙橀噺锛屽唴缃殑锛岃〃绀簍arget鐩綍,濡傛灉涓嶅啓锛屽皢鍦ㄦ牴鐩綍涓嬪垱寤�/lib --> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - <!-- excludeTransitive:鏄惁涓嶅寘鍚棿鎺ヤ緷璧栧寘锛屾瘮濡傛垜浠緷璧朅锛屼絾鏄疉鍙堜緷璧栦簡B锛屾垜浠槸鍚︿篃瑕佹妸B鎵撹繘鍘� 榛樿涓嶆墦--> - <excludeTransitive>false</excludeTransitive> - <!-- 澶嶅埗鐨刯ar鏂囦欢鍘绘帀鐗堟湰淇℃伅 --> - <stripVersion>false</stripVersion> - <finalName>${project.artifactId}-${project.version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrRemote.PipIrrRemoteApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <!-- 璁剧疆java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <!-- source锛� 婧愪唬鐮佺紪璇戠増鏈紱target锛� 鐩爣骞冲彴缂栬瘧鐗堟湰锛沞ncoding锛� 瀛楃闆嗙紪鐮併�� --> - <configuration> - <source>${java.version}</source> - <target>${java.version}</target> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- 瑙e喅璧勬簮鏂囦欢鐨勭紪鐮侀棶棰� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <configuration> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - <plugin> - <!-- 涓嬮潰瑙e喅锛氬綋杩涜Maven Lifecycle package鏃舵姤閿欙細Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)--> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <extensions>true</extensions> - </plugin> - </plugins> - </build> </project> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/resources/application.yml b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/resources/application.yml index 9627a3d..aca21d0 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/resources/application.yml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - include: global, database, database-ym, database-pj + include: global, database #actutor鐨剋eb绔彛 management: diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/pom.xml b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/pom.xml index 50c030a..a9e19dc 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/pom.xml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/pom.xml @@ -36,124 +36,4 @@ <!-- 鑷姩鍒ゆ柇浣跨敤涓巗pring boot鍏煎鐨勭増鏈� --> </dependency> </dependencies> - - <build> - <plugins> - <!-- 鐢熸垚涓嶅寘鍚緷璧杍ar鐨勫彲鎵цjar鍖� - <plugin> - !- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 - - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - !- - <goals> - <goal>repackage</goal> - </goals> - - - <configuration> - !- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - - <classifier>execute</classifier> - !- 涓嶆寚瀹氱敓鎴愯矾寰勭殑璇�, 榛樿淇濆瓨鍦� ${build.directory} 涓� - - <outputDirectory>${project.build.directory}/execute</outputDirectory> - <finalName>${artifactId}-${version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - - </plugin> - --> - <!-- 鎷疯礉渚濊禆鐨刯ar鍖呭埌lib鐩綍--> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <configuration> - <!-- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - <classifier>execute</classifier> - --> - <!-- ${project.build.directory}鏄痬aven鍙橀噺锛屽唴缃殑锛岃〃绀簍arget鐩綍,濡傛灉涓嶅啓锛屽皢鍦ㄦ牴鐩綍涓嬪垱寤�/lib --> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - <!-- excludeTransitive:鏄惁涓嶅寘鍚棿鎺ヤ緷璧栧寘锛屾瘮濡傛垜浠緷璧朅锛屼絾鏄疉鍙堜緷璧栦簡B锛屾垜浠槸鍚︿篃瑕佹妸B鎵撹繘鍘� 榛樿涓嶆墦--> - <excludeTransitive>false</excludeTransitive> - <!-- 澶嶅埗鐨刯ar鏂囦欢鍘绘帀鐗堟湰淇℃伅 --> - <stripVersion>false</stripVersion> - <finalName>${project.artifactId}-${project.version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.sso.PipIrrSsoApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <!-- 璁剧疆java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <!-- source锛� 婧愪唬鐮佺紪璇戠増鏈紱target锛� 鐩爣骞冲彴缂栬瘧鐗堟湰锛沞ncoding锛� 瀛楃闆嗙紪鐮併�� --> - <configuration> - <source>${java.version}</source> - <target>${java.version}</target> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- 瑙e喅璧勬簮鏂囦欢鐨勭紪鐮侀棶棰� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <configuration> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - <plugin> - <!-- 涓嬮潰瑙e喅锛氬綋杩涜Maven Lifecycle package鏃舵姤閿欙細Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)--> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <extensions>true</extensions> - </plugin> - </plugins> - </build> </project> \ No newline at end of file diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/resources/application.yml b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/resources/application.yml index 6281a58..b5ef085 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/resources/application.yml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - include: global, database, database-ym, database-pj + include: global, database #actutor鐨剋eb绔彛 management: diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/pom.xml b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/pom.xml index b7dd239..8cda3d4 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/pom.xml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/pom.xml @@ -15,123 +15,4 @@ <name>pipIrr-web-statistics</name> <description>web缁熻鍒嗘瀽绯荤粺</description> - <build> - <plugins> - <!-- 鐢熸垚涓嶅寘鍚緷璧杍ar鐨勫彲鎵цjar鍖� - <plugin> - !- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 - - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - !- - <goals> - <goal>repackage</goal> - </goals> - - - <configuration> - !- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - - <classifier>execute</classifier> - !- 涓嶆寚瀹氱敓鎴愯矾寰勭殑璇�, 榛樿淇濆瓨鍦� ${build.directory} 涓� - - <outputDirectory>${project.build.directory}/execute</outputDirectory> - <finalName>${artifactId}-${version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - - </plugin> - --> - <!-- 鎷疯礉渚濊禆鐨刯ar鍖呭埌lib鐩綍--> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <configuration> - <!-- 涓嶅姞鐨勮瘽鏈�缁堝寘鍚嶄负: ${artifactId}-${version}.jar, 鍔犱簡鐨勮瘽鏈�缁堝寘鍚�: ${artifactId}-${version}-${classifier}.jar - <classifier>execute</classifier> - --> - <!-- ${project.build.directory}鏄痬aven鍙橀噺锛屽唴缃殑锛岃〃绀簍arget鐩綍,濡傛灉涓嶅啓锛屽皢鍦ㄦ牴鐩綍涓嬪垱寤�/lib --> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - <!-- excludeTransitive:鏄惁涓嶅寘鍚棿鎺ヤ緷璧栧寘锛屾瘮濡傛垜浠緷璧朅锛屼絾鏄疉鍙堜緷璧栦簡B锛屾垜浠槸鍚︿篃瑕佹妸B鎵撹繘鍘� 榛樿涓嶆墦--> - <excludeTransitive>false</excludeTransitive> - <!-- 澶嶅埗鐨刯ar鏂囦欢鍘绘帀鐗堟湰淇℃伅 --> - <stripVersion>false</stripVersion> - <finalName>${project.artifactId}-${project.version}</finalName> - <layout>ZIP</layout> - <mainClass>com.dy.pipIrrStatistics.PipIrrStatisticsApplication</mainClass> - <includes> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-common</artifactId> - </include> - <include> - <groupId>com.dy</groupId> - <artifactId>pipIrr-global</artifactId> - </include> - </includes> - <excludes> - <exclude> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - </exclude> - </excludes> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <!-- 璁剧疆java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <!-- source锛� 婧愪唬鐮佺紪璇戠増鏈紱target锛� 鐩爣骞冲彴缂栬瘧鐗堟湰锛沞ncoding锛� 瀛楃闆嗙紪鐮併�� --> - <configuration> - <source>${java.version}</source> - <target>${java.version}</target> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- 瑙e喅璧勬簮鏂囦欢鐨勭紪鐮侀棶棰� --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <configuration> - <encoding>${encoding}</encoding> - </configuration> - </plugin> - <plugin> - <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 --> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skipTests>true</skipTests> - </configuration> - </plugin> - <plugin> - <!-- 涓嬮潰瑙e喅锛氬綋杩涜Maven Lifecycle package鏃舵姤閿欙細Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)--> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <extensions>true</extensions> - </plugin> - </plugins> - </build> </project> diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/resources/application.yml b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/resources/application.yml index 228c7c2..0031756 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/resources/application.yml +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - include: global, database, database-ym, database-pj + include: global, database #actutor鐨剋eb绔彛 management: diff --git a/pipIrr-platform/pipIrr-web/pom.xml b/pipIrr-platform/pipIrr-web/pom.xml index ce539f0..fb95ba5 100644 --- a/pipIrr-platform/pipIrr-web/pom.xml +++ b/pipIrr-platform/pipIrr-web/pom.xml @@ -216,6 +216,58 @@ <artifactId>junit</artifactId> <scope>test</scope> </dependency> + + <!-- <!– 鍏ㄥ眬鎺掗櫎–>--> + <!-- <dependency>--> + <!-- <groupId>org.springframework.boot</groupId>--> + <!-- <artifactId>spring-boot-starter-json</artifactId>--> + <!-- <exclusions>--> + <!-- <exclusion>--> + <!-- <groupId>*</groupId>--> + <!-- <artifactId>*</artifactId>--> + <!-- </exclusion>--> + <!-- </exclusions>--> + <!-- </dependency>--> + <!-- <dependency>--> + <!-- <groupId>org.springframework.boot</groupId>--> + <!-- <artifactId>spring-boot-starter-logging</artifactId>--> + <!-- <exclusions>--> + <!-- <exclusion>--> + <!-- <groupId>*</groupId>--> + <!-- <artifactId>*</artifactId>--> + <!-- </exclusion>--> + <!-- </exclusions>--> + <!-- </dependency>--> </dependencies> + <build> + <plugins> + <plugin> + <!-- spring boot鎻愪緵鐨刴aven鎵撳寘鎻掍欢 --> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <excludes> + <exclude> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <!-- maven閲屾墽琛屾祴璇曠敤渚嬬殑鎻掍欢 --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <skipTests>true</skipTests> + </configuration> + </plugin> + <plugin> + <!-- 寮哄埗璁惧畾 java缂栬瘧鐗堟湰锛岃繍琛岀幆澧冪増鏈� --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + </plugins> + </build> </project> \ No newline at end of file diff --git a/pipIrr-platform/pom.xml b/pipIrr-platform/pom.xml index 1732cbc..bc6e48a 100644 --- a/pipIrr-platform/pom.xml +++ b/pipIrr-platform/pom.xml @@ -361,4 +361,4 @@ </plugins> </pluginManagement> </build> -</project> \ No newline at end of file +</project> diff --git "a/pipIrr-platform/\346\226\207\346\241\243/Git\346\223\215\344\275\234.txt" "b/pipIrr-platform/\346\226\207\346\241\243/Git\346\223\215\344\275\234.txt" deleted file mode 100644 index 9294710..0000000 --- "a/pipIrr-platform/\346\226\207\346\241\243/Git\346\223\215\344\275\234.txt" +++ /dev/null @@ -1,2 +0,0 @@ -push涔嬪墠鍏坧ull -pull鍓嶈鍏坈ommit \ No newline at end of file diff --git "a/pipIrr-platform/\346\226\207\346\241\243/Maven \346\211\223\345\214\205\346\217\222\344\273\266 maven-jar-plugin.docx" "b/pipIrr-platform/\346\226\207\346\241\243/Maven \346\211\223\345\214\205\346\217\222\344\273\266 maven-jar-plugin.docx" deleted file mode 100644 index ea62d10..0000000 --- "a/pipIrr-platform/\346\226\207\346\241\243/Maven \346\211\223\345\214\205\346\217\222\344\273\266 maven-jar-plugin.docx" +++ /dev/null Binary files differ diff --git "a/pipIrr-platform/\346\226\207\346\241\243/Maven\346\211\223\345\214\205.docx" "b/pipIrr-platform/\346\226\207\346\241\243/Maven\346\211\223\345\214\205.docx" deleted file mode 100644 index 4b1a0a9..0000000 --- "a/pipIrr-platform/\346\226\207\346\241\243/Maven\346\211\223\345\214\205.docx" +++ /dev/null Binary files differ diff --git "a/pipIrr-platform/\346\226\207\346\241\243/Maven\347\232\204maven-compiler-plugin\346\217\222\344\273\266.docx" "b/pipIrr-platform/\346\226\207\346\241\243/Maven\347\232\204maven-compiler-plugin\346\217\222\344\273\266.docx" deleted file mode 100644 index 88a43ce..0000000 --- "a/pipIrr-platform/\346\226\207\346\241\243/Maven\347\232\204maven-compiler-plugin\346\217\222\344\273\266.docx" +++ /dev/null Binary files differ diff --git "a/pipIrr-platform/\346\226\207\346\241\243/\345\234\250\347\272\277\351\234\200\346\261\202\346\226\207\344\273\266\350\256\277\351\227\256\345\234\260\345\235\200.txt" "b/pipIrr-platform/\346\226\207\346\241\243/\345\234\250\347\272\277\351\234\200\346\261\202\346\226\207\344\273\266\350\256\277\351\227\256\345\234\260\345\235\200.txt" index b709088..61ce6a3 100644 --- "a/pipIrr-platform/\346\226\207\346\241\243/\345\234\250\347\272\277\351\234\200\346\261\202\346\226\207\344\273\266\350\256\277\351\227\256\345\234\260\345\235\200.txt" +++ "b/pipIrr-platform/\346\226\207\346\241\243/\345\234\250\347\272\277\351\234\200\346\261\202\346\226\207\344\273\266\350\256\277\351\227\256\345\234\260\345\235\200.txt" @@ -1,2 +1 @@ -https://docs.qq.com/desktop -https://lanhuapp.com/link/#/invite?sid=lX0nqhHU \ No newline at end of file +https://docs.qq.com/doc/DRHBkeVlCekp1d1RU \ No newline at end of file diff --git "a/pipIrr-platform/\346\226\207\346\241\243/\345\242\236\345\212\240\344\270\200\344\270\252\345\272\224\347\224\250\346\234\272\346\236\204.docx" "b/pipIrr-platform/\346\226\207\346\241\243/\345\242\236\345\212\240\344\270\200\344\270\252\345\272\224\347\224\250\346\234\272\346\236\204.docx" index aaf2d3c..7b69488 100644 --- "a/pipIrr-platform/\346\226\207\346\241\243/\345\242\236\345\212\240\344\270\200\344\270\252\345\272\224\347\224\250\346\234\272\346\236\204.docx" +++ "b/pipIrr-platform/\346\226\207\346\241\243/\345\242\236\345\212\240\344\270\200\344\270\252\345\272\224\347\224\250\346\234\272\346\236\204.docx" Binary files differ diff --git "a/pipIrr-platform/\346\226\207\346\241\243/\347\274\226\347\240\201\350\256\276\350\256\241.docx" "b/pipIrr-platform/\346\226\207\346\241\243/\347\274\226\347\240\201\350\256\276\350\256\241.docx" deleted file mode 100644 index a42ca3a..0000000 --- "a/pipIrr-platform/\346\226\207\346\241\243/\347\274\226\347\240\201\350\256\276\350\256\241.docx" +++ /dev/null Binary files differ -- Gitblit v1.8.0