作者 陈志颖

fix:分红预算增加项目有无判断

... ... @@ -8,6 +8,19 @@ import (
"github.com/beego/beego/v2/core/validation"
)
type SearchCooperationProjectExtQuery struct {
// 公司ID,通过集成REST上下文获取
ExtCompanyId int64 `cname:"公司ID" json:"extCompanyId,omitempty"`
// 组织机构ID
ExtOrgId int64 `cname:"组织机构ID" json:"extOrgId,omitempty"`
// 关联的组织机构ID列表
ExtOrgIds []int64 `cname:"关联的组织机构ID列表" json:"extOrgIds,omitempty"`
// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
ExtUserId int64 `cname:"用户ID" json:"extUserId,omitempty"`
// 用户基础数据id
ExtUserBaseId int64 `cname:"用户基础数据ID" json:"extUserBaseId,omitempty"`
}
type SearchCooperationProjectQuery struct {
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
... ... @@ -35,6 +48,8 @@ type SearchCooperationProjectQuery struct {
UserId int64 `cname:"用户ID" json:"userId"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
// 额外的查询条件
SearchCooperationProjectExtQueries []*SearchCooperationProjectExtQuery `cname:"额外的查询条件" json:"searchCooperationProjectExtQueries"`
}
func (searchCooperationProjectQuery *SearchCooperationProjectQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -124,11 +124,11 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
}
// 获取共创项目
if cooperationContract.CooperationProjectNumber != "" {
cooperationProject, err := cooperationProjectRepository.FindOne(map[string]interface{}{
"cooperationProjectNumber": cooperationContract.CooperationProjectNumber,
"companyId": cooperationContract.Company.CompanyId,
"orgId": cooperationContract.Org.OrgId,
//"notPause": true,
})
if err != nil {
var orderNumber string
... ... @@ -144,10 +144,9 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
DividendsAmount: 0,
OrderOrReturnedOrderNumber: orderNumber,
IsSuccessfully: false,
Reason: "共创项目" + orderGood.CooperationContractNumber + "查询错误",
Reason: "共创项目" + cooperationContract.CooperationProjectNumber + "查询错误",
})
continue
//return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if cooperationProject == nil {
var orderNumber string
... ... @@ -163,10 +162,11 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
DividendsAmount: 0,
OrderOrReturnedOrderNumber: orderNumber,
IsSuccessfully: false,
Reason: "共创项目" + orderGood.CooperationContractNumber + "已结束或不存在",
Reason: "共创项目" + cooperationContract.CooperationProjectNumber + "已结束或不存在",
})
continue
}
}
if orderGood.DividendsOrderNumber != "" { // 获取分红订单
// 获取分红订单
... ...