yun-zuoyi
lbwgithub 6 years ago
commit 3ba7719160

@ -1,11 +1,15 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EBaseOrder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import javax.persistence.Column;
import java.util.Date;
import java.util.List;
/**
* @Description :
@ -48,4 +52,8 @@ public class BaseOrder extends BaseAPS {
@Column(name="RECEIVE_DATE")
@ApiParam(value ="接单日期")
private Date receiveDate;
public List<Work> getWorks() {
return BeanRelation.list(this, EBaseOrder.Works);
}
}

@ -1,5 +1,7 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
/**
* @Description :
* @Reference :

@ -0,0 +1,53 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.enums.DATA_LINK_TYPE;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-09-23
* @Modify:
**/
@Data
@Entity
@Table(name = "APS_DATA_LINK")
@Api("数据集成数据连接信息")
public class DataLink extends BaseAPS {
@Column(name="NAME")
@ApiParam(value ="编码")
private String name;
@Column(name="TYPE")
@ApiParam(value ="链接类型")
private DATA_LINK_TYPE type;
@Column(name="PATH")
@ApiParam(value ="IP/文件路径")
private String path;
@Column(name="PORT")
@ApiParam(value ="端口")
private Integer port;
@Column(name="DB_NAME")
@ApiParam(value ="数据库名")
private String dbName;
@Column(name="USER_NAME")
@ApiParam(value ="用户名")
private String userName;
@Column(name="PASSWORD")
@ApiParam(value ="密码")
private String password;
}

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;

@ -0,0 +1,54 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EExportDetail;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-09-23
* @Modify:
**/
@Data
@Entity
@Table(name = "APS_EXPORT_DETAIL")
@Api("数据导出明细")
public class ExportDetail extends BaseAPS {
@Column(name="FILTER")
@ApiParam(value ="筛选")
private String filter;
@Column(name="SORT_BY")
@ApiParam(value ="排序")
private String sortBy;
@Column(name="OUT_NAME")
@ApiParam(value ="外部表名")
private String outName;
@Column(name="IN_NAME")
@ApiParam(value ="内部表名")
private String inName;
@Column(name="PROJECT_ID")
@ApiParam(value ="导出项目ID")
private Long projectId;
public ExportProject getProject() {
return BeanRelation.get(this, EExportDetail.Project);
}
public void setProject(ExportProject project) {
this.projectId = project != null ? project.getId() : 0l;
BeanRelation.set(this, EExportDetail.Project, project);
}
}

@ -0,0 +1,47 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EExportProject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-09-23
* @Modify:
**/
@Data
@Entity
@Table(name = "APS_EXPORT_PROJECT")
@Api("数据导出明细集合")
public class ExportProject extends BaseAPS {
@Column(name="NAME")
@ApiParam(value ="标识名")
private String name;
@Column(name="LINK_ID")
@ApiParam(value ="数据源连接")
private Long linkId;
public DataLink getLink() {
return BeanRelation.get(this, EExportProject.Link);
}
public void setLink(DataLink link) {
this.linkId = link != null ? link.getId() : 0l;
BeanRelation.set(this, EExportProject.Link, link);
}
public List<ExportDetail> getDetails() {
return BeanRelation.list(this, EExportProject.Details);
}
}

