销售合同流程合同金额计算
parent
56cc5b1749
commit
49b78648ae
|
@ -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())
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Reference in New Issue