...
|
...
|
@@ -17,14 +17,19 @@ type SuMoneyController struct { |
|
|
func (controller *SuMoneyController) OperationSuMoney() {
|
|
|
suMoneyService := service.NewSuMoneyService(nil)
|
|
|
operationSuMoneyCommand := &command.OperationSuMoneyCommand{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), operationSuMoneyCommand)
|
|
|
|
|
|
data, err := suMoneyService.OperationSuMoney(operationSuMoneyCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
...
|
...
|
@@ -32,15 +37,20 @@ func (controller *SuMoneyController) OperationSuMoney() { |
|
|
func (controller *SuMoneyController) GetSuMoneyTransactionRecord() {
|
|
|
suMoneyService := service.NewSuMoneyService(nil)
|
|
|
getSuMoneyTransactionRecordQuery := &query.GetSuMoneyTransactionRecordQuery{}
|
|
|
|
|
|
suMoneyTransactionRecordId, _ := controller.GetInt64(":suMoneyTransactionRecordId")
|
|
|
getSuMoneyTransactionRecordQuery.SuMoneyTransactionRecordId = suMoneyTransactionRecordId
|
|
|
|
|
|
data, err := suMoneyService.GetSuMoneyTransactionRecord(getSuMoneyTransactionRecordQuery)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
...
|
...
|
@@ -48,14 +58,19 @@ func (controller *SuMoneyController) GetSuMoneyTransactionRecord() { |
|
|
func (controller *SuMoneyController) ExchangeSuMoney() {
|
|
|
suMoneyService := service.NewSuMoneyService(nil)
|
|
|
exchangeSuMoneyCommand := &command.ExchangeSuMoneyCommand{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), exchangeSuMoneyCommand)
|
|
|
|
|
|
data, err := suMoneyService.ExchangeSuMoney(exchangeSuMoneyCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
...
|
...
|
@@ -63,14 +78,19 @@ func (controller *SuMoneyController) ExchangeSuMoney() { |
|
|
func (controller *SuMoneyController) SearchSuMoneyTransactionRecord() {
|
|
|
suMoneyService := service.NewSuMoneyService(nil)
|
|
|
searchSuMoneyTransactionRecordCommand := &command.SearchSuMoneyTransactionRecordCommand{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), searchSuMoneyTransactionRecordCommand)
|
|
|
|
|
|
data, err := suMoneyService.SearchSuMoneyTransactionRecord(searchSuMoneyTransactionRecordCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
...
|
...
|
@@ -78,112 +98,306 @@ func (controller *SuMoneyController) SearchSuMoneyTransactionRecord() { |
|
|
func (controller *SuMoneyController) SuMoneyTransactionRecordStatistics() {
|
|
|
suMoneyService := service.NewSuMoneyService(nil)
|
|
|
suMoneyTransactionRecordStatisticsCommand := &command.SuMoneyTransactionRecordStatisticsCommand{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), suMoneyTransactionRecordStatisticsCommand)
|
|
|
|
|
|
data, err := suMoneyService.SuMoneyTransactionRecordStatistics(suMoneyTransactionRecordStatisticsCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 现金池投入
|
|
|
*/
|
|
|
// 投入现金池
|
|
|
func (controller *SuMoneyController) CashInput() {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
createCashPoolCommand := &command.CreateCashPoolCommand{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), createCashPoolCommand)
|
|
|
|
|
|
data, err := cashPoolService.OperationCashPool(createCashPoolCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 返回兑换活动列表
|
|
|
*/
|
|
|
// 返回现金池
|
|
|
func (controller *SuMoneyController) CashPool() {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
getCashPoolQuery := &query.GetCashPoolQuery{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), getCashPoolQuery)
|
|
|
|
|
|
data, err := cashPoolService.CashPool(getCashPoolQuery)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
// 返回兑换活动列表
|
|
|
func (controller *SuMoneyController) ListExchangeActivities () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
listExchangeCashActivityQuery := &query.ListExchangeCashActivityQuery{}
|
|
|
|
|
|
companyId, _ := controller.GetInt64("companyId")
|
|
|
listExchangeCashActivityQuery.CompanyId = companyId
|
|
|
|
|
|
exchangeCashActivityNameMatch := controller.GetString("activityNameMatch")
|
|
|
listExchangeCashActivityQuery.ExchangeCashActivityNameMatch = exchangeCashActivityNameMatch
|
|
|
|
|
|
offset, _ := controller.GetInt("offset")
|
|
|
listExchangeCashActivityQuery.Offset = offset
|
|
|
|
|
|
limit, _ := controller.GetInt("limit")
|
|
|
listExchangeCashActivityQuery.Limit = limit
|
|
|
|
|
|
data, err := cashPoolService.ListExchangeCashActivity(listExchangeCashActivityQuery)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 更新兑换活动信息
|
|
|
*/
|
|
|
// 更新兑换活动信息
|
|
|
func (controller *SuMoneyController) UpdateExchangeActivities () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
updateExchangeCashActivityCommand := &command.UpdateExchangeCashActivityCommand{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), updateExchangeCashActivityCommand)
|
|
|
|
|
|
activityId, _ := controller.GetInt64(":activityId")
|
|
|
updateExchangeCashActivityCommand.ExchangeCashActivityId = activityId
|
|
|
|
|
|
data, err := cashPoolService.UpdateExchangeCashActivity(updateExchangeCashActivityCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新增兑换活动
|
|
|
*/
|
|
|
// 新增兑换活动
|
|
|
func (controller *SuMoneyController) CreateExchangeActivities () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
createExchangeCashActivityCommand := &command.CreateExchangeCashActivityCommand{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), createExchangeCashActivityCommand)
|
|
|
|
|
|
data, err := cashPoolService.CreateExchangeCashActivity(createExchangeCashActivityCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除兑换活动
|
|
|
*/
|
|
|
// 移除兑换活动
|
|
|
func (controller *SuMoneyController) RemoveExchangeActivities () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
removeExchangeCashActivityCommand := &command.RemoveExchangeCashActivityCommand{}
|
|
|
|
|
|
}
|
|
|
activityId, _ := controller.GetInt64(":activityId")
|
|
|
removeExchangeCashActivityCommand. ExchangeCashActivityId = activityId
|
|
|
|
|
|
data, err := cashPoolService.RemoveExchangeCashActivity(removeExchangeCashActivityCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
/**
|
|
|
* 搜索兑换素币活动
|
|
|
*/
|
|
|
func (controller *SuMoneyController) searchExchangeActivities () {
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 兑换活动数据统计
|
|
|
*/
|
|
|
func (controller *SuMoneyController) exchangeActivitiesStatistics () {
|
|
|
// 返回兑换现金活动
|
|
|
func (controller *SuMoneyController) GerExchangeCashActivity () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
getExchangeCashActivityQuery := &query.GetExchangeCashActivityQuery{}
|
|
|
|
|
|
activityId, _ := controller.GetInt64(":activityId")
|
|
|
getExchangeCashActivityQuery.ExchangeCashActivityId = activityId
|
|
|
|
|
|
data, err := cashPoolService.GetExchangeCashActivity(getExchangeCashActivityQuery)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取素币兑换清单
|
|
|
*/
|
|
|
// 返回兑换现金人员列表
|
|
|
func (controller *SuMoneyController) ListExchangeList () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
listExchangeCashListQuery := &query.ListExchangeCashPersonQuery{}
|
|
|
|
|
|
activityId, _ := controller.GetInt64("activityId")
|
|
|
listExchangeCashListQuery.ExchangeCashActivityId = activityId
|
|
|
|
|
|
exchangeCashPersonNameMatch := controller.GetString("personNameMatch")
|
|
|
listExchangeCashListQuery.ExchangeCashPersonNameMatch = exchangeCashPersonNameMatch
|
|
|
|
|
|
offset, _ := controller.GetInt("offset")
|
|
|
listExchangeCashListQuery.Offset = offset
|
|
|
|
|
|
limit, _ := controller.GetInt("limit")
|
|
|
listExchangeCashListQuery.Limit = limit
|
|
|
|
|
|
data, err := cashPoolService.ListExchangeCashPerson(listExchangeCashListQuery)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新增素币兑换清单
|
|
|
*/
|
|
|
// 新增兑换现金人员
|
|
|
func (controller *SuMoneyController) CreateExchangeList () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
createExchangeCashPersonCommand := &command.CreateExchangeCashPersonCommand{}
|
|
|
|
|
|
json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), createExchangeCashPersonCommand)
|
|
|
|
|
|
data, err := cashPoolService.CreateExchangeCashPerson(createExchangeCashPersonCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
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")
|
|
|
updateExchangeCashPersonCommand. ExchangeCashPersonId = personId
|
|
|
|
|
|
data, err := cashPoolService.UpdateExchangeCashPerson(updateExchangeCashPersonCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除素币兑换清单
|
|
|
*/
|
|
|
// 移除兑换现金人员
|
|
|
func (controller *SuMoneyController) RemoveExchangeList () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
removeExchangeCashPersonCommand := &command.RemoveExchangeCashPersonCommand{}
|
|
|
|
|
|
}
|
|
|
personId, _ := controller.GetInt64(":personId")
|
|
|
removeExchangeCashPersonCommand.ExchangeCashPersonId = personId
|
|
|
|
|
|
/**
|
|
|
* 搜索素币兑换清单
|
|
|
*/
|
|
|
func (controller *SuMoneyController) searchExchangeList () {
|
|
|
data, err := cashPoolService.RemoveExchangeCashPerson(removeExchangeCashPersonCommand)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导出素币兑换清单
|
|
|
*/
|
|
|
func (controller *SuMoneyController) ExportExchangeList () {
|
|
|
// 返回素币兑换人员
|
|
|
func (controller *SuMoneyController) GetExchangeCashPerson () {
|
|
|
cashPoolService := service.NewCashPoolService(nil)
|
|
|
getExchangeCashPersonQuery := &query.GetExchangeCashPersonQuery{}
|
|
|
|
|
|
personId, _ := controller.GetInt64(":personId")
|
|
|
getExchangeCashPersonQuery.ExchangeCashPersonId = personId
|
|
|
|
|
|
data, err := cashPoolService.GetExchangeCashPerson(getExchangeCashPersonQuery)
|
|
|
|
|
|
var response utils.JsonResponse
|
|
|
|
|
|
if err != nil {
|
|
|
response = utils.ResponseError(controller.Ctx, err)
|
|
|
} else {
|
|
|
response = utils.ResponseData(controller.Ctx, data)
|
|
|
}
|
|
|
|
|
|
controller.Data["json"] = response
|
|
|
controller.ServeJSON()
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 导入素币兑换清单
|
|
|
*/
|
|
|
// TODO 导入素币兑换清单
|
|
|
func (controller *SuMoneyController) ImportExchangeList () {
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|