作者 唐旭辉

0.5.0 版本中移除的功能的相关代码注释清理

1 package service 1 package service
2 2
3 -import (  
4 - "fmt"  
5 -  
6 - "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/businessBonus/command"  
7 - "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/businessBonus/query"  
8 - "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/factory"  
9 - "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"  
10 - "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/dao"  
11 - "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/lib"  
12 -)  
13 -  
14 type BusinessBonusService struct { 3 type BusinessBonusService struct {
15 } 4 }
16 5
@@ -20,160 +9,160 @@ func NewBusinessBonusService(option map[string]interface{}) *BusinessBonusServic @@ -20,160 +9,160 @@ func NewBusinessBonusService(option map[string]interface{}) *BusinessBonusServic
20 } 9 }
21 10
22 // ListBusinessBonus 列表 11 // ListBusinessBonus 列表
23 -func (srv BusinessBonusService) ListBusinessBonus(queryOption query.ListBusinessBonusQuery) (int, interface{}, error) {  
24 - var (  
25 - transactionContext, _ = factory.CreateTransactionContext(nil)  
26 - err error  
27 - )  
28 - if err = transactionContext.StartTransaction(); err != nil {  
29 - return 0, nil, err  
30 - }  
31 - defer func() {  
32 - transactionContext.RollbackTransaction()  
33 - }() 12 +// func (srv BusinessBonusService) ListBusinessBonus(queryOption query.ListBusinessBonusQuery) (int, interface{}, error) {
  13 +// var (
  14 +// transactionContext, _ = factory.CreateTransactionContext(nil)
  15 +// err error
  16 +// )
  17 +// if err = transactionContext.StartTransaction(); err != nil {
  18 +// return 0, nil, err
  19 +// }
  20 +// defer func() {
  21 +// transactionContext.RollbackTransaction()
  22 +// }()
34 23
35 - var (  
36 - bonusDaoao *dao.BusinessBonusDao  
37 - )  
38 - if bonusDaoao, err = factory.CreateBusinessBonusDao(map[string]interface{}{  
39 - "transactionContext": transactionContext,  
40 - }); err != nil {  
41 - return 0, nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())  
42 - }  
43 - result, err := bonusDaoao.SearchBusinessBonus(queryOption.PartnerId, queryOption.PartnerNameMatch,  
44 - queryOption.CompanyId, queryOption.Limit, queryOption.Offset)  
45 - if err != nil {  
46 - return 0, nil, err  
47 - }  
48 - cnt, err := bonusDaoao.CountBusinessBonus(queryOption.PartnerId, queryOption.PartnerNameMatch,  
49 - queryOption.CompanyId, queryOption.Limit, queryOption.Offset)  
50 - if err != nil {  
51 - return 0, nil, err  
52 - }  
53 - err = transactionContext.CommitTransaction() 24 +// var (
  25 +// bonusDaoao *dao.BusinessBonusDao
  26 +// )
  27 +// if bonusDaoao, err = factory.CreateBusinessBonusDao(map[string]interface{}{
  28 +// "transactionContext": transactionContext,
  29 +// }); err != nil {
  30 +// return 0, nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
  31 +// }
  32 +// result, err := bonusDaoao.SearchBusinessBonus(queryOption.PartnerId, queryOption.PartnerNameMatch,
  33 +// queryOption.CompanyId, queryOption.Limit, queryOption.Offset)
  34 +// if err != nil {
  35 +// return 0, nil, err
  36 +// }
  37 +// cnt, err := bonusDaoao.CountBusinessBonus(queryOption.PartnerId, queryOption.PartnerNameMatch,
  38 +// queryOption.CompanyId, queryOption.Limit, queryOption.Offset)
  39 +// if err != nil {
  40 +// return 0, nil, err
  41 +// }
  42 +// err = transactionContext.CommitTransaction()
