作者 陈志颖

test:

@@ -397,11 +397,16 @@ func (controller *SuMoneyController) ImportExchangeList () { @@ -397,11 +397,16 @@ func (controller *SuMoneyController) ImportExchangeList () {
397 //importExchangeCashListCommand := &command.ImportExchangeCashListCommand{} 397 //importExchangeCashListCommand := &command.ImportExchangeCashListCommand{}
398 //json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), importExchangeCashListCommand) 398 //json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), importExchangeCashListCommand)
399 //fmt.Printf("命令:%+v\n", importExchangeCashListCommand.Where) 399 //fmt.Printf("命令:%+v\n", importExchangeCashListCommand.Where)
400 - fmt.Print(controller.GetString("where"), "\n") 400 + //fmt.Print(controller.GetString("where"), "\n")
401 where := controller.GetString("where") 401 where := controller.GetString("where")
402 //fmt.Print(reflect.TypeOf(importExchangeCashListCommand.Where), "\n") 402 //fmt.Print(reflect.TypeOf(importExchangeCashListCommand.Where), "\n")
403 file, h, _ := controller.GetFile("file") 403 file, h, _ := controller.GetFile("file")
404 404
  405 + jsonMap := make(map[string]interface{})
  406 + err := json.Unmarshal([]byte(where), &jsonMap)
  407 +
  408 + fmt.Print(jsonMap["activityId"])
  409 +
405 // 错误信息返回 410 // 错误信息返回
406 var response utils.JsonResponse 411 var response utils.JsonResponse
407 412
@@ -481,9 +486,8 @@ func (controller *SuMoneyController) ImportExchangeList () { @@ -481,9 +486,8 @@ func (controller *SuMoneyController) ImportExchangeList () {
481 if i > 2 && len(row) > 1 { 486 if i > 2 && len(row) > 1 {
482 // 创建兑换清单命令 487 // 创建兑换清单命令
483 createExchangeCashPersonCommand := &command.CreateExchangeCashPersonCommand{} 488 createExchangeCashPersonCommand := &command.CreateExchangeCashPersonCommand{}
484 - //createExchangeCashPersonCommand.ExchangeCashActivityId = importExchangeCashListCommand.Where["activityId"].(int64)  
485 - createExchangeCashPersonCommand.ExchangeCashActivityId = int64(where[0])  
486 - createExchangeCashPersonCommand.Operator = int64(where[1]) 489 + createExchangeCashPersonCommand.ExchangeCashActivityId, _ = strconv.ParseInt(jsonMap["activityId"].(string), 10, 64 )
  490 + createExchangeCashPersonCommand.Operator = int64(jsonMap["uid"].(float64))
487 createExchangeCashPersonCommand.PersonName = row[0] 491 createExchangeCashPersonCommand.PersonName = row[0]
488 createExchangeCashPersonCommand.PersonAccount = row[1] 492 createExchangeCashPersonCommand.PersonAccount = row[1]
489 r2, _ := strconv.ParseFloat(row[2], 64) 493 r2, _ := strconv.ParseFloat(row[2], 64)