From e11e83330959d4a31ad73bf58767a60d66f63595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E4=BA=91=E6=98=8A?= Date: Sun, 27 Sep 2020 13:26:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?refactor(opcua):=E8=B0=83=E6=95=B4pojo?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/i3plus-pojo-hardswitch/pom.xml | 6 ++ .../i3plus/pojo/hardswitch/bean/OpcUAParam.java | 69 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 modules/i3plus-pojo-hardswitch/src/main/java/cn/estsh/i3plus/pojo/hardswitch/bean/OpcUAParam.java diff --git a/modules/i3plus-pojo-hardswitch/pom.xml b/modules/i3plus-pojo-hardswitch/pom.xml index 0a44fb0..dc13374 100644 --- a/modules/i3plus-pojo-hardswitch/pom.xml +++ b/modules/i3plus-pojo-hardswitch/pom.xml @@ -42,6 +42,12 @@ + + + i3plus.pojo + i3plus-pojo-base + + ${project.artifactId}-${project.version} diff --git a/modules/i3plus-pojo-hardswitch/src/main/java/cn/estsh/i3plus/pojo/hardswitch/bean/OpcUAParam.java b/modules/i3plus-pojo-hardswitch/src/main/java/cn/estsh/i3plus/pojo/hardswitch/bean/OpcUAParam.java new file mode 100644 index 0000000..654b74b --- /dev/null +++ b/modules/i3plus-pojo-hardswitch/src/main/java/cn/estsh/i3plus/pojo/hardswitch/bean/OpcUAParam.java @@ -0,0 +1,69 @@ +package cn.estsh.i3plus.pojo.hardswitch.bean; + +import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn; +import io.swagger.annotations.ApiParam; +import lombok.Data; + +/** + * @Description : + * @Reference : + * @Author : yunhao + * @CreateDate : 2019-11-12 17:03 + * @Modify: + **/ +@Data +public class OpcUAParam { + + //opc.tcp://127.0.0.1:49320 + @ApiParam("ua服务地址") + private String serverUrl; + + /** + * 命名空间索引 + * 地址所在的 OPC UA 服务器命名空间的索引。 + */ + @ApiParam("命名空间索引") + private Integer namespaceIndex; + + /** + * 标记地址 + * 通道.设备.标记 + */ + @ApiParam("标记地址") + private String tagAddress; + + /** + * 标记值 + */ + @ApiParam("标记值") + private String tagValue; + + /** + * 标记值类型 + */ + @ApiParam("标记值类型") +// @AnnoOutputColumn(refClass = OpcUAEnumUtil.OPC_UA_TAG_VALUE_TYPE.class) + private String tagValueType; + public String getTagValueTypeVal(){ + return tagValueType == null ? "10" : tagValueType; + } + + /** + * 用户名 + */ + @ApiParam("用户名") + private String userName; + + /** + * 用户密码 + */ + @ApiParam("用户密码") + private String password; + + /** + * 请求间隔 + */ + @ApiParam("请求间隔") + private Double requestInterval = 500.0; + +} From 0d20685a5570e0a5ca68f4f2e06fee8b1a61deaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E4=BA=91=E6=98=8A?= Date: Mon, 28 Sep 2020 16:06:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix(softswitch):ftp=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=99=A8=E5=B9=B6=E5=8F=91=E8=AF=BB=E5=8F=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/model/softswitch/SuitServerModel.java | 1 + .../estsh/i3plus/pojo/softswitch/bean/BsSuitCaseFTP.java | 3 +++ .../cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java | 15 +++++++++++++++ .../estsh/i3plus/pojo/softswitch/bean/BsSuitRecord.java | 1 + .../i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java | 9 +++++++++ 5 files changed, 29 insertions(+) diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/softswitch/SuitServerModel.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/softswitch/SuitServerModel.java index e859e21..f80ec78 100644 --- a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/softswitch/SuitServerModel.java +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/softswitch/SuitServerModel.java @@ -41,6 +41,7 @@ public class SuitServerModel implements Serializable { private String requestId; // 传输单对象 @XmlElement(name = "data") + @XStreamAlias("data") private Object obj; // 传输集合 private List list; diff --git a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitCaseFTP.java b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitCaseFTP.java index 93a159f..bce2e0d 100644 --- a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitCaseFTP.java +++ b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitCaseFTP.java @@ -123,6 +123,9 @@ public class BsSuitCaseFTP extends BaseBean { @Transient @ApiParam(value = "临时适配路径") private String tempSuitFilePath; + @Transient + @ApiParam(value = "临时适配路径") + private List ftpFileList; @Transient @ApiParam(value = "适配文件列表") diff --git a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java index 7e2b460..9e98bc4 100644 --- a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java +++ b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java @@ -85,4 +85,19 @@ public class BsSuitFile extends BaseBean { @ApiParam(value = "处理时间") private String processTime; + public void setFtpPathInfo(String ftpPathInfo){ + if(ftpPathInfo == null){ + return; + } + + int pathIdx = ftpPathInfo.lastIndexOf("/"); + if (pathIdx == -1) { + this.setFolderPath("/"); + this.setFileName(ftpPathInfo); + }else{ + this.setFolderPath(ftpPathInfo.substring(0,pathIdx+1)); + this.setFileName(ftpPathInfo.substring(pathIdx + 1)); + } + } + } diff --git a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitRecord.java b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitRecord.java index d3af46c..f13d15b 100644 --- a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitRecord.java +++ b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitRecord.java @@ -128,6 +128,7 @@ public class BsSuitRecord extends BaseBean { @Column(name = "PROCESS_STATE") @ApiParam(value = "处理状态") + @AnnoOutputColumn(refClass = BlockSoftSwitchEnumUtil.SUIT_PROCESS_STATUS.class) private Integer processState; @Column(name = "PROCESS_TIME") diff --git a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java index cfa357f..e163e9e 100644 --- a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java +++ b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java @@ -430,4 +430,13 @@ public class SoftSwitchHqlPack { DdlPreparedPack.getNumEqualPack(bsBusiScript.getRefId(),"refId",ddlPackBean); return ddlPackBean; } + + public static DdlPackBean packHqlCheckSuitFile(BsSuitFile bsSuitFile){ + DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(bsSuitFile); + DdlPreparedPack.getNumEqualPack(bsSuitFile.getSuitCaseId(), "suitCaseId", ddlPackBean); + DdlPreparedPack.getStringEqualPack(bsSuitFile.getFileName(),"fileName",ddlPackBean); + DdlPreparedPack.getStringEqualPack(bsSuitFile.getFolderPath(),"folderPath",ddlPackBean); + DdlPreparedPack.getNumNOEqualPack(bsSuitFile.getId(),"id",ddlPackBean); + return ddlPackBean; + } } From 21f77a0e7b9b30247c96c66a8e9ef10f03da2fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E4=BA=91=E6=98=8A?= Date: Mon, 28 Sep 2020 18:55:19 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix(softswitch):ftp=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=99=A8=E5=B9=B6=E5=8F=91=E8=AF=BB=E5=8F=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java | 2 +- .../java/cn/estsh/i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java index 9e98bc4..7d4b198 100644 --- a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java +++ b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/bean/BsSuitFile.java @@ -95,7 +95,7 @@ public class BsSuitFile extends BaseBean { this.setFolderPath("/"); this.setFileName(ftpPathInfo); }else{ - this.setFolderPath(ftpPathInfo.substring(0,pathIdx+1)); + this.setFolderPath(ftpPathInfo.substring(0,pathIdx)); this.setFileName(ftpPathInfo.substring(pathIdx + 1)); } } diff --git a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java index e163e9e..2d9e16d 100644 --- a/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java +++ b/modules/i3plus-pojo-softswitch/src/main/java/cn/estsh/i3plus/pojo/softswitch/sqlpack/SoftSwitchHqlPack.java @@ -387,6 +387,7 @@ public class SoftSwitchHqlPack { DdlPreparedPack.getStringLikerPack(bsSuitFile.getSuitCaseCode(),"suitCaseCode",ddlPackBean); DdlPreparedPack.getNumEqualPack(bsSuitFile.getSuitCaseId(), "suitCaseId", ddlPackBean); DdlPreparedPack.getStringLikerPack(bsSuitFile.getFileName(), "fileName", ddlPackBean); + DdlPreparedPack.getStringLikerPack(bsSuitFile.getFolderPath(), "folderPath", ddlPackBean); DdlPreparedPack.timeBuilder(bsSuitFile.getSuitDateTime(), "suitDateTime", ddlPackBean, false, true); ddlPackBean.setOrderByStr(bsSuitFile.orderBy()); From 815daba16d68be12c54ecd52f3c9d35f1477a07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E4=BA=91=E6=98=8A?= Date: Mon, 28 Sep 2020 18:56:05 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat(softswitch):ftp=E9=80=82=E9=85=8D?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8C=89=E6=96=87=E4=BB=B6=E5=90=8D=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/model/softswitch/SuitRecordModel.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/softswitch/SuitRecordModel.java diff --git a/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/softswitch/SuitRecordModel.java b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/softswitch/SuitRecordModel.java new file mode 100644 index 0000000..5367486 --- /dev/null +++ b/modules/i3plus-pojo-model/src/main/java/cn/estsh/i3plus/pojo/model/softswitch/SuitRecordModel.java @@ -0,0 +1,33 @@ +package cn.estsh.i3plus.pojo.model.softswitch; + +import cn.estsh.i3plus.pojo.softswitch.bean.BsSuitFile; +import cn.estsh.i3plus.pojo.softswitch.bean.BsSuitRecord; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Description : + * @Reference : + * @Author : yunhao + * @CreateDate : 2020-09-28 17:48 + * @Modify: + **/ +@Data +@ApiModel("适配记录模型") +public class SuitRecordModel { + + @ApiModelProperty("主记录") + private BsSuitRecord bsSuitRecord; + + @ApiModelProperty("适配文件") + private BsSuitFile bsSuitFile; + + public SuitRecordModel() { + } + + public SuitRecordModel(BsSuitRecord bsSuitRecord, BsSuitFile bsSuitFile) { + this.bsSuitRecord = bsSuitRecord; + this.bsSuitFile = bsSuitFile; + } +}