新增监管平台业务文件,新增搜索商品 处方可开具数量
This commit is contained in:
parent
ba1402b26b
commit
8fe4f57f30
@ -13,6 +13,9 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
/**
|
||||
* @property int $product_id 主键id
|
||||
* @property int $product_platform_id 处方平台商品id
|
||||
* @property int $product_status 商品状态(1:正常 2:下架)
|
||||
* @property int $is_delete 是否删除(0:否 1:是)
|
||||
* @property int $prescription_num 处方可开具的数量
|
||||
* @property string $product_name 商品名称
|
||||
* @property string $common_name 商品通用名
|
||||
* @property string $product_price 商品价格
|
||||
@ -32,6 +35,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property string $product_remarks 商品备注
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read ProductPlatformAmount|null $ProductPlatformAmount
|
||||
*/
|
||||
class Product extends Model
|
||||
{
|
||||
@ -45,7 +49,7 @@ class Product extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['product_id', 'product_platform_id', 'product_name', 'common_name', 'product_price', 'mnemonic_code', 'product_type', 'product_platform_code', 'product_pharmacy_code', 'product_cover_img', 'product_spec', 'license_number', 'manufacturer', 'single_unit', 'single_use', 'packaging_unit', 'frequency_use', 'available_days', 'product_remarks', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['product_id', 'product_platform_id', 'product_status', 'is_delete', 'prescription_num', 'product_name', 'common_name', 'product_price', 'mnemonic_code', 'product_type', 'product_platform_code', 'product_pharmacy_code', 'product_cover_img', 'product_spec', 'license_number', 'manufacturer', 'single_unit', 'single_use', 'packaging_unit', 'frequency_use', 'available_days', 'product_remarks', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "product_id";
|
||||
|
||||
|
||||
@ -132,4 +132,14 @@ class ReportRegulatory extends Model
|
||||
})
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测是否存在
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public static function getExists(array $params): bool
|
||||
{
|
||||
return self::where($params)->exists();
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,6 +226,7 @@ class BasicDataService extends BaseService
|
||||
$fields = [
|
||||
'product_id',
|
||||
'product_platform_id',
|
||||
'prescription_num',
|
||||
'product_name',
|
||||
'product_price',
|
||||
'product_cover_img',
|
||||
@ -239,7 +240,8 @@ class BasicDataService extends BaseService
|
||||
];
|
||||
|
||||
$params = array();
|
||||
|
||||
$params['product_status'] = 1;
|
||||
$params['is_delete'] = 0;
|
||||
$product = Product::getSearchKeywordList($params, $product_keyword,$fields);
|
||||
if (empty($product)) {
|
||||
return success();
|
||||
|
||||
@ -1091,7 +1091,6 @@ class InquiryService extends BaseService
|
||||
|
||||
$message = new AutoFinishInquiryDelayDirectProducer($data);
|
||||
$message->setDelayMs(1000 * 60 * 60 * 24 * 3);
|
||||
// $message->setDelayMs(1000 * 60 * 2);
|
||||
$producer = $this->container->get(Producer::class);
|
||||
$res = $producer->produce($message);
|
||||
if (!$res) {
|
||||
@ -1101,7 +1100,7 @@ class InquiryService extends BaseService
|
||||
Db::commit();
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
Log::getInstance()->error("错误:" . $e->getMessage());
|
||||
Log::getInstance("InquiryService-putFinishInquiry")->error($e->getMessage());
|
||||
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||
}
|
||||
|
||||
@ -1120,8 +1119,8 @@ class InquiryService extends BaseService
|
||||
// 患者-发送通知消息-患者的问诊服务结束
|
||||
$MessagePush = new MessagePush($order_inquiry['user_id'], $order_inquiry['order_inquiry_id']);
|
||||
$MessagePush->patientInquiryFinish();
|
||||
} catch (\Exception $e) {
|
||||
return success([], HttpEnumCode::HTTP_SUCCESS, "消息发送失败");
|
||||
} catch (\Throwable $e) {
|
||||
Log::getInstance("InquiryService-putFinishInquiry")->error($e->getMessage());
|
||||
}
|
||||
|
||||
return success();
|
||||
|
||||
38
app/Services/ReportRegulatoryService.php
Normal file
38
app/Services/ReportRegulatoryService.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Model\ReportRegulatory;
|
||||
|
||||
/**
|
||||
* 监管平台
|
||||
*/
|
||||
class ReportRegulatoryService extends BaseService
|
||||
{
|
||||
/**
|
||||
* 增加上报监管平台表
|
||||
* @param string $order_inquiry_id
|
||||
* @param string $order_prescription_id
|
||||
* @return bool
|
||||
*/
|
||||
protected function addReportRegulatory(string $order_inquiry_id,string $order_prescription_id): bool
|
||||
{
|
||||
// 检测是否已添加
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||
$res = ReportRegulatory::getExists($params);
|
||||
if ($res) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data['order_inquiry_id'] = $order_inquiry_id;
|
||||
$data['order_prescription_id'] = $order_prescription_id;
|
||||
$report_regulatory = ReportRegulatory::addReportRegulatory($data);
|
||||
if (empty($report_regulatory)){
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user