Merge remote-tracking branch 'origin/1.2.0' into 1.2.0

master
Harry Yang 2023-01-05 17:51:53 +08:00
commit ba0d53a001
2 changed files with 13 additions and 1 deletions

View File

@ -236,6 +236,10 @@ public class ProcessController {
return processService.getProjectRepaidAmount(id);
}
private BigDecimal getContractAmount(int id) {
return processService.getContractAmount(id);
}
/**
* ,
*/
@ -317,6 +321,8 @@ public class ProcessController {
// project_budget_plan_detail 垫资金额计算
BigDecimal repaidAmount = getRepaidAmount(id);
BigDecimal contractAmount = getContractAmount(id);
List<ProcurementDetail> procurementDetails = Collections.emptyList();
List<ProjectBudgetIncomeDetail> incomeDetails = Collections.emptyList();
if (processType == ProcessType.sale_contract) {
@ -338,7 +344,7 @@ public class ProcessController {
.budgetGrossMargin(budgetBean.getProjectGrossProfitRate())
.projectNo(project.getProjectNo())
.applyPersonName(admin.getRealName())
.contractAmount(project.getContractAmount())
.contractAmount(contractAmount)
.terminalCustomer(project.getTerminalCustomer())
.projectType(Enumerable.of(ProjectType.class, project.getType()).getDescription())
.cooperationType(Enumerable.of(CooperationType.class, project.getCooperateType()).getDescription())

View File

@ -108,6 +108,12 @@ public class ProjectProcessService {
return queryProject.getProcessType() == ProcessType.sale_contract;
}
public BigDecimal getContractAmount(int id) {
Map<String, Object> map = jdbcTemplate.queryForMap(
"select ifnull(sum(amount * price), 0) contractAmount from project_budget_income_detail where project_id = ?", id);
return (BigDecimal) map.values().iterator().next();
}
@Data
static class DeptReturnValue {