Merge branch 'develop'

This commit is contained in:
mzl
2025-09-18 15:05:57 +08:00
parent 5fef15b0fa
commit b7b6edb06c
46 changed files with 522 additions and 1512 deletions
@@ -1,7 +1,6 @@
<?php
namespace app\common\utils\approval\service;
use app\common\service\MessageNotificationsService;
use support\exception\BusinessException;
use support\Db;
@@ -234,31 +233,6 @@ class ApprovalFlowService
});
}
/** 我的待办 */
public function getPendingApprovals(int $userId): array
{
return Db::table('approval_records as ar')
->join('approval_instances as ai', 'ar.instance_id', '=', 'ai.id')
->where('ar.approver_id', $userId)
->where('ar.status', 'pending')
->where('ai.status', 'processing')
->select('ai.*')
->distinct()
->get()
->toArray();
}
/** 审批历史 */
public function getApprovalHistory(int $instanceId): array
{
return Db::table('approval_records')
->where('instance_id', $instanceId)
->orderBy('step_index')
->orderByRaw('COALESCE(approved_at, created_at) asc')
->get()
->toArray();
}
/** 流程图数据(把 skipped/timeout 视作已完结的中性状态) */
public function getFlowDiagramData(int $instanceId): array
{
@@ -577,7 +551,7 @@ class ApprovalFlowService
$prefix = $isCC ? '【抄送】' : '【审批】';
$text = $map[$action] ?? $action;
$approvalType = array_flip(\app\common\service\SysDictService::pluckKeyValueByCode('approval_type')->toArray());
$approvalType = array_flip(\app\common\service\SysDictService::pluckKeyValueByCode('approval_type'));
switch ($instance->flow_type) {
case 'stock_orders': // 备货单