54 43
55 - returnData := []map[string]interface{}{}  
56 - for _, v := range result {  
57 - m := map[string]interface{}{  
58 - "id": v.Id,  
59 - "uncollectedDividends": v.BonusNot,  
60 - "receiveDividends": v.BonusHas,  
61 - "dividendsReceivable": v.Bonus,  
62 - "stateOfPayment": v.BonusStatus,  
63 - "stateOfPaymentName": domain.DescribeBusinessBonusStatus(v.BonusStatus),  
64 - "partner": v.PartnerName,  
65 - "updateTime": "",  
66 - }  
67 - if !v.UpdateAt.IsZero() {  
68 - m["updateTime"] = v.UpdateAt.Local().Format("2006-01-02 15:04:05")  
69 - }  
70 - returnData = append(returnData, m)  
71 - }  
72 - return cnt, returnData, nil  
73 -} 44 +// returnData := []map[string]interface{}{}
  45 +// for _, v := range result {
  46 +// m := map[string]interface{}{
  47 +// "id": v.Id,
  48 +// "uncollectedDividends": v.BonusNot,
  49 +// "receiveDividends": v.BonusHas,
  50 +// "dividendsReceivable": v.Bonus,
  51 +// "stateOfPayment": v.BonusStatus,
  52 +// "stateOfPaymentName": domain.DescribeBusinessBonusStatus(v.BonusStatus),
  53 +// "partner": v.PartnerName,
  54 +// "updateTime": "",
  55 +// }
  56 +// if !v.UpdateAt.IsZero() {
  57 +// m["updateTime"] = v.UpdateAt.Local().Format("2006-01-02 15:04:05")
  58 +// }
  59 +// returnData = append(returnData, m)
  60 +// }
  61 +// return cnt, returnData, nil
  62 +// }
