Merge branches 'dev' and 'test' of http://git.estsh.com/i3-IMPP/i3plus-pojo into test

yun-zuoyi
许心洁 6 years ago
commit 9fa2f376e4

@ -20,4 +20,5 @@ public @interface FieldAnnotation {
boolean display() default true; // 是否需要在界面显示
int pric() default 2; // 对于浮点型,界面显示的精度
boolean mainkey() default false; // 是否为主键
String defaultValue() default ""; // 字段的默认值
}

@ -80,6 +80,10 @@ public class FieldInfo extends BaseCode {
@ApiParam(value ="数据库类型")
private JDBCType jdbcType;
@Column(name="DEFAULT_VALUE")
@ApiParam(value ="字段默认值")
private String defaultValue;
@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.aps.annotation.RippleAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseCode;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
@ -31,10 +32,12 @@ import java.util.List;
public class Material extends BaseCode {
@Column(name="TYPE")
@ApiParam(value ="类型")
@FieldAnnotation(defaultValue = "PRODUCT")
private MATERIAL_TYPE type;
@Column(name="PREPARE_TYPE")
@ApiParam(value ="备料类型")
@FieldAnnotation(defaultValue = "SELF_MAKE")
private PREPARE_TYPE prepareType;
@Column(name="REPL_TYPE")
@ -68,10 +71,12 @@ public class Material extends BaseCode {
@Column(name="LEVEL")
@ApiParam(value ="低阶码")
@RippleAnnotation(dependence = {"OperOutputs.Operation.ProductRouting.Material"}, method = "calcLevel")
@FieldAnnotation(modify = false)
private Integer level;
@Column(name="IS_AUTO_FIX_PEGGING")
@ApiParam(value ="自动补充标识")
@FieldAnnotation(defaultValue = "true")
private Boolean autoFixPegging;
@Column(name="MAX_PRODUCT_BATCH")
@ -80,6 +85,7 @@ public class Material extends BaseCode {
@Column(name="MIN_PRODUCT_BATCH")
@ApiParam(value ="最小制造批量")
@FieldAnnotation(defaultValue = "0.0")
private Double minProductBatch;
@Column(name="UNIT_PRODUCT_BATCH")

@ -1,6 +1,9 @@
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.EResCalendar;
import com.fasterxml.jackson.annotation.JsonBackReference;
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 :
@ -40,4 +44,14 @@ public class ResCalendar extends BaseAPS {
@Column(name="PRIORITY")
@ApiParam(value ="优先级")
private Integer priority;
@JsonBackReference
public List<DayShift> getDayShifts() {
return BeanRelation.list(this, EResCalendar.DayShifts);
}
@JsonBackReference
public List<Resource> getResources() {
return BeanRelation.list(this, EResCalendar.Resources);
}
}

@ -184,4 +184,6 @@ public class Work extends BaseCode {
public List<PlanFeedback> getPlanFeedbacks() {
return BeanRelation.list(this, EWork.PlanFeedbacks);
}
public WorkPlan getWorkPlan() { return BeanRelation.get(this, EWork.WorkPlan); }
}

@ -0,0 +1,63 @@
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.EWorkPlan;
import cn.estsh.i3plus.pojo.aps.holders.EWorkRelation;
import io.swagger.annotations.Api;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-10-17
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="APS_WORK_PLAN")
@Api("工作计划")
public class WorkPlan extends BaseAPS {
private Date prevSetStart;
private Date prevSetEnd;
private String prevSetTime;
private Date produceStart;
private Date produceEnd;
private String produceTime;
private Date postSetStart;
private Date postSetEnd;
private String postSetTime;
private Date lockStart;
private Date lockEnd;
private String lockTime;
private Date edgeTime;
private Long workId;
private Long resourceId;
public Work getWork() { return BeanRelation.get(this, EWorkPlan.Work); }
public void setWork(Work work) {
this.workId = work != null ? work.getId() : 0l;
BeanRelation.set(this, EWorkPlan.Work, work);
}
public Resource getResource() { return BeanRelation.get(this, EWorkPlan.Resource); }
public void setResource(Resource resource) {
this.resourceId = resource != null ? resource.getId() : 0l;
BeanRelation.set(this, EWorkPlan.Resource, resource);
}
}

@ -1,6 +1,7 @@
package cn.estsh.i3plus.pojo.aps.common;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import javax.persistence.MappedSuperclass;
@ -18,6 +19,7 @@ import java.util.Map;
@Data
@MappedSuperclass
public abstract class BaseAPS extends BaseBean {
@JsonIgnore
private transient Map<String, Object> customFields = new HashMap<>();
public Object getCustomField(String code) {

@ -287,6 +287,9 @@ public class BeanInfo {
case STRING:
cls = String.class;
break;
case DURATION:
cls = DateDuration.class;
break;
default:
break;
}

@ -217,7 +217,7 @@ public class BeanRelation {
* @param bean
* @param holder
*/
private static void remove(BaseBean bean, Enum<?> holder) {
public static void remove(BaseBean bean, Enum<?> holder) {
if (bean == null || holder == null) {
return;
}
@ -241,7 +241,7 @@ public class BeanRelation {
* @param holder
* @param relaBean
*/
private static void remove(BaseBean bean, Enum<?> holder, BaseBean relaBean) {
public static void remove(BaseBean bean, Enum<?> holder, BaseBean relaBean) {
if (bean == null || holder == null) {
return;
}

@ -0,0 +1,4 @@
package cn.estsh.i3plus.pojo.aps.enums;
public enum RESOURCE_CHOISE_RULE {
}

@ -0,0 +1,31 @@
package cn.estsh.i3plus.pojo.aps.enums;
/**
* @Description :
* @Reference :
* @Author : jason.niu
* @CreateDate : 2019-09-17
* @Modify:
**/
public enum WORK_SORT_RULE {
NONE,
ORDER_DELIVERY, // 订单交货期
ORDER_PRIORITY, // 订单优先级
ORDER_ESTSTART, // 订单最早开始时刻
ORDER_COUNT, // 订单数量
ORDER_RECEIVE_DATE,// 订单接单日期
ORDER_LET_MINUS_EST,// 订单交货期与订单最早开始时刻之差
ORDER_PRESSURE, // 订单紧迫程度
ORDER_SURPLUS, // 订单余裕度
REMAIN_OPERATION_COUNT,// 残留工序数
REMAIN_PRODUCT, // 残留生产时间
MINSTE_PREMAIN,// 最小工序宽裕时间
WORK_LET, // 工作最晚结束时刻
WORK_EST, // 工作最早开始时刻
ORDER_STOCK_RELA, // 订单物品库存量相对值
ORDER_FIRST_WORK_START,// 订单首工作上次开始时刻
HAVE_HIGH_WORK, // 订单中含有高级别工作
WORK_RESOURCE_COUNT, // 工作的可用资源数
WORK_SCHED_APPROX,// 与已排工作近视度
TOP_ORDER_DELIVERY;// 顶层订单的交货期
}

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

@ -1,13 +1,14 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EWork {
Order,
ParentWork,
WorkResources,
WorkInputs,
WorkOutputs,
PrevRelations,
PostRelations,
Operation,
PlanFeedbacks
Order, // 订单
ParentWork, // 父工作
WorkResources, // 工作资源
WorkInputs, // 工作输入
WorkOutputs, // 工作输出
PrevRelations, // 前关联
PostRelations, // 后关联
Operation, // 工序
PlanFeedbacks, // 工作计划反馈
WorkPlan // 关联的为主资源的计划
}

@ -0,0 +1,7 @@
package cn.estsh.i3plus.pojo.aps.holders;
public enum EWorkPlan {
Work,
Resource,
AssPlans // 关联的为副资源的工作计划
}

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

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

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="WorkInput">
<Relation field="WorkRelations" name="WorkRelation" reverse="WorkInput" type="ONE_TO_MULTI" owner="true">
</Relation>
<Relation field="Material" name="Material" reverse="WorkInputs" type="MULTI_TO_ONE" owner="false">
</Relation>
<Relation field="OperInput" name="OperInput" reverse="WorkInputs" type="MULTI_TO_ONE" owner="false">
</Relation>
<Relation field="WorkRelations" name="WorkRelation" reverse="WorkInput" type="ONE_TO_MULTI" owner="true">
</Relation>
<Relation field="Material" name="Material" reverse="WorkInputs" type="MULTI_TO_ONE" owner="false">
</Relation>
<Relation field="OperInput" name="OperInput" reverse="WorkInputs" type="MULTI_TO_ONE" owner="false">
</Relation>
</Class>

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