|
|
@@ -31,6 +31,13 @@ class CalcConsole extends BaseBusiness
|
|
|
$businessIsCalculated = $businessPeriod['IS_CALCULATED'] == Period::CALCULATE_FINISH;
|
|
|
$startExecTime = $businessPeriod['START_EXEC_TIME'] ?? 0;
|
|
|
|
|
|
+ echo $businessPeriod['IS_CALCING'];
|
|
|
+ //同步计算进度日志到业务系统
|
|
|
+ if (4 == $period['IS_PREPARE'] && 1 == $period['IS_CALCULATED'] && 1 == $businessPeriod['IS_CALCING']) {
|
|
|
+ self::syncCalcRecord($period['PERIOD_NUM'], $db, $startExecTime);
|
|
|
+ \Yii::$app->db->createCommand()->update('AR_PERIOD', ['IS_CALCING' => 0], 'PERIOD_NUM=' . $period['PERIOD_NUM'])->execute();
|
|
|
+ }
|
|
|
+
|
|
|
if (2 == $period['IS_PREPARE'] && 1 == $period['IS_PERFED'] && $autoExec) {
|
|
|
//拉取期业绩
|
|
|
CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的业绩数据已生成');
|
|
|
@@ -55,11 +62,6 @@ class CalcConsole extends BaseBusiness
|
|
|
return \Yii::$app->$db->createCommand()->update('AR_PERIOD', ['IS_PREPARE' => 3], 'PERIOD_NUM=:PERIOD_NUM', ['PERIOD_NUM' => $period['PERIOD_NUM']])->execute();
|
|
|
}
|
|
|
|
|
|
- //同步计算进度日志到业务系统
|
|
|
- if (4 == $period['IS_PREPARE'] && 0 == $period['IS_CALCULATED']) {
|
|
|
- self::syncCalcRecord($period['PERIOD_NUM'], $db, $startExecTime);
|
|
|
- }
|
|
|
-
|
|
|
if (4 == $period['IS_PREPARE'] && 1 == $period['IS_CALCULATED'] && $autoExec && !$businessIsCalculated) {
|
|
|
CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的奖金已计算完成');
|
|
|
CalcRecord::record($period['PERIOD_NUM'], '开始拉取第' . $period['PERIOD_NUM'] . '期的奖金数据');
|
|
|
@@ -71,14 +73,15 @@ class CalcConsole extends BaseBusiness
|
|
|
CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的奖金数据已全部拉取');
|
|
|
//待拉取完成后再将计算完成标识改为已完成
|
|
|
\Yii::$app->db->createCommand()->update('AR_PERIOD', ['IS_CALCULATED' => 1], 'PERIOD_NUM=' . $period['PERIOD_NUM'])->execute();
|
|
|
- //拉取计算系统的进度日志
|
|
|
- self::syncCalcRecord($period['PERIOD_NUM'], $db, $startExecTime);
|
|
|
+
|
|
|
//自动执行完成 更新对应字段
|
|
|
//计算结束
|
|
|
Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::NOT_PROCESSING);
|
|
|
//流程结束
|
|
|
//同步周期表的值到业务系统
|
|
|
self::pullPeriodForUpdate($period['PERIOD_NUM']);
|
|
|
+ //拉取计算系统的进度日志
|
|
|
+ self::syncCalcRecord($period['PERIOD_NUM'], $db, $startExecTime);
|
|
|
} else {
|
|
|
//结束计算状态
|
|
|
Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::NOT_PROCESSING);
|