wuggemail@foxmail.com 3 months ago
parent
commit
4fe0c5bee6

+ 62 - 17
app/common.php

@@ -93,26 +93,71 @@ if(!function_exists('__')){
 };
 if(!function_exists('UploadImg')){
     function UploadImg($files){
-         $savename = [];
-    $files = !is_array($files) ? [$files] : $files;
-    try {
-        //验证
-        validate(['imgFile' => ['fileSize' => 10240000, 'fileExt' => 'jpg,jpeg,png,bmp,gif', 'fileMime' => 'image/jpeg,image/png,image/gif']])->check(['imgFile' => $files]);
+        $savename = [];
+        $files = !is_array($files) ? [$files] : $files;
+        try {
+            //验证
+            validate(['imgFile' => ['fileSize' => 10240000, 'fileExt' => 'jpg,jpeg,png,bmp,gif', 'fileMime' => 'image/jpeg,image/png,image/gif']])->check(['imgFile' => $files]);
 
-        foreach ($files as $file) {
-            $url = Filesystem::disk('public')->putFile('topic/' . date('Ymd'), $file, function () use ($file) {
-                return str_replace('.' . $file->getOriginalExtension(), '', $file->getOriginalName() . '_' . date('YmdHis'));
-            });
-            $name = str_replace('.' . $file->getOriginalExtension(), '', $file->getOriginalName());
-            $temp = ['url' => $url, 'name' => $name];
-            $savename[] = $temp;
-        }
+            foreach ($files as $file) {
+                $url = Filesystem::disk('public')->putFile('topic/' . date('Ymd'), $file, function () use ($file) {
+                    return str_replace('.' . $file->getOriginalExtension(), '', $file->getOriginalName() . '_' . date('YmdHis'));
+                });
+                $name = str_replace('.' . $file->getOriginalExtension(), '', $file->getOriginalName());
+                $temp = ['url' => $url, 'name' => $name];
+                $savename[] = $temp;
+            }
 
-        return $savename;
-    } catch (\think\exception\ValidateException $e) {
-            throw new \think\Exception($e->getMessage());
+            return $savename;
+        } catch (\think\exception\ValidateException $e) {
+                throw new \think\Exception($e->getMessage());
+        }
+   }
+}
+if(!function_exists('exportExcel')){
+    /**
+     * @param $data  数据集和 二维数组
+     * @param $header  表头 一维数组
+     * @param $filename  文件名
+     * @return \PHPExcel
+     */
+    function exportExcel($data,$header, $filename){
+        $objPHPExcel = new \PHPExcel();
+        $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
+            ->setLastModifiedBy("Maarten Balliauw")
+            ->setTitle("Office 2007 XLSX Test Document")
+            ->setSubject("Office 2007 XLSX Test Document")
+            ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
+            ->setKeywords("office 2007 openxml php")
+            ->setCategory("Test result file");
+        $objPHPExcel->setActiveSheetIndex(0);
+        //制作表头  header为一维数组
+        $i=0;
+        foreach ($header as $key=>$value){
+            $objPHPExcel->getActiveSheet()->setCellValue(chr(65 + $i) . ($key + 1),$value);
+            $i++;
+        }
+        //制作数据  data为二维数组
+        $j=2;
+        foreach ($data as $key=>$value){
+            $k=0;
+            foreach ($value as $k1=>$v1){
+                $objPHPExcel->getActiveSheet()->setCellValue(chr(65+$k).$j,$v1);
+                //设置纯文本格式字符串
+                $objPHPExcel->getActiveSheet()->getStyle(chr(65+$k).$j)->getNumberFormat()->setFormatCode(\PHPExcel_Style_NumberFormat::FORMAT_TEXT);
+                $k++;
+            }
+            $j++;
+        }
+        //文件导出
+        header('Content-Type: application/vnd.ms-excel');
+        header("Content-Disposition: attachment;filename=$filename.xls");
+        header('Cache-Control: max-age=0');
+        $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
+        $objWriter->save('php://output');
+        exit;
     }
-  }
+
 }
 
 if(!function_exists('validate_invoice_info')){

+ 69 - 0
app/cxinv/controller/FinancialCancel.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace app\cxinv\controller;
+
+use app\cxinv\model\FinancialTz;
+use app\cxinv\model\FinancialManager;
+use think\App;
+
+class FinancialCancel extends Base
+{
+    public function __construct(App $app)
+    {
+        parent::__construct($app);
+        $this->model = new \app\cxinv\model\FinancialCancel();
+    }
+
+    public function create(){
+        $params=$this->request->param(['type'=>"","item_ids"=>[],"remark"=>""],"post",'trim');
+        $valid = $this->validate($params,[
+            'type|类型'=>'require|in:1,2',
+            'item_ids|订单id'=>'require|array',
+            'remark|备注'=>'max:255',
+        ]);
+        if($valid!== true) return error($valid);
+        $create=[];
+        foreach ($params['item_ids'] as $k=>$v){
+            if($params['type']==1){
+                $ManagerInfo=FinancialManager::where('id',$v)->findOrEmpty();
+                if($ManagerInfo->isEmpty()) return error("[$v]订单数据不存在");
+                if($ManagerInfo->status!=2 && $ManagerInfo->status!=3) return error("[$v]订单数据状态不正确");
+            }else{
+                $TzInfo=FinancialTz::where('id',$v)->findOrEmpty();
+                if($TzInfo->isEmpty()) return error("[$v]计提数据不存在");
+                if($TzInfo->status!=1 && $TzInfo->status!=2) return error("[$v]计提数据状态不正确");
+            }
+            $create[]=[
+                'type'=>$params['type'],
+                'item_id'=>$params['item_id'],
+                'remark'=>$params['remark'],
+                'apply_id'=>$this->uid,
+                'apply_name'=>$this->uname,
+            ];
+        }
+
+        $this->model->startTrans();
+        try{
+            $res=$this->model->saveAll($create);
+            if($res->isEmpty()) throw new \Exception("删除数据失败");
+            $this->model->commit();
+        }catch (\Exception $e){
+            $this->model->rollback();
+            return error($e->getMessage());
+        }
+        return success("删除数据成功");
+    }
+
+    //列表
+    public function list(){
+        $params=$this->request->param(['type'=>1,"item_id"=>"","page"=>1,"size"=>20],"post",'trim');
+        $where=[];
+        if($params['type']!='') {
+            $where[]=['type','=',$params['type']];
+            $model=($params['type']==1)?'FinancialManager':'FinancialTz';
+        }
+        if($params['item_id']!='') $where[]=['item_id','=',$params['item_id']];
+        $list=$this->model->with([$model])->where($where)->order('id desc')->paginate(['page'=>$params['page'],'list_rows'=>$params['size']]);
+        return success("获取成功",['list'=>$list->items(),'count'=>$list->total()]);
+    }
+}

+ 39 - 0
app/cxinv/controller/FinancialManager.php

@@ -281,6 +281,7 @@ class FinancialManager extends Base{
         $info->delete();
         return success("删除成功");
     }
+    //调整单列表
     public function CheckList(){
         $params = $this->request->param(["page"=>1,"size"=>20,"goodType"=>'',"goodNo"=>'',"company_code"=>'',"start_time"=>"","end_time"=>"","keywords"=>""],"post","trim");
         $where=[];
@@ -296,4 +297,42 @@ class FinancialManager extends Base{
         ->paginate(['page'=>$params['page'],'list_rows'=>$params['size']]);
         return success('获取成功',['list'=>$list->items(),'count'=>$list->total()]);
     }
+
+    //调整单数据删除
+    public function CheckDelete(){
+        $ids = $this->request->param('id',[]);
+        if(empty($ids)) return error("请选择数据");
+        $info=$this->model->whereIn('id',$ids)->select();
+        if($info->isEmpty()) return error("数据不存在");
+        $info->delete();
+        return success("删除成功");
+    }
+
+    //导出数据manager异常数据
+    public function export(){
+     $param = $this->request->param(["code"=>"","type"=>[],"seller_code"=>"","buyer_code"=>"","orderCode"=>"","cxCode"=>"",
+            "goodNo"=>"","inv_number"=>"","inv_buyer_code"=>"",'inv_seller_code'=>"",'channel'=>[],'status'=>"","start"=>"","end"=>"",
+            "page"=>1,"size"=>15],"post","trim");
+    $where=[];
+    if($param['code']!="") $where[]= ["code","=","%{$param['code']}%"];
+    if(!empty($param['type'])) $where[]= ["type","in",$param['type']];
+    if(!empty($param['channel'])) $where[]= ["channel","in",$param['channel']];
+    if($param['status']!="") $where[]= ["status","in",$param['status']];
+    if($param['start']!="") $where[]= ["create_time",">=",startTime($param['start'])];
+    if($param['end']!="") $where[]= ["create_time","<=",endTime($param['end'])];
+    if($param['seller_code']!="") $where[]= ["seller_code","=",$param['seller_code']];
+    if($param['buyer_code']!="") $where[]= ["buyer_code","=",$param['buyer_code']];
+    if($param['orderCode']!="") $where[]= ["orderCode","like", "%{$param['orderCode']}%"];
+    if($param['cxCode']!="") $where[]= ["cxCode","like","%{$param['cxCode']}%"];
+    if($param['goodNo']!="") $where[]= ["goodNo","like","%{$param['goodNo']}%"];
+    if($param['inv_number']!="") $where[]= ["inv_number","like","%{$param['inv_number']}%"];
+    if($param['inv_buyer_code']!="") $where[]= ["inv_buyer_code","=",$param['inv_buyer_code']];
+    if($param['inv_seller_code']!="") $where[]= ["inv_seller_code","=",$param['inv_seller_code']];
+    $list = $this->model
+        ->field("id")
+        ->where($where)
+        ->order("id desc")
+        ->select();
+    exportExcel($list,['id'],"manager");
+    }
 }

+ 50 - 2
app/cxinv/controller/FinancialProducts.php

@@ -71,8 +71,6 @@ class FinancialProducts extends Base
             'childArr|商品子商品' => 'requireIf:is_combind,1|array'
         ]);
         if ($valid !== true) return error($valid);
