|
@@ -390,7 +390,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
currentNode.setPkId(wtc.getPKeyId());
|
|
|
currentNode.setParentId(wtc.getParentId());
|
|
|
currentNode.setWbsId(Long.parseLong(wtc.getWbsId()));
|
|
|
- currentNode.setId(StringUtils.isNotEmpty(wtc.getOldId())? Long.valueOf(wtc.getOldId()) :wtc.getId());
|
|
|
+ currentNode.setId(StringUtils.isNotEmpty(wtc.getOldId()) ? Long.valueOf(wtc.getOldId()) : wtc.getId());
|
|
|
currentNode.setRelateId(wtc.getId());
|
|
|
List<Long> privateIds = this.jdbcTemplate.queryForList("select p_key_id from m_wbs_tree_private where id=" + currentNode.getRelateId() + " and project_id=" + wtc.getProjectId() + " and wbs_id=" + wtc.getWbsId(), Long.class);
|
|
|
if (Func.isNotEmpty(privateIds)) {
|
|
@@ -574,39 +574,39 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
.eq(WbsTreeContract::getIsDeleted, 0));
|
|
|
|
|
|
// 数据维数据
|
|
|
- Map<String , List<WbsTreeContract> > Data = new HashMap<>();
|
|
|
- if(wbsTreeContractList!=null && wbsTreeContractList.size()>=1){
|
|
|
- for(WbsTreeContract dataInfo : wbsTreeContractList){
|
|
|
- String dataId = dataInfo.getId()+"";
|
|
|
- String parentId = dataInfo.getParentId()+"";
|
|
|
+ Map<String, List<WbsTreeContract>> Data = new HashMap<>();
|
|
|
+ if (wbsTreeContractList != null && wbsTreeContractList.size() >= 1) {
|
|
|
+ for (WbsTreeContract dataInfo : wbsTreeContractList) {
|
|
|
+ String dataId = dataInfo.getId() + "";
|
|
|
+ String parentId = dataInfo.getParentId() + "";
|
|
|
|
|
|
- if(!Data.containsKey(dataId)){
|
|
|
+ if (!Data.containsKey(dataId)) {
|
|
|
List<WbsTreeContract> newData = new ArrayList<>();
|
|
|
- Data.put(dataId,newData);
|
|
|
+ Data.put(dataId, newData);
|
|
|
}
|
|
|
// 添加数据
|
|
|
- if(Data.containsKey(parentId)){
|
|
|
+ if (Data.containsKey(parentId)) {
|
|
|
List<WbsTreeContract> newData = Data.get(parentId);
|
|
|
newData.add(dataInfo);
|
|
|
- Data.put(parentId,newData);
|
|
|
+ Data.put(parentId, newData);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//
|
|
|
- Map<Long,String> lastList = new HashMap<>();
|
|
|
+ Map<Long, String> lastList = new HashMap<>();
|
|
|
List<WbsTreeContract> collect = wbsTreeContractList.stream().filter(wbsTreeContract -> "0".equals(wbsTreeContract.getParentId().toString())).collect(Collectors.toList());
|
|
|
|
|
|
- this.dataInfo(collect,lastList,Data);
|
|
|
+ this.dataInfo(collect, lastList, Data);
|
|
|
|
|
|
- if(lastList!=null && lastList.size()>=1){
|
|
|
+ if (lastList != null && lastList.size() >= 1) {
|
|
|
int index = 0;
|
|
|
- StringBuffer sb =new StringBuffer();
|
|
|
- for(Long data : lastList.keySet()){
|
|
|
- sb.append(" update m_wbs_tree_contract set ancestors='"+lastList.get(data)+"' where p_key_id="+data+";");
|
|
|
- index = index+1;
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (Long data : lastList.keySet()) {
|
|
|
+ sb.append(" update m_wbs_tree_contract set ancestors='" + lastList.get(data) + "' where p_key_id=" + data + ";");
|
|
|
+ index = index + 1;
|
|
|
System.out.println(index);
|
|
|
- if(index>=1000){
|
|
|
+ if (index >= 1000) {
|
|
|
jdbcTemplate.execute(sb.toString());
|
|
|
sb = new StringBuffer();
|
|
|
}
|
|
@@ -616,25 +616,25 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void dataInfo(List<WbsTreeContract> collect,Map<Long ,String > lastList,Map<String , List<WbsTreeContract> > Data){
|
|
|
+ public void dataInfo(List<WbsTreeContract> collect, Map<Long, String> lastList, Map<String, List<WbsTreeContract>> Data) {
|
|
|
|
|
|
Queue<WbsTreeContract> queue = new LinkedList<>();
|
|
|
//将第一层级的目录全部入列
|
|
|
collect.forEach(queue::offer);
|
|
|
while (!queue.isEmpty()) {
|
|
|
//每次循环出列一个对象 一直到队列为空
|
|
|
- WbsTreeContract tree= queue.poll();
|
|
|
- String dataId = tree.getId()+"";
|
|
|
+ WbsTreeContract tree = queue.poll();
|
|
|
+ String dataId = tree.getId() + "";
|
|
|
List<WbsTreeContract> er = Data.get(dataId);
|
|
|
- if(er!=null && er.size()>=1){
|
|
|
- for(WbsTreeContract erData : er){
|
|
|
- String Ancestors="";
|
|
|
- if(lastList.containsKey(tree.getPKeyId())){
|
|
|
+ if (er != null && er.size() >= 1) {
|
|
|
+ for (WbsTreeContract erData : er) {
|
|
|
+ String Ancestors = "";
|
|
|
+ if (lastList.containsKey(tree.getPKeyId())) {
|
|
|
Ancestors = lastList.get(tree.getPKeyId());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
Ancestors = tree.getAncestors();
|
|
|
}
|
|
|
- lastList.put(erData.getPKeyId(),Ancestors+","+erData.getParentId());
|
|
|
+ lastList.put(erData.getPKeyId(), Ancestors + "," + erData.getParentId());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -646,7 +646,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 保存首件
|
|
|
*/
|
|
@@ -1169,7 +1168,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
@Override
|
|
|
public R getBussPdfInfo(Long pkeyId) throws Exception {
|
|
|
- //String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
+ // String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
String file_path = "/Users/hongchuangyanfa/Desktop/";
|
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
@@ -1653,62 +1652,50 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
//施工单位
|
|
|
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() : "");
|
|
|
- }
|
|
|
+ reData.put(element.attr("keyname"), ObjectUtils.isNotEmpty(contractInfo.getConstructionUnitName()) ? contractInfo.getConstructionUnitName() : "");
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
//委托单位
|
|
|
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() : "");
|
|
|
- }
|
|
|
+ reData.put(element.attr("keyname"), ObjectUtils.isNotEmpty(contractInfo.getSupervisionUnitName()) ? contractInfo.getSupervisionUnitName() : "");
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
//合同段/工区
|
|
|
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() : "");
|
|
|
- }
|
|
|
+ reData.put(element.attr("keyname"), ObjectUtils.isNotEmpty(contractInfo.getContractName()) ? contractInfo.getContractName() : "");
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- 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() : "");
|
|
|
+ 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) {
|
|
|
+ reData.put(element.attr("keyname"), ObjectUtils.isNotEmpty(projectInfo.getProjectName()) ? projectInfo.getProjectName() : "");
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- 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 (bgHB.size() >= 1) {
|
|
|
- for (Element element : bgHB) {
|
|
|
- int trIndex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trIndex <= 6) {
|
|
|
- reData.put(element.attr("keyName"), ObjectUtils.isNotEmpty(record.getReportNo()) ? record.getReportNo() : "");
|
|
|
+ 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 (bgHB.size() >= 1) {
|
|
|
+ for (Element element : bgHB) {
|
|
|
+ reData.put(element.attr("keyname"), ObjectUtils.isNotEmpty(record.getReportNo()) ? record.getReportNo() : "");
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- //记录编号
|
|
|
- if (jlBH.size() >= 1) {
|
|
|
- for (Element element : jlBH) {
|
|
|
- int trIndex = Integer.parseInt(element.attr("trindex"));
|
|
|
- if (trIndex <= 6) {
|
|
|
- reData.put(element.attr("keyName"), ObjectUtils.isNotEmpty(record.getRecordNo()) ? record.getRecordNo() : "");
|
|
|
+ //记录编号
|
|
|
+ if (jlBH.size() >= 1) {
|
|
|
+ for (Element element : jlBH) {
|
|
|
+ reData.put(element.attr("keyname"), ObjectUtils.isNotEmpty(record.getRecordNo()) ? record.getRecordNo() : "");
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1806,6 +1793,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 试验 获取填报信息 - 施工关联试验数据
|
|
|
*/
|
|
@@ -1962,7 +1950,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
* 试验 单pdf
|
|
|
*/
|
|
|
@Override
|
|
|
- public String getBussPDFTrial(Long pkeyId, String contractId, Long id, int pageNumber, int pageNumberCount) throws Exception {
|
|
|
+ public String getBussPDFTrial(Long pkeyId, String contractId, Long id, int pageNumber, int pageNumberCount) throws
|
|
|
+ Exception {
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
|
|
|
.eq(WbsTreePrivate::getPKeyId, pkeyId));
|
|
@@ -2272,7 +2261,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
* 试验 多pdf
|
|
|
*/
|
|
|
@Override
|
|
|
- public String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String projectId, Long id, String tabIds) throws Exception {
|
|
|
+ public String getBussPDFSTrial(String nodeId, String tableType, String classify, String contractId, String
|
|
|
+ projectId, Long id, String tabIds) throws Exception {
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
//获取有权限的表的信息
|
|
|
String sql = "select p_key_id,html_url,table_type,sort,node_name,create_time from m_wbs_tree_private where is_deleted = 0 and p_key_id in (" + tabIds + ") order by sort,node_name,create_time";
|