作者 陈志颖

fix:日志

@@ -55,20 +55,20 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop @@ -55,20 +55,20 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
55 } 55 }
56 56
57 // 公司REST服务初始化 57 // 公司REST服务初始化
58 - var companyService service.CompanyService  
59 - if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {  
60 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
61 - } else {  
62 - companyService = value  
63 - } 58 + //var companyService service.CompanyService
  59 + //if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
  60 + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  61 + //} else {
  62 + // companyService = value
  63 + //}
64 64
65 // 组织机构REST服务初始化 65 // 组织机构REST服务初始化
66 - var organizationService service.OrgService  
67 - if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil {  
68 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
69 - } else {  
70 - organizationService = value  
71 - } 66 + //var organizationService service.OrgService
  67 + //if value, err := factory.CreateOrganizationService(map[string]interface{}{}); err != nil {
  68 + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  69 + //} else {
  70 + // organizationService = value
  71 + //}
72 72
73 // 共创申请仓储初始化 73 // 共创申请仓储初始化
74 var cooperationApplicationRepository domain.CooperationApplicationRepository 74 var cooperationApplicationRepository domain.CooperationApplicationRepository
@@ -162,20 +162,20 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop @@ -162,20 +162,20 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
162 } 162 }
163 163
164 // 获取公司信息 164 // 获取公司信息
165 - var company *domain.Company  
166 - if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil {  
167 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取公司信息失败")  
168 - } else {  
169 - company = data  
170 - } 165 + //var company *domain.Company
  166 + //if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil {
  167 + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取公司信息失败")
  168 + //} else {
  169 + // company = data
  170 + //}
171 171
172 // 获取组织机构信息 172 // 获取组织机构信息
173 - var organization *domain.Org  
174 - if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil {  
175 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取组织机构数据失败")  
176 - } else {  
177 - organization = data  
178 - } 173 + //var organization *domain.Org
  174 + //if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil {
  175 + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取组织机构数据失败")
  176 + //} else {
  177 + // organization = data
  178 + //}