74 63
75 -func (srv BusinessBonusService) UpdateBusinessBonus(cmd command.UpdateBusinessBonusCommand) error {  
76 - var (  
77 - transactionContext, _ = factory.CreateTransactionContext(nil)  
78 - err error  
79 - )  
80 - if err = transactionContext.StartTransaction(); err != nil {  
81 - return err  
82 - }  
83 - defer func() {  
84 - transactionContext.RollbackTransaction()  
85 - }()  
86 - var (  
87 - bonusRespository domain.BusinessBonusRepository  
88 - bonusData *domain.BusinessBonus  
89 - )  
90 - if bonusRespository, err = factory.CreateBusinessBonusRepository(map[string]interface{}{  
91 - "transactionContext": transactionContext,  
92 - }); err != nil {  
93 - return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())  
94 - }  
95 - bonusData, err = bonusRespository.FindOne(domain.BusinessBonusFindOneQuery{  
96 - Id: cmd.Id, CompanyId: cmd.CompanyId,  
97 - })  
98 - if err != nil {  
99 - e := fmt.Sprintf("获取业务分红(id=%d;company_id=%d)数据失败:%s", cmd.Id, cmd.CompanyId, err)  
100 - return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)  
101 - }  
102 - bonusData.Bonus = cmd.Bonus  
103 - switch cmd.BonusStatus {  
104 - case domain.BUSINESS_BONUS_HAS_PAY:  
105 - bonusData.BusinessBonusPayStatus.PayPartnerBonus(bonusData)  
106 - case domain.BUSINESS_BONUS_WAIT_PAY:  
107 - bonusData.BusinessBonusPayStatus.WartPayPartnerBonus(bonusData)  
108 - case domain.BUSINESS_BONUS_NULL_PAY:  
109 - bonusData.BusinessBonusPayStatus.NullPayPartnerBonus(bonusData)  
110 - default:  
111 - return lib.ThrowError(lib.BUSINESS_ERROR, "支付状态错误")  
112 - }  
113 - err = bonusRespository.Edit(bonusData)  
114 - if err != nil {  
115 - e := fmt.Sprintf("更新业务分红(id=%d)数据失败:%s", bonusData.Id, err)  
116 - return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)  
117 - }  
118 - err = transactionContext.CommitTransaction()  
119 - return nil  
120 -} 64 +// func (srv BusinessBonusService) UpdateBusinessBonus(cmd command.UpdateBusinessBonusCommand) error {
  65 +// var (
  66 +// transactionContext, _ = factory.CreateTransactionContext(nil)
  67 +// err error
  68 +// )
  69 +// if err = transactionContext.StartTransaction(); err != nil {
  70 +// return err
  71 +// }
  72 +// defer func() {
  73 +// transactionContext.RollbackTransaction()
  74 +// }()
  75 +// var (
  76 +// bonusRespository domain.BusinessBonusRepository
  77 +// bonusData *domain.BusinessBonus
  78 +// )
  79 +// if bonusRespository, err = factory.CreateBusinessBonusRepository(map[string]interface{}{
  80 +// "transactionContext": transactionContext,
  81 +// }); err != nil {
  82 +// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
  83 +// }
  84 +// bonusData, err = bonusRespository.FindOne(domain.BusinessBonusFindOneQuery{
  85 +// Id: cmd.Id, CompanyId: cmd.CompanyId,
  86 +// })
  87 +// if err != nil {
  88 +// e := fmt.Sprintf("获取业务分红(id=%d;company_id=%d)数据失败:%s", cmd.Id, cmd.CompanyId, err)
  89 +// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
  90 +// }
  91 +// bonusData.Bonus = cmd.Bonus
  92 +// switch cmd.BonusStatus {
  93 +// case domain.BUSINESS_BONUS_HAS_PAY:
  94 +// bonusData.BusinessBonusPayStatus.PayPartnerBonus(bonusData)
  95 +// case domain.BUSINESS_BONUS_WAIT_PAY:
  96 +// bonusData.BusinessBonusPayStatus.WartPayPartnerBonus(bonusData)
  97 +// case domain.BUSINESS_BONUS_NULL_PAY:
  98 +// bonusData.BusinessBonusPayStatus.NullPayPartnerBonus(bonusData)
  99 +// default:
  100 +// return lib.ThrowError(lib.BUSINESS_ERROR, "支付状态错误")
  101 +// }
  102 +// err = bonusRespository.Edit(bonusData)
  103 +// if err != nil {
  104 +// e := fmt.Sprintf("更新业务分红(id=%d)数据失败:%s", bonusData.Id, err)
  105 +// return lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
  106 +// }
  107 +// err = transactionContext.CommitTransaction()
  108 +// return nil
  109 +// }
