我有一个已经在服务器上运行的grails系统,我们使用租户解决方案来区分公司的分支机构,但是现在我需要将信息从一个分支恢复到另一个分支。
关键是当我在模型中进行以下查询时:
def isThisFilial = true
vol.recoversExpedition().eachWithIndex { row, index ->
log.debug "* Id ${row.id} Code ${row.code} Clint {row.client}"
def expedition = Expedition.findByCodigo(row.codigo)
if(!expedition){
log.info "*expedition is in another subsidiary"
isThisFilial = false
expedition = Tenants.withoutId{Expedition.findByCode(row.code)}
}
}
如果我的探险是由分支机构发出的,那么此发现不会返回任何内容,毕竟这是分支机构不相互填充信息的初始架构。
我尝试使用Tenants.withoutId
函数,但是到我添加import grails.gorm.multitenancy.Tenants
时,这指向以下错误:
|错误编译错误:启动失败: D:\ GitHub \ wms \ wms \ grails-app \ domain \ wms \ Devolucao.groovy:6:无法 解析c lass grails.gorm.multitenancy.Tenants @第6行,第1列,
导入grails.gorm.multitenancy.Tenant ^1个错误
我不知道我是否必须在另一个区域中做一些注释或缺少什么,并且由于它不起作用,我将BuildConfig.groovy
放在这里:
plugins {
//build ":tomcat:7.0.52.1"
build ":tomcat:7.0.70"
runtime ":hibernate:3.6.10.9"
compile ':scaffolding:2.0.3'
runtime ":jquery:1.8.3"
compile ':cache:1.1.1'
runtime ':resources:1.2.8'
compile ":cache-headers:1.1.5"
runtime ":cached-resources:1.0"
runtime ":zipped-resources:1.0"
runtime ":yui-minify-resources:0.1.5"
// framework dependencies
compile ":mail:1.0.1"
compile ":fields:1.4"
compile ":runtime-logging:0.4"
compile ":burning-image:0.5.1"
compile ":twitter-bootstrap:2.3.2"
compile ":spring-security-core:2.0-RC4"
compile ":spring-security-rest:1.4.0.RC5", {
excludes: 'spring-security-core'
}
// multitenancy
compile ":multi-tenant-single-db:0.8.3"
// events to implement app hooks
compile ":platform-core:1.0.RC6"
// Para fazer upload de imagens
compile ":attachmentable:0.3.0"
// calendários para campos do tipo Date
compile ":calendar:1.2.1"
// exportar dados para Excel
compile ":excel-export:0.1.9", {
excludes: 'xerces'
}
// Jasper Reports
compile ":jasper:1.11.0"
// Export CSV
compile ":csv:0.3.1"
// Tests
test ":cucumber:0.6.2"
// Profiling
compile ":profiler:0.5"
//webservice SOAP
compile ":cxf:1.1.4"
compile ":cxf-client:2.0.3"
//cron job
compile ":quartz:1.0.2"
//http-builder
//compile ":rest:0.8"
//compile ":rest-client-builder:2.1.1"
//etiqueta AR
// compile ":barcode4j:0.3"
}