销售合同流程合同金额计算

master
OathK1per 2023-01-05 17:51:16 +08:00
parent 56cc5b1749
commit 49b78648ae
2 changed files with 13 additions and 1 deletions

View File

@ -232,6 +232,10 @@ public class ProcessController {
return processService.getProjectRepaidAmount(id);
}
private BigDecimal getContractAmount(int id) {
return processService.getContractAmount(id);
}
/**
* ,
*/
@ -313,6 +317,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) {
@ -334,7 +340,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 {