|
@@ -1,4 +1,4 @@
|
|
|
-from .MerchantCalcBase import MerchantCalcBase, mch_detail_paths, mch_paths
|
|
|
+from .MerchantCalc import MerchantCalc, mch_detail_paths, mch_paths
|
|
|
from .algorithm import calc_mch_profit
|
|
|
from .DataStream import EMchPosmap as pos_map
|
|
|
|
|
@@ -7,7 +7,7 @@ import time as time
|
|
|
import logging
|
|
|
import json
|
|
|
|
|
|
-logger = logging.getLogger('mch_profit_ratio')
|
|
|
+logger = logging.getLogger('MProfitRatioCalc')
|
|
|
|
|
|
|
|
|
def mixed_ratio(rclient):
|
|
@@ -23,9 +23,9 @@ def mixed_ratio(rclient):
|
|
|
return result
|
|
|
|
|
|
|
|
|
-class MProfitRatioCalc(MerchantCalcBase):
|
|
|
+class MProfitRatioCalc(MerchantCalc):
|
|
|
def _calc_handler(self, rclient):
|
|
|
- logger.debug('MProfitRatioCalc _calc_handler')
|
|
|
+ logger.debug('_calc_handler')
|
|
|
mixed_ratios = mixed_ratio(rclient)
|
|
|
reader = self._reader()
|
|
|
|
|
@@ -62,4 +62,6 @@ class MProfitRatioCalc(MerchantCalcBase):
|
|
|
result = {'gross': gross, 'detail': detail}
|
|
|
if len(gross) != 0 or len(detail) != 0:
|
|
|
rclient.set(f"nc_refill_merchant_profit_ratio", json.dumps(result))
|
|
|
- rclient.publish('refill', json.dumps({'type': 'mch_profit_ratio', 'value': 0}))
|
|
|
+ rclient.publish('refill', json.dumps({'type': 'mch_profit_ratio', 'value': 0}))
|
|
|
+
|
|
|
+ return 1
|