add integration to aps

yun-zuoyi
钮海涛 6 years ago
parent 80bad03881
commit be30cecf13

@ -8,7 +8,9 @@ import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface FieldAnnotation {
boolean property() default true;
boolean modify() default true;
boolean display() default true;
int pric() default 2;
boolean mainkey() default false;
}

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EBaseOrder;
@ -53,7 +54,37 @@ public class BaseOrder extends BaseAPS {
@ApiParam(value ="接单日期")
private Date receiveDate;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(property = false)
private Long materialId;
public List<Work> getWorks() {
return BeanRelation.list(this, EBaseOrder.Works);
}
public Material getMaterial() {
return BeanRelation.get(this, EBaseOrder.Material);
}
public void setMaterial(Material material) {
this.materialId = material != null ? material.getId() : 0l;
BeanRelation.set(this, EBaseOrder.Material, material);
}
public List<WorkRelation> getPrevRelations() {
return BeanRelation.list(this, EBaseOrder.PrevRelations);
}
public List<WorkRelation> getPostRelations() {
return BeanRelation.list(this, EBaseOrder.PostRelations);
}
public List<BaseOrder> getUpperOrders() {
return BeanRelation.list(this, EBaseOrder.UpperOrders);
}
public List<BaseOrder> getLowerOrders() {
return BeanRelation.list(this, EBaseOrder.LowerOrders);
}
}

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EExportDetail;
@ -41,6 +42,7 @@ public class ExportDetail extends BaseAPS {
@Column(name="PROJECT_ID")
@ApiParam(value ="导出项目ID")
@FieldAnnotation(property = false)
private Long projectId;
public ExportProject getProject() {

@ -1,8 +1,10 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EExportProject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -29,7 +31,9 @@ public class ExportProject extends BaseAPS {
private String name;
@Column(name="LINK_ID")
@ApiParam(value ="数据源连接")
@ApiParam(value ="数据连接对象")
@FieldAnnotation(property = false)
@JsonIgnore
private Long linkId;
public DataLink getLink() {

@ -71,6 +71,10 @@ public class FieldInfo extends BaseCode {
@ApiParam(value ="位置")
private String position;
@Column(name="MAIN_KEY")
@ApiParam(value ="主键标识")
private Boolean mainKey;
@JsonIgnore
private transient Class<? extends BaseBean> clazz;
@JsonIgnore

@ -1,7 +1,11 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.enums.IMPORT_DETAIL_TYPE;
import cn.estsh.i3plus.pojo.aps.holders.EExportDetail;
import cn.estsh.i3plus.pojo.aps.holders.EImportDetail;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -33,4 +37,18 @@ public class ImportDetail extends BaseAPS {
@Column(name="IN_NAME")
@ApiParam(value ="内部表名")
private String inName;
@Column(name="PROJECT_ID")
@ApiParam(value ="导入项目ID")
@FieldAnnotation(property = false)
private Long projectId;
public ImportProject getProject() {
return BeanRelation.get(this, EImportDetail.Project);
}
public void setProject(ImportProject project) {
this.projectId = project != null ? project.getId() : 0l;
BeanRelation.set(this, EImportDetail.Project, project);
}
}

@ -1,6 +1,9 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EImportProject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -8,6 +11,7 @@ import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* @Description :
@ -24,4 +28,22 @@ public class ImportProject extends BaseAPS {
@Column(name="NAME")
@ApiParam(value ="标识名")
private String name;
@Column(name="LINK_ID")
@ApiParam(value ="数据连接对象")
@FieldAnnotation(property = false)
private Long linkId;
public DataLink getLink() {
return BeanRelation.get(this, EImportProject.Link);
}
public void setLink(DataLink link) {
this.linkId = link != null ? link.getId() : 0l;
BeanRelation.set(this, EImportProject.Link, link);
}
public List<ImportDetail> getDetails() {
return BeanRelation.list(this, EImportProject.Details);
}
}

@ -1,9 +1,11 @@
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.MATERIAL_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.PREPARE_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.REPLENISHMENT_TYPE;
import cn.estsh.i3plus.pojo.aps.holders.EMaterial;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -11,6 +13,7 @@ import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* @Description :
@ -103,4 +106,32 @@ public class Material extends BaseCode {
@Column(name="MAX_STOCK_COUNT")
@ApiParam(value ="最大库存数量")
private Double maxStockCount;
public List<ProductRouting> getProductRoutings() {
return BeanRelation.list(this, EMaterial.ProductRoutings);
}
public List<OperInput> getOperInputs() {
return BeanRelation.list(this, EMaterial.OperInputs);
}
public List<OperOutput> getOperOutputs() {
return BeanRelation.list(this, EMaterial.OperOutputs);
}
public List<WorkInput> getWorkInputs() {
return BeanRelation.list(this, EMaterial.WorkInputs);
}
public List<WorkOutput> getWorkOutputs() {
return BeanRelation.list(this, EMaterial.WorkOutputs);
}
public List<WorkRelation> getWorkRelations() {
return BeanRelation.list(this, EMaterial.WorkRelations);
}
public List<BaseOrder> getOrders() {
return BeanRelation.list(this, EMaterial.Orders);
}
}

@ -1,7 +1,10 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.enums.CONSTRAINT_TYPE;
import cn.estsh.i3plus.pojo.aps.holders.EOperInput;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -9,6 +12,7 @@ import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* @Description :
@ -45,4 +49,36 @@ public class OperInput extends BaseAPS {
@Column(name="MIN_SPACE_TIME")
@ApiParam(value ="最小时间间隔")
private String minSpaceTime;
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(property = false)
private Long operationId;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(property = false)
private Long materialId;
public Operation getOperation() {
return BeanRelation.get(this, EOperInput.Operation);
}
public void setOperation(Operation oper) {
this.operationId = oper != null ? oper.getId() : 0l;
BeanRelation.set(this, EOperInput.Operation, oper);
}
public Material getMaterial() {
return BeanRelation.get(this, EOperInput.Material);
}
public void setMaterial(Material material) {
this.materialId = material != null ? material.getId() : 0l;
BeanRelation.set(this, EOperInput.Material, material);
}
public List<WorkInput> getWorkInputs() {
return BeanRelation.list(this, EOperInput.WorkInputs);
}
}

@ -1,6 +1,9 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EOperOutput;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -8,6 +11,7 @@ import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* @Description :
@ -21,15 +25,47 @@ import javax.persistence.Table;
@Table(name = "APS_OPER_OUTPUT")
@Api("工序输出")
public class OperOutput extends BaseAPS {
@Column(name="output_Count")
@Column(name="OUTPUT_COUNT")
@ApiParam(value ="输出数量")
private Double outputCount;
@Column(name="yield")
@Column(name="YIELD")
@ApiParam(value ="成品率")
private Double yield;
@Column(name="fix_Scrap_Count")
@Column(name="FIX_SCRAP_COUNT")
@ApiParam(value ="固定报废数")
private Double fixScrapCount;
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(property = false)
private Long operationId;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(property = false)
private Long materialId;
public Operation getOperation() {
return BeanRelation.get(this, EOperOutput.Operation);
}
public void setOperation(Operation oper) {
this.operationId = oper != null ? oper.getId() : 0l;
BeanRelation.set(this, EOperOutput.Operation, oper);
}
public Material getMaterial() {
return BeanRelation.get(this, EOperOutput.Material);
}
public void setMaterial(Material material) {
this.materialId = material != null ? material.getId() : 0l;
BeanRelation.set(this, EOperOutput.Material, material);
}
public List<WorkOutput> getWorkOutputs() {
return BeanRelation.list(this, EOperOutput.WorkOutputs);
}
}

@ -1,7 +1,10 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.enums.USE_TYPE;
import cn.estsh.i3plus.pojo.aps.holders.EOperResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -9,6 +12,7 @@ import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* @Description :
@ -53,4 +57,36 @@ public class OperResource extends BaseAPS {
@Column(name="PRIORITY")
@ApiParam(value ="优先级")
private Integer priority;
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(property = false)
private Long operationId;
@Column(name="RESOURCE_ID")
@ApiParam(value ="资源")
@FieldAnnotation(property = false)
private Long resourceId;
public Operation getOperation() {
return BeanRelation.get(this, EOperResource.Operation);
}
public void setOperation(Operation oper) {
this.operationId = oper != null ? oper.getId() : 0l;
BeanRelation.set(this, EOperResource.Operation, oper);
}
public Resource getResource() {
return BeanRelation.get(this, EOperResource.Resource);
}
public void setResource(Resource res) {
this.resourceId = res != null ? res.getId() : 0l;
BeanRelation.set(this, EOperResource.Resource, res);
}
public List<WorkResource> getWorkResources() {
return BeanRelation.list(this, EOperResource.WorkResources);
}
}

@ -1,15 +1,20 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.enums.CONSTRAINT_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.TAIL_DEAL;
import cn.estsh.i3plus.pojo.aps.holders.EOperation;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* @Description :
@ -71,4 +76,48 @@ public class Operation extends BaseAPS {
@Column(name="MIN_SPACE_TIME")
@ApiParam(value ="最小时间间隔")
private String minSpaceTime;
@Column(name="PRODUCT_ROUTING_ID")
@ApiParam(value ="工艺路线")
@FieldAnnotation(property = false)
private Long productRoutingId;
@Column(name="STAND_OPERATION_ID")
@ApiParam(value ="标准工序")
@FieldAnnotation(property = false)
private Long standOperationId;
public ProductRouting getProductRouting() {
return BeanRelation.get(this, EOperation.ProductRouting);
}
public void setProductRouting(ProductRouting routing) {
this.productRoutingId = routing != null ? routing.getId() : 0l;
BeanRelation.set(this, EOperation.ProductRouting, routing);
}
public List<OperInput> getOperInputs() {
return BeanRelation.list(this, EOperation.OperInputs);
}
public List<OperOutput> getOperOutputs() {
return BeanRelation.list(this, EOperation.OperOutputs);
}
public List<Resource> getOperResources() {
return BeanRelation.list(this, EOperation.OperResources);
}
public StandOperation getStandOperation() {
return BeanRelation.get(this, EOperation.StandOperation);
}
public void setStandOperation(StandOperation std) {
this.standOperationId = std != null ? std.getId() : 0l;
BeanRelation.set(this, EOperation.StandOperation, std);
}
public List<Work> getWorks() {
return BeanRelation.list(this, EOperation.Works);
}
}

@ -1,9 +1,14 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EPlanFeedback;
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;
@ -19,4 +24,18 @@ import javax.persistence.Table;
@Table(name = "APS_PLAN_FEEDBACK")
@Api("物料")
public class PlanFeedback extends BaseAPS {
@Column(name="WORK_ID")
@ApiParam(value ="工作")
@FieldAnnotation(property = false)
private Long workId;
public Work getWork() {
return BeanRelation.get(this, EPlanFeedback.Work);
}
public void setWork(Work work) {
this.workId = work != null ? work.getId() : 0l;
BeanRelation.set(this, EPlanFeedback.Work, work);
}
}

@ -1,5 +1,9 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EProductOrder;
import cn.estsh.i3plus.pojo.aps.holders.EProductRouting;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -80,4 +84,18 @@ public class ProductOrder extends BaseOrder {
@Column(name="LACK_COUNT")
@ApiParam(value ="缺少量")
private Double lackCount;
@Column(name="PRODUCT_ROUTING_ID")
@ApiParam(value ="工艺路线")
@FieldAnnotation(property = false)
private Long productRoutingId;
public ProductRouting getProductRouting() {
return BeanRelation.get(this, EProductOrder.ProductRouting);
}
public void setProductRouting(ProductRouting routing) {
this.productRoutingId = routing != null ? routing.getId() : 0l;
BeanRelation.set(this, EProductOrder.ProductRouting, routing);
}
}

@ -1,6 +1,9 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EProductRouting;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -9,6 +12,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
import java.util.List;
/**
* @Description :线
@ -33,4 +37,26 @@ public class ProductRouting extends BaseCode {
@Column(name="PRIORITY")
@ApiParam(value ="优先级")
private Integer priority;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(property = false)
private Long materialId;
public Material getMaterial() {
return BeanRelation.get(this, EProductRouting.Material);
}
public void setMaterial(Material material) {
this.materialId = material != null ? material.getId() : 0l;
BeanRelation.set(this, EProductRouting.Material, material);
}
public List<Operation> getOperations() {
return BeanRelation.list(this, EProductRouting.Operations);
}
public List<ProductOrder> getProductOrders() {
return BeanRelation.list(this, EProductRouting.ProductOrders);
}
}

@ -26,7 +26,7 @@ public class SysParam extends BaseAPS {
@ApiParam(value ="基准时间")
private Date baseTime;
@Column(name="max_Interrupt_Count")
@Column(name="MAX_INTERRUPT_COUNT")
@ApiParam(value ="最大中断次数")
private Integer maxInterruptCount;
}

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
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;
@ -13,6 +14,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
import java.util.List;
/**
* @Description :
@ -96,8 +98,14 @@ public class Work extends BaseCode {
@Column(name="ORDER_ID")
@ApiParam(value ="订单")
@FieldAnnotation(property = false)
private Long orderId;
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(property = false)
private Long operationId;
public BaseOrder getOrder() {
return BeanRelation.get(this, EWork.Order);
}
@ -106,4 +114,37 @@ public class Work extends BaseCode {
this.orderId = order != null ? order.getId() : 0l;
BeanRelation.set(this, EWork.Order, order);
}
public List<WorkResource> getWorkResources() {
return BeanRelation.list(this, EWork.WorkResources);
}
public List<WorkInput> getWorkInputs() {
return BeanRelation.list(this, EWork.WorkInputs);
}
public List<WorkOutput> getWorkOutputs() {
return BeanRelation.list(this, EWork.WorkOutputs);
}
public List<WorkRelation> getWorkRelationInputs() {
return BeanRelation.list(this, EWork.WorkRelationInputs);
}
public List<WorkRelation> getWorkRelationOutputs() {
return BeanRelation.list(this, EWork.WorkRelationOutputs);
}
public Operation getOperation() {
return BeanRelation.get(this, EWork.Operation);
}
public void setOperation(Operation oper) {
this.operationId = oper != null ? oper.getId() : 0l;
BeanRelation.set(this, EWork.Operation, oper);
}
public List<PlanFeedback> getPlanFeedbacks() {
return BeanRelation.list(this, EWork.PlanFeedbacks);
}
}

@ -1,6 +1,9 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EWorkInput;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -9,6 +12,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
import java.util.List;
/**
* @Description :
@ -33,4 +37,50 @@ public class WorkInput extends BaseAPS {
@Column(name="SHORT_COUNT")
@ApiParam(value ="短缺数量")
private Double shortCount;
@Column(name="WORK_ID")
@ApiParam(value ="工作")
@FieldAnnotation(property = false)
private Long workId;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(property = false)
private Long materialId;
@Column(name="OPER_INPUT_ID")
@ApiParam(value ="工序输入")
@FieldAnnotation(property = false)
private Long operInputId;
public Work getWork() {
return BeanRelation.get(this, EWorkInput.Work);
}
public void setWork(Work work) {
this.workId = work != null ? work.getId() : 0l;
BeanRelation.set(this, EWorkInput.Work, work);
}
public List<WorkRelation> getWorkRelations() {
return BeanRelation.list(this, EWorkInput.WorkRelations);
}
public Material getMaterial() {
return BeanRelation.get(this, EWorkInput.Material);
}
public void setMaterial(Material material) {
this.materialId = material != null ? material.getId() : 0l;
BeanRelation.set(this, EWorkInput.Material, material);
}
public OperInput getOperInput() {
return BeanRelation.get(this, EWorkInput.OperInput);
}
public void setOperInput(OperInput input) {
this.operInputId = input != null ? input.getId() : 0l;
BeanRelation.set(this, EWorkInput.OperInput, input);
}
}

@ -1,14 +1,19 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EWorkOutput;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
import java.util.List;
/**
* @Description :
@ -33,4 +38,50 @@ public class WorkOutput extends BaseAPS {
@Column(name="REMAIN_COUNT")
@ApiParam(value ="多余数量")
private Double remainCount;
@Column(name="WORK_ID")
@ApiParam(value ="工作")
@FieldAnnotation(property = false)
private Long workId;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(property = false)
private Long materialId;
@Column(name="OPER_OUTPUT_ID")
@ApiParam(value ="工序输出")
@FieldAnnotation(property = false)
private Long operOutputId;
public Work getWork() {
return BeanRelation.get(this, EWorkOutput.Work);
}
public void setWork(Work work) {
this.workId = work != null ? work.getId() : 0l;
BeanRelation.set(this, EWorkOutput.Work, work);
}
public List<WorkRelation> getWorkRelations() {
return BeanRelation.list(this, EWorkOutput.WorkRelations);
}
public Material getMaterial() {
return BeanRelation.get(this, EWorkOutput.Material);
}
public void setMaterial(Material material) {
this.materialId = material != null ? material.getId() : 0l;
BeanRelation.set(this, EWorkOutput.Material, material);
}
public OperOutput getOperOutput() {
return BeanRelation.get(this, EWorkOutput.OperOutput);
}
public void setOperOutput(OperOutput output) {
this.operOutputId = output != null ? output.getId() : 0l;
BeanRelation.set(this, EWorkOutput.OperOutput, output);
}
}

@ -1,8 +1,12 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.enums.CONSTRAINT_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.WORK_RELATION_TYPE;
import cn.estsh.i3plus.pojo.aps.holders.EWork;
import cn.estsh.i3plus.pojo.aps.holders.EWorkRelation;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -50,4 +54,102 @@ public class WorkRelation extends BaseAPS {
@Column(name="FIX_COUNT")
@ApiParam(value ="是否固定数量")
private Boolean fixCount;
@Column(name="WORK_INPUT_ID")
@ApiParam(value ="工作输入")
@FieldAnnotation(property = false)
private Long workInputId;
@Column(name="WORK_OUTPUT_ID")
@ApiParam(value ="工作输出")
@FieldAnnotation(property = false)
private Long workOutputId;
@Column(name="PREV_WORK_ID")
@ApiParam(value ="前工作")
@FieldAnnotation(property = false)
private Long prevWorkId;
@Column(name="POST_WORK_ID")
@ApiParam(value ="后工作")
@FieldAnnotation(property = false)
private Long postWorkId;
@Column(name="PREV_ORDER_ID")
@ApiParam(value ="前订单")
@FieldAnnotation(property = false)
private Long prevOrderId;
@Column(name="POST_ORDER_ID")
@ApiParam(value ="后订单")
@FieldAnnotation(property = false)
private Long postOrderId;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(property = false)
private Long materialId;
public WorkInput getWorkInput() {
return BeanRelation.get(this, EWorkRelation.WorkInput);
}
public void setWorkInput(WorkInput input) {
this.workInputId = input != null ? input.getId() : 0l;
BeanRelation.set(this, EWorkRelation.WorkInput, input);
}
public WorkOutput getWorkOutput() {
return BeanRelation.get(this, EWorkRelation.WorkOutput);
}
public void setWorkOutput(WorkOutput output) {
this.workOutputId = output != null ? output.getId() : 0l;
BeanRelation.set(this, EWorkRelation.WorkOutput, output);
}
public Work getPrevWork() {
return BeanRelation.get(this, EWorkRelation.PrevWork);
}
public void setPrevWork(Work work) {
this.prevWorkId = work != null ? work.getId() : 0l;
BeanRelation.set(this, EWorkRelation.PrevWork, work);
}
public Work getPostWork() {
return BeanRelation.get(this, EWorkRelation.PostWork);
}
public void setPostWork(Work work) {
this.postWorkId = work != null ? work.getId() : 0l;
BeanRelation.set(this, EWorkRelation.PostWork, work);
}
public BaseOrder getPrevOrder() {
return BeanRelation.get(this, EWorkRelation.PrevOrder);
}
public void setPrevOrder(BaseOrder order) {
this.prevOrderId = order != null ? order.getId() : 0l;
BeanRelation.set(this, EWorkRelation.PrevOrder, order);
}
public BaseOrder getPostOrder() {
return BeanRelation.get(this, EWorkRelation.PostOrder);
}
public void setPostOrder(BaseOrder order) {
this.postOrderId = order != null ? order.getId() : 0l;
BeanRelation.set(this, EWorkRelation.PostOrder, order);
}
public Material getMaterial() {
return BeanRelation.get(this, EWorkRelation.Material);
}
public void setMaterial(Material material) {
this.materialId = material != null ? material.getId() : 0l;
BeanRelation.set(this, EWorkRelation.Material, material);
}
}

@ -1,7 +1,11 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.enums.USE_TYPE;
import cn.estsh.i3plus.pojo.aps.holders.EWorkRelation;
import cn.estsh.i3plus.pojo.aps.holders.EWorkResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -53,4 +57,46 @@ public class WorkResource extends BaseAPS {
@Column(name="MAX_POST_SD_TIME")
@ApiParam(value ="最大后设置中断时间")
private String maxPostSdTime;
@Column(name="WORK_ID")
@ApiParam(value ="工作")
@FieldAnnotation(property = false)
private Long workId;
@Column(name="RESOURCE_ID")
@ApiParam(value ="资源")
@FieldAnnotation(property = false)
private Long resourceId;
@Column(name="OPER_RESOURCE_ID")
@ApiParam(value ="工序资源")
@FieldAnnotation(property = false)
private Long operResourceId;
public Work getWork() {
return BeanRelation.get(this, EWorkResource.Work);
}
public void setWork(Work work) {
this.workId = work != null ? work.getId() : 0l;
BeanRelation.set(this, EWorkResource.Work, work);
}
public Resource getResource() {
return BeanRelation.get(this, EWorkResource.Resource);
}
public void setResource(Resource res) {
this.resourceId = res != null ? res.getId() : 0l;
BeanRelation.set(this, EWorkResource.Resource, res);
}
public OperResource getOperResource() {
return BeanRelation.get(this, EWorkResource.OperResource);
}
public void setOperResource(OperResource res) {
this.operResourceId = res != null ? res.getId() : 0l;
BeanRelation.set(this, EWorkResource.OperResource, res);
}
}

@ -1,6 +1,5 @@
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;

@ -12,6 +12,12 @@ import java.util.function.Predicate;
public class BeanRelation {
Map<Class<? extends BaseBean>, Map<Long, Map<Enum<?>, List<BaseBean>>>> caches = new HashMap<>();
private void init() {
for (Class<? extends BaseBean> cls : BeanInfo.getBeanClasses()) {
caches.put(cls, new ConcurrentHashMap<>());
}
}
private static Map<Long, BeanRelation> relations = new ConcurrentHashMap<>();
private static BeanRelation get() {
Long userId = 0l;
@ -21,6 +27,7 @@ public class BeanRelation {
relation = relations.get(userId);
if (relation == null) {
relation = new BeanRelation();
relation.init();
relations.put(userId, relation);
}
}
@ -30,7 +37,15 @@ public class BeanRelation {
}
private static Map<Enum<?>, List<BaseBean>> createRelation(Class<? extends BaseBean> cls) {
return null;
Map<Enum<?>, List<BaseBean>> result = new HashMap<>();
BeanInfo beanInfo = BeanInfo.getBeanInfo(cls);
if (beanInfo == null) {
return result;
}
for (Enum<?> holder : beanInfo.getAllHolders()) {
result.put(holder, new ArrayList<>());
}
return result;
}
public static Map<Enum<?>, List<BaseBean>> get(BaseBean bean) {
@ -46,10 +61,6 @@ public class BeanRelation {
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()) {
@ -72,7 +83,13 @@ public class BeanRelation {
return (T)bean;
}
} else {
//List<BaseAPS> relaBeans =
List<BaseBean> relaBeans = list(bean, args[index]);
for (BaseBean relaBean : relaBeans) {
T temp = getImpl(relaBean, pred, args, index + 1);
if (temp != null) {
return temp;
}
}
}
return null;

@ -1,4 +1,4 @@
package cn.estsh.i3plus.pojo.aps.bean;
package cn.estsh.i3plus.pojo.aps.common;
import java.util.AbstractMap;
import java.util.ArrayList;
@ -80,7 +80,8 @@ public class DateDuration {
return this.time * 1000;
}
public String getString() {
@Override
public String toString() {
if (this.rate > PRECISION)
return this.getValue();
@ -130,7 +131,7 @@ public class DateDuration {
if (this.time >= 0)
this.time /= val;
this.rate /= val;
this.value = getString();
this.value = toString();
}
/**

@ -1,5 +1,4 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EDayShift {
ResCalendar
}

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

@ -1,7 +1,7 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EMaterial {
ProductRouting,
ProductRoutings,
OperInputs,
OperOutputs,
WorkInputs,

@ -1,6 +1,4 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EResCalendar {
DayShifts,
Resources,
}

@ -1,6 +1,4 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EResource {
OperResources,
WorkResources
}

@ -1,5 +1,4 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EStandOperation {
Operations
}

@ -8,5 +8,5 @@ public enum EWork {
WorkRelationInputs,
WorkRelationOutputs,
Operation,
PlanFeedback
PlanFeedbacks
}

@ -2,6 +2,6 @@
<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 field="Details" name="ExportDetail" reverse="Project" type="ONE_TO_MULTI" owner="true">
</Relation>
</Class>

@ -2,6 +2,6 @@
<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 field="Details" name="ImportDetail" reverset="Project" 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 field="ProductRoutings" name="ProductRouting" reverse="Material" type="ONE_TO_MULTI" owner="true">
</Relation>
</Class>

@ -1,7 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="ResCalendar">
<Relation field="DayShifts" name="DayShift" reverse="ResCalendar" type="MULTI_TO_MULTI" owner="false">
</Relation>
<Relation field="Resources" name="Resource" type="MULTI_TO_MULTI" owner="false">
</Relation>
</Class>
Loading…
Cancel
Save