|
@@ -394,19 +394,17 @@ func (controller *SuMoneyController) ExchangeCashListRanking() { |
|
@@ -394,19 +394,17 @@ func (controller *SuMoneyController) ExchangeCashListRanking() { |
|
394
|
// 导入兑换素币清单
|
394
|
// 导入兑换素币清单
|
|
395
|
func (controller *SuMoneyController) ImportExchangeList () {
|
395
|
func (controller *SuMoneyController) ImportExchangeList () {
|
|
396
|
cashPoolService := service.NewCashPoolService(nil)
|
396
|
cashPoolService := service.NewCashPoolService(nil)
|
|
397
|
- importExchangeCashListCommand := &command.ImportExchangeCashListCommand{}
|
|
|
|
398
|
-
|
|
|
|
399
|
- json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), importExchangeCashListCommand)
|
|
|
|
400
|
-
|
|
|
|
401
|
- //where := controller.GetString("where")
|
|
|
|
402
|
- fmt.Printf("%+v\n", importExchangeCashListCommand)
|
|
|
|
403
|
- activityId, _ := strconv.ParseInt(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["activityId"].(string), 10, 64)
|
|
|
|
404
|
- fmt.Print(activityId, "\n")
|
|
|
|
405
|
- fmt.Print(int64(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["uid"].(float64)), "\n")
|
|
|
|
406
|
-
|
397
|
+ //importExchangeCashListCommand := &command.ImportExchangeCashListCommand{}
|
|
|
|
398
|
+ //json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), importExchangeCashListCommand)
|
|
|
|
399
|
+ where := controller.GetString("where")
|
|
|
|
400
|
+ //fmt.Printf("%+v\n", importExchangeCashListCommand)
|
|
|
|
401
|
+ //activityId, _ := strconv.ParseInt(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["activityId"].(string), 10, 64)
|
|
|
|
402
|
+ //fmt.Print(activityId, "\n")
|
|
|
|
403
|
+ //fmt.Print(int64(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["uid"].(float64)), "\n")
|
|
407
|
file, h, _ := controller.GetFile("file")
|
404
|
file, h, _ := controller.GetFile("file")
|
|
408
|
|
405
|
|
|
409
|
- //jsonMap := make(map[string]interface{})
|
406
|
+ jsonMap := make(map[string]interface{})
|
|
|
|
407
|
+ _ = json.Unmarshal([]byte(where), &jsonMap)
|
|
410
|
|
408
|
|
|
411
|
//if reflect.TypeOf(where).Kind() == reflect.TypeOf(jsonMap).Kind() { // 传入json
|
409
|
//if reflect.TypeOf(where).Kind() == reflect.TypeOf(jsonMap).Kind() { // 传入json
|
|
412
|
// jsonMap = map[string]interface{}{
|
410
|
// jsonMap = map[string]interface{}{
|
|
@@ -501,10 +499,10 @@ func (controller *SuMoneyController) ImportExchangeList () { |
|
@@ -501,10 +499,10 @@ func (controller *SuMoneyController) ImportExchangeList () { |
|
501
|
if i > 2 && len(row) > 1 {
|
499
|
if i > 2 && len(row) > 1 {
|
|
502
|
// 创建兑换清单命令
|
500
|
// 创建兑换清单命令
|
|
503
|
createExchangeCashPersonCommand := &command.CreateExchangeCashPersonCommand{}
|
501
|
createExchangeCashPersonCommand := &command.CreateExchangeCashPersonCommand{}
|
|
504
|
- //createExchangeCashPersonCommand.ExchangeCashActivityId, _ = strconv.ParseInt(jsonMap["activityId"].(string), 10, 64 )
|
|
|
|
505
|
- createExchangeCashPersonCommand.ExchangeCashActivityId, _ = strconv.ParseInt(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["activityId"].(string), 10, 64)
|
|
|
|
506
|
- //createExchangeCashPersonCommand.Operator = int64(jsonMap["uid"].(float64))
|
|
|
|
507
|
- createExchangeCashPersonCommand.Operator = int64(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["uid"].(float64))
|
502
|
+ createExchangeCashPersonCommand.ExchangeCashActivityId, _ = strconv.ParseInt(jsonMap["activityId"].(string), 10, 64 )
|
|
|
|
503
|
+ //createExchangeCashPersonCommand.ExchangeCashActivityId, _ = strconv.ParseInt(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["activityId"].(string), 10, 64)
|
|
|
|
504
|
+ createExchangeCashPersonCommand.Operator = int64(jsonMap["uid"].(float64))
|
|
|
|
505
|
+ //createExchangeCashPersonCommand.Operator = int64(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["uid"].(float64))
|
|
508
|
createExchangeCashPersonCommand.PersonName = row[0]
|
506
|
createExchangeCashPersonCommand.PersonName = row[0]
|
|
509
|
createExchangeCashPersonCommand.PersonAccount = row[1]
|
507
|
createExchangeCashPersonCommand.PersonAccount = row[1]
|
|
510
|
r2, _ := strconv.ParseFloat(row[2], 64)
|
508
|
r2, _ := strconv.ParseFloat(row[2], 64)
|