Init_22_PrintOrder.groovy 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import com.dderp.common.api.NoSqlKeysService
  2. import com.dderp.common.datas.ESKeys
  3. import com.dySweetFishPlugin.elasticsearch.ESClient
  4. import com.sweetfish.util.Utility
  5. static def createRunnable(ESClient esClient, NoSqlKeysService keysService, long supplierCode) {
  6. return {
  7. //结转方式,es中只存储当期数据,历史完成数据均在数据库中查询
  8. esClient.createIndex(keysService.getESKey(ESKeys.ES_ERP_PRINT_ORDER_INDEX, supplierCode) + "_current", ESKeys.INDEX_CONFIG,
  9. Utility.ofMap(ESKeys.ES_ERP_PRINT_ORDER_TYPE, "printOrder.json",
  10. ESKeys.ES_ERP_WORK_PART_TYPE, "workPart.json",
  11. ESKeys.ES_ERP_ORDER_PREPAY_TYPE, "orderPrePay.json",
  12. ESKeys.ES_ERP_DELIVERY_FEED_BACK_INFO_TYPE, "deliveryFeedBackInfo.json", // 发货反馈记录
  13. ESKeys.ES_ERP_ORDER_DELIVER_INFORM_TYPE, "orderDeliverInform.json", //发货通知
  14. ESKeys.ES_ERP_ORDER_LIFECYCLE_TYPE, "orderLifeCycle.json", //订单生命周期
  15. ESKeys.ES_ERP_ORDER_LIFECYCLE_COUNT_TYPE, "orderLifeCycleCount.json", //订单生命周期数量
  16. ESKeys.ES_ERP_ORDER_SEND_ADDRESS_TYPE, "orderSendAddress.json", //订单发货地址
  17. ESKeys.ES_ERP_ORDER_DISPATCH_ITEM_TYPE, "orderImageDispatchItem.json", //订单修图
  18. ESKeys.ES_ERP_ORDER_RECEIVABLE_TYPE, "orderReceivable.json", //订单应收
  19. ESKeys.ES_ERP_ORDER_CHARGE_DATA_TYPE, "orderChargeData.json", //订单收款
  20. ESKeys.ES_ERP_ORDER_STOCK_ITEM_TYPE, "orderStockItem.json",
  21. ESKeys.ES_ERP_ORDER_STOCK_LABEL_TYPE, "orderStockLabel.json",
  22. ESKeys.ES_ERP_ORDER_PART_TYPE, "orderPart.json",
  23. ESKeys.ES_ERP_ORDER_PART_PARAMS_TYPE, "orderPartParamValue.json",
  24. ESKeys.ES_ERP_ORDER_PART_PROCESS_TYPE, "orderPartProcess.json",
  25. ESKeys.ES_ERP_ORDER_MATERIAL_TYPE, "orderMaterialItem.json",
  26. ESKeys.ES_ERP_ORDER_COST_ITEM_TYPE, "orderCostItem.json"
  27. ))
  28. esClient.checkIndexEx(keysService.getESKey(ESKeys.ES_ERP_ORDER_STEP_INDEX, supplierCode) + "_current", ESKeys.INDEX_CONFIG,
  29. Utility.ofMap(ESKeys.ES_ERP_ORDER_STEP_TYPE, "orderStep.json"))
  30. } as Runnable
  31. }
  32. //groovy最后一个表达式的值为返回
  33. createRunnable(esClient, keysService, supplierCode)