作者 陈志颖

fix:修复收支入参问题

@@ -212,7 +212,7 @@ func (suMoneyService *SuMoneyService) ContributionsTransactionRecordStatistics(c @@ -212,7 +212,7 @@ func (suMoneyService *SuMoneyService) ContributionsTransactionRecordStatistics(c
212 employeeDao = value 212 employeeDao = value
213 } 213 }
214 214
215 - if calculateResult, err := employeeDao.CalculateSuMoneyTransactionRecord(contributionsTransactionRecordStatisticsCommand.Uid, contributionsTransactionRecordStatisticsCommand.TransactionStartTime, contributionsTransactionRecordStatisticsCommand.TransactionEndTime); err != nil { 215 + if calculateResult, err := employeeDao.CalculateContributionsTransactionRecord(contributionsTransactionRecordStatisticsCommand.Uid, contributionsTransactionRecordStatisticsCommand.TransactionStartTime, contributionsTransactionRecordStatisticsCommand.TransactionEndTime); err != nil {
216 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 216 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
217 } else { 217 } else {
218 if err := transactionContext.CommitTransaction(); err != nil { 218 if err := transactionContext.CommitTransaction(); err != nil {
@@ -261,7 +261,7 @@ func (dao *EmployeeDao) CalculateContributionsTransactionRecord(uid int64, trans @@ -261,7 +261,7 @@ func (dao *EmployeeDao) CalculateContributionsTransactionRecord(uid int64, trans
261 if err := tx.Model(suMoneyTransactionRecordModel). 261 if err := tx.Model(suMoneyTransactionRecordModel).
262 ColumnExpr("sum(su_money_transaction_record.su_money) AS expend_su_money"). 262 ColumnExpr("sum(su_money_transaction_record.su_money) AS expend_su_money").
263 Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid). 263 Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid).
264 - Where(`su_money_transaction_record.record_type =`, 4). 264 + Where(`su_money_transaction_record.record_type = ?`, 4).
265 Where(`su_money_transaction_record.create_time > ?`, transactionStartTime). 265 Where(`su_money_transaction_record.create_time > ?`, transactionStartTime).
266 Where(`su_money_transaction_record.create_time < ?`, transactionEndTime). 266 Where(`su_money_transaction_record.create_time < ?`, transactionEndTime).
267 Select(&expendContributions); err != nil { 267 Select(&expendContributions); err != nil {
@@ -619,7 +619,6 @@ func (controller *SuMoneyController) ExportSuMoneyTransactionRecord() { @@ -619,7 +619,6 @@ func (controller *SuMoneyController) ExportSuMoneyTransactionRecord() {
619 columnNum := 0 //列数 619 columnNum := 0 //列数
620 for _, vv := range v { 620 for _, vv := range v {
621 sheetPosition := cells[columnNum] + strconv.Itoa(lineNum+2) 621 sheetPosition := cells[columnNum] + strconv.Itoa(lineNum+2)
622 - //f.SetCellValue("Sheet1", sheetPosition, vv) // 所有字段保存为字符串类型  
623 switch vv.(type) { 622 switch vv.(type) {
624 case string: 623 case string:
625 f.SetCellValue("Sheet1", sheetPosition, vv.(string)) 624 f.SetCellValue("Sheet1", sheetPosition, vv.(string))
@@ -631,7 +630,7 @@ func (controller *SuMoneyController) ExportSuMoneyTransactionRecord() { @@ -631,7 +630,7 @@ func (controller *SuMoneyController) ExportSuMoneyTransactionRecord() {
631 f.SetCellValue("Sheet1", sheetPosition, vv.(float64)) 630 f.SetCellValue("Sheet1", sheetPosition, vv.(float64))
632 break 631 break
633 case time.Time: 632 case time.Time:
634 - f.SetCellValue("Sheet1", sheetPosition, vv.(time.Time)) 633 + f.SetCellValue("Sheet1", sheetPosition, vv)
635 break 634 break
636 } 635 }
637 columnNum++ 636 columnNum++