@ -1,14 +1,17 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import cn.estsh.i3plus.pojo.aps.enums.FIELD_TYPE;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.annotation.JsonIgnore;
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 java.lang.reflect.Method;
@ -28,14 +31,44 @@ import java.lang.reflect.Method;
@Table(name="APS_FIELD_INFO")
@Api("字段信息")
public class FieldInfo extends BaseCode {
@Column(name="CLASS_NAME")
@ApiParam(value ="所属类简称")
private String className;
@Column(name="TYPE")
@ApiParam(value ="类型")
private FIELD_TYPE type;
@Column(name="TYPE_NAME")
@ApiParam(value ="类型全称")
private String typeName;
@Column(name="CUSTOMIZE")
@ApiParam(value ="是否为自定义字段")
private Boolean customize;
@Column(name="MODIFY")
@ApiParam(value ="是否能修改")
private Boolean modify;
@Column(name="DISPLAY")
@ApiParam(value ="是否在界面显示")
private Boolean display;
@Column(name="PRIC")
@ApiParam(value ="浮点数显示精度")
private Integer pric;
@Column(name="TIPS")
@ApiParam(value ="字段提示")
private String tips;
@Column(name="EXPRESSION")
@ApiParam(value ="表达式")
private String expression;
@Column(name="POSITION")
@ApiParam(value ="位置")
private String position;
@JsonIgnore

@ -0,0 +1,36 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.enums.IMPORT_DETAIL_TYPE;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-09-23
* @Modify:
**/
@Data
@Entity
@Table(name = "APS_IMPORT_DETAIL")
@Api("数据导入明细")
public class ImportDetail extends BaseAPS {
@Column(name="TYPE")
@ApiParam(value ="导入类型")
private IMPORT_DETAIL_TYPE type;
@Column(name="OUT_NAME")
@ApiParam(value ="外部表名")
private String outName;
@Column(name="IN_NAME")
@ApiParam(value ="内部表名")
private String inName;
}

@ -0,0 +1,27 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-09-23
* @Modify:
**/
@Data
@Entity
@Table(name = "APS_IMPORT_PROJECT")
@Api("数据导入明细集合")
public class ImportProject extends BaseAPS {
@Column(name="NAME")
@ApiParam(value ="标识名")
private String name;
}

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import cn.estsh.i3plus.pojo.aps.enums.MATERIAL_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.PREPARE_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.REPLENISHMENT_TYPE;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.enums.CONSTRAINT_TYPE;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.enums.USE_TYPE;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.enums.CONSTRAINT_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.TAIL_DEAL;
import io.swagger.annotations.Api;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.enums.CALENDAR_TYPE;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import io.swagger.annotations.Api;
import lombok.Data;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import cn.estsh.i3plus.pojo.aps.enums.RESOURCE_CLASS;
import cn.estsh.i3plus.pojo.aps.enums.RESOURCE_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.TIME_ROUND_TYPE;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import io.swagger.annotations.Api;
import lombok.Data;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import cn.estsh.i3plus.pojo.aps.enums.DIRECTION;
import cn.estsh.i3plus.pojo.aps.enums.RES_COMB_LOCK_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.RES_COMB_TIME_TYPE;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;

@ -1,7 +1,10 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.enums.WORK_STATUS;
import cn.estsh.i3plus.pojo.aps.enums.WORK_TYPE;
import cn.estsh.i3plus.pojo.aps.holders.EWork;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -90,4 +93,17 @@ public class Work extends BaseCode {
@Column(name="PLAN_RESOURCE")
@ApiParam(value ="计划主资源")
private String planResource;
@Column(name="ORDER_ID")
@ApiParam(value ="订单")
private Long orderId;
public BaseOrder getOrder() {
return BeanRelation.get(this, EWork.Order);
}
public void setOrder(BaseOrder order) {
this.orderId = order != null ? order.getId() : 0l;
BeanRelation.set(this, EWork.Order, order);
}
}

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.enums.CONSTRAINT_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.WORK_RELATION_TYPE;
import io.swagger.annotations.Api;

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.enums.USE_TYPE;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;

@ -1,4 +1,4 @@
package cn.estsh.i3plus.pojo.aps.bean;
package cn.estsh.i3plus.pojo.aps.common;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import lombok.Data;

@ -1,4 +1,4 @@
package cn.estsh.i3plus.pojo.aps.bean;
package cn.estsh.i3plus.pojo.aps.common;
import io.swagger.annotations.ApiParam;
import lombok.Data;

@ -0,0 +1,271 @@
package cn.estsh.i3plus.pojo.aps.common;
import cn.estsh.i3plus.pojo.aps.bean.DateDuration;
import cn.estsh.i3plus.pojo.aps.enums.FIELD_TYPE;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import java.util.*;
public class BeanInfo {
private Class<? extends BaseBean> cls;
private BeanInfo superBeanInfo;
private List<BeanInfo> childsBeanInfos = new ArrayList<>();
private Map<Enum<?>, RelationInfo> relations = new HashMap<>();
public BeanInfo(Class<? extends BaseBean> cls) {
this.cls = cls;
}
public void initHolder(Class<Enum<? extends Enum<?>>> holderCls) {
Enum<? extends Enum<?>>[] ens = holderCls.getEnumConstants();
for (Enum<? extends Enum<?>> en : ens) {
RelationInfo info = new RelationInfo();
info.setHolder(en);
info.setBeanInfo(this);
relations.put(en, info);
}
}
public BeanInfo getSuperBeanInfo() { return superBeanInfo; }
public boolean validHolder(Enum<?> holder) {
return this.relations.get(holder) != null;
}
public Enum<?> getHolder(String name) {
for (Enum<?> holder : relations.keySet()) {
if (holder.name().equalsIgnoreCase(name)) {
return holder;
}
}
if (superBeanInfo != null) {
return superBeanInfo.getHolder(name);
}
return null;
}
public Enum<?> getReverseHolder(Enum<?> holder) {
RelationInfo relaInfo = getRelationInfo(holder);
if (relaInfo != null) {
return relaInfo.getReverseHolder();
}
return null;
}
public Enum<?> getReverseHolder(String name) {
RelationInfo relaInfo = getRelationInfo(name);
if (relaInfo != null) {
return relaInfo.getReverseHolder();
}
return null;
}
public RelationInfo getRelationInfo(Enum<?> holder) {
if (validHolder(holder)) {
return relations.get(holder);
}
if (superBeanInfo != null) {
return superBeanInfo.getRelationInfo(holder);
}
return null;
}
public RelationInfo getRelationInfo(String name) {
Enum<?> holder = getHolder(name);
if (holder != null) {
return getRelationInfo(holder);
}
return null;
}
public void addRelationInfo(Enum<?> holder, RelationInfo info) {
this.relations.put(holder, info);
}
public <T extends BaseBean> Class<T> getBeanClass() {
return (Class<T>)cls;
}
public BeanInfo getRelationBeanInfo(Enum<?> holder) {
RelationInfo relaInfo = getRelationInfo(holder);
if (relaInfo != null) {
return relaInfo.getBeanInfo();
}
return null;
}
public BeanInfo getRelationBeanInfo(String name) {
RelationInfo relaInfo = getRelationInfo(name);
if (relaInfo != null) {
return relaInfo.getBeanInfo();
}
return null;
}
public RELATION_TYPE getRelationType(Enum<?> holder) {
RelationInfo relaInfo = getRelationInfo(holder);
if (relaInfo != null) {
return relaInfo.getType();
}
return RELATION_TYPE.INVALID;
}
public RELATION_TYPE getRelationType(String name) {
RelationInfo relaInfo = getRelationInfo(name);
if (relaInfo != null) {
return relaInfo.getType();
}
return RELATION_TYPE.INVALID;
}
public List<Enum<?>> getAllHolders() {
List<Enum<?>> holders = new ArrayList<>();
for (Map.Entry<Enum<?>, RelationInfo> entry : relations.entrySet()) {
holders.add(entry.getKey());
}
return holders;
}
public List<Enum<?>> getOwnerHolders() {
List<Enum<?>> owners = new ArrayList<>();
for (Map.Entry<Enum<?>, RelationInfo> entry : relations.entrySet()) {
if (entry.getValue().isOwner()) {
owners.add(entry.getKey());
}
}
return owners;
}
public List<Enum<?>> getNormalSigns() {
List<Enum<?>> holders = new ArrayList<>();
for (Map.Entry<Enum<?>, RelationInfo> entry : relations.entrySet()) {
if (!entry.getValue().isOwner()) {
holders.add(entry.getKey());
}
}
return holders;
}
private static Map<Class<? extends BaseBean>, BeanInfo> beanInfos = new HashMap<>();
private static Map<String, BeanInfo> nameMapBeanInfos = new HashMap<>();
static {
BeanInfo beanInfo = new BeanInfo(BaseBean.class);
beanInfos.put(BaseBean.class, beanInfo);
nameMapBeanInfos.put(BaseBean.class.getSimpleName(), beanInfo);
}
public static void register(Class<? extends BaseBean> cls) {
if (beanInfos.containsKey(cls)) {
return;
}
BeanInfo beanInfo = new BeanInfo(cls);
beanInfos.put(cls, beanInfo);
nameMapBeanInfos.put(cls.getSimpleName(), beanInfo);
register((Class<? extends BaseBean>)cls.getSuperclass());
}
public static void init() {
for (Map.Entry<Class<? extends BaseBean>, BeanInfo> entry : beanInfos.entrySet()) {
Class<? extends BaseBean> superClass = (Class<? extends BaseBean>)entry.getKey().getSuperclass();
BeanInfo superBeanInfo = beanInfos.get(superClass);
if (superBeanInfo != null) {
entry.getValue().superBeanInfo = superBeanInfo;
superBeanInfo.childsBeanInfos.add(entry.getValue());
}
}
BeanRelationUtil.initData("cn.estsh.i3plus.pojo.aps.holders");
BeanRelationUtil.loadConfig("relations");
}
public static Set<Class<? extends BaseBean>> getBeanClasses() {
return beanInfos.keySet();
}
public static BeanInfo getBeanInfo(Class<? extends BaseBean> cls) {
BeanInfo info = beanInfos.get(cls);
return info;
}
public static BeanInfo getBeanInfo(String name) {
BeanInfo info = nameMapBeanInfos.get(name);
return info;
}
public static Class<? extends BaseBean> getSuperClass(Class<? extends BaseBean> cls) {
BeanInfo superBeanInfo = getBeanInfo(cls).superBeanInfo;
if (superBeanInfo != null) {
return superBeanInfo.getBeanClass();
}
return null;
}
public static FIELD_TYPE getFieldType(Class<?> cls) {
FIELD_TYPE type = null;
if (cls == Boolean.class || cls == boolean.class) {
type = FIELD_TYPE.BOOLEAN;
} else if (cls == Character.class) {
type = FIELD_TYPE.CHAR;
} else if (cls == Short.class || cls == short.class) {
type = FIELD_TYPE.SHORT;
} else if (cls == Integer.class || cls == int.class) {
type = FIELD_TYPE.INTEGER;
} else if (cls == Long.class || cls == long.class) {
type = FIELD_TYPE.LONG;
} else if (cls == Double.class || cls == Float.class ||
cls == double.class || cls == float.class) {
type = FIELD_TYPE.DOUBLE;
} else if (cls == String.class) {
type = FIELD_TYPE.STRING;
} else if(cls == Date.class || cls == java.sql.Date.class) {
type = FIELD_TYPE.DATE_TIME;
} else if (cls == DateDuration.class) {
type = FIELD_TYPE.DURATION;
} else if (Enum.class.isAssignableFrom(cls)) {
type = FIELD_TYPE.ENUM;
} else if (BaseBean.class.isAssignableFrom(cls)) {
type = FIELD_TYPE.OBJECT;
}
return type;
}
public static Class<?> getFieldClass(FIELD_TYPE type) {
Class<?> cls = null;
switch (type) {
case BOOLEAN:
cls = Boolean.class;
break;
case CHAR:
cls = Character.class;
break;
case SHORT:
cls = Short.class;
break;
case INTEGER:
cls = Integer.class;
break;
case LONG:
cls = Long.class;
break;
case DOUBLE:
cls = Double.class;
break;
case DATE:
case TIME:
case DATE_TIME:
cls = Date.class;
break;
case STRING:
cls = String.class;
break;
default:
break;
}
return cls;
}
}

@ -0,0 +1,241 @@
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.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;
public class BeanRelation {
Map<Class<? extends BaseBean>, Map<Long, Map<Enum<?>, List<BaseBean>>>> caches = new HashMap<>();
private static Map<Long, BeanRelation> relations = new ConcurrentHashMap<>();
private static BeanRelation get() {
Long userId = 0l;
BeanRelation relation = relations.get(userId);
if (relation == null) {
synchronized (BeanRelation.class) {
relation = relations.get(userId);
if (relation == null) {
relation = new BeanRelation();
relations.put(userId, relation);
}
}
}
return relation;
}
private static Map<Enum<?>, List<BaseBean>> createRelation(Class<? extends BaseBean> cls) {
return null;
}
public static Map<Enum<?>, List<BaseBean>> get(BaseBean bean) {
Map<Enum<?>, List<BaseBean>> temp = get().caches.get(bean.getClass()).get(bean.getId());
if (temp == null) {
synchronized (bean.getClass()) {
if (temp == null) {
temp = createRelation(bean.getClass());
get().caches.get(bean.getClass()).put(bean.getId(), temp);
}
}
}
return temp;
}
public static void init() {
}
public static <T extends BaseBean> T get(BaseBean bean, Enum<?> holder) {
List<T> beans = (List<T>)get(bean).get(holder);
if (beans == null || beans.isEmpty()) {
return null;
}
return beans.get(0);
}
public static <T extends BaseBean> T get(BaseBean bean, Enum<?> holder, Enum<?>... args) {
return get(bean, null, holder, args);
}
public static <T extends BaseBean> T get(BaseBean bean, Predicate<T> pred, Enum<?> holder, Enum<?>... args) {
return null;
}
private static <T extends BaseBean> T getImpl(BaseBean bean, Predicate<T> pred, Enum<?>[] args, int index) {
if (index >= args.length) {
if (pred == null || pred.test((T)bean)) {
return (T)bean;
}
} else {
//List<BaseAPS> relaBeans =
}
return null;
}
public static <T extends BaseBean> List<T> list(BaseBean bean, Enum<?> holder) {
List<T> beans = (List<T>)get(bean).get(holder);
if (beans == null) {
return new ArrayList<>();
}
return beans;
}
public static <T extends BaseBean> List<T> list(BaseBean bean, Enum<?> holder, Enum<?>... args) {
return list(bean, null, holder, args);
}
public static <T extends BaseBean> List<T> list(BaseBean bean, Predicate<T> pred, Enum<?> holder, Enum<?>... args) {
List<T> result = new ArrayList<>();
List<BaseBean> nextBeans = list(bean, holder);
for (BaseBean nextBean : nextBeans) {
listImpl(result, nextBean, pred, args, 0);
}
return result;
}
private static <T extends BaseBean> void listImpl(List<T> result, BaseBean bean, Predicate<T> pred, Enum<?>[] holders, int index) {
if (index >= holders.length) {
if (pred == null || pred.test((T)bean)) {
result.add((T)bean);
}
} else {
List<BaseBean> nextBeans = list(bean, holders[index]);
for (BaseBean nextBean : nextBeans) {
listImpl(result, nextBean, pred, holders, index + 1);
}
}
}
/**
*
*
* @param bean
* @param holder
* @param relaBean
*/
public static void set(BaseBean bean, Enum<?> holder, BaseBean relaBean) {
if (bean == null) {
return;
}
if (relaBean == null) {
remove(bean, holder);
} else {
BeanInfo beanInfo = BeanInfo.getBeanInfo(bean.getClass());
final Enum<?> reverseHolder = beanInfo.getReverseHolder(holder);
switch (beanInfo.getRelationType(holder)) {
case MULTI_TO_MULTI:
break;
case MULTI_TO_ONE:
remove(bean, holder);
break;
case INVALID:
break;
case ONE_TO_MULTI:
remove(relaBean, reverseHolder);
break;
case ONE_TO_ONE:
remove(bean, holder);
remove(relaBean, reverseHolder);
break;
default:
break;
}
setImpl(bean, holder, relaBean, reverseHolder);
}
}
/**
*
*
* @param bean
* @param holder
* @param relaBean
* @param reverseHolder
*/
private static void setImpl(BaseBean bean, Enum<?> holder, BaseBean relaBean, Enum<?> reverseHolder) {
get(bean).get(holder).add(relaBean);
if (reverseHolder != null) {
get(relaBean).get(reverseHolder).add(bean);
}
}
/**
*
*
* @param bean
* @param holder
*/
private static void remove(BaseBean bean, Enum<?> holder) {
if (holder == null) {
return;
}
BeanInfo beanInfo = BeanInfo.getBeanInfo(bean.getClass());
final Enum<?> reverseHolder = beanInfo.getReverseHolder(holder);
if (reverseHolder != null) {
for (BaseBean relaBean : get(bean).get(holder)) {
if (relaBean == null) {
continue;
}
get(relaBean).get(reverseHolder).remove(bean);
}
}
get(bean).get(holder).clear();
}
/**
*
*
* @param bean
* @param holder
* @param relaBean
*/
private static void remove(BaseBean bean, Enum<?> holder, BaseBean relaBean) {
if (bean == null) {
return;
}
BeanInfo beanInfo = BeanInfo.getBeanInfo(bean.getClass());
final Enum<?> reverseHolder = beanInfo.getReverseHolder(holder);
if (reverseHolder != null) {
get(relaBean).get(reverseHolder).remove(bean);
}
get(bean).get(holder).remove(relaBean);
}
/**
*
*
* @param bean
*/
public static void delete(BaseBean bean) {
if (bean == null) {
return;
}
BeanInfo beanInfo = BeanInfo.getBeanInfo(bean.getClass());
List<Enum<?>> ownerSigns = beanInfo.getOwnerHolders();
for (Enum<?> holder : ownerSigns) {
List<BaseBean> relaBeans = new ArrayList<>(list(bean, holder));
for (BaseBean relaBean : relaBeans) {
//MemoryManager.delete(relaBean);
}
}
List<Enum<?>> normalSigns = beanInfo.getNormalSigns();
for (Enum<?> holder : normalSigns) {
Enum<?> reverseHolder = beanInfo.getReverseHolder(holder);
List<BaseBean> relaBeans = new ArrayList<>(list(bean, holder));
for (BaseBean relaBean : relaBeans) {
if (reverseHolder != null) {
remove(relaBean, reverseHolder, bean);
}
}
}
}
}

@ -0,0 +1,320 @@
package cn.estsh.i3plus.pojo.aps.common;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.io.InputStream;
import java.net.JarURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
public class BeanRelationUtil {
static class XMLReader extends DefaultHandler {
private BeanInfo firstInfo = null;
private Enum<?> firstHolder = null;
private BeanInfo secondInfo = null;
private Enum<?> secondHolder = null;
private RELATION_TYPE type = RELATION_TYPE.INVALID;
private boolean owner = false;
public void startElement(String uri, String localName, String nodeName, Attributes attributes) throws SAXException {
if (nodeName.equalsIgnoreCase("Class")) {
final String name = attributes.getValue("name");
if (name == null) {
throw new SAXException("Class节点的属性name未配置");
}
this.firstInfo = BeanInfo.getBeanInfo(name);
if (this.firstInfo == null) {
throw new SAXException("未找到" + name + "的类定义");
}
} else if (nodeName.equalsIgnoreCase("Relation")) {
if (this.firstInfo == null) {
throw new SAXException("未配置Class节点");
}
String firstSignName = attributes.getValue("field");
if (firstSignName == null) {
throw new SAXException("Relation节点缺少field属性");
}
this.firstHolder = this.firstInfo.getHolder(firstSignName);
if (this.firstHolder == null) {
throw new SAXException("未定义枚举标识" + firstSignName);
}
String secondFactoryName = attributes.getValue("name");
if (secondFactoryName == null) {
throw new SAXException("Relation节点缺少name属性");
}
this.secondInfo = BeanInfo.getBeanInfo(secondFactoryName);
if (this.secondInfo == null) {
throw new SAXException("未找到" + secondFactoryName + "的类定义");
}
String secondSignName = attributes.getValue("reverse");
if (secondSignName != null) {
this.secondHolder = this.secondInfo.getHolder(secondSignName);
if (this.secondHolder == null) {
throw new SAXException(secondFactoryName + "类未定义枚举标识" + secondSignName);
}
} else {
this.secondHolder = null;
}
String typeName = attributes.getValue("type");
if (typeName == null) {
throw new SAXException("Relation节点缺少type属性");
}
this.type = RELATION_TYPE.valueOf(typeName);
String ownerName = attributes.getValue("owner");
if (ownerName == null) {
this.owner = false;
} else {
this.owner = ownerName.equalsIgnoreCase("true") ? true : false;
}
RelationInfo firstData = this.getSignData(firstInfo, this.firstHolder);
firstData.setBeanInfo(this.secondInfo);
firstData.setType(this.type);
firstData.setOwner(this.owner);
firstData.setReverseHolder(this.secondHolder);
if (this.secondHolder != null) {
RelationInfo secondData = this.getSignData(secondInfo, this.secondHolder);
secondData.setBeanInfo(this.firstInfo);
secondData.setOwner(false);
secondData.setReverseHolder(this.firstHolder);
switch (this.type) {
case MULTI_TO_MULTI:
secondData.setType(RELATION_TYPE.MULTI_TO_MULTI);
break;
case MULTI_TO_ONE:
secondData.setType(RELATION_TYPE.ONE_TO_MULTI);
break;
case INVALID:
secondData.setType(RELATION_TYPE.INVALID);
break;
case ONE_TO_MULTI:
secondData.setType(RELATION_TYPE.MULTI_TO_ONE);
break;
case ONE_TO_ONE:
secondData.setType(RELATION_TYPE.ONE_TO_ONE);
break;
default:
secondData.setType(RELATION_TYPE.INVALID);
break;
}
}
}
}
RelationInfo getSignData(BeanInfo beanInfo, Enum<?> holder) {
RelationInfo data = beanInfo.getRelationInfo(holder);
if (data == null) {
data = new RelationInfo();
data.setHolder(holder);
beanInfo.addRelationInfo(holder, data);
}
return data;
}
}
public static void initData(String holderPackage) {
List<Class<?>> holderClses = loadClass(holderPackage);
for (Class<?> enumCls : holderClses) {
if (!Enum.class.isAssignableFrom(enumCls)) {
continue;
}
String name = enumCls.getSimpleName();
BeanInfo beanInfo = BeanInfo.getBeanInfo(name.substring(1));
if (beanInfo == null) {
continue;
}
beanInfo.initHolder((Class<Enum<? extends Enum<?>>>) enumCls);
}
}
public static void loadConfig(String packName) {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
final String strFile = packName.replaceAll("\\.", "/");
try {
Enumeration<URL> urls = loader.getResources(strFile);
while (urls.hasMoreElements()) {
URL url = urls.nextElement();
if (url != null) {
String protocol = url.getProtocol();
String filePath = url.getPath();
if (protocol.equals("file")) {
loadFileImpl(filePath);
} else if (protocol.equals("jar")) {
loadJarImpl(packName, url);
}
}
}
} catch (IOException e) {
return;
}
}
private static void loadFileImpl(String dirPath) {
File dir = new File(dirPath);
if (!dir.exists() || !dir.isDirectory()) {
return;
}
File[] dirFiles = dir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.isDirectory() || file.getName().endsWith(".xml");
}
});
for (File file : dirFiles) {
if (file.isDirectory()) {
loadFileImpl(dirPath + "/" + file.getName());
} else {
try {
loadXMLConfigure(file.getCanonicalPath());
} catch (IOException e) {
}
}
}
}
private static void loadJarImpl(String packName, URL url) throws IOException {
JarURLConnection jarURLConnection = (JarURLConnection) url.openConnection();
JarFile jarFile = jarURLConnection.getJarFile();
Enumeration<JarEntry> jarEntries = jarFile.entries();
while (jarEntries.hasMoreElements()) {
JarEntry jarEntry = jarEntries.nextElement();
String jarEntryName = jarEntry.getName();
if (jarEntryName.endsWith(".xml")) {
String packNameNew = packName.replace(".", "/");
if (jarEntryName.contains(packNameNew)) {
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(jarEntryName);
loadXMLConfigure(is);
}
}
}
}
/**
* xml
* @param xmlPath
*/
private static void loadXMLConfigure(String xmlPath) {
SAXParserFactory sf = SAXParserFactory.newInstance();
try {
SAXParser sp = sf.newSAXParser();
sp.parse(new InputSource(xmlPath), new XMLReader());
} catch (ParserConfigurationException | SAXException | IOException e) {
}
}
/**
* jarxml
* @param is
*/
private static void loadXMLConfigure(InputStream is) {
SAXParserFactory sf = SAXParserFactory.newInstance();
try {
SAXParser sp = sf.newSAXParser();
sp.parse(new InputSource(is), new XMLReader());
} catch (ParserConfigurationException | SAXException | IOException e) {
}
}
/**
*
* @param packName
*/
private static List<Class<?>> loadClass(String packName) {
List<Class<?>> clses = new ArrayList<>();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
String strFile = packName.replaceAll("\\.", "/");
try {
Enumeration<URL> urls = loader.getResources(strFile);
while (urls.hasMoreElements()) {
URL url = urls.nextElement();
if (url != null) {
String protocol = url.getProtocol();
String filePath = url.getPath();
if (protocol.equals("file")) {
loadClassImpl(packName, filePath, clses);
} else if (protocol.equals("jar")) {
loadJarImpl(packName, url, clses);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
return clses;
}
private static void loadClassImpl(String packName, String dirPath, List<Class<?>> clses) {
File dir = new File(dirPath);
if (!dir.exists() || !dir.isDirectory()) {
return;
}
File[] dirFiles = dir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.isDirectory() || file.getName().endsWith(".class");
}
});
for (File file : dirFiles) {
if (file.isDirectory()) {
loadClassImpl(packName + "." + file.getName(), dirPath + "/" + file.getName(), clses);
} else {
String clsName = file.getName();
clsName = clsName.substring(0, clsName.length() - 6);
try {
clses.add(Class.forName(packName + "." + clsName));
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
}
private static void loadJarImpl(String packName, URL url, List<Class<?>> clses) throws IOException {
JarURLConnection jarURLConnection = (JarURLConnection) url.openConnection();
JarFile jarFile = jarURLConnection.getJarFile();
Enumeration<JarEntry> jarEntries = jarFile.entries();
while (jarEntries.hasMoreElements()) {
JarEntry jarEntry = jarEntries.nextElement();
final String jarEntryName = jarEntry.getName();
if (jarEntryName.endsWith(".class")) {
String clsName = jarEntryName.replace("/", ".");
if (clsName.startsWith(packName)) {
clsName = clsName.substring(0, clsName.length() - 6);
try {
clses.add(Class.forName(clsName));
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
}
}
}

@ -0,0 +1,9 @@
package cn.estsh.i3plus.pojo.aps.common;
public enum RELATION_TYPE {
INVALID, // 无效关联
ONE_TO_ONE, // 1对1关系
ONE_TO_MULTI, // 1对多关系
MULTI_TO_ONE, // 多对1关系
MULTI_TO_MULTI,// 多对多关系
}

@ -0,0 +1,12 @@
package cn.estsh.i3plus.pojo.aps.common;
import lombok.Data;
@Data
public class RelationInfo {
private BeanInfo beanInfo;
private Enum<?> holder;
private Enum<?> reverseHolder;
private RELATION_TYPE type;
private boolean owner;
}

@ -0,0 +1,8 @@
package cn.estsh.i3plus.pojo.aps.enums;
public enum DATA_LINK_TYPE {
CSV,
MYSQL,
ORACLE,
SQLSERVER
}

@ -0,0 +1,6 @@
package cn.estsh.i3plus.pojo.aps.enums;
public enum IMPORT_DETAIL_TYPE {
REPLACE,
DIFF
}

@ -0,0 +1,5 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EExportDetail {
Project
}

@ -0,0 +1,6 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EExportProject {
Link,
Details
}

@ -0,0 +1,6 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EImportProject {
Link,
Details
}

@ -0,0 +1,10 @@
package cn.estsh.i3plus.pojo.aps.model;
import cn.estsh.i3plus.pojo.base.common.Pager;
import lombok.Data;
@Data
public class APSPager extends Pager {
private String filter;
private String sort;
}

@ -0,0 +1,9 @@
package cn.estsh.i3plus.pojo.aps.repository;
import cn.estsh.i3plus.pojo.aps.bean.DataLink;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface DataLinkRepository extends CrudRepository<DataLink, Long> {
}

@ -0,0 +1,9 @@
package cn.estsh.i3plus.pojo.aps.repository;
import cn.estsh.i3plus.pojo.aps.bean.ExportDetail;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ExportDetailRepository extends CrudRepository<ExportDetail, Long> {
}

@ -0,0 +1,9 @@
package cn.estsh.i3plus.pojo.aps.repository;
import cn.estsh.i3plus.pojo.aps.bean.ExportProject;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ExportProjectRepository extends CrudRepository<ExportProject, Long> {
}

@ -0,0 +1,9 @@
package cn.estsh.i3plus.pojo.aps.repository;
import cn.estsh.i3plus.pojo.aps.bean.ImportDetail;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ImportDetailRepository extends CrudRepository<ImportDetail, Long> {
}

@ -0,0 +1,9 @@
package cn.estsh.i3plus.pojo.aps.repository;
import cn.estsh.i3plus.pojo.aps.bean.ImportProject;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ImportProjectRepository extends CrudRepository<ImportProject, Long> {
}

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="ExportProject">
<Relation field="Link" name="DataLink" type="MULTI_TO_ONE">
</Relation>
<Relation field="Details" name="ExportDetail" type="ONE_TO_MULTI" owner="true">
</Relation>
</Class>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="ImportProject">
<Relation field="Link" name="DataLink" type="MULTI_TO_ONE">
</Relation>
<Relation field="Details" name="ImportDetail" type="ONE_TO_MULTI" owner="true">
</Relation>
</Class>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="Material">
<Relation field="ProductRouting" name="ProductRouting" reverse="Material" type="ONE_TO_MULTI" owner="true">
</Relation>
<Relation field="ProductRouting" name="ProductRouting" reverse="Material" type="ONE_TO_MULTI" owner="true">
</Relation>
</Class>

@ -237,7 +237,7 @@ public class BlockSoftSwitchEnumUtil {
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum VERIFICATION_METHOD{
LOGIN(1,"登录");
IMPP_LOGIN(1,"IMPP登录");
private int value;
private String description;
@ -264,6 +264,16 @@ public class BlockSoftSwitchEnumUtil {
}
return tmp;
}
public static VERIFICATION_METHOD valueOf(int val) {
VERIFICATION_METHOD tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i];
}
}
return tmp;
}
}
/**
@ -589,4 +599,40 @@ public class BlockSoftSwitchEnumUtil {
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum REQUEST_METHOD{
GET(1,"GET"),
POST(2,"POST"),
PUT(3,"PUT"),
DELETE(4,"DELETE");
private int value;
private String description;
REQUEST_METHOD(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;
}
}
}

@ -997,6 +997,16 @@ public class CommonEnumUtil {
}
return tmp;
}
public static HTTP_METHOD_TYPE valueOf(int val) {
HTTP_METHOD_TYPE tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i];
}
}
return tmp;
}
}
/**

@ -12,6 +12,82 @@ import com.fasterxml.jackson.annotation.JsonFormat;
public class MesEnumUtil {
/**
* mes
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum MES_BUTTON_STATUS_JUDGE_FLAG {
EQUAL("=", "等于"),
NOT_EQUAL("!=", "不等于"),
GREATER_THAN(">", "大于"),
NOT_LESS_THAN(">=", "大于大于"),
LESS_THAN("<", "小于"),
NOT_GREATER_THAN("<=", "小于等于");
private String value;
private String description;
MES_BUTTON_STATUS_JUDGE_FLAG(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.equals(val)) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
* mes
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum MES_BUTTON_STATUS_LOGIC_FLAG {
AND("&&", "逻辑与"),
OR("||", "逻辑或");
private String value;
private String description;
MES_BUTTON_STATUS_LOGIC_FLAG(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.equals(val)) {
tmp = values()[i].description;
}
}
return tmp;
}
}
/**
* MesWorkOrderapprovalStatus
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@ -554,7 +630,7 @@ public class MesEnumUtil {
}
/**
* MesPlanOrdersource
* MesWorkOrdersource
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum WORK_ORDER_SOURCE {

@ -14,7 +14,7 @@ import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description :mes
* @Description :mes
* @Reference :
* @Author : wangjie
* @CreateDate : 2019-09-19
@ -25,26 +25,36 @@ import javax.persistence.Table;
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="MES_STATUS")
@Api("系统业务动作")
public class MesStatus extends BaseBean {
@Column(name="STATUS_CODE")
@ApiParam("状态代码")
private String statusCode;
@Table(name="MES_BUTTON_STATUS")
@Api("按钮状态配置表")
public class MesButtonStatus extends BaseBean {
@Column(name="STATUS_NAME")
@ApiParam("状态名称")
private String statusName;
@Column(name="BUTTON_CODE")
@ApiParam("按钮代码")
private String buttonCode;
@Column(name="STATUS_VALUE")
@ApiParam("状态值")
private Integer statusValue;
@Column(name="CLASS_NAME")
@ApiParam("实体类名称")
private String ClassName;
@Column(name="STATUS_FIELD")
@ApiParam("状态字段")
private String statusField;
public int getStatusValueVal() {
return this.statusValue == null ? 0 : this.statusValue;
}
@Column(name="JUDGE_FLAG")
@ApiParam("判断符合")
private String judgeFlag;
@Column(name="STATUS_VALUE")
@ApiParam("状态值")
private String statusValue;
@Column(name="LOGIC_FLAG")
@ApiParam("逻辑符合")
private String logicFlag;
@Column(name="STATUS_DESC")
@ApiParam("描述")
private String statusDesc;
}

@ -187,6 +187,10 @@ public class MesWorkOrder extends BaseBean {
@ApiParam("mes生产工单页面按钮控制")
private MesWorkOrderButtonModel workOrderButtonModel;
@Transient
@ApiParam(value="下达按钮编号")
public String buttonCode;
public double getQtyVal() {
return this.qty == null ? 0.0d : this.qty;

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

@ -74,6 +74,7 @@ public class MesHqlPack {
if (StringUtils.isNotEmpty(mesPlanOrder.getStatus() + "") && mesPlanOrder.getStatusVal() != 0) {
DdlPreparedPack.getNumEqualPack(mesPlanOrder.getStatus(), "status", packBean);
}
if (StringUtils.isNotEmpty(mesPlanOrder.getCreateUser())) {
DdlPreparedPack.getStringLikerPack(mesPlanOrder.getCreateUser(), "createUser", packBean);
}
@ -1215,4 +1216,40 @@ public class MesHqlPack {
DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
return packBean;
}
/**
*
*
* @param organizeCode
* @return
*/
public static DdlPackBean getMesButtonStatus(MesButtonStatus buttonStatus, String organizeCode) {
DdlPackBean packBean = getAllBaseDataByNormalPro(buttonStatus, organizeCode);
if (StringUtils.isNotEmpty(buttonStatus.getButtonCode())) {
DdlPreparedPack.getStringLikerPack(buttonStatus.getButtonCode(), "buttonCode", packBean);
}
packBean.setOrderByStr(buttonStatus.orderBy());
return packBean;
}
/**
*
* @param mesWorkOrder
* @param organizeCode
* @return
*/
public static DdlPackBean getApprovalData(MesWorkOrder mesWorkOrder, String organizeCode) {
DdlPackBean packBean = MesHqlPack.getAllBaseData(organizeCode);
DdlPreparedPack.getStringEqualPack(mesWorkOrder.getWorkCenterCode(), "workCenterCode", packBean);
if (!org.springframework.util.StringUtils.isEmpty(mesWorkOrder.getOrderNo())) {
DdlPreparedPack.getStringEqualPack(mesWorkOrder.getOrderNo(), "orderNo", packBean);
}
if (!org.springframework.util.StringUtils.isEmpty(mesWorkOrder.getPartNo())) {
DdlPreparedPack.getStringEqualPack(mesWorkOrder.getPartNo(), "partNo", packBean);
}
DdlPreparedPack.getNumEqualPack(MesEnumUtil.WORK_ORDER_APPROVAL_STATUS.WAIT_APPROVAL.getValue(), "approvalStatus", packBean);
DdlPreparedPack.getNumEqualPack(MesEnumUtil.WORK_ORDER_STATUS.CREATE.getValue(), "workOrderStatus", packBean);
DdlPreparedPack.getOrderByPack(new String[]{String.valueOf(CommonEnumUtil.ASC_OR_DESC.ASC.getValue())}, new String[]{"startTime", "shiftCode"}, packBean);
return packBean;
}
}

@ -1,10 +1,7 @@
package cn.estsh.i3plus.pojo.model.softswitch;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.softswitch.bean.BsSocketSuitCase;
import cn.estsh.i3plus.pojo.softswitch.bean.BsSuitCase;
import cn.estsh.i3plus.pojo.softswitch.bean.BsSuitCaseDataSource;
import cn.estsh.i3plus.pojo.softswitch.bean.BsSuitCaseWebService;
import cn.estsh.i3plus.pojo.softswitch.bean.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -35,6 +32,9 @@ public class BsSuitCaseModel implements Serializable {
@ApiParam(value = "Web Service 适配套件")
private BsSuitCaseWebService webService;
@ApiParam(value = "REST 适配套件")
private BsSuitCaseREST bsSuitCaseREST;
@ApiParam(value = "分页数据")
private Pager pager;

@ -1,6 +1,9 @@
package cn.estsh.i3plus.pojo.model.softswitch;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.softswitch.bean.BsSuitRecord;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -19,10 +22,11 @@ import java.util.Map;
public class SuitServerModel {
// 执行方法命令
@ApiParam(value = "适配命令(枚举)")
private Integer actionId;
@ApiParam(value = "适配器code")
private String suitCaseCode;
/* 认证使用 以后使用 */
private String token;
// 传输单对象
private Object obj;
// 传输集合
@ -35,10 +39,52 @@ public class SuitServerModel {
/**
*
*/
@XStreamImplicit
private String suitMessage;
/**
*
*/
private String suitCaseStatusCode;
@XStreamImplicit
private String suitCaseStatusCode = ResourceEnumUtil.MESSAGE.SUCCESS.getCode();
/**
*
*/
@XStreamImplicit
private boolean suitSuccess = true;
/**
*
*/
@XStreamImplicit
private BsSuitRecord bsSuitRecord;
/**
*
*/
@XStreamImplicit
private BsSuitCaseModel bsSuitCaseModel;
/**
*
*/
@XStreamImplicit
private Integer requestSource;
/**
*
*/
@XStreamImplicit
private Integer suitMethodId;
public int getSuitMethodIdVal(){
if(suitMethodId == null){
return -1;
}
return suitMethodId.intValue();
}
@XStreamImplicit
private String analyzeMessage;
}

@ -3,7 +3,6 @@ package cn.estsh.i3plus.pojo.model.wms;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import javax.persistence.Column;
import java.io.Serializable;
/**
@ -27,7 +26,6 @@ public class WmsTaskInfoModel implements Serializable {
@ApiParam("作业类型名称")
public String opTypeName;
@Column(name = "TRANS_TYPE_CODE")
@ApiParam(value = "交易类型代码")
private String transTypeCode;
@ -37,30 +35,33 @@ public class WmsTaskInfoModel implements Serializable {
@ApiParam(value = "关联单据业务类型")
private String busiTypeDesc;
@Column(name = "ZDATE")
@ApiParam(value = "计划日期")
private String zdate;
@Column(name = "ZTIME")
@ApiParam(value = "计划时间")
private String ztime;
@Column(name = "CUST_NO")
@ApiParam(value = "客户编号")
private String custNo;
@Column(name = "VENDOR_NO")
@ApiParam(value = "供应商编号")
private String vendorNo;
@ApiParam(value = "样式")
private WmsMessageStyleModel wmsMessageStyleModel;
@ApiParam(value = "源存储区代码")
private String srcZoneNo;
@ApiParam(value = "创建日期")
public String createDatetime;
public WmsTaskInfoModel() {
}
public WmsTaskInfoModel(String orderNo, Integer taskStatus, String opTypeName, String transTypeCode, String refSrc,
String busiTypeDesc, String zdate, String ztime, String custNo, String vendorNo) {
String busiTypeDesc, String zdate, String ztime, String custNo, String vendorNo,
String createDatetime, String srcZoneNo) {
this.orderNo = orderNo;
this.taskStatus = taskStatus;
this.opTypeName = opTypeName;
@ -71,5 +72,7 @@ public class WmsTaskInfoModel implements Serializable {
this.ztime = ztime;
this.custNo = custNo;
this.vendorNo = vendorNo;
this.createDatetime = createDatetime;
this.srcZoneNo = srcZoneNo;
}
}

@ -44,6 +44,11 @@ public class BsSslKey extends BaseBean {
@ApiParam(value = "认证url")
private String verificationUrl;
//CommonEnumUtil.HTTP_METHOD_TYPE
@Column(name = "REQUEST_METHOD_ID")
@ApiParam(value = "请求方式id")
private Integer requestMethodId;
@Column(name = "KEY_TYPE_ID")
@ApiParam(value = "证书类型枚举")
private Integer keyTypeId;

@ -58,7 +58,7 @@ public class BsSuitCase extends BaseBean {
private Long suitTypeId;
public long getSuitTypeIdVal(){
if(suitTypeId != null){
if(suitTypeId == null){
return -1;
}
return suitTypeId.longValue();

@ -13,6 +13,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;
/**
* @Description :

@ -0,0 +1,48 @@
package cn.estsh.i3plus.pojo.softswitch.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
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.util.List;
/**
* @Description :
* @Reference :
* @Author : yunhao
* @CreateDate : 2019-09-18 16:53
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BS_SUIT_CASE_REST")
@Api(value = "适配器出入参", description = "适配器出入参")
public class BsSuitCaseREST extends BaseBean {
@Column(name = "SUIT_CASE_ID")
@ApiParam(value = "套件id")
@JsonSerialize(using = ToStringSerializer.class)
private Long suitCaseId;
//CommonEnumUtil.HTTP_METHOD_TYPE
@Column(name = "REQUEST_METHOD_ID")
@ApiParam(value = "请求方式id")
private Integer requestMethodId;
@Transient
@ApiParam(value = "请求头转换")
private List<BsSuitCaseParam> requestHeaderList;
}

@ -106,8 +106,7 @@ public class WmsDocMovementSn extends BaseBean {
@ApiParam("ERP库存地")
private String erpWhNo;
@Column(name="SN_STATUS")
@ApiParam(value = "状态", example = "10")
@Transient
@AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_STATUS.class,refForeignKey = "value",value = "description")
public Integer itemStatus;
}

Loading…
Cancel
Save