@@ -47,29 +47,29 @@ class ReportPreProductOrderCommand extends HyperfCommand
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$this->line("开始");
|
||||
$this->line("==================开始==================");
|
||||
|
||||
// 获取可上报商品订单
|
||||
$order_product_ids = $this->getExecProductOrder();
|
||||
if (empty($order_product_ids)){
|
||||
$this->line("结束,无可上报的商品订单");
|
||||
$this->line("==================结束,无可上报的商品订单==================");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($order_product_ids as $item){
|
||||
$this->line("本次请求订单号:" . $item['order_product_id']);
|
||||
$this->line("--本次请求订单号(order_product_id):" . $item['order_product_id']);
|
||||
|
||||
// 获取商品订单数据
|
||||
$params = array();
|
||||
$params['order_product_id'] = $item['order_product_id'];
|
||||
$order_product = OrderProduct::getOne($params);
|
||||
if (empty($order_product)) {
|
||||
$this->line("结束,商品订单数据错误");
|
||||
$this->line("--结束,商品订单数据错误");
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($order_product['report_pre_status'] == 1){
|
||||
$this->line("结束,订单已上报");
|
||||
$this->line("--结束,订单已上报");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,8 @@ class ReportPreProductOrderCommand extends HyperfCommand
|
||||
// 检测执行次数
|
||||
$res = $this->checkHandleNumber($item['order_product_id']);
|
||||
if (!$res) {
|
||||
Log::getInstance("queue-AutoPharmacistCaVerify")->error("错误:超出最大执行次数或检测错误");
|
||||
$this->line("--错误:超出最大执行次数或检测错误");
|
||||
Log::getInstance("queue-AutoPharmacistCaVerify")->error("--错误:超出最大执行次数或检测错误");
|
||||
|
||||
// 修改药品订单表上报处方平台状态
|
||||
$this->saveOrderProductPeportPreStatus($item['order_product_id'],2,"超出最大上报次数");
|
||||
@@ -129,7 +130,7 @@ class ReportPreProductOrderCommand extends HyperfCommand
|
||||
}catch(\Exception $e){
|
||||
Db::rollBack();
|
||||
// 记录失败次数
|
||||
$this->line("错误:" . $e->getMessage());
|
||||
$this->line("--错误:" . $e->getMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -141,16 +142,16 @@ class ReportPreProductOrderCommand extends HyperfCommand
|
||||
// 修改药品订单表上报处方平台状态
|
||||
$this->saveOrderProductPeportPreStatus($item['order_product_id'],1);
|
||||
|
||||
$this->line("成功");
|
||||
$this->line("--成功");
|
||||
Db::commit();
|
||||
continue;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
$this->line("错误" . $e->getMessage());
|
||||
$this->line("--错误" . $e->getMessage());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$this->line("全部结束");
|
||||
$this->line("==================全部结束==================");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user