作者 陈志颖

fix:共创申请取消功能参数调整

... ... @@ -9,7 +9,7 @@ import (
type CancelCooperationApplicationCommand struct {
// 共创申请ID
CooperationApplicationId int64 `cname:"共创申请ID" json:"cooperationApplicationId" valid:"Required"`
CooperationApplicationId string `cname:"共创申请ID" json:"cooperationApplicationId" valid:"Required"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId" valid:"Required"`
// 组织机构id
... ...
... ... @@ -602,6 +602,7 @@ func (cooperationApplicationService *CooperationApplicationService) CancelCooper
}()
//TODO 校验用户菜单模块权限
// 共创申请仓储初始化
var cooperationApplicationRepository domain.CooperationApplicationRepository
if value, err := factory.CreateCooperationApplicationRepository(map[string]interface{}{
"transactionContext": transactionContext,
... ... @@ -610,12 +611,16 @@ func (cooperationApplicationService *CooperationApplicationService) CancelCooper
} else {
cooperationApplicationRepository = value
}
cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": cancelCooperationApplicationCommand.CooperationApplicationId})
cooperationApplicationId, err := strconv.ParseInt(cancelCooperationApplicationCommand.CooperationApplicationId, 10, 64)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创申请ID错误")
}
cooperationApplication, err := cooperationApplicationRepository.FindOne(map[string]interface{}{"cooperationApplicationId": cooperationApplicationId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if cooperationApplication == nil {
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cancelCooperationApplicationCommand.CooperationApplicationId, 10)))
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(cooperationApplicationId, 10)))
}
if err := cooperationApplication.Update(map[string]interface{}{
"isCanceled": true,
... ...