-        $param['apply_id'] = $this->uid;
-        $param['apply_name'] = $this->uname;
         if ($param['is_combind'] == 1) {
             foreach ($param['childArr'] as $key => $item) {
                 $iteminfo = $this->model->where('id', $item['child_id'])->findOrEmpty();
@@ -86,6 +84,8 @@ class FinancialProducts extends Base
         unset($where['childArr']);
         $isT = $this->model->where($where)->findOrEmpty();
         if (!$isT->isEmpty()) return error("商品编号{$param['skuCode']}已存在");
+        $param['apply_id'] = $this->uid;
+        $param['apply_name'] = $this->uname;
         $this->model->startTrans();
         try {
             $res = $this->model->create($param);
@@ -413,4 +413,52 @@ class FinancialProducts extends Base
         if ($info->isEmpty()) return error('盘点单不存在');
         return success("获取成功", $info);
     }
+
+   //批量导入商品信息
+    public function import()
+    {
+        $list = $this->request->param('list', [], 'trim');
+        if (empty($list)) return error('请选择要导入的商品');
+        foreach ($list as &$item) {
+            //批量导入商品信息
+            $valid = $this->validate($item, [
+                'skuCode|商品编号' => 'require|max:255',
+                'goodName|商品名称' => 'require|max:255',
+                'good_type|商品类型' => 'require|in:1,2,3',
+                'buyer_code|买方公司纳税识别号' => 'require|max:255',
+                'buyer_name|买方公司名称' => 'require|max:255',
+                'seller_code|卖方公司纳税识别号' => 'require|max:255',
+                'seller_name|卖方公司名称' => 'require|max:255',
+                'good_source|商品来源' => 'require|in:1,2',
+                'inv_good_name|发票商品名称' => 'require|max:255',
+                'spec|规格' => 'max:255',
+                'good_code|商品代码' => 'max:255',
+                'unit|单位' => 'require|max:255',
+                'unit_price|成本税前单价' => 'require|float',
+                'subunit_price|成本税后单价' => 'require|float',
+                'unit_weight|重量' => 'float',
+                "spectral|分光" => 'max:255',
+                'cat_code|进项类目' => 'require|max:255',
+                'cat_tax|进项税率' => 'require|max:255',
+                'inv_type|发票类型' => 'require|max:255',
+                'basic_status|进项成本状态' => 'require|in:1,2',
+            ]);
+            if ($valid !== true) return error($valid);
+            $isT = $this->model->where($item)->findOrEmpty();
+            if (!$isT->isEmpty()) return error("商品{$item['skuCode']}已存在");
+            $item['apply_id'] = $this->uid;
+            $item['apply_name'] = $this->uname;
+        }
+        $this->model->startTrans();
+        try {
+            $use = $this->model->saveAll($list);
+            if ($use->isEmpty()) throw new \think\Exception("批量导入商品信息失败");
+            $this->model->commit();
+        } catch (\Exception $e) {
+            $this->model->rollback();
+            return error($e->getMessage());
+        }
+        return success('批量导入商品信息成功');
+    }
+
 }

+ 0 - 19
app/cxinv/model/CatDel.php

@@ -1,19 +0,0 @@
-<?php
-namespace app\cxinv\model;
-
-class CatDel extends Base
-{
-//设置字段信息
-    protected $schema = [
-        'id'  =>'int',//
-        'cat_name'  =>'varchar',//分类名称
-        'pid'  =>'int',//父级id
-        'level'  =>'int',//级别
-        'rate'  =>'decimal',//利润率
-        'weight'  =>'int',//权重排序
-        'status'  =>'int',//使用状态
-        'fund_code'  =>'varchar',//财务编码
-        'addtime'  =>'datetime',//
-        'updatetime'  =>'datetime',//
-       ];
-}

+ 122 - 0
app/cxinv/model/FinancialCancel.php

@@ -0,0 +1,122 @@
+<?php
+
+namespace app\cxinv\model;
+
+
+use think\Model;
+
+class FinancialCancel extends Base
+{
+  protected $schema = [
+      'id' => 'bigint',
+      'item_id' => 'bigint',
+      'type' => 'tinyint',
+      'remark' => 'varchar',
+      'apply_id' => 'int',
+      'apply_name' => 'varchar',
+      'status' => 'tinyint',
+      'addtime' => 'datetime',
+      'updatetime' => 'datetime'
+  ];
+  public static $status=[
+      '1'=>'待审批',
+      '2'=>'审批通过',
+      '3'=>'审批驳回'
+  ];
+
+  public function FinancialManager(){
+      return $this->hasOne(FinancialManager::class,'item_id','id');
+  }
+  public function FinancialTz(){
+      return $this->hasOne(FinancialTz::class,'item_id','id');
+  }
+
+  public static function onAfterInsert(Model $model): void
+  {
+      try {
+          if($model['type']==1){
+              FinancialCancel::cancelManager($model['item_id'],$model);
+          }else{
+              FinancialCancel::cancelTz($model['item_id'],$model);
+          }
+      } catch (\Exception $e) {
+          throw new \Exception($e->getMessage());
+      }
+  }
+
+    public static function cancelManager($managerId,$cancelInfo){
+     $ManagerInfo=FinancialManager::with(['ProductRela'=>['Product']])->where('id',$managerId)->findOrEmpty();
+     if($ManagerInfo->isEmpty()) throw new \Exception('数据不存在');
+     if($ManagerInfo->status==3){
+         $IFz=self::checkTz($managerId);
+         if(!$IFz) throw new \Exception('计提数据未处理');
+     }
+     if($ManagerInfo->ProductRela->isEmpty()) throw new \Exception('商品不存在');
+     $ProductInfo=$ManagerInfo->ProductRela;
+     $up=[];
+     $ProductInfo->each(function ($item) use (&$up){
+         $info = FinancialProducts::where('id',$item->product_id)->findOrEmpty();
+         if($info->isEmpty()) throw new \Exception($item->goodName.'商品不存在');
+         if($item->status==1){
+             if($item->type==1)$up[]=ProductStock::AddSingleStock($info,$item->num);
+             if($item->type==2)$up[]=ProductStock::SubSingleStock($info,$item->num);
+         }
+     });
+     if(empty($up)) throw new \Exception('库存修改数据不存在');
+     $log=[];
+     $type=[1=>8,2=>7];
+     foreach ($up as $k=>$v){
+        $log[]=[
+            "type"=>$type[$v['type']],
+            'order_item_id'=>$cancelInfo->id,
+            'product_id'=>$v->product_id,
+            'num'=>$v->num,
+            "fz_date"=>$v->fz_date,
+            'unit_price'=>$v->unit_price,
+            'rate'=>$v->rate,
+            'apply_id'=>$cancelInfo->apply_id,
+            'apply_name'=>$cancelInfo->apply_name,
+        ];
+     }
+      (new ProductOnlog)->saveAll($log);
+      $ManagerInfo->status=5; // 5 取消
+      $ManagerInfo->save();
+  }
+  public static function checkTz($managerId){
+      $ManagerInfo=FinancialTz::where('manager_id',$managerId)->findOrEmpty();
+      if($ManagerInfo->isEmpty()) throw new \Exception($managerId.'计提数据不存在');
+      if($ManagerInfo->status!=4) return false;
+      return true;
+  }
+  public static function cancelTz($tzId,$cancelInfo){
+      $TzInfo=FinancialTz::with(['ProductTz'=>['Product']])->where('id',$tzId)->findOrEmpty();
+      if($TzInfo->isEmpty()) throw new \Exception('计提数据不存在');
+      $status = $TzInfo->status;
+      $ProductInfo=$TzInfo->ProductTz;
+      $up=[];
+      if($status==2){
+          $ProductInfo->each(function ($item) use (&$up,$status){
+              $info = FinancialProducts::where('id',$item->product_id)->findOrEmpty();
+              if($item->type==2)$up[]=ProductStock::AddSingleStock($info,$item->num);
+              if($item->type==1)$up[]=ProductStock::SubSingleStock($info,$item->num);
+          });
+          if(empty($up)) throw new \Exception('库存修改数据不存在');
+          $log=[];
+          $type=[1=>8,2=>7];
+          foreach ($up as $k=>$v){
+              $log[]=[
+                  "type"=>$type[$v['type']],
+                  'order_item_id'=>$cancelInfo->id,
+                  'product_id'=>$v->product_id,
+                  'num'=>$v->num,
+                  "fz_date"=>$v->fz_date,
+                  'unit_price'=>$v->unit_price,
+                  'rate'=>$v->rate,
+              ];
+          }
+          (new ProductOnlog)->saveAll($log);
+      }
+      $TzInfo->status=4;
+      $TzInfo->save();
+  }
+}

+ 3 - 90
app/cxinv/model/FinancialManager.php

@@ -56,11 +56,9 @@ class FinancialManager extends Base{
         'tax_diff'=>'int',//税费差异
         'remark'=>'string',//备注或说明
         'error_remark'=>'string',//备注或说明
-        'status'=>'int',//1 待处理 2 正常 3计提 4 异常
+        'status'=>'int',//1 待处理 2 正常 3计提 4 异常 5 取消数据
         'balance_num'=>'decimal',//库存数量
         'total_num'=>'decimal',//总库存数量,
-        'check_fee'=>'decimal',
-        'is_checkOrder'=>'int',
         'fz_date'=>'varchar',
         'apply_id'=>'int',
         'apply_name'=>'string',
@@ -74,7 +72,7 @@ class FinancialManager extends Base{
     public static $ManagerType=[1=>'入库',2=>'出库',3=>'入库红冲',4=>'出库红冲'];
     public static $ManagerSource=[1=>'结算',2=>'线下订单'];
     public static $PlatformType=[1=>'ToB',2=>'ToC'];
-    public static $StatusCn=[1=>'待处理',2=>'正常',3=>'计提',4=>'异常'];
+    public static $StatusCn=[1=>'待处理',2=>'正常',3=>'计提',4=>'异常' ,5=>'取消数据'];
 
     public function ProductRela(){
         return $this->hasMany(ManagerProduct::class,'manager_id','id');
@@ -116,35 +114,6 @@ class FinancialManager extends Base{
             $temp['status'] = 0;
             return $temp;
         },$data['idArr']);
-//        self::startTrans();
-//        try{
-//            if($data['inv_num']==0) throw new \Exception('发票商品数量不能为0');
-//             if($data['type']==1){
-//                  $product=  $this->inProduct($data);
-//                 $data['error_remark'] = $data['balance_num']!='0'?'入库数量不正确':'';
-//                 }
-//                if($data['type']==2){
-//                   $product=  $this->outProduct($data);
-//                    $data['error_remark'] = $data['balance_num']!='0'?'出库数量不正确':'';
-//                }
-//                if($data['balance_num']!=$data['total_num'] && $data['balance_num']!='0') throw new \Exception($data['error_remark']);
-//                $data['status']=$data['balance_num']==$data['total_num']?1:2;
-//                self::commit();
-//        }catch (\Exception $e){
-//            self::rollback();
-//            if(!empty($data['idArr'])) $product=array_map(function ($item) use($data){
-//                                              $temp=[];
-//                                              $temp['product_id']=$item['id'];
-//                                              $temp['type']=$data['type'];
-//                                              $temp['num']=$item['num'];
-//                                              $temp['apply_id'] = $data['apply_id'];
-//                                              $temp['apply_name'] = $data['apply_name'];
-//                                              $temp['status'] = 0;
-//                                              return $temp;
-//                                          },$data['idArr']);
-//            $data['status'] =4;
-//            $data['error_remark'] = $e->getMessage();
-//        }
         $info=$this->create($data);
         if($info->isEmpty()) throw new \Exception('添加失败');
         if (isset($product)) ManagerProduct::AddProduct($info->id,$product);
@@ -326,34 +295,6 @@ class FinancialManager extends Base{
             $temp['status'] = 0;
             return $temp;
         },$data['idArr']);
-//        self::startTrans();
-//         try{
-//            if($data['type']==1){
-//              $product=$this->inProduct($data);
-//                $data['error_remark'] = $data['balance_num']!='0'?'入库数量不正确':'';
-//            }
-//            if($data['type']==2){
-//               $product=$this->outProduct($data);
-//                $data['error_remark'] = $data['balance_num']!='0'?'出库数量不正确':'';
-//            }
-//             if($data['balance_num']!=$data['total_num'] && $data['balance_num']!='0') throw new \Exception($data['error_remark']);
-//             $data['status']=$data['balance_num']==$data['total_num']?1:2;
-//            self::commit();
-//        }catch (\Exception $e){
-//             self::rollback();
-//             if(!empty($data['idArr'])) $product=array_map(function ($item) use($data){
-//                 $temp=[];
-//                 $temp['product_id']=$item['id'];
-//                 $temp['type']=$data['type'];
-//                 $temp['num']=$item['num'];
-//                 $temp['apply_id'] = $data['apply_id'];
-//                 $temp['apply_name'] = $data['apply_name'];
-//                 $temp['status'] = 0;
-//                 return $temp;
-//             },$data['idArr']);
-//            $data['status'] =4;
-//            $data['error_remark'] = $e->getMessage();
-//        }
         $info=$this->create($data);
         if($info->isEmpty()) throw new \Exception('添加失败');
         if(isset($product) && !empty($product))ManagerProduct::AddProduct($info->id,$product);
@@ -372,35 +313,7 @@ class FinancialManager extends Base{
             $temp['status'] = 0;
             return $temp;
         },$data['idArr']);
-//        self::startTrans();
-//        try{
-//            if($data['type']==1){
-//                $product=$this->inProduct($data);
-//                $data['error_remark'] = $data['balance_num']!='0'?'入库数量不正确':'';
-//            }
-//            if($data['type']==2){
-//                $product=$this->outProduct($data);
-//                $data['error_remark'] = $data['balance_num']!='0'?'出库数量不正确':'';
-//            }
-//            if($data['balance_num']!=$data['total_num'] && $data['balance_num']!='0') throw new \Exception($data['error_remark']);
-//            $data['status']=$data['balance_num']==$data['total_num']?1:2;
-//            self::commit();
-//        }catch (\Exception $e){
-//            self::rollback();
-//            if(!empty($data['idArr'])) $product=array_map(function ($item) use($data){
-//                $temp=[];
-//                $temp['product_id']=$item['id'];
-//                $temp['type']=$data['type'];
-//                $temp['num']=$item['num'];
-//                $temp['apply_id'] = $data['apply_id'];
-//                $temp['apply_name'] = $data['apply_name'];
-//                $temp['status'] = 0;
-//                return $temp;
-//            },$data['idArr']);
-//            $data['status'] =4;
-//            $data['error_remark'] = $e->getMessage();
-//        }
-        $info=$this->create($data);
+       $info=$this->create($data);
         if($info->isEmpty()) throw new \Exception('添加失败');
         if(isset($product) && !empty($product))ManagerProduct::AddProduct($info->id,$product);
     }

