You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.6 KiB
61 lines
1.6 KiB
<?php
|
|
declare(strict_types = 1);
|
|
|
|
namespace App\Http\Logics\Dictionary;
|
|
|
|
use App\Exceptions\GeneralException;
|
|
use App\Services\HisSoap\Client;
|
|
use App\Utils\Traits\Logger;
|
|
use App\Utils\Traits\MiniProgramAuth;
|
|
use App\Utils\Traits\UniversalEncryption;
|
|
use Illuminate\Auth\AuthenticationException;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class ItemLogic
|
|
{
|
|
use Logger;
|
|
use MiniProgramAuth;
|
|
use UniversalEncryption;
|
|
|
|
private Client $his_soap;
|
|
|
|
/**
|
|
* ItemLogic Construct
|
|
* @throws AuthenticationException
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->authInitialize();
|
|
$this->his_soap = app('HisSoapService');
|
|
}
|
|
|
|
/**
|
|
* 列表
|
|
* @throws GeneralException
|
|
*/
|
|
public function getLists()
|
|
{
|
|
$response = $this->his_soap->getDictionaryLists();
|
|
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') {
|
|
throw new GeneralException($response['ERRORMSG'] ?? '找不到缴费项目分类列表!', Response::HTTP_SERVICE_UNAVAILABLE);
|
|
}
|
|
|
|
return $response;
|
|
}
|
|
|
|
/**
|
|
* 详情
|
|
* @param int $type_id
|
|
* @return array
|
|
* @throws GeneralException
|
|
*/
|
|
public function getDetails(int $type_id): array
|
|
{
|
|
$response = $this->his_soap->getDictionaryDetails($type_id);
|
|
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') {
|
|
throw new GeneralException($response['ERRORMSG'] ?? '找不到缴费项目分类详情!', Response::HTTP_SERVICE_UNAVAILABLE);
|
|
}
|
|
|
|
return $response;
|
|
}
|
|
}
|
|
|