修改上报数据
This commit is contained in:
@@ -1354,18 +1354,18 @@ class CallBackController extends AbstractController
|
||||
}
|
||||
|
||||
// 检测签名
|
||||
// $params = array();
|
||||
// $params['app_id'] = $request_params['appId'];
|
||||
// $basic_detection_organ = BasicDetectionOrgan::getOne($params);
|
||||
// if (empty($basic_detection_organ)){
|
||||
// return $this->detectionResultFailReturn("非法appId");
|
||||
// }
|
||||
//
|
||||
// $time = date('Y-m-d');
|
||||
// $sign = md5($basic_detection_organ['app_id'] . $basic_detection_organ['app_secret'] . $time);
|
||||
// if ($auth != $sign){
|
||||
// return $this->detectionResultFailReturn("签名错误");
|
||||
// }
|
||||
$params = array();
|
||||
$params['app_id'] = $request_params['appId'];
|
||||
$basic_detection_organ = BasicDetectionOrgan::getOne($params);
|
||||
if (empty($basic_detection_organ)){
|
||||
return $this->detectionResultFailReturn("非法appId");
|
||||
}
|
||||
|
||||
$time = date('Y-m-d');
|
||||
$sign = md5($basic_detection_organ['app_id'] . $basic_detection_organ['app_secret'] . $time);
|
||||
if ($auth != $sign){
|
||||
return $this->detectionResultFailReturn("签名错误");
|
||||
}
|
||||
|
||||
// 检测pdf文件
|
||||
$pdfData = base64_decode($request_params['pdfReport']);
|
||||
@@ -1392,9 +1392,9 @@ class CallBackController extends AbstractController
|
||||
return $this->detectionResultSuccessReturn();
|
||||
}
|
||||
|
||||
// if ($order_detection['detection_bar_code'] != $request_params['detectBarcode']){
|
||||
// return $this->detectionResultFailReturn("检测条码无法对应");
|
||||
// }
|
||||
if ($order_detection['detection_bar_code'] != $request_params['detectBarcode']){
|
||||
return $this->detectionResultFailReturn("检测条码无法对应");
|
||||
}
|
||||
|
||||
// 获取医生数据
|
||||
$params = array();
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Model\Area;
|
||||
use App\Model\BasicCompany;
|
||||
use App\Model\BasicDetectionOrgan;
|
||||
use App\Model\BasicNation;
|
||||
use App\Model\DetectionProject;
|
||||
use App\Model\DetectionProjectPurpose;
|
||||
@@ -537,6 +538,10 @@ class DetectionService extends BaseService
|
||||
$detection_pic = PcreMatch::pregRemoveOssWebsite($detection_pic);
|
||||
}
|
||||
|
||||
if (!isset($detection_pic)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"上传图片失败");
|
||||
}
|
||||
|
||||
// 检测检测管编码是否已被使用
|
||||
$params = array();
|
||||
$params['detection_bar_code'] = $request_params['detection_bar_code'];
|
||||
@@ -545,21 +550,28 @@ class DetectionService extends BaseService
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"检测管已被使用");
|
||||
}
|
||||
|
||||
// 计算检测机构
|
||||
$detection_organ_id = 1;
|
||||
// 获取检测码对应的检测所
|
||||
$detection_organ_code = substr($request_params['detection_bar_code'], 3, 1);
|
||||
if (!$detection_organ_code){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"检测码错误");
|
||||
}
|
||||
|
||||
// 获取检测所数据
|
||||
$params = array();
|
||||
$params['detection_organ_code'] = $detection_organ_code;
|
||||
$basic_detection_organ = BasicDetectionOrgan::getOne($params);
|
||||
if (empty($basic_detection_organ)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"检测码错误");
|
||||
}
|
||||
|
||||
Db::beginTransaction();
|
||||
try {
|
||||
// 上报数据
|
||||
$wy = new Wy($detection_organ_id);
|
||||
$wy->report($order_detection);
|
||||
|
||||
// 修改检测订单
|
||||
$data = array();
|
||||
$data['detection_pic'] = $detection_pic ?? "";
|
||||
$data['detection_pic'] = $detection_pic;
|
||||
$data['detection_bar_code'] = $request_params['detection_bar_code'];
|
||||
$data['detection_status'] = 3;
|
||||
$data['detection_organ_id'] = $detection_organ_id;// 检测机构id
|
||||
$data['detection_organ_id'] = $basic_detection_organ['detection_organ_id'];// 检测机构id
|
||||
$data['detection_time'] = date('Y-m-d H:i:s', time());// 上传检测时间
|
||||
|
||||
$params = array();
|
||||
@@ -570,11 +582,15 @@ class DetectionService extends BaseService
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"绑定失败");
|
||||
}
|
||||
|
||||
// 上报数据
|
||||
$wy = new Wy($basic_detection_organ['detection_organ_id']);
|
||||
$wy->report($order_detection_id);
|
||||
|
||||
Db::commit();
|
||||
}catch (\Throwable $e){
|
||||
Db::rollBack();
|
||||
Log::getInstance("DetectionService-bindDetectionTube")->error($e->getMessage());
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "绑定失败");
|
||||
return fail(HttpEnumCode::HTTP_ERROR, $e->getMessage());
|
||||
}
|
||||
|
||||
return success();
|
||||
|
||||
Reference in New Issue
Block a user