|
|
@@ -122,7 +122,7 @@ class CalcConsole extends BaseBusiness
|
|
|
$currentPeriod = Period::find()->where('START_TIME< :NOW_TIME',['NOW_TIME'=>$nowTs])->where('END_TIME>= :NOW_TIME',['NOW_TIME'=>$nowTs-6])->asArray()->one();
|
|
|
$periodNum = $currentPeriod['PERIOD_NUM'];
|
|
|
if (
|
|
|
- Period::isProcessing($periodNum)
|
|
|
+ Period::isPreparing($periodNum)
|
|
|
|| $currentPeriod['IS_MONTH'] == 0
|
|
|
) {
|
|
|
return;
|
|
|
@@ -130,12 +130,12 @@ class CalcConsole extends BaseBusiness
|
|
|
if($nowTs+86400>$currentPeriod['END_TIME'] ){
|
|
|
$nowMin = date("i", $nowTs);
|
|
|
$nowSec = date("s", $nowTs);
|
|
|
- if(($nowMin!=0 || $nowSec >= 5 ) || Period::isProcessing($periodNum)){ // 当不是整点小时,当计算中,不计算
|
|
|
+ if(($nowMin!=0 || $nowSec >= 5 ) || Period::isPreparing($periodNum)){ // 当不是整点小时,当计算中,不计算
|
|
|
return;
|
|
|
}
|
|
|
print_r($periodNum."该预结算".$nowMin.PHP_EOL.$nowSec);
|
|
|
//设置计算进行中标识
|
|
|
- Period::updatePeriodIsProcessing($periodNum, Period::IS_PROCESSING);
|
|
|
+ Period::updatePeriodIsPreparing($periodNum, Period::IS_PREPARING);
|
|
|
//设置自动计算标识
|
|
|
Period::updatePeriodIsAutoExec($periodNum, Period::MANUAL_EXEC_CALC);
|
|
|
//记录开始计算的时间
|
|
|
@@ -180,23 +180,23 @@ class CalcConsole extends BaseBusiness
|
|
|
}
|
|
|
if (
|
|
|
2 == $period['IS_PREPARE']
|
|
|
- && 3 == $period['IS_PERFED']
|
|
|
+ && 1 == $period['IS_PERFED']
|
|
|
) {
|
|
|
//拉取期业绩
|
|
|
CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的预计算业绩数据已生成');
|
|
|
CalcRecord::record($period['PERIOD_NUM'], '开始获取第' . $period['PERIOD_NUM'] . '期的预计算期业绩数据');
|
|
|
|
|
|
- Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::IS_PROCESSING);
|
|
|
+ Period::updatePeriodIsPreparing($period['PERIOD_NUM'], Period::IS_PREPARING);
|
|
|
$res = (new PullPerfDataFromCalc($period['PERIOD_NUM']))->start();
|
|
|
if (200 == $res['code']) {
|
|
|
- Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::NOT_PROCESSING);
|
|
|
+// Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::NOT_PROCESSING);
|
|
|
//设置预计算标识
|
|
|
Period::updatePeriodIsPreparing($period['PERIOD_NUM'], Period::NOT_PREPARING);
|
|
|
CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的预计算期业绩数据已获取');
|
|
|
return $res;
|
|
|
} else {
|
|
|
//结束计算状态
|
|
|
- Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::NOT_PROCESSING);
|
|
|
+// Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::NOT_PROCESSING);
|
|
|
//设置预计算标识
|
|
|
Period::updatePeriodIsPreparing($period['PERIOD_NUM'], Period::NOT_PREPARING);
|
|
|
CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的预计算期业绩数据获取失败,原因:' . $res['msg']);
|