Merge branch 'develop'
This commit is contained in:
@@ -112,8 +112,9 @@ class ApprovalRecordsController extends BaseController
|
||||
'instance_id' => $record['instance_id'],
|
||||
|
||||
'biz_id' => $record['instance']['biz_id'],
|
||||
'biz_desc' => '备货单号【'.$record['instance']['bizInfo']['order_no'].'】',
|
||||
'biz_desc' => '业务单号【'.$record['instance']['bizInfo']['order_no'].'】',
|
||||
'biz_type' => $record['instance']['flow_type'],
|
||||
'flow_type' => $record['instance']['flow_type'],
|
||||
|
||||
'initiator_name' => $record['instance']['initiator']['name'],
|
||||
'initiator_avatar' => $record['instance']['initiator']['avatar'],
|
||||
@@ -139,4 +140,63 @@ class ApprovalRecordsController extends BaseController
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function businessOrder(Request $request)
|
||||
{
|
||||
try {
|
||||
$raw = $this->service->serviceBusinessOrder($request, $request->all());
|
||||
$data = $this->transformData($raw, method_exists($this, 'borderFormat')
|
||||
? [$this, 'borderFormat']
|
||||
: null);
|
||||
return $this->success($data);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function transferApproval(Request $request)
|
||||
{
|
||||
try {
|
||||
$raw = $this->service->transferApproval($request, $request->all());
|
||||
$data = $this->transformData($raw, method_exists($this, 'transferFormat')
|
||||
? [$this, 'transferFormat']
|
||||
: null);
|
||||
return $this->success($data);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function approvalTimeline(Request $request)
|
||||
{
|
||||
try {
|
||||
$raw = $this->service->serviceApprovalTimeline($request, $request->all());
|
||||
$data = $this->transformData($raw, method_exists($this, 'timelineFormat')
|
||||
? [$this, 'timelineFormat']
|
||||
: null);
|
||||
return $this->success($data);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function timelineFormat($data)
|
||||
{
|
||||
$result = [];
|
||||
foreach ($data as $record) {
|
||||
$result[] = [
|
||||
'id' => $record['id'],
|
||||
'name' => $record['approver']['name'],
|
||||
'comment' => $record['comment'] ?? '无',
|
||||
'time' => $record['updated_at'],
|
||||
'status_desc' => SysDictItem::where('item_value', $record['status'])->where('status', 1)->value('item_label'),
|
||||
];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user