作者 陈志颖

fix:导入

... ... @@ -477,3 +477,9 @@
}
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"}
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
2020/11/22 17:33:08.740 [I] [???:0] http server Running on http://:8082
2020/11/22 17:34:08.026 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./cash-pool/activity/exchange-list/import.1606037648026939000
Auth=
BodyData:
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"}
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() {
// 导入兑换素币清单
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)
... ...