|
@@ -18,6 +18,7 @@ package org.springblade.manager.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.StopWatch;
|
|
import cn.hutool.core.date.StopWatch;
|
|
|
import cn.hutool.log.StaticLog;
|
|
import cn.hutool.log.StaticLog;
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -71,6 +72,7 @@ import org.springblade.manager.vo.*;
|
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springblade.system.cache.ParamCache;
|
|
import org.springblade.system.cache.ParamCache;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
|
@@ -122,6 +124,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
private final TrialSelfInspectionRecordClient inspectionRecordClient;
|
|
private final TrialSelfInspectionRecordClient inspectionRecordClient;
|
|
|
private final TableInfoServiceImpl tableInfoService;
|
|
private final TableInfoServiceImpl tableInfoService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ StringRedisTemplate RedisTemplate;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public IPage<ExcelTabVO> selectExcelTabPage(IPage<ExcelTabVO> page, ExcelTabVO excelTab) {
|
|
public IPage<ExcelTabVO> selectExcelTabPage(IPage<ExcelTabVO> page, ExcelTabVO excelTab) {
|
|
|
return page.setRecords(baseMapper.selectExcelTabPage(page, excelTab));
|
|
return page.setRecords(baseMapper.selectExcelTabPage(page, excelTab));
|
|
@@ -336,7 +341,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
/*每次都是部分表单提交,保证跨节点跨表取数正常,其次是反向依赖的被动刷新*/
|
|
/*每次都是部分表单提交,保证跨节点跨表取数正常,其次是反向依赖的被动刷新*/
|
|
|
List<AppWbsTreeContractVO> tableAll = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId());
|
|
List<AppWbsTreeContractVO> tableAll = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId());
|
|
|
StopWatch stopWatch = new StopWatch();
|
|
StopWatch stopWatch = new StopWatch();
|
|
|
- List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(tableInfoList.stream().map(TableInfo::getPkeyId).filter(Func::isNotEmpty).map(Long::parseLong).collect(Collectors.toList()), tableInfoList.get(0).getProjectId(),String.valueOf(nodeId));
|
|
|
|
|
|
|
+ List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(tableInfoList.stream().map(TableInfo::getPkeyId).filter(Func::isNotEmpty).map(Long::parseLong).collect(Collectors.toList()), tableInfoList.get(0).getProjectId(), String.valueOf(nodeId));
|
|
|
if (Func.isNotEmpty(keyMappers)) {
|
|
if (Func.isNotEmpty(keyMappers)) {
|
|
|
Map<String, Map<String, String>> coordinateMap = new HashMap<>(keyMappers.size() * 2);
|
|
Map<String, Map<String, String>> coordinateMap = new HashMap<>(keyMappers.size() * 2);
|
|
|
keyMappers.forEach(e -> {
|
|
keyMappers.forEach(e -> {
|
|
@@ -390,7 +395,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
} else {
|
|
} else {
|
|
|
currentNode.setRelateId(wtc.getId());
|
|
currentNode.setRelateId(wtc.getId());
|
|
|
}
|
|
}
|
|
|
- List<Long> privateIds = this.jdbcTemplate.queryForList("select p_key_id from m_wbs_tree_private where id=" + id + " and project_id=" + wtc.getProjectId()+" and wbs_id="+wtc.getWbsId(), Long.class);
|
|
|
|
|
|
|
+ List<Long> privateIds = this.jdbcTemplate.queryForList("select p_key_id from m_wbs_tree_private where id=" + id + " and project_id=" + wtc.getProjectId() + " and wbs_id=" + wtc.getWbsId(), Long.class);
|
|
|
if (Func.isNotEmpty(privateIds)) {
|
|
if (Func.isNotEmpty(privateIds)) {
|
|
|
currentNode.setPrivateId(privateIds.get(0));
|
|
currentNode.setPrivateId(privateIds.get(0));
|
|
|
return currentNode;
|
|
return currentNode;
|
|
@@ -789,6 +794,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
|
|
//保存操作记录
|
|
//保存操作记录
|
|
|
this.operationLogClient.saveUserOperationLog(1, "资料填报", "工序填报页面", json);
|
|
this.operationLogClient.saveUserOperationLog(1, "资料填报", "工序填报页面", json);
|
|
|
|
|
+ // 更新redis
|
|
|
|
|
+ informationQueryClient.AsyncWbsTree(wbsTreeContract.getParentId()+"",wbsTreeContract.getParentId()+"",wbsTreeContract.getContractId(),"","1");
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
return R.fail("操作失败");
|
|
return R.fail("操作失败");
|
|
@@ -857,7 +864,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public R getBussDataInfo(Long pkeyId,int type) {
|
|
|
|
|
|
|
+ public R getBussDataInfo(Long pkeyId, int type) {
|
|
|
|
|
|
|
|
Map<String, Object> reData = new HashMap<>();
|
|
Map<String, Object> reData = new HashMap<>();
|
|
|
|
|
|
|
@@ -1059,7 +1066,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 移除Id 和 p_key_id
|
|
// 移除Id 和 p_key_id
|
|
|
- if(type==0){
|
|
|
|
|
|
|
+ if (type == 0) {
|
|
|
reData.remove("id");
|
|
reData.remove("id");
|
|
|
reData.remove("p_key_id");
|
|
reData.remove("p_key_id");
|
|
|
reData.remove("classify");
|
|
reData.remove("classify");
|
|
@@ -1067,8 +1074,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
reData.remove("pkeyId");
|
|
reData.remove("pkeyId");
|
|
|
reData.remove("projectId");
|
|
reData.remove("projectId");
|
|
|
}
|
|
}
|
|
|
- if(type==1){
|
|
|
|
|
- reData.put("pkeyId",reData.get("p_key_id"));
|
|
|
|
|
|
|
+ if (type == 1) {
|
|
|
|
|
+ reData.put("pkeyId", reData.get("p_key_id"));
|
|
|
}
|
|
}
|
|
|
reData.put("tabGroupId", wbsTreeContract.getTabGroupId());
|
|
reData.put("tabGroupId", wbsTreeContract.getTabGroupId());
|
|
|
return R.data(reData);
|
|
return R.data(reData);
|
|
@@ -1102,7 +1109,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return R.fail("失败");
|
|
return R.fail("失败");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Map<String, Object> DataInfo = (Map<String, Object>) getBussDataInfo(pkeyId,0).getData();
|
|
|
|
|
|
|
+ Map<String, Object> DataInfo = (Map<String, Object>) getBussDataInfo(pkeyId, 0).getData();
|
|
|
|
|
|
|
|
// 获取excel流 和 html流
|
|
// 获取excel流 和 html流
|
|
|
InputStream exceInp = CommonUtil.getOSSInputStream(excelTab.getFileUrl());
|
|
InputStream exceInp = CommonUtil.getOSSInputStream(excelTab.getFileUrl());
|
|
@@ -1286,7 +1293,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
Elements tdsx = ytzData.select("td");
|
|
Elements tdsx = ytzData.select("td");
|
|
|
if (Integer.parseInt(trtd[1]) < tdsx.size()) {
|
|
if (Integer.parseInt(trtd[1]) < tdsx.size()) {
|
|
|
Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
|
|
Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
|
|
|
- if(data.html().indexOf("el-tooltip") >= 0){
|
|
|
|
|
|
|
+ if (data.html().indexOf("el-tooltip") >= 0) {
|
|
|
data = data.children().get(0);
|
|
data = data.children().get(0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1517,7 +1524,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
* 试验 获取填报信息
|
|
* 试验 获取填报信息
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public List<Map<String, Object>> getBussDataInfoTrial(Long groupId, Long pkeyId) {
|
|
|
|
|
|
|
+ public List<Map<String, Object>> getBussDataInfoTrial(Long groupId, Long pkeyId, Long contractId) {
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
Map<String, Object> reData = new HashMap<>();
|
|
Map<String, Object> reData = new HashMap<>();
|
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
|
|
@@ -1550,6 +1557,54 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
//匹配
|
|
//匹配
|
|
|
Elements bgHB = doc.select("el-input[placeholder~=报告编号.*]");
|
|
Elements bgHB = doc.select("el-input[placeholder~=报告编号.*]");
|
|
|
Elements jlBH = doc.select("el-input[placeholder~=记录编号.*]");
|
|
Elements jlBH = doc.select("el-input[placeholder~=记录编号.*]");
|
|
|
|
|
+ Elements gcName = doc.select("el-input[placeholder~=工程名称.*]");
|
|
|
|
|
+ Elements sgName = doc.select("el-input[placeholder~=施工单位.*]");
|
|
|
|
|
+ Elements wtName = doc.select("el-input[placeholder~=委托单位.*]");
|
|
|
|
|
+ Elements htdName = doc.select("el-input[placeholder~=合同段/工区.*]");
|
|
|
|
|
+
|
|
|
|
|
+ ContractInfo contractInfo = jdbcTemplate.query("select construction_unit_name,supervision_unit_name,contract_name from m_contract_info where id = " + contractId, new BeanPropertyRowMapper<>(ContractInfo.class)).stream().findAny().orElse(null);
|
|
|
|
|
+ if (contractInfo != null) {
|
|
|
|
|
+ //施工单位
|
|
|
|
|
+ if (sgName.size() >= 1) {
|
|
|
|
|
+ for (Element element : sgName) {
|
|
|
|
|
+ int trIndex = Integer.parseInt(element.attr("trindex"));
|
|
|
|
|
+ if (trIndex <= 6) {
|
|
|
|
|
+ reData.put(element.attr("keyName"), ObjectUtils.isNotEmpty(contractInfo.getConstructionUnitName()) ? contractInfo.getConstructionUnitName() : "");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //委托单位
|
|
|
|
|
+ if (wtName.size() >= 1) {
|
|
|
|
|
+ for (Element element : wtName) {
|
|
|
|
|
+ int trIndex = Integer.parseInt(element.attr("trindex"));
|
|
|
|
|
+ if (trIndex <= 6) {
|
|
|
|
|
+ reData.put(element.attr("keyName"), ObjectUtils.isNotEmpty(contractInfo.getSupervisionUnitName()) ? contractInfo.getSupervisionUnitName() : "");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //合同段/工区
|
|
|
|
|
+ if (htdName.size() >= 1) {
|
|
|
|
|
+ for (Element element : htdName) {
|
|
|
|
|
+ int trIndex = Integer.parseInt(element.attr("trindex"));
|
|
|
|
|
+ if (trIndex <= 6) {
|
|
|
|
|
+ reData.put(element.attr("keyName"), ObjectUtils.isNotEmpty(contractInfo.getContractName()) ? contractInfo.getContractName() : "");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ProjectInfo projectInfo = jdbcTemplate.query("select project_name from m_project_info where id = " + wbsTreePrivate.getProjectId(), new BeanPropertyRowMapper<>(ProjectInfo.class)).stream().findAny().orElse(null);
|
|
|
|
|
+ if (projectInfo != null) {
|
|
|
|
|
+ //工程名称
|
|
|
|
|
+ if (gcName.size() >= 1) {
|
|
|
|
|
+ for (Element element : gcName) {
|
|
|
|
|
+ int trIndex = Integer.parseInt(element.attr("trindex"));
|
|
|
|
|
+ if (trIndex <= 6) {
|
|
|
|
|
+ reData.put(element.attr("keyName"), ObjectUtils.isNotEmpty(projectInfo.getProjectName()) ? projectInfo.getProjectName() : "");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
TrialSelfInspectionRecord record = jdbcTemplate.query("select record_no,report_no from u_trial_self_inspection_record where id = " + groupId, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class)).stream().findAny().orElse(null);
|
|
TrialSelfInspectionRecord record = jdbcTemplate.query("select record_no,report_no from u_trial_self_inspection_record where id = " + groupId, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class)).stream().findAny().orElse(null);
|
|
|
if (record != null) {
|
|
if (record != null) {
|
|
@@ -1847,7 +1902,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取数据信息info
|
|
//获取数据信息info
|
|
|
- List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(id, pkeyId);
|
|
|
|
|
|
|
+ List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(id, pkeyId, Long.parseLong(contractId));
|
|
|
Map<String, Object> DataInfo = bussDataInfoTrial.stream().findAny().orElse(null);
|
|
Map<String, Object> DataInfo = bussDataInfoTrial.stream().findAny().orElse(null);
|
|
|
|
|
|
|
|
//获取excel流 和 html流
|
|
//获取excel流 和 html流
|