diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesEnumUtil.java index 80629a6..53b6bb0 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesEnumUtil.java @@ -6035,4 +6035,116 @@ public class MesEnumUtil { } } + /** + * 校枪状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum CALIBRATION_STATUS { + UNEXECUTED(10, "UNEXECUTED", "待执行"), + EXECUTE(20, "EXECUTE", "执行中"), + CANCEL(30, "CANCEL", "取消"), + FINISH(40, "FINISH", "完成"); + + private int value; + private String code; + private String description; + + CALIBRATION_STATUS(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public String getCode() { + return code; + } + + public static String valueOf(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static int descOf(String desc) { + int tmp = 1; + for (int i = 0; i < values().length; i++) { + if (values()[i].description.equals(desc)) { + tmp = values()[i].value; + } + } + return tmp; + } + + public static String valueOfDescription(int val) { + return valueOf(val); + } + } + + + /** + * 扭矩枪类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum GUN_TYPE { + DL(10, "DL", "小枪"), + PF(20, "PF", "大枪"); + + private int value; + private String code; + private String description; + + GUN_TYPE(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public String getCode() { + return code; + } + + public static String valueOf(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static int descOf(String desc) { + int tmp = 1; + for (int i = 0; i < values().length; i++) { + if (values()[i].description.equals(desc)) { + tmp = values()[i].value; + } + } + return tmp; + } + + public static String valueOfDescription(int val) { + return valueOf(val); + } + } } 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 index 43e86f6..e48cadd 100644 --- 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 @@ -3791,7 +3791,6 @@ public class MesPcnEnumUtil { return tmp; } } - /** * 界面类型 */ @@ -3827,4 +3826,116 @@ public class MesPcnEnumUtil { return tmp; } } + + /** + * 校枪状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum CALIBRATION_STATUS { + UNEXECUTED(10, "UNEXECUTED", "待执行"), + EXECUTE(20, "EXECUTE", "执行中"), + CANCEL(30, "CANCEL", "取消"), + FINISH(40, "FINISH", "完成"); + + private int value; + private String code; + private String description; + + CALIBRATION_STATUS(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public String getCode() { + return code; + } + + public static String valueOf(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static int descOf(String desc) { + int tmp = 1; + for (int i = 0; i < values().length; i++) { + if (values()[i].description.equals(desc)) { + tmp = values()[i].value; + } + } + return tmp; + } + + public static String valueOfDescription(int val) { + return valueOf(val); + } + } + + /** + * 扭矩枪类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum GUN_TYPE { + DL(10, "DL", "小枪"), + PF(20, "PF", "大枪"); + + private int value; + private String code; + private String description; + + GUN_TYPE(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public String getCode() { + return code; + } + + public static String valueOf(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static int descOf(String desc) { + int tmp = 1; + for (int i = 0; i < values().length; i++) { + if (values()[i].description.equals(desc)) { + tmp = values()[i].value; + } + } + return tmp; + } + + public static String valueOfDescription(int val) { + return valueOf(val); + } + } } diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesGunCalibrationRecord.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesGunCalibrationRecord.java new file mode 100644 index 0000000..c4bb872 --- /dev/null +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesGunCalibrationRecord.java @@ -0,0 +1,81 @@ +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; +import javax.persistence.Transient; +import java.io.Serializable; + +/** + * @Description: + * @Author: jokelin + * @Date: 2020/5/27 2:20 下午 + * @Modify: + */ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name = "IF_PACKAGE_DETAIL") +@Api("校枪记录表") +public class MesGunCalibrationRecord extends BaseBean implements Serializable { + + private static final long serialVersionUID = -6166370020956801528L; + + @Column(name = "WORK_CENTER_CODE") + @ApiParam("工作中心代码") + private String workCenterCode; + + @Column(name = "WORK_CELL_CODE") + @ApiParam("工作单元代码") + private String workCellCode; + + @Column(name = "GUN_CODE") + @ApiParam("枪号") + private String gunCode; + + @Column(name = "CUN_TYPE") + @ApiParam("扭矩枪类型") + private String cunType; + + @Column(name = "PSET_CODE") + @ApiParam("PSET号") + private String psetCode; + + @Column(name = "EXPECT_COUNT") + @ApiParam("设定枪数") + private Integer expectCount; + + @Column(name = "REAL_COUNT") + @ApiParam("实际枪叔") + private Integer realCount; + + @Column(name = "CALIBRATION_STATUS") + @ApiParam("校枪状态") + private Integer calibrationStatus; + + @Column(name = "START_TIME") + @ApiParam("开始校枪时间") + private String startTime; + + @Column(name = "END_TIME") + @ApiParam("结束校枪时间") + private String endTime; + + @Transient + @ApiParam("校枪状态名称") + private String calibrationStatusName; + + @Transient + @ApiParam("界面编号") + private String windowNo; +} diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesGunCalibrationRecordRepository.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesGunCalibrationRecordRepository.java new file mode 100644 index 0000000..e711363 --- /dev/null +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesGunCalibrationRecordRepository.java @@ -0,0 +1,13 @@ +package cn.estsh.i3plus.pojo.mes.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.mes.bean.MesGunCalibrationRecord; + +/** + * @Description: + * @Author: jokelin + * @Date: 2020/5/27 2:39 下午 + * @Modify: + */ +public interface MesGunCalibrationRecordRepository extends BaseRepository { +} 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 e7d3159..a538666 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 @@ -2887,4 +2887,30 @@ public class MesHqlPack { getStringBuilderPack(details, result); return result; } + + /** + * MES 校枪记录 + * + * @param gunCalibrationRecord + * @return + */ + public static DdlPackBean getMesGunCalibrationRecord(MesGunCalibrationRecord gunCalibrationRecord, String organizeCode) { + DdlPackBean packBean = getAllBaseDataByNormalPro(gunCalibrationRecord, organizeCode); + if (!StringUtils.isEmpty(gunCalibrationRecord.getWorkCellCode())) { + DdlPreparedPack.getStringEqualPack(gunCalibrationRecord.getWorkCellCode(), "workCellCode", packBean); + } + if (!StringUtils.isEmpty(gunCalibrationRecord.getGunCode())) { + DdlPreparedPack.getStringEqualPack(gunCalibrationRecord.getGunCode(), "gunCode", packBean); + } + if (gunCalibrationRecord.getCalibrationStatus() != null) { + DdlPreparedPack.getNumEqualPack(gunCalibrationRecord.getCalibrationStatus(), "calibrationStatus", packBean); + } + if (!StringUtils.isEmpty(gunCalibrationRecord.getStartTime())) { + DdlPreparedPack.getStringBiggerPack(gunCalibrationRecord.getStartTime(), "startTime", packBean); + } + if (!StringUtils.isEmpty(gunCalibrationRecord.getStartTime())) { + DdlPreparedPack.getStringSmallerPack(gunCalibrationRecord.getEndTime(), "endTime", packBean); + } + return packBean; + } } diff --git a/sonar-project.properties b/sonar-project.properties index 932bdd9..55e4e84 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,7 +6,7 @@ sonar.projectKey=i3plus.pojo:i3plus-pojo # defaults to project key sonar.projectName=i3plus-pojo # defaults to 'not provided' -sonar.projectVersion=1.0-TEST-SNAPSHOT +sonar.projectVersion=1.0-DEV-SNAPSHOT # Path is relative to the sonar-project.properties file. Defaults to . #sonar.sources=./