import com.dderp.business.dao.OrderDao import com.dderp.common.api.SupplierInitService import com.dderp.common.datas.ESKeys import com.dySweetFishPlugin.elasticsearch.ESClient import com.dySweetFishPlugin.redis.RedisService import com.sweetfish.convert.json.JsonConvert import com.sweetfish.util.Utility import org.apache.logging.log4j.Logger static def createRunnable(ESClient esClient, RedisService redisService, SupplierInitService supplierService, OrderDao orderDao, Logger logger, JsonConvert jsonConvert, String dataSourceId, long supplierCode) { return { esClient.checkIndexEx(supplierService.getDateYearESIndex(supplierCode, ESKeys.ES_DELIVER_BUSINESS_ORDER_INDEX, 0), ESKeys.INDEX_CONFIG, Utility.ofMap(ESKeys.ES_DELIVER_BUSINESS_ORDER_TYPE, "businessorder.json", ESKeys.ES_DELIVER_ORDER_DELIVERY_INFO_TYPE, "orderdeliveryinfo.json", ESKeys.ES_DELIVER_ORDER_FINANCES_TYPE, "orderfinances.json", ESKeys.ES_DELIVER_ORDER_DETAIL_ITEM_TYPE, "orderdetailitem.json", ESKeys.ES_DELIVER_ORDER_AFTER_SALE_BILL_TYPE, "orderaftersalebill.json")) esClient.checkIndexEx(supplierService.getDateYearESIndex(supplierCode, ESKeys.ES_DELIVER_ORDER_STEP_INDEX, 0), ESKeys.INDEX_CONFIG, Utility.ofMap(ESKeys.ES_DELIVER_ORDER_STEP_TYPE, "orderStep.json")) esClient.checkIndexEx(supplierService.getDateYearESIndex(supplierCode, ESKeys.ES_DELIVER_REFUND_ORDER_REQUEST_INDEX, 0), ESKeys.INDEX_CONFIG, Utility.ofMap(ESKeys.ES_DELIVER_REFUND_ORDER_REQUEST_TYPE, "orderrefundrequest.json")) } as Runnable } createRunnable(esClient, redisService, supplierService, orderDao, logger, jsonConvert, dataSourceId, supplierCode)