作者 yangfu
... ... @@ -29,12 +29,12 @@ type CreditAccountItem struct {
//Email string `json:"email,omitempty"`
} `json:"userInfo"`
} `json:"participator"` // 参与人
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachment domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件
Org domain.Org `json:"org"` // 数据所属组织机构
Company domain.CompanyData `json:"company"` // 公司
CreatedAt int64 `json:"createdAt"` // 创建时间
UpdatedAt int64 `json:"updatedAt"` // 更新时间
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachment []domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件,复数
Org domain.Org `json:"org"` // 数据所属组织机构
Company domain.CompanyData `json:"company"` // 公司
CreatedAt int64 `json:"createdAt"` // 创建时间
UpdatedAt int64 `json:"updatedAt"` // 更新时间
AccountDetail []struct {
DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
DividendsType int `json:"dividendsType"`
... ... @@ -54,8 +54,8 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred
SettlementAmount: param.SettlementAmount,
SettlementTime: param.SettlementTime.Unix() * 1000,
CooperationContractNumber: param.CooperationContractNumber,
ParticipateType: param.ParticipateType, // 参与类型
PaymentDocumentAttachment: param.PaymentDocumentAttachment, // 支付凭证附件
ParticipateType: param.ParticipateType, // 参与类型
PaymentDocumentAttachment: param.PaymentDocumentAttachments, // 支付凭证附件
Org: domain.Org{
OrgID: param.Org.OrgID,
OrgName: param.Org.OrgName,
... ...
package service
import (
"time"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
"time"
)
// CompanyCreditAccountService 企业端账期结算
... ... @@ -67,10 +68,10 @@ func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccou
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{
CreditAccountId: cmd.CreditAccountId,
ActuallyPaidAmount: cmd.ActuallyPaidAmount,
Remarks: cmd.Remarks,
Attachment: cmd.Attachment,
CreditAccountId: cmd.CreditAccountId,
ActuallyPaidAmount: cmd.ActuallyPaidAmount,
Remarks: cmd.Remarks,
PaymentDocumentAttachment: cmd.Attachment,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
... ...
... ... @@ -145,6 +145,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
DividendsIncentivesStage: v.DividendsStage,
DividendsIncentivesStageEnd: time.Unix(int64(v.DividendsStageEnd/1e3), 0),
DividendsIncentivesStageStart: time.Unix(int64(v.DividendsStageStart/1e3), 0),
Remarks: v.Remarks,
}
rules1 = append(rules1, r)
}
... ... @@ -158,6 +159,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
MoneyIncentivesTime: time.Unix(int64(v.MoneyIncentivesTime/1e3), 0),
ReferrerPercentage: v.ReferrerPercentage,
SalesmanPercentage: v.SalesmanPercentage,
Remarks: v.Remarks,
}
rules2 = append(rules2, r)
}
... ...
... ... @@ -20,8 +20,8 @@ type CreditAccountItem struct {
UserPhone string `json:"userPhone"` // 用户手机号
UserType int `json:"userType"` // 用户类型,1员工,2共创用户,3公开
} `json:"participator"` // 参与人
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachment *domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachment []domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件
Org struct {
OrgID int `json:"orgId,string"`
OrgName string `json:"orgName"`
... ... @@ -59,7 +59,7 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount, opera
SettlementTime: 0,
CooperationContractNumber: param.CooperationContractNumber,
ParticipateType: param.ParticipateType, // 参与类型
PaymentDocumentAttachment: nil, // 支付凭证附件
PaymentDocumentAttachment: []domain.Attachment{}, // 支付凭证附件
Company: param.Company, // 公司
CreatedAt: param.CreatedAt.UnixNano() / 1e6, // 创建时间
UpdatedAt: param.UpdatedAt.UnixNano() / 1e6, // 更新时间
... ... @@ -73,8 +73,8 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount, opera
if !param.SettlementTime.IsZero() {
data.SettlementTime = param.SettlementTime.Unix() * 1e3
}
if len(param.PaymentDocumentAttachment.Url) > 0 {
data.PaymentDocumentAttachment = &param.PaymentDocumentAttachment
if len(param.PaymentDocumentAttachments) > 0 {
data.PaymentDocumentAttachment = param.PaymentDocumentAttachments
}
data.Org.OrgID = param.Org.OrgID
data.Org.OrgName = param.Org.OrgName
... ...
... ... @@ -51,10 +51,10 @@ func (srv *CreditAccountService) GetCreditAccount(getQuery *query.GetCreditAccou
func (srv *CreditAccountService) PayCreditAccount(payCommand *command.PayCreditAccountCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(payCommand.Operator)
_, err := creationCooperationGateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{
CreditAccountId: payCommand.CreditAccountId,
ActuallyPaidAmount: payCommand.ActuallyPaidAmount,
Remarks: payCommand.Remarks,
Attachment: payCommand.Attachment,
CreditAccountId: payCommand.CreditAccountId,
ActuallyPaidAmount: payCommand.ActuallyPaidAmount,
Remarks: payCommand.Remarks,
PaymentDocumentAttachment: payCommand.Attachment,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -32,9 +32,9 @@ type CreditAccount struct {
UserPhone string `json:"userPhone"` // 用户手机号
UserInfo domain.UserInfo `json:"userInfo"` //
} `json:"operator"`
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachment domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件
Org struct {
ParticipateType string `json:"participateType"` // 参与类型
PaymentDocumentAttachments []domain.Attachment `json:"paymentDocumentAttachments"` // 支付凭证附件
Org struct {
OrgID int `json:"orgId,string"`
OrgName string `json:"orgName"`
} `json:"org"` // 数据所属组织机构
... ... @@ -53,10 +53,10 @@ type CreditAccount struct {
//支付账期结算
type (
ReqCreditAccountsPay struct {
CreditAccountId int `json:"creditAccountId,string"`
ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` //实际支付金额
Remarks string `json:"remarks"`
Attachment []domain.Attachment `json:"paymentDocumentAttachment"` //附件
CreditAccountId int `json:"creditAccountId,string"`
ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` //实际支付金额
Remarks string `json:"remarks"`
PaymentDocumentAttachment []domain.Attachment `json:"paymentDocumentAttachment"` //附件
}
DataCreditAccountsPay struct {
... ...