BSP联调pojo

yun-zuoyi
castle.zang 3 years ago
parent 741193be82
commit aa80fff7fa

@ -0,0 +1,125 @@
package cn.estsh.i3plus.pojo.base.enumutil;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/18 16:10
* @Modify:
**/
public class BspEnumUtil {
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PARAM_TYPE {
METHOD_PARAM_TYPE(10,"method","方法参数"),
SCRIPT_PARAM_TYPE(20,"script","脚本参数");
private Integer value;
private String code;
private String description;
PARAM_TYPE(Integer value,String code,String description){
this.value = value;
this.code = code;
this.description = description;
}
public static PARAM_TYPE getByValue(String value) {
for (PARAM_TYPE actionType : values()) {
if (actionType.getValue().equals(value)) {
return actionType;
}
}
return null;
}
public Integer getValue() {
return value;
}
public String getCode() {
return code;
}
public String getDescription() {
return description;
}
}
/**
* GroovyPythonJavaScriptScalaRuby
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SCRIPT_LANGUAGE {
GROOVY(10, "Groovy"),
PYTHON(20, "Python"),
JAVA_SCRIPT(30, "JavaScript"),
SCALA(40, "Scala"),
RUBY(50, "Ruby");
private int value;
private String description;
SCRIPT_LANGUAGE(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 METHOD_GROUP_TYPE {
WMS(10, "WMS"),
MES(20, "MES"),
APS(30, "APS"),
MES_PCN(40, "MES_PCN");
private int value;
private String description;
METHOD_GROUP_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;
}
}
}

@ -90,8 +90,11 @@ public class CommonEnumUtil {
/**
*
*/
DEV(9999, 0000, 0, 120000000L, "Development", "系统调试");
DEV(9999, 0000, 0, 120000000L, "Development", "系统调试"),
/**
*
*/
LEO(50, 8234, 0, 106000000L, "impp-leo", "智能调度系统");
/**
* ID

@ -19,7 +19,7 @@ import java.util.Date;
* @Modify:
**/
@Entity
@Table(name = "EXECUTOR_GROUP_REGISTRY_INFO")
@Table(name = "BSP_EXECUTOR_GROUP_REGISTRY_INFO")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor

@ -19,7 +19,7 @@ import java.util.Date;
* @Modify:
**/
@Entity
@Table(name = "EXECUTOR_REGISTRY_INFO")
@Table(name = "BSP_EXECUTOR_REGISTRY_INFO")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor

@ -18,7 +18,7 @@ import java.io.Serializable;
* @Modify:
**/
@Entity
@Table(name = "EXECUTOR_REGISTRY_METHOD_DOC_INFO")
@Table(name = "BSP_REGISTRY_METHOD_DOC_INFO")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor

@ -19,7 +19,7 @@ import java.util.List;
* @CreateDate : 2021/6/16 13:39
* @Modify:
**/
@Table(name = "EXECUTOR_REGISTRY_METHOD_INFO")
@Table(name = "BSP_REGISTRY_METHOD_INFO")
@Entity
@Data
@EqualsAndHashCode(callSuper = true)

@ -18,7 +18,7 @@ import java.io.Serializable;
* @Modify:
**/
@Entity
@Table(name = "EXECUTOR_REGISTRY_PARAM_INFO")
@Table(name = "BSP_REGISTRY_PARAM_INFO")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@ -42,7 +42,11 @@ public class ExecutorRegistryParamInfo extends BaseBean implements Serializable
private String typeName;
@Column(name = "METHOD_ID")
@ApiModelProperty("所属方法的ID")
@ApiModelProperty("所属方法/脚本的ID")
private Long methodId;
// @Column(name = "PARAM_TYPE")
// @ApiModelProperty("区分方法还是脚本的参数,方法参数10,脚本参数20")
// private Integer paramType;
}

@ -18,7 +18,7 @@ import java.io.Serializable;
* @Modify:
**/
@Entity
@Table(name = "METHOD_GROUP_INFO")
@Table(name = "BSP_METHOD_GROUP_INFO")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@ -38,9 +38,9 @@ public class MethodGroupInfo extends BaseBean implements Serializable {
@ApiModelProperty("方法组描述")
private String description;
@Column(name = "CLASSIFY")
@ApiModelProperty("方法组分类(唯一)")
private String classify;
@Column(name = "CLASSIFICATION")
@ApiModelProperty("方法组分类,挂载到的wms,mes等,枚举类")
private Integer classification;
}

