Merge branch 'test' into ext-dev

yun-zuoyi
nies 3 years ago
commit 250567bc00

@ -1290,4 +1290,50 @@ public class BlockSoftSwitchEnumUtil {
}
}
/**
*
* 10=Groovy, 20=Jython, 30=JavaScript, 40=Scala, 50=JRuby
*/
public enum LANGUAGE_TYPE {
GROOVY(1, "Groovy", 10),
PYTHON(2, "jython", 20), // "jython" string can not change
JS(3, "JavaScript", 30);
// 下面这2种语言没人会写暂不支持
//SCALA(40,"scala"),
//JRUBY(50,"jruby");
private int index;
private String description;
private int value;
LANGUAGE_TYPE(int index, String description, int value) {
this.index = index;
this.description = description;
this.value = value;
}
public String getDescription() {
return description;
}
public int getIndex() {
return this.index;
}
public int getValue() {
return value;
}
// 根据枚举编号获取语言代码
public static String getCodeByIndex(Integer index) {
for (WmsEnumUtil.LANGUAGE_TYPE languageType : WmsEnumUtil.LANGUAGE_TYPE.values()) {
if (languageType.getValue() == index) {
return languageType.getDescription();
}
}
return null;
}
}
}

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.softswitch.bean;
import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@ -47,4 +48,28 @@ public class BsSuitCaseWebService extends BaseBean {
@Column(name = "CALL_RESTFUL_URL")
@ApiParam(value = "CALL RESTFUL URL(调用restful接口的地址)")
private String callRestfulUrl;
@Column(name = "CONNECTION_TIMEOUT")
@ApiParam(value = "connectionTimeout 连接超时时间")
private Long connectionTimeout;
@Column(name = "RECEIVE_TIMEOUT")
@ApiParam(value = "ReceiveTimeout 接收数据超时时间")
private Long receiveTimeout;
@Column(name = "CONNECTION_REQUEST_TIMEOUT")
@ApiParam(value = "connectionRequestTimeout 请求超时时间")
private Long connectionRequestTimeout;
@Column(name = "CALL_SCRIPT_SWITCH")
@ApiParam(value = "调用脚本的开关 ")
private Integer callScriptSwitch;
@Column(name = "SCRIPT_NO", length = 50)
@ApiParam(name = "脚本编码")
private String scriptNo;
}

@ -0,0 +1,76 @@
package cn.estsh.i3plus.pojo.softswitch.bean;
import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
/**
*
*
*/
@Data
@Entity
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "SCRIPT_PERSISTENCE", uniqueConstraints = {
@UniqueConstraint(columnNames = {"SCRIPT_NO"})
})
@Api("动态脚本脚本目前只支持groovy")
public class ScriptPersistence extends BaseBean {
private static final long serialVersionUID = 7893111140559759490L;
// 脚本调用的唯一编号例如WMS_PDA_0001
@Column(name = "SCRIPT_NO", length = 50)
@AnnoOutputColumn(name = "脚本编码")
private String scriptNo;
// 脚本的中文名称F
@Column(name = "SCRIPT_NAME", length = 50)
@AnnoOutputColumn(name = "脚本名称")
private String scriptName;
// 10=webService 结果拦截脚本
@Column(name = "SCRIPT_TYPE")
@AnnoOutputColumn(name = "脚本类型")
private Integer scriptType;
// 脚本编写的语言
// 10=Groovy, 20=Jython, 30=JavaScript, 40=Scala, 50=JRuby
@Column(name = "LANGUAGE_TYPE")
@AnnoOutputColumn(name = "脚本语言")
private Integer languageType;
// 脚本的具体内容
@Lob
@Column(name = "SCRIPT_CONTENT", columnDefinition = "TEXT")
@AnnoOutputColumn(name = "脚本内容")
private String scriptContent;
// 脚本的描述,包含脚本的用法,参数说明等
@Column(name = "SCRIPT_REMARK", length = 2000)
@AnnoOutputColumn(name = "脚本描述",required = false)
private String scriptRemark;
// 编译后的脚本内容,通过预编译加快脚本的运行速度
@Transient
private Object compiledScript;
// 构造方法,便于批量创建数据
public ScriptPersistence(Long id, String scriptNo, String scriptName, Integer scriptType, Integer languageType,
String scriptContent, String scriptRemark) {
this.id = id;
this.scriptNo = scriptNo;
this.scriptName = scriptName;
this.scriptType = scriptType;
this.languageType = languageType;
this.scriptContent = scriptContent;
this.scriptRemark = scriptRemark;
}
}

@ -0,0 +1,13 @@
package cn.estsh.i3plus.pojo.softswitch.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.softswitch.bean.ScriptPersistence;
import org.springframework.stereotype.Repository;
/**
* @author ns
* @create 2022/5/24 0024 14:11
*/
@Repository
public interface ScriptPersistenceRepository extends BaseRepository<ScriptPersistence,Long> {
}
Loading…
Cancel
Save