接口映射bean

yun-zuoyi
castle.zang 4 years ago
parent edc4a74001
commit c2437fd00f

@ -9747,6 +9747,85 @@ public class WmsEnumUtil {
return valueOf(val); return valueOf(val);
} }
} }
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DATA_SOURCE_STATUS {
CONN_SUCCESS(10, "连接成功", "连接成功"),
CONN_FAILURE(20, "连接失败", "连接失败");
private int value;
private String code;
private String description;
private DATA_SOURCE_STATUS(int value, String code, String description) {
this.value = value;
this.code = code;
this.description = description;
}
public int getValue() {
return value;
}
public String getCode() {
return code;
}
public String getDescription() {
return description;
}
public static String valueOfCode(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].code;
}
}
return tmp;
}
public static int codeOfValue(String code) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].value;
}
}
return tmp;
}
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 WmsEnumUtil.DATA_SOURCE_STATUS valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
public static String codeOfDescription(String code) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].description;
}
}
return tmp;
}
}
} }

@ -0,0 +1,89 @@
package cn.estsh.i3plus.pojo.wms.bean.datasource;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2021/12/17 10:26
* @Modify:
**/
@Data
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Entity
@Table(name = "wms_cus_datasource")
public class CusDatasource extends BaseBean {
@Column(
name = "SOURCE_NAME"
)
@ApiParam("数据源名称")
private String sourceName;
@Column(
name = "SOURCE_CODE"
)
@ApiParam("数据源编码")
private String sourceCode;
@Column(
name = "SOURCE_STATUS"
)
@ApiParam(
value = "数据源状态",
name = "状态:可用,不可用 看枚举当中是否存在"
)
private Integer sourceStatus;
@Column(
name = "SOURCE_TYPE"
)
@ApiParam(
value = "数据源类型",
name = "BlockFormEnumUtil.DATA_SOURCE_TYPE"
)
private Integer sourceType;
@Column(
name = "SOURCE_HOST"
)
@ApiParam("数据源连接地址")
private String sourceHost;
@Column(
name = "SOURCE_PORT"
)
@ApiParam("数据源端口")
private Integer sourcePort;
@Column(
name = "SOURCE_DATA_BASE_NAME"
)
@ApiParam("数据库名称")
private String sourceDataBaseName;
@Column(
name = "SOURCE_USER_NAME"
)
@ApiParam("数据库用户名称")
private String sourceUserName;
@Column(
name = "SOURCE_PASSWORD"
)
@ApiParam("数据库用户密码")
private String sourcePassword;
@Column(
name = "SOURCE_DESCRIPTION"
)
@ApiParam("数据源描述")
private String sourceDescription;
public CusDatasource(Long id, String sourceCode) {
this.id = id;
this.sourceCode = sourceCode;
}
}

@ -50,6 +50,16 @@ public class WmsInterfaceDataMapper extends BaseBean {
@Column(name = "SRC_DATA_SOURCE", length = 50) @Column(name = "SRC_DATA_SOURCE", length = 50)
public String dataSource; public String dataSource;
/** /**
* id
*/
@Column(name = "DEST_DATA_SOURCE_ID)")
public Long destDatasourceId;
/**
* id
*/
@Column(name = "SRC_DATA_SOURCE_ID)")
public Long srcDatasourceId;
/**
* *
*/ */
@Column(name = "SRC_TABLE_NAME", length = 50) @Column(name = "SRC_TABLE_NAME", length = 50)

@ -0,0 +1,16 @@
package cn.estsh.i3plus.pojo.wms.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.wms.bean.datasource.CusDatasource;
import org.springframework.stereotype.Repository;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2021/12/21 13:33
* @Modify:
**/
@Repository
public interface CusDatasourceRepository extends BaseRepository<CusDatasource, Long> {
}

@ -1,7 +1,6 @@
package cn.estsh.i3plus.pojo.wms.repository; package cn.estsh.i3plus.pojo.wms.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.wms.bean.AmpJisRec;
import cn.estsh.i3plus.pojo.wms.dbinterface.WmsInterfaceDataMapper; import cn.estsh.i3plus.pojo.wms.dbinterface.WmsInterfaceDataMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;

Loading…
Cancel
Save