|
@@ -190,6 +190,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
if (dataInfo2.containsKey("firstFileName")) {
|
|
|
tableInfo.setFirstFileName(dataInfo2.getString("firstFileName"));
|
|
|
}
|
|
|
+ //关联的信息
|
|
|
+ if(dataInfo2.containsKey("linkProcessList")){
|
|
|
+ tableInfo.setLinkProcessList(dataInfo2.getJSONArray("linkProcessList"));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -348,7 +352,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
/**
|
|
|
* 保存日志
|
|
|
*/
|
|
|
- private void saveOrUpdateTheLog(List<TableInfo> tableInfoList) {
|
|
|
+ public String saveOrUpdateTheLog(List<TableInfo> tableInfoList) {
|
|
|
//查询绑定的节点
|
|
|
WbsTreePrivate tableNode = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, tableInfoList.get(0).getPkeyId()));
|
|
|
WbsTreePrivate parentNode = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getProjectId, tableNode.getProjectId()).eq(WbsTreePrivate::getId, tableNode.getParentId()));
|
|
@@ -433,7 +437,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
//保存日志记录
|
|
|
- this.contractLogClient.saveContractLog(new SaveContractLogVO(
|
|
|
+ return this.contractLogClient.saveContractLog(new SaveContractLogVO(
|
|
|
Long.parseLong(businessId),
|
|
|
tableInfoList.get(0).getProjectId(),
|
|
|
tableInfoList.get(0).getContractId(),
|
|
@@ -443,10 +447,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
recordTime,
|
|
|
logWbsList
|
|
|
));
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- private void saveOrUpdateFirst(List<TableInfo> tableInfoList) {
|
|
|
+ /**
|
|
|
+ * 保存首件
|
|
|
+ */
|
|
|
+ public String saveOrUpdateFirst(List<TableInfo> tableInfoList) {
|
|
|
//获取首件绑定的节点
|
|
|
String firstNodeId = tableInfoList.get(0).getFirstNodeId();
|
|
|
//获取首件关联的施工记录
|
|
@@ -456,13 +462,15 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
//获取数据所在数据表名
|
|
|
- WbsTreeContract table = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, tableInfoList.get(0).getPkeyId()));
|
|
|
+ WbsTreeContract table = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery()
|
|
|
+ .eq(WbsTreeContract::getContractId, tableInfoList.get(0).getContractId())
|
|
|
+ .eq(WbsTreeContract::getTableType, 111));
|
|
|
if (table == null) {
|
|
|
- return;
|
|
|
+ return null;
|
|
|
}
|
|
|
String tableName = table.getInitTableName();
|
|
|
if (StringUtils.isEmpty(tableName)) {
|
|
|
- return;
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
//获取首件记录ID
|
|
@@ -506,88 +514,78 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
try {
|
|
|
//新增或修改首件记录
|
|
|
- this.informationQueryClient.saveOrUpdateInformationQueryData(firstNodeId, tableInfoList.get(0).getPkeyId() + "", firstId, "文件名称", Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "true", sourceUrl, pdfUrl, firstFileName, linkProcessList);
|
|
|
+ return this.informationQueryClient.saveOrUpdateInformationQueryData(firstNodeId, table.getPKeyId() + "", firstId, "文件名称", Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "true", sourceUrl, pdfUrl, firstFileName, linkProcessList);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void saveOrUpdateInfo(List<TableInfo> tableInfoList) {
|
|
|
if (ListUtils.isNotEmpty(tableInfoList)) {
|
|
|
- if (StringUtils.isNotEmpty(tableInfoList.get(0).getIsFirst())) {
|
|
|
- //首件填报
|
|
|
- this.saveOrUpdateFirst(tableInfoList);
|
|
|
-
|
|
|
- } else if (StringUtils.isNotEmpty(tableInfoList.get(0).getIsTheLog())) {
|
|
|
- //日志填报
|
|
|
- this.saveOrUpdateTheLog(tableInfoList);
|
|
|
-
|
|
|
- } else {
|
|
|
- //施工资料填报
|
|
|
- for (TableInfo tableInfo : tableInfoList) {
|
|
|
- WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getPKeyId, tableInfo.getPkeyId()));
|
|
|
- if (wbsTreeContract == null) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- String tabName = wbsTreeContract.getInitTableName();
|
|
|
-
|
|
|
- // 判读修改还是 添加
|
|
|
- String delSql = "delete from " + tabName + " where p_key_id=" + tableInfo.getPkeyId();
|
|
|
- jdbcTemplate.execute(delSql);
|
|
|
-
|
|
|
- String sqlInfo = "";
|
|
|
- LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
|
|
|
- sqlInfo = "INSERT INTO " + tabName + " ( ";
|
|
|
- String keyStr = "id,";
|
|
|
- String valStr = SnowFlakeUtil.getId() + ",";
|
|
|
- for (String keys : dataMap2.keySet()) {
|
|
|
- keyStr += keys + ",";
|
|
|
- valStr += "'" + dataMap2.get(keys) + "',";
|
|
|
- }
|
|
|
- keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
|
|
|
- valStr = valStr.substring(0, valStr.lastIndexOf(","));
|
|
|
- sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
|
|
|
+ //施工资料填报
|
|
|
+ for (TableInfo tableInfo : tableInfoList) {
|
|
|
+ WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
+ .eq(WbsTreeContract::getPKeyId, tableInfo.getPkeyId()));
|
|
|
+ if (wbsTreeContract == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, tableInfo.getContractId()));
|
|
|
+ String tabName = wbsTreeContract.getInitTableName();
|
|
|
|
|
|
- if (wbsTreeContractByP != null) {
|
|
|
- //处理文件提名
|
|
|
- String fileName = this.wbsParamService.createFileTitle(Func.isNotEmpty(wbsTreeContractByP.getOldId()) ? Long.valueOf(wbsTreeContractByP.getOldId()) : wbsTreeContractByP.getId(), Long.parseLong(wbsTreeContractByP.getContractId()), wbsTreeContractByP);
|
|
|
- fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
|
|
|
+ // 判读修改还是 添加
|
|
|
+ String delSql = "delete from " + tabName + " where p_key_id=" + tableInfo.getPkeyId();
|
|
|
+ jdbcTemplate.execute(delSql);
|
|
|
|
|
|
- //huangjn 保存成功后调用生成资料查询列表数据
|
|
|
- this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfo.getClassify()), 2, "是否是首件(临时,暂时没用到)", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
|
|
|
- }
|
|
|
-
|
|
|
- UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
|
|
|
- updateWrapper.in("p_key_id", tableInfo.getPkeyId());
|
|
|
- updateWrapper.set("is_tab_pdf", 2);
|
|
|
- wbsTreeContractService.update(updateWrapper);
|
|
|
- jdbcTemplate.execute(sqlInfo);
|
|
|
- // pdf 预览添加
|
|
|
- //this.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
|
|
|
+ String sqlInfo = "";
|
|
|
+ LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
|
|
|
+ sqlInfo = "INSERT INTO " + tabName + " ( ";
|
|
|
+ String keyStr = "id,";
|
|
|
+ String valStr = SnowFlakeUtil.getId() + ",";
|
|
|
+ for (String keys : dataMap2.keySet()) {
|
|
|
+ keyStr += keys + ",";
|
|
|
+ valStr += "'" + dataMap2.get(keys) + "',";
|
|
|
}
|
|
|
+ keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
|
|
|
+ valStr = valStr.substring(0, valStr.lastIndexOf(","));
|
|
|
+ sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
|
|
|
|
|
|
- try {
|
|
|
- //获取节点
|
|
|
- WbsTreeContract wbsTreeContract = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, tableInfoList.get(0).getPkeyId()));
|
|
|
+ WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
+ .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, tableInfo.getContractId()));
|
|
|
|
|
|
- WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
|
|
|
+ if (wbsTreeContractByP != null) {
|
|
|
//处理文件提名
|
|
|
String fileName = this.wbsParamService.createFileTitle(Func.isNotEmpty(wbsTreeContractByP.getOldId()) ? Long.valueOf(wbsTreeContractByP.getOldId()) : wbsTreeContractByP.getId(), Long.parseLong(wbsTreeContractByP.getContractId()), wbsTreeContractByP);
|
|
|
fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
|
|
|
|
|
|
//huangjn 保存成功后调用生成资料查询列表数据
|
|
|
- this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfo.getClassify()), 2, "是否是首件(临时,暂时没用到)", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
|
|
|
}
|
|
|
+
|
|
|
+ UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.in("p_key_id", tableInfo.getPkeyId());
|
|
|
+ updateWrapper.set("is_tab_pdf", 2);
|
|
|
+ wbsTreeContractService.update(updateWrapper);
|
|
|
+ jdbcTemplate.execute(sqlInfo);
|
|
|
+ // pdf 预览添加
|
|
|
+ //this.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ //获取节点
|
|
|
+ WbsTreeContract wbsTreeContract = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, tableInfoList.get(0).getPkeyId()));
|
|
|
+
|
|
|
+ WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
+ .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
|
|
|
+ //处理文件提名
|
|
|
+ String fileName = this.wbsParamService.createFileTitle(Func.isNotEmpty(wbsTreeContractByP.getOldId()) ? Long.valueOf(wbsTreeContractByP.getOldId()) : wbsTreeContractByP.getId(), Long.parseLong(wbsTreeContractByP.getContractId()), wbsTreeContractByP);
|
|
|
+ fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
|
|
|
+
|
|
|
+ //huangjn 保存成功后调用生成资料查询列表数据
|
|
|
+ this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
}
|