This commit is contained in:
parent
e825269798
commit
10e46b2f8c
@ -47,29 +47,29 @@ class ReportPreProductOrderCommand extends HyperfCommand
|
|||||||
*/
|
*/
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
$this->line("开始");
|
$this->line("==================开始==================");
|
||||||
|
|
||||||
// 获取可上报商品订单
|
// 获取可上报商品订单
|
||||||
$order_product_ids = $this->getExecProductOrder();
|
$order_product_ids = $this->getExecProductOrder();
|
||||||
if (empty($order_product_ids)){
|
if (empty($order_product_ids)){
|
||||||
$this->line("结束,无可上报的商品订单");
|
$this->line("==================结束,无可上报的商品订单==================");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($order_product_ids as $item){
|
foreach ($order_product_ids as $item){
|
||||||
$this->line("本次请求订单号:" . $item['order_product_id']);
|
$this->line("--本次请求订单号(order_product_id):" . $item['order_product_id']);
|
||||||
|
|
||||||
// 获取商品订单数据
|
// 获取商品订单数据
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['order_product_id'] = $item['order_product_id'];
|
$params['order_product_id'] = $item['order_product_id'];
|
||||||
$order_product = OrderProduct::getOne($params);
|
$order_product = OrderProduct::getOne($params);
|
||||||
if (empty($order_product)) {
|
if (empty($order_product)) {
|
||||||
$this->line("结束,商品订单数据错误");
|
$this->line("--结束,商品订单数据错误");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($order_product['report_pre_status'] == 1){
|
if ($order_product['report_pre_status'] == 1){
|
||||||
$this->line("结束,订单已上报");
|
$this->line("--结束,订单已上报");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,8 @@ class ReportPreProductOrderCommand extends HyperfCommand
|
|||||||
// 检测执行次数
|
// 检测执行次数
|
||||||
$res = $this->checkHandleNumber($item['order_product_id']);
|
$res = $this->checkHandleNumber($item['order_product_id']);
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
Log::getInstance("queue-AutoPharmacistCaVerify")->error("错误:超出最大执行次数或检测错误");
|
$this->line("--错误:超出最大执行次数或检测错误");
|
||||||
|
Log::getInstance("queue-AutoPharmacistCaVerify")->error("--错误:超出最大执行次数或检测错误");
|
||||||
|
|
||||||
// 修改药品订单表上报处方平台状态
|
// 修改药品订单表上报处方平台状态
|
||||||
$this->saveOrderProductPeportPreStatus($item['order_product_id'],2,"超出最大上报次数");
|
$this->saveOrderProductPeportPreStatus($item['order_product_id'],2,"超出最大上报次数");
|
||||||
@ -129,7 +130,7 @@ class ReportPreProductOrderCommand extends HyperfCommand
|
|||||||
}catch(\Exception $e){
|
}catch(\Exception $e){
|
||||||
Db::rollBack();
|
Db::rollBack();
|
||||||
// 记录失败次数
|
// 记录失败次数
|
||||||
$this->line("错误:" . $e->getMessage());
|
$this->line("--错误:" . $e->getMessage());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,16 +142,16 @@ class ReportPreProductOrderCommand extends HyperfCommand
|
|||||||
// 修改药品订单表上报处方平台状态
|
// 修改药品订单表上报处方平台状态
|
||||||
$this->saveOrderProductPeportPreStatus($item['order_product_id'],1);
|
$this->saveOrderProductPeportPreStatus($item['order_product_id'],1);
|
||||||
|
|
||||||
$this->line("成功");
|
$this->line("--成功");
|
||||||
Db::commit();
|
Db::commit();
|
||||||
continue;
|
continue;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Db::rollBack();
|
Db::rollBack();
|
||||||
$this->line("错误" . $e->getMessage());
|
$this->line("--错误" . $e->getMessage());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->line("全部结束");
|
$this->line("==================全部结束==================");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -82,10 +82,15 @@ class ReportRegulatoryCommand extends HyperfCommand
|
|||||||
|
|
||||||
// 上报网络咨询
|
// 上报网络咨询
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
$this->line("A、开始上报网络咨询");
|
||||||
//检测是否为抄方订单
|
//检测是否为抄方订单
|
||||||
$transferInquiryOrder = $this->checkTransferInquiryOrder($order_inquiry);
|
$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){
|
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);
|
$consult_data = $this->getConsultData($order_inquiry);
|
||||||
@ -94,41 +99,46 @@ class ReportRegulatoryCommand extends HyperfCommand
|
|||||||
$regulatoryPlatform = new regulatoryPlatform();
|
$regulatoryPlatform = new regulatoryPlatform();
|
||||||
$result = $regulatoryPlatform->uploadConsult([$consult_data]);
|
$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);
|
$res = $this->modifyReportConsultStatus($report_regulatory, 1);
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
// 记录失败
|
// 记录失败
|
||||||
$this->line("上报成功,存储记录失败");
|
$this->line("A-4、上报成功,存储记录失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}catch (\Throwable $e){
|
}catch (\Throwable $e){
|
||||||
$this->line("上报网络咨询失败" . $e->getMessage());
|
$this->line("A-5、上报网络咨询失败" . $e->getMessage());
|
||||||
|
|
||||||
// 上报失败
|
// 上报失败
|
||||||
$res = $this->modifyReportConsultStatus($report_regulatory, 2, $e->getMessage());
|
$res = $this->modifyReportConsultStatus($report_regulatory, 2, $e->getMessage());
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
// 记录失败
|
// 记录失败
|
||||||
$this->line("上报网络咨询失败,存储记录失败");
|
$this->line("A-6、上报网络咨询失败,存储记录失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 上报复诊
|
// 上报复诊
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
$this->line("B、开始上报复诊");
|
||||||
//检测是否为抄方订单
|
//检测是否为抄方订单
|
||||||
$transferInquiryOrder = $this->checkTransferInquiryOrder($order_inquiry);
|
$transferInquiryOrder = $this->checkTransferInquiryOrder($order_inquiry);
|
||||||
|
if(!$transferInquiryOrder){
|
||||||
|
$this->line("B-1、该问诊不上报复诊");
|
||||||
|
}
|
||||||
if ($report_regulatory['is_further_consult'] == 1 && $transferInquiryOrder){
|
if ($report_regulatory['is_further_consult'] == 1 && $transferInquiryOrder){
|
||||||
if ($report_regulatory['report_further_consult_status'] != 1 && $report_regulatory['report_further_consult_int'] < 5) {
|
if ($report_regulatory['report_further_consult_status'] != 1 && $report_regulatory['report_further_consult_int'] < 5) {
|
||||||
$this->line("上报复诊");
|
$this->line("B-2、上报复诊");
|
||||||
|
|
||||||
// 获取处方数据
|
// 获取处方数据
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['order_prescription_id'] = $report_regulatory['order_prescription_id'];
|
$params['order_prescription_id'] = $report_regulatory['order_prescription_id'];
|
||||||
$order_prescription = OrderPrescription::getOne($params);
|
$order_prescription = OrderPrescription::getOne($params);
|
||||||
if (empty($order_prescription)){
|
if (empty($order_prescription)){
|
||||||
$this->line("需上报复诊,但无处方数据");
|
$this->line("B-3、需上报复诊,但无处方数据");
|
||||||
}else{
|
}else{
|
||||||
// 获取上报数据-复诊
|
// 获取上报数据-复诊
|
||||||
$further_consult_data = $this->getFurtherConsultData($order_inquiry,$order_prescription);
|
$further_consult_data = $this->getFurtherConsultData($order_inquiry,$order_prescription);
|
||||||
@ -136,32 +146,31 @@ class ReportRegulatoryCommand extends HyperfCommand
|
|||||||
// 上报复诊
|
// 上报复诊
|
||||||
$regulatoryPlatform = new regulatoryPlatform();
|
$regulatoryPlatform = new regulatoryPlatform();
|
||||||
$result = $regulatoryPlatform->uploadFurtherConsult([$further_consult_data]);
|
$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);
|
$res = $this->modifyReportFurtherConsultStatus($report_regulatory, 1);
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
// 记录失败
|
// 记录失败
|
||||||
$this->line("上报成功,存储记录失败");
|
$this->line("B-5、上报成功,存储记录失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}catch (\Throwable $e){
|
}catch (\Throwable $e){
|
||||||
$this->line("上报复诊失败" . $e->getMessage());
|
$this->line("B-6、上报复诊失败" . $e->getMessage());
|
||||||
|
|
||||||
// 上报失败
|
// 上报失败
|
||||||
$res = $this->modifyReportFurtherConsultStatus($report_regulatory, 2, $e->getMessage());
|
$res = $this->modifyReportFurtherConsultStatus($report_regulatory, 2, $e->getMessage());
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
// 记录失败
|
// 记录失败
|
||||||
$this->line("上报复诊失败,存储记录失败");
|
$this->line("B-7、上报复诊失败,存储记录失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上报处方
|
// 上报处方
|
||||||
try {
|
try {
|
||||||
$this->line("上报处方");
|
$this->line("C、开始上报处方");
|
||||||
|
|
||||||
// 获取处方数据
|
// 获取处方数据
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['order_prescription_id'] = $report_regulatory['order_prescription_id'];
|
$params['order_prescription_id'] = $report_regulatory['order_prescription_id'];
|
||||||
@ -173,34 +182,37 @@ class ReportRegulatoryCommand extends HyperfCommand
|
|||||||
//检测是否为抄方订单
|
//检测是否为抄方订单
|
||||||
$transferInquiryOrder = $this->checkTransferInquiryOrder($order_inquiry);
|
$transferInquiryOrder = $this->checkTransferInquiryOrder($order_inquiry);
|
||||||
if($transferInquiryOrder){
|
if($transferInquiryOrder){
|
||||||
|
$this->line("C-1、检测处方数据");
|
||||||
// 获取上报数据-处方
|
// 获取上报数据-处方
|
||||||
$report_prescription_data = $this->getReportPrescriptionData($order_inquiry, $order_prescription);
|
$report_prescription_data = $this->getReportPrescriptionData($order_inquiry, $order_prescription);
|
||||||
}else{
|
}else{
|
||||||
|
$this->line("C-2、检测处方(抄方)数据");
|
||||||
// 获取上报数据-处方 (抄方类型)
|
// 获取上报数据-处方 (抄方类型)
|
||||||
$report_prescription_data = $this->getReportTransferPrescriptionData($order_inquiry, $order_prescription);
|
$report_prescription_data = $this->getReportTransferPrescriptionData($order_inquiry, $order_prescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->line("C-3、上报处方");
|
||||||
// 上报处方
|
// 上报处方
|
||||||
$regulatoryPlatform = new regulatoryPlatform();
|
$regulatoryPlatform = new regulatoryPlatform();
|
||||||
$result = $regulatoryPlatform->uploadRecipe([$report_prescription_data]);
|
$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);
|
$res = $this->modifyReportRegulatoryPrescription($report_regulatory, 1);
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
// 记录失败
|
// 记录失败
|
||||||
$this->line("上报处方失败,存储记录失败");
|
$this->line("C-5、上报处方失败,存储记录失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}catch (\Throwable $e){
|
}catch (\Throwable $e){
|
||||||
$this->line("上报处方失败" . $e->getMessage());
|
$this->line("C-6、上报处方失败" . $e->getMessage());
|
||||||
|
|
||||||
// 上报失败
|
// 上报失败
|
||||||
$res = $this->modifyReportRegulatoryPrescription($report_regulatory, 2, $e->getMessage());
|
$res = $this->modifyReportRegulatoryPrescription($report_regulatory, 2, $e->getMessage());
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
// 记录失败
|
// 记录失败
|
||||||
$this->line("上报复诊失败,存储记录失败");
|
$this->line("C-7、上报复诊失败,存储记录失败");
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -342,7 +354,7 @@ class ReportRegulatoryCommand extends HyperfCommand
|
|||||||
{
|
{
|
||||||
//判断该问诊是否为抄方
|
//判断该问诊是否为抄方
|
||||||
if(!empty($order_inquiry['transfer_doctor_id'])){
|
if(!empty($order_inquiry['transfer_doctor_id'])){
|
||||||
$this->line("信息:该问诊为抄方类型,不执行");
|
$this->line("信息:该问诊为抄方类型");
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
$params = array();
|
$params = array();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user