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 {
* 父项id
*/
private Long parentId;
/**
* 层级数
*/
private Integer level;
/**
* 序号
......
......@@ -109,6 +109,10 @@ public class CbProjectOtherImportVo {
* 父项id
*/
private Long parentId;
/**
* 层级数
*/
private Integer level;
/**
* 处理后序号
*/
......
......@@ -131,6 +131,7 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
Assert.notNull(byId, "项目信息不能为空");
CbProjectOther projectOther = new CbProjectOther();
projectOther.setParentId(0L);
projectOther.setLevel(i);
projectOther.setProjectId(projectId);
projectOther.setCbStage(byId.getCbStage());
QueryWrapper<CbProjectOther> tWrapper = Wrappers.query(projectOther);
......@@ -184,12 +185,12 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
}
// 文件名称
String name = file.getFileName();
name = FileNameUtil.getPrefix(name);
String fileName = file.getFileName();
fileName = FileNameUtil.getPrefix(fileName);
// 文件Id
Long fileId = file.getId();
if ("其他费".equals(name)) {
totalDataAnalysis(inputStream, name, file, projectId, cbStage);
if ("其他费".equals(fileName)) {
totalDataAnalysis(inputStream, fileName, file, projectId, cbStage);
continue;
}
//解析数据
......@@ -206,11 +207,12 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
}
log.debug(">>>>" + importVoList.size());
CbProjectOther rootProjectOther = new CbProjectOther();
rootProjectOther.setItemContent(name);
rootProjectOther.setItemContent(fileName);
rootProjectOther.setParentId(0L);
rootProjectOther.setProjectId(projectId);
rootProjectOther.setLevel(0);
rootProjectOther.setCbStage(cbStage);
rootProjectOther.setCbProjectFileId(0L);
rootProjectOther.setCbProjectFileId(fileId);
LambdaQueryWrapper<CbProjectOther> tWrapper = Wrappers.lambdaQuery(rootProjectOther);
CbProjectOther rootOther = this.getOne(tWrapper);
......@@ -224,16 +226,23 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
if (CollectionUtil.isNotEmpty(importVoList)) {
for (CbProjectOtherImportVo importVo : importVoList) {
String number = importVo.getNumber();
CbProjectOther cbProjectOther = new CbProjectOther();
BeanUtil.copyProperties(importVo, cbProjectOther);
//保存一级节点
if (ReUtil.isMatch(firstPattern, number) || ReUtil.isMatch(pattern3, number)) {
if (ObjectUtil.isEmpty(number)) {
cbProjectOther.setParentId(rootMeasuresId);
} else if (ReUtil.isMatch(secondPattern, number)) {
// 根据no查询父级节点
CbProjectOther parentCbCostMeasure = getCbProjectOther(rootMeasuresId, number, projectId, cbStage);
cbProjectOther.setParentId(parentCbCostMeasure.getId());
cbProjectOther.setLevel(1);
} else {
//保存一级节点
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())) {
String newNo = String.valueOf(rootMeasuresId).concat(".").concat(cbProjectOther.getDealWithNumber());
......@@ -277,7 +286,7 @@ public class CbProjectOtherServiceImpl extends ServiceImpl<CbProjectOtherMapper,
BeanUtil.copyProperties(importVo, projectExpenseSummary);
projectExpenseSummary.setProjectId(projectId);
projectExpenseSummary.setCbStage(cbStage);
projectExpenseSummary.setDataType(1);
projectExpenseSummary.setDataType(3);
projectExpenseSummaryService.save(projectExpenseSummary);
}
}
......
......@@ -108,6 +108,12 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
@Override
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);
}
......
......@@ -96,11 +96,12 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
cbProjectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
cbProjectFile.setFailRemark(e.getMessage());
cbProjectFileMapper.updateById(cbProjectFile);
log.error(projectId+"项目 成本汇总解析失败" + e);
}
// }
});
log.info(projectId+"项目 成本汇总解析成功");
}
/**
......@@ -132,11 +133,19 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
transactionTemplate.execute(status -> {
try {
boolean flag = this.saveBatch(addList);
if (!flag) {
throw new ServiceException("导入数据失败");
//分批次插入
if (addList.size() > 1000) {
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
List<CbSummary> cbSummaryList = baseMapper.selectList(
new LambdaQueryWrapper<CbSummary>()
......@@ -161,17 +170,22 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
}
cbSummary.setParentId(parent.getId());
}
flag = this.updateBatchById(cbSummaryList);
if (!flag) {
throw new ServiceException("更新数据失败");
//分批次修改
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);
flag = cbProjectFileMapper.updateById(file) > 0;
if (!flag) {
throw new ServiceException("更新文件状态失败");
}
Assert.isTrue(cbProjectFileMapper.updateById(file) > 0, "更新文件状态失败");
} catch (Exception e) {
status.setRollbackOnly();
throw e;
......@@ -211,11 +225,19 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
transactionTemplate.execute(status -> {
try {
boolean flag = this.saveBatch(addList);
if (!flag) {
throw new ServiceException("导入数据失败");
//分批次插入
if (addList.size() > 1000) {
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
List<CbSummary> cbSummaryList = baseMapper.selectList(
new LambdaQueryWrapper<CbSummary>()
......@@ -249,14 +271,21 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
}
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);
flag = cbProjectFileMapper.updateById(file) > 0;
if (!flag) {
throw new ServiceException("更新文件状态失败");
}
Assert.isTrue(cbProjectFileMapper.updateById(file) > 0, "更新文件状态失败");
} catch (Exception e) {
status.setRollbackOnly();
throw e;
......@@ -307,7 +336,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
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());
children.setTaxExclusiveExpenseTotal(total.get("taxExclusiveExpenseTotal"));
children.setTaxInclusiveExpenseTotal(total.get("taxInclusiveExpenseTotal"));
......@@ -330,7 +359,7 @@ public class CbSummaryServiceImpl extends ServiceImpl<CbSummaryMapper, CbSummary
} else {
// //递归列表
// childrenList = getProjectSumList(bo);
childrenList.forEach(child->{
childrenList.parallelStream().forEach(child->{
Long count = baseMapper.selectCount(new LambdaQueryWrapper<CbSummary>().eq(CbSummary::getParentId,child.getId()));
if(count>0l){
child.setHasChildren(1);
......
......@@ -52,28 +52,26 @@
</select>
<select id="selectListBySubject" resultType="com.dsk.cscec.domain.vo.CbQuantitySummaryListVo">
select a.*, ifnull(sum(a.quantities),0) totalQuantities from (
select
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.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.id actualId, cqsa.ipm_project_code, cqsa.ipm_contract_code, cqsa.ipm_biz_code, cqsa.push_quantities
from cb_quantity_summary cqs
left join cb_quantity_summary_actual cqsa on cqs.id = cqsa.cb_quantity_summary_id
left join cb_subject cs1 on cqs.cb_subject_name = cs1.cb_subject_name
where cqs.del_falg = 0 and cqs.project_id = #{projectId} and cqs.cb_stage = #{cbStage}
<if test="recordDate != null and recordDate != ''"> and cqsa.record_date &lt;= #{recordDate} </if>
<if test="cbSubjectName != null and cbSubjectName !=''">
<choose>
<when test="cbSubjectName == '未归类项目'"> and cs1.id is null </when>
<otherwise> and cqs.cb_subject_name = #{cbSubjectName} </otherwise>
</choose>
</if>
order by cqsa.record_date desc
) a
group by a.id
order by a.`number` asc
select
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.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.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
left join cb_quantity_summary_actual cqsa on (cqs.id = cqsa.cb_quantity_summary_id and cqsa.record_date = #{recordDate} )
left join cb_quantity_summary_actual cqsa1 on (cqs.id = cqsa1.cb_quantity_summary_id and cqsa1.record_date &lt;= #{recordDate} )
left join cb_subject cs1 on cqs.cb_subject_name = cs1.cb_subject_name
where cqs.del_falg = 0 and cqs.project_id = #{projectId} and cqs.cb_stage = #{cbStage}
<if test="cbSubjectName != null and cbSubjectName !=''">
<choose>
<when test="cbSubjectName == '未归类项目'"> and cs1.id is null </when>
<otherwise> and cs1.id is not null and cqs.cb_subject_name = #{cbSubjectName} </otherwise>
</choose>
</if>
group by cqs.id
order by cs1.sort asc, cs1.cb_subject_no asc, cqs.`number` asc
</select>
<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 @@
<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 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="taxIncludebBidSumPrice"><template slot-scope="scope">{{scope.row.taxIncludebBidSumPrice || '--'}}</template></el-table-column>
</el-table-column>
......@@ -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>
<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="tenderProfitLossRatio"><template slot-scope="scope">{{scope.row.tenderProfitLossRatio || '--'}}</template></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