修改排程计划逻辑

yun-zuoyi
钮海涛 4 years ago
parent 257647de0a
commit caafb9c317

@ -30,6 +30,10 @@ public class HeuristicRule extends BaseRule {
@ApiParam(value ="工作筛选")
private String workFilter;
@Column(name="RES_FILTER")
@ApiParam(value ="资源筛选")
private String resFilter;
@Lob
@Column(name="WORK_SORT")
@ApiParam(value ="工作排序")

@ -0,0 +1,65 @@
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.EOrderFeedback;
import cn.estsh.i3plus.pojo.aps.holders.EPlanFeedback;
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 : 2020-03-19
* @Modify:
**/
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "APS_ORDER_FEEDBACK")
@Api("订单反馈")
public class OrderFeedback extends BaseAPS {
private static final long serialVersionUID = 7822380202121225936L;
@Column(name="ORDER_ID")
@ApiParam(value ="订单")
@FieldAnnotation(property = false)
private Long orderId;
@Column(name="DELIVER_RATE")
@ApiParam(value ="发货百分比")
private transient Double deliverRate;
@Column(name="QUALIFIED_RATE")
@ApiParam(value ="成品合格百分比")
private Double qualifiedRate;
@Column(name="INVENTORY_COUNT")
@ApiParam(value ="库存扣减数量")
private Double inventoryCount;
@Column(name="UNQUALIFIED_COUNT")
@ApiParam(value ="不良数量")
private Double unqualifiedCount;
@Column(name="QUALIFIED_COUNT")
@ApiParam(value ="合格数量")
private Double qualifiedCount;
public BaseOrder getOrder() {
return BeanRelation.get(this, EOrderFeedback.Order);
}
public void setOrder(BaseOrder order) {
this.orderId = order != null ? order.getId() : 0l;
BeanRelation.set(this, EOrderFeedback.Order, order);
}
}

