Commit 33d7f0b6 authored by danfuman's avatar danfuman

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents 722087d7 b4b0bfac
...@@ -54,7 +54,7 @@ public class DataAnalysisComponent { ...@@ -54,7 +54,7 @@ public class DataAnalysisComponent {
if (ObjectUtils.isEmpty(fileList)) return; if (ObjectUtils.isEmpty(fileList)) return;
//文件处理 //文件处理
for (CbProjectFile file : fileList) { for (CbProjectFile file : fileList) {
if (file.getDelFlag() == 0) { // if (file.getDelFlag() == 0) {
//文件下载 //文件下载
InputStream inputStream = ossService.downFileIO(file.getFileOssId()); InputStream inputStream = ossService.downFileIO(file.getFileOssId());
...@@ -80,7 +80,7 @@ public class DataAnalysisComponent { ...@@ -80,7 +80,7 @@ public class DataAnalysisComponent {
item.setCbProjectFileId(file.getId()); item.setCbProjectFileId(file.getId());
}).collect(Collectors.toList()); }).collect(Collectors.toList());
if (quantitySummaryList.isEmpty()) { if (quantitySummaryList.isEmpty()) {
throw new ServiceException("表格中不存在有效数据数据!"); throw new ServiceException("表格中不存在有效数据!");
} }
transactionTemplate.execute(status -> { transactionTemplate.execute(status -> {
try { try {
...@@ -115,10 +115,10 @@ public class DataAnalysisComponent { ...@@ -115,10 +115,10 @@ public class DataAnalysisComponent {
} }
return Boolean.TRUE; return Boolean.TRUE;
}); });
} else { // } else {
quantitySummaryService.remove(Wrappers.<CbQuantitySummary>lambdaQuery().eq(CbQuantitySummary::getCbProjectFileId, file.getId())); // quantitySummaryService.remove(Wrappers.<CbQuantitySummary>lambdaQuery().eq(CbQuantitySummary::getCbProjectFileId, file.getId()));
projectFileService.removeById(file); // projectFileService.removeById(file);
} // }
} }
} }
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
id, project_id, cb_stage, cb_type, file_name, file_oss_id, file_oss_url, file_parse_status, fail_remark, id, project_id, cb_stage, cb_type, file_name, file_oss_id, file_oss_url, file_parse_status, fail_remark,
del_flag, create_by, create_time, update_by, update_time del_flag, create_by, create_time, update_by, update_time
FROM cb_project_file FROM cb_project_file
WHERE ((del_flag = 0 and file_parse_status in (1,3)) or del_flag = 1) WHERE (del_flag = 0 and file_parse_status in (1,3)
and project_id=#{projectId} and project_id=#{projectId}
<if test="cbStage != null"> <if test="cbStage != null">
and cb_stage =#{cbStage} and cb_stage =#{cbStage}
......
...@@ -1064,17 +1064,13 @@ export function findAncestors(data, targetId, idKey = "id", childrenKey = "child ...@@ -1064,17 +1064,13 @@ export function findAncestors(data, targetId, idKey = "id", childrenKey = "child
export function addTreeLevel(tree, startLevel = 1, removeEmptyChildren = true) { export function addTreeLevel(tree, startLevel = 1, removeEmptyChildren = true) {
if (tree instanceof Array && tree?.length) { if (tree instanceof Array && tree?.length) {
tree.forEach(node => { tree.forEach(node => {
addTreeLevel(node, startLevel, removeEmptyChildren); node["level"] = startLevel;
}); if (node?.children) {
} else if (Object.prototype.toString.call(tree) == "[object Object]") { addTreeLevel(node.children, startLevel + 1, removeEmptyChildren);
tree["level"] = startLevel; removeEmptyChildren && !node.children?.length ? delete node.children : null;
if (tree?.children) {
addTreeLevel(tree.children, startLevel + 1, removeEmptyChildren);
removeEmptyChildren && !tree.children?.length ? delete tree.children : null;
} }
});
} }
return tree; return tree;
} }
...@@ -1086,15 +1082,11 @@ export function addTreeLevel(tree, startLevel = 1, removeEmptyChildren = true) { ...@@ -1086,15 +1082,11 @@ export function addTreeLevel(tree, startLevel = 1, removeEmptyChildren = true) {
export function addNodeParent(tree, parent = null) { export function addNodeParent(tree, parent = null) {
if (tree instanceof Array && tree?.length) { if (tree instanceof Array && tree?.length) {
tree.forEach(node => { tree.forEach(node => {
addNodeParent(node, parent); node["parent"] = parent ? parent : JSON.parse(JSON.stringify(parent));
}); if (node.children instanceof Array && node.children.length) {
} else if (Object.prototype.toString.call(tree) == "[object Object]") { addNodeParent(node.children, node);
tree["parent"] = JSON.parse(JSON.stringify(parent));
if (tree?.children?.length) {
addNodeParent(tree.children, tree);
} }
});
} }
return tree; return tree;
} }
\ No newline at end of file
...@@ -120,12 +120,11 @@ export default { ...@@ -120,12 +120,11 @@ export default {
// 合并默认配置 // 合并默认配置
const _options = this.mergeMenuOptions(JSON.parse(JSON.stringify(this.menuOptions))); const _options = this.mergeMenuOptions(JSON.parse(JSON.stringify(this.menuOptions)));
this.tempMenuOptions = _options; this.tempMenuOptions = _options;
console.log(this.tempMenuOptions);
// 映射配置 // 映射配置
// const resultData = this.mapDataByMenuOptions(JSON.parse(JSON.stringify(this.comMenuTree)), _options); const resultData = this.mapDataByMenuOptions(JSON.parse(JSON.stringify(this.comMenuTree)), _options);
// if (resultData) { if (resultData) {
// this.tempMenuTree = resultData; this.tempMenuTree = resultData;
// } }
} }
}, },
mergeMenuOptions(options) { mergeMenuOptions(options) {
...@@ -188,6 +187,7 @@ export default { ...@@ -188,6 +187,7 @@ export default {
// 添加层级 // 添加层级
const levelResult = addTreeLevel(mapedData); const levelResult = addTreeLevel(mapedData);
const parentResult = addNodeParent(levelResult); const parentResult = addNodeParent(levelResult);
console.log(parentResult);
return parentResult; return parentResult;
} }
} }
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</div> </div>
</div> </div>
<div class="upload-project"> <div class="upload-project">
<el-form :model="uploaddata" label-width="200px" :rules="uprules" label-position="right" :inline="true"> <el-form :model="uploaddata" label-width="200px" :rules="uprules" ref="ruleForm" label-position="right" :inline="true" :show-message="false">
<el-row> <el-row>
<el-form-item label="直接费成本" prop="zjfcb"> <el-form-item label="直接费成本" prop="zjfcb">
<div class="filelist"> <div class="filelist">
...@@ -220,11 +220,23 @@ ...@@ -220,11 +220,23 @@
</div> </div>
<el-divider></el-divider> <el-divider></el-divider>
<div class="pro-btns"> <div class="pro-btns">
<el-button type="primary" size="small" >导入数据</el-button> <el-button type="primary" size="small" @click="importdata">导入数据</el-button>
<el-button size="small" @click="goback">返回</el-button> <el-button size="small" @click="goback">返回</el-button>
</div> </div>
</div> </div>
<el-dialog title="提示" :visible.sync="visible" width="480px" custom-class='dialog-supplier'>
<el-divider></el-divider>
<div class="protypes">
<div class="ck" v-if="issub">解析成本数据过程需3~10分钟,稍后可到项目列表查看导入结果。</div>
<div class="ck" v-else>请将各阶段成本数据全部上传后,再次点击导入数据按钮。</div>
</div>
<el-divider></el-divider>
<div style="padding: 16px 20px 24px;text-align: right">
<el-button type="primary" size="small" @click="goback" v-if="issub">返回项目列表</el-button>
<el-button type="primary" size="small" @click="visible = false" v-else>我知道了</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -269,16 +281,28 @@ ...@@ -269,16 +281,28 @@
sceneExpense:[], sceneExpense:[],
cbSummary:[], cbSummary:[],
uploadtype:0,//上传的版块类型 uploadtype:0,//上传的版块类型
visible:false,
issub:false,//已填完数据可以开始解析
} }
}, },
created() { created() {
this.formdata = JSON.parse(JSON.stringify(this.uploadData)) this.formdata = JSON.parse(JSON.stringify(this.uploadData))
this.formdata.cbStage = this.formdata.cbStage.toString() this.formdata.cbStage = this.formdata.cbStage.toString()
this.getDetail() this.getDetail()
console.log(this.uploadData)
}, },
methods:{ methods:{
importdata(){
this.visible = true
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
this.issub = true
} else {
this.issub = false
}
});
},
goback(){ goback(){
this.visible = false
this.$emit('closeupload') this.$emit('closeupload')
}, },
getDetail(){ getDetail(){
...@@ -387,6 +411,17 @@ ...@@ -387,6 +411,17 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.protypes{
padding: 24px 20px;
height: 120px;
.ck {
margin-bottom: 12px;
height: 22px;
font-size: 14px;
color: rgba(35, 35, 35, 0.8);
line-height: 22px;
}
}
.title-small{ .title-small{
font-size: 12px; font-size: 12px;
line-height: 24px; line-height: 24px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment