作者 yangfu

查询条件修改

... ... @@ -12,6 +12,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/dao"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
"strconv"
"time"
)
... ... @@ -123,6 +124,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
var undertakerDomain *domain.Undertaker
undertakerUid, _ := strconv.ParseInt(undertaker.UserId, 10, 64)
if data, err := userService.UndertakerFrom(createCooperationContractCommand.CompanyId, createCooperationContractCommand.OrgId, undertakerUid); err != nil {
log.Logger.Error(err.Error())
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
undertakerDomain = data
... ... @@ -131,19 +133,25 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
// 获取推荐人
var referrerDomain *domain.Referrer
referrerUid, _ := strconv.ParseInt(undertaker.ReferrerId, 10, 64)
if data, err := userService.ReferrerFrom(createCooperationContractCommand.CompanyId, createCooperationContractCommand.OrgId, referrerUid); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
referrerDomain = data
if referrerUid > 0 {
if data, err := userService.ReferrerFrom(createCooperationContractCommand.CompanyId, createCooperationContractCommand.OrgId, referrerUid); err != nil {
log.Logger.Error(err.Error())
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
referrerDomain = data
}
}
// 获取业务员
var salesmanDomain *domain.Salesman
salesmanUid, _ := strconv.ParseInt(undertaker.SalesmanId, 10, 64)
if data, err := userService.SalesmanFrom(createCooperationContractCommand.CompanyId, createCooperationContractCommand.OrgId, salesmanUid); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
salesmanDomain = data
if salesmanUid > 0 {
if data, err := userService.SalesmanFrom(createCooperationContractCommand.CompanyId, createCooperationContractCommand.OrgId, salesmanUid); err != nil {
log.Logger.Error(err.Error())
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
salesmanDomain = data
}
}
undertakers = append(undertakers, &domain.Undertaker{
... ... @@ -171,6 +179,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
var relevantDomain *domain.Relevant
relevantUid, _ := strconv.ParseInt(relevantPersonUid, 10, 64)
if data, err := userService.RelevantFrom(createCooperationContractCommand.CompanyId, createCooperationContractCommand.OrgId, relevantUid); err != nil {
log.Logger.Error(err.Error())
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
relevantDomain = data
... ... @@ -751,19 +760,23 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
// 获取推荐人
var referrerDomain *domain.Referrer
referrerUid, _ := strconv.ParseInt(undertaker.ReferrerId, 10, 64)
if data, err := userService.ReferrerFrom(updateCooperationContractCommand.CompanyId, updateCooperationContractCommand.OrgId, referrerUid); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
referrerDomain = data
if referrerUid > 0 {
if data, err := userService.ReferrerFrom(updateCooperationContractCommand.CompanyId, updateCooperationContractCommand.OrgId, referrerUid); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
referrerDomain = data
}
}
// 获取业务员
var salesmanDomain *domain.Salesman
salesmanUid, _ := strconv.ParseInt(undertaker.SalesmanId, 10, 64)
if data, err := userService.SalesmanFrom(updateCooperationContractCommand.CompanyId, updateCooperationContractCommand.OrgId, salesmanUid); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
salesmanDomain = data
if salesmanUid > 0 {
if data, err := userService.SalesmanFrom(updateCooperationContractCommand.CompanyId, updateCooperationContractCommand.OrgId, salesmanUid); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
salesmanDomain = data
}
}
undertakers = append(undertakers, &domain.Undertaker{
... ...
... ... @@ -15,7 +15,7 @@ type SearchCreditAccountQuery struct {
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 账期结算单号
CreditAccountOrderNum string `cname:"账期结算单号" json:"creditAccountOrderNum" valid:"Required"`
CreditAccountOrderNum string `cname:"账期结算单号" json:"creditAccountOrderNum"`
// 参与人姓名
ParticipatorName string `cname:"参与人姓名" json:"participatorName,omitempty"`
// 公司ID,通过集成REST上下文获取
... ... @@ -27,7 +27,7 @@ type SearchCreditAccountQuery struct {
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
// 账期结算支付状态,1待支付,2已支付,APP端结算记录返回已结算的账期结算单
PaymentStatus int32 `cname:"账期结算支付状态" json:"paymentStatus" valid:"Required"`
PaymentStatus int32 `cname:"账期结算支付状态" json:"paymentStatus"`
// 结算周期,按年“2021”或者按月结算”2021-07“
Period time.Time `cname:"结算周期" json:"period,omitempty"`
}
... ...