作者 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 ( @@ -10,6 +10,7 @@ import (
10 type CreditAccountGetCommand struct { 10 type CreditAccountGetCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
  13 + CreditAccountId int
13 } 14 }
14 15
15 func (cmd *CreditAccountGetCommand) Valid(validation *validation.Validation) { 16 func (cmd *CreditAccountGetCommand) Valid(validation *validation.Validation) {
@@ -10,6 +10,11 @@ import ( @@ -10,6 +10,11 @@ import (
10 type CreditAccountPayCommand struct { 10 type CreditAccountPayCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
  13 + CreditAccountId int
  14 + // 账期结算实付金额
  15 + ActuallyPaidAmount float64 `cname:"账期结算实付金额" json:"actuallyPaidAmount" valid:"Required"`
  16 + // 备注
  17 + Remarks string `cname:"备注" json:"remarks" valid:"Required"`
13 } 18 }
14 19
15 func (cmd *CreditAccountPayCommand) Valid(validation *validation.Validation) { 20 func (cmd *CreditAccountPayCommand) Valid(validation *validation.Validation) {
@@ -10,6 +10,12 @@ import ( @@ -10,6 +10,12 @@ import (
10 type CreditAccountPaySearchCommand struct { 10 type CreditAccountPaySearchCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
  13 + // 查询偏离量
  14 + PageNumber int64 `json:"pageNumber"`
  15 + // 查询限制
  16 + PageSize int64 `json:"pageSize" valid:"Required"`
  17 + // 账期结算支付状态,1待支付,2已支付 0全部
  18 + PaymentStatus int32 `json:"paymentStatus"`
13 } 19 }
14 20
15 func (cmd *CreditAccountPaySearchCommand) Valid(validation *validation.Validation) { 21 func (cmd *CreditAccountPaySearchCommand) Valid(validation *validation.Validation) {
1 -package service  
2 -  
3 -import (  
4 - "github.com/linmadan/egglib-go/core/application"  
5 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"  
6 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"  
7 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"  
8 -)  
9 -  
10 -// CompanyCreditAccountService 企业端账期结算  
11 -type CompanyCreditAccountService struct {  
12 -}  
13 -  
14 -// IndexStatistics TODO:企业的账期结算列表(分红信息按合约划分)  
15 -func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) {  
16 - gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
17 - cmd.Operator)  
18 - resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{  
19 - PageNumber: cmd.PageNumber,  
20 - PageSize: cmd.PageSize,  
21 - PaymentStatus: cmd.PaymentStatus,  
22 - })  
23 - if err != nil {  
24 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
25 - }  
26 - return resultMenu, nil  
27 -}  
28 -  
29 -// IndexStatistics TODO:企业的账期结算明细  
30 -func (srv CompanyCreditAccountService) CreditAccountGet(userMenusCommand *command.CreditAccountGetCommand) (interface{}, error) {  
31 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(  
32 - userMenusCommand.Operator)  
33 - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{  
34 - UserId: int(userMenusCommand.Operator.UserId),  
35 - })  
36 - if err != nil {  
37 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
38 - }  
39 - return map[string]interface{}{  
40 - "accessMenus": resultMenu.Menus,  
41 - }, nil  
42 -}  
43 -  
44 -// IndexStatistics TODO:企业的账期结算支付  
45 -func (srv CompanyCreditAccountService) CreditAccountPay(userMenusCommand *command.CreditAccountPayCommand) (interface{}, error) {  
46 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(  
47 - userMenusCommand.Operator)  
48 - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{  
49 - UserId: int(userMenusCommand.Operator.UserId),  
50 - })  
51 - if err != nil {  
52 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
53 - }  
54 - return map[string]interface{}{  
55 - "accessMenus": resultMenu.Menus,  
56 - }, nil  
57 -}  
58 -  
59 -// IndexStatistics TODO:企业分红结算支付记录  
60 -func (srv CompanyCreditAccountService) CreditAccountPaySearch(userMenusCommand *command.CreditAccountPaySearchCommand) (interface{}, error) {  
61 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(  
62 - userMenusCommand.Operator)  
63 - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{  
64 - UserId: int(userMenusCommand.Operator.UserId),  
65 - })  
66 - if err != nil {  
67 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
68 - }  
69 - return map[string]interface{}{  
70 - "accessMenus": resultMenu.Menus,  
71 - }, nil  
72 -}  
@@ -9,7 +9,7 @@ import ( @@ -9,7 +9,7 @@ import (
9 type CompanyDividendsService struct { 9 type CompanyDividendsService struct {
10 } 10 }
11 11
12 -// IndexStatistics TODO:企业的合约列表(分红信息按合约划分) 12 +// GetDividendContracts 企业的合约列表(分红信息按合约划分)
13 func (srv CompanyStatisticsService) GetDividendContracts(userMenusCommand *command.GetDividendContractsCommand) (interface{}, error) { 13 func (srv CompanyStatisticsService) GetDividendContracts(userMenusCommand *command.GetDividendContractsCommand) (interface{}, error) {
14 //creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 14 //creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
15 // userMenusCommand.Operator) 15 // userMenusCommand.Operator)
@@ -30,7 +30,7 @@ func (srv CompanyStatisticsService) GetDividendContracts(userMenusCommand *comma @@ -30,7 +30,7 @@ func (srv CompanyStatisticsService) GetDividendContracts(userMenusCommand *comma
30 }, nil 30 }, nil
31 } 31 }
32 32
33 -// IndexStatistics TODO:企业的合约统计(分红统计) 33 +// DividendsStatistics TODO:企业的合约统计(分红统计)
34 func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *command.DividendsStatisticsCommand) (interface{}, error) { 34 func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *command.DividendsStatisticsCommand) (interface{}, error) {
35 //creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 35 //creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
36 // userMenusCommand.Operator) 36 // userMenusCommand.Operator)
@@ -48,7 +48,7 @@ func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *comman @@ -48,7 +48,7 @@ func (srv CompanyStatisticsService) DividendsStatistics(userMenusCommand *comman
48 }, nil 48 }, nil
49 } 49 }
50 50
51 -// IndexStatistics 企业的合约明细列表(分红预算信息) 51 +// SearchDividendsEstimates 企业的合约明细列表(分红预算信息)
52 func (srv CompanyStatisticsService) SearchDividendsEstimates(userMenusCommand *command.SearchDividendsEstimatesCommand) (interface{}, error) { 52 func (srv CompanyStatisticsService) SearchDividendsEstimates(userMenusCommand *command.SearchDividendsEstimatesCommand) (interface{}, error) {
53 //creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 53 //creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
54 // userMenusCommand.Operator) 54 // userMenusCommand.Operator)
1 -package service  
2 -  
3 -import (  
4 - "github.com/linmadan/egglib-go/core/application"  
5 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"  
6 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"  
7 -)  
8 -  
9 -// 企业端统计  
10 -type CompanyStatisticsService struct {  
11 -}  
12 -  
13 -// IndexStatistics TODO:首页统计 (入口页面统计数据)  
14 -func (srv CompanyStatisticsService) IndexStatistics(userMenusCommand *command.IndexStatisticsCommand) (interface{}, error) {  
15 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(  
16 - userMenusCommand.Operator)  
17 - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{  
18 - UserId: int(userMenusCommand.Operator.UserId),  
19 - })  
20 - if err != nil {  
21 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
22 - }  
23 - return map[string]interface{}{  
24 - "accessMenus": resultMenu.Menus,  
25 - }, nil  
26 -}  
27 -  
28 -// IndexStatistics TODO:共创人员统计(共创人员明细)  
29 -func (srv CompanyStatisticsService) CooperationPersonStatistics(userMenusCommand *command.CooperationPersonStatisticsCommand) (interface{}, error) {  
30 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(  
31 - userMenusCommand.Operator)  
32 - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{  
33 - UserId: int(userMenusCommand.Operator.UserId),  
34 - })  
35 - if err != nil {  
36 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
37 - }  
38 - return map[string]interface{}{  
39 - "accessMenus": resultMenu.Menus,  
40 - }, nil  
41 -}  
42 -  
43 -// IndexStatistics TODO:产品统计排行榜 年月榜  
44 -func (srv CompanyStatisticsService) GoodsStatistics(userMenusCommand *command.GoodsStatisticsCommand) (interface{}, error) {  
45 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(  
46 - userMenusCommand.Operator)  
47 - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{  
48 - UserId: int(userMenusCommand.Operator.UserId),  
49 - })  
50 - if err != nil {  
51 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
52 - }  
53 - return map[string]interface{}{  
54 - "accessMenus": resultMenu.Menus,  
55 - }, nil  
56 -}  
57 -  
58 -// IndexStatistics TODO:共创分红支出统计  
59 -func (srv CompanyStatisticsService) CooperationDividendsStatistics(userMenusCommand *command.CooperationDividendsStatisticsCommand) (interface{}, error) {  
60 - creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(  
61 - userMenusCommand.Operator)  
62 - resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{  
63 - UserId: int(userMenusCommand.Operator.UserId),  
64 - })  
65 - if err != nil {  
66 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
67 - }  
68 - return map[string]interface{}{  
69 - "accessMenus": resultMenu.Menus,  
70 - }, nil  
71 -}  
  1 +package service
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/core/application"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
  7 +)
  8 +
  9 +// CompanyCreditAccountService 企业端账期结算
  10 +type CompanyCreditAccountService struct {
  11 +}
  12 +
  13 +// CreditAccountSearch 企业的账期结算列表
  14 +func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) {
  15 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  16 + cmd.Operator)
  17 + resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
  18 + PageNumber: cmd.PageNumber,
  19 + PageSize: cmd.PageSize,
  20 + PaymentStatus: cmd.PaymentStatus,
  21 + })
  22 + if err != nil {
  23 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  24 + }
  25 + return resultMenu, nil
  26 +}
  27 +
  28 +// CreditAccountGet 企业的账期结算明细
  29 +func (srv CompanyCreditAccountService) CreditAccountGet(cmd *command.CreditAccountGetCommand) (interface{}, error) {
  30 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  31 + cmd.Operator)
  32 + resultMenu, err := gateway.CreditAccountGet(allied_creation_cooperation.ReqCreditAccountGet{
  33 + CreditAccountId: cmd.CreditAccountId,
  34 + })
  35 + if err != nil {
  36 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  37 + }
  38 + return resultMenu, nil
  39 +}
  40 +
  41 +// CreditAccountDelete 企业的账期结算删除
  42 +func (srv CompanyCreditAccountService) CreditAccountDelete(cmd *command.CreditAccountGetCommand) (interface{}, error) {
  43 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  44 + cmd.Operator)
  45 + resultMenu, err := gateway.CreditAccountRemove(allied_creation_cooperation.ReqCreditAccountRemove{
  46 + CreditAccountId: cmd.CreditAccountId,
  47 + })
  48 + if err != nil {
  49 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  50 + }
  51 + return resultMenu, nil
  52 +}
  53 +
  54 +// CreditAccountPay 企业的账期结算支付
  55 +func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccountPayCommand) (interface{}, error) {
  56 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  57 + cmd.Operator)
  58 + resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{
  59 + CreditAccountId: cmd.CreditAccountId,
  60 + })
  61 + if err != nil {
  62 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  63 + }
  64 + return resultMenu, nil
  65 +}
  66 +
  67 +// CreditAccountPaySearch 企业分红结算支付记录
  68 +func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
  69 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  70 + cmd.Operator)
  71 + resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
  72 + PageNumber: cmd.PageNumber,
  73 + PageSize: cmd.PageSize,
  74 + PaymentStatus: 2,
  75 + })
  76 + if err != nil {
  77 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  78 + }
  79 + return map[string]interface{}{
  80 + "list": resultMenu,
  81 + "sum": 6000,
  82 + }, nil
  83 +}
  84 +
  85 +// PaymentHistoryStatistics 支付历史统计
  86 +func (srv CompanyCreditAccountService) PaymentHistoryStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
  87 + //gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  88 + // cmd.Operator)
  89 + //resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
  90 + // PageNumber: cmd.PageNumber,
  91 + // PageSize: cmd.PageSize,
  92 + // PaymentStatus: 2,
  93 + //})
  94 + //if err != nil {
  95 + // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  96 + //}
  97 + return map[string]interface{}{
  98 + "rankItems": []struct{}{},
  99 + "totalPaymentAmount": 6000,
  100 + }, nil
  101 +}
  102 +
  103 +// PaymentHistoryHistogramStatistics 支付历史统计-直方图
  104 +func (srv CompanyCreditAccountService) PaymentHistoryHistogramStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
  105 + //gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  106 + // cmd.Operator)
  107 + //resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
  108 + // PageNumber: cmd.PageNumber,
  109 + // PageSize: cmd.PageSize,
  110 + // PaymentStatus: 2,
  111 + //})
  112 + //if err != nil {
  113 + // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  114 + //}
  115 + return map[string]interface{}{
  116 + "xAxis": map[string]interface{}{
  117 + "data": []string{"7-5", "7-15", "7-25"},
  118 + },
  119 + "yAxis": struct{}{},
  120 + "source": map[string]interface{}{
  121 + "value": []float64{60, 80, 90},
  122 + },
  123 + }, nil
  124 +}
  1 +package service
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/core/application"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
  7 +)
  8 +
  9 +// PersonCreditAccountService 企业端账期结算
  10 +type PersonCreditAccountService struct {
  11 +}
  12 +
  13 +//// CreditAccountSearch 企业的账期结算列表
  14 +//func (srv PersonCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) {
  15 +// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  16 +// cmd.Operator)
  17 +// resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
  18 +// PageNumber: cmd.PageNumber,
  19 +// PageSize: cmd.PageSize,
  20 +// PaymentStatus: cmd.PaymentStatus,
  21 +// })
  22 +// if err != nil {
  23 +// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  24 +// }
  25 +// return resultMenu, nil
  26 +//}
  27 +
  28 +// CreditAccountGet 企业的账期结算明细
  29 +func (srv PersonCreditAccountService) CreditAccountGet(cmd *command.CreditAccountGetCommand) (interface{}, error) {
  30 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  31 + cmd.Operator)
  32 + resultMenu, err := gateway.CreditAccountGet(allied_creation_cooperation.ReqCreditAccountGet{
  33 + CreditAccountId: cmd.CreditAccountId,
  34 + })
  35 + if err != nil {
  36 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  37 + }
  38 + return resultMenu, nil
  39 +}
  40 +
  41 +//// CreditAccountDelete 企业的账期结算删除
  42 +//func (srv PersonCreditAccountService) CreditAccountDelete(cmd *command.CreditAccountGetCommand) (interface{}, error) {
  43 +// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  44 +// cmd.Operator)
  45 +// resultMenu, err := gateway.CreditAccountRemove(allied_creation_cooperation.ReqCreditAccountRemove{
  46 +// CreditAccountId: cmd.CreditAccountId,
  47 +// })
  48 +// if err != nil {
  49 +// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  50 +// }
  51 +// return resultMenu, nil
  52 +//}
  53 +//
  54 +//// CreditAccountPay 企业的账期结算支付
  55 +//func (srv PersonCreditAccountService) CreditAccountPay(cmd *command.CreditAccountPayCommand) (interface{}, error) {
  56 +// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  57 +// cmd.Operator)
  58 +// resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{
  59 +// CreditAccountId: cmd.CreditAccountId,
  60 +// })
  61 +// if err != nil {
  62 +// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  63 +// }
  64 +// return resultMenu, nil
  65 +//}
  66 +
  67 +// CreditAccountPaySearch 企业分红结算支付记录
  68 +func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
  69 + gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  70 + cmd.Operator)
  71 + resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
  72 + PageNumber: cmd.PageNumber,
  73 + PageSize: cmd.PageSize,
  74 + PaymentStatus: 2,
  75 + })
  76 + if err != nil {
  77 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  78 + }
  79 + return map[string]interface{}{
  80 + "list": resultMenu,
  81 + "sum": 6000,
  82 + }, nil
  83 +}
  84 +
  85 +// PaymentHistoryStatistics 支付历史统计
  86 +func (srv PersonCreditAccountService) PaymentHistoryStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
  87 + //gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  88 + // cmd.Operator)
  89 + //resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
  90 + // PageNumber: cmd.PageNumber,
  91 + // PageSize: cmd.PageSize,
  92 + // PaymentStatus: 2,
  93 + //})
  94 + //if err != nil {
  95 + // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  96 + //}
  97 + return map[string]interface{}{
  98 + "rankItems": []struct{}{},
  99 + "totalPaymentAmount": 6000,
  100 + }, nil
  101 +}
  102 +
  103 +// PaymentHistoryHistogramStatistics 支付历史统计-直方图
  104 +func (srv PersonCreditAccountService) PaymentHistoryHistogramStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
  105 + //gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  106 + // cmd.Operator)
  107 + //resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
  108 + // PageNumber: cmd.PageNumber,
  109 + // PageSize: cmd.PageSize,
  110 + // PaymentStatus: 2,
  111 + //})
  112 + //if err != nil {
  113 + // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  114 + //}
  115 + return map[string]interface{}{
  116 + "xAxis": map[string]interface{}{
  117 + "data": []string{"7-5", "7-15", "7-25"},
  118 + },
  119 + "yAxis": struct{}{},
  120 + "source": map[string]interface{}{
  121 + "value": []float64{60, 80, 90},
  122 + },
  123 + }, nil
  124 +}
  1 +package service
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
  5 +)
  6 +
  7 +// 企业端统计
  8 +type CompanyStatisticsService struct {
  9 +}
  10 +
  11 +// IndexStatistics TODO:首页统计 (入口页面统计数据)
  12 +func (srv CompanyStatisticsService) IndexStatistics(userMenusCommand *command.IndexStatisticsCommand) (interface{}, error) {
  13 + //creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
  14 + // userMenusCommand.Operator)
  15 + //resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
  16 + // UserId: int(userMenusCommand.Operator.UserId),
  17 + //})
  18 + //if err != nil {
  19 + // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  20 + //}
  21 + return map[string]interface{}{}, nil
  22 +}
  23 +
  24 +// CooperationPersonStatistics TODO:共创人员统计(共创人员明细)
  25 +func (srv CompanyStatisticsService) CooperationPersonStatistics(userMenusCommand *command.CooperationPersonStatisticsCommand) (interface{}, error) {
  26 + return map[string]interface{}{}, nil
  27 +}
  28 +
  29 +// GoodsStatistics TODO:产品统计排行榜 年月榜
  30 +func (srv CompanyStatisticsService) GoodsStatistics(userMenusCommand *command.GoodsStatisticsCommand) (interface{}, error) {
  31 + return map[string]interface{}{}, nil
  32 +}
  33 +
  34 +// CooperationDividendsStatistics TODO:共创分红支出统计
  35 +func (srv CompanyStatisticsService) CooperationDividendsStatistics(userMenusCommand *command.CooperationDividendsStatisticsCommand) (interface{}, error) {
  36 + return map[string]interface{}{}, nil
  37 +}
  1 +package service
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
  5 +)
  6 +
  7 +// 个人端统计
  8 +type PersonStatisticsService struct {
  9 +}
  10 +
  11 +// IndexStatistics TODO:个人端 - 首页统计 (入口页面统计数据)
  12 +func (srv PersonStatisticsService) IndexStatistics(userMenusCommand *command.IndexStatisticsCommand) (interface{}, error) {
  13 + //creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
  14 + // userMenusCommand.Operator)
  15 + //resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
  16 + // UserId: int(userMenusCommand.Operator.UserId),
  17 + //})
  18 + //if err != nil {
  19 + // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  20 + //}
  21 + return map[string]interface{}{
  22 + "overview": map[string]interface{}{
  23 + "contractSum": 60,
  24 + "contractStoppedSum": 70,
  25 + "companySum": 6,
  26 + },
  27 + "dividendStatistics": map[string]interface{}{
  28 + "creditAccount": 1000,
  29 + "dividendsEstimate": 2000,
  30 + "orderAmount": 7000,
  31 + },
  32 + }, nil
  33 +}
  34 +
  35 +// CompanyStatistics 共创用户-共创企业统计
  36 +func (srv PersonStatisticsService) CompanyStatistics(userMenusCommand *command.CooperationPersonStatisticsCommand) (interface{}, error) {
  37 + return map[string]interface{}{}, nil
  38 +}
  39 +
  40 +// CompanyDividendStatistics 共创用户-共创企业分红统计
  41 +func (srv PersonStatisticsService) CompanyDividendStatistics(userMenusCommand *command.CooperationPersonStatisticsCommand) (interface{}, error) {
  42 + return map[string]interface{}{}, nil
  43 +}
  44 +
  45 +// CooperationProjectRecommend 猜你喜欢(共创项目)
  46 +func (srv PersonStatisticsService) CooperationProjectRecommend(userMenusCommand *command.GoodsStatisticsCommand) (interface{}, error) {
  47 + return map[string]interface{}{}, nil
  48 +}