121 110
122 //GetBusinessBonus 获取详情 111 //GetBusinessBonus 获取详情
123 -func (srv BusinessBonusService) GetBusinessBonus(queryOption query.GetBusinessBonusQuery) (map[string]interface{}, error) { 112 +// func (srv BusinessBonusService) GetBusinessBonus(queryOption query.GetBusinessBonusQuery) (map[string]interface{}, error) {
124 113
125 - var (  
126 - transactionContext, _ = factory.CreateTransactionContext(nil)  
127 - err error  
128 - )  
129 - if err = transactionContext.StartTransaction(); err != nil {  
130 - return nil, err  
131 - }  
132 - defer func() {  
133 - transactionContext.RollbackTransaction()  
134 - }()  
135 - var (  
136 - bonusRespository domain.BusinessBonusRepository  
137 - partnerInfoRepository domain.PartnerInfoRepository  
138 - bonusData *domain.BusinessBonus  
139 - partnerData *domain.PartnerInfo  
140 - )  
141 - if bonusRespository, err = factory.CreateBusinessBonusRepository(map[string]interface{}{  
142 - "transactionContext": transactionContext,  
143 - }); err != nil {  
144 - return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())  
145 - }  
146 - bonusData, err = bonusRespository.FindOne(domain.BusinessBonusFindOneQuery{  
147 - Id: queryOption.Id, CompanyId: queryOption.CompanyId,  
148 - })  
149 - if err != nil {  
150 - e := fmt.Sprintf("获取业务分红(id=%d;company_id=%d)数据失败:%s", queryOption.Id, queryOption.CompanyId, err)  
151 - return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)  
152 - }  
153 - if partnerInfoRepository, err = factory.CreatePartnerInfoRepository(map[string]interface{}{  
154 - "transactionContext": transactionContext,  
155 - }); err != nil {  
156 - return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())  
157 - }  
158 - partnerData, err = partnerInfoRepository.FindOne(domain.PartnerFindOneQuery{UserId: bonusData.PartnerInfoId})  
159 - if err != nil {  
160 - e := fmt.Sprintf("获取合伙人(id=%d)数据失败:%s", bonusData.PartnerInfoId, err)  
161 - return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)  
162 - }  
163 - err = transactionContext.CommitTransaction()  
164 - returnData := map[string]interface{}{  
165 - "partner": partnerData.Partner.PartnerName,  
166 - "dividendsReceivable": bonusData.Bonus,  
167 - "receiveDividends": bonusData.BonusHas,  
168 - "uncollectedDividends": bonusData.BonusNot,  
169 - "updateTime": "",  
170 - "stateOfPayment": bonusData.BonusStatus,  
171 - "stateOfPaymentName": domain.DescribeBusinessBonusStatus(bonusData.BonusStatus),  
172 - "id": bonusData.Id,  
173 - }  
174 - if !bonusData.UpdateAt.IsZero() {  
175 - returnData["updateTime"] = bonusData.UpdateAt.Local().Format("2006-01-02 15:04:05")  
176 - } 114 +// var (
  115 +// transactionContext, _ = factory.CreateTransactionContext(nil)
  116 +// err error
  117 +// )
  118 +// if err = transactionContext.StartTransaction(); err != nil {
  119 +// return nil, err
  120 +// }
  121 +// defer func() {
  122 +// transactionContext.RollbackTransaction()
  123 +// }()
  124 +// var (
  125 +// bonusRespository domain.BusinessBonusRepository
  126 +// partnerInfoRepository domain.PartnerInfoRepository
  127 +// bonusData *domain.BusinessBonus
  128 +// partnerData *domain.PartnerInfo
  129 +// )
  130 +// if bonusRespository, err = factory.CreateBusinessBonusRepository(map[string]interface{}{
  131 +// "transactionContext": transactionContext,
  132 +// }); err != nil {
  133 +// return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
  134 +// }
  135 +// bonusData, err = bonusRespository.FindOne(domain.BusinessBonusFindOneQuery{
  136 +// Id: queryOption.Id, CompanyId: queryOption.CompanyId,
  137 +// })
  138 +// if err != nil {
  139 +// e := fmt.Sprintf("获取业务分红(id=%d;company_id=%d)数据失败:%s", queryOption.Id, queryOption.CompanyId, err)
  140 +// return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
  141 +// }
  142 +// if partnerInfoRepository, err = factory.CreatePartnerInfoRepository(map[string]interface{}{
  143 +// "transactionContext": transactionContext,
  144 +// }); err != nil {
  145 +// return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
  146 +// }
  147 +// partnerData, err = partnerInfoRepository.FindOne(domain.PartnerFindOneQuery{UserId: bonusData.PartnerInfoId})
  148 +// if err != nil {
  149 +// e := fmt.Sprintf("获取合伙人(id=%d)数据失败:%s", bonusData.PartnerInfoId, err)
  150 +// return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, e)
  151 +// }
  152 +// err = transactionContext.CommitTransaction()
  153 +// returnData := map[string]interface{}{
  154 +// "partner": partnerData.Partner.PartnerName,
  155 +// "dividendsReceivable": bonusData.Bonus,
  156 +// "receiveDividends": bonusData.BonusHas,
  157 +// "uncollectedDividends": bonusData.BonusNot,
  158 +// "updateTime": "",
  159 +// "stateOfPayment": bonusData.BonusStatus,
  160 +// "stateOfPaymentName": domain.DescribeBusinessBonusStatus(bonusData.BonusStatus),
  161 +// "id": bonusData.Id,
  162 +// }
  163 +// if !bonusData.UpdateAt.IsZero() {
  164 +// returnData["updateTime"] = bonusData.UpdateAt.Local().Format("2006-01-02 15:04:05")
  165 +// }
