...
|
...
|
@@ -394,19 +394,17 @@ func (controller *SuMoneyController) ExchangeCashListRanking() { |
|
|
// 导入兑换素币清单
|
|
|
func (controller *SuMoneyController) ImportExchangeList () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
importExchangeCashListCommand := &command.ImportExchangeCashListCommand{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), importExchangeCashListCommand)
|
|
|
|
|
|
//where := controller.GetString("where")
|
|
|
fmt.Printf("%+v\n", importExchangeCashListCommand)
|
|
|
activityId, _ := strconv.ParseInt(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["activityId"].(string), 10, 64)
|
|
|
fmt.Print(activityId, "\n")
|
|
|
fmt.Print(int64(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["uid"].(float64)), "\n")
|
|
|
|
|
|
//importExchangeCashListCommand := &command.ImportExchangeCashListCommand{}
|
|
|
//json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), importExchangeCashListCommand)
|
|
|
where := controller.GetString("where")
|
|
|
//fmt.Printf("%+v\n", importExchangeCashListCommand)
|
|
|
//activityId, _ := strconv.ParseInt(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["activityId"].(string), 10, 64)
|
|
|
//fmt.Print(activityId, "\n")
|
|
|
//fmt.Print(int64(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["uid"].(float64)), "\n")
|
|
|
file, h, _ := controller.GetFile("file")
|
|
|
|
|
|
//jsonMap := make(map[string]interface{})
|
|
|
jsonMap := make(map[string]interface{})
|
|
|
_ = json.Unmarshal([]byte(where), &jsonMap)
|
|
|
|
|
|
//if reflect.TypeOf(where).Kind() == reflect.TypeOf(jsonMap).Kind() { // 传入json
|
|
|
// jsonMap = map[string]interface{}{
|
...
|
...
|
@@ -501,10 +499,10 @@ func (controller *SuMoneyController) ImportExchangeList () { |
|
|
if i > 2 && len(row) > 1 {
|
|
|
// 创建兑换清单命令
|
|
|
createExchangeCashPersonCommand := &command.CreateExchangeCashPersonCommand{}
|
|
|
//createExchangeCashPersonCommand.ExchangeCashActivityId, _ = strconv.ParseInt(jsonMap["activityId"].(string), 10, 64 )
|
|
|
createExchangeCashPersonCommand.ExchangeCashActivityId, _ = strconv.ParseInt(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["activityId"].(string), 10, 64)
|
|
|
//createExchangeCashPersonCommand.Operator = int64(jsonMap["uid"].(float64))
|
|
|
createExchangeCashPersonCommand.Operator = int64(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["uid"].(float64))
|
|
|
createExchangeCashPersonCommand.ExchangeCashActivityId, _ = strconv.ParseInt(jsonMap["activityId"].(string), 10, 64 )
|
|
|
//createExchangeCashPersonCommand.ExchangeCashActivityId, _ = strconv.ParseInt(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["activityId"].(string), 10, 64)
|
|
|
createExchangeCashPersonCommand.Operator = int64(jsonMap["uid"].(float64))
|
|
|
//createExchangeCashPersonCommand.Operator = int64(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["uid"].(float64))
|
|
|
createExchangeCashPersonCommand.PersonName = row[0]
|
|
|
createExchangeCashPersonCommand.PersonAccount = row[1]
|
|
|
r2, _ := strconv.ParseFloat(row[2], 64)
|
...
|
...
|
|