...
|
...
|
@@ -23,14 +23,15 @@ func (subscriber *MessageServiceSubscriber) HandleEvent(domainEvent coreDomain.D |
|
|
switch domainEvent.EventType() {
|
|
|
case event.COOPERATION_APPLICATION_AGREED: // 共创申请审核通过
|
|
|
cooperationApplicationAgreedEvent := domainEvent.(*event.CooperationApplicationAgreed)
|
|
|
for _, agreedData := range cooperationApplicationAgreedEvent.CooperationApplicationAgreedData {
|
|
|
data, err1 := messageServiceGateway.AgreeCooperationApplication(
|
|
|
cooperationApplicationAgreedEvent.CreationProjectId,
|
|
|
cooperationApplicationAgreedEvent.CreationProjectName,
|
|
|
cooperationApplicationAgreedEvent.CreationProjectNumber,
|
|
|
cooperationApplicationAgreedEvent.UserId,
|
|
|
cooperationApplicationAgreedEvent.UserBaseId,
|
|
|
cooperationApplicationAgreedEvent.OrgId,
|
|
|
cooperationApplicationAgreedEvent.CompanyId,
|
|
|
agreedData.CreationProjectId,
|
|
|
agreedData.CreationProjectName,
|
|
|
agreedData.CreationProjectNumber,
|
|
|
agreedData.UserId,
|
|
|
agreedData.UserBaseId,
|
|
|
agreedData.OrgId,
|
|
|
agreedData.CompanyId,
|
|
|
)
|
|
|
if err1 != nil {
|
|
|
log.Logger.Error("推送消息错误", map[string]interface{}{
|
...
|
...
|
@@ -40,19 +41,22 @@ func (subscriber *MessageServiceSubscriber) HandleEvent(domainEvent coreDomain.D |
|
|
} else {
|
|
|
log.Logger.Info("推送数据返回", data)
|
|
|
}
|
|
|
}
|
|
|
break
|
|
|
case event.CREATION_CONTRACT_INFORM_JOINT: // 共创确认
|
|
|
creationContractInformJointEvent := domainEvent.(*event.CreationContractInformJoint)
|
|
|
for _, jointData := range creationContractInformJointEvent.CreationContractInformJointData {
|
|
|
data, err2 := messageServiceGateway.InformJoinCreationContract(
|
|
|
creationContractInformJointEvent.CreationContractId,
|
|
|
creationContractInformJointEvent.CreationContractName,
|
|
|
creationContractInformJointEvent.CreationContractNumber,
|
|
|
creationContractInformJointEvent.CreationProjectId,
|
|
|
creationContractInformJointEvent.CreationProjectName,
|
|
|
creationContractInformJointEvent.UserId,
|
|
|
creationContractInformJointEvent.UserBaseId,
|
|
|
creationContractInformJointEvent.OrgId,
|
|
|
creationContractInformJointEvent.CompanyId,
|
|
|
jointData.CreationContractId,
|
|
|
jointData.CreationContractName,
|
|
|
jointData.CreationContractNumber,
|
|
|
jointData.CreationProjectId,
|
|
|
jointData.CreationProjectNumber,
|
|
|
jointData.CreationProjectName,
|
|
|
jointData.UserId,
|
|
|
jointData.UserBaseId,
|
|
|
jointData.OrgId,
|
|
|
jointData.CompanyId,
|
|
|
)
|
|
|
if err2 != nil {
|
|
|
log.Logger.Error("推送消息错误", map[string]interface{}{
|
...
|
...
|
@@ -62,17 +66,19 @@ func (subscriber *MessageServiceSubscriber) HandleEvent(domainEvent coreDomain.D |
|
|
} else {
|
|
|
log.Logger.Info("推送数据返回", data)
|
|
|
}
|
|
|
}
|
|
|
break
|
|
|
case event.COOPERATION_APPLICATION_REJECTED: // 共创申请审核拒绝
|
|
|
cooperationApplicationRejectedEvent := domainEvent.(*event.CooperationApplicationRejected)
|
|
|
for _, rejectedData := range cooperationApplicationRejectedEvent.CooperationApplicationRejectedData {
|
|
|
data, err3 := messageServiceGateway.RejectCooperationApplication(
|
|
|
cooperationApplicationRejectedEvent.CreationProjectId,
|
|
|
cooperationApplicationRejectedEvent.CreationProjectName,
|
|
|
cooperationApplicationRejectedEvent.CreationProjectNumber,
|
|
|
cooperationApplicationRejectedEvent.UserId,
|
|
|
cooperationApplicationRejectedEvent.UserBaseId,
|
|
|
cooperationApplicationRejectedEvent.OrgId,
|
|
|
cooperationApplicationRejectedEvent.CompanyId,
|
|
|
rejectedData.CreationProjectId,
|
|
|
rejectedData.CreationProjectName,
|
|
|
rejectedData.CreationProjectNumber,
|
|
|
rejectedData.UserId,
|
|
|
rejectedData.UserBaseId,
|
|
|
rejectedData.OrgId,
|
|
|
rejectedData.CompanyId,
|
|
|
)
|
|
|
if err3 != nil {
|
|
|
log.Logger.Error("推送消息错误", map[string]interface{}{
|
...
|
...
|
@@ -82,19 +88,22 @@ func (subscriber *MessageServiceSubscriber) HandleEvent(domainEvent coreDomain.D |
|
|
} else {
|
|
|
log.Logger.Info("推送数据返回", data)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
break
|
|
|
case event.CREDIT_ACCOUNT_PAID: // 账期结算支付
|
|
|
creditAccountPaidEvent := domainEvent.(*event.CreditAccountPaid)
|
|
|
for _, paidData := range creditAccountPaidEvent.CreditAccountPaidData {
|
|
|
data, err4 := messageServiceGateway.PayCreditAccount(
|
|
|
creditAccountPaidEvent.CreditAccountOrderNum,
|
|
|
creditAccountPaidEvent.SettlementAmount,
|
|
|
creditAccountPaidEvent.CreditAccountId,
|
|
|
creditAccountPaidEvent.DividendsEstimateId,
|
|
|
creditAccountPaidEvent.DividendsEstimateOrderNumber,
|
|
|
creditAccountPaidEvent.UserId,
|
|
|
creditAccountPaidEvent.UserBaseId,
|
|
|
creditAccountPaidEvent.OrgId,
|
|
|
creditAccountPaidEvent.CompanyId,
|
|
|
paidData.CreditAccountOrderNum,
|
|
|
paidData.SettlementAmount,
|
|
|
paidData.CreditAccountId,
|
|
|
paidData.DividendsEstimateId,
|
|
|
paidData.DividendsEstimateOrderNumber,
|
|
|
paidData.UserId,
|
|
|
paidData.UserBaseId,
|
|
|
paidData.OrgId,
|
|
|
paidData.CompanyId,
|
|
|
)
|
|
|
if err4 != nil {
|
|
|
log.Logger.Error("推送消息错误", map[string]interface{}{
|
...
|
...
|
@@ -104,19 +113,22 @@ func (subscriber *MessageServiceSubscriber) HandleEvent(domainEvent coreDomain.D |
|
|
} else {
|
|
|
log.Logger.Info("推送数据返回", data)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
break
|
|
|
case event.DIVIDENDS_ESTIMATED: // 账期结算
|
|
|
dividendsEstimatedEvent := domainEvent.(*event.DividendsEstimated)
|
|
|
for _, estimatedData := range dividendsEstimatedEvent.DividendsEstimatedData {
|
|
|
data, err5 := messageServiceGateway.DividendsEstimate(
|
|
|
dividendsEstimatedEvent.CreditAccountOrderNum,
|
|
|
dividendsEstimatedEvent.SettlementAmount,
|
|
|
dividendsEstimatedEvent.CreditAccountId,
|
|
|
dividendsEstimatedEvent.DividendsEstimateId,
|
|
|
dividendsEstimatedEvent.DividendsEstimateOrderNumber,
|
|
|
dividendsEstimatedEvent.UserId,
|
|
|
dividendsEstimatedEvent.UserBaseId,
|
|
|
dividendsEstimatedEvent.OrgId,
|
|
|
dividendsEstimatedEvent.CompanyId,
|
|
|
estimatedData.CreditAccountOrderNum,
|
|
|
estimatedData.SettlementAmount,
|
|
|
estimatedData.CreditAccountId,
|
|
|
estimatedData.DividendsEstimateId,
|
|
|
estimatedData.DividendsEstimateOrderNumber,
|
|
|
estimatedData.UserId,
|
|
|
estimatedData.UserBaseId,
|
|
|
estimatedData.OrgId,
|
|
|
estimatedData.CompanyId,
|
|
|
)
|
|
|
if err5 != nil {
|
|
|
log.Logger.Error("推送消息错误", map[string]interface{}{
|
...
|
...
|
@@ -126,22 +138,24 @@ func (subscriber *MessageServiceSubscriber) HandleEvent(domainEvent coreDomain.D |
|
|
} else {
|
|
|
log.Logger.Info("推送数据返回", data)
|
|
|
}
|
|
|
}
|
|
|
break
|
|
|
case event.DIVIDENDS_INFORM_EXPECTED: // 分红预算
|
|
|
dividendsInformExpectedEvent := domainEvent.(*event.DividendsInformExpected)
|
|
|
for _, expectedData := range dividendsInformExpectedEvent.DividendsInformExpectedData {
|
|
|
data, err6 := messageServiceGateway.InformExpectedDividends(
|
|
|
dividendsInformExpectedEvent.CreationContractId,
|
|
|
dividendsInformExpectedEvent.CreationContractName,
|
|
|
dividendsInformExpectedEvent.CreationContractNumber,
|
|
|
dividendsInformExpectedEvent.CreationProjectId,
|
|
|
dividendsInformExpectedEvent.CreationProjectName,
|
|
|
dividendsInformExpectedEvent.ProductName,
|
|
|
dividendsInformExpectedEvent.UserId,
|
|
|
dividendsInformExpectedEvent.UserBaseId,
|
|
|
dividendsInformExpectedEvent.OrgId,
|
|
|
dividendsInformExpectedEvent.CompanyId,
|
|
|
dividendsInformExpectedEvent.DividendsEstimateId,
|
|
|
dividendsInformExpectedEvent.DividendsAmount,
|
|
|
expectedData.CreationContractId,
|
|
|
expectedData.CreationContractName,
|
|
|
expectedData.CreationContractNumber,
|
|
|
expectedData.CreationProjectId,
|
|
|
expectedData.CreationProjectName,
|
|
|
expectedData.ProductName,
|
|
|
expectedData.UserId,
|
|
|
expectedData.UserBaseId,
|
|
|
expectedData.OrgId,
|
|
|
expectedData.CompanyId,
|
|
|
expectedData.DividendsEstimateId,
|
|
|
expectedData.DividendsAmount,
|
|
|
)
|
|
|
if err6 != nil {
|
|
|
log.Logger.Error("推送消息错误", map[string]interface{}{
|
...
|
...
|
@@ -151,6 +165,8 @@ func (subscriber *MessageServiceSubscriber) HandleEvent(domainEvent coreDomain.D |
|
|
} else {
|
|
|
log.Logger.Info("推送数据返回", data)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
break
|
|
|
}
|
|
|
return nil
|
...
|
...
|
|