作者 Your Name

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev

# Conflicts:
#	pkg/infrastructure/service_gateway/allied_creation_cooperation/param_credit_account.go
... ... @@ -10,6 +10,7 @@ import (
type CreditAccountGetCommand struct {
//操作人
Operator domain.Operator `json:"-"`
CreditAccountId int
}
func (cmd *CreditAccountGetCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,6 +10,11 @@ import (
type CreditAccountPayCommand struct {
//操作人
Operator domain.Operator `json:"-"`
CreditAccountId int
// 账期结算实付金额
ActuallyPaidAmount float64 `cname:"账期结算实付金额" json:"actuallyPaidAmount" valid:"Required"`
// 备注
Remarks string `cname:"备注" json:"remarks" valid:"Required"`
}
func (cmd *CreditAccountPayCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,6 +10,12 @@ import (
type CreditAccountPaySearchCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 查询偏离量
PageNumber int64 `json:"pageNumber"`
// 查询限制
PageSize int64 `json:"pageSize" valid:"Required"`
// 账期结算支付状态,1待支付,2已支付 0全部
PaymentStatus int32 `json:"paymentStatus"`
}
func (cmd *CreditAccountPaySearchCommand) Valid(validation *validation.Validation) {
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
)
// CompanyCreditAccountService 企业端账期结算
type CompanyCreditAccountService struct {
}
// IndexStatistics TODO:企业的账期结算列表(分红信息按合约划分)
func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
PaymentStatus: cmd.PaymentStatus,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
// IndexStatistics TODO:企业的账期结算明细
func (srv CompanyCreditAccountService) CreditAccountGet(userMenusCommand *command.CreditAccountGetCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
}
// IndexStatistics TODO:企业的账期结算支付
func (srv CompanyCreditAccountService) CreditAccountPay(userMenusCommand *command.CreditAccountPayCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
}
// IndexStatistics TODO:企业分红结算支付记录
func (srv CompanyCreditAccountService) CreditAccountPaySearch(userMenusCommand *command.CreditAccountPaySearchCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
}
... ... @@ -9,7 +9,7 @@ import (
type CompanyDividendsService struct {
}
// IndexStatistics TODO:企业的合约列表(分红信息按合约划分)
// GetDividendContracts 企业的合约列表(分红信息按合约划分)
func (srv CompanyStatisticsService) GetDividendContracts(userMenusCommand *command.GetDividendContractsCommand) (interface{}, error) {
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
// userMenusCommand.Operator)
... ... @@ -30,7 +30,7 @@ func (srv CompanyStatisticsService) GetDividendContracts(userMenusCommand *comma
}, nil
}
// IndexStatistics TODO:企业的合约统计(分红统计)
// DividendsStatistics TODO:企业的合约统计(分红统计)
func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *command.DividendsStatisticsCommand) (interface{}, error) {
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
// userMenusCommand.Operator)
... ... @@ -48,7 +48,7 @@ func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *comman
}, nil
}
// IndexStatistics 企业的合约明细列表(分红预算信息)
// SearchDividendsEstimates 企业的合约明细列表(分红预算信息)
func (srv CompanyStatisticsService) SearchDividendsEstimates(userMenusCommand *command.SearchDividendsEstimatesCommand) (interface{}, error) {
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
// userMenusCommand.Operator)
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
)
// 企业端统计
type CompanyStatisticsService struct {
}
// IndexStatistics TODO:首页统计 (入口页面统计数据)
func (srv CompanyStatisticsService) IndexStatistics(userMenusCommand *command.IndexStatisticsCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
}
// IndexStatistics TODO:共创人员统计(共创人员明细)
func (srv CompanyStatisticsService) CooperationPersonStatistics(userMenusCommand *command.CooperationPersonStatisticsCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
}
// IndexStatistics TODO:产品统计排行榜 年月榜
func (srv CompanyStatisticsService) GoodsStatistics(userMenusCommand *command.GoodsStatisticsCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
}
// IndexStatistics TODO:共创分红支出统计
func (srv CompanyStatisticsService) CooperationDividendsStatistics(userMenusCommand *command.CooperationDividendsStatisticsCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
}
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// CompanyCreditAccountService 企业端账期结算
type CompanyCreditAccountService struct {
}
// CreditAccountSearch 企业的账期结算列表
func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
PaymentStatus: cmd.PaymentStatus,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
// CreditAccountGet 企业的账期结算明细
func (srv CompanyCreditAccountService) CreditAccountGet(cmd *command.CreditAccountGetCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountGet(allied_creation_cooperation.ReqCreditAccountGet{
CreditAccountId: cmd.CreditAccountId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
// CreditAccountDelete 企业的账期结算删除
func (srv CompanyCreditAccountService) CreditAccountDelete(cmd *command.CreditAccountGetCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountRemove(allied_creation_cooperation.ReqCreditAccountRemove{
CreditAccountId: cmd.CreditAccountId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
// CreditAccountPay 企业的账期结算支付
func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccountPayCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{
CreditAccountId: cmd.CreditAccountId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
// CreditAccountPaySearch 企业分红结算支付记录
func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
PaymentStatus: 2,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"list": resultMenu,
"sum": 6000,
}, nil
}
// PaymentHistoryStatistics 支付历史统计
func (srv CompanyCreditAccountService) PaymentHistoryStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
//resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: 2,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{
"rankItems": []struct{}{},
"totalPaymentAmount": 6000,
}, nil
}
// PaymentHistoryHistogramStatistics 支付历史统计-直方图
func (srv CompanyCreditAccountService) PaymentHistoryHistogramStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
//resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: 2,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{
"xAxis": map[string]interface{}{
"data": []string{"7-5", "7-15", "7-25"},
},
"yAxis": struct{}{},
"source": map[string]interface{}{
"value": []float64{60, 80, 90},
},
}, nil
}
... ...
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// PersonCreditAccountService 企业端账期结算
type PersonCreditAccountService struct {
}
//// CreditAccountSearch 企业的账期结算列表
//func (srv PersonCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) {
// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
// resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: cmd.PaymentStatus,
// })
// if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
// }
// return resultMenu, nil
//}
// CreditAccountGet 企业的账期结算明细
func (srv PersonCreditAccountService) CreditAccountGet(cmd *command.CreditAccountGetCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountGet(allied_creation_cooperation.ReqCreditAccountGet{
CreditAccountId: cmd.CreditAccountId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
//// CreditAccountDelete 企业的账期结算删除
//func (srv PersonCreditAccountService) CreditAccountDelete(cmd *command.CreditAccountGetCommand) (interface{}, error) {
// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
// resultMenu, err := gateway.CreditAccountRemove(allied_creation_cooperation.ReqCreditAccountRemove{
// CreditAccountId: cmd.CreditAccountId,
// })
// if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
// }
// return resultMenu, nil
//}
//
//// CreditAccountPay 企业的账期结算支付
//func (srv PersonCreditAccountService) CreditAccountPay(cmd *command.CreditAccountPayCommand) (interface{}, error) {
// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
// resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{
// CreditAccountId: cmd.CreditAccountId,
// })
// if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
// }
// return resultMenu, nil
//}
// CreditAccountPaySearch 企业分红结算支付记录
func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
PaymentStatus: 2,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"list": resultMenu,
"sum": 6000,
}, nil
}
// PaymentHistoryStatistics 支付历史统计
func (srv PersonCreditAccountService) PaymentHistoryStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
//resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: 2,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{
"rankItems": []struct{}{},
"totalPaymentAmount": 6000,
}, nil
}
// PaymentHistoryHistogramStatistics 支付历史统计-直方图
func (srv PersonCreditAccountService) PaymentHistoryHistogramStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
//resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: 2,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{
"xAxis": map[string]interface{}{
"data": []string{"7-5", "7-15", "7-25"},
},
"yAxis": struct{}{},
"source": map[string]interface{}{
"value": []float64{60, 80, 90},
},
}, nil
}
... ...
package service
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
)
// 企业端统计
type CompanyStatisticsService struct {
}
// IndexStatistics TODO:首页统计 (入口页面统计数据)
func (srv CompanyStatisticsService) IndexStatistics(userMenusCommand *command.IndexStatisticsCommand) (interface{}, error) {
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
// userMenusCommand.Operator)
//resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
// UserId: int(userMenusCommand.Operator.UserId),
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{}, nil
}
// CooperationPersonStatistics TODO:共创人员统计(共创人员明细)
func (srv CompanyStatisticsService) CooperationPersonStatistics(userMenusCommand *command.CooperationPersonStatisticsCommand) (interface{}, error) {
return map[string]interface{}{}, nil
}
// GoodsStatistics TODO:产品统计排行榜 年月榜
func (srv CompanyStatisticsService) GoodsStatistics(userMenusCommand *command.GoodsStatisticsCommand) (interface{}, error) {
return map[string]interface{}{}, nil
}
// CooperationDividendsStatistics TODO:共创分红支出统计
func (srv CompanyStatisticsService) CooperationDividendsStatistics(userMenusCommand *command.CooperationDividendsStatisticsCommand) (interface{}, error) {
return map[string]interface{}{}, nil
}
... ...
package service
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
)
// 个人端统计
type PersonStatisticsService struct {
}
// IndexStatistics TODO:个人端 - 首页统计 (入口页面统计数据)
func (srv PersonStatisticsService) IndexStatistics(userMenusCommand *command.IndexStatisticsCommand) (interface{}, error) {
//creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
// userMenusCommand.Operator)
//resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
// UserId: int(userMenusCommand.Operator.UserId),
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{
"overview": map[string]interface{}{
"contractSum": 60,
"contractStoppedSum": 70,
"companySum": 6,
},
"dividendStatistics": map[string]interface{}{
"creditAccount": 1000,
"dividendsEstimate": 2000,
"orderAmount": 7000,
},
}, nil
}
// CompanyStatistics 共创用户-共创企业统计
func (srv PersonStatisticsService) CompanyStatistics(userMenusCommand *command.CooperationPersonStatisticsCommand) (interface{}, error) {
return map[string]interface{}{}, nil
}
// CompanyDividendStatistics 共创用户-共创企业分红统计
func (srv PersonStatisticsService) CompanyDividendStatistics(userMenusCommand *command.CooperationPersonStatisticsCommand) (interface{}, error) {
return map[string]interface{}{}, nil
}
// CooperationProjectRecommend 猜你喜欢(共创项目)
func (srv PersonStatisticsService) CooperationProjectRecommend(userMenusCommand *command.GoodsStatisticsCommand) (interface{}, error) {
return map[string]interface{}{}, nil
}
... ...
... ... @@ -247,6 +247,7 @@ func (controller *CooperationController) CreditAccountGet() {
if err != nil {
log.Logger.Error(err.Error())
}
cmd.CreditAccountId, _ = controller.GetInt(":creditAccountId")
cmd.Operator = controller.GetOperator()
data, err := svr.CreditAccountGet(cmd)
controller.Response(data, err)
... ... @@ -276,6 +277,79 @@ func (controller *CooperationController) CreditAccountPaySearch() {
controller.Response(data, err)
}
func (controller *CooperationController) DeleteAccountPaySearch() {
svr := service.CompanyCreditAccountService{}
cmd := &command.CreditAccountGetCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
log.Logger.Error(err.Error())
}
cmd.CreditAccountId, _ = controller.GetInt(":creditAccountId")
cmd.Operator = controller.GetOperator()
data, err := svr.CreditAccountDelete(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) PaymentHistoryStatistics() {
svr := service.CompanyCreditAccountService{}
cmd := &command.CreditAccountPaySearchCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.PaymentHistoryStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) PaymentHistoryHistogramStatistics() {
svr := service.CompanyCreditAccountService{}
cmd := &command.CreditAccountPaySearchCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.PaymentHistoryHistogramStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) PersonCreditAccountPaySearch() {
svr := service.PersonCreditAccountService{}
cmd := &command.CreditAccountPaySearchCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.CreditAccountPaySearch(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) PersonPaymentHistoryStatistics() {
svr := service.PersonCreditAccountService{}
cmd := &command.CreditAccountPaySearchCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.PaymentHistoryStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) PersonPaymentHistoryHistogramStatistics() {
svr := service.PersonCreditAccountService{}
cmd := &command.CreditAccountPaySearchCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.PaymentHistoryHistogramStatistics(cmd)
controller.Response(data, err)
}
/***** CompanyDividends 企业端分红 *****/
func (controller *CooperationController) GetDividendContracts() {
svr := service.CompanyStatisticsService{}
... ... @@ -369,3 +443,57 @@ func (controller *CooperationController) CooperationDividendsStatistics() {
data, err := svr.CooperationDividendsStatistics(cmd)
controller.Response(data, err)
}
/***** PersonStatistics 用户端统计 *****/
func (controller *CooperationController) PersonIndexStatistics() {
svr := service.PersonStatisticsService{}
cmd := &command.IndexStatisticsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.IndexStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) PersonCompanyStatistics() {
svr := service.PersonStatisticsService{}
cmd := &command.CooperationPersonStatisticsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.CompanyStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) PersonCompanyDividendStatistics() {
svr := service.PersonStatisticsService{}
cmd := &command.CooperationPersonStatisticsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.CompanyDividendStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) PersonCooperationProjectRecommend() {
svr := service.PersonStatisticsService{}
cmd := &command.GoodsStatisticsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.CooperationProjectRecommend(cmd)
controller.Response(data, err)
}
... ...
... ... @@ -10,7 +10,7 @@ func init() {
web.Router("/v1/auth/login/pwd", &controllers.AuthController{}, "Post:LoginPwd")
web.Router("/v1/auth/login/sms", &controllers.AuthController{}, "Post:LoginSms")
web.Router("/v1/auth/login/qrcode", &controllers.AuthController{}, "Post:QrcodeLoginStatus")
web.Router("/v1/auth/captcha-init", &controllers.AuthController{}, "Post:CaptchaInit")
web.Router("/v1/auth/captcha-init", &controllers.AuthController{}, "Get:CaptchaInit")
web.Router("/v1/auth/qrcode-init", &controllers.AuthController{}, "Post:GetQrcode")
web.Router("/v1/auth/sms-code", &controllers.AuthController{}, "Post:SendSmsCode")
web.Router("/v1/auth/check-sms-code", &controllers.AuthController{}, "Post:CheckSmsCode")
... ...
... ... @@ -42,6 +42,12 @@ func init() {
web.Router("/v1/app/company/credit-accounts/:creditId", &mobile_client.CooperationController{}, "Get:CreditAccountGet")
web.Router("/v1/app/company/credit-accounts/pay", &mobile_client.CooperationController{}, "Post:CreditAccountPay")
web.Router("/v1/app/company/credit-accounts/pay/search", &mobile_client.CooperationController{}, "Post:CreditAccountPaySearch")
web.Router("/v1/app/company/credit-accounts/payment-history/statistics", &mobile_client.CooperationController{}, "Post:PaymentHistoryStatistics")
web.Router("/v1/app/company/credit-accounts/payment-history/histogram-statistics", &mobile_client.CooperationController{}, "Post:PaymentHistoryHistogramStatistics")
web.Router("/v1/app/company/credit-accounts/pay/search/person", &mobile_client.CooperationController{}, "Post:PersonCreditAccountPaySearch")
web.Router("/v1/app/credit-accounts/payment-history/statistics", &mobile_client.CooperationController{}, "Post:PersonPaymentHistoryStatistics")
web.Router("/v1/app/credit-accounts/payment-history/histogram-statistics", &mobile_client.CooperationController{}, "Post:PersonPaymentHistoryHistogramStatistics")
/***** CompanyDividends 企业端分红 *****/
web.Router("/v1/app/cooperation/company/dividends/contracts", &mobile_client.CooperationController{}, "Post:GetDividendContracts")
... ... @@ -53,4 +59,10 @@ func init() {
web.Router("/v1/app/cooperation/person/statistics", &mobile_client.CooperationController{}, "Post:CooperationPersonStatistics")
web.Router("/v1/app/cooperation/goods/statistics", &mobile_client.CooperationController{}, "Post:GoodsStatistics")
web.Router("/v1/app/cooperation-dividends-statistics/statistics", &mobile_client.CooperationController{}, "Post:CooperationDividendsStatistics")
/***** PersonStatistics 用户端统计 *****/
web.Router("/v1/app/cooperation-user/index", &mobile_client.CooperationController{}, "Get:PersonIndexStatistics")
web.Router("/v1/app/cooperation-user/company-statistics", &mobile_client.CooperationController{}, "Post:PersonCompanyStatistics")
web.Router("/v1/app/cooperation-user/company-dividend-statistics", &mobile_client.CooperationController{}, "Post:PersonCompanyDividendStatistics")
web.Router("/v1/app/cooperation-projects/recommend", &mobile_client.CooperationController{}, "Post:PersonCooperationProjectRecommend")
}
... ...