作者 陈志颖

feat:账期结算单数据冗余

@@ -147,13 +147,19 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred @@ -147,13 +147,19 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred
147 // 预算明细 147 // 预算明细
148 var accountDetail []*domain.AccountDetail 148 var accountDetail []*domain.AccountDetail
149 var settlementAmount float64 149 var settlementAmount float64
  150 + var goodAmountCount float64
150 for _, dividendsEstimate := range dividendsEstimates { 151 for _, dividendsEstimate := range dividendsEstimates {
151 accountDetail = append(accountDetail, &domain.AccountDetail{ 152 accountDetail = append(accountDetail, &domain.AccountDetail{
152 DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber, 153 DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
153 DividendsType: dividendsEstimate.DividendsType, 154 DividendsType: dividendsEstimate.DividendsType,
154 DividendsAmount: dividendsEstimate.DividendsAmount, 155 DividendsAmount: dividendsEstimate.DividendsAmount,
  156 + OrderGoodId: dividendsEstimate.OrderGoodId,
  157 + OrderGoodAmount: dividendsEstimate.OrderGoodAmount,
  158 + CooperationContractNumber: dividendsEstimate.CooperationContractNumber,
155 }) 159 })
156 settlementAmount = settlementAmount + dividendsEstimate.DividendsAmount 160 settlementAmount = settlementAmount + dividendsEstimate.DividendsAmount
  161 +
  162 + goodAmountCount = goodAmountCount + dividendsEstimate.OrderGoodAmount
157 } 163 }
158 164
159 // 生成账期结算单号 165 // 生成账期结算单号
@@ -195,6 +201,8 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred @@ -195,6 +201,8 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred
195 CreatedAt: time.Now(), 201 CreatedAt: time.Now(),
196 DeletedAt: time.Time{}, 202 DeletedAt: time.Time{},
197 UpdatedAt: time.Time{}, 203 UpdatedAt: time.Time{},
  204 + GoodAmountCount: goodAmountCount,
  205 + CooperationContractNumber: "", // TODO 弃用
198 } 206 }
199 207
200 if creditAccount, err13 := creditAccountRepository.Save(newCreditAccount); err13 != nil { 208 if creditAccount, err13 := creditAccountRepository.Save(newCreditAccount); err13 != nil {
@@ -11,4 +11,6 @@ type AccountDetail struct { @@ -11,4 +11,6 @@ type AccountDetail struct {
11 OrderGoodId int64 `json:"orderGoodId"` 11 OrderGoodId int64 `json:"orderGoodId"`
12 // 订单产品金额 12 // 订单产品金额
13 OrderGoodAmount float64 `json:"orderGoodAmount"` 13 OrderGoodAmount float64 `json:"orderGoodAmount"`
  14 + // 关联共创合约编号
  15 + CooperationContractNumber string `json:"cooperationContractNumber"`
14 } 16 }