作者 tangxuhui

细节调整

... ... @@ -100,5 +100,5 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm
}
// var dataList []dto.CooperationProjectItem
//TODO 数据填充
return int(result.Total), result.CooperationProjects, nil
return int(result.Total), result.List, nil
}
... ...
... ... @@ -11,8 +11,8 @@ type AuditCooperationApplicationCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 共创申请ID
CooperationApplicationId []int `json:"cooperationApplicationId,string" valid:"Required"`
// 共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationId []string `json:"cooperationApplicationId" valid:"Required"`
// 审核动作,1同意,2拒绝
CooperationApplicationStatus int `json:"cooperationApplicationStatus" valid:"Required"`
// 共创申请审核描述
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription" valid:"Required"`
... ...
... ... @@ -20,24 +20,13 @@ func (cooperationApplicationService *CooperationApplicationService) AuditCoopera
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
auditCooperationApplicationCommand.Operator)
if auditCooperationApplicationCommand.CooperationApplicationStatus == 2 {
_, err := creationCooperationGateway.CooperationApplicationsAgree(allied_creation_cooperation.ReqCooperationApplicationAgree{
CooperationApplicationId: auditCooperationApplicationCommand.CooperationApplicationId,
CooperationApplicationVerifyDescription: auditCooperationApplicationCommand.CooperationApplicationVerifyDescription,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
} else if auditCooperationApplicationCommand.CooperationApplicationStatus == 3 {
_, err := creationCooperationGateway.CooperationApplicationReject(allied_creation_cooperation.ReqCooperationApplicationReject{
CooperationApplicationId: auditCooperationApplicationCommand.CooperationApplicationId,
CooperationApplicationVerifyDescription: auditCooperationApplicationCommand.CooperationApplicationVerifyDescription,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
} else {
return nil, application.ThrowError(application.TRANSACTION_ERROR, "status 参数错误")
_, err := creationCooperationGateway.CooperationApplicationsBatchApproval(allied_creation_cooperation.ReqCooperationApplicationBatchApproval{
CooperationApplicationIds: auditCooperationApplicationCommand.CooperationApplicationId,
CooperationApplicationDescription: auditCooperationApplicationCommand.CooperationApplicationVerifyDescription,
Action: auditCooperationApplicationCommand.CooperationApplicationStatus,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return auditCooperationApplicationCommand, nil
... ...
... ... @@ -11,7 +11,7 @@ type RemoveCooperationModeCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 共创模式ID
CooperationModeId int `json:"cooperationModeId,string" valid:"Required"`
CooperationModeId []string `json:"cooperationModeId" valid:"Required"`
}
func (removeCooperationModeCommand *RemoveCooperationModeCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -99,10 +99,9 @@ func (cooperationModeService *CooperationModeService) RemoveCooperationMode(remo
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeCooperationModeCommand.Operator)
_, err := creationCooperationGateway.CooperationModeRemove(allied_creation_cooperation.ReqCooperationModeRemove{
CooperationModeId: removeCooperationModeCommand.CooperationModeId,
_, err := creationCooperationGateway.CooperationModeBatchRemove(allied_creation_cooperation.ReqCooperationModeBatchRemove{
CooperationModeIds: removeCooperationModeCommand.CooperationModeId,
})
//TODO 改为批量删除
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
... ...
package dto
import (
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type CooperationProjectInfo struct {
Company struct {
CompanyId int `json:"companyId,string,"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"` //项目归属企业
Org struct {
OrgId int `json:"orgId"`
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 []struct {
FileType string `json:"fileType"`
Name string `json:"name"`
Url string `json:"url"`
FileSize int `json:"fileSize"`
} `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:"usersId"`
UsersName string `json:"usersName"`
UsersCode string `json:"usersCode"`
UserInfo struct {
UsersName string `json:"usersName"`
UsersCode string `json:"usersCode"`
Phone string `json:"phone"`
UsersId int `json:"userId,string,"`
} `json:"userInfo"`
} `json:"cooperationProjectSponsor"` //项目发起人
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"` //共创合约承接对象,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结束
}
func ToCooperationProjectInfo(param *allied_creation_cooperation.CooperationProject) *CooperationProjectInfo {
data := CooperationProjectInfo{
Company: param.Company,
Org: param.Org,
CooperationMode: param.CooperationMode,
CooperationProjectDescription: param.CooperationProjectDescription,
Attachment: param.Attachment,
CooperationProjectId: param.CooperationProjectId,
CooperationProjectName: param.CooperationProjectName,
CooperationProjectNumber: param.CooperationProjectNumber,
CooperationProjectPublishTime: param.CooperationProjectPublishTime,
CreatedAt: param.CreatedAt,
CooperationProjectUndertakerType: param.CooperationProjectUndertakerType,
Department: param.Department,
Status: param.Status,
}
data.CooperationProjectSponsor.UsersCode = param.CooperationProjectSponsor.UserInfo.UsersCode
data.CooperationProjectSponsor.UsersName = param.CooperationProjectSponsor.UserInfo.UsersName
data.CooperationProjectSponsor.UsersId = param.CooperationProjectSponsor.UsersId
data.CooperationProjectSponsor.UserInfo = param.CooperationProjectSponsor.UserInfo
return &data
}
type CooperationApplication struct {
CooperationApplicationApplicant struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
} `json:"department"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `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"` //附件
}
func ToCooperationApplication(param *allied_creation_cooperation.CooperationApplication) *CooperationApplication {
data := CooperationApplication{
CooperationApplicationApplicant: param.CooperationApplicationApplicant,
CooperationApplicationDescription: param.CooperationApplicationDescription,
CooperationApplicationID: param.CooperationApplicationID,
CooperationApplicationStatus: param.CooperationApplicationStatus,
CooperationApplyTime: int(param.CooperationApplyTime.Unix()),
CooperationApplicationAttachment: param.CooperationApplicationAttachment,
}
return &data
}
... ...
... ... @@ -5,6 +5,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"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/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -57,13 +58,32 @@ func (cooperationProjectService *CooperationProjectService) GetCooperationProjec
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(getCooperationProjectQuery.Operator)
result, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
resultProject, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
CooperationProjectId: getCooperationProjectQuery.CooperationProjectId,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
resultApplication, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
CooperationProjectNumber: resultProject.CooperationProject.CooperationProjectNumber,
PageNumber: 0,
PageSize: 0,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
var (
applications []dto.CooperationApplication
)
for i := range resultApplication.Gride.List {
item := dto.ToCooperationApplication(&resultApplication.Gride.List[i])
applications = append(applications, *item)
}
data := map[string]interface{}{
"cooperationProject": dto.ToCooperationProjectInfo(&resultProject.CooperationProject),
"application": applications,
}
return data, nil
}
// 返回共创项目管理列表
... ... @@ -83,7 +103,15 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result.Total, result.CooperationProjects, nil
var (
dataList = []dto.CooperationProjectInfo{}
)
for i := range result.List {
item := dto.ToCooperationProjectInfo(&result.List[i])
dataList = append(dataList, *item)
}
return result.Total, dataList, nil
}
// 更新共创项目管理
... ...
... ... @@ -41,31 +41,31 @@ func (gateway HttplibAlliedCreationCooperation) CooperationApplicationUpdaet(par
return &data, err
}
// CooperationApplicationsBatchApproval 共创申请一键审核
// CooperationApplicationsBatchApproval 共创申请批量审核
func (gateway HttplibAlliedCreationCooperation) CooperationApplicationsBatchApproval(param ReqCooperationApplicationBatchApproval) (*DataCooperationApplicationBatchApproval, error) {
url := gateway.baseUrL + "/cooperation-applications/batch-approval"
method := "POST"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:共创申请一键审核。", map[string]interface{}{
log.Logger.Debug("向业务模块请求数据:共创申请批量审核。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求共创申请一键审核失败:%w", err)
return nil, fmt.Errorf("请求共创申请批量审核失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取共创申请一键审核失败:%w", err)
return nil, fmt.Errorf("获取共创申请批量审核失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:共创申请一键审核。", map[string]interface{}{
log.Logger.Debug("获取业务模块请求数据:共创申请批量审核。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析共创申请一键审核:%w", err)
return nil, fmt.Errorf("解析共创申请批量审核:%w", err)
}
var data DataCooperationApplicationBatchApproval
err = gateway.GetResponseData(result, &data)
... ... @@ -350,3 +350,34 @@ func (gateway HttplibAlliedCreationCooperation) CooperationApplicationGet(param
err = gateway.GetResponseData(result, &data)
return &data, err
}
// CooperationApplicationsBatchApproval 共创申请一键审核
func (gateway HttplibAlliedCreationCooperation) CooperationApplicationsOneclickApproval(param ReqCooperationApplicationOneclickApproval) (*DataCooperationApplicationOneclickApproval, error) {
url := gateway.baseUrL + "/cooperation-applications/oneclick-approval"
method := "POST"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:共创申请批量审核。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求共创申请批量审核失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取共创申请批量审核失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:共创申请批量审核。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析共创申请批量审核:%w", err)
}
var data DataCooperationApplicationOneclickApproval
err = gateway.GetResponseData(result, &data)
return &data, err
}
... ...
... ... @@ -195,3 +195,34 @@ func (gateway HttplibAlliedCreationCooperation) CooperationModesSearch(param Req
err = gateway.GetResponseData(result, &data)
return &data, err
}
//CooperationModeBatchRemove 批量移除共创模式
func (gateway HttplibAlliedCreationCooperation) CooperationModeBatchRemove(param ReqCooperationModeBatchRemove) (*DataCooperationModeBatchRemove, error) {
url := gateway.baseUrL + "/cooperation-modes/batch-remove"
method := "post"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向业务模块请求数据:移除共创模式。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
})
req, err := req.JSONBody(param)
if err != nil {
return nil, fmt.Errorf("请求移除共创模式失败:%w", err)
}
byteResult, err := req.Bytes()
if err != nil {
return nil, fmt.Errorf("获取移除共创模式失败:%w", err)
}
log.Logger.Debug("获取业务模块请求数据:移除共创模式。", map[string]interface{}{
"result": string(byteResult),
})
var result service_gateway.GatewayResponse
err = json.Unmarshal(byteResult, &result)
if err != nil {
return nil, fmt.Errorf("解析移除共创模式:%w", err)
}
var data DataCooperationModeBatchRemove
err = gateway.GetResponseData(result, &data)
return &data, err
}
... ...
... ... @@ -7,6 +7,145 @@ import (
)
//共创实体
type CooperationApplication struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
CooperationApplicationApplicant struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
} `json:"department"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `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"`
CooperationApplicationVerifier struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
IsOrganization bool `json:"isOrganization"`
} `json:"department"`
Org struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"cooperationApplicationVerifier"`
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"`
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"`
CooperationApplyTime time.Time `json:"cooperationApplyTime"`
CooperationProject struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
CooperationProjectDescription string `json:"cooperationProjectDescription"`
CooperationProjectID int `json:"cooperationProjectId"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationProjectPublishTime string `json:"cooperationProjectPublishTime"`
CooperationProjectSponsor struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
IsOrganization bool `json:"isOrganization"`
} `json:"department"`
Org struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
Status int `json:"status"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"cooperationProjectSponsor"`
CooperationProjectUndertakerType []int `json:"cooperationProjectUndertakerType"`
CreatedAt string `json:"createdAt"`
DeletedAt string `json:"deletedAt"`
OperateTime string `json:"operateTime"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
Status int `json:"status"`
UpdatedAt string `json:"updatedAt"`
} `json:"cooperationProject"`
CreatedAt string `json:"createdAt"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
IsCanceled bool `json:"isCanceled"`
UpdatedAt string `json:"updatedAt"`
}
//更新共创申请
type (
... ... @@ -18,9 +157,12 @@ type (
}
)
//共创申请一键审核
//共创申请批量审核
type (
ReqCooperationApplicationBatchApproval struct {
CooperationApplicationIds []string `json:"cooperationApplicationIds"`
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述
Action int `json:"action"` //审核动作,1同意,2拒绝
}
DataCooperationApplicationBatchApproval struct {
... ... @@ -30,7 +172,7 @@ type (
//取消共创申请
type (
ReqCooperationApplicationCancel struct {
ApplicationId int
ApplicationId int `json:"applicationId"`
}
DataCooperationApplicationCancel struct {
... ... @@ -40,7 +182,7 @@ type (
//审核-同意共创申请
type (
ReqCooperationApplicationAgree struct {
CooperationApplicationId []int `json:"cooperationApplicationId"`
CooperationApplicationId int `json:"cooperationApplicationId"`
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"`
}
... ... @@ -51,7 +193,7 @@ type (
//审核-拒绝共创申请
type (
ReqCooperationApplicationReject struct {
CooperationApplicationId []int `json:"cooperationApplicationId"`
CooperationApplicationId int `json:"cooperationApplicationId"`
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"`
}
... ... @@ -83,72 +225,16 @@ type (
ApplicantName string `json:"applicantName"` //申请人姓名
CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationProjectName string `json:"cooperationProjectName"` //共创项目名称
CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创项目编号
PageNumber int `json:"pageNumber"`
PageSize int `json:"pageSize"`
}
DataCooperationApplicationSearch struct {
Gride struct {
Total int
List []struct {
//公司
Company struct {
CompanyID int `json:"companyId"`
CompanyName string `json:"companyName"`
} `json:"company"`
//申请人
CooperationApplicationApplicant struct {
//申请人部门
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
} `json:"department"`
//申请人组织
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"cooperationApplicationApplicant"`
//附件信息
CooperationApplicationAttachment []struct {
FileSize int `json:"fileSize"`
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
} `json:"cooperationApplicationAttachment"`
//申请描述
CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
//id
CooperationApplicationID int `json:"cooperationApplicationId"`
//申请单状态 ,共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationStatus int `json:"cooperationApplicationStatus"`
//是否已取消
IsCanceled bool `json:"isCanceled"`
//描述
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"`
//审核时间
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"`
//申请时间
CooperationApplyTime time.Time `json:"cooperationApplyTime"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UpdatedAt time.Time `json:"updatedAt"`
CreatedAt time.Time `json:"createdAt"`
} `json:"list"`
}
Total int `json:"total"`
List []CooperationApplication `json:"list"`
} `json:"gride"`
}
)
... ... @@ -187,135 +273,17 @@ type (
}
DataCooperationApplicationGet struct {
Company struct {
CompanyID float64 `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
//申请人
CooperationApplicationApplicant struct {
Department struct {
DepartmentID float64 `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
IsOrganization bool `json:"isOrganization"`
} `json:"department"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType float64 `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 float64 `json:"cooperationApplicationId"`
CooperationApplicationStatus float64 `json:"cooperationApplicationStatus"`
//审核人
CooperationApplicationVerifier struct {
Department struct {
DepartmentID float64 `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
IsOrganization bool `json:"isOrganization"`
} `json:"department"`
Org struct {
OrgID float64 `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID float64 `json:"userBaseId"`
UserID float64 `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType float64 `json:"userType"`
} `json:"cooperationApplicationVerifier"`
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"`
//审核时间
CooperationApplicationVerifyTime string `json:"cooperationApplicationVerifyTime"`
// 共创申请时间
CooperationApplyTime string `json:"cooperationApplyTime"`
CreatedAt string `json:"createdAt"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UpdatedAt string `json:"updatedAt"`
//共创项目
CooperationProject struct {
CooperationProjectDescription string `json:"cooperationProjectDescription"`
CooperationProjectID float64 `json:"cooperationProjectId"`
CooperationProjectName string `json:"cooperationProjectName"`
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationProjectPublishTime string `json:"cooperationProjectPublishTime"`
CooperationProjectPublisher struct {
Department struct {
DepartmentID float64 `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
} `json:"department"`
Org struct {
OrgID float64 `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID float64 `json:"userBaseId"`
UserID float64 `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType float64 `json:"userType"`
} `json:"cooperationProjectPublisher"`
//项目发起人
CooperationProjectSponsor struct {
Department struct {
DepartmentID float64 `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
} `json:"department"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType float64 `json:"userType"`
} `json:"cooperationProjectSponsor"`
CooperationProjectUndertakerType []float64 `json:"cooperationProjectUndertakerType"`
CreatedAt time.Time `json:"createdAt"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
Status float64 `json:"status"`
} `json:"cooperationProject"`
CooperationApplication
}
)
//共创申请一键审核
type (
ReqCooperationApplicationOneclickApproval struct {
CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //审核描述
Action int `json:"action"` //审核动作,1同意,2拒绝
}
DataCooperationApplicationOneclickApproval struct {
}
)
... ...
... ... @@ -127,13 +127,23 @@ type (
//移除共创模式
type (
ReqCooperationModeRemove struct {
CooperationModeId int `json:"cooperationModeId"`
CooperationModeId int `json:"cooperationModeId,string"`
}
DataCooperationModeRemove struct {
}
)
//批量移除共创模式
type (
ReqCooperationModeBatchRemove struct {
CooperationModeIds []string `json:"cooperationModeIds"`
}
DataCooperationModeBatchRemove struct {
}
)
//查询共创模式
type (
ReqCooperationModesSearch struct {
... ...
... ... @@ -53,7 +53,7 @@ type CooperationProject struct {
DepartmentId int `json:"departmentId,string,"`
DepartmentName string `json:"departmentName"`
} `json:"department"` //项目发起部门
Status int `json:"status"`
Status int `json:"status"` // 共创项目状态,1招标中,2结束
}
//创建共创项目
... ... @@ -118,7 +118,7 @@ type (
//移除共创项目
type (
ReqCooperationProjectRemove struct {
CooperationProjectID int
CooperationProjectID int `json:"cooperationProjectId"`
}
DataCooperationProjectRemove struct {
... ... @@ -148,8 +148,8 @@ type (
}
DataCooperationProjectSearch struct {
Total int64 `json:"total"`
CooperationProjects []CooperationProject `json:"cooperationProjects"`
Total int64 `json:"total"`
List []CooperationProject `json:"cooperationProjects"`
}
)
... ...
... ... @@ -50,9 +50,12 @@ func (controller *CooperationModeController) GetCooperationMode() {
func (controller *CooperationModeController) RemoveCooperationMode() {
cooperationModeService := service.NewCooperationModeService(nil)
removeCooperationModeCommand := &command.RemoveCooperationModeCommand{}
modeId, _ := controller.GetInt(":modeId")
err := controller.Unmarshal(removeCooperationModeCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
removeCooperationModeCommand.Operator = controller.GetOperator()
removeCooperationModeCommand.CooperationModeId = modeId
data, err := cooperationModeService.RemoveCooperationMode(removeCooperationModeCommand)
controller.Response(data, err)
}
... ...
... ... @@ -9,6 +9,6 @@ func init() {
web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Post:CreateCooperationMode")
web.Router("/v1/web/cooperation-modes/:modeId", &web_client.CooperationModeController{}, "Put:UpdateCooperationMode")
web.Router("/v1/web/cooperation-modes/:modeId", &web_client.CooperationModeController{}, "Get:GetCooperationMode")
web.Router("/v1/web/cooperation-modes/:modeId", &web_client.CooperationModeController{}, "Delete:RemoveCooperationMode")
web.Router("/v1/web/cooperation-modes/remove", &web_client.CooperationModeController{}, "Post:RemoveCooperationMode")
web.Router("/v1/web/cooperation-modes/search", &web_client.CooperationModeController{}, "Post:ListCooperationMode")
}
... ...