作者 陈志颖

fix:导出素币流水添加正负号

@@ -724,14 +724,24 @@ func (controller *SuMoneyController) ExportSuMoneyTransactionRecord() { @@ -724,14 +724,24 @@ func (controller *SuMoneyController) ExportSuMoneyTransactionRecord() {
724 var data []map[string]interface{} 724 var data []map[string]interface{}
725 records, err := suMoneyService.ListSuMoneyTransactionRecordById(exportTransactionRecordCommand) 725 records, err := suMoneyService.ListSuMoneyTransactionRecordById(exportTransactionRecordCommand)
726 for _, record := range records { 726 for _, record := range records {
727 - p := map[string]interface{} { 727 + p := map[string]interface{}{}
  728 + if record.RecordType == 2 || record.RecordType == 3 || record.RecordType == 6 {
  729 + p = map[string]interface{} {
728 "name": record.Employee.EmployeeName, 730 "name": record.Employee.EmployeeName,
729 "current_su_money": record.CurrentSuMoney, 731 "current_su_money": record.CurrentSuMoney,
730 - "record": record.SuMoney, 732 + "record": "+" + fmt.Sprintf("%.2f", record.SuMoney),
731 "create_time": record.CreateTime.Local().Format("2006/01/02 15:04:05"), 733 "create_time": record.CreateTime.Local().Format("2006/01/02 15:04:05"),
732 "operator": record.Operator.EmployeeName, 734 "operator": record.Operator.EmployeeName,
733 } 735 }
734 - 736 + } else {
  737 + p = map[string]interface{} {
  738 + "name": record.Employee.EmployeeName,
  739 + "current_su_money": record.CurrentSuMoney,
  740 + "record": "-" + fmt.Sprintf("%.2f", record.SuMoney),
  741 + "create_time": record.CreateTime.Local().Format("2006/01/02 15:04:05"),
  742 + "operator": record.Operator.EmployeeName,
  743 + }
  744 + }
735 data = append(data, p) 745 data = append(data, p)
736 } 746 }
737 if err != nil { 747 if err != nil {