yun-zuoyi
WYnneaoapc 6 years ago
commit 29ac92566d

@ -1,5 +1,7 @@
package cn.estsh.i3plus.pojo.aps.annotation;
import cn.estsh.i3plus.pojo.aps.enums.EDIT_TYPE;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@ -22,4 +24,6 @@ public @interface FieldAnnotation {
boolean mainkey() default false; // 是否为主键
String defaultValue() default ""; // 字段的默认值
boolean popSearch() default false; // 弹出选择对象时是否显示
EDIT_TYPE editType() default EDIT_TYPE.NONE; // 定义字段的编辑类型
String typeName() default ""; // 定义字段类型的简单名称,对于多选关联对象时有用。
}

@ -1,6 +1,7 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import cn.estsh.i3plus.pojo.aps.enums.EDIT_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.FIELD_TYPE;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.annotation.JsonIgnore;
@ -92,6 +93,10 @@ public class FieldInfo extends BaseCode {
@ApiParam(value ="弹出选择时是否显示")
private Boolean popSearch;
@Column(name="EDIT_TYPE")
@ApiParam(value ="字段编辑类型")
private EDIT_TYPE editType;
@ApiParam(value ="枚举项内容")
private transient Enum<?>[] enumItems;

@ -70,7 +70,7 @@ public class Material extends BaseCode {
@Column(name="LEVEL")
@ApiParam(value ="低阶码")
@RippleAnnotation(dependence = {"OperOutputs.Operation.ProductRouting.Material"}, method = "calcLevel")
@RippleAnnotation(dependence = {"OperInputs.Operation.ProductRouting.Material.level"}, method = "calcLevel")
@FieldAnnotation(modify = false)
private Integer level;

@ -1,7 +1,9 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.enums.EDIT_TYPE;
import cn.estsh.i3plus.pojo.aps.holders.EResCalendar;
import com.fasterxml.jackson.annotation.JsonBackReference;
import io.swagger.annotations.Api;
@ -27,6 +29,7 @@ import java.util.List;
public class ResCalendar extends BaseAPS {
@Column(name="RES_CODES")
@ApiParam(value ="资源代码")
@FieldAnnotation(editType = EDIT_TYPE.MULTI_OBJECT, typeName = "Resource")
private String resCodes;
@Column(name="WEEKS")

@ -2,6 +2,7 @@ package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.enums.ROUTING_VALID_TYPE;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -31,6 +32,10 @@ public class SysParam extends BaseAPS {
@ApiParam(value ="最大中断次数")
private Integer maxInterruptCount;
@Column(name="TYPE")
@ApiParam(value ="工艺路径有效判断类型")
private ROUTING_VALID_TYPE type;
@Column(name="RULE_GROUP_ID")
@ApiParam(value ="规则组id")
@FieldAnnotation(display = false)

@ -2,10 +2,7 @@ package cn.estsh.i3plus.pojo.aps.common;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;
@ -235,6 +232,34 @@ public class BeanRelation {
return index == 0 && bNotLast;
}
/**
*
* @param bean
* @param holder
* @param args
* @param <T>
* @return List
*/
public static <T extends BaseBean> Set<T> listUnique(BaseBean bean, Enum<?> holder, Enum<?>... args) {
Set<T> result = new HashSet<>();
List<BaseBean> nextBeans = list(bean, holder);
for (BaseBean nextBean : nextBeans) {
listUniqueImpl(result, nextBean, args, 0);
}
result.remove(bean);
return result;
}
private static <T extends BaseBean> void listUniqueImpl(Set<T> result, BaseBean bean, Enum<?>[] holders, int index) {
if (index >= holders.length) {
result.add((T)bean);
} else {
List<BaseBean> nextBeans = list(bean, holders[index]);
for (BaseBean nextBean : nextBeans) {
listUniqueImpl(result, nextBean, holders, index + 1);
}
}
}
/**
@ -400,4 +425,38 @@ public class BeanRelation {
recursionImpl(relaBean, fun, holders, index + 1);
}
}
/**
* targetbeanholders
* @param bean
* @param target
* @param holders
* @return
*/
public static boolean recursionContains(BaseBean bean, BaseBean target, Enum<?>... holders) {
if (holders.length == 0) {
return false;
}
return recursionContainsImpl(bean, target, holders, 0);
}
private final static boolean recursionContainsImpl(BaseBean bean, BaseBean target,
Enum<?>[] holders, int index) {
if (index >= holders.length) {
if (target == bean) {
return true;
}
index = 0;
}
List<BaseBean> relaBeans = list(bean, holders[index]);
for (BaseBean relaBean : relaBeans) {
if (recursionContainsImpl(relaBean, target, holders, index + 1)) {
return true;
}
}
return false;
}
}

@ -25,7 +25,7 @@ public class DateDuration {
public static final double PRECISION = 0.00001;
private String value;
private long time = 0;
private int time = 0;
private double rate = 0.0;
private boolean bValid = false;
@ -60,7 +60,7 @@ public class DateDuration {
* 0
* @return
*/
public long getTime() {
public int getTime() {
return this.time;
}
@ -68,7 +68,7 @@ public class DateDuration {
*
* @return
*/
public void setTime(long time) {
public void setTime(int time) {
this.time = time;
}

@ -0,0 +1,28 @@
package cn.estsh.i3plus.pojo.aps.enums;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-09-17
* @Modify:
**/
public enum EDIT_TYPE {
NONE,
BOOLEAN, // 布尔, 开关编辑
CHAR, // 字符, 文本框编辑
SHORT, // 短整型, 数字编辑
INTEGER, // 整型, 数字编辑
LONG, // 长整型, 数字编辑
DOUBLE, // 浮点型, 文本框编辑
DATE, // 日期类型(2019-09-16)
TIME, // 时间类型(17:35:30)
DATE_TIME, // 日期时间类型(2019-09-16 17:35:30)
DURATION, // 时间段(1H),文本框编辑
ENUM, // 枚举,下拉选择
MULTI_ENUM, // 多选枚举, 下拉多选
STRING, // 字符串,文本框编辑
OBJECT, // 关联对象下来选择关联对象的Code值
LIST, // 对象集合,不可编辑。
MULTI_OBJECT // 多选对象,弹出框选择,可以选择全部对象,以*表示选择全部
}

@ -0,0 +1,14 @@
package cn.estsh.i3plus.pojo.aps.enums;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-10-29
* @Modify:
**/
public enum ROUTING_VALID_TYPE {
ORDER_CALC_LET, // 与订单的最晚结束时刻计算值做比较
CALC_LET_LT, // 与最晚结束时刻计算值-提前期做比较
BASE_TIME // 与基准时刻做比较
}

@ -12,6 +12,43 @@ import com.fasterxml.jackson.annotation.JsonFormat;
public class MesEnumUtil {
/**
* MesScrap
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SCRAP_TYPE {
SCRAP_TYPE(10, "过期"),
SCRAP_TYPE2(20, "不合格"),
SCRAP_TYPE3(30, "缺失");
private int value;
private String description;
SCRAP_TYPE(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
* mes
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)

@ -12,6 +12,82 @@ import org.apache.commons.lang3.StringUtils;
**/
public class MesPcnEnumUtil {
/**
* MesScrap
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SCRAP_TYPE {
SCRAP_TYPE(10, "过期"),
SCRAP_TYPE2(20, "不合格"),
SCRAP_TYPE3(30, "缺失");
private int value;
private String description;
SCRAP_TYPE(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
* MesProduceSnqcStatus
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PRODUCE_SN_QC_STATUS {
QUALIFIED(10, "合格"),
DEFECTED(20, "不合格"),
SCRAPED(30, "报废"),
DISMANTLED(40, "已拆解");
private int value;
private String description;
PRODUCE_SN_QC_STATUS(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
* mes
*/

@ -53,6 +53,10 @@ public class MesDefectRecord extends BaseBean {
@ApiParam("缺陷位置")
private String defectLocation;
@Column(name = "SIDE_LOCATION")
@ApiParam("面位")
private String sideLocation;
@Column(name="REPAIR_STATUS")
@ApiParam("维修状态")
private Integer repairStatus;

@ -36,4 +36,8 @@ public class MesScrap extends BaseBean {
@ApiParam("报废名称")
private String scrapName;
@Column(name = "SCRAP_TYPE")
@ApiParam("报废类型")
private String scrapType;
}

@ -60,10 +60,6 @@ public class MesScrapRecord extends BaseBean {
@ApiParam("工位")
private String workCellCode;
@Column(name = "SCRAP_REASON")
@ApiParam("报废原因")
private String scrapReason;
@Column(name = "MEMO")
@ApiParam("备注")
private String memo;

@ -36,6 +36,16 @@ public class MesProdBindRecordModel {
private Integer missQty;
@ApiParam("报废数")
private Integer scrapQty;
@ApiParam("创建时间")
private String createUser;
@ApiParam("创建时间")
private String createDatetime;
@ApiParam("修改人")
private String modifyUser;
@ApiParam("修改时间")
private String modifyDatetime;
@ApiParam("产品条码")
private String serialNumber;
public MesProdBindRecordModel() {
}
@ -72,4 +82,26 @@ public class MesProdBindRecordModel {
this.parentPartNo = parentPartNo;
this.parentPartName = parentPartName;
}
public MesProdBindRecordModel(Long id, String itemPartNo, String itemPartName, Double qty, Integer isValid, Integer isDeleted, String organizeCode, Integer isFeed, String workCenterCode, String workCellCode, String kpSn, String parentPartNo, String parentPartName, String createUser, String createDatetime, String modifyUser, String modifyDatetime, String serialNumber) {
this.id = id;
this.itemPartNo = itemPartNo;
this.itemPartName = itemPartName;
this.qty = qty;
this.isValid = isValid;
this.isDeleted = isDeleted;
this.organizeCode = organizeCode;
this.isFeed = isFeed;
this.workCenterCode = workCenterCode;
this.workCellCode = workCellCode;
this.kpSn = kpSn;
this.parentPartNo = parentPartNo;
this.parentPartName = parentPartName;
this.createUser = createUser;
this.createDatetime = createDatetime;
this.modifyUser = modifyUser;
this.modifyDatetime = modifyDatetime;
this.serialNumber = serialNumber;
}
}

@ -220,4 +220,64 @@ public class MesHqlPack {
return packBean;
}
/**
* MES PCN
*
* @param mesRepair
* @return
*/
public static DdlPackBean getMesRepair(MesRepair mesRepair, String organizeCode) {
DdlPackBean packBean = getAllBaseData(organizeCode);
if (StringUtils.isNotEmpty(mesRepair.getRepairCode())) {
DdlPreparedPack.getStringLikerPack(mesRepair.getRepairCode(), "repairCode", packBean);
}
if (StringUtils.isNotEmpty(mesRepair.getRepairName())) {
DdlPreparedPack.getStringLikerPack(mesRepair.getRepairName(), "repairName", packBean);
}
if (mesRepair.getRepairType() != null) {
DdlPreparedPack.getNumEqualPack(mesRepair.getRepairType(), "repairType", packBean);
}
return packBean;
}
/**
* MES PCN
*
* @param mesScrap
* @return
*/
public static DdlPackBean getMesScrap(MesScrap mesScrap, String organizeCode) {
DdlPackBean packBean = getAllBaseData(organizeCode);
if (StringUtils.isNotEmpty(mesScrap.getScrapCode())) {
DdlPreparedPack.getStringLikerPack(mesScrap.getScrapCode(), "scrapCode", packBean);
}
if (StringUtils.isNotEmpty(mesScrap.getScrapName())) {
DdlPreparedPack.getStringLikerPack(mesScrap.getScrapName(), "scrapName", packBean);
}
if (StringUtils.isNotEmpty(mesScrap.getScrapType())) {
DdlPreparedPack.getStringLikerPack(mesScrap.getScrapType(), "scrapType", packBean);
}
return packBean;
}
/**
* MES PCN
*
* @param mesDefectCause
* @return
*/
public static DdlPackBean getMesDefectCause(MesDefectCause mesDefectCause, String organizeCode) {
DdlPackBean packBean = getAllBaseData(organizeCode);
if (StringUtils.isNotEmpty(mesDefectCause.getDcCode())) {
DdlPreparedPack.getStringLikerPack(mesDefectCause.getDcCode(), "dcCode", packBean);
}
if (StringUtils.isNotEmpty(mesDefectCause.getDcName())) {
DdlPreparedPack.getStringLikerPack(mesDefectCause.getDcName(), "dcName", packBean);
}
if (mesDefectCause.getDcType() != null) {
DdlPreparedPack.getNumEqualPack(mesDefectCause.getDcType(), "dcType", packBean);
}
return packBean;
}
}

@ -0,0 +1,23 @@
package cn.estsh.i3plus.pojo.mes.model;
import io.swagger.annotations.ApiParam;
import lombok.Data;
/**
* @Description : Model
* @Reference :
* @Author : jack.jia
* @CreateDate : 2019-10-28
* @Modify:
**/
@Data
public class NormalityModel {
@ApiParam("节点")
double node;
@ApiParam("发生频次")
int times;
@ApiParam("开始节点")
double from;
@ApiParam("结束节点")
double to;
}

@ -0,0 +1,43 @@
package cn.estsh.i3plus.pojo.mes.model;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : jack.jia
* @CreateDate : 2019-10-28
* @Modify:
**/
@Data
public class XrSampleModel {
@ApiParam("样本数量")
private int sampleCount;
@ApiParam("样本组数")
private int groupCount;
@ApiParam("每组个数")
private int preGroupCount;
@ApiParam("A2值")
private double a2;
@ApiParam("D3值")
private double d3;
@ApiParam("D4值")
private double d4;
@ApiParam("均值平均数")
private double xAver;
@ApiParam("均值控制上限")
private double xUcl;
@ApiParam("均值控制下限")
private double xLcl;
@ApiParam("极差平均数")
private double rAver;
@ApiParam("极差控制上限")
private double rUcl;
@ApiParam("极差控制下限")
private double rLcl;
}

@ -185,6 +185,10 @@ public class WmsMoveDetails extends BaseBean {
@Transient
private Integer isSnapshot;
@Transient
@ApiParam(value = "车号")
private String carNo;
public Integer getIsSnapshot() {
return isSnapshot == null ? 0 : isSnapshot.intValue();
}
@ -225,12 +229,14 @@ public class WmsMoveDetails extends BaseBean {
public Long getFinishedCounts() {
return finishedCounts == null ? 0L : this.finishedCounts;
}
public WmsMoveDetails(String partNo, String partNameRdd, String unit, Double transQty) {
this.partNo = partNo;
this.partNameRdd = partNameRdd;
this.unit = unit;
this.transQty = transQty;
}
public WmsMoveDetails(String organizeCode, String partNo, String partNameRdd, String workCenterCode, String fPartNo, String fPartName, String unit, Double qty,
String createDateTime, String sn, String srcZoneNo) {
this.organizeCode = organizeCode;

Loading…
Cancel
Save