Merge branch 'dev' of http://git.estsh.com/i3-IMPP/i3plus-pojo into dev
commit
2414993cf9
@ -0,0 +1,82 @@
|
||||
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.EShippingTime;
|
||||
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="TIME")
|
||||
@ApiParam(value ="运输时间")
|
||||
private String time;
|
||||
|
||||
@Column(name="PRIORITY")
|
||||
@ApiParam(value ="优先级")
|
||||
private Integer priority;
|
||||
|
||||
@Column(name="PREV_RES_CODE")
|
||||
@ApiParam(value ="前资源对象Id")
|
||||
@FieldAnnotation(property = false)
|
||||
private Long prevResId;
|
||||
|
||||
@Column(name="POST_RES_CODE")
|
||||
@ApiParam(value ="后资源对象Id")
|
||||
@FieldAnnotation(property = false)
|
||||
private Long postResId;
|
||||
|
||||
@Column(name="PREV_STAND_CODE")
|
||||
@ApiParam(value ="前标准工序对象Id")
|
||||
@FieldAnnotation(property = false)
|
||||
private Long prevStandId;
|
||||
|
||||
@Column(name="POST_STAND_CODE")
|
||||
@ApiParam(value ="后标准工序对象Id")
|
||||
@FieldAnnotation(property = false)
|
||||
private Long postStandId;
|
||||
|
||||
public Resource getPrevRes() {return BeanRelation.get(this, EShippingTime.PrevRes); }
|
||||
|
||||
public void setPrevRes(Resource res) {
|
||||
this.prevResId = res != null ? res.getId() : 0l;
|
||||
BeanRelation.set(this, EShippingTime.PrevRes, res);
|
||||
}
|
||||
|
||||
public Resource getPostRes() { return BeanRelation.get(this, EShippingTime.PostRes); }
|
||||
|
||||
public void setPostRes(Resource res) {
|
||||
this.postResId = res != null ? res.getId() : 0l;
|
||||
BeanRelation.set(this, EShippingTime.PostRes, res);
|
||||
}
|
||||
|
||||
public StandOperation getPrevStand() { return BeanRelation.get(this, EShippingTime.PrevStand);}
|
||||
|
||||
public void setPrevStand(StandOperation stand) {
|
||||
this.prevStandId = stand != null ? stand.getId() : 0l;
|
||||
BeanRelation.set(this, EShippingTime.PrevStand, stand);
|
||||
}
|
||||
|
||||
public StandOperation getPostStand() { return BeanRelation.get(this, EShippingTime.PostStand); }
|
||||
|
||||
public void setPostStand(StandOperation stand) {
|
||||
this.postStandId = stand != null ? stand.getId() : 0l;
|
||||
BeanRelation.set(this, EShippingTime.PostStand, stand);
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package cn.estsh.i3plus.pojo.aps.enums;
|
||||
|
||||
public enum WORK_PLAN_TYPE {
|
||||
MAIN_PLAN, // 主资源计划
|
||||
ASS_PLAN, // 副资源计划
|
||||
BATCH_PLAN // 炉资源计划
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
package cn.estsh.i3plus.pojo.aps.holders;
|
||||
|
||||
public enum EResource {
|
||||
WorkPlans
|
||||
}
|
||||
|
@ -0,0 +1,8 @@
|
||||
package cn.estsh.i3plus.pojo.aps.holders;
|
||||
|
||||
public enum EShippingTime {
|
||||
PrevRes, // 前资源
|
||||
PostRes, // 后资源
|
||||
PrevStand, // 前标准工序
|
||||
PostStand // 后标准工序
|
||||
}
|
@ -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>
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Class name="WorkPlan">
|
||||
<Relation field="PrevRes" name="Resource" type="MULTI_TO_ONE" owner="false">
|
||||
</Relation>
|
||||
<Relation field="PostRes" name="Resource" type="MULTI_TO_ONE" owner="false">
|
||||
</Relation>
|
||||
<Relation field="PrevStand" name="StandOperation" type="MULTI_TO_ONE" owner="false">
|
||||
</Relation>
|
||||
<Relation field="PostStand" name="StandOperation" type="MULTI_TO_ONE" owner="false">
|
||||
</Relation>
|
||||
</Class>
|
@ -0,0 +1,179 @@
|
||||
package cn.estsh.i3plus.pojo.base.enumutil;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2019-10-29 13:37
|
||||
* @Modify:
|
||||
**/
|
||||
public class LacEnumUtil {
|
||||
|
||||
/**
|
||||
* 适配器类型
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum SUIT_CASE_TYPE {
|
||||
SOFTWARE(10, "软件"),
|
||||
HARDWARE(20, "硬件");
|
||||
|
||||
private int value;
|
||||
private String description;
|
||||
|
||||
private SUIT_CASE_TYPE (int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String valueOfDescription(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
tmp = values()[i].description;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static LacEnumUtil.SUIT_CASE_TYPE valueOf(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
return values()[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 硬件类型
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum HARDWARE_TYPE {
|
||||
OPC_READ(10, "读OPC"),
|
||||
OPC_WRITE(20, "写OPC");
|
||||
|
||||
private int value;
|
||||
private String description;
|
||||
|
||||
private HARDWARE_TYPE (int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String valueOfDescription(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
tmp = values()[i].description;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static LacEnumUtil.HARDWARE_TYPE valueOf(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
return values()[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum PARAM_TYPE{
|
||||
OUT_PARAM(1,"出参"),
|
||||
IN_PARAM(2,"入参");
|
||||
|
||||
private int value;
|
||||
private String description;
|
||||
|
||||
PARAM_TYPE(int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String valueOfDescription(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
tmp = values()[i].description;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 指令集状态
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
|
||||
public enum STACK_STATUS{
|
||||
RUNNING(1,"运行中"),
|
||||
PAUSE(2,"暂停"),
|
||||
FINISH(3,"完成");
|
||||
|
||||
private int value;
|
||||
private String description;
|
||||
|
||||
STACK_STATUS(int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String valueOfDescription(int val) {
|
||||
String tmp = null;
|
||||
for (int i = 0; i < values().length; i++) {
|
||||
if (values()[i].value == val) {
|
||||
tmp = values()[i].description;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static boolean isRunning(int val) {
|
||||
return RUNNING.getValue() == val;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package cn.estsh.i3plus.pojo.model.lac;
|
||||
|
||||
import cn.estsh.i3plus.pojo.lac.bean.LacCommandStackRecord;
|
||||
import lombok.Data;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @Description : lac指令集model
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2019-10-29 15:29
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
public class LacCommandStackModel {
|
||||
|
||||
/**
|
||||
* 指令集记录id
|
||||
*/
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
* 指令集记录
|
||||
*/
|
||||
private LacCommandStackRecord commandStackRecord;
|
||||
|
||||
/**
|
||||
* 请求数据
|
||||
*/
|
||||
private LacSuitRequest request;
|
||||
|
||||
/**
|
||||
* 请求XML
|
||||
*/
|
||||
private String requestXml;
|
||||
|
||||
/**
|
||||
* 响应数据
|
||||
*/
|
||||
private LacSuitResponse response;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private Exception exception;
|
||||
|
||||
public void setException(Exception exception){
|
||||
LoggerFactory.getLogger("YYYY").error("异常信息:{}",exception);
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
public void setCommandStackRecord(LacCommandStackRecord commandStackRecord){
|
||||
this.commandStackRecord = commandStackRecord;
|
||||
this.recordId = commandStackRecord.getId();
|
||||
}
|
||||
|
||||
public Object getTaskRequestParam(String taskCode){
|
||||
for (Task task : this.getRequest().getTaskList()) {
|
||||
if(task.getCode().equals(taskCode)){
|
||||
return task.getParamList();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.estsh.i3plus.pojo.model.lac;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description : lac 适配请求信息
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2019-10-29 15:07
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@XStreamAlias("request")
|
||||
public class LacSuitRequest {
|
||||
|
||||
/**
|
||||
* 指令集代码
|
||||
*/
|
||||
private String commandStackCode;
|
||||
|
||||
/**
|
||||
* 参数集合
|
||||
*/
|
||||
private List<Task> taskList;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.estsh.i3plus.pojo.model.lac;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description : lac 适配响应信息
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2019-10-29 15:07
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@XStreamAlias("response")
|
||||
public class LacSuitResponse {
|
||||
|
||||
/**
|
||||
* 是否成功
|
||||
*/
|
||||
private boolean success;
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 状态信息
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
private Object result;
|
||||
|
||||
public LacSuitResponse(){
|
||||
this.success = true;
|
||||
this.code = ResourceEnumUtil.MESSAGE.SUCCESS.getCode();
|
||||
this.message = ResourceEnumUtil.MESSAGE.SUCCESS.getDescription();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package cn.estsh.i3plus.pojo.model.lac;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2019-10-29 17:06
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@XStreamAlias("task")
|
||||
public class Task {
|
||||
|
||||
private String code;
|
||||
|
||||
private Object paramList;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package cn.estsh.i3plus.pojo.model.lac;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamConverter;
|
||||
import com.thoughtworks.xstream.converters.extended.ToAttributedValueConverter;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2019-10-29 15:10
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@XStreamAlias("param")
|
||||
@XStreamConverter(value= ToAttributedValueConverter.class, strings={"value"})
|
||||
public class TaskParam {
|
||||
|
||||
private String name;
|
||||
|
||||
private String value;
|
||||
|
||||
}
|
Loading…
Reference in New Issue