Bläddra i källkod

计算日志整理

theo 2 år sedan
förälder
incheckning
62bac65988

+ 3 - 0
common/helpers/bonus/Calc/GeneratePerfOrder.php

@@ -462,6 +462,7 @@ class GeneratePerfOrder extends BasePerfBusiness
     public static function _createFakeOrder($periodNum, $isCalcMonth)
     {
         if ($isCalcMonth) {
+            CalcRecord::record($periodNum, "【期业绩】业务系统,是月结点,生成自动订单");
             $periods = Period::getCurrentMonthPeriodByPeriodNum($periodNum);
             //先清除本期的假订单
 //            echo('首先,清除上次尝试生成业绩单时所创建的虚假订单' . date('Y-m-d  H:i:s', time()) . PHP_EOL);
@@ -477,6 +478,8 @@ class GeneratePerfOrder extends BasePerfBusiness
                     $newOrderForm->addFakeOrder($uR['USER_ID'], $periodNum);
                 }
             }
+        } else {
+            CalcRecord::record($periodNum, "【期业绩】业务系统,不是月结点,跳过生成自动订单");
         }
     }
 }

+ 4 - 0
common/helpers/bonus/Calc/PullCalcBonusData.php

@@ -354,6 +354,10 @@ class PullCalcBonusData extends BaseBusiness
             CalcRecord::record($this->_periodNum, "【奖金计算】业务系统,是月结点,AR_CALC_BONUS_GARAGE表,已清除当月数据");
             CalcBonusVilla::pageDeleteAll('PERIOD_NUM=' . $this->_periodNum);
             CalcRecord::record($this->_periodNum, "【奖金计算】业务系统,是月结点,AR_CALC_BONUS_VILLA表,已清除当月数据");
+        } else {
+            CalcRecord::record($this->_periodNum, "【奖金计算】业务系统,不是月结点,AR_CALC_BONUS_TOURISM表,无需清除");
+            CalcRecord::record($this->_periodNum, "【奖金计算】业务系统,不是月结点,AR_CALC_BONUS_GARAGE表,无需清除");
+            CalcRecord::record($this->_periodNum, "【奖金计算】业务系统,不是月结点,AR_CALC_BONUS_VILLA表,无需清除");
         }
     }
 

+ 6 - 0
common/helpers/bonus/Calc/PullPerfDataFromCalc.php

@@ -28,9 +28,13 @@ class PullPerfDataFromCalc extends BasePerfBusiness
                 $this->clearPerfPeriod();
                 if ($this->_isCalcMonth) {
                     //拉取月业绩
+                    CalcRecord::record($this->_periodNum, "【期业绩】业务系统,是月结点,拉取月业绩");
                     $this->pullPerfMonth();
+                } else {
+                    CalcRecord::record($this->_periodNum, "【期业绩】业务系统,不是月结点,无需拉取月业绩");
                 }
                 //拉取期业绩数据
+                CalcRecord::record($this->_periodNum, "【期业绩】业务系统,拉取期业绩");
                 $this->pullPerfPeriod();
                 //同步周期表的值到业务系统
                 self::pullPeriodForUpdate($this->_periodNum);
@@ -76,6 +80,8 @@ class PullPerfDataFromCalc extends BasePerfBusiness
             CalcRecord::record($this->_periodNum, "【期业绩】业务系统,是月结点,AR_PERF_MONTH表,已清除当月所有记录");
             //达标业绩表
 //            PerfStandard::pageDeleteAll("CALC_MONTH='{$this->_calcYearMonth}'");
+        } else {
+            CalcRecord::record($this->_periodNum, "【期业绩】业务系统,不是月结点,无需操作AR_PERF_MONTH表");
         }
     }
 

+ 14 - 0
common/helpers/bonus/Calc/PushBaseDataToCalc.php

@@ -350,6 +350,9 @@ class PushBaseDataToCalc extends BaseBusiness
             //达标业绩表
             PerfStandard::pageDeleteAll("CALC_MONTH='{$this->_calcYearMonth}'");
             CalcRecord::record($this->_periodNum, "【基础数据】业务系统,是月结点,AR_PERF_STANDARD表,已清除当月所有记录");
+        } else {
+            CalcRecord::record($this->_periodNum, "【基础数据】业务系统,不是月结点,AR_PERF_MONTH表,无需清除");
+            CalcRecord::record($this->_periodNum, "【基础数据】业务系统,不是月结点,AR_PERF_STANDARD表,无需清除");
         }
     }
 
@@ -419,7 +422,13 @@ class PushBaseDataToCalc extends BaseBusiness
             $where = ['CALC_YEAR' => $this->_calcYear, 'CALC_MONTH' => $this->_calcMonth];
             if (in_array($this->_calcMonth, [3, 6, 9, 12])) {
                 $where['CALC_MONTH'] = [$this->_calcMonth, $this->_calcMonth - 1, $this->_calcMonth - 2];
+                CalcRecord::record($this->_periodNum, "【基础数据】当前是季结点,推送整季数据");
+            } else {
+                CalcRecord::record($this->_periodNum, "【基础数据】当前不是季结点");
+                CalcRecord::record($this->_periodNum, "【基础数据】当前是月结点,推送当月数据");
             }
+        } else {
+            CalcRecord::record($this->_periodNum, "【基础数据】当前不是季结点或月结点,仅推送当期数据");
         }
 
         $data = Period::find()->select($field)
@@ -484,6 +493,7 @@ class PushBaseDataToCalc extends BaseBusiness
     public function calcBonusQy($table, $fieldArray, $db): bool
     {
         if (!$this->_isCalcMonth) {
+            CalcRecord::record($this->_periodNum, "【基础数据】当前不是月结点,跳过QY奖");
             return true;
         }
         $periodNum     = $this->_periodNum;
@@ -524,6 +534,7 @@ class PushBaseDataToCalc extends BaseBusiness
     public function perfPeriod($table, $fieldArray, $db): bool
     {
         if (!$this->_isCalcMonth) {
+            CalcRecord::record($this->_periodNum, "【基础数据】当前不是月结点");
             return true;
         }
         $field = implode(',', $fieldArray);
@@ -552,7 +563,10 @@ class PushBaseDataToCalc extends BaseBusiness
         $currentPeriod = Period::getInfoByPeriodNum($periodNum);
         //判断是否月节点
         if ($currentPeriod['IS_MONTH']) {
+            CalcRecord::record($this->_periodNum, "【基础数据】当前是月结点,获取当月的所有期");
             $periodNum = Period::getCurrentMonthPeriodByPeriodNum($periodNum);
+        } else {
+            CalcRecord::record($this->_periodNum, "【基础数据】当前不是月结点");
         }
 
         //结算月