diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java index bdcae3c..bcf68f3 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/PtlPcnEnumUtil.java @@ -417,6 +417,15 @@ public class PtlPcnEnumUtil { this.description = description; } + public static TAG_LIGHT_TYPE getByValue(int value) { + for (TAG_LIGHT_TYPE tagLightType : values()) { + if (tagLightType.getValue() == value) { + return tagLightType; + } + } + return null; + } + public int getValue() { return value; } @@ -680,21 +689,22 @@ public class PtlPcnEnumUtil { } @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum MonitorProcessMessageType { + public enum MONITOR_PROCESS_MESSAGE_TYPE { CONNECT_CONTROL_CMD(10, "CONNECT_CONTROL_CMD", "connectControlService", "连接控制器"), DISCONNECT_CONTROL_CMD(20, "DISCONNECT_CONTROL_CMD", "disconnectControlService", "断开控制器"), - EXCEPTION__DISCONNECT_CONTROL_CMD(25, "EXCEPTION_DISCONNECT_CONTROL_CMD", "disconnectControlService", "断开控制器"), + EXCEPTION_DISCONNECT_CONTROL_CMD(25, "EXCEPTION_DISCONNECT_CONTROL_CMD", "disconnectControlService", "断开控制器"), LIGHT_ON_CMD(30, "LIGHT_ON_CMD", "lightOnService", "亮灯命令"), LIGHT_OFF_CMD(40, "LIGHT_OFF_CMD", "lightOffService", "灭灯命令"), CONTROL_SIGNAL_CMD(50, "CONTROL_SIGNAL_CMD", "controlSignalService", "控制器反馈信号"), - INTERFACE_SIGNAL_CMD(60, "INTERFACE_SIGNAL_CMD", "", "发送给界面actor通过websocket返回"); + INTERFACE_SIGNAL_CMD(60, "INTERFACE_SIGNAL_CMD", "", "发送给界面actor通过websocket返回"), + REFRESH_CONTROL_CMD(70, "REFRESH_CONTROL_CMD", "refreshControlService", "刷新"); private int value; private String code; private String callClass; private String description; - MonitorProcessMessageType(int value, String code, String callClass, String description) { + MONITOR_PROCESS_MESSAGE_TYPE(int value, String code, String callClass, String description) { this.value = value; this.code = code; this.callClass = callClass; @@ -717,11 +727,11 @@ public class PtlPcnEnumUtil { return description; } - public static MonitorProcessMessageType getTypeByValue(String code) { + public static MONITOR_PROCESS_MESSAGE_TYPE getTypeByValue(String code) { if (StringUtils.isEmpty(code)) { return null; } - for (MonitorProcessMessageType enums : MonitorProcessMessageType.values()) { + for (MONITOR_PROCESS_MESSAGE_TYPE enums : MONITOR_PROCESS_MESSAGE_TYPE.values()) { if (enums.getCode().equals(code)) { return enums; } @@ -731,13 +741,13 @@ public class PtlPcnEnumUtil { } @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum InterfaceSignalMessageType { + public enum INTERFACE_SIGNAL_MESSAGE_TYPE { CONNECT_CONTROL_CMD(10, "CONNECT_CONTROL_CMD", "connectControlService", "连接控制器"), DISCONNECT_CONTROL_CMD(20, "DISCONNECT_CONTROL_CMD", "disconnectControlService", "断开控制器"), REFRESH_CONTROL_CMD(30, "REFRESH_CONTROL_CMD", "refreshControlService", "刷新"), SCAN_CONTROL_CMD(40, "SCAN_CONTROL_CMD", "scanControlService", "扫描"), INIT_MODULE_CONTROL_CMD(50, "INIT_MODULE_CONTROL_CMD", "initModuleControlService", "初始化页面"), - GET_CONTROL_DATA_CONTROL_CMD(50, "GET_CONTROL_DATA_CONTROL_CMD", "getControlDataControlService", "获取控制器数据"); + GET_CONTROL_DATA_CONTROL_CMD(60, "GET_CONTROL_DATA_CONTROL_CMD", "getControlDataControlService", "获取控制器数据"); // UNLOCK_CONTROL_CMD(50, "UNLOCK_CONTROL_CMD", "unlockControlService", "解锁"), // LABEL_SELF_CHECK_CONTROL_CMD(60, "labelSelfCheck", "labelSelfCheckControlService", "标签自检"), // LIGHT_DETAIL_CONTROL_CMD(70, "LABEL_SELF_CHECK_CONTROL_CMD", "lightDetailControlService", "亮灯明细"); @@ -747,7 +757,7 @@ public class PtlPcnEnumUtil { private String callClass; private String description; - InterfaceSignalMessageType(int value, String code, String callClass, String description) { + INTERFACE_SIGNAL_MESSAGE_TYPE(int value, String code, String callClass, String description) { this.value = value; this.code = code; this.callClass = callClass; @@ -770,11 +780,11 @@ public class PtlPcnEnumUtil { return description; } - public static InterfaceSignalMessageType getTypeByValue(String code) { + public static INTERFACE_SIGNAL_MESSAGE_TYPE getTypeByValue(String code) { if (StringUtils.isEmpty(code)) { return null; } - for (InterfaceSignalMessageType enums : InterfaceSignalMessageType.values()) { + for (INTERFACE_SIGNAL_MESSAGE_TYPE enums : INTERFACE_SIGNAL_MESSAGE_TYPE.values()) { if (enums.getCode().equals(code)) { return enums; } @@ -783,25 +793,33 @@ public class PtlPcnEnumUtil { } } + /** + * 生成任务actor message type + */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum WsBusiType { - MONITOR_PROCESS(10, "MONITOR_PROCESS", "控制器相关"), - INTERFACE_PROCESS(10, "INTERFACE_PROCESS", "界面处理"); + public enum GEN_TASK_MESSAGE_TYPE { + GEN_TASK_CMD(10, "GEN_TASK_CMD", "", "生成任务"); private int value; private String code; + private String callClass; private String description; - WsBusiType(int value, String code, String description) { + GEN_TASK_MESSAGE_TYPE(int value, String code, String callClass, String description) { this.value = value; - this.description = description; this.code = code; + this.callClass = callClass; + this.description = description; } public int getValue() { return value; } + public String getCallClass() { + return callClass; + } + public String getCode() { return code; } @@ -809,22 +827,33 @@ public class PtlPcnEnumUtil { public String getDescription() { return description; } + + public static INTERFACE_SIGNAL_MESSAGE_TYPE getTypeByValue(String code) { + if (StringUtils.isEmpty(code)) { + return null; + } + for (INTERFACE_SIGNAL_MESSAGE_TYPE enums : INTERFACE_SIGNAL_MESSAGE_TYPE.values()) { + if (enums.getCode().equals(code)) { + return enums; + } + } + return null; + } } @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum WsDataType { - TEXT(10, "TEXT", "正常信息"), - EXP_TEXT(20, "EXP_TEXT", "异常信息"), - TABLE(30, "TABLE", "表格"); + public enum WsBusiType { + MONITOR_PROCESS(10, "MONITOR_PROCESS", "控制器相关"), + INTERFACE_PROCESS(20, "INTERFACE_PROCESS", "界面处理"); private int value; private String code; private String description; - WsDataType(int value, String code, String description) { + WsBusiType(int value, String code, String description) { this.value = value; - this.code = code; this.description = description; + this.code = code; } public int getValue() { @@ -841,16 +870,16 @@ public class PtlPcnEnumUtil { } @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum STATUS_TYPE { - START(10, "START", "开始状态"), - FINISH(20, "FINISH", "完成状态"), - TERMINATE(30, "TERMINATE", "中断状态"); + public enum WsDataType { + TEXT(10, "TEXT", "正常信息"), + EXP_TEXT(20, "EXP_TEXT", "异常信息"), + TABLE(30, "TABLE", "表格"); private int value; private String code; private String description; - STATUS_TYPE(int value, String code, String description) { + WsDataType(int value, String code, String description) { this.value = value; this.code = code; this.description = description; @@ -870,15 +899,16 @@ public class PtlPcnEnumUtil { } @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum AREA_SECTION_TASK_DETAIL_STATUS { - CREATE(10, "CREATE", "创建"), - COMPLETE(20, "COMPLETE", "完成"); + public enum STATUS_TYPE { + START(10, "START", "开始状态"), + FINISH(20, "FINISH", "完成状态"), + TERMINATE(30, "TERMINATE", "中断状态"); private int value; private String code; private String description; - AREA_SECTION_TASK_DETAIL_STATUS(int value, String code, String description) { + STATUS_TYPE(int value, String code, String description) { this.value = value; this.code = code; this.description = description; @@ -897,22 +927,18 @@ public class PtlPcnEnumUtil { } } - /** - * 生成任务actor message type - */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum GenTaskMessageType { - GEN_TASK_CMD(10, "GEN_TASK_CMD", "", "生成任务"); + public enum AREA_SECTION_TASK_DETAIL_STATUS { + CREATE(10, "CREATE", "创建"), + COMPLETE(20, "COMPLETE", "完成"); private int value; private String code; - private String callClass; private String description; - GenTaskMessageType(int value, String code, String callClass, String description) { + AREA_SECTION_TASK_DETAIL_STATUS(int value, String code, String description) { this.value = value; this.code = code; - this.callClass = callClass; this.description = description; } @@ -920,10 +946,6 @@ public class PtlPcnEnumUtil { return value; } - public String getCallClass() { - return callClass; - } - public String getCode() { return code; } @@ -931,18 +953,6 @@ public class PtlPcnEnumUtil { public String getDescription() { return description; } - - public static InterfaceSignalMessageType getTypeByValue(String code) { - if (StringUtils.isEmpty(code)) { - return null; - } - for (InterfaceSignalMessageType enums : InterfaceSignalMessageType.values()) { - if (enums.getCode().equals(code)) { - return enums; - } - } - return null; - } } /** diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/annotation/ElasticSearch.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/annotation/ElasticSearch.java new file mode 100644 index 0000000..e31f9c1 --- /dev/null +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/annotation/ElasticSearch.java @@ -0,0 +1,15 @@ +package cn.estsh.i3plus.pojo.ptl.annotation; + + +import java.lang.annotation.*; + +/** + * @Author: Wynne.Lu + * @CreateDate: 2019/12/25 1:45 下午 + * @Description: + **/ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +@Documented +public @interface ElasticSearch { +} diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/annotation/Json4Es.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/annotation/Json4Es.java new file mode 100644 index 0000000..b169b83 --- /dev/null +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/annotation/Json4Es.java @@ -0,0 +1,15 @@ +package cn.estsh.i3plus.pojo.ptl.annotation; + + +import java.lang.annotation.*; + +/** + * @Author: Wynne.Lu + * @CreateDate: 2019/12/25 1:45 下午 + * @Description: + **/ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD}) +@Documented +public @interface Json4Es { +} diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlAreaTask.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlAreaTask.java index 64e3c64..cb738fd 100644 --- a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlAreaTask.java +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlAreaTask.java @@ -31,7 +31,7 @@ public class PtlAreaTask extends BaseBean implements Serializable { @Column(name = "AREA_TASK_NO") @ApiParam("区域任务编号") - private Long areaTaskNo; + private String areaTaskNo; @Column(name = "AREA_NO") @ApiParam("区域代码") diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlSyncDeadLetter.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlSyncDeadLetter.java new file mode 100644 index 0000000..0de2878 --- /dev/null +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/bean/PtlSyncDeadLetter.java @@ -0,0 +1,56 @@ +package cn.estsh.i3plus.pojo.ptl.bean; + + +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiParam; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * @Author: Wynne.Lu + * @CreateDate: 2020/02/15 1:45 PM + * @Description: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name = "PTL_SYNC_DEAD_LETTER", indexes = { + @Index(name = "idx_object_code_pcn", columnList = "OBJECT_CODE"), + @Index(name = "idx_object_code_pcn", columnList = "PCN_CODE") +}) +@Api("数据同步死信") +public class PtlSyncDeadLetter extends BaseBean implements Serializable { + private static final long serialVersionUID = 1151025992437433734L; + + @Column(name = "OBJECT_CODE") + @ApiParam("对象代码") + private String objectCode; + + @Column(name = "SYNC_TYPE") + @ApiParam("同步类型") + private Integer syncType; + + @Column(name = "PCN_CODE") + @ApiParam("pcn代码") + private String pcnCode; + + @Lob + @Column(name = "EX_MSG") + @ApiParam("同步数据") + private String exMsg; + + @Lob + @Column(name = "DATA") + @ApiParam("同步数据") + private String data; + + +} diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/CommonMsgModel.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/CommonMsgModel.java index 34116b7..13576e2 100644 --- a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/CommonMsgModel.java +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/CommonMsgModel.java @@ -1,5 +1,6 @@ package cn.estsh.i3plus.pojo.ptl.model; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.ptl.bean.PtlRouteStatus; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -29,6 +30,9 @@ public class CommonMsgModel implements Serializable { @ApiModelProperty("消息类型") private String msgType; + @ApiModelProperty("是否重试") + private Integer isRestart= CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); + @ApiModelProperty("消息数据") private Map msgData; diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/LightOnModel.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/LightOnModel.java index 549116a..7dd41d4 100644 --- a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/LightOnModel.java +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/LightOnModel.java @@ -1,18 +1,47 @@ package cn.estsh.i3plus.pojo.ptl.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiParam; import lombok.Data; import lombok.ToString; import java.io.Serializable; /** - * @author Wynne.Lu + * @author wangjie * @date 2020/2/15 15:42 * @desc */ @Data -@ToString +@ApiModel("亮灯model") public class LightOnModel implements Serializable { private static final long serialVersionUID = -1089361557513425229L; + @ApiParam("标签地址,范围1~250,设置null即为所有标签") + private Integer tagNo; + + @ApiParam("内容:字母,数字,字符") + private String content; + + @ApiParam("颜色指令:枚举获取,TAG_LIGHT_COLOR_CMD") + private String colorCmd; + + @ApiParam("亮灯方式") + private Integer lightType; + + @ApiParam("音乐编号指令:枚举获取,FINISH_TAG_LIGHT_MUSIC_CMD") + private String musicCmd; + + @ApiParam("音量值指令:枚举获取,FINISH_TAG_LIGHT_VOLUME_CMD") + private String volumeCmd; + + @ApiParam("是否蜂鸣") + private Integer buzz; + + @ApiParam("是否熄灯,清除LED显示器") + private Integer ledFlag; + + @ApiParam("是否熄灯") + private Integer lightFlag; + } diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/ProductDataModel.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/ProductDataModel.java new file mode 100644 index 0000000..c4bbcd4 --- /dev/null +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/model/ProductDataModel.java @@ -0,0 +1,24 @@ +package cn.estsh.i3plus.pojo.ptl.model; + + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@Api("产品包装model") +public class ProductDataModel { + + @ApiParam("字段代码") + private String fieldCode; + + @ApiParam("字段名称") + private String fieldName; + + @ApiParam("字段值") + private String fieldValue; +} diff --git a/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/repository/PtlSyncDeadLetterRepository.java b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/repository/PtlSyncDeadLetterRepository.java new file mode 100644 index 0000000..5f9062a --- /dev/null +++ b/modules/i3plus-pojo-ptl/src/main/java/cn/estsh/i3plus/pojo/ptl/repository/PtlSyncDeadLetterRepository.java @@ -0,0 +1,12 @@ +package cn.estsh.i3plus.pojo.ptl.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.ptl.bean.PtlSyncDeadLetter; + +/** + * @author Wynne.Lu + * @date 2020/2/18 09:19 + * @desc + */ +public interface PtlSyncDeadLetterRepository extends BaseRepository { +}