作者 陈志颖

fix:修复返回参数问题

... ... @@ -101,6 +101,7 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea
FeedbackContent: createContractUndertakerFeedbackCommand.FeedbackContent,
CooperationContractNumber: createContractUndertakerFeedbackCommand.CooperationContractNumber,
CooperationContractName: cooperationContract.CooperationContractName,
CooperationModeName: cooperationContract.CooperationMode.CooperationModeName,
ContractUndertaker: undertaker,
Company: company,
Org: organization,
... ...
... ... @@ -121,9 +121,17 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
organization = data
}
// 部门REST服务初始化
var departmentService service.DepartmentService
if value, err := factory.CreateDepartmentService(map[string]interface{}{}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
departmentService = value
}
// 获取部门信息
var department *domain.Org
if data, err := organizationService.OrgFrom(createCooperationProjectCommand.CompanyId, createCooperationProjectCommand.DepartmentId); err != nil {
var department *domain.Department
if data, err := departmentService.DepartmentFrom(createCooperationProjectCommand.CompanyId, createCooperationProjectCommand.DepartmentId); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取部门信息失败")
} else {
department = data
... ... @@ -179,7 +187,7 @@ func (cooperationProjectService *CooperationProjectService) CreateCooperationPro
CooperationProjectPublishTime: time.Now(),
Attachment: createCooperationProjectCommand.Attachment,
Company: company,
Department: department.ToDepartment(),
Department: department,
Org: organization,
Operator: operator,
OperateTime: time.Now(),
... ... @@ -377,13 +385,13 @@ func (cooperationProjectService *CooperationProjectService) RemoveCooperationPro
if cooperationProject == nil {
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(removeCooperationProjectCommand.CooperationProjectId, 10)))
}
if cooperationProject, err := cooperationProjectRepository.Remove(cooperationProject); err != nil {
if cooperationProjectRemoved, err := cooperationProjectRepository.Remove(cooperationProject); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return cooperationProject, nil
return cooperationProjectRemoved, nil
}
}
... ... @@ -417,10 +425,8 @@ func (cooperationProjectService *CooperationProjectService) SearchCooperationPro
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return map[string]interface{}{
//"grid": map[string]interface{}{
"total": count,
"list": cooperationProjects,
//},
}, nil
}
}
... ... @@ -507,13 +513,13 @@ func (cooperationProjectService *CooperationProjectService) EndCooperationProjec
if err := cooperationProject.Update(tool_funs.SimpleStructToMap(updateCooperationProjectCommand)); err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
if cooperationProject, err := cooperationProjectRepository.Save(cooperationProject); err != nil {
if cooperationProjectSaved, err := cooperationProjectRepository.Save(cooperationProject); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return cooperationProject, nil
return cooperationProjectSaved, nil
}
}
... ...
... ... @@ -34,7 +34,7 @@ type CreateDividendsOrderCommand struct {
// 订单时间
OrderTime string `cname:"订单时间" json:"orderTime" valid:"Required"`
// 备注
Remarks string `cname:"备注" json:"remarks" valid:"Required"`
Remarks string `cname:"备注" json:"remarks,omitempty"`
// 订单区域名称
RegionName string `cname:"订单区域名称" json:"regionName,omitempty"`
// 订单操作人uid
... ...
... ... @@ -14,6 +14,8 @@ type ContractUndertakerFeedback struct {
CooperationContractNumber string `json:"cooperationContractNumber"`
// 项目合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式名称
CooperationModeName string `json:"cooperationModeName"`
// 共创合约承接人
ContractUndertaker *Undertaker `json:"contractUndertaker"`
// 数据所属组织机构
... ...
... ... @@ -12,4 +12,6 @@ type UserInfo struct {
UserPhone string `json:"userPhone"`
// 用户账号,区别于手机号,冗余字段
UserAccount string `json:"userAccount"`
// 用户编码
UserCode string `json:"用户编码"`
}
... ...
... ... @@ -207,6 +207,7 @@ func (translator *UserTranslator) ToUndertakerFromRepresentation(user *UserDetai
UserName: user.UserInfo.UserName,
UserPhone: user.UserInfo.Phone,
UserAccount: "",
UserCode: user.UserCode,
},
UserType: user.UserType,
UserName: user.UserInfo.UserName,
... ...