param_cooperation_project.go 9.9 KB
package allied_creation_cooperation

import (
	"time"

	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/util/jtime"
)

type ProjectAttachment struct {
	FileType string `json:"fileType"`
	Name     string `json:"name"`
	Url      string `json:"url"`
	FileSize int    `json:"fileSize"`
} //图片附件
type CooperationProject struct {
	Company struct {
		CompanyId   int    `json:"companyId,string,"`
		CompanyLogo string `json:"companyLogo"`
		CompanyName string `json:"companyName"`
	} `json:"company"` //项目归属企业
	Org struct {
		OrgId   int    `json:"orgId,string"`
		OrgName string `json:"orgName"`
	} `json:"org"` //项目创建时的组织
	CooperationMode struct {
		CooperationModeId     int    `json:"cooperationModeId,string"`
		CooperationModeName   string `json:"cooperationModeName"`
		CooperationModeNumber string `json:"cooperationModeNumber"`
	} `json:"cooperationMode"` //项目模式
	CooperationProjectDescription string              `json:"cooperationProjectDescription"`
	Attachment                    []domain.Attachment `json:"attachment"`
	CooperationProjectId          int                 `json:"cooperationProjectId,string,"`
	CooperationProjectName        string              `json:"cooperationProjectName"`
	CooperationProjectNumber      string              `json:"cooperationProjectNumber"`
	CooperationProjectPublishTime time.Time           `json:"cooperationProjectPublishTime"`
	CreatedAt                     time.Time           `json:"createdAt"`
	CooperationProjectPublisher   struct {
		UsersId  int `json:"userId,string"`
		UserInfo struct {
			UsersName string `json:"userName"`
			UsersCode string `json:"userCode"`
			Phone     string `json:"phone"`
			UsersId   int    `json:"userId,string,"`
		} `json:"userInfo"`
	} `json:"cooperationProjectPublisher"` //项目发布人,即操作人
	CooperationProjectSponsor struct {
		UsersId  int `json:"userId,string"`
		UserInfo struct {
			UsersName string `json:"userName"`
			UsersCode string `json:"userCode"`
			Phone     string `json:"phone"`
			UsersId   int    `json:"userId,string"`
		} `json:"userInfo"`
	} `json:"cooperationProjectSponsor"` //项目发起人
	CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"` //共创合约承接对象,1员工,2共创用户,3公开
	Department                       struct {
		DepartmentNumber string `json:"departmentNumber"`
		DepartmentId     int    `json:"departmentId,string,"`
		DepartmentName   string `json:"departmentName"`
	} `json:"department"` //项目发起部门
	Status int `json:"status"` // 共创项目状态,1招标中,2结束
}

//创建共创项目
type (
	ReqCooperationProjectAdd struct {
		CooperationProjectDescription    string               `json:"cooperationProjectDescription"`
		CooperationProjectName           string               `json:"cooperationProjectName"`
		CooperationModeNumber            string               `json:"cooperationModeNumber"`
		PublisherUid                     int                  `json:"publisherUid,string"`
		SponsorUid                       int                  `json:"sponsorUid,string"`
		DepartmentId                     int                  `json:"departmentId,string"`
		CooperationProjectUndertakerType []int                `json:"cooperationProjectUndertakerTypes"`
		Attachment                       []*domain.Attachment `json:"attachment"`
	}

	DataCooperationProjectAdd struct {
		CooperationProject
	}
)

//返回共创项目列表
type (
	ReqCooperationProjectList struct {
	}

	DataCooperationProjectList struct {
	}
)

//返回共创项目详情
type (
	ReqCooperationProjectGet struct {
		CooperationProjectId int
	}

	DataCooperationProjectGet struct {
		CooperationProject
	}
)

//更新共创项目
type (
	ReqCooperationProjectUpdate struct {
		// 共创项目ID
		CooperationProjectId string `json:"cooperationProjectId" `
		// 共创项目名称
		CooperationProjectName string `json:"cooperationProjectName"`
		CooperationModeNumber  string `json:"cooperationModeNumber"`
		// 承接对象,1员工,2共创用户,3公开,可以多选
		CooperationProjectUndertakerType []int32 `json:"cooperationProjectUndertakerTypes"`
		// 共创项目发起人uid
		SponsorUid string `json:"sponsorUid"`
		// 共创项目发布人uid
		PublisherUid string `json:"publisherUid"`
		// 共创项目描述
		CooperationProjectDescription string              `json:"cooperationProjectDescription"`
		Attachment                    []domain.Attachment `json:"attachment"`
		DepartmentId                  int                 `json:"departmentId,string"`
	}

	DataCooperationProjectUpdate struct {
		CooperationProject
	}
)

//移除共创项目
type (
	ReqCooperationProjectRemove struct {
		CooperationProjectID int `json:"cooperationProjectId"`
	}

	DataCooperationProjectRemove struct {
	}
)

//发布共创项目
type (
	ReqCooperationProjectsRelease struct {
	}

	DataCooperationProjectsRelease struct {
	}
)

