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 { //结转方式,es中只存储当期数据,历史完成数据均在数据库中查询 esClient.createIndex(keysService.getESKey(ESKeys.ES_ERP_PRINT_ORDER_INDEX, supplierCode) + "_current", ESKeys.INDEX_CONFIG, Utility.ofMap(ESKeys.ES_ERP_PRINT_ORDER_TYPE, "printOrder.json", ESKeys.ES_ERP_WORK_PART_TYPE, "workPart.json", ESKeys.ES_ERP_ORDER_PREPAY_TYPE, "orderPrePay.json", ESKeys.ES_ERP_DELIVERY_FEED_BACK_INFO_TYPE, "deliveryFeedBackInfo.json", // 发货反馈记录 ESKeys.ES_ERP_ORDER_DELIVER_INFORM_TYPE, "orderDeliverInform.json", //发货通知 ESKeys.ES_ERP_ORDER_LIFECYCLE_TYPE, "orderLifeCycle.json", //订单生命周期 ESKeys.ES_ERP_ORDER_LIFECYCLE_COUNT_TYPE, "orderLifeCycleCount.json", //订单生命周期数量 ESKeys.ES_ERP_ORDER_SEND_ADDRESS_TYPE, "orderSendAddress.json", //订单发货地址 ESKeys.ES_ERP_ORDER_DISPATCH_ITEM_TYPE, "orderImageDispatchItem.json", //订单修图 ESKeys.ES_ERP_ORDER_RECEIVABLE_TYPE, "orderReceivable.json", //订单应收 ESKeys.ES_ERP_ORDER_CHARGE_DATA_TYPE, "orderChargeData.json", //订单收款 ESKeys.ES_ERP_ORDER_STOCK_ITEM_TYPE, "orderStockItem.json", ESKeys.ES_ERP_ORDER_STOCK_LABEL_TYPE, "orderStockLabel.json", ESKeys.ES_ERP_ORDER_PART_TYPE, "orderPart.json", ESKeys.ES_ERP_ORDER_PART_PARAMS_TYPE, "orderPartParamValue.json", ESKeys.ES_ERP_ORDER_PART_PROCESS_TYPE, "orderPartProcess.json", ESKeys.ES_ERP_ORDER_MATERIAL_TYPE, "orderMaterialItem.json", ESKeys.ES_ERP_ORDER_COST_ITEM_TYPE, "orderCostItem.json" )) esClient.checkIndexEx(keysService.getESKey(ESKeys.ES_ERP_ORDER_STEP_INDEX, supplierCode) + "_current", ESKeys.INDEX_CONFIG, Utility.ofMap(ESKeys.ES_ERP_ORDER_STEP_TYPE, "orderStep.json")) } as Runnable } //groovy最后一个表达式的值为返回 createRunnable(esClient, keysService, supplierCode)