Merge branch 'dev' of http://git.estsh.com/i3-IMPP/i3plus-pojo into dev
commit
033b23321f
@ -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;
|
||||||
|
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -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,11 +1,15 @@
|
|||||||
package cn.estsh.i3plus.pojo.aps.bean;
|
package cn.estsh.i3plus.pojo.aps.common;
|
||||||
|
|
||||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.MappedSuperclass;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class BaseAPS extends BaseBean {
|
@Data
|
||||||
|
@MappedSuperclass
|
||||||
|
public abstract class BaseAPS extends BaseBean {
|
||||||
private transient Map<String, Object> customFields = new HashMap<>();
|
private transient Map<String, Object> customFields = new HashMap<>();
|
||||||
|
|
||||||
public Object getCustomField(String code) {
|
public Object getCustomField(String code) {
|
@ -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) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载jar中的xml配置文件。
|
||||||
|
* @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,13 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :日历类型
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum CALENDAR_TYPE {
|
||||||
|
ENABLE, // 启用
|
||||||
|
DISABLE // 停用
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :接续方式
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum CONSTRAINT_TYPE {
|
||||||
|
ES, // 前工作开始,后工作结束
|
||||||
|
SS, // 前工作开始,后工作开始
|
||||||
|
EE, // 前工作结束,后工作结束
|
||||||
|
SSEE // 前后工作同时开始或同时结束
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
public enum DATA_LINK_TYPE {
|
||||||
|
CSV,
|
||||||
|
MYSQL,
|
||||||
|
ORACLE,
|
||||||
|
SQLSERVER
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :排程方向
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum DIRECTION {
|
||||||
|
POSITIVE, // 正向
|
||||||
|
REVERSE // 逆向
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
public enum IMPORT_DETAIL_TYPE {
|
||||||
|
REPLACE,
|
||||||
|
DIFF
|
||||||
|
}
|
@ -1,7 +1,14 @@
|
|||||||
package cn.estsh.i3plus.pojo.aps.enums;
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :物料类型
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
public enum MATERIAL_TYPE {
|
public enum MATERIAL_TYPE {
|
||||||
PRODUCT,
|
PRODUCT, // 成品
|
||||||
HALF_PRODUCT,
|
HALF_PRODUCT, // 半成品
|
||||||
RAW_MATERIAL
|
RAW_MATERIAL // 原材料
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :订单删除限制
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum ORDER_DEL_LIMIT {
|
||||||
|
NONE,
|
||||||
|
NO_PO,
|
||||||
|
NO_PLAN,
|
||||||
|
NO_POR,
|
||||||
|
NO_PPRS
|
||||||
|
}
|
@ -1,7 +1,14 @@
|
|||||||
package cn.estsh.i3plus.pojo.aps.enums;
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :备料类型
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
public enum PREPARE_TYPE {
|
public enum PREPARE_TYPE {
|
||||||
NO,
|
NO,
|
||||||
SELF_MAKE,
|
SELF_MAKE, // 自制
|
||||||
PURCHASE
|
PURCHASE // 采购
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
package cn.estsh.i3plus.pojo.aps.enums;
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :补充类型
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
public enum REPLENISHMENT_TYPE {
|
public enum REPLENISHMENT_TYPE {
|
||||||
NO,
|
NO,
|
||||||
BATCH,
|
BATCH, // 批量补充
|
||||||
ONEBYONE
|
ONEBYONE // 一对一补充
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :资源区分
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum RESOURCE_CLASS {
|
||||||
|
MAIN, // 主资源
|
||||||
|
ASS // 副资源
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :资源类型
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum RESOURCE_TYPE {
|
||||||
|
LIMITLESS, // 无限能力
|
||||||
|
SINGLE, // 单能力
|
||||||
|
BATCH // 炉资源
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :锁定时间计算方式
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum RES_COMB_LOCK_TYPE {
|
||||||
|
KEEP_ORIGIN, // 各自锁定
|
||||||
|
MAIN_LOCK, // 主资源锁定
|
||||||
|
MAX_ALL_RESOURCE, // 最大锁定时间
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :生产时间计算方法
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum RES_COMB_TIME_TYPE {
|
||||||
|
MAIN_RESOURCE, // 主资源
|
||||||
|
MAX_ASS_RESOURCE, // 副资源最大值
|
||||||
|
MIN_ASS_RESOURCE, // 副资源最小值
|
||||||
|
AVG_ASS_RESOURCE, // 副资源平均值
|
||||||
|
MAX_ALL_RESOURCE, // 主副资源最大值
|
||||||
|
MIN_ALL_RESOURCE, // 主副资源最小值
|
||||||
|
AVG_ALL_RESOURCE // 主副资源平均值
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :尾数处理方式
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum TAIL_DEAL {
|
||||||
|
NODEAL, // 不处理
|
||||||
|
CEILING, // 向下
|
||||||
|
PUSHFRONT // 向上
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :时间圆整方式
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum TIME_ROUND_TYPE {
|
||||||
|
NONE, // 不圆整
|
||||||
|
UP, // 向上
|
||||||
|
DOWN, // 向下
|
||||||
|
ROUNDING // 四舍五入
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :使用类型
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum USE_TYPE {
|
||||||
|
MAIN, // 主资源
|
||||||
|
FIRST_ASS, // 第一套副资源
|
||||||
|
SECOND_ASS, // 第二套副资源
|
||||||
|
THIRD_ASS, // 第三套副资源
|
||||||
|
FOURTH_ASS, // 第四套副资源
|
||||||
|
FIFTH_ASS, // 第五套副资源
|
||||||
|
SIXTH_ASS // 第六套副资源
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :工作关联类型
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum WORK_RELATION_TYPE {
|
||||||
|
INNER, // 订单内关联
|
||||||
|
OUTER // 订单间关联
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :工作状态
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum WORK_STATUS {
|
||||||
|
NOPLAN, // 未计划
|
||||||
|
PLANDONE, // 计划完毕
|
||||||
|
INDICATIONDONE, // 指示完毕
|
||||||
|
CONFIRM, // 确认
|
||||||
|
STARTPRODUCT, // 开始生产
|
||||||
|
FINISH // 完成
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :工作类型
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-09-17
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public enum WORK_TYPE {
|
||||||
|
FICTITIOUS, // 虚拟工作
|
||||||
|
NORMAL // 普通工作
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EBaseOrder {
|
||||||
|
Works,
|
||||||
|
Material,
|
||||||
|
PrevRelations,
|
||||||
|
PostRelations,
|
||||||
|
UpperOrders,
|
||||||
|
LowerOrders
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EDayShift {
|
||||||
|
ResCalendar
|
||||||
|
}
|
@ -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,11 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EMaterial {
|
||||||
|
ProductRouting,
|
||||||
|
OperInputs,
|
||||||
|
OperOutputs,
|
||||||
|
WorkInputs,
|
||||||
|
WorkOutputs,
|
||||||
|
WorkRelations,
|
||||||
|
Orders
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EOperInput {
|
||||||
|
Operation,
|
||||||
|
Material,
|
||||||
|
WorkInputs
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EOperOutput {
|
||||||
|
Operation,
|
||||||
|
Material,
|
||||||
|
WorkOutputs
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EOperResource {
|
||||||
|
Operation,
|
||||||
|
Resource,
|
||||||
|
WorkResources
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EOperation {
|
||||||
|
ProductRouting,
|
||||||
|
OperInputs,
|
||||||
|
OperOutputs,
|
||||||
|
OperResources,
|
||||||
|
StandOperation,
|
||||||
|
Works
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EPlanFeedback {
|
||||||
|
Work
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EProductOrder {
|
||||||
|
ProductRouting
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EProductRouting {
|
||||||
|
Material,
|
||||||
|
Operations,
|
||||||
|
ProductOrders
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EResCalendar {
|
||||||
|
DayShifts,
|
||||||
|
Resources,
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EResource {
|
||||||
|
OperResources,
|
||||||
|
WorkResources
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EStandOperation {
|
||||||
|
Operations
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EWork {
|
||||||
|
Order,
|
||||||
|
WorkResources,
|
||||||
|
WorkInputs,
|
||||||
|
WorkOutputs,
|
||||||
|
WorkRelationInputs,
|
||||||
|
WorkRelationOutputs,
|
||||||
|
Operation,
|
||||||
|
PlanFeedback
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EWorkInput {
|
||||||
|
Work,
|
||||||
|
WorkRelations,
|
||||||
|
Material,
|
||||||
|
OperInput
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EWorkOutput {
|
||||||
|
Work,
|
||||||
|
WorkRelations,
|
||||||
|
Material,
|
||||||
|
OperOutput
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EWorkRelation {
|
||||||
|
WorkInput,
|
||||||
|
WorkOutput,
|
||||||
|
PrevWork,
|
||||||
|
PostWork,
|
||||||
|
PrevOrder,
|
||||||
|
PostOrder,
|
||||||
|
Material
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EWorkResource {
|
||||||
|
Work,
|
||||||
|
Resource,
|
||||||
|
OperResource
|
||||||
|
}
|
@ -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.CancelPlanRule;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface CancelPlanRuleRepository extends CrudRepository<CancelPlanRule, Long> {
|
||||||
|
}
|
@ -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.DayShift;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface DayShiftRepository extends CrudRepository<DayShift, 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.FieldSetRule;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface FieldSetRuleRepository extends CrudRepository<FieldSetRule, Long> {
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.aps.bean.HeuristicRule;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface HeuristicRuleRepository extends CrudRepository<HeuristicRule, 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,9 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.aps.bean.Inventory;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface InventoryRepository extends CrudRepository<Inventory, Long> {
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.aps.bean.MatCalcRule;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface MatCalcRuleRepository extends CrudRepository<MatCalcRule, Long> {
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.aps.bean.Material;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface MaterialRepository extends CrudRepository<Material, Long> {
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.aps.bean.OperInput;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface OperInputRepository extends CrudRepository<OperInput, Long> {
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.aps.bean.OperOutput;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface OperOutputRepository extends CrudRepository<OperOutput, Long> {
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue