wugg 6 months ago
parent
commit
e5bd840335

+ 5 - 2
app/admin/command/CheckInvoice.php

@@ -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){

+ 5 - 3
app/admin/command/CheckTicket.php

@@ -15,6 +15,7 @@ use think\console\Output;use think\facade\Db;
 class CheckTicket extends Command
 {
     protected $dateTime;
+    protected $output;
     protected function configure()
     {
         // 指令配置
@@ -25,12 +26,13 @@ class CheckTicket extends Command
     protected function execute(Input $input, Output $output)
     {
         $this->dateTime = date("Y-m-d H:i:s");
-     #   if(Cache::get('checkTicketP')==1)return;
+        if(Cache::get('checkTicketP')==1)return;
+        $this->output=$output;
         $ticket = $this->getTicket();
         while ($ticket->valid()) {
             Cache::set('checkTicketP',1,1800);
             $data = $ticket->current();
-            echo  $data['invNo']."\r\n";
+            $this->output->writeln('[' . date(DATE_W3C) . ']' . $ticket['invNo'] . '验票');
             $this->checkTicket($data);
             $ticket->next();
         }
@@ -67,7 +69,7 @@ class CheckTicket extends Command
         if($info['inv_type']!="016")$checkNum= substr($info['check_code'],-6);
         if(in_array($info['inv_type'],["022",'021'])) $subtotal= $info['inv_total'];
         $result=$Tax->CheckInvoiceSingle( $checkNum,$subtotal,$info['inv_code'],$info['inv_number'],$opentime,$info['inv_type']);
-        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){

+ 2 - 2
app/admin/controller/Payment.php

@@ -1736,8 +1736,8 @@ class Payment extends Base
             $value['has_account'] = (int)isset($supp_account['data'][$value['supplierNo']]);
             if($value['status']==4){
                 $inv_fee += $value['inv_fee'];
-                $inv_subtotal_amount += $value['inv_subtotal_amount'];
-                $total += $value['total'];
+                $inv_subtotal_amount += intval($value['inv_subtotal_amount']??0);
+                $total += intval($value['total']??0);
             }
 
         }

+ 2 - 2
app/admin/listener/ComonQrd.php

@@ -108,7 +108,7 @@ class ComonQrd
     	$qrdinfo = QrdInfo::where([["sequenceNo","in",$qrdNo],["wpay_fee",">",0]])->select();
     	if($qrdinfo->isEmpty())return;
     	$this->CheckComonOrder($payinfo);
-    	$tagInfo = TagLog::where(["code"=>$qrdNo,"tag_id"=>10,"status"=>1])->column("id,code,tag_id,creater,createrid,tag_fee,tag_img,status","code");
+    	$tagInfo = TagLog::where(["code"=>$qrdNo,"tag_id"=>108,"status"=>1])->column("id,code,tag_id,creater,createrid,tag_fee,tag_img,status","code");
     	$tag=[];
     	$qrdSave=[];
         $payfee=$data['pay_fee'];
@@ -165,7 +165,7 @@ class ComonQrd
             ->select();
         if ($qrdinfo->isEmpty()) return;
         $this->CheckComonOrder($payinfo);
-        $tagInfo = TagLog::where(['code'=>$qrdNo,'tag_id'=>10,'status'=>1])->column('id,code,tag_id,creater,createrid,tag_fee,tag_img,status','code');
+        $tagInfo = TagLog::where(['code'=>$qrdNo,'tag_id'=>108,'status'=>1])->column('id,code,tag_id,creater,createrid,tag_fee,tag_img,status','code');
 
         $qrdSave =$tagsave =$del= [];
          $payfee=$data['pay_fee'];