优化日志
Build Docker / build (push) Waiting to run

This commit is contained in:
haomingming
2026-01-06 09:26:25 +08:00
parent e825269798
commit 10e46b2f8c
2 changed files with 41 additions and 28 deletions
+30 -18
View File
@@ -82,10 +82,15 @@ class ReportRegulatoryCommand extends HyperfCommand
// 上报网络咨询
try {
$this->line("A、开始上报网络咨询");
//检测是否为抄方订单
$transferInquiryOrder = $this->checkTransferInquiryOrder($order_inquiry);
if(!$transferInquiryOrder){
$this->line("A-1、该问诊不上报网络咨询");
}
if ($report_regulatory['report_consult_status'] != 1 && $report_regulatory['report_consult_int'] < 5 && $transferInquiryOrder){
$this->line("上报网络咨询");
$this->line("A-2、上报网络咨询");
// 获取上报数据-网络咨询
$consult_data = $this->getConsultData($order_inquiry);
@@ -94,41 +99,46 @@ class ReportRegulatoryCommand extends HyperfCommand
$regulatoryPlatform = new regulatoryPlatform();
$result = $regulatoryPlatform->uploadConsult([$consult_data]);
$this->line("上报网络咨询成功" . json_encode($result,JSON_UNESCAPED_UNICODE));
$this->line("A-3、上报网络咨询成功" . json_encode($result,JSON_UNESCAPED_UNICODE));
// 修改上报状态-网络咨询
$res = $this->modifyReportConsultStatus($report_regulatory, 1);
if (!$res) {
// 记录失败
$this->line("上报成功,存储记录失败");
$this->line("A-4、上报成功,存储记录失败");
}
}
}catch (\Throwable $e){
$this->line("上报网络咨询失败" . $e->getMessage());
$this->line("A-5、上报网络咨询失败" . $e->getMessage());
// 上报失败
$res = $this->modifyReportConsultStatus($report_regulatory, 2, $e->getMessage());
if (!$res) {
// 记录失败
$this->line("上报网络咨询失败,存储记录失败");
$this->line("A-6、上报网络咨询失败,存储记录失败");
}
}
// 上报复诊
try {
$this->line("B、开始上报复诊");
//检测是否为抄方订单
$transferInquiryOrder = $this->checkTransferInquiryOrder($order_inquiry);
if(!$transferInquiryOrder){
$this->line("B-1、该问诊不上报复诊");
}
if ($report_regulatory['is_further_consult'] == 1 && $transferInquiryOrder){
if ($report_regulatory['report_further_consult_status'] != 1 && $report_regulatory['report_further_consult_int'] < 5) {
$this->line("上报复诊");
$this->line("B-2、上报复诊");
// 获取处方数据
$params = array();
$params['order_prescription_id'] = $report_regulatory['order_prescription_id'];
$order_prescription = OrderPrescription::getOne($params);
if (empty($order_prescription)){
$this->line("需上报复诊,但无处方数据");
$this->line("B-3、需上报复诊,但无处方数据");
}else{
// 获取上报数据-复诊
$further_consult_data = $this->getFurtherConsultData($order_inquiry,$order_prescription);
@@ -136,32 +146,31 @@ class ReportRegulatoryCommand extends HyperfCommand
// 上报复诊
$regulatoryPlatform = new regulatoryPlatform();
$result = $regulatoryPlatform->uploadFurtherConsult([$further_consult_data]);
$this->line("上报复诊成功" . json_encode($result,JSON_UNESCAPED_UNICODE));
$this->line("B-4、上报复诊成功" . json_encode($result,JSON_UNESCAPED_UNICODE));
// 修改上报状态-复诊
$res = $this->modifyReportFurtherConsultStatus($report_regulatory, 1);
if (!$res) {
// 记录失败
$this->line("上报成功,存储记录失败");
$this->line("B-5、上报成功,存储记录失败");
}
}
}
}
}catch (\Throwable $e){
$this->line("上报复诊失败" . $e->getMessage());
$this->line("B-6、上报复诊失败" . $e->getMessage());
// 上报失败
$res = $this->modifyReportFurtherConsultStatus($report_regulatory, 2, $e->getMessage());
if (!$res) {
// 记录失败
$this->line("上报复诊失败,存储记录失败");
$this->line("B-7、上报复诊失败,存储记录失败");
}
}
// 上报处方
try {
$this->line("上报处方");
$this->line("C、开始上报处方");
// 获取处方数据
$params = array();
$params['order_prescription_id'] = $report_regulatory['order_prescription_id'];
@@ -173,34 +182,37 @@ class ReportRegulatoryCommand extends HyperfCommand
//检测是否为抄方订单
$transferInquiryOrder = $this->checkTransferInquiryOrder($order_inquiry);
if($transferInquiryOrder){
$this->line("C-1、检测处方数据");
// 获取上报数据-处方
$report_prescription_data = $this->getReportPrescriptionData($order_inquiry, $order_prescription);
}else{
$this->line("C-2、检测处方(抄方)数据");
// 获取上报数据-处方 (抄方类型)
$report_prescription_data = $this->getReportTransferPrescriptionData($order_inquiry, $order_prescription);
}
$this->line("C-3、上报处方");
// 上报处方
$regulatoryPlatform = new regulatoryPlatform();
$result = $regulatoryPlatform->uploadRecipe([$report_prescription_data]);
$this->line("上报处方成功" . json_encode($result,JSON_UNESCAPED_UNICODE));
$this->line("C-4、上报处方成功" . json_encode($result,JSON_UNESCAPED_UNICODE));
// 上报成功
$res = $this->modifyReportRegulatoryPrescription($report_regulatory, 1);
if (!$res) {
// 记录失败
$this->line("上报处方失败,存储记录失败");
$this->line("C-5、上报处方失败,存储记录失败");
}
}
}catch (\Throwable $e){
$this->line("上报处方失败" . $e->getMessage());
$this->line("C-6、上报处方失败" . $e->getMessage());
// 上报失败
$res = $this->modifyReportRegulatoryPrescription($report_regulatory, 2, $e->getMessage());
if (!$res) {
// 记录失败
$this->line("上报复诊失败,存储记录失败");
$this->line("C-7、上报复诊失败,存储记录失败");
return ;
}
}
@@ -342,7 +354,7 @@ class ReportRegulatoryCommand extends HyperfCommand
{
//判断该问诊是否为抄方
if(!empty($order_inquiry['transfer_doctor_id'])){
$this->line("信息:该问诊为抄方类型,不执行");
$this->line("信息:该问诊为抄方类型");
return false;
}else{
$params = array();