parent
98aba13e5f
commit
375329445b
9 changed files with 678 additions and 261 deletions
@ -0,0 +1,176 @@ |
||||
package org.jeecg.modules.fieldx.dto; |
||||
|
||||
import com.aliyuncs.utils.StringUtils; |
||||
import org.apache.poi.ss.usermodel.Row; |
||||
import org.jeecg.modules.tablex.entity.Tablex; |
||||
import org.jeecg.modules.tablex.service.impl.TablexServiceImpl; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.beans.factory.annotation.Value; |
||||
import org.springframework.data.redis.core.index.Indexed; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import javax.annotation.PostConstruct; |
||||
@Component |
||||
public class ExcelInfo { |
||||
private Row cells; |
||||
|
||||
@Autowired |
||||
private TablexServiceImpl tablexService; |
||||
|
||||
public void setcells(Row cells){ |
||||
this.cells = cells; |
||||
} |
||||
public static ExcelInfo excelInfo; |
||||
@PostConstruct |
||||
public void init(){ |
||||
excelInfo=this; |
||||
excelInfo.tablexService=this.tablexService; |
||||
} |
||||
public String getTableId(){ |
||||
String value=cells.getCell(1).getStringCellValue(); |
||||
System.out.println("value = ==================================" + value); |
||||
if(StringUtils.isEmpty(value)) |
||||
return null; |
||||
Tablex tablex=excelInfo.tablexService.query().eq("table_name",value).one(); |
||||
if(tablex==null) |
||||
return null; |
||||
return tablex.getId(); |
||||
} |
||||
|
||||
public String getFieldName(){ |
||||
String value=cells.getCell(2).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getFieldEnName(){ |
||||
String value=cells.getCell(3).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getType(){ |
||||
String value=cells.getCell(4).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getLength(){ |
||||
String value=cells.getCell(5).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getAccuracy(){ |
||||
String value=cells.getCell(6).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getFormat(){ |
||||
String value=cells.getCell(7).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getIsPk(){ |
||||
String value=cells.getCell(8).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getIsFk(){ |
||||
String value=cells.getCell(9).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getAssociateTable(){ |
||||
String value=cells.getCell(10).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getAssociateField(){ |
||||
String value=cells.getCell(11).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getIsNull(){ |
||||
String value=cells.getCell(12).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getIsUniqueness(){ |
||||
String value=cells.getCell(13).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getRule(){ |
||||
String value=cells.getCell(14).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getVerisonStatus(){ |
||||
String value=cells.getCell(15).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
public String getVerison(){ |
||||
String value=cells.getCell(16).getStringCellValue(); |
||||
return getvalue(value); |
||||
} |
||||
|
||||
private String getvalue(String value){ |
||||
if(StringUtils.isEmpty(value)) |
||||
return null; |
||||
if(value.equals("否")||value.equals("历史")||value.equals("停用")) |
||||
return "0"; |
||||
if(value.equals("是")|| value.equals("正常")||value.equals("当前")||value.equals("TINYINT")) |
||||
return "1"; |
||||
if(value.equals("SMALLINT")) |
||||
return "2"; |
||||
if(value.equals("MEDIUMINT")||value.equals("废弃")) |
||||
return "3"; |
||||
if(value.equals("INT")) |
||||
return "4"; |
||||
if(value.equals("BIGINT")) |
||||
return "5"; |
||||
if(value.equals("FLOAT")) |
||||
return "6"; |
||||
if(value.equals("DOUBLE")) |
||||
return "7"; |
||||
if(value.equals("DECIMAL")) |
||||
return "8"; |
||||
if(value.equals("YEAR")) |
||||
return "9"; |
||||
if(value.equals("TIME")) |
||||
return "10"; |
||||
if(value.equals("DATE")) |
||||
return "11"; |
||||
if(value.equals("DATETIME")) |
||||
return "12"; |
||||
if(value.equals("TIMESTAMP")) |
||||
return "13"; |
||||
if(value.equals("CHAR")) |
||||
return "14"; |
||||
if(value.equals("VARCHAR")) |
||||
return "15"; |
||||
if(value.equals("BINARY")) |
||||
return "16"; |
||||
if(value.equals("VARBINARY")) |
||||
return "17"; |
||||
if(value.equals("BLOB")) |
||||
return "18"; |
||||
if(value.equals("TEXT")) |
||||
return "19"; |
||||
if(value.equals("ENUM")) |
||||
return "20"; |
||||
if(value.equals("SET")) |
||||
return "21"; |
||||
if(value.equals("BIT")) |
||||
return "22"; |
||||
if(value.equals("TINYBLOB")) |
||||
return "23"; |
||||
if(value.equals("BLOB")) |
||||
return "24"; |
||||
if(value.equals("MEDIUMBLOB")) |
||||
return "25"; |
||||
if(value.equals("LONGBLOB")) |
||||
return "26"; |
||||
return value; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,91 @@ |
||||
package org.jeecg.modules.fieldx.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@TableName("fieldx222") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
public class Fieldx222 implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private java.lang.String id; |
||||
/**对应实体id*/ |
||||
@Excel(name = "对应实体id", width = 15,dictTable="tablex",dicText = "table_name",dicCode = "id") |
||||
@ApiModelProperty(value = "对应实体") |
||||
private java.lang.String tableId; |
||||
/**中文名称*/ |
||||
@Excel(name = "中文名称", width = 15) |
||||
@ApiModelProperty(value = "中文名称") |
||||
private java.lang.String fieldName; |
||||
/**英文名称*/ |
||||
@Excel(name = "英文名称", width = 15) |
||||
@ApiModelProperty(value = "英文名称") |
||||
private java.lang.String fieldEnName; |
||||
/**数据类型*/ |
||||
@Excel(name = "数据类型", width = 15, dicCode = "date_type") |
||||
@ApiModelProperty(value = "数据类型") |
||||
private java.lang.String type; |
||||
/**数据长度*/ |
||||
@Excel(name = "数据长度", width = 15) |
||||
@ApiModelProperty(value = "数据长度") |
||||
private java.lang.String length; |
||||
/**浮点精度*/ |
||||
@Excel(name = "浮点精度", width = 15) |
||||
@ApiModelProperty(value = "浮点精度") |
||||
private java.lang.String accuracy; |
||||
/**显示形式*/ |
||||
@Excel(name = "显示形式", width = 15) |
||||
@ApiModelProperty(value = "显示形式") |
||||
private java.lang.String format; |
||||
/**是否主键*/ |
||||
@Excel(name = "是否主键", width = 15,dicCode = "yn") |
||||
@ApiModelProperty(value = "是否主键") |
||||
private java.lang.String isPk; |
||||
/**是否外键*/ |
||||
@Excel(name = "是否外键", width = 15,dicCode = "yn") |
||||
@ApiModelProperty(value = "是否外键") |
||||
private java.lang.String isFk; |
||||
/**关联实体*/ |
||||
@Excel(name = "关联实体", width = 15) |
||||
@ApiModelProperty(value = "关联实体") |
||||
private java.lang.String associateTable; |
||||
/**关联字段*/ |
||||
@Excel(name = "关联字段", width = 15) |
||||
@ApiModelProperty(value = "关联字段") |
||||
private java.lang.String associateField; |
||||
/**是否为空*/ |
||||
@Excel(name = "是否为空", width = 15,dicCode = "yn") |
||||
@ApiModelProperty(value = "是否为空") |
||||
private java.lang.String isNull; |
||||
/**是否重复*/ |
||||
@Excel(name = "是否重复", width = 15,dicCode = "yn") |
||||
@ApiModelProperty(value = "是否重复") |
||||
private java.lang.String isUniqueness; |
||||
/**字段规则*/ |
||||
@Excel(name = "字段规则", width = 15) |
||||
@ApiModelProperty(value = "字段规则") |
||||
private java.lang.String rull; |
||||
/**版本状态*/ |
||||
@Excel(name = "版本状态", width = 15 ,dicCode = "verison_status") |
||||
@ApiModelProperty(value = "版本状态") |
||||
private java.lang.String verisonStatus; |
||||
/**版本号*/ |
||||
@Excel(name = "版本号", width = 15) |
||||
@ApiModelProperty(value = "版本号") |
||||
private java.lang.String verison; |
||||
} |
@ -0,0 +1,8 @@ |
||||
package org.jeecg.modules.fieldx.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.jeecg.modules.fieldx.entity.Fieldx222; |
||||
@Mapper |
||||
public interface Fieldx222Mapper extends BaseMapper<Fieldx222> { |
||||
} |
@ -0,0 +1,8 @@ |
||||
package org.jeecg.modules.fieldx.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import org.jeecg.modules.fieldx.entity.Fieldx; |
||||
import org.jeecg.modules.fieldx.entity.Fieldx222; |
||||
|
||||
public interface IFieldx222Service extends IService<Fieldx222> { |
||||
} |
@ -0,0 +1,12 @@ |
||||
package org.jeecg.modules.fieldx.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.jeecg.modules.fieldx.entity.Fieldx222; |
||||
import org.jeecg.modules.fieldx.mapper.Fieldx222Mapper; |
||||
import org.jeecg.modules.fieldx.service.IFieldx222Service; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@Service |
||||
public class Fieldx222ServiceImpl extends ServiceImpl<Fieldx222Mapper, Fieldx222> implements IFieldx222Service { |
||||
} |
||||
|
Loading…
Reference in new issue