...
|
...
|
@@ -5,6 +5,7 @@ import ( |
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
"github.com/linmadan/egglib-go/utils/tool_funs"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationProject/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationProject/dto"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationProject/query"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/factory"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
|
...
|
...
|
@@ -119,13 +120,15 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro |
|
|
}
|
|
|
|
|
|
newCooperationProject := &domain.CooperationProject{
|
|
|
CooperationProjectNumber: "",
|
|
|
CooperationProjectNumber: createCooperationProjectCommand.CooperationModeNumber,
|
|
|
CooperationProjectName: createCooperationProjectCommand.CooperationProjectName,
|
|
|
CooperationProjectUndertakerTypes: createCooperationProjectCommand.CooperationProjectUndertakerTypes,
|
|
|
CooperationProjectSponsor: sponsor,
|
|
|
CooperationProjectPublisher: publisher,
|
|
|
CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription,
|
|
|
CooperationProjectPublishTime: time.Now(),
|
|
|
Company: company,
|
|
|
Department: organization.ToDepartment(),
|
|
|
Org: organization,
|
|
|
Operator: operator,
|
|
|
OperateTime: time.Now(),
|
...
|
...
|
@@ -215,13 +218,40 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje |
|
|
if count, cooperationProjects, err := cooperationProjectRepository.Find(tool_funs.SimpleStructToMap(listCooperationProjectQuery)); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
|
|
|
//var cooperationModeRepository domain.CooperationModeRepository
|
|
|
//if value, err := factory.CreateCooperationProjectRepository(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//}); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
//} else {
|
|
|
// cooperationProjectRepository = value
|
|
|
//}
|
|
|
//var modeMap = make(map[string]*domain.CooperationMode)
|
|
|
//if _, cooperationProjects, err := cooperationModeRepository.Find(map[string]interface{}{"companyId":listCooperationProjectQuery.CompanyId,"orgId":listCooperationProjectQuery.OrgId}); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
//}else{
|
|
|
// for i:=range cooperationProjects{
|
|
|
// p :=cooperationProjects[i]
|
|
|
// modeMap[p.CooperationModeNumber]=p
|
|
|
// }
|
|
|
//}
|
|
|
//
|
|
|
var res []*dto.CooperationProjectsDto
|
|
|
for i := range cooperationProjects {
|
|
|
p := cooperationProjects[i]
|
|
|
tp := &dto.CooperationProjectsDto{}
|
|
|
tp.LoadDto(p, &domain.CooperationMode{})
|
|
|
res = append(res, tp)
|
|
|
}
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return map[string]interface{}{
|
|
|
//"grid": map[string]interface{}{
|
|
|
"total": count,
|
|
|
"list": cooperationProjects,
|
|
|
"list": res,
|
|
|
//},
|
|
|
}, nil
|
|
|
}
|
...
|
...
|
|