|  | @@ -109,14 +109,18 @@ func (d *ContractPaidDao) UpdatePaidTotalPrice(projectId int, bidsectionId int,
 | 
												
													
														
															|  |  	contractsPrice := 0.00
 |  |  	contractsPrice := 0.00
 | 
												
													
														
															|  |  	// 扣款金额合计
 |  |  	// 扣款金额合计
 | 
												
													
														
															|  |  	contractDeductionTotal := 0.00
 |  |  	contractDeductionTotal := 0.00
 | 
												
													
														
															|  | 
 |  | +	// 总扣款金额
 | 
												
													
														
															|  | 
 |  | +	contractDeductionPrice := 0.00
 | 
												
													
														
															|  |  	for _, item := range datalist {
 |  |  	for _, item := range datalist {
 | 
												
													
														
															|  |  		price, _ := strconv.ParseFloat(item.Price, 64)
 |  |  		price, _ := strconv.ParseFloat(item.Price, 64)
 | 
												
													
														
															|  |  		priceTotal = priceTotal + price
 |  |  		priceTotal = priceTotal + price
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | 
 |  | +		contractDeduction, _ := strconv.ParseFloat(item.ContractDeduction, 64)
 | 
												
													
														
															|  | 
 |  | +		contractDeductionPrice = contractDeductionPrice + contractDeduction
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |  		if item.ContractsId == contractsId {
 |  |  		if item.ContractsId == contractsId {
 | 
												
													
														
															|  |  			contractsPrice = contractsPrice + price
 |  |  			contractsPrice = contractsPrice + price
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -			contractDeduction, _ := strconv.ParseFloat(item.ContractDeduction, 64)
 |  | 
 | 
												
													
														
															|  |  			contractDeductionTotal = contractDeductionTotal + contractDeduction
 |  |  			contractDeductionTotal = contractDeductionTotal + contractDeduction
 | 
												
													
														
															|  |  		}
 |  |  		}
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
											
												
													
														
															|  | @@ -145,8 +149,9 @@ func (d *ContractPaidDao) UpdatePaidTotalPrice(projectId int, bidsectionId int,
 | 
												
													
														
															|  |  		session.Rollback()
 |  |  		session.Rollback()
 | 
												
													
														
															|  |  		return errors.New("金额更新失败")
 |  |  		return errors.New("金额更新失败")
 | 
												
													
														
															|  |  	}
 |  |  	}
 | 
												
													
														
															|  | -	// 4.更新标段树 整个标段下回款总金额
 |  | 
 | 
												
													
														
															|  | -	_, err = session.Exec("UPDATE  cm_tree SET `contracts_paid` = ? where project_id = ? and bidsection_id=? ", priceTotal, projectId, bidsectionId)
 |  | 
 | 
												
													
														
															|  | 
 |  | +	// 4.更新标段树 整个标段下回款总金额 TODO
 | 
												
													
														
															|  | 
 |  | +	_, err = session.Exec("UPDATE  cm_tree SET `contracts_paid` = ? ,contract_deduction_total = ? where project_id = ? and bidsection_id=? ",
 | 
												
													
														
															|  | 
 |  | +		priceTotal, contractDeductionPrice, projectId, bidsectionId)
 | 
												
													
														
															|  |  	if err != nil {
 |  |  	if err != nil {
 | 
												
													
														
															|  |  		session.Rollback()
 |  |  		session.Rollback()
 | 
												
													
														
															|  |  		return errors.New("金额更新失败")
 |  |  		return errors.New("金额更新失败")
 |