...
|
...
|
@@ -24,16 +24,23 @@ func (srv CooperationApplicationsService) GetCooperationApplications(application |
|
|
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())
|
|
|
//}
|
|
|
|
|
|
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())
|
|
|
}
|
|
|
//data := map[string]interface{}{
|
|
|
// "cooperationApplication": dto.ToCooperationApplication(&resultApplication.CooperationApplication),
|
|
|
// "cooperationProject": dto.ToCooperationProjectInfo(&resultProject.CooperationProject),
|
|
|
//}
|
|
|
resultApplication.CooperationProject.CooperationMode.CooperationModeNumber = resultProject.CooperationMode.CooperationModeNumber
|
|
|
resultApplication.CooperationProject.CooperationMode.CooperationModeName = resultProject.CooperationMode.CooperationModeName
|
|
|
resultApplication.CooperationProject.CooperationMode.CooperationModeId = resultProject.CooperationMode.CooperationModeId
|
|
|
return resultApplication, nil
|
|
|
}
|
|
|
|
...
|
...
|
@@ -41,15 +48,16 @@ func (srv CooperationApplicationsService) GetCooperationApplications(application |
|
|
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,
|
|
|
//applicationIds := []string{strconv.Itoa(auditCommand.CooperationApplicationId)}
|
|
|
//for _, v := range auditCommand.CooperationApplicationId {
|
|
|
// idStr := strconv.Itoa(v)
|
|
|
// applicationIds = append(applicationIds, idStr)
|
|
|
//}
|
|
|
_, err := creationCooperationGateway.CooperationApplicationsApproval(allied_creation_cooperation.ReqCooperationApplicationApproval{
|
|
|
CooperationApplicationId: strconv.Itoa(auditCommand.CooperationApplicationId),
|
|
|
CooperationApplicationDescription: auditCommand.CooperationApplicationVerifyDescription,
|
|
|
Action: auditCommand.CooperationApplicationStatus,
|
|
|
Code: "a1-2",
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
...
|
...
|
|