@ -37,6 +37,11 @@ public class ParentWork extends BaseAPS {
@ApiParam(value ="数量")
private Double count;
@Column(name="SERIAL_NUMBER")
@ApiParam(value ="拆分工作流水号")
@FieldAnnotation(property = false)
private Integer serialNumber = 0;
@Column(name="PRODUCT_ORDER_ID")
@ApiParam(value ="订单")
@FieldAnnotation(property = false)

@ -4,6 +4,7 @@ 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 cn.estsh.i3plus.pojo.base.enumutil.ApsEnumUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
@ -28,11 +29,24 @@ import javax.persistence.Table;
public class PlanFeedback extends BaseAPS {
private static final long serialVersionUID = 2520555825093741381L;
@Column(name="WORK_ID")
@ApiParam(value ="工作")
@FieldAnnotation(property = false)
private Long workId;
@Column(name="STATUS")
@ApiParam(value ="状态")
private ApsEnumUtil.FEED_BACK_STATUS status;
@Column(name="ACTUAL_COUNT")
@ApiParam(value ="实际完成数量")
private Double actualCount;
@Column(name="REMARK")
@ApiParam(value ="备注")
private String remark;
public Work getWork() {
return BeanRelation.get(this, EPlanFeedback.Work);
}

@ -60,6 +60,11 @@ public class Resource extends BaseAPS {
@FieldAnnotation(defaultValue = "1.0", notEmpty = true)
private Double efficiency;
@Column(name="WORK_SHOP_ID")
@ApiParam(value ="车间代码")
@FieldAnnotation(relation = "WorkShop")
private Long workShopId;
@Column(name="PREV_BUFFER")
@ApiParam(value ="前缓冲时间")
@FieldAnnotation(editType = ApsEnumUtil.EDIT_TYPE.DURATION)
@ -122,6 +127,13 @@ public class Resource extends BaseAPS {
@Transient
private boolean hasConflict;
public WorkShop getWorkShop() { return BeanRelation.get(this, EResource.WorkShop); }
public void setWorkShop(WorkShop workShop) {
this.workShopId = workShop != null ? workShop.getId() : 0l;
BeanRelation.set(this, EResource.WorkShop, workShop);
}
@JsonBackReference
public List<WorkPlan> getWorkPlans() { return BeanRelation.list(this, EResource.WorkPlans); }
}

@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* @Description :
@ -27,7 +28,31 @@ import javax.persistence.Table;
public class SerialNumber extends BaseAPS {
private static final long serialVersionUID = 312483211086701109L;
@Column(name="NUMBER")
@ApiParam(value ="流水号")
private Integer number;
@Column(name="S_NUMBER")
@ApiParam(value ="销售订单流水号")
private Integer sNumber = 0;
@Column(name="M_NUMBER")
@ApiParam(value ="生产订单流水号")
private Integer mNumber = 0;
@Column(name="P_NUMBER")
@ApiParam(value ="采购订单流水号")
private Integer pNumber = 0;
@Column(name="W_NUMBER")
@ApiParam(value ="库存订单流水号")
private Integer wNumber = 0;
@Column(name="Q_NUMBER")
@ApiParam(value ="安全库存订单流水号")
private Integer qNumber = 0;
@Column(name="H_NUMBER")
@ApiParam(value ="插单流水号")
private Integer hNumber = 0;
@Column(name="LAST_DATE")
@ApiParam(value ="最后生成日期")
private Date lastDate;
}

@ -3,6 +3,8 @@ package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.annotation.MainKey;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
import cn.estsh.i3plus.pojo.aps.holders.EStandOperation;
import cn.estsh.i3plus.pojo.aps.validator.InsertGroup;
import cn.estsh.i3plus.pojo.aps.validator.UpdateGroup;
import cn.estsh.i3plus.pojo.base.enumutil.ApsEnumUtil;
@ -65,4 +67,16 @@ public class StandOperation extends BaseAPS {
@ApiParam(value ="生产组合方式")
@FieldAnnotation(defaultValue = "MAX_ALL_RESOURCE")
private ApsEnumUtil.RES_COMB_TIME_TYPE combType;
@Column(name="WORK_SHOP_ID")
@ApiParam(value ="车间代码")
@FieldAnnotation(relation = "WorkShop")
private Long workShopId;
public WorkShop getWorkShop() { return BeanRelation.get(this, EStandOperation.WorkShop); }
public void setWorkShop(WorkShop workShop) {
this.workShopId = workShop != null ? workShop.getId() : 0l;
BeanRelation.set(this, EStandOperation.WorkShop, workShop);
}
}

@ -217,8 +217,8 @@ public class Work extends BaseAPS {
}
@JsonBackReference
public List<PlanFeedback> getPlanFeedbacks() {
return BeanRelation.list(this, EWork.PlanFeedbacks);
public PlanFeedback getPlanFeedback() {
return BeanRelation.get(this, EWork.PlanFeedback);
}
public WorkPlan getMainPlan() { return BeanRelation.get(this, EWork.MainPlan); }

@ -99,11 +99,6 @@ public class WorkPlan extends BaseAPS {
@FieldAnnotation(modify = false, editType = ApsEnumUtil.EDIT_TYPE.DURATION)
private Integer postSetTime;
@Column(name="FORCE_POST_SET_ZERO")
@ApiParam(value ="是否将后设置时间强制设置成0")
@FieldAnnotation(property = false)
private Boolean forcePostSetZero;
@Column(name="WORK_RESOURCE_ID")
@ApiParam(value ="工作资源对象id")
@FieldAnnotation(property = false)

@ -0,0 +1,40 @@
package cn.estsh.i3plus.pojo.aps.bean;
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
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-03-22
* @Modify:
**/
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "APS_WORK_SHOP")
@Api("车间")
public class WorkShop extends BaseAPS {
private static final long serialVersionUID = 5627016086816721284L;
@Column(name="CODE")
@ApiParam(value ="编码")
@FieldAnnotation(popSearch = true, mainkey = true)
private String code;
@Column(name="NAME")
@ApiParam(value ="名称")
@FieldAnnotation(popSearch = true)
private String name;
}

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

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

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

@ -9,7 +9,7 @@ public enum EWork {
PrevRelations, // 前关联
PostRelations, // 后关联
Operation, // 工序
PlanFeedbacks, // 工作计划反馈
PlanFeedback, // 工作计划反馈
MainPlan, // 关联的为主资源的计划
WorkPlans, // 关联的工作计划
SpecifyResource, // 指定资源

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

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

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="OrderFeedback">
<Relation field="Order" name="BaseOrder" type="ONE_TO_ONE" owner="false">
</Relation>
</Class>

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="PlanFeedback">
</Class>

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

@ -1,3 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Class name="StandOperation">
<Relation field="WorkShop" name="WorkShop" type="MULTI_TO_ONE" owner="false">
</Relation>
</Class>

@ -16,7 +16,7 @@
</Relation>
<Relation field="WorkPlans" name="WorkPlan" reverse="Work" type="ONE_TO_MULTI" owner="true">
</Relation>
<Relation field="PlanFeedbacks" name="PlanFeedback" reverse="Work" type="ONE_TO_MULTI" owner="true">
<Relation field="PlanFeedback" name="PlanFeedback" reverse="Work" type="ONE_TO_ONE" owner="true">
</Relation>
<Relation field="SpecifyResource" name="Resource" type="MULTI_TO_ONE">
</Relation>

@ -1174,4 +1174,58 @@ public class ApsEnumUtil {
return description;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum FEED_BACK_STATUS {
UNCOMMIT("UNCOMMIT", "未提交"),
COMMIT("COMMIT", "提交");
private String value;
private String description;
FEED_BACK_STATUS(String value, String description) {
this.value = value;
this.description = description;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum APS_ORDER_TYPE {
SALES_ORDER("S", "销售订单"),
PRODUCT_ORDER("M", "生产订单"),
PURCHASE_ORDER("P", "采购订单"),
INVENTORY("W", "库存订单"),
SAFE_STOCK_ORDER("Q", "安全库存订单"),
INSERTED_ORDER("H", "插单");
private String value;
private String description;
APS_ORDER_TYPE(String value, String description) {
this.value = value;
this.description = description;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
}
}

Loading…
Cancel
Save