...
|
...
|
@@ -153,39 +153,41 @@ func (suMoneyService *SuMoneyService) SearchSuMoneyTransactionRecord(searchSuMon |
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
//for _, suMoneyTransactionRecord := range suMoneyTransactionRecords {
|
|
|
// contributions := []int{2,3,4}
|
|
|
// suMoney := []int{1,2,3,4,5}
|
|
|
// // 查询贡献值时规范描述
|
|
|
// if utils.StringSliceEqualBCE(searchSuMoneyTransactionRecordCommand.RecordTypes, contributions) {
|
|
|
// switch suMoneyTransactionRecord.RecordType {
|
|
|
// case 2: // 任务奖励
|
|
|
// suMoneyTransactionRecord.RecordDescription = suMoneyTransactionRecord.RecordDescription + "奖励"
|
|
|
// case 3: // 增加
|
|
|
// suMoneyTransactionRecord.RecordDescription = "增加贡献"
|
|
|
// case 4: // 扣除
|
|
|
// suMoneyTransactionRecord.RecordDescription = "扣除贡献"
|
|
|
// }
|
|
|
// }
|
|
|
// // 查询素币值时规范描述
|
|
|
// if utils.StringSliceEqualBCE(searchSuMoneyTransactionRecordCommand.RecordTypes, suMoney) {
|
|
|
// switch suMoneyTransactionRecord.RecordType {
|
|
|
// case 1: // 兑换物资
|
|
|
// suMoneyTransactionRecord.RecordDescription = "兑换物资"
|
|
|
// case 2: // 任务奖励
|
|
|
// suMoneyTransactionRecord.RecordDescription = suMoneyTransactionRecord.RecordDescription + "奖励"
|
|
|
// case 3: // 增加
|
|
|
// suMoneyTransactionRecord.RecordDescription = "增加素币"
|
|
|
// case 4: // 扣除
|
|
|
// suMoneyTransactionRecord.RecordDescription = "扣除素币"
|
|
|
// case 5: // 兑换现金
|
|
|
// suMoneyTransactionRecord.RecordDescription = "素币兑换现金"
|
|
|
// }
|
|
|
// }
|
|
|
//}
|
|
|
var suMoneyTransactionRecordsFormat []interface{}
|
|
|
//loc, _ := time.LoadLocation("Local")
|
|
|
for _, suMoneyTransactionRecord := range suMoneyTransactionRecords {
|
|
|
//dt, _ := ("2006-01-02 15:04:05", suMoneyTransactionRecord.CreateTime, loc)
|
|
|
suMoneyTransactionRecordFormat := map[string]interface{} {
|
|
|
"suMoneyTransactionRecordId": suMoneyTransactionRecord.SuMoneyTransactionRecordId,
|
|
|
"recordType": suMoneyTransactionRecord.RecordType,
|
|
|
"employee": map[string]interface{} {
|
|
|
"uid": suMoneyTransactionRecord.Employee.Uid,
|
|
|
"employeeName": suMoneyTransactionRecord.Employee.EmployeeName,
|
|
|
"employeeAccount": suMoneyTransactionRecord.Employee.EmployeeAccount,
|
|
|
"employeeAvatarUrl": suMoneyTransactionRecord.Employee.EmployeeAvatarUrl,
|
|
|
"isPrincipal": suMoneyTransactionRecord.Employee.IsPrincipal,
|
|
|
},
|
|
|
"suMoneyBeforeTransaction": suMoneyTransactionRecord.SuMoneyBeforeTransaction,
|
|
|
"currentSuMoney": suMoneyTransactionRecord.CurrentSuMoney,
|
|
|
"suMoney": suMoneyTransactionRecord.SuMoney,
|
|
|
"cashBeforeTransaction": suMoneyTransactionRecord.CashBeforeTransaction,
|
|
|
"currentCash": suMoneyTransactionRecord.CurrentCash,
|
|
|
"cash": suMoneyTransactionRecord.Cash,
|
|
|
"operator": map[string]interface{} {
|
|
|
"uid": suMoneyTransactionRecord.Operator.Uid,
|
|
|
"employeeName": suMoneyTransactionRecord.Operator.EmployeeName,
|
|
|
"employeeAccount": suMoneyTransactionRecord.Operator.EmployeeAccount,
|
|
|
"employeeAvatarUrl": suMoneyTransactionRecord.Operator.EmployeeAvatarUrl,
|
|
|
"isPrincipal": suMoneyTransactionRecord.Operator.IsPrincipal,
|
|
|
},
|
|
|
"recordDescription": suMoneyTransactionRecord.RecordDescription,
|
|
|
"createTime": suMoneyTransactionRecord.CreateTime.Location(),
|
|
|
}
|
|
|
suMoneyTransactionRecordsFormat = append(suMoneyTransactionRecordsFormat, suMoneyTransactionRecordFormat)
|
|
|
}
|
|
|
return map[string]interface{}{
|
|
|
"count": count,
|
|
|
"suMoneyTransactionRecords": suMoneyTransactionRecords,
|
|
|
"suMoneyTransactionRecords": suMoneyTransactionRecordsFormat,
|
|
|
}, nil
|
|
|
}
|
|
|
}
|
...
|
...
|
|