wugg 3 months ago
parent
commit
a0b7dbd916

+ 46 - 0
app/cxinv/command/CreateFz.php

@@ -0,0 +1,46 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\cxinv\command;
+
+use app\cxinv\model\ProductFz;use app\user\model\Business;use think\console\Command;
+use think\console\Input;
+use think\console\input\Argument;
+use think\console\input\Option;
+use think\console\Output;
+
+class CreateFz extends Command
+{
+    protected function configure()
+    {
+        // 指令配置
+        $this->setName('createfz')
+            ->setDescription('the createfz command');
+    }
+
+    protected function execute(Input $input, Output $output)
+    {
+        $list = Business::where([["status","=",1],["is_del","=",0]])->select();
+        foreach ($list as $item){
+            $this->createFz($item);
+        }
+        // 指令输出
+        $output->writeln('createfz');
+    }
+
+    public function createFz($item){
+        $fz_date = date('Y-m');
+        $fzInfo = ProductFz::where([['company_code','=',$item['inv_code']],['fz_date','=',$fz_date]])->findOrEmpty();
+        if($fzInfo->isEmpty()){
+            $fzInfo = [
+                "fzCode"=>makeNo("CWFZ"),
+                'company_code'=>$item['inv_code'],
+                'company_name'=>$item['company'],
+                'fz_date'=>$fz_date,
+                'status'=>0,
+                'remark'=>'',
+            ];
+            (new ProductFz)->save($fzInfo);
+        }
+    }
+}

+ 9 - 0
app/cxinv/controller/FinancialSeal.php

@@ -26,6 +26,15 @@ class FinancialSeal extends Base{
         $list = $this->model->where($where)->order('id desc')->paginate(['list_rows'=>$params['size'],'page'=>$params['page']]);
         $list = $this->model->where($where)->order('id desc')->paginate(['list_rows'=>$params['size'],'page'=>$params['page']]);
        return success('获取成功',['list'=>$list->items(),'count'=>$list->total()]);
        return success('获取成功',['list'=>$list->items(),'count'=>$list->total()]);
     }
     }
+
+    public function getQuery(){
+         $params = $this->request->param(['company_code'=>'','status'=>''],'post','trim');
+         $where=[];
+         if($params['company_code']!='') $where[]=['company_code','=',$params['company_code']];
+         if($params['status']!='') $where[]=['status','=',$params['status']];
+         $list=$this->model->where($where)->select();
+         return success('获取成功',$list);
+    }
     //0解封 1封账中 2 封账完成 3 封账失败
     //0解封 1封账中 2 封账完成 3 封账失败
     public function status(){
     public function status(){
         $params = $this->request->param(["id"=>"","status"=>""],"post","trim");
         $params = $this->request->param(["id"=>"","status"=>""],"post","trim");

+ 1 - 0
app/cxinv/model/ProductFz.php

@@ -10,6 +10,7 @@ class ProductFz extends Base
         'company_code'  =>'varchar',//业务公司编号
         'company_code'  =>'varchar',//业务公司编号
         'company_name'  =>'varchar',//业务公司名称
         'company_name'  =>'varchar',//业务公司名称
         'fz_date'  =>'varchar',//封账月份
         'fz_date'  =>'varchar',//封账月份
+        'remark'  =>'varchar',
         'status'  =>'tinyint',//
         'status'  =>'tinyint',//
         'apply_id'  =>'int',//
         'apply_id'  =>'int',//
         'apply_name'  =>'varchar',//
         'apply_name'  =>'varchar',//

+ 2 - 0
config/console.php

@@ -13,5 +13,7 @@ return [
     	"checkinvoice"=>\app\cxinv\command\CheckInvoice::class,
     	"checkinvoice"=>\app\cxinv\command\CheckInvoice::class,
     	"checktrade"=>\app\cxinv\command\CheckTrade::class,
     	"checktrade"=>\app\cxinv\command\CheckTrade::class,
     	"postinfo"=>\app\admin\command\PostInfo::class,
     	"postinfo"=>\app\admin\command\PostInfo::class,
+    	"createfz"=>\app\cxinv\command\CreateFz::class,
+    	"makeseal"=>\app\cxinv\command\MakeSeal::class,
     ],
     ],
 ];
 ];