新增对接检测所,新增医生短信推送
This commit is contained in:
@@ -20,6 +20,7 @@ use App\Model\UserDoctor;
|
||||
use App\Model\UserLocation;
|
||||
use App\Utils\Log;
|
||||
use App\Utils\PcreMatch;
|
||||
use Extend\Detection\Wy;
|
||||
use Extend\Wechat\WechatPay;
|
||||
use Hyperf\Amqp\Producer;
|
||||
use Hyperf\DbConnection\Db;
|
||||
@@ -537,16 +538,27 @@ class DetectionService extends BaseService
|
||||
$detection_pic = PcreMatch::pregRemoveOssWebsite($detection_pic);
|
||||
}
|
||||
|
||||
// 获取检测所
|
||||
// 检测检测管编码是否已被使用
|
||||
$params = array();
|
||||
$params['detection_bar_code'] = $request_params['detection_bar_code'];
|
||||
$result = OrderDetection::getOne($params);
|
||||
if (!empty($result)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"检测管已被使用");
|
||||
}
|
||||
|
||||
Db::beginTransaction();
|
||||
try {
|
||||
// 上报数据
|
||||
$wy = new Wy($order_detection['detection_organ_id']);
|
||||
$wy->report($order_detection);
|
||||
|
||||
// 修改检测订单
|
||||
$data = array();
|
||||
$data['detection_pic'] = $detection_pic ?? "";
|
||||
$data['detection_bar_code'] = $request_params['detection_bar_code'];
|
||||
$data['detection_status'] = 3;
|
||||
$data['detection_organ_id'] = 1;// 检测机构id
|
||||
$data['detection_time'] = date('Y-m-d H:i:s', time());// 上传检测时间
|
||||
|
||||
$params = array();
|
||||
$params['order_detection_id'] = $order_detection_id;
|
||||
@@ -556,12 +568,11 @@ class DetectionService extends BaseService
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"绑定失败");
|
||||
}
|
||||
|
||||
// 上报数据
|
||||
|
||||
Db::commit();
|
||||
}catch (\Exception $e){
|
||||
}catch (\Throwable $e){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::HTTP_ERROR, $e->getMessage());
|
||||
Log::getInstance("DetectionService-bindDetectionTube")->error($e->getMessage());
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "绑定失败");
|
||||
}
|
||||
|
||||
return success();
|
||||
|
||||
Reference in New Issue
Block a user