离线端数据包,文件解析
This commit is contained in:
parent
7ed94f0c7d
commit
5a86d4a00b
|
|
@ -40,9 +40,9 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
private static String UNZIP_PWD = "zizhi102!";
|
private static String UNZIP_PWD = "zizhi102!";
|
||||||
private static int UPLOAD_CATALOGUE = 122;
|
private static int UPLOAD_CATALOGUE = 122;
|
||||||
|
|
||||||
private static String CONFIG_TABLE_NAME = "uf_bmj_sjjxpz";
|
private static String CONFIG_TABLE_NAME = "uf_config_package";
|
||||||
private static String CONFIG_DETAIL_TABLE_NAME = "uf_bmj_sjjxpz_dt1";
|
private static String CONFIG_DETAIL_TABLE_NAME = "uf_config_package_dt1";
|
||||||
private static String FILE_DETAIL_TABLE_NAME = "uf_bmj_sjjxpz_dt2";
|
private static String FILE_DETAIL_TABLE_NAME = "uf_config_package_dt2";
|
||||||
|
|
||||||
BaseBean baseBean = new BaseBean();
|
BaseBean baseBean = new BaseBean();
|
||||||
|
|
||||||
|
|
@ -143,15 +143,16 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e.getMessage().contains("Wrong password")) {
|
if (e.getMessage().contains("Wrong password")) {
|
||||||
System.err.println("密码错误");
|
throw new CustomizeRunTimeException("数据包解压失败,密码错误");
|
||||||
} else {
|
} else {
|
||||||
e.printStackTrace();
|
baseBean.writeLog(e);
|
||||||
|
throw new CustomizeRunTimeException(e);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
Files.deleteIfExists(zipFilePath);
|
Files.deleteIfExists(zipFilePath);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
baseBean.writeLog(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -205,8 +206,7 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dealDetailData(rootNode, billId, childDataConfigList);
|
dealDetailData(rootNode, billId, childDataConfigList);
|
||||||
// TODO 更新文件信息
|
dealFileList(billId, fileList, mainTableName, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
JsonNode jsonNode = rootNode.at(rootPath);
|
JsonNode jsonNode = rootNode.at(rootPath);
|
||||||
|
|
@ -215,7 +215,7 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dealDetailData(rootNode, billId, childDataConfigList);
|
dealDetailData(rootNode, billId, childDataConfigList);
|
||||||
// TODO 更新文件信息
|
dealFileList(billId, fileList, mainTableName, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int billId = insertMainTable(rootNode, mainTableName, fieldDetailList);
|
int billId = insertMainTable(rootNode, mainTableName, fieldDetailList);
|
||||||
|
|
@ -223,7 +223,6 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dealDetailData(rootNode, billId, childDataConfigList);
|
dealDetailData(rootNode, billId, childDataConfigList);
|
||||||
// TODO 更新文件信息
|
|
||||||
dealFileList(billId, fileList, mainTableName, false);
|
dealFileList(billId, fileList, mainTableName, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -316,13 +315,12 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
int formModeId = ModeUtil.getModeIdByTableName(mainTableName);
|
int formModeId = ModeUtil.getModeIdByTableName(mainTableName);
|
||||||
insertMap.put("formmodeid", formModeId);
|
insertMap.put("formmodeid", formModeId);
|
||||||
// 构建主表数据插入基本字段
|
// 构建主表数据插入基本字段
|
||||||
// TODO ModeUtil.buildModeInsertFields(insertMap, user.getUID());
|
ModeUtil.buildModeInsertFields(insertMap, user.getUID());
|
||||||
// 插入数据
|
|
||||||
// TODO ModeUtil.insertData(insertMap, mainTableName);
|
|
||||||
// 数据权限重构,返回数据ID
|
|
||||||
// TODO return ModeUtil.refreshRight(uuid, mainTableName, formModeId, user.getUID());
|
|
||||||
baseBean.writeLog("insertMainTable: " + JSON.toJSONString(insertMap));
|
baseBean.writeLog("insertMainTable: " + JSON.toJSONString(insertMap));
|
||||||
return 1;
|
// 插入数据
|
||||||
|
ModeUtil.insertData(insertMap, mainTableName);
|
||||||
|
// 数据权限重构,返回数据ID
|
||||||
|
return ModeUtil.refreshRight(uuid, mainTableName, formModeId, user.getUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -359,7 +357,7 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
insertMap.put("mainId", mainId);
|
insertMap.put("mainId", mainId);
|
||||||
baseBean.writeLog("insertDetailTable: " + JSON.toJSONString(insertMap));
|
baseBean.writeLog("insertDetailTable: " + JSON.toJSONString(insertMap));
|
||||||
// 插入数据
|
// 插入数据
|
||||||
// TODO ModeUtil.insertData(insertMap, detailTableName);
|
ModeUtil.insertData(insertMap, detailTableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -419,11 +417,11 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
// 根据主表、明细表,区分数据处理方式
|
// 根据主表、明细表,区分数据处理方式
|
||||||
if (isDetail) {
|
if (isDetail) {
|
||||||
dataMap.put("mainid", mainId);
|
dataMap.put("mainid", mainId);
|
||||||
//TODO ModeUtil.insertData(dataMap,tableName);
|
ModeUtil.insertData(dataMap,tableName);
|
||||||
} else {
|
} else {
|
||||||
dataMap.put("id", mainId);
|
dataMap.put("id", mainId);
|
||||||
// 根据ID更新主表数据
|
// 根据ID更新主表数据
|
||||||
// TODO ModeUtil.updateDataById(dataMap, tableName);
|
ModeUtil.updateDataById(dataMap, tableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -440,14 +438,13 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
// 获取离线包的先关配置
|
// 获取离线包的先关配置
|
||||||
List<DataConfig> dataConfigList = new ArrayList<>();
|
List<DataConfig> dataConfigList = new ArrayList<>();
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
// TODO 表名,字段名待确定
|
rs.executeQuery("select * from " + CONFIG_TABLE_NAME + " where main_table is not null and main_table !='' and source_type = ?", type);
|
||||||
rs.executeQuery("select * from " + CONFIG_TABLE_NAME + " where xrbbm is not null and xrbbm !='' and sjbly = ?", type);
|
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
DataConfig dataConfig = new DataConfig();
|
DataConfig dataConfig = new DataConfig();
|
||||||
dataConfig.setId(rs.getString("id"));
|
dataConfig.setId(rs.getString("id"));
|
||||||
dataConfig.setMainTableName(rs.getString("xrbbm"));
|
dataConfig.setMainTableName(rs.getString("main_table"));
|
||||||
dataConfig.setDetailTableName(rs.getString("xrbmxb"));
|
dataConfig.setDetailTableName(rs.getString("detail_tables"));
|
||||||
dataConfig.setRootPath(rs.getString("gjd"));
|
dataConfig.setRootPath(rs.getString("root_path"));
|
||||||
// 获取字段对照关系数据
|
// 获取字段对照关系数据
|
||||||
List<DataConfigDetail> detailList = getDetailList(dataConfig.getId());
|
List<DataConfigDetail> detailList = getDetailList(dataConfig.getId());
|
||||||
dataConfig.setDetailList(detailList);
|
dataConfig.setDetailList(detailList);
|
||||||
|
|
@ -477,14 +474,12 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
|
|
||||||
for (String dtName : detailNameArray) {
|
for (String dtName : detailNameArray) {
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
// TODO 表名,字段名待确定
|
rs.executeQuery("select * from " + CONFIG_TABLE_NAME + " where (main_table is null or main_table ='') and detail_tables = ? and source_type = ?", dtName, type);
|
||||||
rs.executeQuery("select * from " + CONFIG_TABLE_NAME + " where (xrbbm is null or xrbbm ='') and xrbmxb = ? and sjbly = ?", dtName, type);
|
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
DataConfig dataConfig = new DataConfig();
|
DataConfig dataConfig = new DataConfig();
|
||||||
dataConfig.setId(rs.getString("id"));
|
dataConfig.setId(rs.getString("id"));
|
||||||
dataConfig.setMainTableName(rs.getString("xrbbm"));
|
dataConfig.setDetailTableName(rs.getString("detail_tables"));
|
||||||
dataConfig.setDetailTableName(rs.getString("xrbmxb"));
|
dataConfig.setRootPath(rs.getString("root_path"));
|
||||||
dataConfig.setRootPath(rs.getString("gjd"));
|
|
||||||
// 获取字段对照关系数据
|
// 获取字段对照关系数据
|
||||||
List<DataConfigDetail> detailList = getDetailList(dataConfig.getId());
|
List<DataConfigDetail> detailList = getDetailList(dataConfig.getId());
|
||||||
dataConfig.setDetailList(detailList);
|
dataConfig.setDetailList(detailList);
|
||||||
|
|
@ -507,8 +502,7 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
rs.executeQuery("select * from " + CONFIG_DETAIL_TABLE_NAME + " where mainId = ?", mainId);
|
rs.executeQuery("select * from " + CONFIG_DETAIL_TABLE_NAME + " where mainId = ?", mainId);
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
// TODO 表名,字段名待确定
|
detailList.add(DataConfigDetail.builder().fieldName(rs.getString("field_name")).path(rs.getString("config_path")).condition(rs.getString("conditions")).build());
|
||||||
detailList.add(DataConfigDetail.builder().fieldName(rs.getString("zdm")).path(rs.getString("wjbs")).condition(rs.getString("tj")).build());
|
|
||||||
}
|
}
|
||||||
return detailList;
|
return detailList;
|
||||||
}
|
}
|
||||||
|
|
@ -524,8 +518,7 @@ public class QualificationApplicationServiceImpl extends Service implements Qual
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
rs.executeQuery("select * from " + FILE_DETAIL_TABLE_NAME + " where mainId = ?", mainId);
|
rs.executeQuery("select * from " + FILE_DETAIL_TABLE_NAME + " where mainId = ?", mainId);
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
// TODO 表名,字段名待确定
|
fileList.add(FileConfig.builder().fieldName(rs.getString("field_name")).fileId(rs.getString("file_id")).isFilled(rs.getString("file_type")).build());
|
||||||
fileList.add(FileConfig.builder().fieldName(rs.getString("zdm")).fileId(rs.getString("wjbs")).isFilled(rs.getString("bzwj")).build());
|
|
||||||
}
|
}
|
||||||
return fileList;
|
return fileList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue