|
@@ -16,6 +16,7 @@ class CheckInvoice extends Command
|
|
|
protected $taxStatus = [
|
|
|
'Y'=>'2','N'=>'1','H'=>'3'
|
|
|
];
|
|
|
+ protected $output;
|
|
|
protected function configure()
|
|
|
{
|
|
|
// 指令配置
|
|
@@ -29,11 +30,13 @@ class CheckInvoice extends Command
|
|
|
$list = $this->getInvoice();
|
|
|
$invoice =Config::get('invoiceType');
|
|
|
$this->InvoiceNum = $invoice['KingInvoice'];
|
|
|
+ $this->output=$output;
|
|
|
if(Cache::get('checkInvoiceP')==1)return;
|
|
|
while ($list->valid()){
|
|
|
Cache::set('checkInvoiceP',1,1800);
|
|
|
$invoice = $list->current();
|
|
|
$this->checkTicket($invoice);
|
|
|
+ $this->output->writeln("[".date(DATE_W3C)."]".$invoice['hpNo']."验票");
|
|
|
$list->next();
|
|
|
}
|
|
|
Cache::set('checkInvoiceP',0);
|
|
@@ -41,7 +44,7 @@ class CheckInvoice extends Command
|
|
|
}
|
|
|
|
|
|
protected function getInvoice(){
|
|
|
- $list = PayInvoice::where([["status","in",[1,9]],["open_time","<",$this->datetime],["updatetime","<=",date("Y-m-d H:i:s")]])->cursor();
|
|
|
+ $list = PayInvoice::where([["status","in",[1,9]],["open_time","<",$this->datetime],["updatetime","<=",date("Y-m-d H:i:s")],['is_del',"=",0]])->cursor();
|
|
|
foreach ($list as $item){
|
|
|
yield $item;
|
|
|
}
|
|
@@ -65,7 +68,7 @@ class CheckInvoice extends Command
|
|
|
if(!in_array($invNum,['012','022',"028"]))$checkNum= substr($invoice['checkNumber'],-6);
|
|
|
if(in_array($invNum,['021','022'])) $subtotal= $invoice['inv_amount'];
|
|
|
$result=$Tax->CheckInvoiceSingle( $checkNum,$subtotal,$invoice['invoiceCode'],$invoice['invoiceNumber'],$opentime,$invNum);;
|
|
|
- echo json_encode($result,JSON_UNESCAPED_UNICODE);
|
|
|
+ $this->output->writeln('[' . date(DATE_W3C) . ']' . json_encode($result,JSON_UNESCAPED_UNICODE));
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
if(isset($result['code']) && $result['code']=='0000' and count($result['data'])>0){
|