调整基类更新后置方法&&增加转交、业务单详情
This commit is contained in:
@@ -95,6 +95,24 @@ class ApprovalRecordsService
|
||||
$config['where']['instance_id'] = $p['instance_id'];
|
||||
$config['order']['id'] = 'desc';
|
||||
break;
|
||||
case 'border':
|
||||
$config['where']['id'] = $p['id'];
|
||||
$config['order']['id'] = 'desc';
|
||||
$config['with'] = [
|
||||
'instance',
|
||||
'approver',
|
||||
'instance.flows',
|
||||
'instance.initiator',
|
||||
'instance.bizInfo',
|
||||
|
||||
// 'instance.bizInfo.items',
|
||||
// 'instance.bizInfo.items.options',
|
||||
// 'instance.bizInfo.items.moneyValues',
|
||||
// 'instance.bizInfo.accounts',
|
||||
// 'instance.bizInfo.moneyValues',
|
||||
// 'instance.bizInfo.salesperson',
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
return $config;
|
||||
@@ -115,4 +133,49 @@ class ApprovalRecordsService
|
||||
$item = $this->logicListAll($config);
|
||||
return $this->postProcess('Logs', $item);
|
||||
}
|
||||
|
||||
|
||||
public function serviceBusinessOrder(Request $request, array $data = [])
|
||||
{
|
||||
$config = $this->buildQueryConfig($request, 'border');
|
||||
$config = $this->borderConfig($config, $data['flow_type']);
|
||||
$item = $this->logicShow($config);
|
||||
$bizInfo = [];
|
||||
$service = match ($data['flow_type']) {
|
||||
'stock_orders' => new \app\common\service\StockOrdersService(),
|
||||
'purchase_orders' => new \app\common\service\PurchaseOrdersService(),
|
||||
default => new \app\common\service\StockOrdersService()
|
||||
};
|
||||
$bizInfo = $service->formatData($item->instance->bizInfo);
|
||||
return $this->postProcess('Border', $bizInfo);
|
||||
}
|
||||
|
||||
public function borderConfig($config, $type = 'stock_orders')
|
||||
{
|
||||
$with = match ($type) {
|
||||
'stock_orders' => [
|
||||
'instance.bizInfo.items',
|
||||
'instance.bizInfo.items.options',
|
||||
'instance.bizInfo.items.moneyValues',
|
||||
'instance.bizInfo.accounts',
|
||||
'instance.bizInfo.moneyValues',
|
||||
'instance.bizInfo.salesperson',
|
||||
],
|
||||
'purchase_orders' => [
|
||||
'instance.bizInfo.items',
|
||||
'instance.bizInfo.items.stockOrder',
|
||||
'instance.bizInfo.items.stockOrderItems'
|
||||
]
|
||||
};
|
||||
$config['with'] = array_merge($config['with'], $with);
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
public function transferApproval(Request $request, array $data = [])
|
||||
{
|
||||
$service = new \app\common\utils\approval\service\ApprovalFlowService();
|
||||
$result = $service->transferApproval($data['instance_id'], $data['step_index'], $request->user->uid, $data['to_uid'], $data['reason'], 'name');
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user