作者 yangfu

登录修改

... ... @@ -11,15 +11,15 @@ type AuditCooperationApplicationCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 共创申请ID
CooperationApplicationId []int `json:"cooperationApplicationId,string" valid:"Required"`
// 共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationId []int `json:"cooperationApplicationId" valid:"Required"`
// 审核动作,1同意,2拒绝
CooperationApplicationStatus int `json:"cooperationApplicationStatus" valid:"Required"`
// 共创申请审核描述
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription" valid:"Required"`
}
func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) ValidateCommand() error {
... ...
... ... @@ -2,6 +2,7 @@ package command
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
... ... @@ -12,7 +13,9 @@ type CreateCooperationApplicationCommand struct {
// 共创申请描述
CooperationApplicationDescription string `json:"cooperationApplicationDescription" valid:"Required"`
// 申请人的id
UserId int64 `json:"userId,omitempty"`
UserId int `json:"userId"`
//
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 附件列表
Attachment []domain.Attachment `json:"attachment"`
}
... ...
... ... @@ -16,7 +16,7 @@ type GetCooperationApplicationQuery struct {
}
func (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (getCooperationApplicationQuery *GetCooperationApplicationQuery) ValidateQuery() error {
... ...
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
//合约模式
type CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
}
//部门
type Department struct {
DepartmentNumber string `json:"departmentNumber"`
DepartmentId int `json:"departmentId,string,"`
DepartmentName string `json:"departmentName"`
}
//用户
type UserInfo struct {
UsersName string `json:"usersName"`
Phone string `json:"phone"`
UsersId int `json:"userId,string"`
}
//公司
type CompanyData struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
}
//CooperationProjectItem 返回共创项目列表项
type CooperationProjectItem struct {
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
CooperationProjectID int `json:"cooperationProjectId,string,"` //id
CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
Department struct {
DepartmentNumber string `json:"departmentNumber"`
DepartmentId int `json:"departmentId,string,"`
DepartmentName string `json:"departmentName"`
} `json:"department"` //项目发起部门
Status int `json:"status"` //项目状态
CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"`
CooperationProjectSponsor struct {
UsersId int `json:"usersId"`
UserInfo struct {
UsersName string `json:"usersName"`
Phone string `json:"phone"`
UsersId int `json:"userId,string"`
} `json:"UserInfo"`
CooperationMode CooperationMode `json:"cooperationMode"` //项目模式
CooperationProjectID int `json:"cooperationProjectId,string,"` //id
CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
Department Department `json:"department"` //项目发起部门
Status int `json:"status"` //项目状态
CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"`
CooperationProjectSponsor struct {
UsersId int `json:"usersId"`
UserInfo UserInfo `json:"UserInfo"`
} `json:"cooperationProjectSponsor"` //共创发起人
}
... ... @@ -52,32 +69,20 @@ func ToCooperationProjectItem(projecetParam *allied_creation_cooperation.Coopera
//CooperationProjectInfo 返回共创项目详情
type CooperationProjectInfo struct {
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string"`
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //共创模式
CooperationProjectID int `json:"cooperationProjectId,string,"` //id
CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"` //共创项目发布时间
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
CooperationProjectDescription string `json:"cooperationProjectDescription"` //共创描述
Department struct {
DepartmentNumber string `json:"departmentNumber"`
DepartmentId int `json:"departmentId,string,"`
DepartmentName string `json:"departmentName"`
} `json:"department"` //项目发起部门
Status int `json:"status"` //项目状态
CooperationProjectSponsor struct {
UsersId int `json:"usersId"`
UserInfo struct {
UsersName string `json:"usersName"`
Phone string `json:"phone"`
UsersId int `json:"userId,string"`
} `json:"UserInfo"`
CooperationMode CooperationMode `json:"cooperationMode"` //共创模式
CooperationProjectID int `json:"cooperationProjectId,string,"` //id
CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationProjectPublishTime int `json:"cooperationProjectPublishTime"` //共创项目发布时间
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //承接对象
CooperationProjectDescription string `json:"cooperationProjectDescription"` //共创描述
Department Department `json:"department"` //项目发起部门
Status int `json:"status"` //项目状态
CooperationProjectSponsor struct {
UsersId int `json:"usersId"`
UserInfo UserInfo `json:"UserInfo"`
} `json:"cooperationProjectSponsor"` //共创发起人
Attachment []allied_creation_cooperation.ProjectAttachment `json:"attachment"` //图片附件
Attachment []domain.Attachment `json:"attachment"` //图片附件
}
func ToCooperationProjectInfo(projecetParam *allied_creation_cooperation.CooperationProject) *CooperationProjectInfo {
... ... @@ -97,6 +102,47 @@ func ToCooperationProjectInfo(projecetParam *allied_creation_cooperation.Coopera
data.CooperationProjectSponsor.UserInfo.UsersId = projecetParam.CooperationProjectSponsor.UsersId
data.CooperationProjectSponsor.UserInfo.Phone = projecetParam.CooperationProjectSponsor.UserInfo.Phone
data.CooperationProjectSponsor.UserInfo.UsersName = projecetParam.CooperationProjectSponsor.UserInfo.UsersName
return &data
}
type CooperationApplication struct {
Company CompanyData `json:"company"`
CooperationApplicationApplicant struct {
UserId int `json:"userId"`
UserInfo UserInfo `json:"userInfo"`
Department Department `json:"department"` //申请人部门
} `json:"cooperationApplicationApplicant"` //申请人
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件信息
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //申请描述
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationId int `json:"cooperationApplicationId"` //申请id
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //审核状态
CooperationApplicationVerifyTime int `json:"cooperationApplicationVerifyTime"` //审核的时间
CooperationProjectId int `json:"cooperationProjectId"` //项目id
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
}
func ToCooperationApplication(applicationParam *allied_creation_cooperation.CooperationApplication) *CooperationApplication {
data := CooperationApplication{
CooperationApplicationAttachment: applicationParam.CooperationApplicationAttachment, //附件信息
CooperationApplicationDescription: applicationParam.CooperationApplicationDescription,
CooperationApplicationId: applicationParam.CooperationApplicationID,
CooperationApplicationStatus: applicationParam.CooperationApplicationStatus, //共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationVerifyTime: int(applicationParam.CooperationApplicationVerifyTime.Unix()), //审核的时间
CooperationProjectId: applicationParam.CooperationProject.CooperationProjectID,
CooperationProjectName: applicationParam.CooperationProject.CooperationProjectName,
CooperationProjectNumber: applicationParam.CooperationProject.CooperationProjectNumber,
CooperationApplicationVerifyDescription: applicationParam.CooperationApplicationVerifyDescription,
}
data.CooperationApplicationApplicant.UserId = applicationParam.CooperationApplicationApplicant.UserID
data.CooperationApplicationApplicant.UserInfo.Phone = applicationParam.CooperationApplicationApplicant.UserInfo.UserPhone
data.CooperationApplicationApplicant.UserInfo.UsersName = applicationParam.CooperationApplicationApplicant.UserInfo.UserName
data.CooperationApplicationApplicant.UserInfo.UsersId = applicationParam.CooperationApplicationApplicant.UserID
data.CooperationApplicationApplicant.Department.DepartmentId = applicationParam.CooperationApplicationApplicant.Department.DepartmentID
data.CooperationApplicationApplicant.Department.DepartmentName = applicationParam.CooperationApplicationApplicant.Department.DepartmentName
data.CooperationApplicationApplicant.Department.DepartmentNumber = applicationParam.CooperationApplicationApplicant.Department.DepartmentNumber
data.Company.CompanyID = applicationParam.Company.CompanyID
data.Company.CompanyName = applicationParam.Company.CompanyName
return &data
}
... ...
package service
import (
"strconv"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_user"
)
// CooperationApplicationsService 共创申请服务
... ... @@ -13,41 +15,54 @@ type CooperationApplicationsService struct {
/***** 企业端 *****/
// GetCooperationApplications TODO:企业获取共创申请详情
func (srv CooperationApplicationsService) GetCooperationApplications(userMenusCommand *command.GetCooperationApplicationQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
// GetCooperationApplications 企业获取共创申请详情
func (srv CooperationApplicationsService) GetCooperationApplications(applicationQuery *command.GetCooperationApplicationQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
applicationQuery.Operator)
resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
CooperationApplicationId: applicationQuery.CooperationApplicationId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
CooperationProjectId: resultApplication.CooperationProject.CooperationProjectID,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
data := map[string]interface{}{
"cooperationApplication": dto.ToCooperationApplication(&resultApplication.CooperationApplication),
"cooperationProject": dto.ToCooperationProjectInfo(&resultProject.CooperationProject),
}
return data, nil
}
// GetCooperationApplications TODO:企业审核共创申请
func (srv CooperationApplicationsService) AuditCooperationApplications(userMenusCommand *command.AuditCooperationApplicationCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
// AuditCooperationApplications 企业审核共创申请
func (srv CooperationApplicationsService) AuditCooperationApplications(auditCommand *command.AuditCooperationApplicationCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
auditCommand.Operator)
applicationIds := []string{}
for _, v := range auditCommand.CooperationApplicationId {
idStr := strconv.Itoa(v)
applicationIds = append(applicationIds, idStr)
}
_, err := creationCooperationGateway.CooperationApplicationsBatchApproval(allied_creation_cooperation.ReqCooperationApplicationBatchApproval{
CooperationApplicationIds: applicationIds,
CooperationApplicationDescription: auditCommand.CooperationApplicationVerifyDescription,
Action: auditCommand.CooperationApplicationStatus,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
return auditCommand, nil
}
// GetCooperationApplications TODO:企业获取共创申请列表
// SearchCooperationApplications 企业获取共创申请列表
func (srv CooperationApplicationsService) SearchCooperationApplications(applicationQuery *command.ListCooperationApplicationQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
applicationQuery.Operator)
resultMenu, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
resultApplications, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
PageNumber: applicationQuery.PageNumber,
PageSize: applicationQuery.PageSize,
CompanyId: int(applicationQuery.Operator.CompanyId),
... ... @@ -56,67 +71,80 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
return resultApplications, nil
}
/***** 共创用户端 *****/
// GetCooperationApplications TODO:创建共创申请管理
func (srv CooperationApplicationsService) CreateCooperationApplications(userMenusCommand *command.CreateCooperationApplicationCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
// CreateCooperationApplications 创建共创申请管理
func (srv CooperationApplicationsService) CreateCooperationApplications(createApplicationsCommand *command.CreateCooperationApplicationCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
createApplicationsCommand.Operator)
result, err := creationCooperationGateway.CooperationApplicationAdd(allied_creation_cooperation.ReqCooperationApplicationAdd{
ApplicantUid: strconv.Itoa(createApplicationsCommand.UserId),
CooperationApplicationDescription: createApplicationsCommand.CooperationApplicationDescription,
CooperationApplicationAttachment: createApplicationsCommand.Attachment,
CooperationProjectNumber: createApplicationsCommand.CooperationProjectNumber,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
data := struct {
CooperationApplicationId int `json:"cooperationApplicationId"`
command.CreateCooperationApplicationCommand
}{
CooperationApplicationId: result.CooperationApplicationId,
CreateCooperationApplicationCommand: *createApplicationsCommand,
}
return data, err
}
//PersonGetCooperationApplications TODO:共创用户获取共创申请详情
func (srv CooperationApplicationsService) PersonGetCooperationApplications(userMenusCommand *command.GetCooperationApplicationQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
//PersonGetCooperationApplications 共创用户获取共创申请详情
func (srv CooperationApplicationsService) PersonGetCooperationApplications(applicationQuery *command.GetCooperationApplicationQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
applicationQuery.Operator)
resultApplication, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
CooperationApplicationId: applicationQuery.CooperationApplicationId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
}
// GetCooperationApplications TODO:共创用户取消共创申请
func (srv CooperationApplicationsService) PersonCancelCooperationApplications(userMenusCommand *command.CancelCooperationApplicationCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
CooperationProjectId: resultApplication.CooperationProject.CooperationProjectID,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
data := map[string]interface{}{
"cooperationApplication": dto.ToCooperationApplication(&resultApplication.CooperationApplication),
"cooperationProject": dto.ToCooperationProjectInfo(&resultProject.CooperationProject),
}
return data, nil
}
// PersonCancelCooperationApplications 共创用户取消共创申请
func (srv CooperationApplicationsService) PersonCancelCooperationApplications(userMenusCommand *command.CancelCooperationApplicationCommand) (interface{}, error) {
return nil, nil
}
// GetCooperationApplications TODO:共创用户获取共创申请列表
func (srv CooperationApplicationsService) PersonSearchCooperationApplications(userMenusCommand *command.ListCooperationApplicationQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
// PersonSearchCooperationApplications 共创用户获取共创申请列表
func (srv CooperationApplicationsService) PersonSearchCooperationApplications(applicationQuery *command.ListCooperationApplicationQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
applicationQuery.Operator)
resultApplications, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
PageNumber: applicationQuery.PageNumber,
PageSize: applicationQuery.PageSize,
CompanyId: int(applicationQuery.Operator.CompanyId),
CooperationApplicationStatus: applicationQuery.Status,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
// var dataList []dto.CooperationApplication
// for i := range resultApplications.Gride.List {
// item := dto.ToCooperationApplication(&resultApplications.Gride.List[i])
// dataList = append(dataList, *item)
// }
return resultApplications, nil
}
... ...
... ... @@ -6,6 +6,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -19,9 +20,9 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
var images []allied_creation_cooperation.ProjectAttachment
var images []domain.Attachment
for _, v := range createCooperationProjectCommand.Images {
images = append(images, allied_creation_cooperation.ProjectAttachment{
images = append(images, domain.Attachment{
Url: v,
})
}
... ... @@ -61,12 +62,12 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command
return dto.ToCooperationProjectInfo(&result.CooperationProject), nil
}
// UpdateCooperationProject
// UpdateCooperationProject 更新项目
func (srv CooperationProjectService) UpdateCooperationProject(updateCooperationProjectCommand *command.UpdateCooperationProjectCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator)
var images []allied_creation_cooperation.ProjectAttachment
var images []domain.Attachment
for _, v := range updateCooperationProjectCommand.Images {
images = append(images, allied_creation_cooperation.ProjectAttachment{
images = append(images, domain.Attachment{
Url: v,
})
}
... ...
... ... @@ -3,6 +3,7 @@ package dto
import (
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -18,18 +19,13 @@ type CooperationApplicationItem struct {
DepartmentName string `json:"departmentName"` //申请人部门
Phone string `json:"userPhone"` //申请人电话
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []struct {
FileSize float64 `json:"fileSize"`
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
} `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //申请状态
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //申请状态
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
... ... @@ -38,7 +34,6 @@ type CooperationApplicationItem struct {
func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {
data := CooperationApplicationItem{
CooperationApplicationAttachment: param.CooperationApplicationAttachment,
CooperationApplicationDescription: param.CooperationApplicationDescription,
CooperationApplicationID: param.CooperationApplicationID,
... ... @@ -74,18 +69,13 @@ type CooperationApplicationInfo struct {
DepartmentName string `json:"departmentName"` //申请人部门
Phone string `json:"userPhone"` //申请人电话
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []struct {
FileSize float64 `json:"fileSize"`
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
} `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //申请状态
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //id
IsCanceled bool `json:"isCanceled"` //是否取消
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //申请状态
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
... ...
... ... @@ -3,6 +3,7 @@ package dto
import (
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -21,13 +22,13 @@ type CooperationProjectInfo struct {
CooperationModeName string `json:"cooperationModeName"`
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []allied_creation_cooperation.ProjectAttachment `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"`
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"`
CooperationProjectSponsor struct {
UsersId int `json:"userId"`
UsersName string `json:"userName"`
... ... @@ -46,7 +47,6 @@ type CooperationProjectInfo struct {
DepartmentName string `json:"departmentName"`
} `json:"department"` //项目发起部门
Status int `json:"status"` // 共创项目状态,1招标中,2结束
}
func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProject) *CooperationProjectInfo {
... ... @@ -100,16 +100,11 @@ type CooperationApplicationItem struct {
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"cooperationApplicationApplicant"` //申请人
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //申请id
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //状态
CooperationApplyTime int `json:"cooperationApplyTime"` //申请时间
CooperationApplicationAttachment []struct {
FileSize float64 `json:"fileSize"`
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
} `json:"cooperationApplicationAttachment"` //附件
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
CooperationApplicationID int `json:"cooperationApplicationId"` //申请id
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //状态
CooperationApplyTime int `json:"cooperationApplyTime"` //申请时间
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件
}
func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {
... ...
... ... @@ -7,6 +7,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationProject/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -21,9 +22,9 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
var images []allied_creation_cooperation.ProjectAttachment
var images []domain.Attachment
for _, v := range createCooperationProjectCommand.Images {
images = append(images, allied_creation_cooperation.ProjectAttachment{
images = append(images, domain.Attachment{
Url: v,
})
}
... ... @@ -133,9 +134,9 @@ func (cooperationProjectService *CooperationProjectService) UpdateCooperationPro
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator)
var images []allied_creation_cooperation.ProjectAttachment
var images []domain.Attachment
for _, v := range updateCooperationProjectCommand.Images {
images = append(images, allied_creation_cooperation.ProjectAttachment{
images = append(images, domain.Attachment{
Url: v,
})
}
... ...
package domain
//TODO 移除文件
//Dictionary 字典
type Dictionary struct {
// 字典编号 主键
... ...
package domain
//TODO 移除文件
//DictionaryItem 字典明细项
type DictionaryItem struct {
// 项编码
... ...
... ... @@ -39,15 +39,10 @@ type CooperationApplication struct {
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []struct {
FileSize float64 `json:"fileSize"`
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
} `json:"cooperationApplicationAttachment"`
CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
CooperationApplicationID int `json:"cooperationApplicationId"`
CooperationApplicationStatus int `json:"cooperationApplicationStatus"`
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"`
CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
CooperationApplicationID int `json:"cooperationApplicationId"`
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationVerifier struct {
Company struct {
CompanyID int `json:"companyId"`
... ...
package allied_creation_cooperation
import "time"
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"time"
)
type ProjectAttachment struct {
FileType string `json:"fileType"`
... ... @@ -24,7 +27,7 @@ type CooperationProject struct {
CooperationModeNumber string `json:"cooperationModeNumber"`
} `json:"cooperationMode"` //项目模式
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []ProjectAttachment `json:"attachment"`
Attachment []domain.Attachment `json:"attachment"`
CooperationProjectId int `json:"cooperationProjectId,string,"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
... ... @@ -67,7 +70,7 @@ type (
SponsorUid int `json:"sponsorUid,string"`
DepartmentId int `json:"departmentId,string"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerTypes"`
Attachment []ProjectAttachment `json:"attachment"`
Attachment []domain.Attachment `json:"attachment"`
}
DataCooperationProjectAdd struct {
... ... @@ -111,7 +114,7 @@ type (
PublisherUid string `json:"publisherUid"`
// 共创项目描述
CooperationProjectDescription string `json:"cooperationProjectDescription"`
Attachment []ProjectAttachment `json:"attachment"`
Attachment []domain.Attachment `json:"attachment"`
}
DataCooperationProjectUpdate struct {
... ...