From d8779f42fbe1b3469df0eaaba43dfee872d24d85 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 25 Mar 2020 16:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=8Edev=E6=8B=89=E5=8F=96=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/WmsEnumUtil.java | 141 ++++++++++++++++++++- .../estsh/i3plus/pojo/wms/bean/MesPpDetails.java | 4 + .../cn/estsh/i3plus/pojo/wms/bean/MesPpMaster.java | 4 + .../estsh/i3plus/pojo/wms/bean/WmsLocatePart.java | 4 + .../cn/estsh/i3plus/pojo/wms/bean/WmsPart.java | 5 + .../cn/estsh/i3plus/pojo/wms/bean/WmsPullRule.java | 51 ++++++++ .../i3plus/pojo/wms/bean/WmsPullTaskDetails.java | 4 + .../i3plus/pojo/wms/bean/WmsPullTaskMaster.java | 8 ++ .../cn/estsh/i3plus/pojo/wms/bean/WmsZones.java | 15 +++ .../pojo/wms/modelbean/WmsPullOrderModel.java | 39 ++++++ .../pojo/wms/repository/WmsPullRuleRepository.java | 16 +++ .../estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java | 16 +++ 12 files changed, 306 insertions(+), 1 deletion(-) create mode 100644 modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullRule.java create mode 100644 modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/modelbean/WmsPullOrderModel.java create mode 100644 modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsPullRuleRepository.java 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 4fd1ad6..a0dd0ef 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 @@ -4512,7 +4512,9 @@ public class WmsEnumUtil { SAFETY_STOCK_PULL(10, "安全库存拉动"), ELECTRONIC_KANBAN_PULL(20, "电子看板拉动"), LINE_PULL(30, "巡线拉动"), - PLANNED_PULL(40, "计划拉动"); + PLANNED_PULL(40, "计划拉动"), + ANDON_PULL(50, "安灯拉动"), + EXTERNAL_PULL(60, "手工拉动"); private int value; private String description; @@ -4551,6 +4553,53 @@ public class WmsEnumUtil { } /** + * 尾数计算方式 + * 默认为 10 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum TAIL_QTY_MODE { + NONE(1, "不处理"), + ORIGIN_NUMBER(10, "原数值"), + UP_ROUND(20, "向上取整"), + DOWN_ROUND(30, "向下取整"); + + private int value; + private String description; + + TAIL_QTY_MODE(int value, String description) { + this.value = value; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static TAIL_QTY_MODE codeOf(int value) { + for (int i = 0; i < values().length; i++) { + if (values()[i].value == value) { + return values()[i]; + } + } + return null; + } + + 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; + } + } + + /** * 收货看板状态 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) @@ -5301,4 +5350,94 @@ public class WmsEnumUtil { return tmp; } } + + /** + * 存储区-补货方式 + * 默认为 10 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum ZONE_PULL_WAY { + JOB_CYCLE(10, "JOB周期"), + FIXED_CYCLE(20, "固定周期"); + + private int value; + private String description; + + ZONE_PULL_WAY(int value, String description) { + this.value = value; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static ZONE_PULL_WAY codeOf(int value) { + for (int i = 0; i < values().length; i++) { + if (values()[i].value == value) { + return values()[i]; + } + } + return null; + } + + 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; + } + } + + /** + * 拉动任务-任务类型 + * 默认为 10 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PULL_TASK_TYPE { + NORMAL_PULL(10, "普通拉动"), + GROUP_PULL(20, "组合拉动"); + + private int value; + private String description; + + PULL_TASK_TYPE(int value, String description) { + this.value = value; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static PULL_TASK_TYPE codeOf(int value) { + for (int i = 0; i < values().length; i++) { + if (values()[i].value == value) { + return values()[i]; + } + } + return null; + } + + 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; + } + } } \ No newline at end of file diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/MesPpDetails.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/MesPpDetails.java index b87c776..04436ff 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/MesPpDetails.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/MesPpDetails.java @@ -52,6 +52,10 @@ public class MesPpDetails extends BaseBean{ @ApiParam(value = "工单数量", example = "0") public Double qty; + @Column(name="PART_GROUP_NO") + @ApiParam("零件组号") + public String partGroupNo; + public Integer getItem() { return item == null ? 0 : this.item.intValue(); } diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/MesPpMaster.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/MesPpMaster.java index e9d4e61..8ec1cae 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/MesPpMaster.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/MesPpMaster.java @@ -58,6 +58,10 @@ public class MesPpMaster extends BaseBean{ @ApiParam(value = "单据状态", example = "0") private Integer orderStatus = 0; + @Column(name="SEQ") + @ApiParam(value = "排序号", example = "0") + private Integer seq = 0; + public Integer getOrderStatus() { return orderStatus == null ? 0 : this.orderStatus.intValue(); } diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsLocatePart.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsLocatePart.java index a0ea3cb..c4b5956 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsLocatePart.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsLocatePart.java @@ -62,6 +62,10 @@ public class WmsLocatePart extends BaseBean { @ApiParam(value = "安全库存", example = "0") private Double safetyStock; + @Column(name = "MOQ", columnDefinition = "decimal(18,8)") + @ApiParam(value = "起订量", example = "0") + private Double moq; + @Transient @ApiParam("库位类型") private Integer locateType; diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPart.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPart.java index 85ec609..ca95598 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPart.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPart.java @@ -244,6 +244,11 @@ public class WmsPart extends BaseBean { @ApiParam(value = "拉动方式") private String pullWay; + @Column(name = "TAIL_QTY_MODE") + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, entityName = "TAIL_QTY_MODE") + @ApiParam(value = "尾数计算方式", example = "1") + private Integer tailQtyMode; + @Column(name = "CYCLE_RQUEST_PERIOD") @ApiParam(value = "循环补货周期", example = "0") @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2) diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullRule.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullRule.java new file mode 100644 index 0000000..90b3a58 --- /dev/null +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullRule.java @@ -0,0 +1,51 @@ +package cn.estsh.i3plus.pojo.wms.bean; + +import cn.estsh.i3plus.pojo.base.annotation.DynamicField; +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +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; + +/** + * @Description 拉动规则实体 + * @Author Jason + * @Date 2020-03-20 + * @ModifyDate 2020-03-20 + */ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name = "WMS_PULL_RULE") +@Api("拉动规则") +public class WmsPullRule extends BaseBean { + @Column(name = "PULL_WAY") + @ApiParam(value = "拉动类型", example = "10") + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.SELECT, entityName = "PULL_WAY_STATUS") + private Integer pullWay; + + @Column(name = "CONTAIN_UNFINISH_ORDER") + @ApiParam(value = "考虑未完成的移库单", example = "0") + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, entityName = "TRUE_OR_FALSE") + private Integer containUnfinishOrder; + + @Column(name = "CONTAIN_EXIST_PERIOD") + @ApiParam(value = "考虑现有库存", example = "0") + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, entityName = "TRUE_OR_FALSE") + private Integer containExistStock; + + @Column(name = "TAIL_QTY_MODE") + @ApiParam(value = "尾数计算方式", example = "0") + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, entityName = "TAIL_QTY_MODE") + private Integer tailQtyMode; +} diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullTaskDetails.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullTaskDetails.java index 0a41d3e..4eaabf1 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullTaskDetails.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullTaskDetails.java @@ -110,6 +110,10 @@ public class WmsPullTaskDetails extends BaseBean{ @ApiParam(value = "明细状态", example = "0") private Integer orderStatus = 0; + @Column(name="PART_GROUP_NO") + @ApiParam("零件组号") + public String partGroupNo; + public Integer getOrderStatus() { return orderStatus == null ? 0 : this.orderStatus.intValue(); } diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullTaskMaster.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullTaskMaster.java index f7d6c15..aa9559c 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullTaskMaster.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsPullTaskMaster.java @@ -62,6 +62,14 @@ public class WmsPullTaskMaster extends BaseBean{ @ApiParam(value = "是否暂停", example = "0") private Integer isSuspend = 2; + @Column(name="PULL_TASK_TYPE") + @ApiParam(value = "拉动任务类型", example = "10") + private Integer pullTaskType; + + @Column(name="SEQ") + @ApiParam(value = "排序号", example = "0") + private Integer seq; + public Integer getOrderStatus() { return orderStatus == null ? 0 : this.orderStatus.intValue(); } diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsZones.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsZones.java index e11133a..f916604 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsZones.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsZones.java @@ -117,6 +117,21 @@ public class WmsZones extends BaseBean { @ApiParam(value = "三维位置") private String position; + @Column(name = "ZONE_PULL_WAY") + @ApiParam(value = "补货方式", example = "10") + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, entityName = "ZONE_PULL_WAY") + private Integer zonePullWay; + + @Column(name = "PULL_CYCLE") + @ApiParam(value = "固定拉动周期", example = "0") + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2) + private Integer pullCycle; + + @Column(name = "LAST_PULL_TIME") + @ApiParam(value = "上次拉动时间") + @DynamicField(webFieldType = WmsEnumUtil.FIELD_TYPE.DATETIME, isRequire = 2) + private String lastPullTime; + @Transient @ApiParam(value = "子存储区列表") private List childList; diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/modelbean/WmsPullOrderModel.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/modelbean/WmsPullOrderModel.java new file mode 100644 index 0000000..6a41bbc --- /dev/null +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/modelbean/WmsPullOrderModel.java @@ -0,0 +1,39 @@ +package cn.estsh.i3plus.pojo.wms.modelbean; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiParam; +import lombok.Data; + +/** + * @description + * @author jason.niu + * @date 2020/03/25 + */ +@Data +@Api("外部拉动单模型") +public class WmsPullOrderModel { + + @ApiParam("工厂代码") + private String organizeCode; + + @ApiParam("车间") + private String workShopCode; + + @ApiParam("产线") + private String lineNo; + + @ApiParam("库位") + private String locateNo; + + @ApiParam("零件号") + private String partNo; + + @ApiParam("供应商") + private String vendorNo; + + @ApiParam("数量") + private Double qty; + + @ApiParam("业务类型") + private Integer busiType; +} diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsPullRuleRepository.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsPullRuleRepository.java new file mode 100644 index 0000000..efb40b5 --- /dev/null +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/WmsPullRuleRepository.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.WmsPullRule; +import org.springframework.stereotype.Repository; + +/** + * @Description :拉动规则Repository的方法接口 + * @Reference : + * @Author : jason.niu + * @CreateDate : 2020-03-23 15:38 + * @Modify: + **/ +@Repository +public interface WmsPullRuleRepository extends BaseRepository { +} diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java index 68b8086..09eaafe 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java @@ -559,6 +559,22 @@ public class WmsHqlPack { } /** + * 拉动规则 分页查询 + * @param rule + * @return + */ + public static DdlPackBean packHqlWmsPullRule(WmsPullRule rule) { + //查询参数封装 + DdlPackBean result = new DdlPackBean(); + + //查询参数封装 + DdlPreparedPack.getNumEqualPack(rule.getPullWay(), "pullWay", result); + + getStringBuilderPack(rule, result); + return result; + } + + /** * 根据类型查询库位分页 * * @param wmsLocate