import com.dderp.common.api.NoSqlKeysService import com.dderp.common.datas.ESKeys import com.dySweetFishPlugin.elasticsearch.ESClient import com.sweetfish.util.Utility static def createRunnable(ESClient esClient, NoSqlKeysService keysService, long supplierCode) { return { esClient.checkIndexEx(keysService.getESKey(ESKeys.ES_ERP_PRINTBILL_INDEX, supplierCode) + "_current", ESKeys.INDEX_CONFIG, Utility.ofMap(ESKeys.ES_ERP_PRINTBILL_TYPE, "printBill.json", ESKeys.ES_ERP_PRINTBILL_BREED_TYPE, "printBillBreed.json", ESKeys.ES_ERP_PRINTBILL_LIFECYCLE_TYPE, "printBillLifeCycle.json", ESKeys.ES_ERP_PRINT_BREED_PART_TYPE, "printBreedPart.json", ESKeys.ES_ERP_MACHINE_BREED_TASK_TYPE, "machineBreedTask.json")) esClient.checkIndexEx(keysService.getESKey(ESKeys.ES_ERP_PRINTBILL_STEP_INDEX, supplierCode) + "_current", ESKeys.INDEX_CONFIG, Utility.ofMap(ESKeys.ES_ERP_PRINTBILL_STEP_TYPE, "printBillStep.json")) } as Runnable } //groovy最后一个表达式的值为返回 createRunnable(esClient, keysService, supplierCode)