Commit 8c2c519c 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 d9112371 c95ed0ae
...@@ -49,39 +49,42 @@ public class DataAnalysisComponent { ...@@ -49,39 +49,42 @@ public class DataAnalysisComponent {
*/ */
@Async @Async
public void quantitySummaryDataAnalysis(CbProjectBaseBo bo) throws Exception { public void quantitySummaryDataAnalysis(CbProjectBaseBo bo) throws Exception {
//查询工料汇总导入文件 //查询工料汇总导入文件
List<CbProjectFile> fileList = projectFileService.selectAnalysisList(bo.getProjectId(), CbProjectConstants.CB_TYPE_QUANTITY_SUMMARY, bo.getCbStage()); List<CbProjectFile> fileList = projectFileService.selectAnalysisList(bo.getProjectId(), CbProjectConstants.CB_TYPE_QUANTITY_SUMMARY, bo.getCbStage());
if (ObjectUtils.isEmpty(fileList)) return; if (ObjectUtils.isEmpty(fileList)) return;
//文件处理 //文件处理
for (CbProjectFile file : fileList) { for (CbProjectFile file : fileList) {
//文件下载 try {
InputStream inputStream = ossService.downFileIO(file.getFileOssId()); //文件下载
if (ObjectUtil.isNull(inputStream)) { InputStream inputStream = ossService.downFileIO(file.getFileOssId());
file.setFileParseStatus(3); if (ObjectUtil.isNull(inputStream)) {
file.setFailRemark("文件数据不存在"); file.setFileParseStatus(3);
projectFileService.updateById(file); file.setFailRemark("文件数据不存在");
break; projectFileService.updateById(file);
} break;
//解析数据 }
List<CbQuantitySummary> importList = new ExcelUtils<>(CbQuantitySummary.class).importExcelAllSheet(inputStream, 1); //解析数据
if (importList.isEmpty()) { List<CbQuantitySummary> importList = new ExcelUtils<>(CbQuantitySummary.class).importExcelAllSheet(inputStream, 1);
file.setFileParseStatus(3); if (importList.isEmpty()) {
file.setFailRemark("表格中不存在待导入数据!"); file.setFileParseStatus(3);
projectFileService.updateById(file); file.setFailRemark("表格中不存在待导入数据!");
break; projectFileService.updateById(file);
} break;
List<CbQuantitySummary> quantitySummaryList = importList.stream().parallel() }
.filter(item -> !ObjectUtils.isEmpty(item.getCbName())) List<CbQuantitySummary> quantitySummaryList = importList.stream().parallel()
.peek(item -> { .filter(item -> !ObjectUtils.isEmpty(item.getCbName()))
item.setProjectId(bo.getProjectId()); .peek(item -> {
item.setCbStage(bo.getCbStage()); item.setProjectId(bo.getProjectId());
item.setCbProjectFileId(file.getId()); item.setCbStage(bo.getCbStage());
}).collect(Collectors.toList()); item.setCbProjectFileId(file.getId());
if (quantitySummaryList.isEmpty()) { }).collect(Collectors.toList());
throw new ServiceException("表格中不存在有效数据!"); if (quantitySummaryList.isEmpty()) {
} throw new ServiceException("表格中不存在有效数据!");
transactionTemplate.execute(status -> { }
try {
transactionTemplate.execute(status -> {
try {
// //分批次插入 // //分批次插入
// if (quantitySummaryList.size() > 1000) { // if (quantitySummaryList.size() > 1000) {
// int index = 0; // int index = 0;
...@@ -100,23 +103,29 @@ public class DataAnalysisComponent { ...@@ -100,23 +103,29 @@ public class DataAnalysisComponent {
// throw new ServiceException("数据插入失败!"); // throw new ServiceException("数据插入失败!");
// } // }
// } // }
boolean a = quantitySummaryService.batchInsert(quantitySummaryList); boolean a = quantitySummaryService.batchInsert(quantitySummaryList);
if (!a) { if (!a) {
throw new ServiceException("数据插入失败!"); throw new ServiceException("数据插入失败!");
} }
file.setFileParseStatus(2); file.setFileParseStatus(2);
boolean b = projectFileService.updateById(file); boolean b = projectFileService.updateById(file);
if (!b) { if (!b) {
throw new ServiceException("文件状态更新失败!"); throw new ServiceException("文件状态更新失败!");
}
} catch (Exception e) {
status.setRollbackOnly();
file.setFileParseStatus(3);
file.setFailRemark(e.getMessage());
projectFileService.updateById(file);
} }
} catch (Exception e) { return Boolean.TRUE;
status.setRollbackOnly(); });
file.setFileParseStatus(3); } catch (Exception e) {
file.setFailRemark(e.getMessage()); file.setFileParseStatus(3);
projectFileService.updateById(file); file.setFailRemark(e.getMessage());
} projectFileService.updateById(file);
return Boolean.TRUE; }
});
} }
} }
} }
...@@ -22,6 +22,7 @@ import com.dsk.cscec.domain.vo.CbProjectOtherImportVo; ...@@ -22,6 +22,7 @@ import com.dsk.cscec.domain.vo.CbProjectOtherImportVo;
import com.dsk.cscec.domain.vo.CbProjectOtherVo; import com.dsk.cscec.domain.vo.CbProjectOtherVo;
import com.dsk.cscec.listener.CbProjectExpenseSummaryImportListener; import com.dsk.cscec.listener.CbProjectExpenseSummaryImportListener;
import com.dsk.cscec.listener.CbProjectOtherImportListener; import com.dsk.cscec.listener.CbProjectOtherImportListener;
import com.dsk.cscec.mapper.CbProjectFileMapper;
import com.dsk.cscec.mapper.CbProjectOtherMapper; import com.dsk.cscec.mapper.CbProjectOtherMapper;
import com.dsk.cscec.service.*; import com.dsk.cscec.service.*;
import com.dsk.system.service.ISysOssService; import com.dsk.system.service.ISysOssService;
...@@ -54,6 +55,8 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper, ...@@ -54,6 +55,8 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
private ISysOssService ossService; private ISysOssService ossService;
@Resource @Resource
private CbProjectExpenseSummaryService projectExpenseSummaryService; private CbProjectExpenseSummaryService projectExpenseSummaryService;
@Resource
private CbProjectFileMapper projectFileMapper;
@SneakyThrows @SneakyThrows
@Override @Override
...@@ -164,11 +167,7 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper, ...@@ -164,11 +167,7 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
Integer cbStage = baseBo.getCbStage(); Integer cbStage = baseBo.getCbStage();
Assert.notNull(projectId, "项目信息不能为空"); Assert.notNull(projectId, "项目信息不能为空");
// 查询其他费用导入文件 // 查询其他费用导入文件
List<CbProjectFile> projectFileList = projectFileService.list(Wrappers.<CbProjectFile>lambdaQuery() List<CbProjectFile> projectFileList = projectFileMapper.selectAnalysisList(projectId, CbProjectConstants.CB_TYPE_OTHER_PROJECT, cbStage);
.eq(CbProjectFile::getProjectId, baseBo.getProjectId())
.eq(CbProjectFile::getCbType, CbProjectConstants.CB_TYPE_SCENE_EXPENSE)
.eq(CbProjectFile::getCbStage, baseBo.getCbStage())
.in(CbProjectFile::getFileParseStatus, Arrays.asList(0)));
if (ObjectUtils.isEmpty(projectFileList)) { if (ObjectUtils.isEmpty(projectFileList)) {
return; return;
} }
...@@ -196,7 +195,6 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper, ...@@ -196,7 +195,6 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
//解析数据 //解析数据
ExcelResult<CbProjectOtherImportVo> importVoExcelResult = ExcelResult<CbProjectOtherImportVo> importVoExcelResult =
ExcelUtil.importExcel(inputStream, CbProjectOtherImportVo.class,new CbProjectOtherImportListener(projectId, fileId)); ExcelUtil.importExcel(inputStream, CbProjectOtherImportVo.class,new CbProjectOtherImportListener(projectId, fileId));
log.info(importVoExcelResult.getAnalysis());
List<CbProjectOtherImportVo> importVoList = importVoExcelResult.getList(); List<CbProjectOtherImportVo> importVoList = importVoExcelResult.getList();
if (CollectionUtil.isEmpty(importVoList)) { if (CollectionUtil.isEmpty(importVoList)) {
//解析失败 //解析失败
...@@ -262,7 +260,6 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper, ...@@ -262,7 +260,6 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
//解析数据 //解析数据
ExcelResult<CbProjectExpenseSummaryImportVo> importVoExcelResult = ExcelResult<CbProjectExpenseSummaryImportVo> importVoExcelResult =
ExcelUtil.importExcel(inputStream, CbProjectExpenseSummaryImportVo.class,new CbProjectExpenseSummaryImportListener(projectId, cbStage)); ExcelUtil.importExcel(inputStream, CbProjectExpenseSummaryImportVo.class,new CbProjectExpenseSummaryImportListener(projectId, cbStage));
log.info(importVoExcelResult.getAnalysis());
List<CbProjectExpenseSummaryImportVo> importVoList = importVoExcelResult.getList(); List<CbProjectExpenseSummaryImportVo> importVoList = importVoExcelResult.getList();
if (CollectionUtil.isEmpty(importVoList)) { if (CollectionUtil.isEmpty(importVoList)) {
//解析失败 //解析失败
......
...@@ -93,7 +93,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary ...@@ -93,7 +93,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
} catch (Exception e) { } catch (Exception e) {
//修改文件状态 //修改文件状态
cbProjectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL); cbProjectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
cbProjectFile.setFailRemark("失败原因:" + e.getMessage()); cbProjectFile.setFailRemark(e.getMessage());
cbProjectFileMapper.updateById(cbProjectFile); cbProjectFileMapper.updateById(cbProjectFile);
} }
// } // }
......
...@@ -17,12 +17,11 @@ ...@@ -17,12 +17,11 @@
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 = 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}
</if> </if>
and cb_type = #{cbType}) and cb_type = #{cbType}
</select> </select>
<update id="removeById"> <update id="removeById">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
visible-arrow="true" visible-arrow="true"
trigger="hover"> trigger="hover">
<div> <div>
<img :src="logo" class="tips_logo" /> <!--<img :src="logo" class="tips_logo" />-->
<div class="tips_title">{{title}}</div> <div class="tips_title">{{title}}</div>
</div> </div>
<transition name="sidebarLogoFade" slot="reference"> <transition name="sidebarLogoFade" slot="reference">
...@@ -46,7 +46,8 @@ export default { ...@@ -46,7 +46,8 @@ export default {
data() { data() {
return { return {
title: '中建一局集团第二建筑有限公司', title: '中建一局集团第二建筑有限公司',
logo: logoImg // logo: logoImg
logo: ''
} }
} }
} }
...@@ -123,7 +124,7 @@ export default { ...@@ -123,7 +124,7 @@ export default {
font-size:22px; font-size:22px;
transform:scale(0.5); transform:scale(0.5);
-webkit-transform:scale(0.5); -webkit-transform:scale(0.5);
padding: 0 16px; padding: 16px 16px 0;
float: left; float: left;
margin-top: -14px; margin-top: -14px;
margin-left: -48px; margin-left: -48px;
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<!--<div class="on" @click="isDXlogin = false">密码登录</div>--> <!--<div class="on" @click="isDXlogin = false">密码登录</div>-->
<!--<div @click="isDXlogin = true">快捷登录</div>--> <!--<div @click="isDXlogin = true">快捷登录</div>-->
<!--</div>--> <!--</div>-->
<div class="loginname"><img src="../assets/images/login/ztlogo.png">中建一局集团第二建筑有限公司</div> <div class="loginname"><!--<img src="../assets/images/login/ztlogo.png">-->中建一局集团第二建筑有限公司</div>
<el-form-item prop="username" > <el-form-item prop="username" >
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<template slot-scope="scope">{{scope.row.taxType || '--'}}</template> <template slot-scope="scope">{{scope.row.taxType || '--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="本月发生成本比例" width="150" prop="monthCostRate"> <el-table-column label="本月成本发生比例" width="150" prop="monthCostRate">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="isinput"><el-input v-model="scope.row.monthCostRate "></el-input></template> <template v-if="isinput"><el-input v-model="scope.row.monthCostRate "></el-input></template>
<template v-else>{{scope.row.monthCostRate || '--'}}</template> <template v-else>{{scope.row.monthCostRate || '--'}}</template>
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
<el-table-column label="截止本月工程量" width="130" prop="currentProjectVolume"> <el-table-column label="截止本月工程量" width="130" prop="currentProjectVolume">
<template slot-scope="scope">{{scope.row.suncurrentProjectVolume || '--'}}</template> <template slot-scope="scope">{{scope.row.suncurrentProjectVolume || '--'}}</template>
</el-table-column> </el-table-column>
<el-table-column label="本月推送工量" width="130" prop="submitProjectVolume"> <el-table-column label="本月推送工量" width="130" prop="submitProjectVolume">
<template slot-scope="scope">{{scope.row.submitProjectVolume || '--'}}</template> <template slot-scope="scope">{{scope.row.submitProjectVolume || '--'}}</template>
</el-table-column> </el-table-column>
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
</div> </div>
</el-dialog> </el-dialog>
<!--添加实际成本--> <!--添加实际成本-->
<el-dialog class="pro-news" :visible.sync="cbVisible" width="480px"> <el-dialog class="pro-news" :visible.sync="cbVisible" width="480px" :close-on-click-modal="false" >
<div class="poptitle"> <div class="poptitle">
<span>填写实际成本</span> <span>填写实际成本</span>
</div> </div>
......
...@@ -68,7 +68,8 @@ ...@@ -68,7 +68,8 @@
<el-table-column label="工程名称" width="416" :resizable="false"> <el-table-column label="工程名称" width="416" :resizable="false">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display:flex;align-items:center"> <div style="display:flex;align-items:center">
<el-tooltip placement="top" v-if="scope.row.projectText.length>20"> <el-tooltip placement="top" v-if="scope.row.projectText.length>26">
<div slot="content">{{scope.row.projectText}}</div>
<div class="renling"> <div class="renling">
<router-link v-if="scope.row.projectFileStatus==2" :to="`/projectCostLedger/detail?projectId=${scope.row.id}`" tag="a" <router-link v-if="scope.row.projectFileStatus==2" :to="`/projectCostLedger/detail?projectId=${scope.row.id}`" tag="a"
class="wordprimary" v-html="scope.row.projectName"></router-link> class="wordprimary" v-html="scope.row.projectName"></router-link>
...@@ -100,9 +101,13 @@ ...@@ -100,9 +101,13 @@
{{scope.row.ipmProjectNo||"--"}} {{scope.row.ipmProjectNo||"--"}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="文件名称" min-width="286" :resizable="false"> <el-table-column label="文件名称" min-width="310" :resizable="false">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.projectFileName||"--"}} <el-tooltip placement="top" v-if="scope.row.projectFileName.length>20">
<div slot="content">{{scope.row.projectFileName}}</div>
<div class="renling">{{scope.row.projectFileName||"--"}}</div>
</el-tooltip>
<div v-else class="renling">{{scope.row.projectFileName||"--"}}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="成本阶段" prop="customerCode" width="90" :resizable="false"> <el-table-column label="成本阶段" prop="customerCode" width="90" :resizable="false">
...@@ -112,7 +117,7 @@ ...@@ -112,7 +117,7 @@
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上传人" prop="updateBy" width="90" :resizable="false"> <el-table-column label="上传人" prop="updateBy" width="140" :resizable="false">
</el-table-column> </el-table-column>
<el-table-column label="上传时间" min-width="180" :resizable="false"> <el-table-column label="上传时间" min-width="180" :resizable="false">
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div> <div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div>
</template> </template>
<div class="cz" v-if="item.fileParseStatus != 1"> <div class="cz" v-if="item.fileParseStatus != 1">
<div v-if="item.fileParseStatus != 3"><a :href="item.fileOssUrl">下载</a></div> <div><a :href="item.fileOssUrl">下载</a></div>
<div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div> <div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div>
<div class="i" @click="deletefille(item.id,0)" v-if="prodetail == false">删除</div> <div class="i" @click="deletefille(item.id,0)" v-if="prodetail == false">删除</div>
</div> </div>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div> <div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div>
</template> </template>
<div class="cz" v-if="item.fileParseStatus != 1"> <div class="cz" v-if="item.fileParseStatus != 1">
<div v-if="item.fileParseStatus != 3"><a :href="item.fileOssUrl">下载</a></div> <div><a :href="item.fileOssUrl">下载</a></div>
<div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div> <div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div>
<div class="i" @click="deletefille(item.id,1)" v-if="prodetail == false">删除</div> <div class="i" @click="deletefille(item.id,1)" v-if="prodetail == false">删除</div>
</div> </div>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div> <div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div>
</template> </template>
<div class="cz" v-if="item.fileParseStatus != 1"> <div class="cz" v-if="item.fileParseStatus != 1">
<div v-if="item.fileParseStatus != 3"><a :href="item.fileOssUrl">下载</a></div> <div><a :href="item.fileOssUrl">下载</a></div>
<div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div> <div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div>
<div class="i" @click="deletefille(item.id,2)" v-if="prodetail == false">删除</div> <div class="i" @click="deletefille(item.id,2)" v-if="prodetail == false">删除</div>
</div> </div>
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
<div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div> <div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div>
</template> </template>
<div class="cz" v-if="item.fileParseStatus != 1"> <div class="cz" v-if="item.fileParseStatus != 1">
<div v-if="item.fileParseStatus != 3"><a :href="item.fileOssUrl">下载</a></div> <div><a :href="item.fileOssUrl">下载</a></div>
<div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div> <div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div>
<div class="i" @click="deletefille(item.id,3)" v-if="prodetail == false">删除</div> <div class="i" @click="deletefille(item.id,3)" v-if="prodetail == false">删除</div>
</div> </div>
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
<div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div> <div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div>
</template> </template>
<div class="cz" v-if="item.fileParseStatus != 1"> <div class="cz" v-if="item.fileParseStatus != 1">
<div v-if="item.fileParseStatus != 3"><a :href="item.fileOssUrl">下载</a></div> <div><a :href="item.fileOssUrl">下载</a></div>
<div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div> <div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div>
<div class="i" @click="deletefille(item.id,4)" v-if="prodetail == false">删除</div> <div class="i" @click="deletefille(item.id,4)" v-if="prodetail == false">删除</div>
</div> </div>
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
<div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div> <div class="prostatus i3" v-if="item.fileParseStatus == 3">解析失败</div>
</template> </template>
<div class="cz" v-if="item.fileParseStatus != 1"> <div class="cz" v-if="item.fileParseStatus != 1">
<div v-if="item.fileParseStatus != 3"><a :href="item.fileOssUrl">下载</a></div> <div><a :href="item.fileOssUrl">下载</a></div>
<div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div> <div v-if="item.fileParseStatus == 3 && prodetail == false">重新上传</div>
<div class="i" @click="deletefille(item.id,5)" v-if="prodetail == false">删除</div> <div class="i" @click="deletefille(item.id,5)" v-if="prodetail == false">删除</div>
</div> </div>
......
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