Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway into dev
正在显示
6 个修改的文件
包含
32 行增加
和
29 行删除
@@ -29,12 +29,12 @@ type CreditAccountItem struct { | @@ -29,12 +29,12 @@ type CreditAccountItem struct { | ||
29 | //Email string `json:"email,omitempty"` | 29 | //Email string `json:"email,omitempty"` |
30 | } `json:"userInfo"` | 30 | } `json:"userInfo"` |
31 | } `json:"participator"` // 参与人 | 31 | } `json:"participator"` // 参与人 |
32 | - ParticipateType string `json:"participateType"` // 参与类型 | ||
33 | - PaymentDocumentAttachment domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件 | ||
34 | - Org domain.Org `json:"org"` // 数据所属组织机构 | ||
35 | - Company domain.CompanyData `json:"company"` // 公司 | ||
36 | - CreatedAt int64 `json:"createdAt"` // 创建时间 | ||
37 | - UpdatedAt int64 `json:"updatedAt"` // 更新时间 | 32 | + ParticipateType string `json:"participateType"` // 参与类型 |
33 | + PaymentDocumentAttachment []domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件,复数 | ||
34 | + Org domain.Org `json:"org"` // 数据所属组织机构 | ||
35 | + Company domain.CompanyData `json:"company"` // 公司 | ||
36 | + CreatedAt int64 `json:"createdAt"` // 创建时间 | ||
37 | + UpdatedAt int64 `json:"updatedAt"` // 更新时间 | ||
38 | AccountDetail []struct { | 38 | AccountDetail []struct { |
39 | DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` | 39 | DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` |
40 | DividendsType int `json:"dividendsType"` | 40 | DividendsType int `json:"dividendsType"` |
@@ -54,8 +54,8 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred | @@ -54,8 +54,8 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred | ||
54 | SettlementAmount: param.SettlementAmount, | 54 | SettlementAmount: param.SettlementAmount, |
55 | SettlementTime: param.SettlementTime.Unix() * 1000, | 55 | SettlementTime: param.SettlementTime.Unix() * 1000, |
56 | CooperationContractNumber: param.CooperationContractNumber, | 56 | CooperationContractNumber: param.CooperationContractNumber, |
57 | - ParticipateType: param.ParticipateType, // 参与类型 | ||
58 | - PaymentDocumentAttachment: param.PaymentDocumentAttachment, // 支付凭证附件 | 57 | + ParticipateType: param.ParticipateType, // 参与类型 |
58 | + PaymentDocumentAttachment: param.PaymentDocumentAttachments, // 支付凭证附件 | ||
59 | Org: domain.Org{ | 59 | Org: domain.Org{ |
60 | OrgID: param.Org.OrgID, | 60 | OrgID: param.Org.OrgID, |
61 | OrgName: param.Org.OrgName, | 61 | OrgName: param.Org.OrgName, |
1 | package service | 1 | package service |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "time" | ||
5 | + | ||
4 | "github.com/linmadan/egglib-go/core/application" | 6 | "github.com/linmadan/egglib-go/core/application" |
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" | 7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" |
6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto" | 8 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto" |
7 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" | 9 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" |
8 | - "time" | ||
9 | ) | 10 | ) |
10 | 11 | ||
11 | // CompanyCreditAccountService 企业端账期结算 | 12 | // CompanyCreditAccountService 企业端账期结算 |
@@ -67,10 +68,10 @@ func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccou | @@ -67,10 +68,10 @@ func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccou | ||
67 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( | 68 | gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( |
68 | cmd.Operator) | 69 | cmd.Operator) |
69 | resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{ | 70 | resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{ |
70 | - CreditAccountId: cmd.CreditAccountId, | ||
71 | - ActuallyPaidAmount: cmd.ActuallyPaidAmount, | ||
72 | - Remarks: cmd.Remarks, | ||
73 | - Attachment: cmd.Attachment, | 71 | + CreditAccountId: cmd.CreditAccountId, |
72 | + ActuallyPaidAmount: cmd.ActuallyPaidAmount, | ||
73 | + Remarks: cmd.Remarks, | ||
74 | + PaymentDocumentAttachment: cmd.Attachment, | ||
74 | }) | 75 | }) |
75 | if err != nil { | 76 | if err != nil { |
76 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 77 | return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) |
@@ -145,6 +145,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | @@ -145,6 +145,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | ||
145 | DividendsIncentivesStage: v.DividendsStage, | 145 | DividendsIncentivesStage: v.DividendsStage, |
146 | DividendsIncentivesStageEnd: time.Unix(int64(v.DividendsStageEnd/1e3), 0), | 146 | DividendsIncentivesStageEnd: time.Unix(int64(v.DividendsStageEnd/1e3), 0), |
147 | DividendsIncentivesStageStart: time.Unix(int64(v.DividendsStageStart/1e3), 0), | 147 | DividendsIncentivesStageStart: time.Unix(int64(v.DividendsStageStart/1e3), 0), |
148 | + Remarks: v.Remarks, | ||
148 | } | 149 | } |
149 | rules1 = append(rules1, r) | 150 | rules1 = append(rules1, r) |
150 | } | 151 | } |
@@ -158,6 +159,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | @@ -158,6 +159,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | ||
158 | MoneyIncentivesTime: time.Unix(int64(v.MoneyIncentivesTime/1e3), 0), | 159 | MoneyIncentivesTime: time.Unix(int64(v.MoneyIncentivesTime/1e3), 0), |
159 | ReferrerPercentage: v.ReferrerPercentage, | 160 | ReferrerPercentage: v.ReferrerPercentage, |
160 | SalesmanPercentage: v.SalesmanPercentage, | 161 | SalesmanPercentage: v.SalesmanPercentage, |
162 | + Remarks: v.Remarks, | ||
161 | } | 163 | } |
162 | rules2 = append(rules2, r) | 164 | rules2 = append(rules2, r) |
163 | } | 165 | } |
@@ -20,8 +20,8 @@ type CreditAccountItem struct { | @@ -20,8 +20,8 @@ type CreditAccountItem struct { | ||
20 | UserPhone string `json:"userPhone"` // 用户手机号 | 20 | UserPhone string `json:"userPhone"` // 用户手机号 |
21 | UserType int `json:"userType"` // 用户类型,1员工,2共创用户,3公开 | 21 | UserType int `json:"userType"` // 用户类型,1员工,2共创用户,3公开 |
22 | } `json:"participator"` // 参与人 | 22 | } `json:"participator"` // 参与人 |
23 | - ParticipateType string `json:"participateType"` // 参与类型 | ||
24 | - PaymentDocumentAttachment *domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件 | 23 | + ParticipateType string `json:"participateType"` // 参与类型 |
24 | + PaymentDocumentAttachment []domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件 | ||
25 | Org struct { | 25 | Org struct { |
26 | OrgID int `json:"orgId,string"` | 26 | OrgID int `json:"orgId,string"` |
27 | OrgName string `json:"orgName"` | 27 | OrgName string `json:"orgName"` |
@@ -59,7 +59,7 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount, opera | @@ -59,7 +59,7 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount, opera | ||
59 | SettlementTime: 0, | 59 | SettlementTime: 0, |
60 | CooperationContractNumber: param.CooperationContractNumber, | 60 | CooperationContractNumber: param.CooperationContractNumber, |
61 | ParticipateType: param.ParticipateType, // 参与类型 | 61 | ParticipateType: param.ParticipateType, // 参与类型 |
62 | - PaymentDocumentAttachment: nil, // 支付凭证附件 | 62 | + PaymentDocumentAttachment: []domain.Attachment{}, // 支付凭证附件 |
63 | Company: param.Company, // 公司 | 63 | Company: param.Company, // 公司 |
64 | CreatedAt: param.CreatedAt.UnixNano() / 1e6, // 创建时间 | 64 | CreatedAt: param.CreatedAt.UnixNano() / 1e6, // 创建时间 |
65 | UpdatedAt: param.UpdatedAt.UnixNano() / 1e6, // 更新时间 | 65 | UpdatedAt: param.UpdatedAt.UnixNano() / 1e6, // 更新时间 |
@@ -73,8 +73,8 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount, opera | @@ -73,8 +73,8 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount, opera | ||
73 | if !param.SettlementTime.IsZero() { | 73 | if !param.SettlementTime.IsZero() { |
74 | data.SettlementTime = param.SettlementTime.Unix() * 1e3 | 74 | data.SettlementTime = param.SettlementTime.Unix() * 1e3 |
75 | } | 75 | } |
76 | - if len(param.PaymentDocumentAttachment.Url) > 0 { | ||
77 | - data.PaymentDocumentAttachment = ¶m.PaymentDocumentAttachment | 76 | + if len(param.PaymentDocumentAttachments) > 0 { |
77 | + data.PaymentDocumentAttachment = param.PaymentDocumentAttachments | ||
78 | } | 78 | } |
79 | data.Org.OrgID = param.Org.OrgID | 79 | data.Org.OrgID = param.Org.OrgID |
80 | data.Org.OrgName = param.Org.OrgName | 80 | data.Org.OrgName = param.Org.OrgName |
@@ -51,10 +51,10 @@ func (srv *CreditAccountService) GetCreditAccount(getQuery *query.GetCreditAccou | @@ -51,10 +51,10 @@ func (srv *CreditAccountService) GetCreditAccount(getQuery *query.GetCreditAccou | ||
51 | func (srv *CreditAccountService) PayCreditAccount(payCommand *command.PayCreditAccountCommand) (interface{}, error) { | 51 | func (srv *CreditAccountService) PayCreditAccount(payCommand *command.PayCreditAccountCommand) (interface{}, error) { |
52 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(payCommand.Operator) | 52 | creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(payCommand.Operator) |
53 | _, err := creationCooperationGateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{ | 53 | _, err := creationCooperationGateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{ |
54 | - CreditAccountId: payCommand.CreditAccountId, | ||
55 | - ActuallyPaidAmount: payCommand.ActuallyPaidAmount, | ||
56 | - Remarks: payCommand.Remarks, | ||
57 | - Attachment: payCommand.Attachment, | 54 | + CreditAccountId: payCommand.CreditAccountId, |
55 | + ActuallyPaidAmount: payCommand.ActuallyPaidAmount, | ||
56 | + Remarks: payCommand.Remarks, | ||
57 | + PaymentDocumentAttachment: payCommand.Attachment, | ||
58 | }) | 58 | }) |
59 | if err != nil { | 59 | if err != nil { |
60 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 60 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
@@ -32,9 +32,9 @@ type CreditAccount struct { | @@ -32,9 +32,9 @@ type CreditAccount struct { | ||
32 | UserPhone string `json:"userPhone"` // 用户手机号 | 32 | UserPhone string `json:"userPhone"` // 用户手机号 |
33 | UserInfo domain.UserInfo `json:"userInfo"` // | 33 | UserInfo domain.UserInfo `json:"userInfo"` // |
34 | } `json:"operator"` | 34 | } `json:"operator"` |
35 | - ParticipateType string `json:"participateType"` // 参与类型 | ||
36 | - PaymentDocumentAttachment domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件 | ||
37 | - Org struct { | 35 | + ParticipateType string `json:"participateType"` // 参与类型 |
36 | + PaymentDocumentAttachments []domain.Attachment `json:"paymentDocumentAttachments"` // 支付凭证附件 | ||
37 | + Org struct { | ||
38 | OrgID int `json:"orgId,string"` | 38 | OrgID int `json:"orgId,string"` |
39 | OrgName string `json:"orgName"` | 39 | OrgName string `json:"orgName"` |
40 | } `json:"org"` // 数据所属组织机构 | 40 | } `json:"org"` // 数据所属组织机构 |
@@ -53,10 +53,10 @@ type CreditAccount struct { | @@ -53,10 +53,10 @@ type CreditAccount struct { | ||
53 | //支付账期结算 | 53 | //支付账期结算 |
54 | type ( | 54 | type ( |
55 | ReqCreditAccountsPay struct { | 55 | ReqCreditAccountsPay struct { |
56 | - CreditAccountId int `json:"creditAccountId,string"` | ||
57 | - ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` //实际支付金额 | ||
58 | - Remarks string `json:"remarks"` | ||
59 | - Attachment []domain.Attachment `json:"paymentDocumentAttachment"` //附件 | 56 | + CreditAccountId int `json:"creditAccountId,string"` |
57 | + ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` //实际支付金额 | ||
58 | + Remarks string `json:"remarks"` | ||
59 | + PaymentDocumentAttachment []domain.Attachment `json:"paymentDocumentAttachment"` //附件 | ||
60 | } | 60 | } |
61 | 61 | ||
62 | DataCreditAccountsPay struct { | 62 | DataCreditAccountsPay struct { |
-
请 注册 或 登录 后发表评论