修复规则组合关联问题

yun-zuoyi
钮海涛 6 years ago
parent ce63c161be
commit bed955575d

@ -28,4 +28,5 @@ public @interface FieldAnnotation {
Class<?> multiEnumClass() default Object.class; // 多选枚举的类型。
String typeName() default ""; // 定义字段类型的简单名称,对于多选关联对象时有用。
String relation() default ""; // 关联字段标识
boolean notEmpty() 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.base.enumutil.ApsEnumUtil;
import io.swagger.annotations.Api;
@ -26,25 +27,31 @@ import javax.persistence.Table;
public class AssistResourceSetTime extends BaseAPS {
@Column(name="RES_CODE")
@ApiParam(value ="资源编码")
@FieldAnnotation(editType = ApsEnumUtil.EDIT_TYPE.MULTI_OBJECT, typeName = "Resource", notEmpty = true)
private String resCode;
@Column(name="TYPE")
@ApiParam(value ="副资源使用类型")
@FieldAnnotation(defaultValue = "FIRST_ASS")
private ApsEnumUtil.USE_TYPE type;
@Column(name="PREV_RESOURCE")
@ApiParam(value ="前资源编码")
@ApiParam(value ="前资源")
@FieldAnnotation(notEmpty = true)
private String prevResource;
@Column(name="POST_RESOURCE")
@ApiParam(value ="后资源编码")
@ApiParam(value ="后资源")
@FieldAnnotation(notEmpty = true)
private String postResource;
@Column(name="TIME")
@ApiParam(value ="设置时间")
@FieldAnnotation(notEmpty = true)
private String time;
@Column(name="PRIORITY")
@ApiParam(value ="优先级")
@FieldAnnotation(defaultValue = "10")
private int priority;
}

@ -31,11 +31,12 @@ public class BaseOrder extends BaseCode {
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(relation = "Material")
@FieldAnnotation(relation = "Material", notEmpty = true)
private Long materialId;
@Column(name="COUNT")
@ApiParam(value ="数量")
@FieldAnnotation(notEmpty = true)
private Double count;
@Column(name="PRIORITY")
@ -45,6 +46,7 @@ public class BaseOrder extends BaseCode {
@Column(name="LET")
@ApiParam(value ="最晚结束时刻")
@FieldAnnotation(notEmpty = true)
private Date let;
@Column(name="CALC_EST")

@ -1,6 +1,8 @@
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.BaseCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -22,12 +24,9 @@ import javax.persistence.Table;
@Entity
@Table(name = "APS_DAY_SHIFT")
@Api("班次")
public class DayShift extends BaseAPS {
@Column(name="CODE")
@ApiParam(value ="编码")
private String code;
public class DayShift extends BaseCode {
@Column(name="WORK_TIMES")
@ApiParam(value ="工作时间")
@FieldAnnotation(notEmpty = true)
private String workTimes;
}

@ -27,6 +27,7 @@ import javax.persistence.Table;
public class DynamicSetTime extends BaseAPS {
@Column(name="RES_CODE")
@ApiParam(value ="资源代码")
@FieldAnnotation(editType = ApsEnumUtil.EDIT_TYPE.MULTI_OBJECT, typeName = "Resource", notEmpty = true)
private String resCode;
@Column(name="TYPE")

@ -26,13 +26,6 @@ import javax.persistence.Table;
@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 ="外部表名")
@ -42,9 +35,22 @@ public class ExportDetail extends BaseAPS {
@ApiParam(value ="内部表名")
private String inName;
@Column(name="FILTER")
@ApiParam(value ="筛选")
private String filter;
@Column(name="SORT_BY")
@ApiParam(value ="排序")
private String sortBy;
@Column(name="ORDER_NUMBER")
@ApiParam(value ="序号")
@FieldAnnotation(display = false)
private Integer orderNumber;
@Column(name="PROJECT_ID")
@ApiParam(value ="导出项目ID")
@FieldAnnotation(property = false)
@FieldAnnotation(relation = "Project")
private Long projectId;
public ExportProject getProject() {

@ -104,6 +104,10 @@ public class FieldInfo extends BaseCode {
@ApiParam(value ="枚举项内容")
private transient Enum<?>[] enumItems;
@Column(name = "NOT_EMPTY")
@ApiParam(value = "不能为空")
private Boolean notEmpty;
@JsonIgnore
private transient Class<? extends BaseBean> clazz;
@JsonIgnore

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.base.enumutil.ApsEnumUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
@ -33,6 +34,7 @@ public class FieldSetRule extends BaseRule {
@Column(name="FIELD_NAME")
@ApiParam(value ="字段名")
@FieldAnnotation(notEmpty = true)
private String fieldName;
@Column(name="VALUE")

@ -27,10 +27,6 @@ import javax.persistence.Table;
@Table(name = "APS_IMPORT_DETAIL")
@Api("数据导入明细")
public class ImportDetail extends BaseAPS {
@Column(name="TYPE")
@ApiParam(value ="导入类型")
@FieldAnnotation(defaultValue = "REPLACE")
private ApsEnumUtil.IMPORT_DETAIL_TYPE type;
@Column(name="OUT_NAME")
@ApiParam(value ="外部表名")
@ -40,9 +36,19 @@ public class ImportDetail extends BaseAPS {
@ApiParam(value ="内部表名")
private String inName;
@Column(name="TYPE")
@ApiParam(value ="导入类型")
@FieldAnnotation(defaultValue = "REPLACE")
private ApsEnumUtil.IMPORT_DETAIL_TYPE type;
@Column(name="ORDER_NUMBER")
@ApiParam(value ="序号")
@FieldAnnotation(property = false)
private Integer orderNumber;
@Column(name="PROJECT_ID")
@ApiParam(value ="导入项目ID")
@FieldAnnotation(property = false)
@FieldAnnotation(relation = "Project")
private Long projectId;
public ImportProject getProject() {

@ -38,7 +38,7 @@ public class MatCalcRule extends BaseRule {
@Column(name="DEL_AUTO")
@ApiParam(value ="自动删除补充订单")
@FieldAnnotation(defaultValue = "true")
@FieldAnnotation(defaultValue = "1")
private Boolean delAuto;
@Column(name="DEL_LIMIT")
@ -52,6 +52,7 @@ public class MatCalcRule extends BaseRule {
@Column(name="AUTO_SUPPLY")
@ApiParam(value ="自动补充")
@FieldAnnotation(defaultValue = "1")
private Boolean autoSupply;
@Column(name="BATCH_SUPPLY")

@ -77,7 +77,7 @@ public class Material extends BaseCode {
@Column(name="IS_AUTO_FIX_PEGGING")
@ApiParam(value ="自动补充标识")
@FieldAnnotation(defaultValue = "true")
@FieldAnnotation(defaultValue = "1")
private Boolean autoFixPegging;
@Column(name="MAX_PRODUCT_BATCH")

@ -2,6 +2,7 @@ package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.base.enumutil.ApsEnumUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -26,18 +27,22 @@ import javax.persistence.Table;
public class MaterialSetTime extends BaseAPS {
@Column(name="RES_CODE")
@ApiParam(value ="资源编码")
@FieldAnnotation(editType = ApsEnumUtil.EDIT_TYPE.MULTI_OBJECT, typeName = "Resource", notEmpty = true)
private String resCode;
@Column(name="PREV_MATERIAL")
@ApiParam(value ="前物料编码")
@ApiParam(value ="前物料")
@FieldAnnotation(notEmpty = true)
private String prevMaterial;
@Column(name="POST_MATERIAL")
@ApiParam(value ="后物料编码")
@ApiParam(value ="后物料")
@FieldAnnotation(notEmpty = true)
private String postMaterial;
@Column(name="TIME")
@ApiParam(value ="设置时间")
@FieldAnnotation(notEmpty = true)
private String time;
@Column(name="PRIORITY")

@ -29,9 +29,14 @@ import java.util.List;
@Table(name = "APS_OPER_INPUT")
@Api("工序输入")
public class OperInput extends BaseAPS {
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(relation = "Operation", notEmpty = true, display = false)
private Long operationId;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(relation = "Material")
@FieldAnnotation(relation = "Material", notEmpty = true)
private Long materialId;
@Column(name="INPUT_COUNT")
@ -59,11 +64,6 @@ public class OperInput extends BaseAPS {
@ApiParam(value ="最小时间间隔")
private String minSpaceTime;
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(property = false)
private Long operationId;
public Operation getOperation() {
return BeanRelation.get(this, EOperInput.Operation);
}

@ -28,9 +28,14 @@ import java.util.List;
@Table(name = "APS_OPER_OUTPUT")
@Api("工序输出")
public class OperOutput extends BaseAPS {
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(relation = "Operation", notEmpty = true, display = false)
private Long operationId;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(relation = "Material")
@FieldAnnotation(relation = "Material", notEmpty = true)
private Long materialId;
@Column(name="OUTPUT_COUNT")
@ -45,11 +50,6 @@ public class OperOutput extends BaseAPS {
@ApiParam(value ="固定报废数")
private Double fixScrapCount;
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(property = false)
private Long operationId;
public Operation getOperation() {
return BeanRelation.get(this, EOperOutput.Operation);
}

@ -29,10 +29,14 @@ import java.util.List;
@Table(name = "APS_OPER_RESOURCE")
@Api("工序资源")
public class OperResource extends BaseAPS {
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(relation = "Operation", notEmpty = true, display = false)
private Long operationId;
@Column(name="RESOURCE_ID")
@ApiParam(value ="资源")
@FieldAnnotation(relation = "Resource")
@FieldAnnotation(relation = "Resource", notEmpty = true)
private Long resourceId;
@Column(name="USE_TYPE")
@ -46,6 +50,7 @@ public class OperResource extends BaseAPS {
@Column(name="PRODUCE_TIME")
@ApiParam(value ="生产时间")
@FieldAnnotation(notEmpty = true)
private String produceTime;
@Column(name="POST_TIME")
@ -72,11 +77,6 @@ public class OperResource extends BaseAPS {
@ApiParam(value ="资源使用配套号")
private String userMatchNumber;
@Column(name="OPERATION_ID")
@ApiParam(value ="工序")
@FieldAnnotation(property = false)
private Long operationId;
public Operation getOperation() {
return BeanRelation.get(this, EOperResource.Operation);
}

@ -29,17 +29,29 @@ import java.util.List;
@Table(name = "APS_OPERATION")
@Api("工序")
public class Operation extends BaseAPS {
@Column(name="NUMBER")
@ApiParam(value ="工序号")
@FieldAnnotation(notEmpty = true)
private Integer number;
@Column(name="PRODUCT_ROUTING_ID")
@ApiParam(value ="工艺路线")
@FieldAnnotation(relation = "ProductRouting", notEmpty = true, display = false)
private Long productRoutingId;
@Column(name="STAND_OPERATION_ID")
@ApiParam(value ="标准工序")
@FieldAnnotation(relation = "StandOperation", notEmpty = true)
private Long standOperationId;
@Column(name="PREV_COUNT_RATE")
@ApiParam(value ="前工序数量比")
@FieldAnnotation(notEmpty = true, defaultValue = "1.0")
private Double prevCountRate;
@Column(name="YIELD")
@ApiParam(value ="成品率")
@FieldAnnotation(notEmpty = true, defaultValue = "1.0")
private Double yield;
@Column(name="FIX_SCRAP_COUNT")
@ -71,16 +83,6 @@ public class Operation extends BaseAPS {
@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);
}

@ -29,6 +29,11 @@ import java.util.List;
@Table(name = "APS_PRODUCT_ROUTING")
@Api("物料")
public class ProductRouting extends BaseCode {
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(relation = "Material", notEmpty = true, display = false)
private Long materialId;
@Column(name="VALID_START")
@ApiParam(value ="有效开始时间")
private Date validStart;
@ -42,11 +47,6 @@ public class ProductRouting extends BaseCode {
@FieldAnnotation(defaultValue = "10")
private Integer priority;
@Column(name="MATERIAL_ID")
@ApiParam(value ="物料")
@FieldAnnotation(property = false)
private Long materialId;
public Material getMaterial() {
return BeanRelation.get(this, EProductRouting.Material);
}

@ -31,7 +31,7 @@ import java.util.List;
public class ResCalendar extends BaseAPS {
@Column(name="RES_CODES")
@ApiParam(value ="资源代码")
@FieldAnnotation(editType = ApsEnumUtil.EDIT_TYPE.MULTI_OBJECT, typeName = "Resource")
@FieldAnnotation(editType = ApsEnumUtil.EDIT_TYPE.MULTI_OBJECT, typeName = "Resource", notEmpty = true)
private String resCodes;
@Column(name="WEEKS")
@ -45,6 +45,7 @@ public class ResCalendar extends BaseAPS {
@Column(name="SHIFT_CODES")
@ApiParam(value ="班次代码")
@FieldAnnotation(editType = ApsEnumUtil.EDIT_TYPE.MULTI_OBJECT, typeName = "DayShift", notEmpty = true)
private String shiftCodes;
@Column(name="PRIORITY")

@ -41,7 +41,7 @@ public class Resource extends BaseCode {
@Column(name="EFFICIENCY")
@ApiParam(value ="生产效率")
@FieldAnnotation(defaultValue = "1.0")
@FieldAnnotation(defaultValue = "1.0", notEmpty = true)
private Double efficiency;
@Column(name="PREV_BUFFER")

@ -38,12 +38,12 @@ public class RuleDetail extends BaseAPS {
@Column(name="RULE_GROUP_ID")
@ApiParam(value ="规则组合ID")
@FieldAnnotation(property = false)
@FieldAnnotation(relation = "RuleGroup", display = false)
private Long ruleGroupId;
@Column(name="RULE_ID")
@ApiParam(value ="规则配置ID")
@FieldAnnotation(property = false)
@FieldAnnotation(relation = "Rule", display = false)
private Long ruleId;
public RuleGroup getRuleGroup() { return BeanRelation.get(this, ERuleDetail.RuleGroup); }

@ -26,35 +26,37 @@ import javax.persistence.Table;
@Table(name = "APS_SHIPPING_TIME")
@Api("运输时间")
public class ShippingTime extends BaseAPS {
@Column(name="TIME")
@ApiParam(value ="运输时间")
private String time;
@Column(name="PRIORITY")
@ApiParam(value ="优先级")
@FieldAnnotation(defaultValue = "10")
private Integer priority;
@Column(name="PREV_RES_CODE")
@ApiParam(value ="前资源对象Id")
@FieldAnnotation(property = false)
@ApiParam(value ="前资源编码")
@FieldAnnotation(relation = "PrevRes")
private Long prevResId;
@Column(name="POST_RES_CODE")
@ApiParam(value ="后资源对象Id")
@FieldAnnotation(property = false)
@ApiParam(value ="后资源编码")
@FieldAnnotation(relation = "PostRes")
private Long postResId;
@Column(name="PREV_STAND_CODE")
@ApiParam(value ="前标准工序对象Id")
@FieldAnnotation(property = false)
@ApiParam(value ="前标准工序编码")
@FieldAnnotation(relation = "PrevStand")
private Long prevStandId;
@Column(name="POST_STAND_CODE")
@ApiParam(value ="后标准工序对象Id")
@FieldAnnotation(property = false)
@ApiParam(value ="后标准工序编码")
@FieldAnnotation(relation = "PostStand")
private Long postStandId;
@Column(name="TIME")
@ApiParam(value ="运输时间")
@FieldAnnotation(notEmpty = true)
private String time;
@Column(name="PRIORITY")
@ApiParam(value ="优先级")
@FieldAnnotation(defaultValue = "10")
private Integer priority;
public Resource getPrevRes() {return BeanRelation.get(this, EShippingTime.PrevRes); }
public void setPrevRes(Resource res) {

@ -33,7 +33,7 @@ public class SysParam extends BaseAPS {
@Column(name="MAX_INTERRUPT_COUNT")
@ApiParam(value ="最大中断次数")
@FieldAnnotation(defaultValue = "20")
private Integer maxInterruptCount;
private Integer maxInterruptCount = 20;
@Column(name="TYPE")
@ApiParam(value ="工艺路径有效判断类型")

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="WorkPlan">
<Class name="ShippingTime">
<Relation field="PrevRes" name="Resource" type="MULTI_TO_ONE" owner="false">
</Relation>
<Relation field="PostRes" name="Resource" type="MULTI_TO_ONE" owner="false">

@ -781,10 +781,10 @@ public class ApsEnumUtil {
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum CONSTRAINT_TYPE {
ES("ES", "前工作开始,后工作结束"),
SS("SS", "前工作开始,后工作开始"),
EE("EE", "前工作结束,后工作结束"),
SSEE("SSEE", "前后工同时开始或同时结束");
ES("ES", "前工序结束,后工序开始"),
SS("SS", "前工序开始,后工序开始"),
EE("EE", "前工序结束,后工序结束"),
SSEE("SSEE", "前后工同时开始或同时结束");
private String value;
private String description;

Loading…
Cancel
Save