wugg 1 년 전
부모
커밋
34c64a8c9a

+ 5 - 0
app/admin/controller/AfterChild.php

@@ -779,6 +779,11 @@ class AfterChild extends Base
                 ->update(['status' => 5, 'updatetime' => $date]);
 			 if($Reup==false) throw new Exception('售后申请退货状态更新失败');
             //售后退货工单设置信息维护
+              $process = ['order_code' =>  $param['returnCode'], 'order_id' =>  $order_return['id'], 'order_status'
+              =>5, 'order_type' => 'SHD', 'before_status' => 0, 'holder_id' => $this->uid];
+             ProcessOrder::AddProcess(['id' => $this->uid, 'nickname' => $this->uname], $process);
+             $orde = ['order_code' =>$param['returnCode'], 'status' => 5, 'action_remark' => '', 'action_type' => 'create'];
+            ActionLog::logAdd(['id' => $this->uid, 'nickname' => $this->uname], $orde, 'SHD', 1, $orde);
             $Reupchild=Db::name('order_return_prepare')
                 ->where(['is_del' => 0, 'status' => 1, 'id' => array_column($info, 'id')])
                 ->update(['updatetime' => $date, 'status' => 3]);

+ 6 - 2
app/admin/controller/Filing.php

@@ -14,10 +14,12 @@ class Filing extends Base
     public function getList()
     {
         $data = $this->request->only(['page' => 1, 'size' => 10, 'cat_id' => '', 'start_date' => '', 'end_date' => '',
-        'filingCode' => '', 'status' => '', 'good_name' => '', 'companyName' => '', 'companyCode' => '', 'orderCode' => '','customerCode' => '', 'supplierNo' => ''], 'post');
+        'filingCode' => '', 'status' => '', 'good_name' => '', 'companyName' => '', 'companyCode' => '',"plat_orderCode"=>"",
+        'orderCode' => '','customerCode' => '', 'supplierNo' => ''], 'post');
 
         $where = [['is_del', '=', '0']];
         if ($data['cat_id'] != '') $where[] = ['cat_id', '=', $data['cat_id']];
+        if ($data['plat_orderCode'] != '') $where[] = ['plat_orderCode', 'like', '%' . $data['plat_orderCode'] . '%'];
         if ($data['start_date'] != '' && $data['end_date'] != '') $where[] = ['addtime', 'between', [$data['start_date'] . ' 00:00:00', $data['end_date'] . ' 23:59:59']];
         if ($data['filingCode'] != '') $where[] = ['filingCode', 'like', '%' . $data['filingCode'] . '%'];
         if ($data['status'] != '') $where[] = ['status', '=', $data['status']];
@@ -34,7 +36,7 @@ class Filing extends Base
 
         $list = Db::name('filing')
             ->field('id,filingCode,cat_id,good_name,num,wait_num,transfer_num,good_img,
-            price,expect_service,companyName,companyCode,status,addtime,supplierNo,supplierName,customerCode,customerName,
+            price,expect_service,companyName,companyCode,status,addtime,supplierNo,supplierName,customerCode,customerName,plat_orderCode,
             "" catinfo,orderCode,cgd_charge')
             ->where($where)
             ->page($data['page'], $data['size'])
@@ -89,6 +91,7 @@ class Filing extends Base
         	'noble_metal',
         	'config',
         	'other_config',
+        	'plat_orderCode',
         	'remark',
         	'cost_desc',
         	'good_img'], 'post');
@@ -251,6 +254,7 @@ class Filing extends Base
         	'config',
         	'other_config',
         	'remark',
+        	'plat_orderCode',
         	'cost_desc',
         	'good_img'], 'post');
 

+ 2 - 2
app/command/ImportOrderFromCHandleData.php

@@ -267,8 +267,8 @@ class ImportOrderFromCHandleData extends Command
                     'cgder' => $supplier_temp_info['person'],//采购员(供应商负责人)
                     'good_createrid' => $goodinfo['createrid'],
                     'good_creater' => $goodinfo['creater'],//商品创建人
