...
|
...
|
@@ -245,7 +245,7 @@ func (controller *SuMoneyController) GetExchangeCashActivity () { |
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
// 返回兑换现金人员列表
|
|
|
// 返回兑换素币清单列表
|
|
|
func (controller *SuMoneyController) ListExchangeList () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
listExchangeCashListQuery := &query.ListExchangeCashPersonQuery{}
|
...
|
...
|
@@ -271,7 +271,7 @@ func (controller *SuMoneyController) ListExchangeList () { |
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
// 新增兑换现金人员
|
|
|
// 返回兑换素币清单
|
|
|
func (controller *SuMoneyController) CreateExchangeList () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
createExchangeCashPersonCommand := &command.CreateExchangeCashPersonCommand{}
|
...
|
...
|
@@ -287,12 +287,12 @@ func (controller *SuMoneyController) CreateExchangeList () { |
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
// 更新兑换现金人员
|
|
|
// 更新兑换素币清单
|
|
|
func (controller *SuMoneyController) UpdateExchangeList () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
updateExchangeCashPersonCommand := &command.UpdateExchangeCashPersonCommand{}
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), updateExchangeCashPersonCommand)
|
|
|
personId, _ := controller.GetInt64(":personId")
|
|
|
personId, _ := controller.GetInt64(":listId")
|
|
|
updateExchangeCashPersonCommand.ListId = personId
|
|
|
data, err := cashPoolService.UpdateExchangeCashPerson(updateExchangeCashPersonCommand)
|
|
|
var response utils.JsonResponse
|
...
|
...
|
@@ -305,7 +305,7 @@ func (controller *SuMoneyController) UpdateExchangeList () { |
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
// 移除兑换现金人员
|
|
|
// 移除兑换素币清单
|
|
|
func (controller *SuMoneyController) RemoveExchangeCashPerson() {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
removeExchangeCashPersonCommand := &command.RemoveExchangeCashPersonCommand{}
|
...
|
...
|
@@ -322,7 +322,7 @@ func (controller *SuMoneyController) RemoveExchangeCashPerson() { |
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
// 返回素币兑换人员
|
|
|
// 返回兑换素币清单
|
|
|
func (controller *SuMoneyController) GetExchangeCashPerson () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
getExchangeCashPersonQuery := &query.GetExchangeCashPersonQuery{}
|
...
|
...
|
@@ -339,14 +339,13 @@ func (controller *SuMoneyController) GetExchangeCashPerson () { |
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
// 导入素币兑换清单
|
|
|
// 导入兑换素币清单
|
|
|
func (controller *SuMoneyController) ImportExchangeList () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
createExchangeCashPersonCommand := &command.CreateExchangeCashPersonCommand{}
|
|
|
activityId, _ := controller.GetInt64("activityId")
|
|
|
file, h, _ := controller.GetFile("file") //获取上传的文件
|
|
|
ext := path.Ext(h.Filename)
|
|
|
//验证后缀名是否符合要求
|
|
|
AllowExtMap := map[string]bool{
|
|
|
".xlsx":true,
|
|
|
}
|
...
|
...
|
@@ -359,12 +358,9 @@ func (controller *SuMoneyController) ImportExchangeList () { |
|
|
fmt.Println(err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
dataList := make([]interface{}, 0)
|
|
|
rows, _ := xlsx.GetRows("Sheet1")
|
|
|
|
|
|
for i, row := range rows {
|
|
|
if i > 0 {
|
|
|
for _, _ = range row {
|
...
|
...
|
@@ -382,13 +378,11 @@ func (controller *SuMoneyController) ImportExchangeList () { |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
ret := map[string]interface{}{
|
|
|
"count": len(dataList),
|
|
|
"people": dataList,
|
|
|
}
|
|
|
response = utils.ResponseData(controller.Ctx, ret)
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|