@ -20,7 +20,7 @@ import java.util.List;
* @Modify:
**/
@Entity
@Table(name = "METHOD_LEVEL_INFO")
@Table(name = "BSP_METHOD_LEVEL_INFO")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor

@ -19,7 +19,7 @@ import java.io.Serializable;
* @Modify:
**/
@Entity
@Table(name = "METHOD_LEVEL_PARAM_INFO")
@Table(name = "BSP_METHOD_LEVEL_PARAM_INFO")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor

@ -18,7 +18,7 @@ import java.io.Serializable;
* @CreateDate : 2021/9/8 17:01
* @Modify:
**/
@Table(name = "METHOD_LOG")
@Table(name = "BSP_METHOD_LOG")
@Entity
@Data
@EqualsAndHashCode(callSuper = true)

@ -0,0 +1,77 @@
package cn.estsh.i3plus.pojo.bsp.server.bean.po;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/19 11:49
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "BSP_SCRIPT_PERSISTENCE", uniqueConstraints = {
@UniqueConstraint(columnNames = {"ORGANIZE_CODE", "SCRIPT_NO"})
})
@Api("系统动态脚本")
public class ScriptPersistence extends BaseBean {
@Column(name = "SCRIPT_NO", length = 50)
@ApiModelProperty(value = "脚本调用的唯一编号例如WMS_PDA_0001")
private String scriptNo;
@ApiModelProperty(value = "脚本的中文名称")
@Column(name = "SCRIPT_NAME", length = 50)
private String scriptName;
@ApiModelProperty(value = "目标执行器")
@Column(name = "TARGET_EXECUTOR")
private Integer targetExecutor;
@ApiModelProperty(value = "脚本编写的语言 10=Groovy, 20=Jython, 30=JavaScript, 40=Scala, 50=JRuby")
@Column(name = "LANGUAGE_TYPE")
private Integer languageType;
@Lob
@Column(name = "SCRIPT_CONTENT", columnDefinition = "TEXT")
@ApiModelProperty(value = "脚本的具体内容")
private String scriptContent;
@ApiModelProperty(value = "脚本的描述,包含脚本的用法,参数说明等")
@Column(name = "SCRIPT_REMARK", length = 2000)
private String scriptRemark;
@ApiModelProperty(value = "编译后的脚本内容,通过预编译加快脚本的运行速度")
@Transient
private Object compiledScript;
//暂时不提供历史版本号功能
// @Column(name = "SCRIPT_VERSION")
// @ApiModelProperty(value = "脚本版本号")
// private String scriptVersion;
//
// @ApiModelProperty(value = "脚本编号列表")
// @Transient
// private List<String> versionList;
@ApiModelProperty(value = "脚本参数列表")
@Transient
private List<ExecutorRegistryParamInfo> paramInfoList;
}

@ -17,5 +17,5 @@ public class MethodGroupVo {
@ApiParam(value = "方法组名称")
private String groupName;
@ApiParam(value = "是否启用")
private Integer valid;
private Integer isValid;
}

@ -0,0 +1,29 @@
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/19 11:39
* @Modify:
**/
@ApiModel(value = "查询脚本vo")
@Data
public class ScriptVo {
@ApiModelProperty(value = "脚本名称")
private String scriptName;
@ApiModelProperty(value = "脚本状态")
private Integer isValid;
@ApiModelProperty(value = "脚本语言")
private Integer scriptLanguage;
@ApiModelProperty(value = "脚本No,唯一")
private String scriptNo;
}

@ -0,0 +1,21 @@
package cn.estsh.i3plus.pojo.bsp.server.dao;
import cn.estsh.i3plus.pojo.bsp.client.bean.po.EngineScriptPersistence;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/18 11:23
* @Modify:
**/
public interface IEngineScriptDao {
/**
*
* @param name
* @return
*/
List<EngineScriptPersistence> findAllVersionByScriptName(String name);
}

@ -1,7 +1,7 @@
package cn.estsh.i3plus.pojo.bsp.server.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.bsp.client.bean.po.EngineScriptPersistence;
import cn.estsh.i3plus.pojo.bsp.server.bean.po.ScriptPersistence;
/**
* @Description :
@ -10,5 +10,5 @@ import cn.estsh.i3plus.pojo.bsp.client.bean.po.EngineScriptPersistence;
* @CreateDate : 2021/7/22 13:51
* @Modify:
**/
public interface ScriptRepository extends BaseRepository<EngineScriptPersistence,Long> {
public interface ScriptRepository extends BaseRepository<ScriptPersistence,Long> {
}

Loading…
Cancel
Save