作者 yangfu
@@ -93,7 +93,8 @@ type DividendsEstimateItem struct { @@ -93,7 +93,8 @@ type DividendsEstimateItem struct {
93 DividendsType int `json:"dividendsType"` // 分红类型,1订单分红,2退货冲销,3金额激励 93 DividendsType int `json:"dividendsType"` // 分红类型,1订单分红,2退货冲销,3金额激励
94 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` // 分红订单号或退货单号 94 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` // 分红订单号或退货单号
95 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号, 95 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号,
96 - DividendsIncentivesStage int `json:"DividendsIncentivesStage"` //分红阶段 96 + CooperationContractNumber string `json:"cooperationContractNumber"` // 共创项目合约编号,
  97 + DividendsIncentivesStage int `json:"dividendsIncentivesStage"` //分红阶段
97 IsCanceled bool `json:"isCanceled"` // 取消状态 98 IsCanceled bool `json:"isCanceled"` // 取消状态
98 DividendsUser struct { 99 DividendsUser struct {
99 UsersId int `json:"usersId,string,"` // 用户ID, 100 UsersId int `json:"usersId,string,"` // 用户ID,
@@ -93,6 +93,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat @@ -93,6 +93,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat
93 DividendsType: v.DividendsType, 93 DividendsType: v.DividendsType,
94 OrderOrReturnedOrderNum: v.OrderOrReturnedOrderNum, 94 OrderOrReturnedOrderNum: v.OrderOrReturnedOrderNum,
95 CooperationProjectNumber: v.CooperationProjectNumber, 95 CooperationProjectNumber: v.CooperationProjectNumber,
  96 + CooperationContractNumber: v.CooperationContractNumber,
96 DividendsIncentivesStage: v.DividendsIncentivesStage, 97 DividendsIncentivesStage: v.DividendsIncentivesStage,
97 IsCanceled: v.IsCanceled, 98 IsCanceled: v.IsCanceled,
98 } 99 }
@@ -6,6 +6,6 @@ import ( @@ -6,6 +6,6 @@ import (
6 6
7 type RemoveDividendsReturnedOrderCommand struct { 7 type RemoveDividendsReturnedOrderCommand struct {
8 //操作人 8 //操作人
9 - Operator domain.Operator `json:"-"`  
10 - DividendsReturnedOrderID []string `json:"dividendsReturnedOrderId"` //分红退货单记录id 9 + Operator domain.Operator `json:"-"`
  10 + ReturnedOrderId []string `json:"returnedOrderId"` //分红退货单记录id
11 } 11 }
@@ -17,6 +17,7 @@ type DividendsReturnedOrderInfo struct { @@ -17,6 +17,7 @@ type DividendsReturnedOrderInfo struct {
17 DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号 17 DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
18 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名 18 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名
19 DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期 19 DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
  20 + OrderTime int64 `json:"orderTime"` //订单时间
20 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id 21 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id
21 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号 22 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号
22 DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额 23 DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额
@@ -36,8 +37,12 @@ type DividendsReturnedOrderInfo struct { @@ -36,8 +37,12 @@ type DividendsReturnedOrderInfo struct {
36 } 37 }
37 38
38 func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsReturnedOrder) *DividendsReturnedOrderInfo { 39 func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsReturnedOrder) *DividendsReturnedOrderInfo {
  40 + goods := param.Goods
  41 + if len(param.Goods) == 0 {
  42 + goods = []allied_creation_cooperation.DividendsReturnedOrderGoods{}
  43 + }
39 data := DividendsReturnedOrderInfo{ 44 data := DividendsReturnedOrderInfo{
40 - Goods: param.Goods, 45 + Goods: goods,
41 Org: param.Org, 46 Org: param.Org,
42 Region: param.Region, 47 Region: param.Region,
43 Company: param.Company, 48 Company: param.Company,
@@ -47,6 +52,7 @@ func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsRe @@ -47,6 +52,7 @@ func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsRe
47 DividendsOrderNumber: param.DividendsOrderNumber, 52 DividendsOrderNumber: param.DividendsOrderNumber,
48 DividendsReturnedCustomerName: param.DividendsReturnedCustomerName, 53 DividendsReturnedCustomerName: param.DividendsReturnedCustomerName,
49 DividendsReturnedDate: param.DividendsReturnedDate.UnixNano() / 1e6, 54 DividendsReturnedDate: param.DividendsReturnedDate.UnixNano() / 1e6,
  55 + OrderTime: param.OrderTime.UnixNano() / 1e6,
50 DividendsReturnedOrderID: param.DividendsReturnedOrderID, 56 DividendsReturnedOrderID: param.DividendsReturnedOrderID,
51 DividendsReturnedOrderNumber: param.DividendsReturnedOrderNumber, 57 DividendsReturnedOrderNumber: param.DividendsReturnedOrderNumber,
52 DividendsReturnedOrderRefund: param.DividendsReturnedOrderRefund, 58 DividendsReturnedOrderRefund: param.DividendsReturnedOrderRefund,
@@ -65,7 +65,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends @@ -65,7 +65,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends
65 func (dividendsReturnedOrderService *DividendsReturnedOrderService) RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand *command.RemoveDividendsReturnedOrderCommand) (interface{}, error) { 65 func (dividendsReturnedOrderService *DividendsReturnedOrderService) RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand *command.RemoveDividendsReturnedOrderCommand) (interface{}, error) {
66 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsReturnedOrderCommand.Operator) 66 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsReturnedOrderCommand.Operator)
67 _, err := creationCooperationGateway.DividendsReturnedOrderBatchRemove(allied_creation_cooperation.ReqDividendsReturnedOrderBatchRemove{ 67 _, err := creationCooperationGateway.DividendsReturnedOrderBatchRemove(allied_creation_cooperation.ReqDividendsReturnedOrderBatchRemove{
68 - DividendsReturnedOrderIDs: removeDividendsReturnedOrderCommand.DividendsReturnedOrderID, 68 + DividendsReturnedOrderIDs: removeDividendsReturnedOrderCommand.ReturnedOrderId,
69 }) 69 })
70 if err != nil { 70 if err != nil {
71 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 71 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
1 package command 1 package command
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
@@ -27,20 +24,20 @@ type CooperationUserAddCommand struct { @@ -27,20 +24,20 @@ type CooperationUserAddCommand struct {
27 Phone string `json:"phone" valid:"Required"` 24 Phone string `json:"phone" valid:"Required"`
28 } 25 }
29 26
30 -func (cooperationUserAddCommand *CooperationUserAddCommand) Valid(validation *validation.Validation) { 27 +// func (cooperationUserAddCommand *CooperationUserAddCommand) Valid(validation *validation.Validation) {
31 28
32 -} 29 +// }
33 30
34 -func (cooperationUserAddCommand *CooperationUserAddCommand) ValidateCommand() error {  
35 - valid := validation.Validation{}  
36 - b, err := valid.Valid(cooperationUserAddCommand)  
37 - if err != nil {  
38 - return err  
39 - }  
40 - if !b {  
41 - for _, validErr := range valid.Errors {  
42 - return fmt.Errorf("%s %s", validErr.Key, validErr.Message)  
43 - }  
44 - }  
45 - return nil  
46 -} 31 +// func (cooperationUserAddCommand *CooperationUserAddCommand) ValidateCommand() error {
  32 +// valid := validation.Validation{}
  33 +// b, err := valid.Valid(cooperationUserAddCommand)
  34 +// if err != nil {
  35 +// return err
  36 +// }
  37 +// if !b {
  38 +// for _, validErr := range valid.Errors {
  39 +// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  40 +// }
  41 +// }
  42 +// return nil
  43 +// }
1 package command 1 package command
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
@@ -16,20 +13,20 @@ type CooperationUserEnableCommand struct { @@ -16,20 +13,20 @@ type CooperationUserEnableCommand struct {
16 EnableStatus int `json:"enableStatus,omitempty"` 13 EnableStatus int `json:"enableStatus,omitempty"`
17 } 14 }
18 15
19 -func (cooperationUserEnableCommand *CooperationUserEnableCommand) Valid(validation *validation.Validation) { 16 +// func (cooperationUserEnableCommand *CooperationUserEnableCommand) Valid(validation *validation.Validation) {
20 17
21 -} 18 +// }
22 19
23 -func (cooperationUserEnableCommand *CooperationUserEnableCommand) ValidateCommand() error {  
24 - valid := validation.Validation{}  
25 - b, err := valid.Valid(cooperationUserEnableCommand)  
26 - if err != nil {  
27 - return err  
28 - }  
29 - if !b {  
30 - for _, validErr := range valid.Errors {  
31 - return fmt.Errorf("%s %s", validErr.Key, validErr.Message)  
32 - }  
33 - }  
34 - return nil  
35 -} 20 +// func (cooperationUserEnableCommand *CooperationUserEnableCommand) ValidateCommand() error {
  21 +// valid := validation.Validation{}
  22 +// b, err := valid.Valid(cooperationUserEnableCommand)
  23 +// if err != nil {
  24 +// return err
  25 +// }
  26 +// if !b {
  27 +// for _, validErr := range valid.Errors {
  28 +// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  29 +// }
  30 +// }
  31 +// return nil
  32 +// }
@@ -3,11 +3,12 @@ package service @@ -3,11 +3,12 @@ package service
3 import ( 3 import (
4 "crypto/sha1" 4 "crypto/sha1"
5 "fmt" 5 "fmt"
6 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"  
7 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"  
8 "strconv" 6 "strconv"
9 "time" 7 "time"
10 8
  9 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
  11 +
11 "github.com/linmadan/egglib-go/core/application" 12 "github.com/linmadan/egglib-go/core/application"
12 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/command" 13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/command"
13 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/dto" 14 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/dto"
@@ -286,10 +287,15 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand * @@ -286,10 +287,15 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *
286 if err != nil { 287 if err != nil {
287 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 288 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
288 } 289 }
  290 + cooperationDeadline := time.Time{}
  291 + if cooperationUserAddCommand.CooperationDeadline > 0 {
  292 + cooperationDeadline = time.Unix(cooperationUserAddCommand.CooperationDeadline/1e3, 0)
  293 + }
  294 +
289 result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{ 295 result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{
290 CompanyId: cooperationUserAddCommand.Operator.CompanyId, 296 CompanyId: cooperationUserAddCommand.Operator.CompanyId,
291 CooperationCompany: cooperationUserAddCommand.CooperationCompany, 297 CooperationCompany: cooperationUserAddCommand.CooperationCompany,
292 - CooperationDeadline: time.Unix(cooperationUserAddCommand.CooperationDeadline/1000, 0), 298 + CooperationDeadline: cooperationDeadline,
293 Email: cooperationUserAddCommand.Email, 299 Email: cooperationUserAddCommand.Email,
294 EnableStatus: cooperationUserAddCommand.EnableStatus, 300 EnableStatus: cooperationUserAddCommand.EnableStatus,
295 UserCode: cooperationUserAddCommand.UsersCode, 301 UserCode: cooperationUserAddCommand.UsersCode,
@@ -342,7 +348,10 @@ func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *qu @@ -342,7 +348,10 @@ func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *qu
342 if err != nil { 348 if err != nil {
343 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 349 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
344 } 350 }
345 - deadline := result.CooperationInfo.CooperationDeadline.Unix() 351 + var deadline int64
  352 + if !result.CooperationInfo.CooperationDeadline.IsZero() {
  353 + deadline = result.CooperationInfo.CooperationDeadline.Unix()
  354 + }
346 userInfo := dto.CooperationUserInfo{ 355 userInfo := dto.CooperationUserInfo{
347 UserId: strconv.Itoa(result.UserId), 356 UserId: strconv.Itoa(result.UserId),
348 UserCode: result.UserCode, 357 UserCode: result.UserCode,
@@ -382,7 +391,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * @@ -382,7 +391,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
382 item = dto.CooperationUserItem{ 391 item = dto.CooperationUserItem{
383 CooperationCompany: v.CooperationInfo.CooperationCompany, 392 CooperationCompany: v.CooperationInfo.CooperationCompany,
384 UserId: strconv.Itoa(v.UserId), 393 UserId: strconv.Itoa(v.UserId),
385 - CooperationDeadline: v.CooperationInfo.CooperationDeadline.Format("2006-01-02"), 394 + CooperationDeadline: "",
386 Phone: v.UserInfo.Phone, 395 Phone: v.UserInfo.Phone,
387 EnableStatus: v.EnableStatus, 396 EnableStatus: v.EnableStatus,
388 UserCode: v.UserCode, 397 UserCode: v.UserCode,
@@ -390,6 +399,10 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * @@ -390,6 +399,10 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
390 OrgName: v.Org.OrgName, 399 OrgName: v.Org.OrgName,
391 OrgId: strconv.Itoa(v.Org.OrgId), 400 OrgId: strconv.Itoa(v.Org.OrgId),
392 } 401 }
  402 + if !v.CooperationInfo.CooperationDeadline.IsZero() {
  403 + item.CooperationDeadline = v.CooperationInfo.CooperationDeadline.Format("2006-01-02")
  404 + }
  405 +
393 listData = append(listData, item) 406 listData = append(listData, item)
394 } 407 }
395 return cnt, listData, err 408 return cnt, listData, err
@@ -63,6 +63,7 @@ type ( @@ -63,6 +63,7 @@ type (
63 DividendsType int `json:"dividendsType"` // 分红类型,1订单分红,2退货冲销,3金额激励 63 DividendsType int `json:"dividendsType"` // 分红类型,1订单分红,2退货冲销,3金额激励
64 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` // 分红订单号或退货单号 64 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` // 分红订单号或退货单号
65 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号, 65 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号,
  66 + CooperationContractNumber string `json:"cooperationContractNumber"` // 共创项目合约编号,
66 DividendsIncentivesStage int `json:"DividendsIncentivesStage"` // 分红阶段 67 DividendsIncentivesStage int `json:"DividendsIncentivesStage"` // 分红阶段
67 IsCanceled bool `json:"isCanceled"` // 取消状态 68 IsCanceled bool `json:"isCanceled"` // 取消状态
68 DividendsUser struct { 69 DividendsUser struct {
@@ -26,6 +26,7 @@ type ( @@ -26,6 +26,7 @@ type (
26 DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号 26 DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
27 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名 27 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名
28 DividendsReturnedDate time.Time `json:"dividendsReturnedDate"` //退货日期 28 DividendsReturnedDate time.Time `json:"dividendsReturnedDate"` //退货日期
  29 + OrderTime time.Time `json:"orderTime"` // 订单日期
29 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id 30 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id
30 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号 31 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号
31 DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额 32 DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额
@@ -127,7 +128,7 @@ type ( @@ -127,7 +128,7 @@ type (
127 DividendsReturnedOrderIDs []string `json:"dividendsReturnedOrderIds"` //分红退货单记录id 128 DividendsReturnedOrderIDs []string `json:"dividendsReturnedOrderIds"` //分红退货单记录id
128 } 129 }
129 130
130 - DataDividendsReturnedOrderBatchRemove struct { 131 + DataDividendsReturnedOrderBatchRemove []struct {
131 } 132 }
132 ) 133 )
133 134