新增获取商品库存对接、修正实际付款金额返回值
This commit is contained in:
@@ -78,11 +78,11 @@ class Prescription
|
||||
}
|
||||
|
||||
// 获取药品
|
||||
public function getProd(){
|
||||
public function getProd(int $page = 1,int $pageSize = 10){
|
||||
$option = [
|
||||
"json" => array(
|
||||
"page" => 1,
|
||||
"pageSize" => 1,
|
||||
"page" => $page,
|
||||
"pageSize" => $pageSize,
|
||||
),
|
||||
];
|
||||
|
||||
@@ -93,20 +93,32 @@ class Prescription
|
||||
throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR));
|
||||
}
|
||||
|
||||
if (empty($response['result']['rows'])){
|
||||
return true;
|
||||
}
|
||||
|
||||
dump($response);
|
||||
// 获取总数
|
||||
// $count
|
||||
return $response['result'];
|
||||
} catch (GuzzleException $e) {
|
||||
throw new BusinessException($e->getMessage());
|
||||
}
|
||||
|
||||
// return $response['token'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品库存
|
||||
* @param string $product_platform_code 处方平台商品编码(此处使用第三方药店商品编码!)
|
||||
* @return array
|
||||
*/
|
||||
public function getProdStock(string $product_platform_code): array
|
||||
{
|
||||
$option = [
|
||||
"json" => array(
|
||||
"pharmacyCode" => "JG-10009",
|
||||
"drugCode" => $product_platform_code,
|
||||
),
|
||||
];
|
||||
|
||||
try {
|
||||
return $this->httpRequest($this->api_url . $this->version . '/pharmacy/pharmacyInventory', $option);
|
||||
} catch (GuzzleException $e) {
|
||||
throw new BusinessException($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求封装
|
||||
@@ -117,7 +129,7 @@ class Prescription
|
||||
*/
|
||||
protected function httpRequest(string $path,array $arg = []): array
|
||||
{
|
||||
if ($path != "http://49.233.3.200:6304/api/thridapi/v1/drug/syncDrugCatalogue"){
|
||||
if ($path != "http://49.233.3.200:6304/api/thridapi/v1/user_thrid/token"){
|
||||
$this->redis = $this->container->get(Redis::class);
|
||||
|
||||
$access_token = $this->redis->get("prescription_token");
|
||||
@@ -139,7 +151,6 @@ class Prescription
|
||||
}
|
||||
|
||||
$response = $this->client->post($path, $arg);
|
||||
|
||||
if ($response->getStatusCode() != '200'){
|
||||
// 请求失败
|
||||
throw new BusinessException($response->getBody()->getContents());
|
||||
|
||||
Reference in New Issue
Block a user