|
@@ -15,9 +15,11 @@ import com.persagy.dmp.rwd.dic.FuncidUtils;
|
|
|
import com.persagy.dmp.rwd.enums.FuncidDataType;
|
|
|
import lombok.Data;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.junit.Before;
|
|
|
import org.junit.Test;
|
|
@@ -43,9 +45,9 @@ import java.util.UUID;
|
|
|
@RunWith(SpringRunner.class)
|
|
|
public class ImportFuncid {
|
|
|
|
|
|
- private String basepath = "C:\\Users\\24341\\Downloads\\数据字典附表(20210412)";
|
|
|
+ private String basepath = "C:\\Users\\24341\\Downloads\\数据字典附表(20210503)";
|
|
|
|
|
|
- private String outPath = "C:/Users/24341/Downloads/20210413/funcid-" + DateUtils.format(new Date()) + ".dml.sql";
|
|
|
+ private String outPath = "C:/Users/24341/Downloads/20210512/funcid-" + DateUtils.format(new Date()) + ".dml.sql";
|
|
|
|
|
|
@Autowired
|
|
|
private HttpUtils httpUtils;
|
|
@@ -62,7 +64,7 @@ public class ImportFuncid {
|
|
|
@Test
|
|
|
public void importFuncidDef() throws IOException {
|
|
|
List<FuncidDefModel> funcids = new LinkedList<>();
|
|
|
-// importBase(funcids);
|
|
|
+ //importBase(funcids);
|
|
|
importSpace(funcids);
|
|
|
importSystem(funcids);
|
|
|
importEquipment(funcids);
|
|
@@ -238,6 +240,8 @@ public class ImportFuncid {
|
|
|
funcids.addAll(readSheet("TenantZone", "/附表5-建筑空间类对象属性点表/附表5.5-空间.xlsx", "TNZ租户分区"));
|
|
|
funcids.addAll(readSheet("FunctionZone", "/附表5-建筑空间类对象属性点表/附表5.5-空间.xlsx", "FCZ功能分区"));
|
|
|
funcids.addAll(readSheet("PassengerFlowZone", "/附表5-建筑空间类对象属性点表/附表5.5-空间.xlsx", "PFZ客流分区"));
|
|
|
+ funcids.addAll(readSheet("EvacuateZone", "/附表5-建筑空间类对象属性点表/附表5.5-空间.xlsx", "EVZ疏散分区"));
|
|
|
+ funcids.addAll(readSheet("EnvironmentZone", "/附表5-建筑空间类对象属性点表/附表5.5-空间.xlsx", "ENZ环境分区"));
|
|
|
funcids.addAll(readSheet("OtherZone", "/附表5-建筑空间类对象属性点表/附表5.5-空间.xlsx", "OTZ其他分区"));
|
|
|
}
|
|
|
|
|
@@ -405,6 +409,7 @@ public class ImportFuncid {
|
|
|
funcids.addAll(readSheet("WEPMCU", "/附表8-设备类对象分类属性点表/附表8.2-弱电专业设备/附表8.2.9-客流管理系统设备.xlsx", "PMCU客流管理控制箱"));
|
|
|
funcids.addAll(readSheet("ACCCCC", "/附表8-设备类对象分类属性点表/附表8.3-空调专业设备/附表8.3.1-中央供冷系统设备.xlsx", "CCCC离心式冷水机组"));
|
|
|
funcids.addAll(readSheet("ACCCSC", "/附表8-设备类对象分类属性点表/附表8.3-空调专业设备/附表8.3.1-中央供冷系统设备.xlsx", "CCSC螺杆式冷水机组"));
|
|
|
+ funcids.addAll(readSheet("ACCCPC", "/附表8-设备类对象分类属性点表/附表8.3-空调专业设备/附表8.3.1-中央供冷系统设备.xlsx", "CCPC活塞式冷水机组"));
|
|
|
funcids.addAll(readSheet("ACCCAC", "/附表8-设备类对象分类属性点表/附表8.3-空调专业设备/附表8.3.1-中央供冷系统设备.xlsx", "CCAC吸收式冷水机组"));
|
|
|
funcids.addAll(readSheet("ACCCAH", "/附表8-设备类对象分类属性点表/附表8.3-空调专业设备/附表8.3.1-中央供冷系统设备.xlsx", "CCAH空调空气源热泵"));
|
|
|
funcids.addAll(readSheet("ACCCWH", "/附表8-设备类对象分类属性点表/附表8.3-空调专业设备/附表8.3.1-中央供冷系统设备.xlsx", "CCWH空调水源热泵"));
|
|
@@ -587,6 +592,11 @@ public class ImportFuncid {
|
|
|
funcids.addAll(readSheet("FFFSSP", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSSP喷淋供水加压泵"));
|
|
|
funcids.addAll(readSheet("FFFSMP", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSMP水喷雾供水加压泵"));
|
|
|
funcids.addAll(readSheet("FFFSAP", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSAP停机坪消防供水加压泵"));
|
|
|
+ funcids.addAll(readSheet("FFFSPP", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSPP预作用加压泵"));
|
|
|
+ funcids.addAll(readSheet("FFFSGP", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSGP窗玻璃喷淋泵"));
|
|
|
+ funcids.addAll(readSheet("FFFSIP", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSIP加密喷淋泵"));
|
|
|
+ funcids.addAll(readSheet("FFFSWP", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSWP水炮泵"));
|
|
|
+ funcids.addAll(readSheet("FFFSPM", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSPM消防稳压泵"));
|
|
|
funcids.addAll(readSheet("FFFSWM", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSWM消防水炮设备"));
|
|
|
funcids.addAll(readSheet("FFFSCF", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSCF消防给水定压补水装置"));
|
|
|
funcids.addAll(readSheet("FFFSPT", "/附表8-设备类对象分类属性点表/附表8.5-消防专业设备/附表8.5.5-消防给水系统设备.xlsx", "FSPT消防给水压力罐"));
|
|
@@ -676,6 +686,7 @@ public class ImportFuncid {
|
|
|
funcids.addAll(readSheet("CFIDSC", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.3-室内装饰设备.xlsx", "IDSC插座"));
|
|
|
funcids.addAll(readSheet("CFIDFN", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.3-室内装饰设备.xlsx", "IDFN家具"));
|
|
|
funcids.addAll(readSheet("CFIDCL", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.3-室内装饰设备.xlsx", "IDCL吊顶"));
|
|
|
+ funcids.addAll(readSheet("CFIDFD", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.3-室内装饰设备.xlsx", "IDFD地漏"));
|
|
|
funcids.addAll(readSheet("CFCADM", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.4-建筑附件设备.xlsx", "CADM装饰材料"));
|
|
|
funcids.addAll(readSheet("CFCAHD", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.4-建筑附件设备.xlsx", "CAHD栏杆"));
|
|
|
funcids.addAll(readSheet("CFCASB", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.4-建筑附件设备.xlsx", "CASB减速带"));
|
|
@@ -686,6 +697,8 @@ public class ImportFuncid {
|
|
|
funcids.addAll(readSheet("CFCADD", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.4-建筑附件设备.xlsx", "CADD排水沟"));
|
|
|
funcids.addAll(readSheet("CFCAWB", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.4-建筑附件设备.xlsx", "CAWB垃圾桶"));
|
|
|
funcids.addAll(readSheet("CFCAMC", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.4-建筑附件设备.xlsx", "CAMC井盖"));
|
|
|
+ funcids.addAll(readSheet("CFCAIS", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.4-建筑附件设备.xlsx", "CAIS检查井"));
|
|
|
+ funcids.addAll(readSheet("CFCAOP", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.4-建筑附件设备.xlsx", "CAOP室外道路"));
|
|
|
funcids.addAll(readSheet("CFPKPS", "/附表8-设备类对象分类属性点表/附表8.7-土建精装专业设备/附表8.7.5-停车场设备.xlsx", "PKPS停车位"));
|
|
|
funcids.addAll(readSheet("OTSAEW", "/附表8-设备类对象分类属性点表/附表8.8-其他专业设备/附表8.8.1-强电线路及附件设备.xlsx", "SAEW强电线路"));
|
|
|
funcids.addAll(readSheet("OTWAEW", "/附表8-设备类对象分类属性点表/附表8.8-其他专业设备/附表8.8.2-弱电线路及附件设备.xlsx", "WAEW弱电线路"));
|
|
@@ -735,9 +748,9 @@ public class ImportFuncid {
|
|
|
funcids.addAll(readSheet("ACCCSCMT", "/附表9-部件类对象分类属性点表/附表9.3-空调专业部件.xlsx", "CCSCMT螺杆式冷水机组电机"));
|
|
|
funcids.addAll(readSheet("ACCCGHBP", "/附表9-部件类对象分类属性点表/附表9.3-空调专业部件.xlsx", "CCGHBP地埋管"));
|
|
|
funcids.addAll(readSheet("ACCCOTFN", "/附表9-部件类对象分类属性点表/附表9.3-空调专业部件.xlsx", "CCOTFN冷却塔风机"));
|
|
|
-// funcids.addAll(readSheet("WSSheet1", "/附表9-部件类对象分类属性点表/附表9.4-给排水专业部件.xlsx", "Sheet1"));
|
|
|
-// funcids.addAll(readSheet("FFSheet1", "/附表9-部件类对象分类属性点表/附表9.5-消防专业部件.xlsx", "Sheet1"));
|
|
|
-// funcids.addAll(readSheet("SPSheet1", "/附表9-部件类对象分类属性点表/附表9.6-安防专业部件.xlsx", "Sheet1"));
|
|
|
+ //funcids.addAll(readSheet("WSSheet1", "/附表9-部件类对象分类属性点表/附表9.4-给排水专业部件.xlsx", "Sheet1"));
|
|
|
+ //funcids.addAll(readSheet("FFSheet1", "/附表9-部件类对象分类属性点表/附表9.5-消防专业部件.xlsx", "Sheet1"));
|
|
|
+ //funcids.addAll(readSheet("SPSheet1", "/附表9-部件类对象分类属性点表/附表9.6-安防专业部件.xlsx", "Sheet1"));
|
|
|
funcids.addAll(readSheet("CFCSFDCS", "/附表9-部件类对象分类属性点表/附表9.7-土建精装专业部件.xlsx", "CSFDCS基础垫层"));
|
|
|
funcids.addAll(readSheet("CFCSFDWB", "/附表9-部件类对象分类属性点表/附表9.7-土建精装专业部件.xlsx", "CSFDWB基础防水板"));
|
|
|
funcids.addAll(readSheet("CFCSFDGD", "/附表9-部件类对象分类属性点表/附表9.7-土建精装专业部件.xlsx", "CSFDGD基础梁"));
|
|
@@ -759,6 +772,7 @@ public class ImportFuncid {
|
|
|
funcids.addAll(readSheet("CFBELRKL", "/附表9-部件类对象分类属性点表/附表9.7-土建精装专业部件.xlsx", "BELRKL采光顶龙骨"));
|
|
|
funcids.addAll(readSheet("CFBELRPN", "/附表9-部件类对象分类属性点表/附表9.7-土建精装专业部件.xlsx", "BELRPN采光顶嵌板"));
|
|
|
funcids.addAll(readSheet("CFBELRCP", "/附表9-部件类对象分类属性点表/附表9.7-土建精装专业部件.xlsx", "BELRCP采光顶组件"));
|
|
|
+ //funcids.addAll(readSheet("OTSheet1", "/附表9-部件类对象分类属性点表/附表9.8-其他专业部件.xlsx", "Sheet1"));
|
|
|
// funcids.addAll(readSheet("OTSheet1", "/附表9-部件类对象分类属性点表/附表9.8-其他专业部件.xlsx", "Sheet1"));
|
|
|
|
|
|
}
|
|
@@ -804,7 +818,6 @@ public class ImportFuncid {
|
|
|
if (sheet == null) {
|
|
|
return data;
|
|
|
}
|
|
|
-
|
|
|
// 行号从0开始, 从第2行开始读数据
|
|
|
int startRowNum = 2;
|
|
|
int lastRowNum = sheet.getLastRowNum();
|
|
@@ -828,14 +841,9 @@ public class ImportFuncid {
|
|
|
target.inputMode = (String) ExcelUtils.parseCell(row.getCell(7), "string");
|
|
|
target.origDataSource = (String) ExcelUtils.parseCell(row.getCell(8), "string");
|
|
|
target.remark = (String) ExcelUtils.parseCell(row.getCell(9), "string");
|
|
|
-
|
|
|
if (target.origCode == null || "".equals(target.origCode) || "`".equals(target.origCode)) {
|
|
|
continue;
|
|
|
}
|
|
|
- if (FuncidUtils.isBase(target.origCode)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
// firstTag不为空
|
|
|
if (target.firstTag != null) {
|
|
|
cache.firstTag = target.firstTag;
|
|
@@ -851,6 +859,10 @@ public class ImportFuncid {
|
|
|
target.secondTag = cache.secondTag;
|
|
|
}
|
|
|
FuncidDefModel funcidDefModel = toFuncidDefModel(target);
|
|
|
+
|
|
|
+ if (FuncidUtils.isBase(target.origCode)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if (funcidDefModel == null) {
|
|
|
log.info("file: {}, sheet: {}, row: {} data type [{}] error", fileName, sheetName, rowIndex, target.origDataType);
|
|
|
} else {
|