【2074 06 1.2.3.8上架策略-计算COI值】

yun-zuoyi
曾贞一 5 years ago
parent f54669ec6f
commit f3857116d1

@ -7635,4 +7635,480 @@ public class WmsEnumUtil {
return null;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum TRACTICS_GRADE {
ONE_TRACTICS_GRADE(10, "ONE_TRACTICS_GRADE", "1级策略"),
TWO_TRACTICS_GRADE(20, "TWO_TRACTICS_GRADE", "2级策略"),
THREE_TRACTICS_GRADE(30, "THREE_TRACTICS_GRADE", "3级策略");
private int value;
private String code;
private String description;
TRACTICS_GRADE(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 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 TRACTICS_GRADE 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 TRACTICS_GROUP {
INSTOCK(10, "INSTOCK", "上架"),
PICKING(20, "PICKING", "拣货");
private int value;
private String code;
private String description;
TRACTICS_GROUP(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 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 TRACTICS_GROUP 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;
}
}
/**
* ::1
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum INSTOCK_TRACTICS_ITEM_ONE {
COI_RECOMMEND(10, "COI_RECOMMEND", "COI推荐"),
ADJACENT_RECOMMEND(20, "ADJACENT_RECOMMEND", "高频推荐(相邻)"),
AREA_RECOMMEND(30, "AREA_RECOMMEND", "区域随机推荐"),
INERTIA_RECOMMEND(40, "INERTIA_RECOMMEND", "惯性推荐"),
ARTIFICIAL_RECOMMEND(50, "ARTIFICIAL_RECOMMEND", "人工指定");
private int value;
private String code;
private String description;
INSTOCK_TRACTICS_ITEM_ONE(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 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 INSTOCK_TRACTICS_ITEM_ONE 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;
}
}
/**
* ::2
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum INSTOCK_TRACTICS_ITEM_TWO {
FULL_RECOMMEND(10, "FULL_RECOMMEND", "放满推荐"),
EMPTY_RECOMMEND(20, "EMPTY_RECOMMEND", "空位推荐");
private int value;
private String code;
private String description;
INSTOCK_TRACTICS_ITEM_TWO(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 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 INSTOCK_TRACTICS_ITEM_TWO 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;
}
}
/**
* ::3
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum INSTOCK_TRACTICS_ITEM_THREE {
FCL_RECOMMEND(10, "FCL_RECOMMEND", "整箱推荐"),
EMPTY_BOX_RECOMMEND(20, "EMPTY_BOX_RECOMMEND", "零箱推荐"),
WHOLE_BOX_RECOMMEND(30, "WHOLE_BOX_RECOMMEND", "整零箱推荐");
private int value;
private String code;
private String description;
INSTOCK_TRACTICS_ITEM_THREE(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 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 INSTOCK_TRACTICS_ITEM_THREE 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;
}
}
/**
* ::1
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PICKING_TRACTICS_ITEM_ONE {
ABSOLUTE_PATH(10, "ABSOLUTE_PATH", "绝对路径"),
RELATIVE_PATH(20, "RELATIVE_PATH", "相对路径"),
LOCATE_ORDER_BY(30, "LOCATE_ORDER_BY", "库位编号排序");
private int value;
private String code;
private String description;
PICKING_TRACTICS_ITEM_ONE(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 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 PICKING_TRACTICS_ITEM_ONE 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 DOWN_OR_UP {
IS_TRUE(10, "IS_TRUE", "允许"),
IS_FALSE(20, "IS_FALSE", "不允许");
private int value;
private String codeValue;
private String description;
DOWN_OR_UP(int value, String codeValue, String description) {
this.value = value;
this.codeValue = codeValue;
this.description = description;
}
public int getValue() {
return value;
}
public String getCodeValue() {
return codeValue;
}
public String getDescription() {
return description;
}
}
}

@ -0,0 +1,64 @@
package cn.estsh.i3plus.pojo.wms.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 : COI
* @Reference :
* @Author : jimmy.zeng
* @CreateDate : 2020-06-09 16:59
* @Modify:
**/
@Data
@Entity
@Table(name="WMS_COI")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="COI对照表",description = "COI对照表")
public class WmsCoi extends BaseBean {
private static final long serialVersionUID = -8298385889006722335L;
@Column(name = "PART_NO")
@ApiParam(value = "物料编号")
private String partNo;
@Column(name = "PART_NAME")
@ApiParam(value = "物料名称")
private String partName;
@Column(name = "PART_VOL")
@ApiParam(value = "体积")
private Double partVol;
@Column(name = "TRUNROUND_RATE")
@ApiParam(value = "周转率")
private Double trunroundRate;
@Column(name = "COI_VALUE")
@ApiParam(value = "COI值")
private Double coiValue;
@Column(name = "LAST_UPDATE_DATE")
@ApiParam(value = "末次更新日期")
private String lastUpdateDate;
@Column(name = "FREQUENCY")
@ApiParam(value = "频次")
private Double frequency;
@Column(name = "LOCATE_NO")
@ApiParam(value = "库位")
private String locateNo;
}

@ -165,6 +165,26 @@ dataSrc ="cn.estsh.i3plus.pojo.wms.bean.WmsZones",
@AnnoOutputColumn(refClass = WmsEnumUtil.BH_LOCATE_TYPE.class, refForeignKey = "value", value = "description")
private Integer bhLocateType;
@Column(name = "DOWN_X")
@ApiParam(value = "X向下偏移", example = "-1")
@AnnoOutputColumn(refClass = WmsEnumUtil.DOWN_OR_UP.class, refForeignKey = "value", value = "description")
private Integer downX;
@Column(name = "UP_X")
@ApiParam(value = "X向上偏移", example = "-1")
@AnnoOutputColumn(refClass = WmsEnumUtil.DOWN_OR_UP.class, refForeignKey = "value", value = "description")
private Integer upX;
@Column(name = "DOWN_Y")
@ApiParam(value = "Y向下偏移", example = "-1")
@AnnoOutputColumn(refClass = WmsEnumUtil.DOWN_OR_UP.class, refForeignKey = "value", value = "description")
private Integer downY;
@Column(name = "UP_Y")
@ApiParam(value = "Y向上偏移", example = "-1")
@AnnoOutputColumn(refClass = WmsEnumUtil.DOWN_OR_UP.class, refForeignKey = "value", value = "description")
private Integer upY;
// 导入用
@ApiParam(value = "工厂")
@Transient

@ -226,6 +226,11 @@ public class WmsPart extends BaseBean {
@AnnoOutputColumn(refClass = WmsEnumUtil.IS_VALUABLE.class, refForeignKey = "value", value = "description")
private Integer isValuable;
@Column(name = "PART_VOL", columnDefinition = "decimal(18,8)")
@ApiParam(value = "体积", example = "1")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
private Double partVol;
@Transient
@ApiParam("总数量")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
@ -290,6 +295,11 @@ public class WmsPart extends BaseBean {
public WmsPart() {
}
public Double getPartVol() {
return partVol == null ? 0 : partVol;
}
public Double getQty() {
return qty == null ? 0 : qty;
}

@ -0,0 +1,126 @@
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.Table;
import javax.persistence.Transient;
/**
* @Description :
* @Reference :
* @Author : jimmy.zeng
* @CreateDate : 2020-06-09 16:45
* @Modify:
**/
@Data
@Entity
@Table(name="WMS_TRACTICS")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="策略表",description = "策略表")
public class WmsTractics extends BaseBean {
private static final long serialVersionUID = -8203200560604263871L;
@Column(name="TRACTICS_CODE")
@ApiParam(value ="策略代码")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
private String tracticsCode;
@Column(name="TRACTICS_NAME")
@ApiParam(value ="策略名称")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
private String tracticsName;
@Column(name="TRACTICS_DESC")
@ApiParam(value ="策略描述")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
private String tracticsDesc;
@Column(name="TRACTICS_GRADE")
@ApiParam(value ="策略等级")
// @AnnoOutputColumn(refClass = WmsEnumUtil.TRACTICS_GRADE.class, refForeignKey = "value", value = "description")
// @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isMultiple = 1, dataSrc = "TRACTICS_GRADE")
private Integer tracticsGrade;
@Column(name="TRACTICS_GROUP")
@ApiParam(value ="策略组")
// @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isMultiple = 1, dataSrc = "TRACTICS_GROUP")
@AnnoOutputColumn(refClass = WmsEnumUtil.TRACTICS_GROUP.class, refForeignKey = "value", value = "description")
private Integer tracticsGroup;
@Column(name="TRACTICS_ITEM")
@ApiParam(value ="策略项")
// @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER)
private Integer tracticsItem;
@Column(name="TRACTICS_PART_GROUP")
@ApiParam(value ="策略适用物料组")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST,isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsPartGroup",
searchColumnName = "partGroupNo,partGroupName", listColumnName = "partGroupNo,partGroupName", explicitColumnName = "partGroupNo")
private String tracticsPartGroup;
@Column(name="TRACTICS_ZONE")
@ApiParam(value ="策略适用存储区")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
dataSrc ="cn.estsh.i3plus.pojo.wms.bean.WmsZones",
searchColumnName = "zoneNo,zoneName",listColumnName = "zoneNo,zoneName", explicitColumnName = "zoneNo")
private String tracticsZone;
@Column(name="TRACTICS_PARAM")
@ApiParam(value ="参数")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
private String tracticsParam;
@Column(name="TRACTICS_START_TIME")
@ApiParam(value ="策略生效日期")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.DATETIME)
private String tracticsStartTime;
@Column(name="TRACTICS_END_TIME")
@ApiParam(value ="策略失效日期")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.DATETIME)
private String tracticsEndTime;
@Column(name="LEV1_STRATEGY")
@ApiParam(value ="1级策略上架")
@AnnoOutputColumn(refClass = WmsEnumUtil.INSTOCK_TRACTICS_ITEM_ONE.class, refForeignKey = "value", value = "description")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isMultiple = 1, dataSrc = "INSTOCK_TRACTICS_ITEM_ONE")
private String lev1Strategy;
// @Column(name="LEV1_STRATEGY")
@Transient
@ApiParam(value ="1级策略拣货")
@AnnoOutputColumn(refClass = WmsEnumUtil.PICKING_TRACTICS_ITEM_ONE.class, refForeignKey = "value", value = "description")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isMultiple = 1, dataSrc = "PICKING_TRACTICS_ITEM_ONE")
private String lev1StrategyPicking;
@Column(name="LEV2_STRATEGY")
@ApiParam(value ="2级策略")
@AnnoOutputColumn(refClass = WmsEnumUtil.INSTOCK_TRACTICS_ITEM_TWO.class, refForeignKey = "value", value = "description")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isMultiple = 1, dataSrc = "INSTOCK_TRACTICS_ITEM_TWO")
private String lev2Strategy;
@Column(name="LEV3_STRATEGY")
@ApiParam(value ="3级策略")
@AnnoOutputColumn(refClass = WmsEnumUtil.INSTOCK_TRACTICS_ITEM_THREE.class, refForeignKey = "value", value = "description")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isMultiple = 1, dataSrc = "INSTOCK_TRACTICS_ITEM_THREE")
private String lev3Strategy;
// public String getIev1StrategyPicking (String lev1StrategyPicking) {
// return this.lev1Strategy = lev1StrategyPicking;
// }
}

@ -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.WmsCoi;
import org.springframework.stereotype.Repository;
/**
* @Description : COI
* @Reference :
* @Author : jimmy.zeng
* @CreateDate : 2020-06-10 10:24
* @Modify:
**/
@Repository
public interface WmsCoiRepository extends BaseRepository<WmsCoi,Long> {
}

@ -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.WmsTractics;
import org.springframework.stereotype.Repository;
/**
* @Description :
* @Reference :
* @Author : jimmy.zeng
* @CreateDate : 2020-06-10 10:24
* @Modify:
**/
@Repository
public interface WmsTracticsRepository extends BaseRepository<WmsTractics,Long>{
}
Loading…
Cancel
Save