Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev
正在显示
7 个修改的文件
包含
46 行增加
和
46 行删除
@@ -11,7 +11,6 @@ type CreateDividendsReturnedOrderCommand struct { | @@ -11,7 +11,6 @@ type CreateDividendsReturnedOrderCommand struct { | ||
11 | DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号 | 11 | DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号 |
12 | OriginalOrderNum string `json:"originalOrderNum"` //源单号 | 12 | OriginalOrderNum string `json:"originalOrderNum"` //源单号 |
13 | OrderGoods []struct { | 13 | OrderGoods []struct { |
14 | - OrderGoodId int64 `json:"orderGoodId,string"` // 订单产品id | ||
15 | CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号 | 14 | CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号 |
16 | // OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额 | 15 | // OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额 |
17 | OrderGoodName string `json:"orderGoodName"` //订单产品名称 | 16 | OrderGoodName string `json:"orderGoodName"` //订单产品名称 |
@@ -2,7 +2,6 @@ package service | @@ -2,7 +2,6 @@ package service | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "strconv" | 4 | "strconv" |
5 | - "time" | ||
6 | 5 | ||
7 | "github.com/linmadan/egglib-go/core/application" | 6 | "github.com/linmadan/egglib-go/core/application" |
8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command" | 7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command" |
@@ -18,8 +17,7 @@ type DividendsReturnedOrderService struct { | @@ -18,8 +17,7 @@ type DividendsReturnedOrderService struct { | ||
18 | // 创建分红退货单服务 | 17 | // 创建分红退货单服务 |
19 | func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand *command.CreateDividendsReturnedOrderCommand) (interface{}, error) { | 18 | func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand *command.CreateDividendsReturnedOrderCommand) (interface{}, error) { |
20 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsReturnedOrderCommand.Operator) | 19 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsReturnedOrderCommand.Operator) |
21 | - dividendsReturnedDate := time.Unix(createDividendsReturnedOrderCommand.DividendsReturnedDate/1e3, 0) | ||
22 | - orderDate := time.Unix(createDividendsReturnedOrderCommand.OrderTime/1e3, 0) | 20 | + |
23 | var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood | 21 | var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood |
24 | for _, v := range createDividendsReturnedOrderCommand.OrderGoods { | 22 | for _, v := range createDividendsReturnedOrderCommand.OrderGoods { |
25 | good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{ | 23 | good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{ |
@@ -37,8 +35,8 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide | @@ -37,8 +35,8 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide | ||
37 | DividendsOrderNumber: createDividendsReturnedOrderCommand.DividendsOrderNumber, | 35 | DividendsOrderNumber: createDividendsReturnedOrderCommand.DividendsOrderNumber, |
38 | OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum, | 36 | OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum, |
39 | OrderGoods: orderGooods, | 37 | OrderGoods: orderGooods, |
40 | - DividendsReturnedDate: dividendsReturnedDate, | ||
41 | - OrderTime: orderDate, | 38 | + DividendsReturnedDate: createDividendsReturnedOrderCommand.DividendsReturnedDate, |
39 | + OrderTime: createDividendsReturnedOrderCommand.OrderTime, | ||
42 | OrgId: int(createDividendsReturnedOrderCommand.Operator.OrgId), | 40 | OrgId: int(createDividendsReturnedOrderCommand.Operator.OrgId), |
43 | Remarks: createDividendsReturnedOrderCommand.Remarks, | 41 | Remarks: createDividendsReturnedOrderCommand.Remarks, |
44 | RegionName: createDividendsReturnedOrderCommand.RegionName, | 42 | RegionName: createDividendsReturnedOrderCommand.RegionName, |
@@ -96,8 +94,6 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide | @@ -96,8 +94,6 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide | ||
96 | // 更新分红退货单服务 | 94 | // 更新分红退货单服务 |
97 | func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand *command.UpdateDividendsReturnedOrderCommand) (interface{}, error) { | 95 | func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand *command.UpdateDividendsReturnedOrderCommand) (interface{}, error) { |
98 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsReturnedOrderCommand.Operator) | 96 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsReturnedOrderCommand.Operator) |
99 | - dividendsReturnedDate := time.Unix(updateDividendsReturnedOrderCommand.DividendsReturnedDate/1e3, 0) | ||
100 | - orderDate := time.Unix(updateDividendsReturnedOrderCommand.OrderTime/1e3, 0) | ||
101 | var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood | 97 | var orderGooods []allied_creation_cooperation.ReqDividendsReturnedOrderGood |
102 | for _, v := range updateDividendsReturnedOrderCommand.OrderGoods { | 98 | for _, v := range updateDividendsReturnedOrderCommand.OrderGoods { |
103 | good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{ | 99 | good := allied_creation_cooperation.ReqDividendsReturnedOrderGood{ |
@@ -116,8 +112,8 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide | @@ -116,8 +112,8 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide | ||
116 | DividendsOrderNumber: updateDividendsReturnedOrderCommand.DividendsOrderNumber, | 112 | DividendsOrderNumber: updateDividendsReturnedOrderCommand.DividendsOrderNumber, |
117 | OriginalOrderNum: updateDividendsReturnedOrderCommand.OriginalOrderNum, | 113 | OriginalOrderNum: updateDividendsReturnedOrderCommand.OriginalOrderNum, |
118 | OrderGoods: orderGooods, | 114 | OrderGoods: orderGooods, |
119 | - DividendsReturnedDate: dividendsReturnedDate, | ||
120 | - OrderTime: orderDate, | 115 | + DividendsReturnedDate: updateDividendsReturnedOrderCommand.DividendsReturnedDate, |
116 | + OrderTime: updateDividendsReturnedOrderCommand.OrderTime, | ||
121 | OrgId: int(updateDividendsReturnedOrderCommand.Operator.OrgId), | 117 | OrgId: int(updateDividendsReturnedOrderCommand.Operator.OrgId), |
122 | Remarks: updateDividendsReturnedOrderCommand.Remarks, | 118 | Remarks: updateDividendsReturnedOrderCommand.Remarks, |
123 | RegionName: updateDividendsReturnedOrderCommand.RegionName, | 119 | RegionName: updateDividendsReturnedOrderCommand.RegionName, |
@@ -24,25 +24,28 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin | @@ -24,25 +24,28 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin | ||
24 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( | 24 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
25 | noticeSettingListQuery.Operator, | 25 | noticeSettingListQuery.Operator, |
26 | ) | 26 | ) |
27 | - orgResult, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{ | ||
28 | - Offset: 1, | ||
29 | - Limit: 20, | ||
30 | - CompanyId: int(noticeSettingListQuery.Operator.CompanyId), | ||
31 | - IsOrg: 1, | ||
32 | - DepName: noticeSettingListQuery.OrgName, | ||
33 | - }) | ||
34 | - if err != nil { | 27 | + var orgIds []int |
28 | + if len(noticeSettingListQuery.OrgName) > 0 { | ||
29 | + orgResult, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{ | ||
30 | + Offset: 1, | ||
31 | + Limit: 20, | ||
32 | + CompanyId: int(noticeSettingListQuery.Operator.CompanyId), | ||
33 | + IsOrg: 1, | ||
34 | + DepName: noticeSettingListQuery.OrgName, | ||
35 | + }) | ||
35 | if err != nil { | 36 | if err != nil { |
36 | - return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 37 | + if err != nil { |
38 | + return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
39 | + } | ||
40 | + } | ||
41 | + if len(orgResult.Orgs) == 0 { | ||
42 | + return 0, []dto.NoticeSettingItem{}, nil | ||
43 | + } | ||
44 | + for _, v := range orgResult.Orgs { | ||
45 | + orgIds = append(orgIds, v.OrgID) | ||
37 | } | 46 | } |
38 | } | 47 | } |
39 | - if len(orgResult.Orgs) == 0 { | ||
40 | - return 0, []dto.NoticeSettingItem{}, nil | ||
41 | - } | ||
42 | - var orgIds []int | ||
43 | - for _, v := range orgResult.Orgs { | ||
44 | - orgIds = append(orgIds, v.OrgID) | ||
45 | - } | 48 | + |
46 | result, err := creationBasicGateway.NoticeSettingSearch(allied_creation_basic.ReqNoticeSettingSearch{ | 49 | result, err := creationBasicGateway.NoticeSettingSearch(allied_creation_basic.ReqNoticeSettingSearch{ |
47 | PageIndex: noticeSettingListQuery.PageNumber, | 50 | PageIndex: noticeSettingListQuery.PageNumber, |
48 | PageSize: noticeSettingListQuery.PageSize, | 51 | PageSize: noticeSettingListQuery.PageSize, |
@@ -206,8 +206,9 @@ func (gateway HttplibAlliedCreationCooperation) DividendsOrderGet(param ReqDivid | @@ -206,8 +206,9 @@ func (gateway HttplibAlliedCreationCooperation) DividendsOrderGet(param ReqDivid | ||
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 | } | 208 | } |
209 | + fmt.Printf("=========>param %+v", param) | ||
209 | log.Logger.Debug("向业务模块请求数据:返回分红订单详情。", map[string]interface{}{ | 210 | log.Logger.Debug("向业务模块请求数据:返回分红订单详情。", map[string]interface{}{ |
210 | - "api": method + ":" + url, | 211 | + "api": method + ":" + req.GetRequest().URL.String(), |
211 | "param": param, | 212 | "param": param, |
212 | }) | 213 | }) |
213 | req, err := req.JSONBody(param) | 214 | req, err := req.JSONBody(param) |
@@ -227,7 +227,7 @@ type ( | @@ -227,7 +227,7 @@ type ( | ||
227 | DividendsEstimateIds []string `json:"dividendsEstimateIds"` | 227 | DividendsEstimateIds []string `json:"dividendsEstimateIds"` |
228 | } | 228 | } |
229 | 229 | ||
230 | - DataDividendsEstimateBatchCancel struct { | 230 | + DataDividendsEstimateBatchCancel []struct { |
231 | } | 231 | } |
232 | ) | 232 | ) |
233 | 233 |
@@ -61,8 +61,8 @@ type ( | @@ -61,8 +61,8 @@ type ( | ||
61 | DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号 | 61 | DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号 |
62 | OriginalOrderNum string `json:"originalOrderNum"` | 62 | OriginalOrderNum string `json:"originalOrderNum"` |
63 | OrderGoods []ReqDividendsReturnedOrderGood `json:"orderGoods"` | 63 | OrderGoods []ReqDividendsReturnedOrderGood `json:"orderGoods"` |
64 | - DividendsReturnedDate time.Time `json:"dividendsReturnedDate"` | ||
65 | - OrderTime time.Time `json:"orderTime"` | 64 | + DividendsReturnedDate int64 `json:"dividendsReturnedDate,string"` |
65 | + OrderTime int64 `json:"orderTime,string"` | ||
66 | OrgId int `json:"orgId"` | 66 | OrgId int `json:"orgId"` |
67 | Remarks string `json:"remarks"` | 67 | Remarks string `json:"remarks"` |
68 | RegionName string `json:"regionName"` | 68 | RegionName string `json:"regionName"` |
@@ -81,8 +81,8 @@ type ( | @@ -81,8 +81,8 @@ type ( | ||
81 | DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号 | 81 | DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号 |
82 | OriginalOrderNum string `json:"originalOrderNum"` | 82 | OriginalOrderNum string `json:"originalOrderNum"` |
83 | OrderGoods []ReqDividendsReturnedOrderGood `json:"orderGoods"` | 83 | OrderGoods []ReqDividendsReturnedOrderGood `json:"orderGoods"` |
84 | - DividendsReturnedDate time.Time `json:"dividendsReturnedDate"` | ||
85 | - OrderTime time.Time `json:"orderTime"` | 84 | + DividendsReturnedDate int64 `json:"dividendsReturnedDate,string"` |
85 | + OrderTime int64 `json:"orderTime,string"` | ||
86 | OrgId int `json:"orgId"` | 86 | OrgId int `json:"orgId"` |
87 | Remarks string `json:"remarks"` | 87 | Remarks string `json:"remarks"` |
88 | RegionName string `json:"regionName"` | 88 | RegionName string `json:"regionName"` |
@@ -2,6 +2,9 @@ package controllers | @@ -2,6 +2,9 @@ package controllers | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | + "io" | ||
6 | + "path/filepath" | ||
7 | + | ||
5 | "github.com/linmadan/egglib-go/core/application" | 8 | "github.com/linmadan/egglib-go/core/application" |
6 | "github.com/linmadan/egglib-go/utils/json" | 9 | "github.com/linmadan/egglib-go/utils/json" |
7 | "github.com/linmadan/egglib-go/web/beego" | 10 | "github.com/linmadan/egglib-go/web/beego" |
@@ -9,8 +12,6 @@ import ( | @@ -9,8 +12,6 @@ import ( | ||
9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | 12 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" |
10 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" | 13 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" |
11 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/middleware" | 14 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/middleware" |
12 | - "io" | ||
13 | - "path/filepath" | ||
14 | ) | 15 | ) |
15 | 16 | ||
16 | type BaseController struct { | 17 | type BaseController struct { |
@@ -59,21 +60,21 @@ func (controller *BaseController) Response(data interface{}, err error) { | @@ -59,21 +60,21 @@ func (controller *BaseController) Response(data interface{}, err error) { | ||
59 | controller.ServeJSON() | 60 | controller.ServeJSON() |
60 | } | 61 | } |
61 | 62 | ||
62 | -func (controller *BaseController) GetUserId() int64 { | ||
63 | - return 1 | ||
64 | -} | 63 | +// func (controller *BaseController) GetUserId() int64 { |
64 | +// return 1 | ||
65 | +// } | ||
65 | 66 | ||
66 | -func (controller *BaseController) GetCompanyId() int64 { | ||
67 | - return 1 | ||
68 | -} | 67 | +// func (controller *BaseController) GetCompanyId() int64 { |
68 | +// return 1 | ||
69 | +// } | ||
69 | 70 | ||
70 | -func (controller *BaseController) GetUserBaseId() int64 { | ||
71 | - return 1 | ||
72 | -} | 71 | +// func (controller *BaseController) GetUserBaseId() int64 { |
72 | +// return 1 | ||
73 | +// } | ||
73 | 74 | ||
74 | -func (controller *BaseController) GetOrgId() int64 { | ||
75 | - return 1 | ||
76 | -} | 75 | +// func (controller *BaseController) GetOrgId() int64 { |
76 | +// return 1 | ||
77 | +// } | ||
77 | 78 | ||
78 | func (controller *BaseController) GetOperator() domain.Operator { | 79 | func (controller *BaseController) GetOperator() domain.Operator { |
79 | token := controller.Ctx.Input.Header("X-Mmm-Accesstoken") | 80 | token := controller.Ctx.Input.Header("X-Mmm-Accesstoken") |
-
请 注册 或 登录 后发表评论