177 166
178 - return returnData, nil  
179 -} 167 +// return returnData, nil
  168 +// }
@@ -1246,6 +1246,7 @@ func (service OrderInfoService) ListOrderBonusForExcel(listOrderQuery query.List @@ -1246,6 +1246,7 @@ func (service OrderInfoService) ListOrderBonusForExcel(listOrderQuery query.List
1246 [2]string{"num", "序号"}, 1246 [2]string{"num", "序号"},
1247 [2]string{"order_type", "订单类型"}, 1247 [2]string{"order_type", "订单类型"},
1248 [2]string{"order_code", "订单号"}, 1248 [2]string{"order_code", "订单号"},
  1249 + [2]string{"delivery_code", "发货单号"},
1249 [2]string{"partner_name", "合伙人"}, 1250 [2]string{"partner_name", "合伙人"},
1250 [2]string{"bonus_status", "订单状态"}, 1251 [2]string{"bonus_status", "订单状态"},
1251 [2]string{"update_time", "最后操作时间"}, 1252 [2]string{"update_time", "最后操作时间"},
1 package controllers 1 package controllers
2 2
3 import ( 3 import (
4 - "errors"  
5 -  
6 - "github.com/astaxie/beego/logs"  
7 - businessCommand "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/businessBonus/command"  
8 - businessQuery "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/businessBonus/query"  
9 - businessService "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/businessBonus/service"  
10 "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain" 4 "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
11 ) 5 )
12 6
@@ -24,95 +18,95 @@ func (c *BusinessBonusController) Prepare() { @@ -24,95 +18,95 @@ func (c *BusinessBonusController) Prepare() {
24 } 18 }
25 } 19 }
26 20
27 -func (c *BusinessBonusController) ListBusinessBonus() {  
28 - type Parameter struct {  
29 - PageNumber int `json:"pageNumber"`  
30 - Partner int64 `json:"partner"`  
31 - PageSize int `json:"pageSize"`  
32 - SearchText string `json:"searchText"`  
33 - }  
34 - var (  
35 - param Parameter  
36 - err error  
37 - )  
38 - if err = c.BindJsonData(&param); err != nil {  
39 - logs.Error(err)  
40 - c.ResponseError(errors.New("json数据解析失败"))  
41 - return  
42 - }  
43 - if param.PageSize == 0 {  
44 - param.PageSize = 20  
45 - }  
46 - if param.PageNumber == 0 {  
47 - param.PageNumber = 1  
48 - }  
49 - companyId := c.GetUserCompany()  
50 - srv := businessService.NewBusinessBonusService(nil)  
51 - cnt, result, err := srv.ListBusinessBonus(businessQuery.ListBusinessBonusQuery{  
52 - CompanyId: companyId,  
53 - Limit: param.PageSize,  
54 - Offset: param.PageSize * (param.PageNumber - 1),  
55 - PartnerId: param.Partner,  
56 - })  
57 - if err != nil {  
58 - c.ResponseError(err)  
59 - return  
60 - }  
61 - c.ResponsePageList(result, cnt, param.PageNumber)  
62 -} 21 +// func (c *BusinessBonusController) ListBusinessBonus() {
  22 +// type Parameter struct {
  23 +// PageNumber int `json:"pageNumber"`
  24 +// Partner int64 `json:"partner"`
  25 +// PageSize int `json:"pageSize"`
  26 +// SearchText string `json:"searchText"`
  27 +// }
  28 +// var (
  29 +// param Parameter
  30 +// err error
  31 +// )
  32 +// if err = c.BindJsonData(&param); err != nil {
  33 +// logs.Error(err)
  34 +// c.ResponseError(errors.New("json数据解析失败"))
  35 +// return
  36 +// }
  37 +// if param.PageSize == 0 {
  38 +// param.PageSize = 20
  39 +// }
  40 +// if param.PageNumber == 0 {
  41 +// param.PageNumber = 1
  42 +// }
  43 +// companyId := c.GetUserCompany()
  44 +// srv := businessService.NewBusinessBonusService(nil)
  45 +// cnt, result, err := srv.ListBusinessBonus(businessQuery.ListBusinessBonusQuery{
  46 +// CompanyId: companyId,
  47 +// Limit: param.PageSize,
  48 +// Offset: param.PageSize * (param.PageNumber - 1),
  49 +// PartnerId: param.Partner,
  50 +// })
  51 +// if err != nil {
  52 +// c.ResponseError(err)
  53 +// return
  54 +// }
  55 +// c.ResponsePageList(result, cnt, param.PageNumber)
  56 +// }
