作者 陈志颖

feat:共创申请接口调整

... ... @@ -13,10 +13,6 @@ type ListCooperationApplicationQuery struct {
PageNumber int64 `cname:"页面大小" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 查询偏离量
Offset int `cname:"查询偏离量" json:"offset" valid:"Required"`
// 查询限制
Limit int `cname:"查询限制" json:"limit" valid:"Required"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"`
// 组织机构ID
... ...
... ... @@ -9,8 +9,10 @@ import (
)
type SearchCooperationApplicationQuery struct {
// 共创项目编号
CooperationProjectNumber string `cname:"共创项目编号" json:"cooperationProjectNumber,omitempty"`
// 共创项目名称
CooperationProjectName string `cname:"共创项目名称" json:"cooperationProjectName" valid:"Required"`
CooperationProjectName string `cname:"共创项目名称" json:"cooperationProjectName,omitempty"`
// 申请人姓名
ApplicantName string `cname:"申请人姓名" json:"applicantName,omitempty"`
// 共创申请审核状态,1待审核,2已同意,3已拒绝
... ...
... ... @@ -24,6 +24,7 @@ func (repository *CooperationApplicationRepository) nextIdentify() (int64, error
id, err := IdWorker.NextId()
return id, err
}
func (repository *CooperationApplicationRepository) Save(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
sqlBuildFields := []string{
"cooperation_application_id",
... ... @@ -67,7 +68,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication
&cooperationApplication.CooperationApplicationVerifyDescription,
&cooperationApplication.CooperationApplicationVerifyTime,
&cooperationApplication.CooperationApplyTime,
&cooperationApplication.CooperationProject,
&cooperationApplication.CooperationProject.CooperationProjectNumber,
&cooperationApplication.Org,
&cooperationApplication.IsCanceled,
&cooperationApplication.Company,
... ... @@ -85,12 +86,12 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication
cooperationApplication.CooperationApplicationVerifyDescription,
cooperationApplication.CooperationApplicationVerifyTime,
cooperationApplication.CooperationApplyTime,
cooperationApplication.CooperationProject,
cooperationApplication.CooperationProject.CooperationProjectNumber,
cooperationApplication.Org,
cooperationApplication.IsCanceled,
cooperationApplication.Company,
cooperationApplication.CreatedAt,
cooperationApplication.DeletedAt,
nil,
cooperationApplication.UpdatedAt,
); err != nil {
return cooperationApplication, err
... ... @@ -107,7 +108,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication
&cooperationApplication.CooperationApplicationVerifyDescription,
&cooperationApplication.CooperationApplicationVerifyTime,
&cooperationApplication.CooperationApplyTime,
&cooperationApplication.CooperationProject,
&cooperationApplication.CooperationProject.CooperationProjectNumber,
&cooperationApplication.Org,
&cooperationApplication.IsCanceled,
&cooperationApplication.Company,
... ... @@ -125,12 +126,12 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication
cooperationApplication.CooperationApplicationVerifyDescription,
cooperationApplication.CooperationApplicationVerifyTime,
cooperationApplication.CooperationApplyTime,
cooperationApplication.CooperationProject,
cooperationApplication.CooperationProject.CooperationProjectNumber,
cooperationApplication.Org,
cooperationApplication.IsCanceled,
cooperationApplication.Company,
cooperationApplication.CreatedAt,
cooperationApplication.DeletedAt,
nil,
cooperationApplication.UpdatedAt,
cooperationApplication.Identify(),
); err != nil {
... ... @@ -139,6 +140,7 @@ func (repository *CooperationApplicationRepository) Save(cooperationApplication
}
return cooperationApplication, nil
}
func (repository *CooperationApplicationRepository) Remove(cooperationApplication *domain.CooperationApplication) (*domain.CooperationApplication, error) {
tx := repository.transactionContext.PgTx
cooperationApplicationModel := new(models.CooperationApplication)
... ... @@ -148,6 +150,7 @@ func (repository *CooperationApplicationRepository) Remove(cooperationApplicatio
}
return cooperationApplication, nil
}
func (repository *CooperationApplicationRepository) FindOne(queryOptions map[string]interface{}) (*domain.CooperationApplication, error) {
tx := repository.transactionContext.PgTx
cooperationApplicationModel := new(models.CooperationApplication)
... ... @@ -172,6 +175,7 @@ func (repository *CooperationApplicationRepository) FindOne(queryOptions map[str
return transform.TransformToCooperationApplicationDomainModelFromPgModels(cooperationApplicationModel, cooperationProjectModel)
}
}
func (repository *CooperationApplicationRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.CooperationApplication, error) {
tx := repository.transactionContext.PgTx
var cooperationApplicationModels []*models.CooperationApplication
... ... @@ -198,6 +202,7 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string
return int64(count), cooperationApplications, nil
}
}
func NewCooperationApplicationRepository(transactionContext *pgTransaction.TransactionContext) (*CooperationApplicationRepository, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为nil")
... ...