作者 Your Name

调整 根据项目编码获取详情 需要的条件

1 package query 1 package query
2 2
3 import ( 3 import (
4 - "fmt"  
5 -  
6 - "github.com/beego/beego/v2/core/validation"  
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" 4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
8 ) 5 )
9 6
@@ -11,24 +8,7 @@ type GetCooperationProjectQuery struct { @@ -11,24 +8,7 @@ type GetCooperationProjectQuery struct {
11 //操作人 8 //操作人
12 Operator domain.Operator `json:"-"` 9 Operator domain.Operator `json:"-"`
13 // 共创项目ID 10 // 共创项目ID
14 - CooperationProjectId int `json:"cooperationProjectId"`  
15 - CooperationProjectNumber string `json:"cooperationProjectNumber"`  
16 -}  
17 -  
18 -func (getCooperationProjectQuery *GetCooperationProjectQuery) Valid(validation *validation.Validation) {  
19 -  
20 -}  
21 -  
22 -func (getCooperationProjectQuery *GetCooperationProjectQuery) ValidateQuery() error {  
23 - valid := validation.Validation{}  
24 - b, err := valid.Valid(getCooperationProjectQuery)  
25 - if err != nil {  
26 - return err  
27 - }  
28 - if !b {  
29 - for _, validErr := range valid.Errors {  
30 - return fmt.Errorf("%s %s", validErr.Key, validErr.Message)  
31 - }  
32 - }  
33 - return nil 11 + CooperationProjectId int `json:"-"`
  12 + CooperationProjectNumber string `json:"-"`
  13 + OrgId int `json:"-"`
34 } 14 }
@@ -63,6 +63,8 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec @@ -63,6 +63,8 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec
63 resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{ 63 resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
64 CooperationProjectId: getCooperationProjectQuery.CooperationProjectId, 64 CooperationProjectId: getCooperationProjectQuery.CooperationProjectId,
65 CooperationProjectNumber: getCooperationProjectQuery.CooperationProjectNumber, 65 CooperationProjectNumber: getCooperationProjectQuery.CooperationProjectNumber,
  66 + OrgId: getCooperationProjectQuery.OrgId,
  67 + CompanyId: int(getCooperationProjectQuery.Operator.CompanyId),
66 }) 68 })
67 if err != nil { 69 if err != nil {
68 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 70 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -72,6 +74,7 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec @@ -72,6 +74,7 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec
72 PageNumber: 0, 74 PageNumber: 0,
73 PageSize: 0, 75 PageSize: 0,
74 CompanyId: resultProject.Company.CompanyId, 76 CompanyId: resultProject.Company.CompanyId,
  77 + OrgId: int64(resultProject.Org.OrgId),
75 }) 78 })
76 if err != nil { 79 if err != nil {
77 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 80 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -8,24 +8,7 @@ type GetDividendsOrderQuery struct { @@ -8,24 +8,7 @@ type GetDividendsOrderQuery struct {
8 //操作人 8 //操作人
9 Operator domain.Operator `json:"-"` 9 Operator domain.Operator `json:"-"`
10 // 分红订单ID 10 // 分红订单ID
11 - DividendsOrderId int `json:"dividendsOrderId,string" valid:"Required"`  
12 - DividendsOrderNumber string `json:"dividendsOrderNumber"` 11 + DividendsOrderId int `json:"-" `
  12 + DividendsOrderNumber string `json:"-"`
  13 + OrgId int `json:"-"`
13 } 14 }
14 -  
15 -// func (getDividendsOrderQuery *GetDividendsOrderQuery) Valid(validation *validation.Validation) {  
16 -  
17 -// }  
18 -  
19 -// func (getDividendsOrderQuery *GetDividendsOrderQuery) ValidateQuery() error {  
20 -// valid := validation.Validation{}  
21 -// b, err := valid.Valid(getDividendsOrderQuery)  
22 -// if err != nil {  
23 -// return err  
24 -// }  
25 -// if !b {  
26 -// for _, validErr := range valid.Errors {  
27 -// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)  
28 -// }  
29 -// }  
30 -// return nil  
31 -// }  
@@ -57,6 +57,8 @@ func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividen @@ -57,6 +57,8 @@ func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividen
57 result, err := creationCooperationGateway.DividendsOrderGet(allied_creation_cooperation.ReqDividendsOrderGet{ 57 result, err := creationCooperationGateway.DividendsOrderGet(allied_creation_cooperation.ReqDividendsOrderGet{
58 DividendsOrderId: getDividendsOrderQuery.DividendsOrderId, 58 DividendsOrderId: getDividendsOrderQuery.DividendsOrderId,
59 DividendsOrderNumber: getDividendsOrderQuery.DividendsOrderNumber, 59 DividendsOrderNumber: getDividendsOrderQuery.DividendsOrderNumber,
  60 + OrgId: getDividendsOrderQuery.OrgId,
  61 + CompanyId: int(getDividendsOrderQuery.Operator.CompanyId),
60 }) 62 })
61 if err != nil { 63 if err != nil {
62 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 64 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -78,7 +78,10 @@ func (gateway HttplibAlliedCreationCooperation) CooperationProjectGet(param ReqC @@ -78,7 +78,10 @@ func (gateway HttplibAlliedCreationCooperation) CooperationProjectGet(param ReqC
78 req := gateway.CreateRequest(url, method) 78 req := gateway.CreateRequest(url, method)
79 if len(param.CooperationProjectNumber) > 0 { 79 if len(param.CooperationProjectNumber) > 0 {
80 req.Param("cooperationProjectNumber", param.CooperationProjectNumber) 80 req.Param("cooperationProjectNumber", param.CooperationProjectNumber)
  81 + req.Param("orgId", strconv.Itoa(param.OrgId))
  82 + req.Param("companyId", strconv.Itoa(param.CompanyId))
81 } 83 }
  84 +
82 log.Logger.Debug("向业务模块请求数据:返回共创项目详情。", map[string]interface{}{ 85 log.Logger.Debug("向业务模块请求数据:返回共创项目详情。", map[string]interface{}{
83 "api": method + ":" + url, 86 "api": method + ":" + url,
84 "param": param, 87 "param": param,
@@ -205,6 +205,8 @@ func (gateway HttplibAlliedCreationCooperation) DividendsOrderGet(param ReqDivid @@ -205,6 +205,8 @@ func (gateway HttplibAlliedCreationCooperation) DividendsOrderGet(param ReqDivid
205 req := gateway.CreateRequest(url, method) 205 req := gateway.CreateRequest(url, method)
206 if len(param.DividendsOrderNumber) > 0 { 206 if len(param.DividendsOrderNumber) > 0 {
207 req.Param("dividendsOrderNumber", param.DividendsOrderNumber) 207 req.Param("dividendsOrderNumber", param.DividendsOrderNumber)
  208 + req.Param("orgId", strconv.Itoa(param.OrgId))
  209 + req.Param("companyId", strconv.Itoa(param.CompanyId))
208 } 210 }
209 fmt.Printf("=========>param %+v", param) 211 fmt.Printf("=========>param %+v", param)
210 log.Logger.Debug("向业务模块请求数据:返回分红订单详情。", map[string]interface{}{ 212 log.Logger.Debug("向业务模块请求数据:返回分红订单详情。", map[string]interface{}{
@@ -118,6 +118,8 @@ type ( @@ -118,6 +118,8 @@ type (
118 ReqCooperationProjectGet struct { 118 ReqCooperationProjectGet struct {
119 CooperationProjectId int 119 CooperationProjectId int
120 CooperationProjectNumber string 120 CooperationProjectNumber string
  121 + OrgId int
  122 + CompanyId int
121 } 123 }
122 124
123 DataCooperationProjectGet struct { 125 DataCooperationProjectGet struct {
@@ -173,8 +173,10 @@ type ( @@ -173,8 +173,10 @@ type (
173 //返回分红订单详情 173 //返回分红订单详情
174 type ( 174 type (
175 ReqDividendsOrderGet struct { 175 ReqDividendsOrderGet struct {
176 - DividendsOrderId int `json:"dividendsOrderId"`  
177 - DividendsOrderNumber string `json:"dividendsOrderNumber"` 176 + DividendsOrderId int
  177 + DividendsOrderNumber string
  178 + OrgId int
  179 + CompanyId int
178 } 180 }
179 181
180 DataDividendsOrderGet struct { 182 DataDividendsOrderGet struct {
@@ -46,8 +46,10 @@ func (controller *CooperationProjectController) GetCooperationProject() { @@ -46,8 +46,10 @@ func (controller *CooperationProjectController) GetCooperationProject() {
46 getCooperationProjectQuery := &query.GetCooperationProjectQuery{} 46 getCooperationProjectQuery := &query.GetCooperationProjectQuery{}
47 projectId, _ := controller.GetInt(":projectId") 47 projectId, _ := controller.GetInt(":projectId")
48 projectNumber := controller.GetString("cooperationProjectNumber") 48 projectNumber := controller.GetString("cooperationProjectNumber")
  49 + orgId, _ := controller.GetInt("orgId")
49 getCooperationProjectQuery.CooperationProjectId = projectId 50 getCooperationProjectQuery.CooperationProjectId = projectId
50 getCooperationProjectQuery.CooperationProjectNumber = projectNumber 51 getCooperationProjectQuery.CooperationProjectNumber = projectNumber
  52 + getCooperationProjectQuery.OrgId = orgId
51 getCooperationProjectQuery.Operator = controller.GetOperator() 53 getCooperationProjectQuery.Operator = controller.GetOperator()
52 data, err := cooperationProjectService.GetCooperationProject(getCooperationProjectQuery) 54 data, err := cooperationProjectService.GetCooperationProject(getCooperationProjectQuery)
53 controller.Response(data, err) 55 controller.Response(data, err)
@@ -61,7 +61,9 @@ func (controller *DividendsOrderController) GetDividendsOrder() { @@ -61,7 +61,9 @@ func (controller *DividendsOrderController) GetDividendsOrder() {
61 getDividendsOrderQuery := &query.GetDividendsOrderQuery{} 61 getDividendsOrderQuery := &query.GetDividendsOrderQuery{}
62 orderId, _ := controller.GetInt(":orderId") 62 orderId, _ := controller.GetInt(":orderId")
63 dividendsOrderNumber := controller.GetString("dividendsOrderNumber") 63 dividendsOrderNumber := controller.GetString("dividendsOrderNumber")
  64 + orgId, _ := controller.GetInt("orgId")
64 getDividendsOrderQuery.DividendsOrderId = orderId 65 getDividendsOrderQuery.DividendsOrderId = orderId
  66 + getDividendsOrderQuery.OrgId = orgId
65 getDividendsOrderQuery.DividendsOrderNumber = dividendsOrderNumber 67 getDividendsOrderQuery.DividendsOrderNumber = dividendsOrderNumber
66 getDividendsOrderQuery.Operator = controller.GetOperator() 68 getDividendsOrderQuery.Operator = controller.GetOperator()
67 data, err := dividendsOrderService.GetDividendsOrder(getDividendsOrderQuery) 69 data, err := dividendsOrderService.GetDividendsOrder(getDividendsOrderQuery)