From 3c2a345b93dd0843e9cc0bc6115c3f735bfa969c Mon Sep 17 00:00:00 2001 From: jimmy <1622218722@qq.com> Date: Thu, 28 Mar 2019 18:46:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=9B=98=E7=82=B9pc=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/WmsEnumUtil.java | 34 ++++++++++++++++++++++ .../estsh/i3plus/pojo/wms/bean/WmsCSFactTrans.java | 18 +++++++----- .../i3plus/pojo/wms/bean/WmsCSOrderDetails.java | 21 +++++++++++-- .../estsh/i3plus/pojo/wms/sqlpack/WmsHqlPack.java | 2 ++ 4 files changed, 66 insertions(+), 9 deletions(-) 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 9ac8347..62153b4 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 @@ -2157,4 +2157,38 @@ public class WmsEnumUtil { return tmp; } } + + /** + * 盘点物料 是否调差 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum CS_IS_ADJUST { + IS_ADJUST(1, "是调差"), ADJUST(2, "否调差"); + + private int value; + private String description; + + CS_IS_ADJUST(int value, String description) { + this.value = value; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return 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; + } + } } diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsCSFactTrans.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsCSFactTrans.java index 9186610..719f50e 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsCSFactTrans.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsCSFactTrans.java @@ -29,6 +29,17 @@ import javax.persistence.Table; @Api("盘点实盘信息") public class WmsCSFactTrans extends BaseBean { + public WmsCSFactTrans(){} + + public WmsCSFactTrans(Double factQty, String partNo){ + if(factQty == null) { + this.factQty = 0d; + }else{ + this.factQty = factQty; + } + this.partNo = partNo; + } + @Column(name="ORDER_NO") @ApiParam("单号") public String orderNo; @@ -81,11 +92,4 @@ public class WmsCSFactTrans extends BaseBean { @Column(name="REMARK") @ApiParam(value = "备注") public String reMark; - - public WmsCSFactTrans(){} - - public WmsCSFactTrans(double factQty, String partNo){ - this.factQty = factQty; - this.partNo = partNo; - } } diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsCSOrderDetails.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsCSOrderDetails.java index 1fc9743..f1c8cf5 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsCSOrderDetails.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/bean/WmsCSOrderDetails.java @@ -95,11 +95,12 @@ public class WmsCSOrderDetails extends BaseBean { @ApiParam(value = "处理状态", example = "1") public Integer transStatus; - //虚拟字段(实盘数量、剩余数量) @Transient + @ApiParam(value = "实盘数量", example = "1") public Double factQty; @Transient + @ApiParam(value = "剩余数量", example = "1") public Double surplusQty; public Double getQty() { @@ -108,8 +109,24 @@ public class WmsCSOrderDetails extends BaseBean { public WmsCSOrderDetails(){} - public WmsCSOrderDetails(double qty, String partNo){ + public WmsCSOrderDetails(Double qty, String partNo,String orderNo,String whNo,String zoneNo,String locateNo,String partName){ this.qty = qty; this.partNo = partNo; + this.orderNo = orderNo; + this.whNo = whNo; + this.zoneNo = zoneNo; + this.locateNo = locateNo; + this.partNameRdd = partName; + } + + public WmsCSOrderDetails(Double qty, String partNo,String orderNo,String whNo,String zoneNo,String locateNo,String partName,String sn){ + this.qty = qty; + this.partNo = partNo; + this.orderNo = orderNo; + this.whNo = whNo; + this.zoneNo = zoneNo; + this.locateNo = locateNo; + this.partNameRdd = partName; + this.sn = sn; } } 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 c3996f2..e05c640 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 @@ -748,6 +748,7 @@ public class WmsHqlPack { HqlPack.getStringEqualPack(wmsCSPart.getOrderNo(), "orderNo", result); HqlPack.getStringEqualPack(wmsCSPart.getPartNo(), "partNo", result); + HqlPack.getNumEqualPack(wmsCSPart.getIsAdjust(), "isAdjust", result); HqlPack.getStringLikerPack(wmsCSPart.getPartNameRdd(), "partNameRdd", result); getStringBuilderPack(wmsCSPart, result); @@ -1104,6 +1105,7 @@ public class WmsHqlPack { //查询参数封装 HqlPack.getStringEqualPack(wmsCSFactTrans.getOrderNo(), "orderNo", result); + HqlPack.getStringEqualPack(wmsCSFactTrans.getPartNo(), "partNo", result); getStringBuilderPack(wmsCSFactTrans, result); From bd4df8351959e76cb6816abee0862085f04732d7 Mon Sep 17 00:00:00 2001 From: "Rock.Yu" Date: Thu, 28 Mar 2019 22:24:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=20=E5=A2=9E=E5=8A=A0=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=BC=95=E7=94=A8=20POJO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/{rules => engine/rule}/WmsSNCheckRule.java | 2 +- .../rule}/WmsSNNextStatusRule.java | 4 +- .../wms/engine/script/EngineScriptPersistence.java | 63 ++++++++++++++++++++++ .../repository/IEngineScriptPersistenceDao.java | 16 ++++++ 4 files changed, 82 insertions(+), 3 deletions(-) rename modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/{rules => engine/rule}/WmsSNCheckRule.java (96%) rename modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/{rules => engine/rule}/WmsSNNextStatusRule.java (96%) create mode 100644 modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/script/EngineScriptPersistence.java create mode 100644 modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/IEngineScriptPersistenceDao.java diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/rules/WmsSNCheckRule.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/rule/WmsSNCheckRule.java similarity index 96% rename from modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/rules/WmsSNCheckRule.java rename to modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/rule/WmsSNCheckRule.java index 7ddb183..3abbe1d 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/rules/WmsSNCheckRule.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/rule/WmsSNCheckRule.java @@ -1,4 +1,4 @@ -package cn.estsh.i3plus.pojo.wms.rules; +package cn.estsh.i3plus.pojo.wms.engine.rule; /** * @Description : 纯POJO,WMS PDA 操作前的条码状态检查 diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/rules/WmsSNNextStatusRule.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/rule/WmsSNNextStatusRule.java similarity index 96% rename from modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/rules/WmsSNNextStatusRule.java rename to modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/rule/WmsSNNextStatusRule.java index cec3ca8..1f74f53 100644 --- a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/rules/WmsSNNextStatusRule.java +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/rule/WmsSNNextStatusRule.java @@ -1,4 +1,4 @@ -package cn.estsh.i3plus.pojo.wms.rules; +package cn.estsh.i3plus.pojo.wms.engine.rule; /** * @Description : 纯POJO,WMS 获取条码下一步的状态 @@ -17,7 +17,7 @@ public class WmsSNNextStatusRule { private boolean oneStep; // 免检 private boolean skipQC; - // 自动入库 + // 自动入库t private boolean defaultInStock; // 原条码状态 private int srcSNStatusCode; diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/script/EngineScriptPersistence.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/script/EngineScriptPersistence.java new file mode 100644 index 0000000..7e498d3 --- /dev/null +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/engine/script/EngineScriptPersistence.java @@ -0,0 +1,63 @@ +package cn.estsh.i3plus.pojo.wms.engine.script; + +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +import io.swagger.annotations.Api; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.*; +import javax.script.CompiledScript; + +/** + * 脚本持久化实体类 + * + * @author Rock.Yu + * @since 2019-03-18 14:22 + */ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name = "SCRIPT_PERSISTENCE") +@Api("系统动态脚本") +public class EngineScriptPersistence extends BaseBean { + // 脚本调用的唯一编号,例如:WMS_PDA_0001 + @Column(name = "SCRIPT_NO", length = 50) + private String scriptNo; + // 脚本的中文名称 + @Column(name = "SCRIPT_NAME", length = 50) + private String scriptName; + // 10=组件脚本,20=表单脚本,30=报表脚本,40=JOB脚本,50=其他脚本 + @Column(name = "SCRIPT_TYPE") + private int scriptType; + // 脚本编写的语言 + // 10=Groovy, 20=Jython, 30=JavaScript, 40=Scala, 50=JRuby + @Column(name = "LANGUAGE_TYPE") + private int languageType; + // 脚本的具体内容 + @Column(name = "SCRIPT_CONTENT", columnDefinition = "TEXT") + private String scriptContent; + // 脚本的描述,包含脚本的用法,参数说明等 + @Column(name = "SCRIPT_REMARK", length = 2000) + private String scriptRemark; + // 编译后的脚本内容,通过预编译加快脚本的运行速度 + @Transient + private CompiledScript compiledScript; + + public EngineScriptPersistence() {} + + // 构造方法,便于批量创建数据 + public EngineScriptPersistence(long id, String scriptNo, String scriptName, int scriptType, int languageType, + String scriptContent, String scriptRemark) { + this.id = id; + this.scriptNo = scriptNo; + this.scriptName = scriptName; + this.scriptType = scriptType; + this.languageType = languageType; + this.scriptContent = scriptContent; + this.scriptRemark = scriptRemark; + } +} diff --git a/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/IEngineScriptPersistenceDao.java b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/IEngineScriptPersistenceDao.java new file mode 100644 index 0000000..a44d246 --- /dev/null +++ b/modules/i3plus-pojo-wms/src/main/java/cn/estsh/i3plus/pojo/wms/repository/IEngineScriptPersistenceDao.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.engine.script.EngineScriptPersistence; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface IEngineScriptPersistenceDao extends BaseRepository { + EngineScriptPersistence findByScriptNo(String scriptNo); + + @Query("select t.languageType from EngineScriptPersistence t group by t.languageType") + List findGroupByLanguageType(); +}