first commit

This commit is contained in:
Your Name
2026-09-08 11:40:15 +08:00
commit a5353f7eb5
9568 changed files with 1646214 additions and 0 deletions
@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace app\adminapi\controller\finance;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\logic\finance\DeptPerformanceTargetLogic;
use app\adminapi\validate\finance\DeptPerformanceTargetValidate;
/**
* 制定业绩:按部门、按自然月维护目标金额(元)
*
* - GET finance.dept_performance_target/monthMatrix
* - POST finance.dept_performance_target/batchSave
*/
class DeptPerformanceTargetController extends BaseAdminController
{
public function monthMatrix()
{
$params = (new DeptPerformanceTargetValidate())->goCheck('monthMatrix');
$ym = (string) $params['year_month'];
return $this->data(DeptPerformanceTargetLogic::monthMatrix($ym, $this->adminId, $this->adminInfo));
}
public function batchSave()
{
$params = (new DeptPerformanceTargetValidate())->post()->goCheck('batchSave');
$ym = (string) $params['year_month'];
$items = $params['items'] ?? [];
if (!is_array($items)) {
return $this->fail('目标数据格式错误');
}
$result = DeptPerformanceTargetLogic::batchSave(
$ym,
$items,
$this->adminId,
$this->adminInfo,
(string) ($this->adminInfo['name'] ?? '')
);
if ($result === false) {
return $this->fail(DeptPerformanceTargetLogic::getError());
}
return $this->success(
'保存成功',
DeptPerformanceTargetLogic::monthMatrix($ym, $this->adminId, $this->adminInfo),
1,
1
);
}
}