diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/WmsEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/WmsEnumUtil.java index e1371ad..44a3c2a 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/WmsEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/WmsEnumUtil.java @@ -8709,4 +8709,154 @@ public class WmsEnumUtil { return null; } } + + /** + * 悬挂链库存同步状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum SUSPEN_STOCK_SYNC_STATUS { + CREATE(10, "CREATE", "创建"), + HANDLED(20, "HANDLED", "已处理"), + HANDLE_ERROR(30, "HANDLE_ERROR", "处理错误"), + PLC_HANDLE_OUTITME(40, "PLC_HANDLE_OUTITME", "PLC处理超时"), + SRC_DATA_ERROR(50, "SRC_DATA_ERROR", "来源数据解析错误"); + + private String code; + private String description; + int value; + + public int getValue() { + return value; + } + + public String getCode() { + return code; + } + + public String getDescription() { + return description; + } + + SUSPEN_STOCK_SYNC_STATUS(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + 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 String valueOfDescription(int val) { + return valueOf(val); + } + + public static int descriptionOfValue(String desc) { + return descOf(desc); + } + + + 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 SUSPEN_STOCK_SYNC_STATUS codeOf(Integer value) { + if (value == null) { + return null; + } else { + for (int i = 0; i < values().length; i++) { + if (values()[i].value == value) { + return values()[i]; + } + } + } + return null; + } + } + + /** + * 悬挂链库存同步数据来源 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum SUSPEN_STOCK_SYNC_DATA_SRC { + IP(10, "IP", "IP"), + DF(20, "DF", "DF"), + DR(30, "DR", "DR"); + + int value; + private String code; + private String description; + + public int getValue() { + return value; + } + + public String getCode() { + return code; + } + + public String getDescription() { + return description; + } + + SUSPEN_STOCK_SYNC_DATA_SRC(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + 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 String valueOfDescription(int val) { + return valueOf(val); + } + + public static int descriptionOfValue(String desc) { + return descOf(desc); + } + + + 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 SUSPEN_STOCK_SYNC_DATA_SRC codeOf(String code) { + if (StringUtils.isEmpty(code)) { + return null; + } else { + for (int i = 0; i < values().length; i++) { + if (values()[i].code.equalsIgnoreCase(code)) { + return values()[i]; + } + } + } + return null; + } + } } diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsSuspenStockSync.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsSuspenStockSync.java new file mode 100644 index 0000000..0470492 --- /dev/null +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsSuspenStockSync.java @@ -0,0 +1,117 @@ +package cn.estsh.i3plus.pojo.wms.bean; + +import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn; +import cn.estsh.i3plus.pojo.base.annotation.DynamicField; +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil; +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.Index; +import javax.persistence.Table; +import javax.persistence.Transient; +import java.util.List; +import java.util.Map; + +/** + * @Description : 悬挂链库存同步数据 + * @Reference : + * @Author : jimmy.zeng + * @CreateDate : 2020-07-14 9:53 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name = "WMS_SUSPEN_STOCK_SYNC", indexes = { + @Index(columnList = "ORGANIZE_CODE") +}) +@Api("悬挂链库存同步数据") +public class WmsSuspenStockSync extends BaseBean { + + @Column(name = "SRC") + @ApiParam(value = "数据来源") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private String src; + + @Column(name = "SERVER_URL") + @ApiParam(value = "服务地址") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private String serverUrl; + + @Column(name = "LOCATE_NO") + @ApiParam(value = "库位号") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private String locateNo; + + @Column(name = "PART_NO_A") + @ApiParam(value = "物料号A") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private String partNoA; + + @Column(name = "PART_NO_B") + @ApiParam(value = "物料号B") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private String partNoB; + + @Column(name = "QTY_A") + @ApiParam(value = "数量A") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private Double qtyA; + + @Column(name = "qty_b") + @ApiParam(value = "数量B") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private Double qtyB; + + @Column(name = "LOT_NO_A") + @ApiParam(value = "批次A") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private String lotNoA; + + @Column(name = "LOT_NO_B") + @ApiParam(value = "批次B") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private String lotNoB; + + @Column(name = "STATUS") + @ApiParam(value = "状态") + @AnnoOutputColumn(refClass = WmsEnumUtil.SUSPEN_STOCK_SYNC_STATUS.class) + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER) + private Integer status; + + @Column(name = "ERROR_MSG") + @ApiParam(value = "错误信息") + @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT) + private String errorMsg; + + @Transient + @ApiParam(value = "物料数组集") + private String[] partNos; + + @Transient + @ApiParam(value = "数量数组集") + private Double[] qtys; + + @Transient + @ApiParam(value = "批次数组集") + private String[] lotNos; + + @Transient + @ApiParam(value = "物料数据List") + private List partList; + + @Transient + @ApiParam(value = "物料数据Map") + private Map partNameMap; + +} diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsSuspenStockSyncRepository.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsSuspenStockSyncRepository.java new file mode 100644 index 0000000..f4dd112 --- /dev/null +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsSuspenStockSyncRepository.java @@ -0,0 +1,16 @@ +package cn.estsh.i3plus.pojo.wms.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.wms.bean.WmsSuspenStockSync; +import org.springframework.stereotype.Repository; + +/** + * @Description : + * @Reference : + * @Author : jimmy.zeng + * @CreateDate : 2020-07-14 10:33 + * @Modify: + **/ +@Repository +public interface WmsSuspenStockSyncRepository extends BaseRepository { +}