Explorar o código

Merge branch 'feature/NG-14-1'

# Conflicts:
#	common/helpers/bonus/Calc/CalcConsole.php
george191900 hai 1 ano
pai
achega
9420e1c1cf

+ 1 - 0
backendApi/config/menu.php

@@ -206,6 +206,7 @@ return [
         'child'=>[
             ['name'=>'Closure period', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'period', 'routePath'=>'bonus/period', 'show'=>1, 'wiki' => 'closurePeriod'],//封期管理
             ['name'=>'封期操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'close-period', 'routePath'=>'bonus/close-period', 'show'=>0,],
+            ['name'=>'自动计算', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'auto-calc', 'routePath'=>'bonus/auto-calc', 'show'=>0,],
             ['name'=>'生成业绩单', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'perf-period', 'routePath'=>'bonus/perf-period', 'show'=>0,],
             ['name'=>'结算操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'calc-period', 'routePath'=>'bonus/calc-period', 'show'=>0,],
             ['name'=>'挂网操作', 'class'=>'', 'icon'=>'', 'controller'=>'bonus', 'action'=>'send-period', 'routePath'=>'bonus/send-period', 'show'=>0,],

+ 17 - 1
backendApi/config/params.php

@@ -17,6 +17,14 @@ return [
         'v1/demo/ipayments',
         'v1/article/detail',
         'v1/admin/change-language',
+        'v1/bonus/auto-calc',
+        'v1/bonus/calc-period',
+        'v1/bonus/close-period',
+        'v1/bonus/period',
+        'v1/bonus/calc-period',
+        'v1/calc/record-list',
+        'v1/calc/auto-calc',
+        'v1/shop/order-detail'
     ],
     'noCheckPermissionActions' => [
         'oauth/login',
@@ -73,6 +81,14 @@ return [
         'demo/payments',
         'demo/ipayments',
         'article/detail',
-        'admin/change-language'
+        'admin/change-language',
+        'bonus/auto-calc',
+        'bonus/calc-period',
+        'bonus/close-period',
+        'bonus/period',
+        'bonus/calc-period',
+        'calc/record-list',
+        'calc/auto-calc',
+        'shop/order-detail'
     ],
 ];

+ 13 - 1
common/helpers/bonus/Calc/CalcConsole.php

@@ -132,7 +132,8 @@ class CalcConsole extends BaseBusiness
                 Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::NOT_PROCESSING);
                 \Yii::$app->$db->createCommand()->update('AR_PERIOD', ['CALC_ID' => ''], 'PERIOD_NUM=:PERIOD_NUM', ['PERIOD_NUM' => $period['PERIOD_NUM']])->execute();
                 CalcOperation::closeOperation($businessPeriod['CALC_ID']);
-                CalcRecord::record($period['PERIOD_NUM'], '【奖金计算】第' . $period['PERIOD_NUM'] . '期的奖金数据获取失败,原因:' . $res['msg']);
+//                CalcRecord::record($period['PERIOD_NUM'], '【奖金计算】第' . $period['PERIOD_NUM'] . '期的奖金数据获取失败,原因:' . $res['msg']);
+                CalcRecord::record($period['PERIOD_NUM'], '【奖金计算】第' . $period['PERIOD_NUM'] . '期的奖金数据获取失败');
                 //设置计算进行中标识
                 Period::updatePeriodIsPreparing($period['PERIOD_NUM'], Period::NOT_PREPARING);
                 //设置redis开关
@@ -206,6 +207,17 @@ class CalcConsole extends BaseBusiness
             }
         }
 
+//        if( 1 < $nowDate && 10 >= $nowDate ){ // 10号及以前,不是0点,则跳过
+//            if( $nowHour != 0) {
+//                return;
+//            }
+//        }
+//
+//        if( 15 < $nowDate && 25 >= $nowDate ){ // 下半月前10天,不是0点,则跳过
+//            if( $nowHour != 0) {
+//                return;
+//            }
+//        }
 //        if($nowDate >1 && $nowDate <= 15 || (($nowMin!=0 || $nowSec >= 5 ) || Period::isPreparing($periodNum)) ){ // 当不是整点小时,当计算中,不计算
 //            return;
 //        }

+ 0 - 1
common/models/CalcRecord.php

@@ -30,7 +30,6 @@ class CalcRecord extends \common\components\ActiveRecord
         return [
             [['PERIOD_NUM', 'TEXT'], 'required'],
             [['PERIOD_NUM'], 'number'],
-            [['TEXT'], 'string', 'max' => 2000],
             [['ID'], 'unique'],
         ];
     }