作者 yangfu

共创申请修改

... ... @@ -3,7 +3,6 @@ package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -42,16 +41,17 @@ func (cooperationApplicationService *CooperationApplicationService) GetCooperati
applicationResult, err := creationCooperationGateway.CooperationApplicationGet(allied_creation_cooperation.ReqCooperationApplicationGet{
CooperationApplicationId: getCooperationApplicationQuery.CooperationApplicationId,
})
//if err != nil {
// return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
//}
//objectResult, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
// CooperationProjectId: applicationResult.CooperationProject.CooperationProjectID,
//})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
objectResult, err := creationCooperationGateway.CooperationProjectGet(allied_creation_cooperation.ReqCooperationProjectGet{
CooperationProjectId: applicationResult.CooperationProject.CooperationProjectID,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return dto.ToCooperationApplicationInfo(&applicationResult.CooperationApplication, &objectResult.CooperationProject), nil
//return dto.ToCooperationApplicationInfo(&applicationResult.CooperationApplication, &objectResult.CooperationProject), nil
return applicationResult, nil
}
// 返回共创申请管理列表
... ...
package dto
import (
"strconv"
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
... ... @@ -91,25 +92,26 @@ type CooperationApplicationItem struct {
}
func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {
//data := CooperationApplicationItem{
// CooperationApplicationDescription: param.CooperationApplicationDescription,
// CooperationApplicationID: param.CooperationApplicationID,
// CooperationApplicationStatus: param.CooperationApplicationStatus,
// CooperationApplyTime: int(param.CooperationApplyTime.Unix()),
// CooperationApplicationAttachment: param.CooperationApplicationAttachment,
//}
//data.CooperationApplicationApplicant.Company.CompanyID = param.CooperationApplicationApplicant.Company.CompanyID
//data.CooperationApplicationApplicant.Company.CompanyName = param.CooperationApplicationApplicant.Company.CompanyName
//data.CooperationApplicationApplicant.Department.DepartmentId = param.CooperationApplicationApplicant.Department.DepartmentID
//data.CooperationApplicationApplicant.Department.DepartmentName = param.CooperationApplicationApplicant.Department.DepartmentName
applicationID, _ := strconv.Atoi(param.CooperationApplicationID)
data := CooperationApplicationItem{
CooperationApplicationDescription: param.CooperationApplicationDescription,
CooperationApplicationID: applicationID,
CooperationApplicationStatus: param.CooperationApplicationStatus,
CooperationApplyTime: int(param.CooperationApplyTime),
CooperationApplicationAttachment: param.CooperationApplicationAttachment,
}
data.CooperationApplicationApplicant.Company.CompanyID = param.Company.CompanyID
data.CooperationApplicationApplicant.Company.CompanyName = param.Company.CompanyName
data.CooperationApplicationApplicant.Department.DepartmentId = int(param.CooperationApplicationApplicant.Department.DepartmentId)
data.CooperationApplicationApplicant.Department.DepartmentName = param.CooperationApplicationApplicant.Department.DepartmentName
//data.CooperationApplicationApplicant.Department.DepartmentNumber = param.CooperationApplicationApplicant.Department.DepartmentNumber
//data.CooperationApplicationApplicant.Org.OrgID = param.CooperationApplicationApplicant.Org.OrgID
//data.CooperationApplicationApplicant.Org.OrgName = param.CooperationApplicationApplicant.Org.OrgName
//data.CooperationApplicationApplicant.UserID = param.CooperationApplicationApplicant.UserID
//data.CooperationApplicationApplicant.UserType = param.CooperationApplicationApplicant.UserType
//data.CooperationApplicationApplicant.UserInfo.Phone = param.CooperationApplicationApplicant.UserInfo.UserPhone
//data.CooperationApplicationApplicant.UserInfo.UsersName = param.CooperationApplicationApplicant.UserInfo.UserName
//data.CooperationApplicationApplicant.UserInfo.UsersId = param.CooperationApplicationApplicant.UserID
//return &data
return nil
data.CooperationApplicationApplicant.Org.OrgID = param.Org.OrgID
data.CooperationApplicationApplicant.Org.OrgName = param.Org.OrgName
data.CooperationApplicationApplicant.UserID = param.CooperationApplicationApplicant.UserID
//data.CooperationApplicationApplicant.UserType = param.CooperationApplicationApplicant.
data.CooperationApplicationApplicant.UserInfo.Phone = param.CooperationApplicationApplicant.UserInfo.UserPhone
data.CooperationApplicationApplicant.UserInfo.UsersName = param.CooperationApplicationApplicant.UserInfo.UserName
data.CooperationApplicationApplicant.UserInfo.UsersId = param.CooperationApplicationApplicant.UserID
return &data
//return nil
}
... ...
... ... @@ -16,16 +16,16 @@ type CooperationApplication struct {
UserPhone string `json:"userPhone"`
UserAccount string `json:"userAccount"`
} `json:"userInfo"`
Department interface{} `json:"department"`
Department struct {
// 部门ID,通过REST集成上下文获取
DepartmentId int64 `json:"departmentId"`
// 部门名称
DepartmentName string `json:"departmentName"`
} `json:"department"`
} `json:"cooperationApplicationApplicant"`
CooperationApplicationAttachment []struct {
FileType string `json:"fileType"`
Name string `json:"name"`
URL string `json:"url"`
FileSize string `json:"fileSize"`
} `json:"cooperationApplicationAttachment"`
CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
CooperationApplicationStatus int `json:"cooperationApplicationStatus"`
CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"`
CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
CooperationApplicationStatus int `json:"cooperationApplicationStatus"`
CooperationApplicationVerifier struct {
UserID int `json:"userId"`
Department interface{} `json:"department"`
... ...