+ 1 - 1
app/cxinv/model/FinancialTz.php

@@ -11,7 +11,7 @@ class FinancialTz extends Base
         'id'  =>'bigint',//
         'ktCode'  =>'varchar',//计提编号
         'manager_id'  =>'bigint',//出库id
-        'status'  =>'tinyint',//状态
+        'status'  =>'tinyint',//状态  1 待审核 2 已审核 3 已驳回 4 已取消
         'num'  =>'decimal',//数量
         'out_fee'  =>'decimal',//出口金额
         'check_fee'  =>'decimal',//调整金额

+ 1 - 1
app/cxinv/model/ProductOnlog.php

@@ -6,7 +6,7 @@ class ProductOnlog extends Base
 //设置字段信息
     protected $schema = [
         'id'  =>'bigint',//
-        "type"=>'tinyint',// 1入账 2 出账 3 盘盈 4盘亏 5计提入库 6计提出库
+        "type"=>'tinyint',// 1入账 2 出账 3 盘盈 4盘亏 5计提入库 6计提出库 7 取消数据入库 8 取消数据出库
         'order_item_id'  =>'bigint',//关联明细采购单id 盘点id
         'product_id'  =>'bigint',//商品id
         'first_on_time'  =>'datetime',//第一次入账

+ 2 - 1
composer.json

@@ -27,7 +27,8 @@
         "topthink/think-multi-app": "^1.0",
         "topthink/think-helper": "^3.1",
         "huaweicloud/huaweicloud-sdk-php": "^3.1",
-        "youzanyun/open-sdk": "^2.0"
+        "youzanyun/open-sdk": "^2.0",
+        "phpoffice/phpexcel": "^1.8"
     },
     "require-dev": {
         "symfony/var-dumper": "^4.2",