Przeglądaj źródła

增加日志标记与一些小BUG修复

Zhouzhendong 4 lat temu
rodzic
commit
8c02da51c8

+ 0 - 33
app/Http/Controllers/RejectedController.php

@@ -446,39 +446,6 @@ class RejectedController extends Controller
             "item_amount"=>"商品数量","quality_label_name"=>"商品质量","item_remark"=>"备注","operator_name"=>"录入人","remark"=>"退单备注"
         ])->direct();
     }
-
-
-    /*public function exportExcel(Request $request)
-    {
-        if(!Gate::allows('退货管理-查询')){ return '没有权限';  }
-        ini_set('max_execution_time',2500);
-        ini_set('memory_limit','1526M');
-        $ids=$request->input('ids')??'';
-        $ids=json_decode($ids,true);
-        $export=new RejectedExport();
-        $export->setIds($ids);
-        app('LogService')->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
-        return Excel::download($export,'退货表'.Carbon::now().'.xlsx');
-    }
-    public function exportExcelOnFilterParams(Request $request)
-    {
-        if(!Gate::allows('退货管理-查询')){ return '没有权限';  }
-        ini_set('max_execution_time',2500);
-        ini_set('memory_limit','1526M');
-        $filterParams=json_decode($request->input('filterParams'),true);
-        $user=Auth::user();
-        $rejectedBills=$this->buildFilteredQuery($filterParams)->orderBy('id','desc')->whereIn('id_owner',
-            $user?app('UserService')->getPermittingOwnerIds($user):[]);
-        if($rejectedBills->count()>RejectedExport::$max){
-            $rejectedBills->where('is_finished',false);
-        }
-        $rejectedBills->get();
-        $export=new RejectedExport();
-        $export->setRejectedBills($rejectedBills);
-        app('LogService')->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
-        return Excel::download($export,'退货表'.Carbon::now().'.xlsx');
-
-    }*/
     public function import(Request $request)
     {
         return view('rejected.import');

+ 2 - 1
app/Jobs/PackageCollectingAllocation.php

@@ -48,7 +48,8 @@ class PackageCollectingAllocation implements ShouldQueue
         $result = OrderPackage::query()->where("id",$this->orderPackage->id)
             ->where("collecting_status",'0')->update(["collecting_status"=>'1']);
         if ($result!=1)
-            Log::warning("自动揽收异常",["message"=>"未能成功修改揽收标记","param"=>$this->orderPackage->toArray(),"line"=>$result]);
+            Log::warning("自动揽收异常",["message"=>"未能成功修改揽收标记","param"=>["id"=>$this->orderPackage->id,"number"=>$this->orderPackage->logistic_number],"line"=>$result]);
+        else Log::info("揽收成功",["id"=>$this->orderPackage->id,"number"=>$this->orderPackage->logistic_number]);
         /*$result = app("OrderService")->allocation($this->orderPackage->order->code,$this->lineNo);
         if (mb_substr($result,0,3)=='000'){
             if (OrderPackage::query()->where("id",$this->orderPackage->id)

+ 3 - 5
app/Services/RejectedService.php

@@ -16,13 +16,12 @@ use App\Traits\ServiceAppAop;
 class RejectedService
 {
     use ServiceAppAop;
-    protected $modelClass=Rejected::class;
     /** @var CacheService $cacheService */
     private $cacheService;
     function __construct(){
         $this->instant($this->cacheService,'CacheService');
     }
-    private function    conditionQuery(array $param)
+    private function  conditionQuery(array $param)
     {
         $user = Auth::user();
         $rejectedBills = RejectedBill::query()->with('user','owner', 'logistic', 'items.quality','orderIssueRejectedBill:logistic_number_return')
@@ -32,6 +31,7 @@ class RejectedService
             'created_at_start' => ['alias' => 'created_at', 'startDate' => ' 00:00:00'],
             'created_at_end' => ['alias' => 'created_at', 'endDate' => ' 23:59:59'],
             'owner' => ['alias' => 'id_owner', 'multi' => ','],
+            'owner_id' => ['alias' => 'id_owner', 'multi' => ','],
             'order_number' => ['batch' => ''],
             'remark' => ['batch' => '','timeLimit'=>15],
             'logistic_number' => ['batch' => ''],
@@ -99,9 +99,7 @@ class RejectedService
             }
             unset($param['is_issue']);
         }
-        $rejectedBills = app(QueryService::class)->query($param, $rejectedBills, $columnQueryRules,"rejected_bills");
-
-        return $rejectedBills;
+        return app(QueryService::class)->query($param, $rejectedBills, $columnQueryRules,"rejected_bills");
     }
 
     public function paginate(Request $request)

+ 3 - 3
app/Services/WaybillService.php

@@ -158,9 +158,9 @@ class WaybillService
             ->orderBy('waybill_on_tops.updated_at','desc')
             ->orderBy('waybills.id','desc')
             ->where('waybills.type','专线')
-            ->where('waybills.amount','>',0)
-            ->where('waybills.deliver_at','like',$param['screenDate'].'%')
-            ->get();
+            ->where('waybills.amount','>',0);
+        if ($param['screenDate'] ?? false)$waybills->where('waybills.deliver_at','like',$param['screenDate'].'%');
+        $waybills = $waybills->get();
         if ($waybills->isEmpty()) return '无数据';
         foreach ($waybills as $waybill){
             if (!$waybill['carrier_weight_other'] && !$waybill['carrier_weight']) return null;

+ 0 - 1
app/Services/common/QueryService.php

@@ -11,7 +11,6 @@ use Illuminate\Database\Eloquent\Builder;
 class QueryService
 {
     use ServiceAppAop;
-    protected $modelClass=Query::class;
 
     /**
      * parameter - query(sql) - special column description