|
...
|
...
|
@@ -209,10 +209,8 @@ func (cooperationModeService *CooperationModeService) ListCooperationMode(listCo |
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
|
}
|
|
|
|
return map[string]interface{}{
|
|
|
|
//"grid": map[string]interface{}{
|
|
|
|
"list": cooperationModes,
|
|
|
|
"total": count,
|
|
|
|
//},
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -330,10 +328,8 @@ func (cooperationModeService *CooperationModeService) SearchCooperationMode(sear |
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
|
}
|
|
|
|
return map[string]interface{}{
|
|
|
|
//"grid": map[string]interface{}{
|
|
|
|
"list": cooperationModes,
|
|
|
|
"total": count,
|
|
|
|
//},
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -361,6 +357,25 @@ func (cooperationModeService *CooperationModeService) UpdateCooperationMode(upda |
|
|
|
} else {
|
|
|
|
cooperationModeRepository = value
|
|
|
|
}
|
|
|
|
// 共创模式DAO初始化
|
|
|
|
var cooperationModeDao *dao.CooperationModeDao
|
|
|
|
if value, err := factory.CreateCooperationModeDao(map[string]interface{}{
|
|
|
|
"transactionContext": transactionContext,
|
|
|
|
}); err != nil {
|
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
|
} else {
|
|
|
|
cooperationModeDao = value
|
|
|
|
}
|
|
|
|
// 校验共创模式名称唯一性
|
|
|
|
nameAvailable, _ := cooperationModeDao.CheckModeNameAvailable(map[string]interface{}{
|
|
|
|
"companyId": updateCooperationModeCommand.CompanyId,
|
|
|
|
"orgId": updateCooperationModeCommand.OrgId,
|
|
|
|
"cooperationModeName": updateCooperationModeCommand.CooperationModeName,
|
|
|
|
})
|
|
|
|
if !nameAvailable {
|
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "模式名称已存在")
|
|
|
|
}
|
|
|
|
|
|
|
|
cooperationMode, err := cooperationModeRepository.FindOne(map[string]interface{}{"cooperationModeId": updateCooperationModeCommand.CooperationModeId})
|
|
|
|
if err != nil {
|
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
|