63 57
64 -func (c *BusinessBonusController) UpdateBusinessBonus() {  
65 - type Parameter struct {  
66 - Id int64 `json:"id"`  
67 - DividendsReceivable float64 `json:"dividendsReceivable"`  
68 - StateOfPayment int8 `json:"stateOfPayment"`  
69 - }  
70 - var (  
71 - param Parameter  
72 - err error  
73 - )  
74 - if err = c.BindJsonData(&param); err != nil {  
75 - logs.Error(err)  
76 - c.ResponseError(errors.New("json数据解析失败"))  
77 - return  
78 - }  
79 - companyId := c.GetUserCompany()  
80 - srv := businessService.NewBusinessBonusService(nil)  
81 - err = srv.UpdateBusinessBonus(businessCommand.UpdateBusinessBonusCommand{  
82 - CompanyId: companyId,  
83 - Id: param.Id,  
84 - Bonus: param.DividendsReceivable,  
85 - BonusStatus: param.StateOfPayment,  
86 - })  
87 - if err != nil {  
88 - c.ResponseError(err)  
89 - return  
90 - }  
91 - c.ResponseData(nil)  
92 -} 58 +// func (c *BusinessBonusController) UpdateBusinessBonus() {
  59 +// type Parameter struct {
  60 +// Id int64 `json:"id"`
  61 +// DividendsReceivable float64 `json:"dividendsReceivable"`
  62 +// StateOfPayment int8 `json:"stateOfPayment"`
  63 +// }
  64 +// var (
  65 +// param Parameter
  66 +// err error
  67 +// )
  68 +// if err = c.BindJsonData(&param); err != nil {
  69 +// logs.Error(err)
  70 +// c.ResponseError(errors.New("json数据解析失败"))
  71 +// return
  72 +// }
  73 +// companyId := c.GetUserCompany()
  74 +// srv := businessService.NewBusinessBonusService(nil)
  75 +// err = srv.UpdateBusinessBonus(businessCommand.UpdateBusinessBonusCommand{
  76 +// CompanyId: companyId,
  77 +// Id: param.Id,
  78 +// Bonus: param.DividendsReceivable,
  79 +// BonusStatus: param.StateOfPayment,
  80 +// })
  81 +// if err != nil {
  82 +// c.ResponseError(err)
  83 +// return
  84 +// }
  85 +// c.ResponseData(nil)
  86 +// }
