diff --git a/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonManageQueue.java b/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonManageQueue.java index 1291f43..64780b0 100644 --- a/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonManageQueue.java +++ b/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonManageQueue.java @@ -10,10 +10,7 @@ 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; -import javax.persistence.Transient; +import javax.persistence.*; /** * @Description : 安灯队列 @@ -24,7 +21,16 @@ import javax.persistence.Transient; **/ @Data @Entity -@Table(name="ANDON_MANAGE_QUEUE") +@Table(name="ANDON_MANAGE_QUEUE", indexes = { + @Index(columnList = "WORK_CENTER_CODE", name = "ANDON_INDEX_WORK_CENTER_CODE"), + @Index(columnList = "WORK_CELL_CODE", name = "ANDON_INDEX_WORK_CELL_CODE"), + @Index(columnList = "ORGANIZE_CODE", name = "ANDON_INDEX_ORGANIZE_CODE"), + @Index(columnList = "ANDON_ORDER_NO", name = "ANDON_INDEX_ANDON_ORDER_NO"), + @Index(columnList = "ALARM_CODE", name = "ANDON_INDEX_ALARM_CODE"), + @Index(columnList = "STATUS_CODE", name = "ANDON_INDEX_STATUS_CODE"), + @Index(columnList = "ACTION_CODE", name = "ANDON_INDEX_ACTION_CODE"), + @Index(columnList = "EQUIPMENT_CODE", name = "ANDON_INDEX_EQUIPMENT_CODE") +}) @DynamicInsert @DynamicUpdate @EqualsAndHashCode(callSuper = true) @@ -87,80 +93,67 @@ public class AndonManageQueue extends BaseBean { @ApiParam(value = "优先级别", example = "1") private Integer priorityLevel; - @Column(name="CALL_TIME",updatable = false) + @Column(name="CALL_TIME") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiParam(value = "呼叫时间") + @ApiParam(value="呼叫时间",example = "2018-01-01 01:00:00") @AnnoOutputColumn(hidden = true) public String callTime; @Transient @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiParam(value="呼叫时间,查询开始时间") + @ApiParam(value="呼叫时间,查询开始时间", example = "2018-01-01 01:00:00") public String callTimeStart; @Transient @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiParam(value="呼叫时间,查询结束时间") + @ApiParam(value="呼叫时间,查询结束时间", example = "2018-01-01 01:00:00") public String callTimeEnd; - @Transient @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiParam(value="呼叫时间",example = "2018-01-01 01:00:00") - @AnnoOutputColumn(hidden = true) - public String callTimeStr; - - @Column(name="CONFIRM_TIME",updatable = false) - @ApiParam(value = "响应时间") + @Column(name="CONFIRM_TIME") + @ApiParam(value = "响应时间", example = "2018-01-01 01:00:00") @AnnoOutputColumn(hidden = true) public String confirmTime; - @Transient - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiParam(value="响应时间",example = "2018-01-01 01:00:00") - @AnnoOutputColumn(hidden = true) - public String confirmTimeStr; - - @Column(name="RESET_TIME",updatable = false) - @ApiParam(value = "解决时间") - @AnnoOutputColumn(hidden = true) - public String resetTime; - - @Transient + @Column(name="RESET_TIME") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @ApiParam(value="解决时间",example = "2018-01-01 01:00:00") @AnnoOutputColumn(hidden = true) - public String resetTimeStr; + public String resetTime; @Column(name = "CALL_USER") @ApiParam(value = "呼叫人") private String callUser; + @Transient + @ApiParam(value = "呼叫人名字") + private String callUserName; + @Column(name = "CONFIRM_USER") @ApiParam(value = "响应人") private String confirmUser; + @Transient + @ApiParam(value = "响应人名字") + private String confirmUserName; + @Column(name = "RESET_USER") @ApiParam(value = "解决人") private String resetUser; @Transient - @ApiParam(value = "异常时长") + @ApiParam(value = "解决人名字") private String resetUserName; @Column(name = "IS_SHIFT_CALL") @ApiParam(value = "是否转呼", example = "1") private Integer isShiftCall; - @Column(name="SHIFT_CALL_TIME",updatable = false) - @ApiParam(value = "转呼时间") - @AnnoOutputColumn(hidden = true) - public String shiftCallTime; - - @Transient + @Column(name="SHIFT_CALL_TIME") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @ApiParam(value="转呼时间",example = "2018-01-01 01:00:00") @AnnoOutputColumn(hidden = true) - public String shiftCallTimeStr; + public String shiftCallTime; @Column(name = "RP_OBJECT_CODE") @ApiParam(value = "转呼对象代码") diff --git a/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonManageRecord.java b/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonManageRecord.java index fcc6d64..05c7e9d 100644 --- a/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonManageRecord.java +++ b/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonManageRecord.java @@ -10,10 +10,7 @@ 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; -import javax.persistence.Transient; +import javax.persistence.*; /** * @Description : 安灯记录 @@ -24,7 +21,16 @@ import javax.persistence.Transient; **/ @Data @Entity -@Table(name="ANDON_MANAGE_RECORD") +@Table(name="ANDON_MANAGE_RECORD", indexes = { + @Index(columnList = "WORK_CENTER_CODE", name = "ANDON_INDEX_WORK_CENTER_CODE"), + @Index(columnList = "WORK_CELL_CODE", name = "ANDON_INDEX_WORK_CELL_CODE"), + @Index(columnList = "ORGANIZE_CODE", name = "ANDON_INDEX_ORGANIZE_CODE"), + @Index(columnList = "ANDON_ORDER_NO", name = "ANDON_INDEX_ANDON_ORDER_NO"), + @Index(columnList = "ALARM_CODE", name = "ANDON_INDEX_ALARM_CODE"), + @Index(columnList = "STATUS_CODE", name = "ANDON_INDEX_STATUS_CODE"), + @Index(columnList = "ACTION_CODE", name = "ANDON_INDEX_ACTION_CODE"), + @Index(columnList = "EQUIPMENT_CODE", name = "ANDON_INDEX_EQUIPMENT_CODE") +}) @DynamicInsert @DynamicUpdate @EqualsAndHashCode(callSuper = true) diff --git a/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonPLCRecord.java b/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonPLCRecord.java index 4390a91..33078db 100644 --- a/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonPLCRecord.java +++ b/modules/i3plus-pojo-andon/src/main/java/cn.estsh.i3plus.pojo.andon/bean/AndonPLCRecord.java @@ -10,6 +10,7 @@ import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.Index; import javax.persistence.Table; /** @@ -21,7 +22,14 @@ import javax.persistence.Table; **/ @Data @Entity -@Table(name="ANDON_PLC_RECORD") +@Table(name="ANDON_PLC_RECORD", indexes = { + @Index(columnList = "WORK_CENTER_CODE", name = "ANDON_INDEX_WORK_CENTER_CODE"), + @Index(columnList = "WORK_CELL_CODE", name = "ANDON_INDEX_WORK_CELL_CODE"), + @Index(columnList = "ORGANIZE_CODE", name = "ANDON_INDEX_ORGANIZE_CODE"), + @Index(columnList = "CHANNEL_NAME", name = "ANDON_INDEX_CHANNEL_NAME"), + @Index(columnList = "TAG_ADDRESS", name = "ANDON_INDEX_TAG_ADDRESS"), + @Index(columnList = "GROUP_NO", name = "ANDON_INDEX_GROUP_NO") +}) @DynamicInsert @DynamicUpdate @EqualsAndHashCode(callSuper = true) diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/AndonEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/AndonEnumUtil.java index 3ceadb1..ec7d5c4 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/AndonEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/AndonEnumUtil.java @@ -83,7 +83,7 @@ public class AndonEnumUtil { public enum ALARM_FLAG{ CALL(1,"10","呼叫"), - SIGN(2,"20","签到"), + SIGN(2,"20","响应"), RESOLVE(3,"30","解决"), CANCEL(4,"40", "撤销"); diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/dao/BaseRepository.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/dao/BaseRepository.java index 4c07060..c131da7 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/dao/BaseRepository.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/dao/BaseRepository.java @@ -132,6 +132,51 @@ public interface BaseRepository extends JpaReposito int updateByProperties(String[] conditionName, Object[] conditionValue, String[] propertyName, Object[] propertyValue); /** + * 通过多单属性进行单个值更新(eg: price = price + :price) + * @param conditionName + * @param conditionValue + * @param propertyName + * @param propertyValue + */ + int updateByPropertiesWithVal(String conditionName, Object conditionValue, String propertyName, Object propertyValue); + + /** + * 通过单个属性进行多个值更新(eg: price = price + :price) + * @param conditionName + * @param conditionValue + * @param propertyName + * @param propertyValue + */ + int updateByPropertiesWithVal(String conditionName, Object conditionValue, String[] propertyName, Object[] propertyValue); + + /** + * 通过属性进行多个值更新(eg: price = price + :price) + * @param propertyName + * @param propertyValue + */ + int updateByPropertiesWithVal(String propertyName, Object propertyValue,DdlPackBean packBean); + int updateByPropertiesWithVal(String[] propertyName, Object[] propertyValue,DdlPackBean packBean); + + + /** + * 通过多个属性进行单个值更新(eg: price = price + :price) + * @param conditionName + * @param conditionValue + * @param propertyName + * @param propertyValue + */ + int updateByPropertiesWithVal(String[] conditionName, Object[] conditionValue, String propertyName, Object propertyValue); + + /** + * 通过多个属性进行多个值更新(eg: price = price + :price) + * @param conditionName 查询属性名称 + * @param conditionValue 查询属性值 + * @param propertyName 更新属性名称 + * @param propertyValue 更新属性值 + */ + int updateByPropertiesWithVal(String[] conditionName, Object[] conditionValue, String[] propertyName, Object[] propertyValue); + + /** * 根据 hqlWhere 批量修改制定字段 * @param hqlWhere * @param propertyName 修改的字段名称 diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/daoimpl/BaseRepositoryImpl.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/daoimpl/BaseRepositoryImpl.java index ae2aecf..04141fd 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/daoimpl/BaseRepositoryImpl.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/jpa/daoimpl/BaseRepositoryImpl.java @@ -11,10 +11,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.jpa.repository.support.SimpleJpaRepository; -import javax.persistence.EntityManager; -import javax.persistence.Id; -import javax.persistence.NoResultException; -import javax.persistence.Query; +import javax.persistence.*; import java.io.Serializable; import java.lang.reflect.Field; import java.text.SimpleDateFormat; @@ -196,6 +193,42 @@ public class BaseRepositoryImpl extends SimpleJpaRep @Override public int updateByProperties(String[] conditionName, Object[] conditionValue, String[] propertyName, Object[] propertyValue) { + return updateByPropertiesMain(conditionName, conditionValue, propertyName, propertyValue,true); + } + + @Override + public int updateByPropertiesWithVal(String conditionName, Object conditionValue, String propertyName, Object propertyValue) { + return updateByPropertiesWithVal(new String[] { conditionName }, new Object[] { conditionValue }, new String[] { propertyName }, new Object[] { propertyValue }); + } + + @Override + public int updateByPropertiesWithVal(String conditionName, Object conditionValue, String[] propertyName, Object[] propertyValue) { + return updateByPropertiesWithVal(new String[] { conditionName }, new Object[] { conditionValue }, propertyName, propertyValue); + } + + @Override + public int updateByPropertiesWithVal(String[] conditionName, Object[] conditionValue, String propertyName, Object propertyValue) { + return updateByPropertiesWithVal(conditionName, conditionValue, new String[] { propertyName }, new Object[] { propertyValue }); + } + + @Override + public int updateByPropertiesWithVal(String[] conditionName, Object[] conditionValue, String[] propertyName, Object[] propertyValue) { + return updateByPropertiesMain(conditionName, conditionValue, propertyName, propertyValue,false); + } + + /** + * 更新参数汇总方法 + * @param conditionName 条件属性名 + * @param conditionValue 条件属性值 + * @param propertyName 更新属性名 + * @param propertyValue 更新属性值 + * @param valWithSimple 是否简单赋值 + * true为正常eg: price = :price + * false为自身添加eg: price = price + :price + * @return + */ + private int updateByPropertiesMain(String[] conditionName, Object[] conditionValue, + String[] propertyName, Object[] propertyValue,boolean valWithSimple) { if ((propertyName != null) && (propertyName.length > 0) && (propertyValue != null) && (propertyValue.length > 0) && (propertyName.length == propertyValue.length) && (conditionValue != null) && (conditionValue.length > 0)) { @@ -203,7 +236,11 @@ public class BaseRepositoryImpl extends SimpleJpaRep sb.append("update " + persistentClass.getName() + " model set "); for (int i = 0; i < propertyName.length; i++) { - sb.append(propertyName[i] + " = :p_" + propertyName[i] + ","); + if(valWithSimple) { + sb.append(propertyName[i] + " = :p_" + propertyName[i] + ","); + }else{ + sb.append(propertyName[i] + " = " + propertyName[i] + " + :p_" + propertyName[i] + ","); + } } sb.deleteCharAt(sb.length() - 1); @@ -229,13 +266,32 @@ public class BaseRepositoryImpl extends SimpleJpaRep @Override public int updateByProperties(String[] propertyName, Object[] propertyValue,DdlPackBean packBean) { + return updateByPropertiesDdlPack(propertyName, propertyValue,packBean,true); + } + + @Override + public int updateByPropertiesWithVal(String propertyName, Object propertyValue,DdlPackBean packBean) { + return updateByPropertiesWithVal(new String[] { propertyName }, new Object[] { propertyValue },packBean); + } + + @Override + public int updateByPropertiesWithVal(String[] propertyName, Object[] propertyValue,DdlPackBean packBean) { + return updateByPropertiesDdlPack(propertyName, propertyValue,packBean,false); + } + + private int updateByPropertiesDdlPack(String[] propertyName, Object[] propertyValue, + DdlPackBean packBean,boolean valWithSimple) { if ((propertyName != null) && (propertyName.length > 0) && (propertyValue != null) && (propertyValue.length > 0) && (propertyName.length == propertyValue.length)) { StringBuffer sb = new StringBuffer(); sb.append("update " + persistentClass.getName() + " model set "); for (int i = 0; i < propertyName.length; i++) { - sb.append(propertyName[i] + " = :p_" + propertyName[i] + ","); + if(valWithSimple) { + sb.append(propertyName[i] + " = :p_" + propertyName[i] + ","); + }else{ + sb.append(propertyName[i] + " = " + propertyName[i] + " + :p_" + propertyName[i] + ","); + } } sb.deleteCharAt(sb.length() - 1); sb.append(" where 1=1 " + packBean.getWhereAppend()); @@ -297,7 +353,9 @@ public class BaseRepositoryImpl extends SimpleJpaRep @Override public List list() { - return this.findAll(); + List l = this.findAll(); + this.flush(); + return l; } @Override @@ -1349,7 +1407,11 @@ public class BaseRepositoryImpl extends SimpleJpaRep if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) { StringBuffer sb = new StringBuffer("select sum(model." + sumPropertyName + ") from " + persistentClass.getName() + " model where 1=1 "); appendQL(sb, paramName, paramValue); - sb.append(" group by model." + groupByName); + + if(StringUtils.isNotBlank(groupByName)) { + sb.append(" group by model." + groupByName); + } + Query query = entityManager.createQuery(sb.toString()); setParameter(query,paramName,paramValue); @@ -1374,7 +1436,10 @@ public class BaseRepositoryImpl extends SimpleJpaRep if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) { StringBuffer sb = new StringBuffer("select avg(model."+sumPropertyName+") from " + persistentClass.getName() + " model where 1=1 "); appendQL(sb,paramName,paramValue); - sb.append(" group by model." + groupByName); + + if(StringUtils.isNotBlank(groupByName)) { + sb.append(" group by model." + groupByName); + } Query query = entityManager.createQuery(sb.toString()); setParameter(query,paramName,paramValue); @@ -1400,7 +1465,7 @@ public class BaseRepositoryImpl extends SimpleJpaRep if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) { StringBuffer sb = new StringBuffer("select max(model." + sumPropertyName + ") from " + persistentClass.getName() + " model where 1=1 "); appendQL(sb, paramName, paramValue); - if(!StringUtils.isEmpty(groupByName)){ + if(StringUtils.isNotBlank(groupByName)){ sb.append(" group by model." + groupByName); } @@ -1428,7 +1493,10 @@ public class BaseRepositoryImpl extends SimpleJpaRep if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) { StringBuffer sb = new StringBuffer("select min(model." + sumPropertyName + ") from " + persistentClass.getName() + " model where 1=1 "); appendQL(sb, paramName, paramValue); - sb.append(" group by model." + groupByName); + + if(StringUtils.isNotBlank(groupByName)) { + sb.append(" group by model." + groupByName); + } Query query = entityManager.createQuery(sb.toString()); setParameter(query,paramName,paramValue); diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesKpData.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesKpData.java new file mode 100644 index 0000000..94c7b81 --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesKpData.java @@ -0,0 +1,63 @@ +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; +import javax.persistence.Transient; + +/** + * @Description :物料关键数据 + * @Reference : + * @Author : crish + * @CreateDate : 2019-05-15 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="MES_KP_DATA") +@Api("生产区域") +public class MesKpData extends BaseBean { + @Column(name="PART_NO") + @ApiParam("物料号") + private String partNo; + + @Column(name="KEY_DATA_CODE") + @ApiParam("关键数据代码") + private String keyDataCode; + + @Column(name="KEY_DATA_NAME") + @ApiParam("关键数据名称") + private String keyDataName; + + @Column(name="KEY_DATA_COUNT") + @ApiParam("关键数据数量") + private Integer keyDataCount; + + @Column(name="UPPER_LIMIT") + @ApiParam("数据上限") + private Double upperLimit; + + @Column(name="LOWER_LIMIT") + @ApiParam("数据下限") + private Double lowerLimit; + + @Transient + @ApiParam("扭矩值") + private Double torqueValue; + + @Transient + @ApiParam("是否在范围之内") + private Boolean ok; +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPLCConfigure.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPLCConfigure.java new file mode 100644 index 0000000..2ad8ec6 --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPLCConfigure.java @@ -0,0 +1,59 @@ +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 :PLC设备信息配置表 + * @Reference : + * @Author : Crish + * @CreateDate : 2019-05-17 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="MES_PLC_CONFIGURE") +@Api("PLC设备信息配置表") +public class MesPLCConfigure extends BaseBean { + @Column(name="IP") + @ApiParam("设备ip") + private String ipAddress; + + @Column(name="AREA_CODE") + @ApiParam("区域代码") + private String channelName; + + @Column(name="AREA_NAME") + @ApiParam("区域名称") + private String deviceName; + + @Column(name="AREA_CODE") + @ApiParam("区域代码") + private String tagName; + + @Column(name="WORK_CELL_CODE") + @ApiParam("工作单元") + private String workCellCode; + + @Column(name="WORK_CENTER_CODE") + @ApiParam("工作中心") + private String workCenterCode; + + @Column(name="AREA_CODE") + @ApiParam("区域代码") + private String areaCode; + +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesProduceSn.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesProduceSn.java index 8889ab4..dc7c2ea 100644 --- a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesProduceSn.java +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesProduceSn.java @@ -11,6 +11,7 @@ import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; +import javax.persistence.Transient; /** * @Description: @@ -104,6 +105,10 @@ public class MesProduceSn extends BaseBean { @ApiParam("包装条码") private String packageSn; + @Transient + @ApiParam("返回信息") + private String resultMsg; + public double getQtyVal() { return this.qty == null ? 0.0d : this.qty; } diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesTorqueDetail.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesTorqueDetail.java new file mode 100644 index 0000000..f99cd7f --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesTorqueDetail.java @@ -0,0 +1,82 @@ +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 : Crish + * @CreateDate : 2019-05-17 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="MES_TORQUE_DETAIL") +@Api("扭矩信息记录表") +public class MesTorqueDetail extends BaseBean { + @Column(name="SN") + @ApiParam("过程条码") + private String serialNumber; + + @Column(name="UPPER_LIMIT") + @ApiParam("最大值") + private Double upperLimit; + + @Column(name="LOWER_LIMIT") + @ApiParam("最小值") + private Double lowerLimit; + + @Column(name="TORQUE_DETAIL_VALUE") + @ApiParam("扭矩值") + private Double torqueValue; + + @Column(name="WORK_CELL_CODE") + @ApiParam("工作单元") + private String workCellCode; + + @Column(name="WORK_CENTER_CODE") + @ApiParam("工作中心") + private String workCenterCode; + + @Column(name="AREA_CODE") + @ApiParam("区域代码") + private String areaCode; + + @Column(name="ok") + @ApiParam("扭矩是否合格") + private String ok; + + @Column(name="PART_NO") + @ApiParam("扭矩是否合格") + private String partNO; + + @Column(name="p_set") + @ApiParam("螺丝枪PSET设置值") + private String deviceSetValue; + + @Column(name="MAXANGLE") + @ApiParam("最大扭矩") + private String maxAngle; + + @Column(name="MINANGLE") + @ApiParam("最小扭矩") + private String minAngel; + + @Column(name="FINALANGLE") + @ApiParam("最终扭矩") + private Integer finalAngle; +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/model/StationRequestBean.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/model/StationRequestBean.java index 03ac201..9ee5b73 100644 --- a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/model/StationRequestBean.java +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/model/StationRequestBean.java @@ -49,6 +49,9 @@ public class StationRequestBean implements Serializable { @ApiParam("按钮编号") private String buttonCode; + @ApiParam("工步代码") + private String stepCode; + /** * doScan-扫描,doModule-处理组件,initModule-初始化组件 */ diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesKpDataRepository.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesKpDataRepository.java new file mode 100644 index 0000000..da57b4f --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesKpDataRepository.java @@ -0,0 +1,17 @@ +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.MesArea; +import cn.estsh.i3plus.pojo.mes.pcn.bean.MesKpData; +import org.springframework.stereotype.Repository; + +/** + * @Description : + * @Reference : + * @Author : crish + * @CreateDate : 2019-05-15 + * @Modify: + **/ +@Repository +public interface MesKpDataRepository extends BaseRepository { +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPLCConfigureRepository.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPLCConfigureRepository.java new file mode 100644 index 0000000..cce563e --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPLCConfigureRepository.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.MesArea; +import org.springframework.stereotype.Repository; + +/** + * @Description : + * @Reference : + * @Author : jack.jia + * @CreateDate : 2019-04-02 + * @Modify: + **/ +@Repository +public interface MesPLCConfigureRepository extends BaseRepository { +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesTorqueDetailRepository.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesTorqueDetailRepository.java new file mode 100644 index 0000000..d2be5f1 --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesTorqueDetailRepository.java @@ -0,0 +1,17 @@ +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.MesArea; +import cn.estsh.i3plus.pojo.mes.pcn.bean.MesTorqueDetail; +import org.springframework.stereotype.Repository; + +/** + * @Description : + * @Reference : + * @Author : jack.jia + * @CreateDate : 2019-04-02 + * @Modify: + **/ +@Repository +public interface MesTorqueDetailRepository extends BaseRepository { +} diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesRouteProcessCell.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesRouteProcessCell.java index 64027fc..a2b7c6d 100644 --- a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesRouteProcessCell.java +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesRouteProcessCell.java @@ -38,4 +38,9 @@ public class MesRouteProcessCell extends BaseBean { @Column(name = "WORK_CELL_CODE") @ApiParam("工作单元代码") private String workCellCode; + + @Column(name = "WORK_CENTER_CODE") + @ApiParam("工作中心") + private String workCenterCode; + } diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/sqlpack/MesHqlPack.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/sqlpack/MesHqlPack.java index ac8fceb..0e9ac7f 100644 --- a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/sqlpack/MesHqlPack.java +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/sqlpack/MesHqlPack.java @@ -263,6 +263,23 @@ public class MesHqlPack { } /** + * MES设备信息查询条件封装 + * @param mesEquipment + * @return + */ + public static DdlPackBean getMesEquipment(MesEquipment mesEquipment, String organizeCode) { + DdlPackBean packBean = getAllBaseDataByNormalPro(mesEquipment, organizeCode); + if (StringUtils.isNotEmpty(mesEquipment.getWorkCellCode())){ + DdlPreparedPack.getStringEqualPack(mesEquipment.getWorkCellCode(), "workCellCode", packBean); + } + if (StringUtils.isNotEmpty(mesEquipment.getEquipmentCode())){ + DdlPreparedPack.getStringEqualPack(mesEquipment.getEquipmentCode(), "equipmentCode", packBean); + } + + return packBean; + } + + /** * 流程查询条件封装 * * @param mesRoute @@ -363,4 +380,27 @@ public class MesHqlPack { return packBean; } + + /** + * MES工序工作单元对应关系查询条件封装 + * @param routeProcessCell + * @return + */ + public static DdlPackBean getMesRouteProcessCell(MesRouteProcessCell routeProcessCell, String organizeCode) { + DdlPackBean packBean = getAllBaseDataByNormalPro(routeProcessCell, organizeCode); + if (StringUtils.isNotEmpty(routeProcessCell.getRouteCode())){ + DdlPreparedPack.getStringEqualPack(routeProcessCell.getRouteCode(), "routeCode", packBean); + } + if (StringUtils.isNotEmpty(routeProcessCell.getProcessCode())){ + DdlPreparedPack.getStringEqualPack(routeProcessCell.getProcessCode(), "processCode", packBean); + } + if (StringUtils.isNotEmpty(routeProcessCell.getWorkCellCode())){ + DdlPreparedPack.getStringEqualPack(routeProcessCell.getWorkCellCode(), "workCellCode", packBean); + } + if (StringUtils.isNotEmpty(routeProcessCell.getWorkCenterCode())){ + DdlPreparedPack.getStringEqualPack(routeProcessCell.getWorkCenterCode(), "workCenterCode", packBean); + } + + return packBean; + } } diff --git a/modules/i3plus-pojo-platform/src/main/java/cn/estsh/i3plus/pojo/platform/bean/TestTransUser.java b/modules/i3plus-pojo-platform/src/main/java/cn/estsh/i3plus/pojo/platform/bean/TestTransUser.java new file mode 100644 index 0000000..7f5be42 --- /dev/null +++ b/modules/i3plus-pojo-platform/src/main/java/cn/estsh/i3plus/pojo/platform/bean/TestTransUser.java @@ -0,0 +1,46 @@ +package cn.estsh.i3plus.pojo.platform.bean; + +import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn; +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +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; +import javax.persistence.Version; + +/** + * @Description : 测试类,用来测试事务 + * @Reference : + * @Author : alwaysfrin + * @CreateDate : 2019-05-14 12:51 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="TEST_TRANS_USER") +@Api(value="测试用户类",description = "测试事务信息") +public class TestTransUser extends BaseBean { + + @Column(name="NAME") + @ApiParam(value ="名称" , access ="名称") + private String name; + + @Column(name="SALARY") + @ApiParam(value ="金额" , access ="金额") + private Double salary; + + /*@Version + @ApiParam(value ="版本控制" , access ="乐观锁") + private int version;*/ +} diff --git a/modules/i3plus-pojo-platform/src/main/java/cn/estsh/i3plus/pojo/platform/repository/TestTransUserRepository.java b/modules/i3plus-pojo-platform/src/main/java/cn/estsh/i3plus/pojo/platform/repository/TestTransUserRepository.java new file mode 100644 index 0000000..2221006 --- /dev/null +++ b/modules/i3plus-pojo-platform/src/main/java/cn/estsh/i3plus/pojo/platform/repository/TestTransUserRepository.java @@ -0,0 +1,15 @@ +package cn.estsh.i3plus.pojo.platform.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.platform.bean.SysUserInfo; +import cn.estsh.i3plus.pojo.platform.bean.TestTransUser; + +/** + * @Description : 测试事务用户 + * @Reference : + * @Author : frin + * @Date : 2019-5-14 + * @Modify : + **/ +public interface TestTransUserRepository extends BaseRepository { +}