更改下发token主键类型问题
This commit is contained in:
parent
21d483cc14
commit
67429ae31b
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Amqp\Consumer;
|
||||
|
||||
use App\Model\OrderPrescription;
|
||||
use App\Utils\Log;
|
||||
use Hyperf\Amqp\Message\ConsumerDelayedMessageTrait;
|
||||
use Hyperf\Amqp\Message\ProducerDelayedMessageTrait;
|
||||
@ -37,14 +38,72 @@ class PrescriptionExpiredDelayDirectConsumer extends ConsumerMessage
|
||||
|
||||
Db::beginTransaction();
|
||||
try {
|
||||
// 验证参数
|
||||
if (!isset($data['order_prescription_id'])){
|
||||
Db::rollBack();
|
||||
Log::getInstance()->error("自动取消未使用处方队列执行失败:入参错误");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 获取处方数据
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $data['order_prescription_id'];
|
||||
$order_prescription = OrderPrescription::getOne($params);
|
||||
if (empty($order_prescription)){
|
||||
Db::rollBack();
|
||||
Log::getInstance()->error("自动取消未使用处方队列执行失败:获取处方数据为空");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 检测处方审核、使用状态
|
||||
$res = $this->checkPrescriptionStatus($order_prescription);
|
||||
if (!$res){
|
||||
Db::rollBack();
|
||||
return Result::ACK;
|
||||
}
|
||||
|
||||
// 处理处方过期状态
|
||||
|
||||
|
||||
|
||||
Db::commit();
|
||||
Log::getInstance()->info("自动取消未使用处方队列执行成功");
|
||||
Log::getInstance()->info("自动取消未使用处方 队列执行成功");
|
||||
return Result::ACK;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
Log::getInstance()->error("自动完成问诊订单执行失败:" . $e->getMessage());
|
||||
Log::getInstance()->error("自动取消未使用处方 执行失败:" . $e->getMessage());
|
||||
return Result::ACK; // 重回队列
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测处方审核状态
|
||||
* @param array|object $order_prescription
|
||||
* @return bool
|
||||
*/
|
||||
protected function checkPrescriptionStatus(array|object $order_prescription): bool
|
||||
{
|
||||
if ($order_prescription['prescription_status'] == 3){
|
||||
Db::rollBack();
|
||||
Log::getInstance()->info("自动取消未使用处方队列执行失败:处方已失效,无需处理");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($order_prescription['prescription_status'] == 4){
|
||||
Db::rollBack();
|
||||
Log::getInstance()->info("自动取消未使用处方队列执行失败:处方已使用,无需处理");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 处理处方
|
||||
protected function handlePrescription(array|object $order_prescription){
|
||||
$pamras = array();
|
||||
$pamras['order_prescription_id'] = $order_prescription['order_prescription_id'];
|
||||
|
||||
$data = array();
|
||||
$data['prescription_status'] = 3;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,11 +38,6 @@ class Banner extends Model
|
||||
*/
|
||||
protected array $fillable = ['banner_id', 'banner_name', 'banner_path', 'app_type', 'client_type', 'banner_place', 'banner_status', 'open_with', 'title', 'sub_title', 'banner_sort', 'banner_link', 'remarks', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['banner_id' => 'string', 'app_type' => 'integer', 'client_type' => 'integer', 'banner_place' => 'integer', 'banner_status' => 'integer', 'open_with' => 'integer', 'banner_sort' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected string $primaryKey = "banner_id";
|
||||
|
||||
/**
|
||||
|
||||
@ -33,11 +33,6 @@ class BasicWord extends Model
|
||||
*/
|
||||
protected array $fillable = ['basics_words_id', 'basics_words_type', 'basics_words_status', 'sort', 'basics_words', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['basics_words_id' => 'string', 'basics_words_type' => 'integer', 'basics_words_status' => 'integer', 'sort' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected string $primaryKey = "basics_words_id";
|
||||
|
||||
/**
|
||||
|
||||
@ -34,11 +34,6 @@ class DiseaseClass extends Model
|
||||
*/
|
||||
protected array $fillable = ['disease_class_id', 'disease_class_name', 'expertise_id', 'disease_class_status', 'disease_class_enable', 'icd_id', 'is_hot', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['disease_class_id' => 'string', 'expertise_id' => 'string', 'disease_class_status' => 'integer', 'disease_class_enable' => 'integer', 'icd_id' => 'string', 'is_hot' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected string $primaryKey = "disease_class_id";
|
||||
|
||||
/**
|
||||
|
||||
@ -40,11 +40,6 @@ class User extends Model
|
||||
*/
|
||||
protected array $fillable = ['user_id', 'user_name', 'user_account', 'mobile', 'sex', 'avatar', 'wx_mobile', 'user_password', 'salt', 'user_type', 'user_status', 'register_method', 'login_ip', 'last_login_at', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['user_id' => 'string', 'user_type' => 'integer', 'user_status' => 'integer', 'register_method' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'sex' => 'integer'];
|
||||
|
||||
protected string $primaryKey = "user_id";
|
||||
|
||||
/**
|
||||
|
||||
@ -37,11 +37,6 @@ class UserCoupon extends Model
|
||||
*/
|
||||
protected array $fillable = ['user_coupon_id', 'user_id', 'patient_id', 'coupon_id', 'user_coupon_status', 'coupon_use_date', 'valid_start_time', 'valid_end_time', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['user_coupon_id' => 'string', 'user_id' => 'string', 'patient_id' => 'string', 'coupon_id' => 'string', 'user_coupon_status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected string $primaryKey = "user_coupon_id";
|
||||
|
||||
/**
|
||||
|
||||
@ -438,7 +438,6 @@ class DoctorAccountService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取医生账户余额
|
||||
* @param string $doctor_id
|
||||
|
||||
@ -205,10 +205,10 @@ class LoginService extends BaseService
|
||||
UserModel::editUser($params,$data);
|
||||
// 组合生成token的数据
|
||||
$token_user_data = array();
|
||||
$token_user_data['user_id'] = $user['user_id']; // 用户id
|
||||
$token_user_data['user_id'] = (string)$user['user_id']; // 用户id
|
||||
$token_user_data['user_type'] = $user['user_type'];// 用户类型
|
||||
$token_user_data['open_id'] = $wx_info_data['openid'];// open_id
|
||||
$token_user_data['client_user_id'] = $client_user_id;// 对应客户端id
|
||||
$token_user_data['client_user_id'] = (string)$client_user_id;// 对应客户端id
|
||||
|
||||
// 发放token
|
||||
$Jwt = new Jwt();
|
||||
@ -217,8 +217,8 @@ class LoginService extends BaseService
|
||||
// 组合返回数据
|
||||
$data = array();
|
||||
$data['token'] = $token;
|
||||
$data['user_id'] = $user['user_id'];
|
||||
$data['client_user_id'] = $client_user_id;
|
||||
$data['user_id'] = (string)$user['user_id'];
|
||||
$data['client_user_id'] = (string)$client_user_id;
|
||||
|
||||
Db::commit();
|
||||
return success($data);
|
||||
@ -394,10 +394,10 @@ class LoginService extends BaseService
|
||||
|
||||
// 组合生成token的数据
|
||||
$token_user_data = array();
|
||||
$token_user_data['user_id'] = $user['user_id']; // 用户id
|
||||
$token_user_data['user_id'] = (string)$user['user_id']; // 用户id
|
||||
$token_user_data['user_type'] = $user['user_type'];// 用户类型
|
||||
$token_user_data['open_id'] = $open_id ?? "";// open_id
|
||||
$token_user_data['client_user_id'] = $client_user_id;// 对应客户端id
|
||||
$token_user_data['client_user_id'] = (string)$client_user_id;// 对应客户端id
|
||||
|
||||
// 发放token
|
||||
$Jwt = new Jwt();
|
||||
@ -409,8 +409,8 @@ class LoginService extends BaseService
|
||||
// 组合返回数据
|
||||
$data = array();
|
||||
$data['token'] = $token;
|
||||
$data['user_id'] = $user['user_id'];
|
||||
$data['client_user_id'] = $client_user_id;
|
||||
$data['user_id'] = (string)$user['user_id'];
|
||||
$data['client_user_id'] = (string)$client_user_id;
|
||||
|
||||
Db::commit();
|
||||
return success($data);
|
||||
|
||||
@ -57,6 +57,9 @@ class OrderPrescriptionService extends BaseService
|
||||
{
|
||||
$params = array();
|
||||
$params['pharmacist_id'] = $pharmacist_id;
|
||||
if ($pharmacist_audit_status == 0 && $platform_audit_status == 0){
|
||||
$params['prescription_status'] = 1; // 处方状态(1:待审核 2:待使用 3:已失效 4:已使用)
|
||||
}
|
||||
$params['pharmacist_audit_status'] = $pharmacist_audit_status; // 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
$params['platform_audit_status'] = $platform_audit_status; // 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
|
||||
|
||||
@ -459,6 +459,7 @@ class UserDoctorService extends BaseService
|
||||
// 获取处方数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['prescription_status'] = 1;
|
||||
$params['pharmacist_audit_status'] = $pharmacist_audit_status;
|
||||
$params['is_delete'] = 0;
|
||||
$order_prescriptions = OrderPrescription::getWithIcdPage($params,['*'],$page,$per_page);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user