Commit 14bb2ece authored by tianhongyang's avatar tianhongyang

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 7ad9ce4f b5af2833
...@@ -34,6 +34,10 @@ public class CbProjectOther implements Serializable { ...@@ -34,6 +34,10 @@ public class CbProjectOther implements Serializable {
* 父项id * 父项id
*/ */
private Long parentId; private Long parentId;
/**
* 层级数
*/
private Integer level;
/** /**
* 序号 * 序号
......
...@@ -109,6 +109,10 @@ public class CbProjectOtherImportVo { ...@@ -109,6 +109,10 @@ public class CbProjectOtherImportVo {
* 父项id * 父项id
*/ */
private Long parentId; private Long parentId;
/**
* 层级数
*/
private Integer level;
/** /**
* 处理后序号 * 处理后序号
*/ */
......
...@@ -131,6 +131,7 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper, ...@@ -131,6 +131,7 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
Assert.notNull(byId, "项目信息不能为空"); Assert.notNull(byId, "项目信息不能为空");
CbProjectOther projectOther = new CbProjectOther(); CbProjectOther projectOther = new CbProjectOther();
projectOther.setParentId(0L); projectOther.setParentId(0L);
projectOther.setLevel(i);
projectOther.setProjectId(projectId); projectOther.setProjectId(projectId);
projectOther.setCbStage(byId.getCbStage()); projectOther.setCbStage(byId.getCbStage());
QueryWrapper<CbProjectOther> tWrapper = Wrappers.query(projectOther); QueryWrapper<CbProjectOther> tWrapper = Wrappers.query(projectOther);
...@@ -184,12 +185,12 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper, ...@@ -184,12 +185,12 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
} }
// 文件名称 // 文件名称
String name = file.getFileName(); String fileName = file.getFileName();
name = FileNameUtil.getPrefix(name); fileName = FileNameUtil.getPrefix(fileName);
// 文件Id // 文件Id
Long fileId = file.getId(); Long fileId = file.getId();
if ("其他费".equals(name)) { if ("其他费".equals(fileName)) {
totalDataAnalysis(inputStream, name, file, projectId, cbStage); totalDataAnalysis(inputStream, fileName, file, projectId, cbStage);
continue; continue;
} }
//解析数据 //解析数据
...@@ -206,11 +207,12 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper, ...@@ -206,11 +207,12 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
} }
log.debug(">>>>" + importVoList.size()); log.debug(">>>>" + importVoList.size());
CbProjectOther rootProjectOther = new CbProjectOther(); CbProjectOther rootProjectOther = new CbProjectOther();
rootProjectOther.setItemContent(name); rootProjectOther.setItemContent(fileName);
rootProjectOther.setParentId(0L); rootProjectOther.setParentId(0L);
rootProjectOther.setProjectId(projectId); rootProjectOther.setProjectId(projectId);
rootProjectOther.setLevel(0);
rootProjectOther.setCbStage(cbStage); rootProjectOther.setCbStage(cbStage);
rootProjectOther.setCbProjectFileId(0L); rootProjectOther.setCbProjectFileId(fileId);
LambdaQueryWrapper<CbProjectOther> tWrapper = Wrappers.lambdaQuery(rootProjectOther); LambdaQueryWrapper<CbProjectOther> tWrapper = Wrappers.lambdaQuery(rootProjectOther);
CbProjectOther rootOther = this.getOne(tWrapper); CbProjectOther rootOther = this.getOne(tWrapper);
...@@ -224,16 +226,23 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper, ...@@ -224,16 +226,23 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
if (CollectionUtil.isNotEmpty(importVoList)) { if (CollectionUtil.isNotEmpty(importVoList)) {
for (CbProjectOtherImportVo importVo : importVoList) { for (CbProjectOtherImportVo importVo : importVoList) {
String number = importVo.getNumber(); String number = importVo.getNumber();
CbProjectOther cbProjectOther = new CbProjectOther(); CbProjectOther cbProjectOther = new CbProjectOther();
BeanUtil.copyProperties(importVo, cbProjectOther); BeanUtil.copyProperties(importVo, cbProjectOther);
//保存一级节点 if (ObjectUtil.isEmpty(number)) {
if (ReUtil.isMatch(firstPattern, number) || ReUtil.isMatch(pattern3, number)) {
cbProjectOther.setParentId(rootMeasuresId); cbProjectOther.setParentId(rootMeasuresId);
} else if (ReUtil.isMatch(secondPattern, number)) { cbProjectOther.setLevel(1);
// 根据no查询父级节点 } else {
CbProjectOther parentCbCostMeasure = getCbProjectOther(rootMeasuresId, number, projectId, cbStage); //保存一级节点
cbProjectOther.setParentId(parentCbCostMeasure.getId()); if (ReUtil.isMatch(firstPattern, number) || ReUtil.isMatch(pattern3, number)) {
cbProjectOther.setParentId(rootMeasuresId);
cbProjectOther.setLevel(1);
} else if (ReUtil.isMatch(secondPattern, number)) {
// 根据no查询父级节点
CbProjectOther parentCbCostMeasure = getCbProjectOther(rootMeasuresId, number, projectId, cbStage);
String[] split = number.split("\\.");
cbProjectOther.setLevel(split.length);
cbProjectOther.setParentId(parentCbCostMeasure.getId());
}
} }
if (ObjectUtil.isNotEmpty(cbProjectOther.getDealWithNumber())) { if (ObjectUtil.isNotEmpty(cbProjectOther.getDealWithNumber())) {
String newNo = String.valueOf(rootMeasuresId).concat(".").concat(cbProjectOther.getDealWithNumber()); String newNo = String.valueOf(rootMeasuresId).concat(".").concat(cbProjectOther.getDealWithNumber());
...@@ -277,7 +286,7 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper, ...@@ -277,7 +286,7 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
BeanUtil.copyProperties(importVo, projectExpenseSummary); BeanUtil.copyProperties(importVo, projectExpenseSummary);
projectExpenseSummary.setProjectId(projectId); projectExpenseSummary.setProjectId(projectId);
projectExpenseSummary.setCbStage(cbStage); projectExpenseSummary.setCbStage(cbStage);
projectExpenseSummary.setDataType(1); projectExpenseSummary.setDataType(3);
projectExpenseSummaryService.save(projectExpenseSummary); projectExpenseSummaryService.save(projectExpenseSummary);
} }
} }
......
...@@ -108,6 +108,12 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM ...@@ -108,6 +108,12 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
@Override @Override
public List<CbQuantitySummaryListVo> subjectList(CbQuantitySummaryListBo bo) { public List<CbQuantitySummaryListVo> subjectList(CbQuantitySummaryListBo bo) {
if(ObjectUtils.isEmpty(bo.getRecordDate())){
//默认当前月
bo.setRecordDate(DatePattern.SIMPLE_MONTH_FORMAT.format(new Date()));
}
if (ObjectUtils.isEmpty(bo.getProjectId())) throw new BeanException("项目id不能为空!");
if (ObjectUtils.isEmpty(bo.getCbStage())) throw new BeanException("成本阶段不能为空!");
return baseMapper.selectListBySubject(bo); return baseMapper.selectListBySubject(bo);
} }
......
...@@ -96,11 +96,12 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary ...@@ -96,11 +96,12 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
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);
log.error(projectId+"项目 成本汇总解析失败" + e);
} }
// } // }
}); });
log.info(projectId+"项目 成本汇总解析成功");
} }
/** /**
...@@ -132,11 +133,19 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary ...@@ -132,11 +133,19 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
transactionTemplate.execute(status -> { transactionTemplate.execute(status -> {
try { try {
boolean flag = this.saveBatch(addList); //分批次插入
if (!flag) { if (addList.size() > 1000) {
throw new ServiceException("导入数据失败"); int index = 0;
int total = addList.size();
while (index < total) {
List<CbSummary> divideList = addList.subList(index, Math.min(index += 1000, total));
Assert.isTrue(this.saveBatch(divideList), "数据插入失败");
}
} else {
Assert.isTrue(this.saveBatch(addList), "数据插入失败");
} }
//处理父级id //处理父级id
List<CbSummary> cbSummaryList = baseMapper.selectList( List<CbSummary> cbSummaryList = baseMapper.selectList(
new LambdaQueryWrapper<CbSummary>() new LambdaQueryWrapper<CbSummary>()
...@@ -161,17 +170,22 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary ...@@ -161,17 +170,22 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
} }
cbSummary.setParentId(parent.getId()); cbSummary.setParentId(parent.getId());
} }
//分批次修改
flag = this.updateBatchById(cbSummaryList); if (cbSummaryList.size() > 1000) {
if (!flag) { int index = 0;
throw new ServiceException("更新数据失败"); int total = cbSummaryList.size();
while (index < total) {
List<CbSummary> divideList = cbSummaryList.subList(index, Math.min(index += 1000, total));
Assert.isTrue(this.updateBatchById(divideList), "更新数据失败");
}
} else {
Assert.isTrue(this.updateBatchById(cbSummaryList), "更新数据失败");
} }
//修改文件状态为解析成功 //修改文件状态为解析成功
file.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_SUCCESS); file.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_SUCCESS);
flag = cbProjectFileMapper.updateById(file) > 0; Assert.isTrue(cbProjectFileMapper.updateById(file) > 0, "更新文件状态失败");
if (!flag) {
throw new ServiceException("更新文件状态失败");
}
} catch (Exception e) { } catch (Exception e) {
status.setRollbackOnly(); status.setRollbackOnly();
throw e; throw e;
...@@ -211,11 +225,19 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary ...@@ -211,11 +225,19 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
transactionTemplate.execute(status -> { transactionTemplate.execute(status -> {
try { try {
boolean flag = this.saveBatch(addList); //分批次插入
if (!flag) { if (addList.size() > 1000) {
throw new ServiceException("导入数据失败"); int index = 0;
int total = addList.size();
while (index < total) {
List<CbSummary> divideList = addList.subList(index, Math.min(index += 1000, total));
Assert.isTrue(this.saveBatch(divideList), "数据插入失败");
}
} else {
Assert.isTrue(this.saveBatch(addList), "数据插入失败");
} }
//处理父级id //处理父级id
List<CbSummary> cbSummaryList = baseMapper.selectList( List<CbSummary> cbSummaryList = baseMapper.selectList(
new LambdaQueryWrapper<CbSummary>() new LambdaQueryWrapper<CbSummary>()
...@@ -249,14 +271,21 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary ...@@ -249,14 +271,21 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
} }
cbSummary.setParentId(parent.getId()); cbSummary.setParentId(parent.getId());
} }
//分批次修改
this.updateBatchById(cbSummaryList); if (cbSummaryList.size() > 1000) {
int index = 0;
int total = cbSummaryList.size();
while (index < total) {
List<CbSummary> divideList = cbSummaryList.subList(index, Math.min(index += 1000, total));
Assert.isTrue(this.updateBatchById(divideList), "更新数据失败");
}
} else {
Assert.isTrue(this.updateBatchById(cbSummaryList), "更新数据失败");
}
//修改文件状态为解析成功 //修改文件状态为解析成功
file.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_SUCCESS); file.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_SUCCESS);
flag = cbProjectFileMapper.updateById(file) > 0; Assert.isTrue(cbProjectFileMapper.updateById(file) > 0, "更新文件状态失败");
if (!flag) {
throw new ServiceException("更新文件状态失败");
}
} catch (Exception e) { } catch (Exception e) {
status.setRollbackOnly(); status.setRollbackOnly();
throw e; throw e;
...@@ -307,7 +336,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary ...@@ -307,7 +336,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
List<CbSummaryActualListVo> childrenList = baseMapper.getByParentId(bo.getId(), bo.getExpenseDate()); List<CbSummaryActualListVo> childrenList = baseMapper.getByParentId(bo.getId(), bo.getExpenseDate());
//截至本月费用汇总 //截至本月费用汇总
childrenList.forEach(children -> { childrenList.parallelStream().forEach(children -> {
Map<String, BigDecimal> total = cbSummaryActualMapper.getTotal(children.getId(), bo.getExpenseDate()); Map<String, BigDecimal> total = cbSummaryActualMapper.getTotal(children.getId(), bo.getExpenseDate());
children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal")); children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal"));
children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal")); children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal"));
...@@ -330,7 +359,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary ...@@ -330,7 +359,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
} else { } else {
// //递归列表 // //递归列表
// childrenList = getProjectSumList(bo); // childrenList = getProjectSumList(bo);
childrenList.forEach(child->{ childrenList.parallelStream().forEach(child->{
Long count = baseMapper.selectCount(new LambdaQueryWrapper<CbSummary>().eq(CbSummary::getParentId,child.getId())); Long count = baseMapper.selectCount(new LambdaQueryWrapper<CbSummary>().eq(CbSummary::getParentId,child.getId()));
if(count>0l){ if(count>0l){
child.setHasChildren(1); child.setHasChildren(1);
......
...@@ -52,28 +52,26 @@ ...@@ -52,28 +52,26 @@
</select> </select>
<select id="selectListBySubject" resultType="com.dsk.cscec.domain.vo.CbQuantitySummaryListVo"> <select id="selectListBySubject" resultType="com.dsk.cscec.domain.vo.CbQuantitySummaryListVo">
select a.*, ifnull(sum(a.quantities),0) totalQuantities from ( select
select cqs.id, cqs.cb_subject_name, cqs.company_no, cqs.org_no, cqs.cb_name, cqs.job_content, cqs.calculation_rule,
cqs.id, cqs.cb_subject_name, cqs.company_no, cqs.org_no, cqs.cb_name, cqs.job_content, cqs.calculation_rule, cqs.unit, cqs.material_description, cqs.guide_price, cqs.bid_unit_price, cqs.unit_price_difference, cqs.quantity,
cqs.unit, cqs.material_description, cqs.guide_price, cqs.bid_unit_price, cqs.unit_price_difference, cqs.quantity, cqs.combined_price, cqs.combined_price_tax, cqs.brand_name, cqs.bid_source, cqs.remark, cqs.`number`, cqsa.quantities,
cqs.combined_price, cqs.combined_price_tax, cqs.brand_name, cqs.bid_source, cqs.remark, cqs.`number`, cqsa.quantities, cqsa.quantities_unit, cqsa.conversion_quantities, cqsa.conversion_unit, cqsa.purchase_unit_price, cqsa.create_time,
cqsa.quantities_unit, cqsa.conversion_quantities, cqsa.conversion_unit, cqsa.purchase_unit_price, cqsa.create_time, cqsa.id actualId, cqsa.ipm_project_code, cqsa.ipm_contract_code, cqsa.ipm_biz_code, cqsa.push_quantities,
cqsa.id actualId, cqsa.ipm_project_code, cqsa.ipm_contract_code, cqsa.ipm_biz_code, cqsa.push_quantities ifnull(sum(cqsa1.quantities),0) totalQuantities
from cb_quantity_summary cqs from cb_quantity_summary cqs
left join cb_quantity_summary_actual cqsa on cqs.id = cqsa.cb_quantity_summary_id left join cb_quantity_summary_actual cqsa on (cqs.id = cqsa.cb_quantity_summary_id and cqsa.record_date = #{recordDate} )
left join cb_subject cs1 on cqs.cb_subject_name = cs1.cb_subject_name left join cb_quantity_summary_actual cqsa1 on (cqs.id = cqsa1.cb_quantity_summary_id and cqsa1.record_date &lt;= #{recordDate} )
where cqs.del_falg = 0 and cqs.project_id = #{projectId} and cqs.cb_stage = #{cbStage} left join cb_subject cs1 on cqs.cb_subject_name = cs1.cb_subject_name
<if test="recordDate != null and recordDate != ''"> and cqsa.record_date &lt;= #{recordDate} </if> where cqs.del_falg = 0 and cqs.project_id = #{projectId} and cqs.cb_stage = #{cbStage}
<if test="cbSubjectName != null and cbSubjectName !=''"> <if test="cbSubjectName != null and cbSubjectName !=''">
<choose> <choose>
<when test="cbSubjectName == '未归类项目'"> and cs1.id is null </when> <when test="cbSubjectName == '未归类项目'"> and cs1.id is null </when>
<otherwise> and cqs.cb_subject_name = #{cbSubjectName} </otherwise> <otherwise> and cs1.id is not null and cqs.cb_subject_name = #{cbSubjectName} </otherwise>
</choose> </choose>
</if> </if>
order by cqsa.record_date desc group by cqs.id
) a order by cs1.sort asc, cs1.cb_subject_no asc, cqs.`number` asc
group by a.id
order by a.`number` asc
</select> </select>
<select id="unconvertedList" resultType="com.dsk.cscec.domain.vo.CbQuantitySummaryListVo"> <select id="unconvertedList" resultType="com.dsk.cscec.domain.vo.CbQuantitySummaryListVo">
......
dsk-operate-ui/public/favicon.ico

4.19 KB | W: | H:

dsk-operate-ui/public/favicon.ico

16.6 KB | W: | H:

dsk-operate-ui/public/favicon.ico
dsk-operate-ui/public/favicon.ico
dsk-operate-ui/public/favicon.ico
dsk-operate-ui/public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<el-table-column label="含税招标合价" width="180" prop="taxIncludeTenderSumPrice"><template slot-scope="scope">{{scope.row.taxIncludeTenderSumPrice || '--'}}</template></el-table-column> <el-table-column label="含税招标合价" width="180" prop="taxIncludeTenderSumPrice"><template slot-scope="scope">{{scope.row.taxIncludeTenderSumPrice || '--'}}</template></el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="投标报价" align="center"> <el-table-column label="投标报价" align="center">
<el-table-column label="投标控制价合价" width="180" prop="bidSumPrice"><template slot-scope="scope">{{scope.row.bidSumPrice || '--'}}</template></el-table-column> <el-table-column label="投标价合价" width="180" prop="bidSumPrice"><template slot-scope="scope">{{scope.row.bidSumPrice || '--'}}</template></el-table-column>
<el-table-column label="不含税投标合价" width="180" prop="taxExcludeBidSumPrice"><template slot-scope="scope">{{scope.row.taxExcludeBidSumPrice || '--'}}</template></el-table-column> <el-table-column label="不含税投标合价" width="180" prop="taxExcludeBidSumPrice"><template slot-scope="scope">{{scope.row.taxExcludeBidSumPrice || '--'}}</template></el-table-column>
<el-table-column label="含税投标合价" width="180" prop="taxIncludebBidSumPrice"><template slot-scope="scope">{{scope.row.taxIncludebBidSumPrice || '--'}}</template></el-table-column> <el-table-column label="含税投标合价" width="180" prop="taxIncludebBidSumPrice"><template slot-scope="scope">{{scope.row.taxIncludebBidSumPrice || '--'}}</template></el-table-column>
</el-table-column> </el-table-column>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<el-table-column label="成本" width="180" prop="costExpense"><template slot-scope="scope">{{scope.row.costExpense || '--'}}</template></el-table-column> <el-table-column label="成本" width="180" prop="costExpense"><template slot-scope="scope">{{scope.row.costExpense || '--'}}</template></el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="含税成本占比" width="180" prop="taxInclusiveExpenseProportion"><template slot-scope="scope">{{scope.row.taxInclusiveExpenseProportion || '--'}}</template></el-table-column> <el-table-column label="含税成本占比" width="180" prop="taxInclusiveExpenseProportion"><template slot-scope="scope">{{scope.row.taxInclusiveExpenseProportion || '--'}}</template></el-table-column>
<el-table-column label="控制盈亏对比情况" align="center"> <el-table-column label="控制盈亏对比情况" align="center">
<el-table-column label="含税合价偏差" width="180" prop="tenderSumPriceDeviation"><template slot-scope="scope">{{scope.row.tenderSumPriceDeviation || '--'}}</template></el-table-column> <el-table-column label="含税合价偏差" width="180" prop="tenderSumPriceDeviation"><template slot-scope="scope">{{scope.row.tenderSumPriceDeviation || '--'}}</template></el-table-column>
<el-table-column label="含税盈亏率" width="180" prop="tenderProfitLossRatio"><template slot-scope="scope">{{scope.row.tenderProfitLossRatio || '--'}}</template></el-table-column> <el-table-column label="含税盈亏率" width="180" prop="tenderProfitLossRatio"><template slot-scope="scope">{{scope.row.tenderProfitLossRatio || '--'}}</template></el-table-column>
</el-table-column> </el-table-column>
......
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