Init_16_BusinessOrder.groovy 1.8 KB

1234567891011121314151617181920212223242526272829303132
  1. import com.dderp.business.dao.OrderDao
  2. import com.dderp.common.api.SupplierInitService
  3. import com.dderp.common.datas.ESKeys
  4. import com.dySweetFishPlugin.elasticsearch.ESClient
  5. import com.dySweetFishPlugin.redis.RedisService
  6. import com.sweetfish.convert.json.JsonConvert
  7. import com.sweetfish.util.Utility
  8. import org.apache.logging.log4j.Logger
  9. static def createRunnable(ESClient esClient, RedisService redisService, SupplierInitService supplierService,
  10. OrderDao orderDao, Logger logger, JsonConvert jsonConvert, String dataSourceId, long supplierCode) {
  11. return {
  12. esClient.checkIndexEx(supplierService.getDateYearESIndex(supplierCode, ESKeys.ES_DELIVER_BUSINESS_ORDER_INDEX, 0),
  13. ESKeys.INDEX_CONFIG,
  14. Utility.ofMap(ESKeys.ES_DELIVER_BUSINESS_ORDER_TYPE, "businessorder.json",
  15. ESKeys.ES_DELIVER_ORDER_DELIVERY_INFO_TYPE, "orderdeliveryinfo.json",
  16. ESKeys.ES_DELIVER_ORDER_FINANCES_TYPE, "orderfinances.json",
  17. ESKeys.ES_DELIVER_ORDER_DETAIL_ITEM_TYPE, "orderdetailitem.json",
  18. ESKeys.ES_DELIVER_ORDER_AFTER_SALE_BILL_TYPE, "orderaftersalebill.json"))
  19. esClient.checkIndexEx(supplierService.getDateYearESIndex(supplierCode, ESKeys.ES_DELIVER_ORDER_STEP_INDEX, 0),
  20. ESKeys.INDEX_CONFIG,
  21. Utility.ofMap(ESKeys.ES_DELIVER_ORDER_STEP_TYPE, "orderStep.json"))
  22. esClient.checkIndexEx(supplierService.getDateYearESIndex(supplierCode, ESKeys.ES_DELIVER_REFUND_ORDER_REQUEST_INDEX, 0),
  23. ESKeys.INDEX_CONFIG,
  24. Utility.ofMap(ESKeys.ES_DELIVER_REFUND_ORDER_REQUEST_TYPE, "orderrefundrequest.json"))
  25. } as Runnable
  26. }
  27. createRunnable(esClient, redisService, supplierService, orderDao, logger, jsonConvert, dataSourceId, supplierCode)