93 87
94 -func (c *BusinessBonusController) GetBusinessBonus() {  
95 - type Parameter struct {  
96 - Id int64 `json:"id"`  
97 - }  
98 - var (  
99 - param Parameter  
100 - err error  
101 - )  
102 - if err = c.BindJsonData(&param); err != nil {  
103 - logs.Error(err)  
104 - c.ResponseError(errors.New("json数据解析失败"))  
105 - return  
106 - }  
107 - companyId := c.GetUserCompany()  
108 - srv := businessService.NewBusinessBonusService(nil)  
109 - data, err := srv.GetBusinessBonus(businessQuery.GetBusinessBonusQuery{  
110 - Id: param.Id,  
111 - CompanyId: companyId,  
112 - })  
113 - if err != nil {  
114 - c.ResponseError(err)  
115 - return  
116 - }  
117 - c.ResponseData(data)  
118 -} 88 +// func (c *BusinessBonusController) GetBusinessBonus() {
  89 +// type Parameter struct {
  90 +// Id int64 `json:"id"`
  91 +// }
  92 +// var (
  93 +// param Parameter
  94 +// err error
  95 +// )
  96 +// if err = c.BindJsonData(&param); err != nil {
  97 +// logs.Error(err)
  98 +// c.ResponseError(errors.New("json数据解析失败"))
  99 +// return
  100 +// }
  101 +// companyId := c.GetUserCompany()
  102 +// srv := businessService.NewBusinessBonusService(nil)
  103 +// data, err := srv.GetBusinessBonus(businessQuery.GetBusinessBonusQuery{
  104 +// Id: param.Id,
  105 +// CompanyId: companyId,
  106 +// })
  107 +// if err != nil {
  108 +// c.ResponseError(err)
  109 +// return
  110 +// }
  111 +// c.ResponseData(data)
  112 +// }
@@ -39,11 +39,11 @@ func init() { @@ -39,11 +39,11 @@ func init() {
39 // beego.NSRouter("/business/list", &controllers.BusinessBonusController{}, "POST:ListBusinessBonus"), 39 // beego.NSRouter("/business/list", &controllers.BusinessBonusController{}, "POST:ListBusinessBonus"),
40 ), 40 ),
41 beego.NSNamespace("/order", 41 beego.NSNamespace("/order",
42 - beego.NSRouter("/purpose/list", &controllers.OrderInfoController{}, "POST:PageListOrderPurpose"),  
43 - beego.NSRouter("/purpose/update", &controllers.OrderInfoController{}, "POST:UpdateOrderPurpose"),  
44 - beego.NSRouter("/purpose/detail", &controllers.OrderInfoController{}, "POST:GetOrderPurpose"),  
45 - beego.NSRouter("/purpose/del", &controllers.OrderInfoController{}, "POST:RemoveOrderPurpose"),  
46 - beego.NSRouter("/purpose/sendout", &controllers.OrderInfoController{}, "POST:OrderPurposeDelivery"), 42 + // beego.NSRouter("/purpose/list", &controllers.OrderInfoController{}, "POST:PageListOrderPurpose"),
  43 + // beego.NSRouter("/purpose/update", &controllers.OrderInfoController{}, "POST:UpdateOrderPurpose"),
  44 + // beego.NSRouter("/purpose/detail", &controllers.OrderInfoController{}, "POST:GetOrderPurpose"),
  45 + // beego.NSRouter("/purpose/del", &controllers.OrderInfoController{}, "POST:RemoveOrderPurpose"),
  46 + // beego.NSRouter("/purpose/sendout", &controllers.OrderInfoController{}, "POST:OrderPurposeDelivery"),
47 beego.NSRouter("/actual/list", &controllers.OrderInfoController{}, "POST:PageListOrderReal"), 47 beego.NSRouter("/actual/list", &controllers.OrderInfoController{}, "POST:PageListOrderReal"),
48 beego.NSRouter("/actual/detail", &controllers.OrderInfoController{}, "POST:GetOrderReal"), 48 beego.NSRouter("/actual/detail", &controllers.OrderInfoController{}, "POST:GetOrderReal"),
49 beego.NSRouter("/actual/del", &controllers.OrderInfoController{}, "POST:RemoveOrderReal"), 49 beego.NSRouter("/actual/del", &controllers.OrderInfoController{}, "POST:RemoveOrderReal"),