修改枚举

yun-zuoyi
钮海涛 4 years ago
parent e918d85702
commit b396d9cfd9

@ -0,0 +1,50 @@
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.EInterMediateDetail;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2021-04-27
* @Modify:
**/
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "APS_INTER_MEDIATE_DETAIL")
@Api("计算中间结果")
public class InterMediateDetail extends BaseAPS {
private static final long serialVersionUID = -2588016171684238811L;
@Column(name="RESULT_ID")
@ApiParam(value ="中间结果")
@FieldAnnotation(relation = "InterMediateResult")
private Long resultId;
@Column(name="RULE")
@ApiParam(value ="评估规则")
private String rule;
@Column(name="EVALUATE_VALUE")
@ApiParam(value ="评估值")
private Double evaluateValue;
public InterMediateResult getResult() { return BeanRelation.get(this, EInterMediateDetail.Result); }
public void setResult(InterMediateResult result) {
this.resultId = result != null ? result.getId() : 0;
BeanRelation.set(this, EInterMediateDetail.Result, result);
}
}

@ -0,0 +1,67 @@
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.EInterMediateResult;
import cn.estsh.i3plus.pojo.aps.holders.EWorkInput;
import cn.estsh.i3plus.pojo.aps.holders.EWorkPlan;
import com.fasterxml.jackson.annotation.JsonBackReference;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2021-04-25
* @Modify:
**/
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "APS_INTER_MEDIATE_RESULT")
@Api("计算中间结果")
public class InterMediateResult extends BaseAPS {
private static final long serialVersionUID = -1869359887027950540L;
@Column(name="WORK_ID")
@ApiParam(value ="工作")
@FieldAnnotation(relation = "Work")
private Long workId;
@Column(name="RESOURCE_ID")
@ApiParam(value ="资源")
@FieldAnnotation(relation = "Resource")
private Long resourceId;
@Column(name="EVALUATE_VALUE")
@ApiParam(value ="评估值")
private Double evaluateValue;
public Work getWork() {
return BeanRelation.get(this, EInterMediateResult.Work);
}
public void setWork(Work work) {
this.workId = work != null ? work.getId() : 0l;
BeanRelation.set(this, EInterMediateResult.Work, work);
}
public Resource getResource() { return BeanRelation.get(this, EInterMediateResult.Resource); }
public void setResource(Resource resource) {
this.resourceId = resource != null ? resource.getId() : 0l;
BeanRelation.set(this, EInterMediateResult.Resource, resource);
}
@JsonBackReference
public List<InterMediateDetail> getDetails() { return BeanRelation.get(this, EInterMediateResult.Details); }
}

@ -33,11 +33,6 @@ import java.util.List;
public class Inventory extends BaseOrder {
private static final long serialVersionUID = 2378846162007550439L;
@Column(name="ORDER_STATUS")
@ApiParam(value ="订单状态")
@FieldAnnotation(defaultValue = "UNCOMMIT")
private ApsEnumUtil.INVENTORY_ORDER_STATUS orderStatus = ApsEnumUtil.INVENTORY_ORDER_STATUS.UNCOMMIT;
@Column(name="SPECIFY_TOP_ORDER")
@ApiParam(value ="指定顶层订单")
private String specifyTopOrder;

@ -4,6 +4,7 @@ import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EBaseOrder;
import cn.estsh.i3plus.pojo.aps.holders.ESafeStockOrder;
import cn.estsh.i3plus.pojo.base.enumutil.ApsEnumUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
@ -30,16 +31,21 @@ public class SafeStockOrder extends BaseOrder {
private static final long serialVersionUID = 5944067344390531794L;
@JsonIgnore
public Work getWork() {
return BeanRelation.get(this, EBaseOrder.Works);
}
@Column(name="ORDER_STATUS")
@ApiParam(value ="订单状态")
@FieldAnnotation(defaultValue = "UNCOMMIT")
private ApsEnumUtil.SAFE_STOCK_ORDER_STATUS orderStatus = ApsEnumUtil.SAFE_STOCK_ORDER_STATUS.UNCOMMIT;
@Column(name="INVENTORY_ID")
@ApiParam(value ="库存")
@FieldAnnotation(relation = "Inventory", notEmpty = true)
private Long inventoryId;
@JsonIgnore
public Work getWork() {
return BeanRelation.get(this, EBaseOrder.Works);
}
public Inventory getInventory() { return BeanRelation.get(this, ESafeStockOrder.Inventory); }
public void setInventory(Inventory inventory) {

@ -49,4 +49,8 @@ public class SysParam extends BaseAPS {
@Column(name="INVENTORY_RATE")
@ApiParam(value ="库存误差百分比")
private Double inventoryRate;
@Column(name="RECORD_RESULT")
@ApiParam(value ="记录资源评估结果")
private Boolean recordResult;
}

@ -161,7 +161,7 @@ public class Work extends BaseAPS {
@Column(name="DYN_SPLIT_WORK_ID")
@ApiParam(value ="动态拆分的工作ID")
@FieldAnnotation(property = false)
// @FieldAnnotation(property = false)
private Long dynSplitWorkId;
private transient boolean hasOptimized = false;
@ -223,6 +223,7 @@ public class Work extends BaseAPS {
return BeanRelation.get(this, EWork.PlanFeedback);
}
@JsonBackReference
public WorkPlan getMainPlan() { return BeanRelation.get(this, EWork.MainPlan); }
public void setMainPlan(WorkPlan plan) {

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

@ -0,0 +1,7 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EInterMediateResult {
Work,
Resource,
Details
}

@ -2,6 +2,7 @@ package cn.estsh.i3plus.pojo.aps.validator;
import cn.estsh.i3plus.pojo.aps.annotation.ShiftTimeAnnotation;
import cn.estsh.i3plus.pojo.aps.model.TimeBlock;
import cn.estsh.i3plus.pojo.base.util.StringUtil;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
@ -13,6 +14,9 @@ public class ShiftTimeValidator implements ConstraintValidator<ShiftTimeAnnotati
@Override
public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
if (StringUtil.isEmpty(s)) {
return false;
}
for (String strTime : s.split(",")) {
String[] times = strTime.split("-");
if (times.length != 2) {

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="InterMediateResult">
<Relation field="Work" name="Work" type="MULTI_TO_ONE">
</Relation>
<Relation field="Resource" name="Resource" type="MULTI_TO_ONE">
</Relation>
<Relation field="Details" name="InterMediateDetail" reverse="Result" type="ONE_TO_MULTI" owner="true">
</Relation>
</Class>
Loading…
Cancel
Save