//查询共创项目
type (
	ReqCooperationProjectSearch struct {
		PageNumber int `json:"pageNumber"`
		PageSize   int `json:"pageSize"`
		//发起部门名称
		DepartmentName string `json:"departmentName"`
		//项目名称
		CooperationProjectName string `json:"cooperationProjectName"`
		// 共创项目状态,1招标中,2结束 0 全部
		Status int `json:"status"`
		//
		OrgIds                       []string `json:"orgIds"`
		CooperationProjectNumberLike string   `json:"cooperationProjectNumberLike"`
		//OffsetLimitFlag bool `json:"offsetLimitFlag"`
	}

	DataCooperationProjectSearch struct {
		//Total int64                `json:"total"`
		//List  []CooperationProject `json:"cooperationProjects"`
		List []struct {
			CooperationProjectID          string               `json:"cooperationProjectId"`
			CooperationProjectNumber      string               `json:"cooperationProjectNumber"`
			CooperationProjectDescription string               `json:"cooperationProjectDescription"`
			CooperationProjectName        string               `json:"cooperationProjectName"`
			CooperationProjectPublishTime jtime.TimeToUnixMsec `json:"cooperationProjectPublishTime"`
			CooperationProjectPublisher   struct {
				UserID     string      `json:"userId"`
				UserBaseID string      `json:"userBaseId"`
				Department interface{} `json:"department"`
				UserInfo   struct {
					UserAvatar  string `json:"userAvatar"`
					UserEmail   string `json:"userEmail"`
					UserName    string `json:"userName"`
					UserPhone   string `json:"userPhone"`
					UserAccount string `json:"userAccount"`
				} `json:"userInfo"`
				//UserType  int    `json:"userType"`
				//UserName  string `json:"userName"`
				//UserPhone string `json:"userPhone"`
				//Status    int    `json:"status"`
			} `json:"cooperationProjectPublisher"`
			CooperationProjectSponsor struct {
				UserID     string      `json:"userId"`
				UserBaseID string      `json:"userBaseId"`
				Department interface{} `json:"department"`
				UserInfo   struct {
					UserAvatar  string `json:"userAvatar"`
					UserEmail   string `json:"userEmail"`
					UserName    string `json:"userName"`
					UserPhone   string `json:"userPhone"`
					UserAccount string `json:"userAccount"`
				} `json:"userInfo"`
				//UserType  int    `json:"userType"`
				//UserName  string `json:"userName"`
				//UserPhone string `json:"userPhone"`
				//Status    int    `json:"status"`
			} `json:"cooperationProjectSponsor"`
			CooperationMode struct {
				CooperationModeId     int    `json:"cooperationModeId,string"`
				CooperationModeName   string `json:"cooperationModeName"`
				CooperationModeNumber string `json:"cooperationModeNumber"`
			} `json:"cooperationMode"` //项目模式
			Department struct {
				DepartmentID     string `json:"departmentId"`
				DepartmentName   string `json:"departmentName"`
				DepartmentNumber string `json:"departmentNumber"`
				//IsOrganization   bool   `json:"isOrganization"`
			} `json:"department"`
			CooperationProjectUndertakerTypes []int `json:"cooperationProjectUndertakerTypes"`
			CooperationProjectUndertakerType  []int `json:"cooperationProjectUndertakerType"`
			Org                               struct {
				OrgID   string `json:"orgId"`
				OrgName string `json:"orgName"`
			} `json:"org"`
			Attachment interface{} `json:"attachment"`
			Company    struct {
				CompanyID   string `json:"companyId"`
				CompanyLogo string `json:"companyLogo"`
				CompanyName string `json:"companyName"`
			} `json:"company"`
			Operator struct {
				UserID     string      `json:"userId"`
				UserBaseID string      `json:"userBaseId"`
				Department interface{} `json:"department"`
				UserInfo   struct {
					UserAvatar  string `json:"userAvatar"`
					UserEmail   string `json:"userEmail"`
					UserName    string `json:"userName"`
					UserPhone   string `json:"userPhone"`
					UserAccount string `json:"userAccount"`
				} `json:"userInfo"`
				//UserType  int    `json:"userType"`
				//UserName  string `json:"userName"`
				//UserPhone string `json:"userPhone"`
				//Status    int    `json:"status"`
			} `json:"operator"`
			//OperateTime time.Time `json:"operateTime"`
			Status int `json:"status"`
			//UpdatedAt   time.Time `json:"updatedAt"`
			//DeletedAt   time.Time `json:"deletedAt"`
			//CreatedAt   time.Time `json:"createdAt"`
		} `json:"list"`
		Total int `json:"total"`
	}
)

//判断当前勾选的承接对象是否存在用户
type (
	ReqCooperationProjectsCheck struct {
		CooperationProjectId              int   `json:"cooperationProjectId"`
		CooperationProjectUndertakerTypes []int `json:"cooperationProjectUndertakerTypes"`
	}

	DataCooperationProjectsCheck struct {
	}
)

// 批量结束项目
type (
	ReqCooperationProjectBatchEnd struct {
		CooperationProjectIds []string `json:"cooperationProjectIds"`
	}

	DataCooperationProjectBatchEnd struct {
	}
)

// 结束项目
type (
	ReqCooperationProjectEnd struct {
		CooperationProjectId string `json:"cooperationProjectId"`
	}

	DataCooperationProjectEnd struct {
	}
)