1:新增弹出框选择多个对象信息接口

yun-zuoyi
钮海涛 6 years ago
parent 2e02d77966
commit 6a1990a215

@ -1,10 +1,13 @@
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.RESOURCE_CLASS;
import cn.estsh.i3plus.pojo.aps.enums.RESOURCE_LOCK_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.RESOURCE_TYPE;
import cn.estsh.i3plus.pojo.aps.enums.TIME_ROUND_TYPE;
import cn.estsh.i3plus.pojo.aps.holders.EResource;
import com.fasterxml.jackson.annotation.JsonBackReference;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -12,6 +15,7 @@ import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* @Description :
@ -96,4 +100,7 @@ public class Resource extends BaseCode {
@Column(name="LOCK_TIME")
@ApiParam(value ="锁定时间长度")
private String lockTime;
@JsonBackReference
public List<WorkPlan> getWorkPlans() { return BeanRelation.list(this, EResource.WorkPlans); }
}

@ -0,0 +1,47 @@
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-17
* @Modify:
**/
@Data
@Entity
@Table(name = "APS_SHIPPING_TIME")
@Api("运输时间")
public class ShippingTime extends BaseAPS {
@Column(name="PREV_RES_CODE")
@ApiParam(value ="前资源编码")
private String prevResCode;
@Column(name="POST_RES_CODE")
@ApiParam(value ="后资源编码")
private String postResCode;
@Column(name="PREV_STAND_CODE")
@ApiParam(value ="前标准工序编码")
private String prevStandCode;
@Column(name="POST_STAND_CODE")
@ApiParam(value ="后标准工序编码")
private String postStandCode;
@Column(name="TIME")
@ApiParam(value ="运输时间")
private String time;
@Column(name="PRIORITY")
@ApiParam(value ="优先级")
private Integer priority;
}

@ -1,6 +1,7 @@
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.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.enums.WORK_PLAN_TYPE;
@ -57,6 +58,8 @@ public class WorkPlan extends BaseAPS {
@Column(name="PRODUCE_BEGIN")
@ApiParam(value ="生产开始时间")
@FieldAnnotation(modify = false)
@RippleAnnotation(dependence = {"Work.PrevRelations.PrevWork.WorkPlan.produceBegin",
"PrevPlan.produceBegin"}, method = "calcPositive")
private Date produceBegin;
@Column(name="PRODUCE_END")
@ -87,6 +90,7 @@ public class WorkPlan extends BaseAPS {
@Column(name="LOCK_BEGIN")
@ApiParam(value ="锁定开始时间")
@FieldAnnotation(modify = false)
@RippleAnnotation(dependence = {"PostRelations.PostWork.WorkPlan.produceBegin"}, method = "calcPositiveLockBegin")
private Date lockBegin;
@Column(name="LOCK_END")

@ -34,17 +34,17 @@ public class WorkResource extends BaseAPS {
@Column(name="PREV_TIME")
@ApiParam(value ="前设置时间")
@FieldAnnotation(modify = false)
private Long prevTime;
private Integer prevTime;
@Column(name="PRODUCE_TIME")
@ApiParam(value ="制造时间")
@FieldAnnotation(modify = false)
private Long produceTime;
private Integer produceTime;
@Column(name="POST_TIME")
@ApiParam(value ="后设置时间")
@FieldAnnotation(modify = false)
private Long postTime;
private Integer postTime;
@Column(name="PRIORITY")
@ApiParam(value ="优先级")

@ -48,7 +48,7 @@ public class BeanRelation {
return result;
}
for (Enum<?> holder : beanInfo.getAllHolders()) {
result.put(holder, new ArrayList<>());
result.put(holder, new LinkedList<>());
}
return result;
}

@ -139,12 +139,12 @@ public class DateDuration {
* @param amount
* @return
*/
public long getTime(double amount) {
public int getTime(double amount) {
if (amount < PRECISION)
return getTime();
double result = (amount * this.rate) + this.time;
return (long)Math.ceil(result);
return (int)Math.ceil(result);
}
/**

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

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

@ -1,3 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="Resource">
<Relation field="WorkPlans" name="WorkPlan" reverse="Resource" type="ONE_TO_MULTI" owner="true">
</Relation>
</Class>

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="WorkPlan">
<Relation field="Resource" name="Resource" type="MULTI_TO_ONE" owner="false">
</Relation>
<Relation field="WorkResource" name="WorkResource" type="ONE_TO_ONE" owner="false">
</Relation>
<Relation field="AssPlans" name="WorkPlan" reverse="MainPlan" type="ONE_TO_MULTI" owner="false">

Loading…
Cancel
Save