|
@@ -78,7 +78,6 @@ import org.springframework.transaction.TransactionStatus;
|
|
|
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
|
|
|
|
|
import java.io.*;
|
|
|
-import java.sql.SQLException;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
@@ -1211,112 +1210,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return R.fail(reason(e.getMessage()));
|
|
|
}
|
|
|
}
|
|
|
- //获取节点
|
|
|
- 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(wbsTreeContractByP);
|
|
|
-
|
|
|
- //huangjn 保存成功后调用生成资料查询列表数据
|
|
|
- this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
|
|
|
-
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("operationObjIds", Func.toStrList(pkids));
|
|
|
- json.put("operationObjName", wbsTreeContractByP.getNodeName() + "节点数据操作");
|
|
|
- json.put("saveData", saveData.toString());
|
|
|
- json.put("projectId", wbsTreeContract.getProjectId());
|
|
|
- json.put("contractId", wbsTreeContract.getContractId());
|
|
|
-
|
|
|
- //保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(1, "资料填报", "工序填报页面", json);
|
|
|
- // 更新redis
|
|
|
- informationQueryClient.AsyncWbsTree(wbsTreeContractByP.getParentId() + "", wbsTreeContractByP.getParentId() + "", wbsTreeContractByP.getContractId(), "", "1");
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- return R.fail("操作失败");
|
|
|
- }
|
|
|
- if (log.length() > 5) {
|
|
|
- return R.fail(reason(log.toString()));
|
|
|
- }
|
|
|
- }
|
|
|
- return R.success("操作成功");
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public R<Object> saveOrUpdateInfoResign(List<TableInfo> tableInfoList) throws SQLException {
|
|
|
- if (ListUtils.isNotEmpty(tableInfoList)) {
|
|
|
- //施工资料填报
|
|
|
- String pkids = "";
|
|
|
- StringBuilder log = new StringBuilder("异常:");
|
|
|
- StringBuilder saveData = new StringBuilder(tableInfoList.toString());
|
|
|
- try {
|
|
|
- for (TableInfo tableInfo : tableInfoList) {
|
|
|
- WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getPKeyId, tableInfo.getPkeyId()));
|
|
|
- if (wbsTreeContract == null) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- pkids += tableInfo.getPkeyId() + ",";
|
|
|
- String tabName = wbsTreeContract.getInitTableName();
|
|
|
- // 判读修改还是 添加
|
|
|
- String delSql = "delete from " + tabName + " where p_key_id=" + tableInfo.getPkeyId();
|
|
|
-
|
|
|
-
|
|
|
- String sqlInfo = "";
|
|
|
- LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
|
|
|
- /*检查发现有p_key_id缺失的情况,导致表单数据丢失,所以强制覆盖*/
|
|
|
- dataMap2.put("p_key_id", tableInfo.getPkeyId());
|
|
|
- //统计保存的字段
|
|
|
-
|
|
|
- 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 + ")";
|
|
|
-
|
|
|
- WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, tableInfo.getContractId()));
|
|
|
-
|
|
|
- if (wbsTreeContractByP != null) {
|
|
|
- //处理文件提名
|
|
|
- String fileName = this.wbsParamService.createFileTitle(wbsTreeContractByP);
|
|
|
-
|
|
|
- //huangjn 保存成功后调用生成资料查询列表数据
|
|
|
- this.informationQueryClient.saveOrUpdateInformationQueryDataReSign(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);
|
|
|
- BladeUser user = AuthUtil.getUser();
|
|
|
- TransactionStatus transactionStatus = this.beginTransaction(transactionManager1);
|
|
|
- try {
|
|
|
- //添加被张表的操作日志
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
- String sqlInfoNew = sqlInfo.replace("\"", "'");
|
|
|
- sb.append("insert into blade_tab_sql(p_key_id,user_id,create_time,sql_info) VALUES(");
|
|
|
- sb.append(tableInfo.getPkeyId());sb.append(",");sb.append(user.getUserId());
|
|
|
- sb.append(","); sb.append("SYSDATE()");sb.append(",\"");sb.append(sqlInfoNew);
|
|
|
- sb.append("\")");
|
|
|
- jdbcTemplate.execute(delSql);
|
|
|
- jdbcTemplate.execute(sqlInfo);
|
|
|
- jdbcTemplate.execute(sb.toString());
|
|
|
- transactionManager1.commit(transactionStatus);
|
|
|
- } catch (Exception e) {
|
|
|
- transactionManager1.rollback(transactionStatus);
|
|
|
- log.append(e.getMessage()).append("@@");
|
|
|
- e.printStackTrace();
|
|
|
- return R.fail(reason(e.getMessage()));
|
|
|
- }
|
|
|
- }
|
|
|
//获取节点
|
|
|
WbsTreeContract wbsTreeContract = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, tableInfoList.get(0).getPkeyId()));
|
|
|
|
|
@@ -1326,7 +1220,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
String fileName = this.wbsParamService.createFileTitle(wbsTreeContractByP);
|
|
|
|
|
|
//huangjn 保存成功后调用生成资料查询列表数据
|
|
|
- this.informationQueryClient.saveOrUpdateInformationQueryDataReSign(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
|
|
|
+ this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
|
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("operationObjIds", Func.toStrList(pkids));
|