diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java new file mode 100644 index 0000000..68e18a9 --- /dev/null +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java @@ -0,0 +1,86 @@ +package cn.estsh.i3plus.pojo.base.enumutil; + +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * @Description : + * @Reference : + * @Author : alwaysfrin + * @CreateDate : 2018-10-23 15:53 + * @Modify: + **/ +public class MesPcnEnumUtil { + /** + * PCN同步MES主数据同步方式枚举 + * 10. + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum SYNC_PATTERN{ + + UPDATE(1,"修改或新增"), + INSERT(2,"新增"); + + private int value; + private String description; + + SYNC_PATTERN(int value, String description) { + this.value = value; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static String valueOfDescription(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** + * PCN同步MES主数据同步类型枚举 + * 10. + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum SYNC_TYPE{ + + GET_MES_DATA(1,"pcn获取mes数据"), + DATA_TO_MES(2,"pcn推送数据至mes"); + + private int value; + private String description; + + SYNC_TYPE(int value, String description) { + this.value = value; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static String valueOfDescription(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + } +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPart.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPart.java index 504a987..785ecb7 100644 --- a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPart.java +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPart.java @@ -12,6 +12,7 @@ import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; +import javax.persistence.Transient; /** * @Description :物料信息 @@ -71,4 +72,8 @@ public class MesPart extends BaseBean { @Column(name="PRODUCE_CATEGORY") @ApiParam("产品类型") private String produceCategory; + + @Transient + @ApiParam("分类名称") + private String categoryName; } diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPcn.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPcn.java new file mode 100644 index 0000000..26b99b7 --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPcn.java @@ -0,0 +1,46 @@ +package cn.estsh.i3plus.pojo.mes.pcn.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.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * @Description: + * @Reference: + * @Author: yiming.gu + * @CreateDate:2019-04-22-17:20 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="MES_PCN") +@Api("PCN节点") +public class MesPcn extends BaseBean { + @Column(name="PCN_CODE") + @ApiParam("PCN代码") + private String pcnCode; + + @Column(name="PCN_NAME") + @ApiParam("PCN名称") + private String pcnName; + + @Column(name="AREA_CODE") + @ApiParam("区域") + private String areaCode; + + @Column(name="WORK_CENTER_CODE") + @ApiParam("工作中心") + private String workCentreCode; + +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPcnSyncCfg.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPcnSyncCfg.java new file mode 100644 index 0000000..b444b59 --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPcnSyncCfg.java @@ -0,0 +1,80 @@ +package cn.estsh.i3plus.pojo.mes.pcn.bean; + +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +import com.fasterxml.jackson.annotation.JsonFormat; +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.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * @Description: + * @Reference: + * @Author: yiming.gu + * @CreateDate:2019-04-22-17:32 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="MES_PCN_SYNC_CFG") +@Api("MES_PCN_同步配置") +public class MesPcnSyncCfg extends BaseBean { + @Column(name="PCN_CODE") + @ApiParam("PCN代码") + private String pcnCode; + + @Column(name="OBJECT_CODE") + @ApiParam("对象代码") + private String objectCode; + + @Column(name="OBJECT_NAME") + @ApiParam("对象名称") + private String objectName; + + @Column(name="OBJECT_KEY") + @ApiParam("对象主键") + private String objectKey; + + @Column(name="SYNC_FREQUENCY") + @ApiParam("同步频率") + private Integer syncFrequency; + + @Column(name="SYNC_TIME") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiParam(value ="同步时间") + private String syncTime; + + @Column(name="SYNC_PATTERN")//2、新增 1、修改 + @ApiParam("同步方式") + private Integer syncPattern; + + @Column(name="SYNC_TYPE")//1\pcn获取mes数据 2、pcn推送数据至mes + @ApiParam("同步类型") + private Integer syncType; + + @Column(name="LAST_SYNC_TIME") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiParam(value ="上一同步时间") + private String lastSyncTime; + + public int getSyncFrequencyVal() { + return this.syncFrequency == null ? 0 : this.syncFrequency; + } + + public int getSyncTypeVal() { + return this.syncType == null ? 0 : this.syncType; + } + + public int getSyncPatternVal() { + return this.syncPattern == null ? 0 : this.syncPattern; + } +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPcnSyncErrorLog.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPcnSyncErrorLog.java new file mode 100644 index 0000000..a2d045a --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPcnSyncErrorLog.java @@ -0,0 +1,50 @@ +package cn.estsh.i3plus.pojo.mes.pcn.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.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * @Description: + * @Reference: + * @Author: yiming.gu + * @CreateDate:2019-04-22-17:20 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="MES_PCN_SYNC_ERRORLOG") +@Api("MES_PCN同步异常日志") +public class MesPcnSyncErrorLog extends BaseBean { + @Column(name="PCN_CODE") + @ApiParam("PCN代码") + private String pcnCode; + + @Column(name="OBJECT_CODE") + @ApiParam("对象代码") + private String objectCode; + + @Column(name="OBJECT_NAME") + @ApiParam("对象名称") + private String objectName; + + @Column(name="ERROR_SPOT") + @ApiParam("异常位置") + private String errorSpot; + + @Column(name="ERROR_CONTENT") + @ApiParam("异常内容") + private String errorContent; + +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPcnSyncCfgRepository.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPcnSyncCfgRepository.java new file mode 100644 index 0000000..256e8da --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPcnSyncCfgRepository.java @@ -0,0 +1,16 @@ +package cn.estsh.i3plus.pojo.mes.pcn.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.mes.pcn.bean.MesPcnSyncCfg; +import org.springframework.stereotype.Repository; + +/** + * @Description: + * @Reference: + * @Author: yiming.gu + * @CreateDate:2019-04-24-17:13 + * @Modify: + **/ +@Repository +public interface MesPcnSyncCfgRepository extends BaseRepository { +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPcnSyncErrorLogRepository.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPcnSyncErrorLogRepository.java new file mode 100644 index 0000000..a217480 --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPcnSyncErrorLogRepository.java @@ -0,0 +1,16 @@ +package cn.estsh.i3plus.pojo.mes.pcn.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.mes.pcn.bean.MesPcnSyncErrorLog; +import org.springframework.stereotype.Repository; + +/** + * @Description: + * @Reference: + * @Author: yiming.gu + * @CreateDate:2019-04-24-17:13 + * @Modify: + **/ +@Repository +public interface MesPcnSyncErrorLogRepository extends BaseRepository { +} diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesObjectDao.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesObjectDao.java new file mode 100644 index 0000000..da55753 --- /dev/null +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesObjectDao.java @@ -0,0 +1,39 @@ +package cn.estsh.i3plus.pojo.mes.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.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +/** + * @Description :MES_对象与dao对应关系 + * @Reference : + * @Author : yiming.gu + * @CreateDate : 2019-04-23 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="MES_OBJECT_DAO") +@Api("MES_对象与dao对应关系") +public class MesObjectDao extends BaseBean { + @Column(name="OBJECT_CODE") + @ApiParam("对象代码") + private String objectCode; + + @Column(name="DAO_CLASS") + @ApiParam("dao层类名") + private String daoClass; + +} diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesObjectDaoRepository.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesObjectDaoRepository.java new file mode 100644 index 0000000..d29df0f --- /dev/null +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesObjectDaoRepository.java @@ -0,0 +1,16 @@ +package cn.estsh.i3plus.pojo.mes.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.mes.bean.MesObjectDao; +import org.springframework.stereotype.Repository; + +/** + * @Description: + * @Reference: + * @Author: yiming.gu + * @CreateDate:2019-04-23 + * @Modify: + **/ +@Repository +public interface MesObjectDaoRepository extends BaseRepository { +}