179 179
180 // 校验:同一个用户,不能多次申请同一个项目 180 // 校验:同一个用户,不能多次申请同一个项目
181 applicationExist, _ := cooperationApplicationDao.CheckApplicationExist(map[string]interface{}{ 181 applicationExist, _ := cooperationApplicationDao.CheckApplicationExist(map[string]interface{}{
@@ -211,9 +211,9 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop @@ -211,9 +211,9 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
211 CooperationApplicationVerifyTime: time.Time{}, 211 CooperationApplicationVerifyTime: time.Time{},
212 CooperationApplyTime: time.Now(), 212 CooperationApplyTime: time.Now(),
213 CooperationProject: cooperationProject, 213 CooperationProject: cooperationProject,
214 - Org: organization, 214 + Org: cooperationProject.Org,
215 IsCanceled: 1, 215 IsCanceled: 1,
216 - Company: company, 216 + Company: cooperationProject.Company,
217 CreatedAt: time.Now(), 217 CreatedAt: time.Now(),
218 DeletedAt: time.Time{}, 218 DeletedAt: time.Time{},
219 UpdatedAt: time.Time{}, 219 UpdatedAt: time.Time{},
@@ -753,7 +753,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -753,7 +753,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
753 orderGoodsToConfirm := make([]*domain.OrderGood, 0) 753 orderGoodsToConfirm := make([]*domain.OrderGood, 0)
754 orderGoodsToConfirm = append(orderGoodsToConfirm, orderGood) 754 orderGoodsToConfirm = append(orderGoodsToConfirm, orderGood)
755 // 分红订单产品预算 755 // 分红订单产品预算
756 - if dividendsEstimateDetails, err := confirmDividendsIncentivesEstimateService.Confirm(orderGoodsToConfirm, confirmDividendsIncentivesEstimateCommand.CompanyId, confirmDividendsIncentivesEstimateCommand.OrgId, cooperationContractsMap, nil); err != nil { 756 + if dividendsEstimateDetails, err := confirmDividendsIncentivesEstimateService.Confirm(orderGoodsToConfirm, confirmDividendsIncentivesEstimateCommand.CompanyId, confirmDividendsIncentivesEstimateCommand.OrgId, cooperationContractsMap); err != nil {
757 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 757 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
758 } else { 758 } else {
759 for _, dividendsEstimateDetail := range dividendsEstimateDetails { 759 for _, dividendsEstimateDetail := range dividendsEstimateDetails {
@@ -809,7 +809,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -809,7 +809,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
809 orderGoodsToConfirm := make([]*domain.OrderGood, 0) 809 orderGoodsToConfirm := make([]*domain.OrderGood, 0)
810 orderGoodsToConfirm = append(orderGoodsToConfirm, orderGood) 810 orderGoodsToConfirm = append(orderGoodsToConfirm, orderGood)
811 // 分红退货单产品预算 811 // 分红退货单产品预算
812 - if dividendsReturnedEstimateDetails, err := confirmDividendsIncentivesEstimateService.Confirm(orderGoodsToConfirm, confirmDividendsIncentivesEstimateCommand.CompanyId, confirmDividendsIncentivesEstimateCommand.OrgId, cooperationContractsMap, nil); err != nil { 812 + if dividendsReturnedEstimateDetails, err := confirmDividendsIncentivesEstimateService.Confirm(orderGoodsToConfirm, confirmDividendsIncentivesEstimateCommand.CompanyId, confirmDividendsIncentivesEstimateCommand.OrgId, cooperationContractsMap); err != nil {
813 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 813 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
814 } else { 814 } else {
815 for _, dividendsReturnedEstimateDetail := range dividendsReturnedEstimateDetails { 815 for _, dividendsReturnedEstimateDetail := range dividendsReturnedEstimateDetails {
@@ -43,5 +43,5 @@ func (DividendsEstimateDetail *DividendsEstimateDetail) GenerateSpecificDividend @@ -43,5 +43,5 @@ func (DividendsEstimateDetail *DividendsEstimateDetail) GenerateSpecificDividend
43 43
44 type ConfirmDividendsIncentivesEstimateService interface { 44 type ConfirmDividendsIncentivesEstimateService interface {
45 coreDomain.DomainEventPublisher 45 coreDomain.DomainEventPublisher
46 - Confirm(orderGoods []*domain.OrderGood, companyId int64, orgId int64, cooperationContractsMap map[string]*domain.CooperationContract, cooperationProjectsMap map[string]*domain.CooperationProject) ([]*DividendsEstimateDetail, error) 46 + Confirm(orderGoods []*domain.OrderGood, companyId int64, orgId int64, cooperationContractsMap map[string]*domain.CooperationContract) ([]*DividendsEstimateDetail, error)
47 } 47 }
@@ -16,7 +16,7 @@ type ConfirmDividendsIncentivesEstimateService struct { @@ -16,7 +16,7 @@ type ConfirmDividendsIncentivesEstimateService struct {
16 } 16 }
17 17
18 // Confirm 确认业绩分红预算 18 // Confirm 确认业绩分红预算
19 -func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoods []*domain.OrderGood, companyId int64, orgId int64, cooperationContractsMap map[string]*domain.CooperationContract, cooperationProjectsMap map[string]*domain.CooperationProject) ([]*service.DividendsEstimateDetail, error) { 19 +func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoods []*domain.OrderGood, companyId int64, orgId int64, cooperationContractsMap map[string]*domain.CooperationContract) ([]*service.DividendsEstimateDetail, error) {
20 var dividendsOrderRepository domain.DividendsOrderRepository // 分红订单仓储 20 var dividendsOrderRepository domain.DividendsOrderRepository // 分红订单仓储
21 var dividendsReturnedOrderRepository domain.DividendsReturnedOrderRepository // 分红退货单仓储 21 var dividendsReturnedOrderRepository domain.DividendsReturnedOrderRepository // 分红退货单仓储
22 22