作者 yangfu

Merge branch 'test' of http://gitlab.fjmaimaimai.com/allied-creation/allied-crea…

…tion-cooperation into test
... ... @@ -55,20 +55,20 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
}
// 公司REST服务初始化
var companyService service.CompanyService
if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
companyService = value
}
//var companyService service.CompanyService
//if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
//} else {
// companyService = value
//}
// 组织机构REST服务初始化
var organizationService service.OrgService
if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
organizationService = value
}
//var organizationService service.OrgService
//if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
//} else {
// organizationService = value
//}
// 共创申请仓储初始化
var cooperationApplicationRepository domain.CooperationApplicationRepository
... ... @@ -162,20 +162,20 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
}
// 获取公司信息
var company *domain.Company
if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取公司信息失败")
} else {
company = data
}
//var company *domain.Company
//if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取公司信息失败")
//} else {
// company = data
//}
// 获取组织机构信息
var organization *domain.Org
if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取组织机构数据失败")
} else {
organization = data
}
//var organization *domain.Org
//if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil {
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取组织机构数据失败")
//} else {
// organization = data
//}
// 校验:同一个用户,不能多次申请同一个项目
applicationExist, _ := cooperationApplicationDao.CheckApplicationExist(map[string]interface{}{
... ... @@ -211,9 +211,9 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
CooperationApplicationVerifyTime: time.Time{},
CooperationApplyTime: time.Now(),
CooperationProject: cooperationProject,
Org: organization,
Org: cooperationProject.Org,
IsCanceled: 1,
Company: company,
Company: cooperationProject.Company,
CreatedAt: time.Now(),
DeletedAt: time.Time{},
UpdatedAt: time.Time{},
... ...
... ... @@ -753,7 +753,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
orderGoodsToConfirm := make([]*domain.OrderGood, 0)
orderGoodsToConfirm = append(orderGoodsToConfirm, orderGood)
// 分红订单产品预算
if dividendsEstimateDetails, err := confirmDividendsIncentivesEstimateService.Confirm(orderGoodsToConfirm, confirmDividendsIncentivesEstimateCommand.CompanyId, confirmDividendsIncentivesEstimateCommand.OrgId, cooperationContractsMap, nil); err != nil {
if dividendsEstimateDetails, err := confirmDividendsIncentivesEstimateService.Confirm(orderGoodsToConfirm, confirmDividendsIncentivesEstimateCommand.CompanyId, confirmDividendsIncentivesEstimateCommand.OrgId, cooperationContractsMap); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
for _, dividendsEstimateDetail := range dividendsEstimateDetails {
... ... @@ -809,7 +809,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
orderGoodsToConfirm := make([]*domain.OrderGood, 0)
orderGoodsToConfirm = append(orderGoodsToConfirm, orderGood)
// 分红退货单产品预算
if dividendsReturnedEstimateDetails, err := confirmDividendsIncentivesEstimateService.Confirm(orderGoodsToConfirm, confirmDividendsIncentivesEstimateCommand.CompanyId, confirmDividendsIncentivesEstimateCommand.OrgId, cooperationContractsMap, nil); err != nil {
if dividendsReturnedEstimateDetails, err := confirmDividendsIncentivesEstimateService.Confirm(orderGoodsToConfirm, confirmDividendsIncentivesEstimateCommand.CompanyId, confirmDividendsIncentivesEstimateCommand.OrgId, cooperationContractsMap); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
for _, dividendsReturnedEstimateDetail := range dividendsReturnedEstimateDetails {
... ...
... ... @@ -43,5 +43,5 @@ func (DividendsEstimateDetail *DividendsEstimateDetail) GenerateSpecificDividend
type ConfirmDividendsIncentivesEstimateService interface {
coreDomain.DomainEventPublisher
Confirm(orderGoods []*domain.OrderGood, companyId int64, orgId int64, cooperationContractsMap map[string]*domain.CooperationContract, cooperationProjectsMap map[string]*domain.CooperationProject) ([]*DividendsEstimateDetail, error)
Confirm(orderGoods []*domain.OrderGood, companyId int64, orgId int64, cooperationContractsMap map[string]*domain.CooperationContract) ([]*DividendsEstimateDetail, error)
}
... ...
... ... @@ -16,7 +16,7 @@ type ConfirmDividendsIncentivesEstimateService struct {
}
// Confirm 确认业绩分红预算
func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoods []*domain.OrderGood, companyId int64, orgId int64, cooperationContractsMap map[string]*domain.CooperationContract, cooperationProjectsMap map[string]*domain.CooperationProject) ([]*service.DividendsEstimateDetail, error) {
func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoods []*domain.OrderGood, companyId int64, orgId int64, cooperationContractsMap map[string]*domain.CooperationContract) ([]*service.DividendsEstimateDetail, error) {
var dividendsOrderRepository domain.DividendsOrderRepository // 分红订单仓储
var dividendsReturnedOrderRepository domain.DividendsReturnedOrderRepository // 分红退货单仓储
... ...