作者 陈志颖

fix:导入

@@ -477,3 +477,9 @@ @@ -477,3 +477,9 @@
477 } 477 }
478 2020/11/22 15:57:29.242 [D] [server.go:2843] <====Send RequestId:POST./statistics/employees-ranking-list.1606031849174719000 BodyData:{"code":0,"data":{"currentEmployeeContributions":null,"currentEmployeeWealth":null,"employeesContributions":null,"employeesWealth":null},"msg":"ok"} 478 2020/11/22 15:57:29.242 [D] [server.go:2843] <====Send RequestId:POST./statistics/employees-ranking-list.1606031849174719000 BodyData:{"code":0,"data":{"currentEmployeeContributions":null,"currentEmployeeWealth":null,"employeesContributions":null,"employeesWealth":null},"msg":"ok"}
479 2020/11/22 15:57:29.242 [D] [server.go:1925] | 127.0.0.1| 200 | 67.591516ms| match| POST  /statistics/employees-ranking-list r:/statistics/employees-ranking-list 479 2020/11/22 15:57:29.242 [D] [server.go:1925] | 127.0.0.1| 200 | 67.591516ms| match| POST  /statistics/employees-ranking-list r:/statistics/employees-ranking-list
  480 +2020/11/22 17:33:08.740 [I] [???:0] http server Running on http://:8082
  481 +2020/11/22 17:34:08.026 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./cash-pool/activity/exchange-list/import.1606037648026939000
  482 + Auth=
  483 + BodyData:
  484 +2020/11/22 17:34:08.225 [D] [server.go:2843] <====Send RequestId:POST./cash-pool/activity/exchange-list/import.1606037648026939000 BodyData:{"code":0,"data":{"fail":null,"successCount":1},"msg":"ok"}
  485 +2020/11/22 17:34:08.225 [D] [server.go:1925] | 127.0.0.1| 200 | 198.53039ms| match| POST  /cash-pool/activity/exchange-list/import r:/cash-pool/activity/exchange-list/import
@@ -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)