@@ -247,6 +247,7 @@ func (controller *CooperationController) CreditAccountGet() { @@ -247,6 +247,7 @@ func (controller *CooperationController) CreditAccountGet() {
247 if err != nil { 247 if err != nil {
248 log.Logger.Error(err.Error()) 248 log.Logger.Error(err.Error())
249 } 249 }
  250 + cmd.CreditAccountId, _ = controller.GetInt(":creditAccountId")
250 cmd.Operator = controller.GetOperator() 251 cmd.Operator = controller.GetOperator()
251 data, err := svr.CreditAccountGet(cmd) 252 data, err := svr.CreditAccountGet(cmd)
252 controller.Response(data, err) 253 controller.Response(data, err)
@@ -276,6 +277,79 @@ func (controller *CooperationController) CreditAccountPaySearch() { @@ -276,6 +277,79 @@ func (controller *CooperationController) CreditAccountPaySearch() {
276 controller.Response(data, err) 277 controller.Response(data, err)
277 } 278 }
278 279
  280 +func (controller *CooperationController) DeleteAccountPaySearch() {
  281 + svr := service.CompanyCreditAccountService{}
  282 + cmd := &command.CreditAccountGetCommand{}
  283 + err := controller.Unmarshal(cmd)
  284 + if err != nil {
  285 + log.Logger.Error(err.Error())
  286 + }
  287 + cmd.CreditAccountId, _ = controller.GetInt(":creditAccountId")
  288 + cmd.Operator = controller.GetOperator()
  289 + data, err := svr.CreditAccountDelete(cmd)
  290 + controller.Response(data, err)
  291 +}
  292 +
  293 +func (controller *CooperationController) PaymentHistoryStatistics() {
  294 + svr := service.CompanyCreditAccountService{}
  295 + cmd := &command.CreditAccountPaySearchCommand{}
  296 + err := controller.Unmarshal(cmd)
  297 + if err != nil {
  298 + log.Logger.Error(err.Error())
  299 + }
  300 + cmd.Operator = controller.GetOperator()
  301 + data, err := svr.PaymentHistoryStatistics(cmd)
  302 + controller.Response(data, err)
  303 +}
  304 +
  305 +func (controller *CooperationController) PaymentHistoryHistogramStatistics() {
  306 + svr := service.CompanyCreditAccountService{}
  307 + cmd := &command.CreditAccountPaySearchCommand{}
  308 + err := controller.Unmarshal(cmd)
  309 + if err != nil {
  310 + log.Logger.Error(err.Error())
  311 + }
  312 + cmd.Operator = controller.GetOperator()
  313 + data, err := svr.PaymentHistoryHistogramStatistics(cmd)
  314 + controller.Response(data, err)
  315 +}
  316 +
  317 +func (controller *CooperationController) PersonCreditAccountPaySearch() {
  318 + svr := service.PersonCreditAccountService{}
  319 + cmd := &command.CreditAccountPaySearchCommand{}
  320 + err := controller.Unmarshal(cmd)
  321 + if err != nil {
  322 + log.Logger.Error(err.Error())
  323 + }
  324 + cmd.Operator = controller.GetOperator()
  325 + data, err := svr.CreditAccountPaySearch(cmd)
  326 + controller.Response(data, err)
  327 +}
  328 +
  329 +func (controller *CooperationController) PersonPaymentHistoryStatistics() {
  330 + svr := service.PersonCreditAccountService{}
  331 + cmd := &command.CreditAccountPaySearchCommand{}
  332 + err := controller.Unmarshal(cmd)
  333 + if err != nil {
  334 + log.Logger.Error(err.Error())
  335 + }
  336 + cmd.Operator = controller.GetOperator()
  337 + data, err := svr.PaymentHistoryStatistics(cmd)
  338 + controller.Response(data, err)
  339 +}
  340 +
  341 +func (controller *CooperationController) PersonPaymentHistoryHistogramStatistics() {
  342 + svr := service.PersonCreditAccountService{}
  343 + cmd := &command.CreditAccountPaySearchCommand{}
  344 + err := controller.Unmarshal(cmd)
  345 + if err != nil {
  346 + log.Logger.Error(err.Error())
  347 + }
  348 + cmd.Operator = controller.GetOperator()
  349 + data, err := svr.PaymentHistoryHistogramStatistics(cmd)
  350 + controller.Response(data, err)
  351 +}
  352 +
279 /***** CompanyDividends 企业端分红 *****/ 353 /***** CompanyDividends 企业端分红 *****/
280 func (controller *CooperationController) GetDividendContracts() { 354 func (controller *CooperationController) GetDividendContracts() {
281 svr := service.CompanyStatisticsService{} 355 svr := service.CompanyStatisticsService{}
@@ -369,3 +443,57 @@ func (controller *CooperationController) CooperationDividendsStatistics() { @@ -369,3 +443,57 @@ func (controller *CooperationController) CooperationDividendsStatistics() {
369 data, err := svr.CooperationDividendsStatistics(cmd) 443 data, err := svr.CooperationDividendsStatistics(cmd)
370 controller.Response(data, err) 444 controller.Response(data, err)
371 } 445 }
  446 +
  447 +/***** PersonStatistics 用户端统计 *****/
  448 +
  449 +func (controller *CooperationController) PersonIndexStatistics() {
  450 + svr := service.PersonStatisticsService{}
  451 + cmd := &command.IndexStatisticsCommand{}
  452 + err := controller.Unmarshal(cmd)
  453 + if err != nil {
  454 + controller.Response(nil, err)
  455 + return
  456 + }
  457 + cmd.Operator = controller.GetOperator()
  458 + data, err := svr.IndexStatistics(cmd)
  459 + controller.Response(data, err)
  460 +}
  461 +
  462 +func (controller *CooperationController) PersonCompanyStatistics() {
  463 + svr := service.PersonStatisticsService{}
  464 + cmd := &command.CooperationPersonStatisticsCommand{}
  465 + err := controller.Unmarshal(cmd)
  466 + if err != nil {
  467 + controller.Response(nil, err)
  468 + return
  469 + }
  470 + cmd.Operator = controller.GetOperator()
  471 + data, err := svr.CompanyStatistics(cmd)
  472 + controller.Response(data, err)
  473 +}
  474 +
  475 +func (controller *CooperationController) PersonCompanyDividendStatistics() {
  476 + svr := service.PersonStatisticsService{}
  477 + cmd := &command.CooperationPersonStatisticsCommand{}
  478 + err := controller.Unmarshal(cmd)
  479 + if err != nil {
  480 + controller.Response(nil, err)
  481 + return
  482 + }
  483 + cmd.Operator = controller.GetOperator()
  484 + data, err := svr.CompanyDividendStatistics(cmd)
  485 + controller.Response(data, err)
  486 +}
  487 +
  488 +func (controller *CooperationController) PersonCooperationProjectRecommend() {
  489 + svr := service.PersonStatisticsService{}
  490 + cmd := &command.GoodsStatisticsCommand{}
  491 + err := controller.Unmarshal(cmd)
  492 + if err != nil {
  493 + controller.Response(nil, err)
  494 + return
  495 + }
  496 + cmd.Operator = controller.GetOperator()
  497 + data, err := svr.CooperationProjectRecommend(cmd)
  498 + controller.Response(data, err)
  499 +}
@@ -10,7 +10,7 @@ func init() { @@ -10,7 +10,7 @@ func init() {
10 web.Router("/v1/auth/login/pwd", &controllers.AuthController{}, "Post:LoginPwd") 10 web.Router("/v1/auth/login/pwd", &controllers.AuthController{}, "Post:LoginPwd")
11 web.Router("/v1/auth/login/sms", &controllers.AuthController{}, "Post:LoginSms") 11 web.Router("/v1/auth/login/sms", &controllers.AuthController{}, "Post:LoginSms")
12 web.Router("/v1/auth/login/qrcode", &controllers.AuthController{}, "Post:QrcodeLoginStatus") 12 web.Router("/v1/auth/login/qrcode", &controllers.AuthController{}, "Post:QrcodeLoginStatus")
13 - web.Router("/v1/auth/captcha-init", &controllers.AuthController{}, "Post:CaptchaInit") 13 + web.Router("/v1/auth/captcha-init", &controllers.AuthController{}, "Get:CaptchaInit")
14 web.Router("/v1/auth/qrcode-init", &controllers.AuthController{}, "Post:GetQrcode") 14 web.Router("/v1/auth/qrcode-init", &controllers.AuthController{}, "Post:GetQrcode")
15 web.Router("/v1/auth/sms-code", &controllers.AuthController{}, "Post:SendSmsCode") 15 web.Router("/v1/auth/sms-code", &controllers.AuthController{}, "Post:SendSmsCode")
16 web.Router("/v1/auth/check-sms-code", &controllers.AuthController{}, "Post:CheckSmsCode") 16 web.Router("/v1/auth/check-sms-code", &controllers.AuthController{}, "Post:CheckSmsCode")
@@ -42,6 +42,12 @@ func init() { @@ -42,6 +42,12 @@ func init() {
42 web.Router("/v1/app/company/credit-accounts/:creditId", &mobile_client.CooperationController{}, "Get:CreditAccountGet") 42 web.Router("/v1/app/company/credit-accounts/:creditId", &mobile_client.CooperationController{}, "Get:CreditAccountGet")
43 web.Router("/v1/app/company/credit-accounts/pay", &mobile_client.CooperationController{}, "Post:CreditAccountPay") 43 web.Router("/v1/app/company/credit-accounts/pay", &mobile_client.CooperationController{}, "Post:CreditAccountPay")
44 web.Router("/v1/app/company/credit-accounts/pay/search", &mobile_client.CooperationController{}, "Post:CreditAccountPaySearch") 44 web.Router("/v1/app/company/credit-accounts/pay/search", &mobile_client.CooperationController{}, "Post:CreditAccountPaySearch")
  45 + web.Router("/v1/app/company/credit-accounts/payment-history/statistics", &mobile_client.CooperationController{}, "Post:PaymentHistoryStatistics")
  46 + web.Router("/v1/app/company/credit-accounts/payment-history/histogram-statistics", &mobile_client.CooperationController{}, "Post:PaymentHistoryHistogramStatistics")
  47 +
  48 + web.Router("/v1/app/company/credit-accounts/pay/search/person", &mobile_client.CooperationController{}, "Post:PersonCreditAccountPaySearch")
  49 + web.Router("/v1/app/credit-accounts/payment-history/statistics", &mobile_client.CooperationController{}, "Post:PersonPaymentHistoryStatistics")
  50 + web.Router("/v1/app/credit-accounts/payment-history/histogram-statistics", &mobile_client.CooperationController{}, "Post:PersonPaymentHistoryHistogramStatistics")
45 51
46 /***** CompanyDividends 企业端分红 *****/ 52 /***** CompanyDividends 企业端分红 *****/
47 web.Router("/v1/app/cooperation/company/dividends/contracts", &mobile_client.CooperationController{}, "Post:GetDividendContracts") 53 web.Router("/v1/app/cooperation/company/dividends/contracts", &mobile_client.CooperationController{}, "Post:GetDividendContracts")
@@ -53,4 +59,10 @@ func init() { @@ -53,4 +59,10 @@ func init() {
53 web.Router("/v1/app/cooperation/person/statistics", &mobile_client.CooperationController{}, "Post:CooperationPersonStatistics") 59 web.Router("/v1/app/cooperation/person/statistics", &mobile_client.CooperationController{}, "Post:CooperationPersonStatistics")
54 web.Router("/v1/app/cooperation/goods/statistics", &mobile_client.CooperationController{}, "Post:GoodsStatistics") 60 web.Router("/v1/app/cooperation/goods/statistics", &mobile_client.CooperationController{}, "Post:GoodsStatistics")
55 web.Router("/v1/app/cooperation-dividends-statistics/statistics", &mobile_client.CooperationController{}, "Post:CooperationDividendsStatistics") 61 web.Router("/v1/app/cooperation-dividends-statistics/statistics", &mobile_client.CooperationController{}, "Post:CooperationDividendsStatistics")
  62 +
  63 + /***** PersonStatistics 用户端统计 *****/
  64 + web.Router("/v1/app/cooperation-user/index", &mobile_client.CooperationController{}, "Get:PersonIndexStatistics")
  65 + web.Router("/v1/app/cooperation-user/company-statistics", &mobile_client.CooperationController{}, "Post:PersonCompanyStatistics")
  66 + web.Router("/v1/app/cooperation-user/company-dividend-statistics", &mobile_client.CooperationController{}, "Post:PersonCompanyDividendStatistics")
  67 + web.Router("/v1/app/cooperation-projects/recommend", &mobile_client.CooperationController{}, "Post:PersonCooperationProjectRecommend")
56 } 68 }