-                    'manager'=>$rm,
-                    'managerid'=>$ri,
+                    'manager'=>$ri,
+                    'managerid'=>$rm,
                 ];
                 $paytime == "" ? "" : $data['paytime'] = $paytime;
                 $datainfo = Db::name('sale')->insert($data, true);

+ 7 - 22
app/command/SplitSale.php

@@ -32,11 +32,11 @@ class SplitSale extends Command
 
             $key = 'split_sale_';
 
-            $rs = Cache::store('redis')->get($key);
-
-            if ($rs) return true;
-
-            Cache::store('redis')->set($key, 1, 60 * 15);
+            $rs = Cache::store('redis')->inc($key);
+            if ($rs!=1){
+            	Cache::store('redis')->dec($key);
+	            return true;
+            }
 
             Db::startTrans();
 
@@ -51,11 +51,7 @@ class SplitSale extends Command
                         ['a.is_del', '=', 0],
                         ['a.updatetime', '>=', date('Y-m-d H:i:s', time() - 5 * 60)],
                         ['a.pay_id', '<>', 0]
-                    ])
-                    ->cursor();
-
-//                $cgd_insert_tmp_data=[];
-
+                    ])->cursor();
                 $userCommon = User::getIns();
 
                 foreach ($data as $sale) {
@@ -70,16 +66,6 @@ class SplitSale extends Command
                             ->leftJoin('unit d', 'd.id=b.good_unit')
                             ->where(['b.spuCode' => $sale['good_code']])
                             ->findOrEmpty();
-//                    } elseif ($sale['order_type'] == 4) {
-//                        //报备单
-//                        $good = Db::name('filing')
-//                            ->field('a.noble_metal,c.brand_name brand,d.unit,a.cost_desc,a.gold_weight noble_weight,b.tax,a.delivery_day,0 lead_time')
-//                            ->alias('a')
-//                            ->rightJoin('good_zixun b', 'b.is_del=0 AND b.spuCode=a.spuCode')
-//                            ->leftJoin('brand c', 'c.id=a.brand_id')
-//                            ->leftJoin('unit d', 'd.id=a.unit_id')
-//                            ->where(['a.is_del' => 0, 'b.spuCode' => $sale['good_code']])
-//                            ->findOrEmpty();
                     } else {
                         $good = Db::name('good')
                             ->field('b.noble_metal,c.brand_name brand,d.unit,b.craft_desc cost_desc,b.noble_weight,b.tax,b.delivery_day,b.lead_time')
@@ -121,7 +107,6 @@ class SplitSale extends Command
 		            //客户
                     $customer = ['No' => $sale['customer_code'], 'name' => $sale['customerName']];
                     foreach ($pay_rates as $keys=>$pay_rate) {
-
                         //生成新的采购单号和销售单号
                         $cgdNo = makeNo($this->Tcode.'CG');
                        
@@ -181,7 +166,7 @@ class SplitSale extends Command
                 $output->writeln('事务回滚:' . $e->getMessage() . '||' . $e->getFile() . '||' . $e->getLine());
             }
 
-            Cache::store('redis')->set($key, 0);
+           Cache::store('redis')->dec($key);
 
         } catch (\Exception $exception) {
             $output->writeln('脚本执行出错,' . $exception->getMessage() . '||' . $exception->getFile() . '||' . $exception->getLine());

+ 2 - 2
app/command/handleYzOrderData.php

@@ -200,8 +200,8 @@ class handleYzOrderData extends Command
                     'cgder' => $supplier_temp_info['person']??'',//采购员(供应商负责人)
                     'good_createrid' => $goodinfo['createrid'],
                     'good_creater' => $goodinfo['creater'],//商品创建人
-                     'manager'=>$rm,
-                    'managerid'=>$ri,
+                     'manager'=>$ri,
+                    'managerid'=>$rm,
                 ];
                 $paytime == "" ? "" : $data['paytime'] = $paytime;
                 $datainfo = Db::name('sale')->insertGetId($data);