Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev
正在显示
15 个修改的文件
包含
88 行增加
和
20 行删除
@@ -14,10 +14,10 @@ type CooperationApplicationItem struct { | @@ -14,10 +14,10 @@ type CooperationApplicationItem struct { | ||
14 | CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创编号 | 14 | CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创编号 |
15 | } `json:"cooperationProject"` | 15 | } `json:"cooperationProject"` |
16 | CooperationApplicationApplicant struct { | 16 | CooperationApplicationApplicant struct { |
17 | - UserName string `json:"userName"` //申请人名字 | ||
18 | - UserCode string `json:"userCode"` | 17 | + UserName string `json:"usersName"` //申请人名字 |
18 | + UserCode string `json:"usersCode"` | ||
19 | DepartmentName string `json:"departmentName"` //申请人部门 | 19 | DepartmentName string `json:"departmentName"` //申请人部门 |
20 | - Phone string `json:"userPhone"` //申请人电话 | 20 | + Phone string `json:"Phone"` //申请人电话 |
21 | } `json:"cooperationApplicationApplicant"` | 21 | } `json:"cooperationApplicationApplicant"` |
22 | CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件 | 22 | CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件 |
23 | CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述 | 23 | CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述 |
@@ -26,8 +26,7 @@ type CooperationApplicationItem struct { | @@ -26,8 +26,7 @@ type CooperationApplicationItem struct { | ||
26 | CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述 | 26 | CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述 |
27 | CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间 | 27 | CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间 |
28 | CooperationApplicationStatus int `json:"cooperationApplicationStatus"` // | 28 | CooperationApplicationStatus int `json:"cooperationApplicationStatus"` // |
29 | - | ||
30 | - Org struct { | 29 | + Org struct { |
31 | OrgID int `json:"orgId"` | 30 | OrgID int `json:"orgId"` |
32 | OrgName string `json:"orgName"` | 31 | OrgName string `json:"orgName"` |
33 | } `json:"org"` //组织 | 32 | } `json:"org"` //组织 |
@@ -18,8 +18,8 @@ type ListCooperationApplicationQuery struct { | @@ -18,8 +18,8 @@ type ListCooperationApplicationQuery struct { | ||
18 | ProjectName string `json:"projectName"` | 18 | ProjectName string `json:"projectName"` |
19 | //申请人名称 | 19 | //申请人名称 |
20 | ApplicantName string `json:"applicantName"` | 20 | ApplicantName string `json:"applicantName"` |
21 | - //审核状态 | ||
22 | - VerifyStatus int `json:"verifyStatus"` | 21 | + //只显示待审核 |
22 | + WaitAuditOnly bool `json:"waitAuditOnly"` | ||
23 | } | 23 | } |
24 | 24 | ||
25 | func (listCooperationApplicationQuery *ListCooperationApplicationQuery) Valid(validation *validation.Validation) { | 25 | func (listCooperationApplicationQuery *ListCooperationApplicationQuery) Valid(validation *validation.Validation) { |
@@ -60,10 +60,15 @@ func (cooperationApplicationService *CooperationApplicationService) ListCooperat | @@ -60,10 +60,15 @@ func (cooperationApplicationService *CooperationApplicationService) ListCooperat | ||
60 | if err := listCooperationApplicationQuery.ValidateQuery(); err != nil { | 60 | if err := listCooperationApplicationQuery.ValidateQuery(); err != nil { |
61 | return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 61 | return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
62 | } | 62 | } |
63 | + cooperationApplicationStatus := 0 | ||
64 | + if listCooperationApplicationQuery.WaitAuditOnly { | ||
65 | + cooperationApplicationStatus = 1 | ||
66 | + } | ||
67 | + | ||
63 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationApplicationQuery.Operator) | 68 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationApplicationQuery.Operator) |
64 | result, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{ | 69 | result, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{ |
65 | ApplicantName: listCooperationApplicationQuery.ApplicantName, | 70 | ApplicantName: listCooperationApplicationQuery.ApplicantName, |
66 | - CooperationApplicationStatus: listCooperationApplicationQuery.VerifyStatus, | 71 | + CooperationApplicationStatus: cooperationApplicationStatus, |
67 | CooperationProjectName: listCooperationApplicationQuery.ProjectName, | 72 | CooperationProjectName: listCooperationApplicationQuery.ProjectName, |
68 | PageNumber: listCooperationApplicationQuery.PageNumber, | 73 | PageNumber: listCooperationApplicationQuery.PageNumber, |
69 | PageSize: listCooperationApplicationQuery.PageSize, | 74 | PageSize: listCooperationApplicationQuery.PageSize, |
@@ -25,7 +25,7 @@ type CreateCooperationContractCommand struct { | @@ -25,7 +25,7 @@ type CreateCooperationContractCommand struct { | ||
25 | // 共创模式编码, | 25 | // 共创模式编码, |
26 | CooperationModeNumber string `json:"cooperationModeNumber"` | 26 | CooperationModeNumber string `json:"cooperationModeNumber"` |
27 | // 共创合约发起人uid | 27 | // 共创合约发起人uid |
28 | - SponsorUid string `json:"sponsorUserId"` | 28 | + SponsorUid string `json:"sponsorUid"` |
29 | } `json:"cooperationContract"` | 29 | } `json:"cooperationContract"` |
30 | // 业绩分红激励规则列表 | 30 | // 业绩分红激励规则列表 |
31 | DividendsIncentivesRules []struct { | 31 | DividendsIncentivesRules []struct { |
@@ -13,7 +13,9 @@ type ListCooperationContractQuery struct { | @@ -13,7 +13,9 @@ type ListCooperationContractQuery struct { | ||
13 | // 查询偏离量 | 13 | // 查询偏离量 |
14 | PageNumber int `json:"pageNumber"` | 14 | PageNumber int `json:"pageNumber"` |
15 | // 查询限制 | 15 | // 查询限制 |
16 | - PageSize int `json:"pageSize" valid:"Required"` | 16 | + PageSize int `json:"pageSize" valid:"Required"` |
17 | + CooperationContractNumber string `json:"cooperationContractNumber"` | ||
18 | + SponsorName string `json:"sponsorName"` | ||
17 | } | 19 | } |
18 | 20 | ||
19 | func (listCooperationContractQuery *ListCooperationContractQuery) Valid(validation *validation.Validation) { | 21 | func (listCooperationContractQuery *ListCooperationContractQuery) Valid(validation *validation.Validation) { |
@@ -112,8 +112,10 @@ func (cooperationContractService *CooperationContractService) ListCooperationCon | @@ -112,8 +112,10 @@ func (cooperationContractService *CooperationContractService) ListCooperationCon | ||
112 | } | 112 | } |
113 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationContractQuery.Operator) | 113 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationContractQuery.Operator) |
114 | result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{ | 114 | result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{ |
115 | - PageNumber: listCooperationContractQuery.PageNumber, | ||
116 | - PageSize: listCooperationContractQuery.PageSize, | 115 | + PageNumber: listCooperationContractQuery.PageNumber, |
116 | + PageSize: listCooperationContractQuery.PageSize, | ||
117 | + SponsorName: listCooperationContractQuery.SponsorName, | ||
118 | + CooperationContractNumber: listCooperationContractQuery.CooperationContractNumber, | ||
117 | }) | 119 | }) |
118 | if err != nil { | 120 | if err != nil { |
119 | return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 121 | return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
@@ -15,7 +15,7 @@ type DividendsOrder struct { | @@ -15,7 +15,7 @@ type DividendsOrder struct { | ||
15 | DividendTime int64 `json:"dividendTime"` //分红订单分红时间 | 15 | DividendTime int64 `json:"dividendTime"` //分红订单分红时间 |
16 | DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额 | 16 | DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额 |
17 | DividendsOrderID int `json:"dividendsOrderId"` //分红订单 | 17 | DividendsOrderID int `json:"dividendsOrderId"` //分红订单 |
18 | - DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号 | 18 | + DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号 |
19 | DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号 | 19 | DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号 |
20 | OrderSalesman struct { //订单业务员 | 20 | OrderSalesman struct { //订单业务员 |
21 | Department struct { | 21 | Department struct { |
@@ -84,6 +84,31 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide | @@ -84,6 +84,31 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide | ||
84 | return updateDividendsReturnedOrderCommand, nil | 84 | return updateDividendsReturnedOrderCommand, nil |
85 | } | 85 | } |
86 | 86 | ||
87 | +// 更新分红退货单服务 | ||
88 | +func (dividendsReturnedOrderService *DividendsReturnedOrderService) SelectorDividendsOrder(selectorDividendsOrderQuery *query.SelectorDividendsOrderQuery) ( | ||
89 | + int, interface{}, error) { | ||
90 | + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(selectorDividendsOrderQuery.Operator) | ||
91 | + result, err := creationCooperationGateway.DividendsOrderSearch(allied_creation_cooperation.ReqDividendsOrderSearch{ | ||
92 | + DividendsOrderNumber: selectorDividendsOrderQuery.DividendsOrderNumber, | ||
93 | + PageNumber: 1, | ||
94 | + PageSize: 999, | ||
95 | + }) | ||
96 | + if err != nil { | ||
97 | + return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
98 | + } | ||
99 | + listData := []map[string]interface{}{} | ||
100 | + for _, v := range result.Gride.List { | ||
101 | + m := map[string]interface{}{ | ||
102 | + "dividendsOrderNumber": v.DividendsOrderNumber, | ||
103 | + "dividendsOriginalOrderNum": v.DividendsOriginalOrderNum, | ||
104 | + "dividendsOrderId": strconv.Itoa(v.DividendsOrderID), | ||
105 | + "dividendTime": v.DividendTime.Unix(), | ||
106 | + } | ||
107 | + listData = append(listData, m) | ||
108 | + } | ||
109 | + return result.Gride.Total, listData, nil | ||
110 | +} | ||
111 | + | ||
87 | func NewDividendsReturnedOrderService(options map[string]interface{}) *DividendsReturnedOrderService { | 112 | func NewDividendsReturnedOrderService(options map[string]interface{}) *DividendsReturnedOrderService { |
88 | newDividendsReturnedOrderService := &DividendsReturnedOrderService{} | 113 | newDividendsReturnedOrderService := &DividendsReturnedOrderService{} |
89 | return newDividendsReturnedOrderService | 114 | return newDividendsReturnedOrderService |
@@ -161,10 +161,10 @@ type ( | @@ -161,10 +161,10 @@ type ( | ||
161 | MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"` // 金额激励规则列表 | 161 | MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"` // 金额激励规则列表 |
162 | Undertakers []Undertaker `json:"undertakers"` // 承接方列表 | 162 | Undertakers []Undertaker `json:"undertakers"` // 承接方列表 |
163 | RelevantIds []string `json:"relevantIds"` //关联业务员 | 163 | RelevantIds []string `json:"relevantIds"` //关联业务员 |
164 | - CompanyId int `json:"companyId,string"` | ||
165 | - OrgId int `json:"orgId,string"` // 组织机构ID | ||
166 | - UserId int ` json:"userId,string"` // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
167 | - UserBaseId int `json:"userBaseId,string" ` // 用户基础数据id | 164 | + CompanyId int `json:"-"` |
165 | + OrgId int `json:"-"` // 组织机构ID | ||
166 | + UserId int `json:"-"` // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
167 | + UserBaseId int `json:"-" ` // 用户基础数据id | ||
168 | } | 168 | } |
169 | 169 | ||
170 | DataCooperationContractAdd struct { | 170 | DataCooperationContractAdd struct { |
@@ -15,7 +15,7 @@ type DividendsOrder struct { | @@ -15,7 +15,7 @@ type DividendsOrder struct { | ||
15 | DividendTime time.Time `json:"dividendTime"` //分红订单分红时间 | 15 | DividendTime time.Time `json:"dividendTime"` //分红订单分红时间 |
16 | DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额 | 16 | DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额 |
17 | DividendsOrderID int `json:"dividendsOrderId"` //分红订单 | 17 | DividendsOrderID int `json:"dividendsOrderId"` //分红订单 |
18 | - DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号 | 18 | + DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号 |
19 | DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号 | 19 | DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号 |
20 | OrderSalesman struct { //订单业务员 | 20 | OrderSalesman struct { //订单业务员 |
21 | Department struct { | 21 | Department struct { |
@@ -88,10 +88,10 @@ func (controller *BaseController) GetOperator() domain.Operator { | @@ -88,10 +88,10 @@ func (controller *BaseController) GetOperator() domain.Operator { | ||
88 | } | 88 | } |
89 | // TODO:测试数据后期删除 | 89 | // TODO:测试数据后期删除 |
90 | if op.UserId == 0 { | 90 | if op.UserId == 0 { |
91 | - op.UserId = 9 | 91 | + op.UserId = 23 |
92 | op.CompanyId = 23 | 92 | op.CompanyId = 23 |
93 | op.OrgId = 45 | 93 | op.OrgId = 45 |
94 | - op.UserBaseId = 5 | 94 | + op.UserBaseId = 23 |
95 | } | 95 | } |
96 | // TODO:打印测试日志 | 96 | // TODO:打印测试日志 |
97 | log.Logger.Debug("operator " + json.MarshalToString(op)) | 97 | log.Logger.Debug("operator " + json.MarshalToString(op)) |
@@ -70,3 +70,15 @@ func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder | @@ -70,3 +70,15 @@ func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder | ||
70 | cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery) | 70 | cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery) |
71 | controller.ReturnPageListData(int64(cnt), data, err, searchDividendsReturnedOrderQuery.PageNumber) | 71 | controller.ReturnPageListData(int64(cnt), data, err, searchDividendsReturnedOrderQuery.PageNumber) |
72 | } | 72 | } |
73 | + | ||
74 | +func (controller *DividendsReturnedOrderController) SelectorDividendsOrder() { | ||
75 | + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil) | ||
76 | + selectorDividendsOrderQuery := &query.SelectorDividendsOrderQuery{} | ||
77 | + err := controller.Unmarshal(selectorDividendsOrderQuery) | ||
78 | + if err != nil { | ||
79 | + log.Logger.Debug("json err:" + err.Error()) | ||
80 | + } | ||
81 | + selectorDividendsOrderQuery.Operator = controller.GetOperator() | ||
82 | + cnt, data, err := dividendsReturnedOrderService.SelectorDividendsOrder(selectorDividendsOrderQuery) | ||
83 | + controller.ReturnPageListData(int64(cnt), data, err, 0) | ||
84 | +} |
1 | +package routers | ||
2 | + | ||
3 | +import ( | ||
4 | + "github.com/beego/beego/v2/server/web" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client" | ||
6 | +) | ||
7 | + | ||
8 | +func init() { | ||
9 | + web.Router("/v1/web/dividends-order/", &web_client.DividendsOrderController{}, "Post:CreateDividendsOrder") | ||
10 | + web.Router("/v1/web/dividends-order/:orderId", &web_client.DividendsOrderController{}, "Put:UpdateDividendsOrder") | ||
11 | + web.Router("/v1/web/dividends-order/remove", &web_client.DividendsOrderController{}, "Post:RemoveDividendsOrder") | ||
12 | + web.Router("/v1/web/dividends-order/:orderId", &web_client.DividendsOrderController{}, "Get:GetDividendsOrder") | ||
13 | + web.Router("/v1/web/dividends-order/search", &web_client.DividendsOrderController{}, "Post:SearchDividendsOrder") | ||
14 | +} |
@@ -11,4 +11,5 @@ func init() { | @@ -11,4 +11,5 @@ func init() { | ||
11 | web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Delete:RemoveDividendsReturnedOrder") | 11 | web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Delete:RemoveDividendsReturnedOrder") |
12 | web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Get:GetDividendsReturnedOrder") | 12 | web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Get:GetDividendsReturnedOrder") |
13 | web.Router("/v1/web/dividends-returned-order/search", &web_client.DividendsReturnedOrderController{}, "Post:SearchDividendsReturnedOrder") | 13 | web.Router("/v1/web/dividends-returned-order/search", &web_client.DividendsReturnedOrderController{}, "Post:SearchDividendsReturnedOrder") |
14 | + web.Router("/v1/web/dividends-returned-order/selector/dividends-order", &web_client.DividendsReturnedOrderController{}, "Post:SelectorDividendsOrder") | ||
14 | } | 15 | } |
-
请 注册 或 登录 后发表评论