【需求:1189,产品条码工步】

yun-zuoyi
王杰 6 years ago
parent e30ba280e0
commit f5c8e36ac9

@ -2899,6 +2899,7 @@ public class MesEnumUtil {
PART_NO("partNo", "物料号"),
CUST_PART_NO("custPartNo", "客户物料号"),
CUST_CODE("custCode", "客户代码"),
SERIAL_NUMBER("serialNumber", "过程条码"),
PROD_LOCATION("prodLocation", "产地"),
YEAR("year", "年"),
MOTH("month", "月"),

@ -12,6 +12,92 @@ import org.apache.commons.lang3.StringUtils;
**/
public class MesPcnEnumUtil {
/**
* MesProductEncodeCfg
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum MES_MATCH_TYPE {
ORGANIZATION("10", "工厂"),
PART("20", "物料"),
CUST_CODE("30", "客户代码"),
CUST_PART_NO("40", "客户物料号"),
WORK_CENTER("50", "产线");
private String value;
private String description;
MES_MATCH_TYPE(String value, String description) {
this.value = value;
this.description = description;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(String val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
// 根据value返回枚举类型,主要在switch中使用
public static MES_MATCH_TYPE getByValue(String value) {
for (MES_MATCH_TYPE mesMatchType : values()) {
if (mesMatchType.getValue().equals(value)) {
return mesMatchType;
}
}
return null;
}
}
/**
* MesProductEncodeCfg
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum MES_CODE_TYPE {
SERIAL_SN("10", "过程条码"),
PRODUCT_SN("20", "产品条码"),
PACK_SN("30", "包装条码");
private String value;
private String description;
MES_CODE_TYPE(String value, String description) {
this.value = value;
this.description = description;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(String val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
* MesScrap

@ -73,6 +73,18 @@ public class MesPart extends BaseBean {
@ApiParam("产品类型")
private String produceCategory;
@Column(name = "PORCESS_MATCH_TYPE")
@ApiParam("过程编码匹配类型")
private String porcessMatchType;
@Column(name = "PACKAGE_MATCH_TYPE")
@ApiParam("包装编码匹配类型")
private String packageMatchType;
@Column(name = "PRODUCT_MATCH_TYPE")
@ApiParam("产品编码匹配类型")
private String productMatchType;
@Transient
@ApiParam("分类名称")
private String categoryName;

@ -0,0 +1,51 @@
package cn.estsh.i3plus.pojo.mes.pcn.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:
* @Reference:
* @Author: wangjie
* @CreateDate:2019-04-16-17:36
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PRODUCT_ENCODE_CFG")
@Api("产品编码配置表")
public class MesProductEncodeCfg extends BaseBean implements Serializable {
private static final long serialVersionUID = 6641051790330191326L;
@Column(name = "CODE_TYPE")
@ApiParam("编码类型")
private Integer codeType;
@Column(name = "MATCH_TYPE")
@ApiParam("匹配类型")
private Integer matchType;
@Column(name = "MATCH_VALUE")
@ApiParam("匹配值")
private String matchValue;
@Column(name = "RULE_CODE")
@ApiParam("编码规则代码")
private String ruleCode;
}

@ -34,6 +34,9 @@ public class GenSerialNoModel {
@ApiParam("客户代码")
private String custCode;
@ApiParam("过程条码")
private String serialNumber;
@ApiParam("产地")
private String prodLocation;

@ -0,0 +1,16 @@
package cn.estsh.i3plus.pojo.mes.pcn.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.mes.pcn.bean.MesProductEncodeCfg;
import org.springframework.stereotype.Repository;
/**
* @Description:
* @Reference:
* @Author: wangjie
* @CreateDate:2019-04-17-17:10
* @Modify:
**/
@Repository
public interface MesProductEncodeCfgRepository extends BaseRepository<MesProductEncodeCfg, Long> {
}

@ -76,4 +76,16 @@ public class MesPart extends BaseBean {
@Transient
@ApiParam("产品类型名称")
private String produceCategoryName;
@Column(name = "PORCESS_MATCH_TYPE")
@ApiParam("过程编码匹配类型")
private String porcessMatchType;
@Column(name = "PACKAGE_MATCH_TYPE")
@ApiParam("包装编码匹配类型")
private String packageMatchType;
@Column(name = "PRODUCT_MATCH_TYPE")
@ApiParam("产品编码匹配类型")
private String productMatchType;
}

@ -39,6 +39,9 @@ public class GenSerialNoModel {
@ApiParam("客户代码")
private String custCode;
@ApiParam("过程条码")
private String serialNumber;
@ApiParam("产地")
private String prodLocation;

Loading…
Cancel
Save