作者 陈志颖

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

... ... @@ -724,14 +724,24 @@ func (controller *SuMoneyController) ExportSuMoneyTransactionRecord() {
var data []map[string]interface{}
records, err := suMoneyService.ListSuMoneyTransactionRecordById(exportTransactionRecordCommand)
for _, record := range records {
p := map[string]interface{} {
"name": record.Employee.EmployeeName,
"current_su_money": record.CurrentSuMoney,
"record": record.SuMoney,
"create_time": record.CreateTime.Local().Format("2006/01/02 15:04:05"),
"operator": record.Operator.EmployeeName,
p := map[string]interface{}{}
if record.RecordType == 2 || record.RecordType == 3 || record.RecordType == 6 {
p = map[string]interface{} {
"name": record.Employee.EmployeeName,
"current_su_money": record.CurrentSuMoney,
"record": "+" + fmt.Sprintf("%.2f", record.SuMoney),
"create_time": record.CreateTime.Local().Format("2006/01/02 15:04:05"),
"operator": record.Operator.EmployeeName,
}
} else {
p = map[string]interface{} {
"name": record.Employee.EmployeeName,
"current_su_money": record.CurrentSuMoney,
"record": "-" + fmt.Sprintf("%.2f", record.SuMoney),
"create_time": record.CreateTime.Local().Format("2006/01/02 15:04:05"),
"operator": record.Operator.EmployeeName,
}
}
data = append(data, p)
}
if err != nil {
... ...