Kaynağa Gözat

Merge branch 'master' into Haozi

haozi 5 yıl önce
ebeveyn
işleme
965a46dbd2
100 değiştirilmiş dosya ile 482 ekleme ve 252 silme
  1. 2 2
      app/AuditLog.php
  2. 2 2
      app/Authority.php
  3. 14 2
      app/Batch.php
  4. 2 2
      app/CarType.php
  5. 2 2
      app/Carrier.php
  6. 3 3
      app/City.php
  7. 2 2
      app/Commodity.php
  8. 2 2
      app/CommodityBarcode.php
  9. 2 18
      app/Console/Commands/CreateOwnerAreaReport.php
  10. 9 5
      app/Console/Commands/CreateOwnerReport.php
  11. 32 0
      app/Console/Commands/MakeModelCommand.php
  12. 18 3
      app/Console/Commands/MakeServiceCommand.php
  13. 23 4
      app/Console/Commands/MakeTestCommand.php
  14. 2 3
      app/Console/Commands/SyncBatchTask.php
  15. 2 2
      app/Console/Commands/stubs/model.stub
  16. 2 2
      app/CustomField.php
  17. 2 2
      app/Customer.php
  18. 2 2
      app/CustomerLog.php
  19. 2 2
      app/CustomerLogStatus.php
  20. 2 2
      app/CustomerTag.php
  21. 2 2
      app/Depository.php
  22. 2 2
      app/Feature.php
  23. 82 0
      app/Http/Controllers/CustomerController.php
  24. 4 0
      app/Http/Controllers/OrderFreezeController.php
  25. 34 17
      app/Http/Controllers/PriceModelController.php
  26. 1 1
      app/Http/Controllers/StationController.php
  27. 51 10
      app/Http/Controllers/TestController.php
  28. 1 1
      app/Http/Middleware/Authenticate.php
  29. 21 15
      app/Imports/ExpressImport.php
  30. 0 5
      app/Imports/OrderTrackingImport.php
  31. 8 1
      app/Imports/OwnerPriceDirectLogisticDetailImport.php
  32. 1 1
      app/Imports/StoreCheckingReceiveImport.php
  33. 2 2
      app/InventoryAccount.php
  34. 2 2
      app/InventoryAccountMission.php
  35. 2 2
      app/InventoryBlindReceiveExcel.php
  36. 2 2
      app/InventoryCompare.php
  37. 2 2
      app/InventoryDailyLog.php
  38. 2 2
      app/InventoryDailyLoggingOwner.php
  39. 2 2
      app/JobType.php
  40. 2 1
      app/Jobs/OrderCreateInstantBill.php
  41. 5 2
      app/Jobs/OrderFreeze.php
  42. 2 2
      app/LaborCompany.php
  43. 2 2
      app/LaborReport.php
  44. 2 2
      app/LaborReportStatus.php
  45. 1 1
      app/Log.php
  46. 2 2
      app/Logistic.php
  47. 2 2
      app/LogisticNumberFeature.php
  48. 2 2
      app/LogisticTiming.php
  49. 2 2
      app/MailEvent.php
  50. 2 2
      app/MaterialBox.php
  51. 2 2
      app/MeasuringMachine.php
  52. 2 2
      app/Menu.php
  53. 2 2
      app/OperatorLog.php
  54. 2 2
      app/OracleActAllocationDetails.php
  55. 2 2
      app/OracleActTransactionLog.php
  56. 2 2
      app/OracleBasCode.php
  57. 2 2
      app/OracleBasCustomer.php
  58. 2 2
      app/OracleBasSKU.php
  59. 2 2
      app/OracleDOCASNDetail.php
  60. 2 2
      app/OracleDOCASNHeader.php
  61. 2 2
      app/OracleDOCMovementDetail.php
  62. 2 2
      app/OracleDOCMovementHeader.php
  63. 2 2
      app/OracleDOCOrderDetail.php
  64. 2 2
      app/OracleDOCOrderHeader.php
  65. 2 2
      app/OracleDOCWaveDetails.php
  66. 2 2
      app/OracleDOCWaveHeader.php
  67. 2 2
      app/OracleDocOrderPackingSummary.php
  68. 2 2
      app/OracleIdxAsrsReceive.php
  69. 2 2
      app/OracleInvLotAtt.php
  70. 2 2
      app/OracleInvLotLocId.php
  71. 2 2
      app/Order.php
  72. 2 2
      app/OrderBin.php
  73. 2 2
      app/OrderCommodity.php
  74. 2 2
      app/OrderCommodityAssign.php
  75. 2 2
      app/OrderCountingRecord.php
  76. 3 3
      app/OrderFreeze.php
  77. 2 2
      app/OrderIssue.php
  78. 2 2
      app/OrderIssueOnTop.php
  79. 2 2
      app/OrderIssueProcessLog.php
  80. 2 2
      app/OrderIssueRejectedBill.php
  81. 2 2
      app/OrderIssueType.php
  82. 2 2
      app/OrderPackage.php
  83. 2 2
      app/OrderPackageCommodities.php
  84. 2 2
      app/OrderPackageCountingRecord.php
  85. 2 2
      app/OrderTracking.php
  86. 2 2
      app/OrderTrackingOwner.php
  87. 2 2
      app/Owner.php
  88. 2 2
      app/OwnerAreaReport.php
  89. 2 2
      app/OwnerBillReport.php
  90. 2 2
      app/OwnerContract.php
  91. 6 2
      app/OwnerFeeDetail.php
  92. 2 2
      app/OwnerPriceDirectLogistic.php
  93. 2 2
      app/OwnerPriceDirectLogisticCar.php
  94. 2 2
      app/OwnerPriceExpress.php
  95. 2 2
      app/OwnerPriceExpressProvince.php
  96. 2 2
      app/OwnerPriceLogistic.php
  97. 2 2
      app/OwnerPriceLogisticDetail.php
  98. 6 2
      app/OwnerPriceOperation.php
  99. 3 2
      app/OwnerPriceOperationItem.php
  100. 2 2
      app/OwnerReport.php

+ 2 - 2
app/AuditLog.php

@@ -6,11 +6,11 @@ use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class AuditLog extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     use SoftDeletes;

+ 2 - 2
app/Authority.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Authority extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable = ['name','remark','id_parent','alias_name','type','relevance','permission'];

+ 14 - 2
app/Batch.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Batch extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         'id','code','type', 'wms_type', 'status', 'wms_status', 'wms_created_at',"remark","owner_id",
@@ -41,5 +41,17 @@ class Batch extends Model
     {
         return $this->hasOne(Owner::class,"id","owner_id");
     }
+    public function stationBatchTask()
+    {
+        return $this->hasOne(StationTaskBatch::class);
+    }
+    public function stationTask()
+    {
+
+        return $this->stationBatchTask?
+            $this->stationBatchTask->belongsTo(StationTask::class):
+            null;
+    }
+
 
 }

+ 2 - 2
app/CarType.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class CarType extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
 

+ 2 - 2
app/Carrier.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Carrier extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=[

+ 3 - 3
app/City.php

@@ -2,16 +2,16 @@
 
 namespace App;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
 class City extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
-    use LogModelChanging;
+    use ModelLogChanging;
     protected $fillable=[
         'province_id','name','type'
     ];

+ 2 - 2
app/Commodity.php

@@ -6,11 +6,11 @@ use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Commodity extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=['name','sku','owner_id','created_at','length','width','height','volumn',"type","pack_spec"];

+ 2 - 2
app/CommodityBarcode.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class CommodityBarcode extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=['code','commodity_id','created_at'];

+ 2 - 18
app/Console/Commands/CreateOwnerAreaReport.php

@@ -35,7 +35,7 @@ class CreateOwnerAreaReport extends Command
     }
 
     /**
-     * 25号生成盘点面积记录,记录留空由人工填写
+     * 1号生成盘点面积记录,记录留空由人工填写
      *
      * @return void
      */
@@ -44,24 +44,8 @@ class CreateOwnerAreaReport extends Command
         /** @var OwnerService $ownerService */
         $ownerService = app('OwnerService');
         $chunks = ($ownerService->get([],["ownerStoragePriceModels"],false,true))->chunk(50);
-        $month = date('Y-m-d');
         foreach ($chunks as $owners){
-            $date = date('Y-m-d H:i:s');
-            $createOwnerAreaReport = [];
-            foreach ($owners as $owner){
-                if (!$owner->ownerStoragePriceModels)continue;
-                foreach ($owner->ownerStoragePriceModels as $model){
-                    $createOwnerAreaReport[] = [
-                        "owner_id"              => $owner->id,
-                        "counting_month"        => $month,
-                        "user_owner_group_id"   => $owner->user_owner_group_id,
-                        "created_at"            => $date,
-                        "owner_storage_price_model_id"  => $model->id,
-                    ];
-                }
-            }
-            DB::table("owner_area_reports")->insert($createOwnerAreaReport);
-            LogService::log(__METHOD__,"客户管理-定时生成盘点记录",json_encode($createOwnerAreaReport));
+            app("OwnerAreaReportService")->notExistToInsert($owners);
         }
     }
 }

+ 9 - 5
app/Console/Commands/CreateOwnerReport.php

@@ -67,7 +67,7 @@ class CreateOwnerReport extends Command
         $bills = OwnerBillReport::query()->where("counting_month","like",$year."-".$lastMonth."%")->get();
 
         //日均单量统计
-        $query = DB::raw("select  count(*) c,CUSTOMERID from DOC_ORDER_HEADER where EDITTIME >= to_date('".$year."-".$lastMonth."-01 00:00:00','yyyy-mm-dd hh24:mi:ss') and EDITTIME <= to_date('".$year."-".$lastMonth."-".$lastDay." 23:59:59','yyyy-mm-dd hh24:mi:ss') group by CUSTOMERID");
+        $query = DB::raw("select  count(*) c,CUSTOMERID from DOC_ORDER_HEADER where SOSTATUS = '99' and EDITTIME >= to_date('".$year."-".$lastMonth."-01 00:00:00','yyyy-mm-dd hh24:mi:ss') and EDITTIME <= to_date('".$year."-".$lastMonth."-".$lastDay." 23:59:59','yyyy-mm-dd hh24:mi:ss') group by CUSTOMERID");
         $orderStatistic = DB::connection("oracle")->select($query);
         $map = [];
         foreach ($orderStatistic as $item){
@@ -117,9 +117,13 @@ class CreateOwnerReport extends Command
             ];
         }
         //执行生成或修改
-        app(BatchUpdateService::class)->batchUpdate('owner_reports', $updateReports);
-        app('LogService')->log(__METHOD__,"客户管理-修改原有货主报表",json_encode($updateReports));
-        DB::table("owner_reports")->insert($createReports);
-        app('LogService')->log(__METHOD__,"客户管理-生成货主报表",json_encode($createReports));
+        if (count($updateReports)>1){
+            app(BatchUpdateService::class)->batchUpdate('owner_reports', $updateReports);
+            app('LogService')->log(__METHOD__,"客户管理-修改原有货主报表",json_encode($updateReports));
+        }
+        if (count($createReports)>0){
+            DB::table("owner_reports")->insert($createReports);
+            app('LogService')->log(__METHOD__,"客户管理-生成货主报表",json_encode($createReports));
+        }
     }
 }

+ 32 - 0
app/Console/Commands/MakeModelCommand.php

@@ -4,6 +4,9 @@
 namespace App\Console\Commands;
 
 
+use Illuminate\Support\Str;
+use Symfony\Component\Console\Input\InputOption;
+
 class MakeModelCommand extends \Illuminate\Foundation\Console\ModelMakeCommand
 {
     protected function getStub()
@@ -13,5 +16,34 @@ class MakeModelCommand extends \Illuminate\Foundation\Console\ModelMakeCommand
         }
         return __DIR__ . '/stubs/model.stub';
     }
+    public function handle()
+    {
+        if (parent::handle() === false && ! $this->option('force')) {
+            return false;
+        }
+
+        if ($this->option('all')) {
+            $this->input->setOption('service', true);
+        }
+
+        if ($this->option('service')) {
+            $this->createService();
+        }
+    }
+    public function createService()
+    {
+        $modelName = Str::studly(class_basename($this->argument('name')));
+
+        $this->call('make:service', [
+            'name' => "{$modelName}Service",
+        ]);
+    }
+
+    protected function getOptions(): array
+    {
+        $options= parent::getOptions();
+        $options[]=['service', 'sv', InputOption::VALUE_NONE, 'Create a new service file'];
+        return $options;
+    }
 
 }

+ 18 - 3
app/Console/Commands/MakeServiceCommand.php

@@ -4,6 +4,7 @@ namespace App\Console\Commands;
 
 use App\Traits\ServiceAppAop;
 use Illuminate\Console\Command;
+use Illuminate\Support\Str;
 
 class MakeServiceCommand extends Command
 {
@@ -13,7 +14,7 @@ class MakeServiceCommand extends Command
      * @var string
      */
     protected $signature = 'make:service
-    {--provider : Register in the provider}
+    {--noProvider : Register in the provider}
     {name : fileName}';
 
     /**
@@ -43,7 +44,16 @@ class MakeServiceCommand extends Command
         if (!file_exists(base_path('app\\Services'))){
             mkdir('app\\Services',666,false);
         }
-        $fileName=$this->argument('name');
+        preg_match('/(.*?)Service/',$this->argument('name'),$resultNames);
+        var_dump($this->argument('name'),$resultNames);
+        if(count($resultNames)==0) {
+            $fileName = $this->argument('name');
+            $modelName = $this->argument('name');
+        }else{
+            $fileName=$resultNames[0];
+            $modelName=Str::studly($resultNames[1]);
+        }
+
         if (!file_exists(base_path('app\\Services\\'.$fileName.'.php'))){
             file_put_contents(base_path('app\\Services\\'.$fileName.'.php'),
                 '<?php '
@@ -54,6 +64,8 @@ class MakeServiceCommand extends Command
                 .PHP_EOL
                 .'use App\Traits\ServiceAppAop;'
                 .PHP_EOL
+                .'use App\\'.$modelName.';'
+                .PHP_EOL
                 .PHP_EOL
                 .'class '.$fileName
                 .PHP_EOL
@@ -61,11 +73,13 @@ class MakeServiceCommand extends Command
                 .PHP_EOL
                 .'    use ServiceAppAop;'
                 .PHP_EOL
+                .'    protected $modelClass='.$modelName.'::class;'
+                .PHP_EOL
                 .PHP_EOL.
                 '}');
         }
         else $this->error("ERROR: file exists;");
-        if ($this->option("provider")){
+        if (!$this->option("noProvider")){
             $path = base_path("app\\Providers\\AppServiceProvider.php");
             $i = 0;
             $fop = fopen($path,"r+");
@@ -107,4 +121,5 @@ class MakeServiceCommand extends Command
         }
         $this->info("File create success!");
     }
+
 }

+ 23 - 4
app/Console/Commands/MakeTestCommand.php

@@ -22,8 +22,7 @@ class MakeTestCommand extends \Illuminate\Foundation\Console\TestMakeCommand
             ||$this->option('controllers')) {
             return $rootNamespace.'\Controllers';
         }
-        if ($this->option('services')
-            ||$this->option('service')) {
+        if ($this->isForService()) {
             return $rootNamespace.'\Services\\'
                 .$this->getServiceName()
                 ;
@@ -35,9 +34,20 @@ class MakeTestCommand extends \Illuminate\Foundation\Console\TestMakeCommand
         }
     }
 
+    protected function isForService()
+    {
+        if ($this->option('services')
+            ||$this->option('service')) {
+            return true;
+        }
+        return false;
+    }
     protected function getNameInput()
     {
         $input= trim($this->argument('name'));
+        if(!$this->isForService()){
+            return $input;
+        }
         $inputs = explode(':', $input);
         return $inputs[1]
             ?$this->getMethodName()
@@ -47,16 +57,22 @@ class MakeTestCommand extends \Illuminate\Foundation\Console\TestMakeCommand
     protected function getServiceName()
     {
         $input= trim($this->argument('name'));
+        if(!$this->isForService()){
+            return $input;
+        }
         return ucfirst(explode(':',$input)[0]);
     }
     protected function getModelName()
     {
         $input= trim($this->argument('name'));
+        if(!$this->isForService()){
+            return $input;
+        }
         return str_replace('Service','',(explode(':',$input)[0]));
     }
     protected function getModelNamePlural()
     {
-        $modelName=preg_replace('/(s|x|ch|sh)$/','ses',lcfirst($this->getModelName()));
+        $modelName=preg_replace('/(s|x|ch|sh)$/','$1es',lcfirst($this->getModelName()));
         $modelName=preg_replace('/y$/','ies',$modelName);
         $modelName=preg_replace('/[cC]hild$/','children',$modelName);
         if(preg_match('/[cC]hildren$/',$modelName)==0){
@@ -67,6 +83,9 @@ class MakeTestCommand extends \Illuminate\Foundation\Console\TestMakeCommand
     protected function getMethodName()
     {
         $input= trim($this->argument('name'));
+        if(!$this->isForService()){
+            return $input;
+        }
         return ucfirst(explode(':',$input)[1]).'Test';
     }
 
@@ -92,7 +111,7 @@ class MakeTestCommand extends \Illuminate\Foundation\Console\TestMakeCommand
         $stub = str_replace(['{{ serviceName }}', '{{serviceName}}'], $this->getServiceName(), $stub);
         $stub = str_replace(['{{ modelName }}', '{{modelName}}'], $this->getModelName(), $stub);
         $stub = str_replace(['{{ modelNameUc }}', '{{modelNameUc}}'], ucfirst($this->getModelName()), $stub);
-        $stub = str_replace(['{{ modelNamePlural }}', '{{modelNamePlural}}'], ucfirst($this->getModelNamePlural()), $stub);
+        $stub = str_replace(['{{ modelNamePlural }}', '{{modelNamePlural}}'], lcfirst($this->getModelNamePlural()), $stub);
 
         return str_replace(['DummyClass', '{{ class }}', '{{class}}'], $class, $stub);
     }

+ 2 - 3
app/Console/Commands/SyncBatchTask.php

@@ -257,10 +257,9 @@ sql;
                 }
             }
         }
-
-         $this->batchService->assignTasks($batches);    //在这里为波次注册任务!
-
         ValueStore::query()->where("name","wave_detail_last_sync_date")->update(["value"=>$details[count($details)-1]->edittime]);
+
+        $this->batchService->assignTasks($batches);    //在这里为波次注册任务!
     }
 
     /**

+ 2 - 2
app/Console/Commands/stubs/model.stub

@@ -4,11 +4,11 @@ namespace {{ namespace }};
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class {{ class }} extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
 }

+ 2 - 2
app/CustomField.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class CustomField extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable=['table',
         'field',

+ 2 - 2
app/Customer.php

@@ -6,11 +6,11 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Relations\HasMany;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Customer extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
 

+ 2 - 2
app/CustomerLog.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class CustomerLog extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
 

+ 2 - 2
app/CustomerLogStatus.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class CustomerLogStatus extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
 

+ 2 - 2
app/CustomerTag.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class CustomerTag extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
 

+ 2 - 2
app/Depository.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Depository extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=[

+ 2 - 2
app/Feature.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Feature extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "type",     //类型

+ 82 - 0
app/Http/Controllers/CustomerController.php

@@ -4,6 +4,8 @@ namespace App\Http\Controllers;
 
 use App\Components\AsyncResponse;
 use App\Owner;
+use App\OwnerAreaReport;
+use App\OwnerReport;
 use App\Services\LogService;
 use App\Services\OwnerAreaReportService;
 use App\Services\OwnerBillReportService;
@@ -420,4 +422,84 @@ class CustomerController extends Controller
     {
         $this->success($this->validator($request->input())->errors());
     }
+
+    public function createReport()
+    {
+        $ids = \request("val");
+        if (!$ids)$this->error("未选择任何项目");
+
+        $reports = OwnerReport::query()->with("owner")
+            ->where("counting_month",">=",date("Y-m")."-01")
+            ->whereIn("owner_id",$ids)->get(["id","owner_id"]);
+        $errors = [];
+        $exist = [];
+        foreach ($reports as $report){
+            $errors[] = "“".($report->owner ? $report->owner->name : $report->owner_id)."”已存在本月报表";
+            $exist[] = $report->owner_id;
+        }
+        $ids = array_diff($ids,$exist);
+        $insert = [];
+        $date = date("Y-m-d H:i:s");
+        foreach ($ids as $id){
+            $insert[] = [
+                "owner_id"       => $id,
+                "counting_month" => date("Y-m-d"),
+                "created_at"     => $date
+            ];
+        }
+        if ($insert){
+            OwnerReport::query()->insert($insert);
+            LogService::log(__METHOD__,"手动生成报表",json_encode($insert));
+        }
+        $reports = OwnerReport::query()->with(["owner.userOwnerGroup","owner.customer"])
+            ->where("counting_month",">=",date("Y-m")."-01")
+            ->whereIn("owner_id",$ids)->get();
+        $result = [];
+        foreach ($reports as $report){
+            $result[] = [
+                "id" => $report->id,
+                "ownerGroupName" => $report->owner ? ($report->owner->userOwnerGroup ? $report->owner->userOwnerGroup->name : '') : '',
+                "customerName" => $report->owner ? ($report->owner->customer ? $report->owner->customer->name : '') : '',
+                "ownerName" => $report->owner ? $report->owner->name : '',
+                "ownerStatus" => $report->owner ? ($report->owner->deleted_at ? "冻结" : "激活") : '',
+                "ownerStorageDuration" => $report->owner ? ($report->owner->created_at ? ((new \DateTime())->diff(new \DateTime($report->owner->created_at))->days)  : '') : '',
+                "ownerCreatedAt" => $report->owner ? $report->owner->created_at : '',
+                "countingMonth" => $report->counting_month,
+            ];
+        }
+        $this->success(["errors"=>$errors,"data"=>$result]);
+    }
+
+    public function createAreaReport()
+    {
+        $ids = \request("val");
+        if (!$ids)$this->error("未选择任何项目");
+
+        /** @var OwnerService $service */
+        $service = app("OwnerService");
+        $owners = $service->get(["id"=>$ids],["ownerStoragePriceModels"],false,true);
+        app("OwnerAreaReportService")->notExistToInsert($owners);
+
+        $reports = OwnerAreaReport::query()
+            ->where("counting_month",">=",date("Y-m")."-01")
+            ->whereIn("owner_id",array_column($owners->toArray(),"id"))->get();
+        $result = [];
+        foreach ($reports as $report){
+            $result[] = [
+                "id" => $report->id,
+                "ownerGroupId" => $report->user_owner_group_id,
+                "ownerName" => $report->owner ? $report->owner->name : '',
+                "customerName" => $report->owner ? ($report->owner->customer ? $report->owner->customer->name : '') : '',
+                "countingMonth" => $report->counting_month,
+                "areaOnTray" => $report->area_on_tray,
+                "areaOnHalfTray" => $report->area_on_half_tray,
+                "areaOnFlat" => $report->area_on_flat,
+                "accountingArea" => $report->accounting_area,
+                "status" => $report->status,
+                "updatedAt" => $report->updated_at,
+                "ownerStoragePriceModel"=> $report->ownerStoragePriceModel ? $report->ownerStoragePriceModel->using_type : '' ,
+            ];
+        }
+        $this->success($result);
+    }
 }

+ 4 - 0
app/Http/Controllers/OrderFreezeController.php

@@ -36,6 +36,9 @@ class OrderFreezeController extends Controller
         if (request("street_id"))$freeze->where("street_id",request("street_id"));
         else $freeze->whereNull("street_id");
 
+        if (request("thawed_at"))$freeze->where("thawed_at",request("thawed_at"));
+        else $freeze->whereNull("thawed_at");
+
         $freeze = $freeze->first();
         if ($freeze && $freeze->id!=request("id"))$this->error("已存在冻结选项,无需重复录入");
         $obj = [
@@ -45,6 +48,7 @@ class OrderFreezeController extends Controller
             "district_id"   => request("district_id"),
             "town_id"       => request("town_id"),
             "street_id"     => request("street_id"),
+            "thawed_at"     => request("thawed_at"),
         ];
         if (request("id")){
             $freeze = OrderFreeze::query()->find(request("id"));

+ 34 - 17
app/Http/Controllers/PriceModelController.php

@@ -35,7 +35,7 @@ class PriceModelController extends Controller
     public function storageIndex(Request $request)
     {
         if(!Gate::allows('计费模型-仓储')){ return redirect('denied');  }
-        $models = app('OwnerStoragePriceModelService')->paginate($request->input("id"),["unit","owners"]);
+        $models = app('OwnerStoragePriceModelService')->paginate($request->input("id"),["unit","owners","timeUnit"]);
         return response()->view('maintenance.priceModel.storage.index',compact("models"));
     }
 
@@ -79,6 +79,7 @@ class PriceModelController extends Controller
             "discount_type" => $request->input("discount_type"),
             "discount_value"=> $request->input("discount_value"),
             "unit_id"       => $request->input("unit_id"),
+            "time_unit_id"  => $request->input("time_unit_id"),
         ]);
         $model = new OwnerStoragePriceModel();
         $model->id = $request->input("id");
@@ -105,6 +106,7 @@ class PriceModelController extends Controller
             'price'=>['required','numeric','min:0'],
             'discount_type'=>['required'],
             'unit_id'=>['required','integer'],
+            'time_unit_id'=>['required','integer'],
         ],[
             'required'=>':attribute 为必填项',
             'min'=>':attribute 不得小于0',
@@ -118,6 +120,7 @@ class PriceModelController extends Controller
             'discount_type' =>"减免类型",
             'discount_value'=>"减免值",
             'unit_id'       =>"单位",
+            'time_unit_id'  =>"计时单位",
         ]);
     }
 
@@ -262,6 +265,9 @@ class PriceModelController extends Controller
             "priority" => $request->input("priority"),
             "remark" => $request->input("remark"),
             "feature" => $request->input("feature"),
+            "discount_count"    => request("discount_count"),
+            "total_price"       => request("total_price"),
+            "total_discount_price"=> request("total_discount_price"),
         ]);
         //录入子表
         $insert = [];
@@ -309,6 +315,9 @@ class PriceModelController extends Controller
             "priority" => $request->input("priority"),
             "remark" => $request->input("remark"),
             "feature" => $request->input("feature"),
+            "discount_count"    => request("discount_count"),
+            "total_price"       => request("total_price"),
+            "total_discount_price"=> request("total_discount_price"),
         ]);
         $service->destroyItem($id);
         //录入子表
@@ -1005,6 +1014,7 @@ class PriceModelController extends Controller
             "discount_type"     => request("discount_type"),
             "discount_value"    => request("discount_value") ?? 0,
             "unit_id"           => request("unit_id"),
+            "time_unit_id"      => request("time_unit_id"),
         ];
         if (request("id"))app('OwnerStoragePriceModelService')->update(["id"=>request("id")],$values);
         else{
@@ -1037,15 +1047,19 @@ class PriceModelController extends Controller
         if (count($errors)>0)$this->success(["errors"=>$errors]);
 
         if (!request("owner_id"))$this->error("参数传递错误");
+        $operation = [
+            "name"              => request("name"),
+            "operation_type"    => request("operation_type"),
+            "strategy"          => request("strategy"),
+            "feature"           => request("feature"),
+            "remark"            => request("remark"),
+            "discount_count"    => request("discount_count"),
+            "total_price"       => request("total_price"),
+            "total_discount_price"=> request("total_discount_price"),
+        ];
         if (request("id")){
             $model = app('OwnerPriceOperationService')->find(request("id"),["items"]);
-            app('OwnerPriceOperationService')->findUpdate($model,[
-                "name"              => request("name"),
-                "operation_type"    => request("operation_type"),
-                "strategy"          => request("strategy"),
-                "feature"           => request("feature"),
-                "remark"            => request("remark"),
-            ]);
+            app('OwnerPriceOperationService')->findUpdate($model,$operation);
             $delete = [];//需要删除子项
             $update = [["id","strategy","amount","unit_id","unit_price","feature"]];//需要更新子项
             $insert = [];//需要新增子项
@@ -1073,14 +1087,8 @@ class PriceModelController extends Controller
             if (count($update) > 1)app(BatchUpdateService::class)->batchUpdate("owner_price_operation_items",$update);
             if ($insert)app("OwnerPriceOperationItemService")->insert($insert);
         }else{
-            DB::transaction(function ()use(&$model,$params){
-                $model = app('OwnerPriceOperationService')->create([
-                    "name"              => request("name"),
-                    "operation_type"    => request("operation_type"),
-                    "strategy"          => request("strategy"),
-                    "feature"           => request("feature"),
-                    "remark"            => request("remark"),
-                ]);
+            DB::transaction(function ()use(&$model,$params,$operation){
+                $model = app('OwnerPriceOperationService')->create($operation);
                 foreach ($params["items"] as &$item){
                     $item["owner_price_operation_id"] = $model->id;
                     if (!isset($item["feature"]))$item["feature"] = null;
@@ -1296,7 +1304,13 @@ class PriceModelController extends Controller
     {
         $owner = new Owner();
         $owner->id = request("id");
-        $owner->load(["ownerStoragePriceModels","ownerPriceOperations.items","ownerPriceExpresses"=>function($query){
+        $owner->load(["ownerStoragePriceModels","ownerPriceOperations"=>function($query){
+            /** @var Builder $query */
+            $query->with(["items"=>function($query){
+                /** @var Builder $query */
+                $query->orderByRaw("CASE strategy  WHEN '起步' THEN 1 WHEN '默认' THEN 2 WHEN '特征' THEN 3 END");
+            }]);
+        },"ownerPriceExpresses"=>function($query){
             /** @var Builder $query */
             $query->with(["details","logistics"]);
         },"ownerPriceLogistics"=>function($query){
@@ -1310,6 +1324,9 @@ class PriceModelController extends Controller
             $operation["featureFormat"] = $operation->featureFormat;
             foreach ($operation->items as &$item){
                 $item["featureFormat"] = $item->featureFormat;
+                if ($operation["operation_type"]==='出库' && $item["strategy"] == "起步"){
+                    $item["type"] = $item["amount"] ? 0 : 1;
+                }
             }
         }
         $this->success($owner);

+ 1 - 1
app/Http/Controllers/StationController.php

@@ -20,7 +20,7 @@ class StationController extends Controller
     }
     public function monitorIndex()
     {
-        $stations = Station::query()->with('type:name','parent:name')->whereHas('type',function($query){
+        $stations = Station::query()->with('stationType:name','parent:name')->whereHas('stationType',function($query){
             /** @var Builder $query */
             $query->where('name','料箱监视器');
         })->paginate(100);

+ 51 - 10
app/Http/Controllers/TestController.php

@@ -48,6 +48,7 @@ use App\OrderPackageCommodities;
 use App\OrderPackageCountingRecord;
 use App\OrderTracking;
 use App\Owner;
+use App\OwnerFeeDetail;
 use App\OwnerPriceOperation;
 use App\OwnerPriceOperationItem;
 use App\Package;
@@ -73,6 +74,7 @@ use App\Services\OracleDocAsnHerderService;
 use App\Services\OracleDOCOrderHeaderService;
 use App\Services\OracleDocWaveDetailService;
 use App\Services\OrderCommodityService;
+use App\Services\OrderFreezeService;
 use App\Services\OrderPackageReceivedSyncService;
 use App\Services\OrderPackageService;
 use App\Services\OrderService;
@@ -85,6 +87,7 @@ use App\Services\ShopService;
 use App\Services\StoreService;
 use App\Services\WarehouseService;
 use App\StationRuleBatch;
+use App\StationTask;
 use App\Store;
 use App\StationTaskBatch;
 use App\StoreCheckingReceiveItem;
@@ -131,12 +134,52 @@ class TestController extends Controller
     }
 
     public function zzd(){
-        $update = [
-            ["id","wms_status","remark","updated_at"],
-            ["id"=>6,"wms_status"=>"完全收货",
-                "remark"=>"01.[ALLBLU]普通波次","updated_at"=>"2021-01-27 08:58:53"]
-        ];
-        dd(app(BatchUpdateService::class)->batchUpdate("batches",$update));
+        dd(substr("2021-01-28",0,7) == date("Y-m"));
+    }
+
+
+    public function orderFreeze()
+    {
+        $freezeOrders = [];
+        $orders = Order::query()->whereBetween("updated_at",["2021-01-29 09:00:00","2021-01-29 14:00:00"])
+        ->get()->toArray();
+        foreach ($orders as $param){
+            if ($this->isFreeze($param))$freezeOrders[] = $param["code"];
+        }
+        $this->pushWMS($freezeOrders);
+    }
+
+    private function isFreeze($param)
+    {
+        $status = ['分配完成','创建订单','拣货完成','播种完成'];
+        if (array_search($param["wms_status"],$status)===false)return false;
+
+        $service = new OrderFreezeService();
+        $pools = $service->getFreezes();
+        foreach ($pools as $pool){
+            if ($pool["thawed_at"] && Carbon::parse($pool["thawed_at"])->lte(Carbon::today()))continue;
+            if ($pool["logistic_id"]!=$param["logistic_id"])continue;
+            if ($pool["province_name"] && (mb_strpos($param["province"],$pool["province_name"]) === false))continue;
+            if ($pool["city_name"] && (mb_strpos($param["city"],$pool["city_name"]) === false))continue;
+            if ($pool["district_name"] && (mb_strpos($param["district"],$pool["district_name"]) === false))continue;
+            if ($pool["town_name"] && (mb_strpos($param["address"],$pool["town_name"]) === false))continue;
+            if ($pool["street_name"] && (mb_strpos($param["address"],$pool["street_name"]) === false))continue;
+            return true;
+        }
+        return false;
+    }
+
+    private function pushWMS($freezeOrders)
+    {
+        if (!$freezeOrders)return;
+        $where = "''";
+        foreach ($freezeOrders as $f)$where .= ",'{$f}'";
+        $edit = date("Y-m-d H:i:s");
+        $sql = <<<sql
+UPDATE DOC_ORDER_HEADER SET edittime = TO_DATE('{$edit}','yyyy-mm-dd hh24:mi:ss'),releasestatus = 'H',waveno='*',notes = CASE WHEN notes IS NULL THEN '停运' ELSE  notes||',停运' END where ORDERNO in ({$where})
+sql;
+        DB::connection("oracle")->update($sql);
+        LogService::log(__METHOD__,"订单同步-自动冻结",$sql);
     }
 
     public function syncWeight()
@@ -294,7 +337,7 @@ sql;
 
     function tlog(Request $request)
     {
-        app('LogService')->log(__METHOD__, 'cczdelme' . __FUNCTION__, json_encode($request->all()), null);
+         dd((User::class)::query()->first());
     }
 
     function setCache(Request $request)
@@ -312,9 +355,7 @@ sql;
 
     function t1(Request $request)
     {
-        throw new ErrorException('eeeff');
-        DB::connection('oracle')->update(DB::raw("update BAS_SKU set HAZARD_FLAG= 'N' where SKU= '13564151055'"));
-//        DB::connection('oracle')->update(DB::raw("UPDATE DOC_ORDER_HEADER SET notes = CASE WHEN notes IS NULL THEN '停运' ELSE  notes||',停运' END where ORDERNO in ('','SO190628000050','SO190628000001')"));
+//        StationTask::query()->create(['status'=>'待处理']);
     }
 
     function packageT(Request $request)

+ 1 - 1
app/Http/Middleware/Authenticate.php

@@ -15,7 +15,7 @@ class Authenticate extends Middleware
     protected function redirectTo($request)
     {
         if ( $request->expectsJson()) {
-            return route('notLogin');
+            return route('login');
         }
     }
 }

+ 21 - 15
app/Imports/ExpressImport.php

@@ -11,11 +11,20 @@ use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Cache;
 use Maatwebsite\Excel\Concerns\ToCollection;
 use Maatwebsite\Excel\Concerns\WithHeadingRow;
+use Maatwebsite\Excel\Concerns\WithMultipleSheets;
 use Maatwebsite\Excel\Imports\HeadingRowFormatter;
 
 HeadingRowFormatter::default('none');
-class ExpressImport implements ToCollection,WithHeadingRow
+class ExpressImport implements ToCollection,WithHeadingRow,WithMultipleSheets
 {
+
+    public function sheets(): array
+    {
+        return [
+            0 => $this,
+        ];
+    }
+
     protected $express;
     public function __construct(OwnerPriceExpress $express = null)
     {
@@ -43,7 +52,7 @@ class ExpressImport implements ToCollection,WithHeadingRow
         $map = [];
         $provinces = Province::query()->get();
         foreach ($provinces as $province){
-            $map[$province->name] = $province->id;
+            $map[mb_substr($province->name,0,2)] = $province->id;
         }
 
         if (!$this->express){
@@ -63,7 +72,8 @@ class ExpressImport implements ToCollection,WithHeadingRow
         $update = [["id","initial_weight_price","additional_weight_price","updated_at"]];
         $date = date('Y-m-d H:i:s');
         foreach ($collection as $index => $item){
-            if (!isset($map[$item["省"]])){
+            $province = mb_substr($item["省"],0,2);
+            if (!isset($map[$province])){
                 $errors[] = "第“".($index+2)."”行未知省份";
                 continue;
             }
@@ -75,9 +85,9 @@ class ExpressImport implements ToCollection,WithHeadingRow
                 $errors[] = "第“".($index+2)."”行非法续重价格";
                 continue;
             }
-            if (isset($existDetails[$map[$item["省"]]])){
+            if (isset($existDetails[$map[$province]])){
                 $update[] = [
-                    "id" => $existDetails[$map[$item["省"]]],
+                    "id" => $existDetails[$map[$province]],
                     "initial_weight_price" => $item["首重价格"],
                     "additional_weight_price" => $item["续重价格"],
                     "updated_at" => $date,
@@ -86,7 +96,7 @@ class ExpressImport implements ToCollection,WithHeadingRow
             }
             $insert[] = [
                 "owner_price_express_id" => $id,
-                "province_id" => $map[$item["省"]],
+                "province_id" => $map[$province],
                 "initial_weight_price" => $item["首重价格"],
                 "additional_weight_price" => $item["续重价格"],
                 "created_at" => $date,
@@ -111,14 +121,10 @@ class ExpressImport implements ToCollection,WithHeadingRow
         $errors = [];
         $data = [];
         foreach ($collection as $index => $item){
-            if (!isset($map[$item["省"]])){
-                foreach ($map as $name=>$id){
-                    if (mb_strpos($item["省"],$name) !== false)$item["省"] = $name;
-                }
-                if (!isset($map[$item["省"]])){
-                    $errors[] = "第“".($index+2)."”行未知省份";
-                    continue;
-                }
+            $province = mb_substr($item["省"],0,2);
+            if (!isset($map[$province])){
+                $errors[] = "第“".($index+2)."”行未知省份";
+                continue;
             }
             if (!is_numeric($item["首重价格"]) || $item["首重价格"] <= 0){
                 $errors[] = "第“".($index+2)."”行非法首重价格";
@@ -129,7 +135,7 @@ class ExpressImport implements ToCollection,WithHeadingRow
                 continue;
             }
             $data[] = [
-                "province_id" => $map[$item["省"]],
+                "province_id" => $map[$province],
                 "initial_weight_price" => $item["首重价格"],
                 "additional_weight_price" => $item["续重价格"],
             ];

+ 0 - 5
app/Imports/OrderTrackingImport.php

@@ -43,7 +43,6 @@ class OrderTrackingImport implements ToCollection
          * @var OrderPackage $package
          * @var Commodity $commodity
          */
-        $service = app('OrderTrackingService');
         $owner = Owner::query()->where('name','安桥主品')->first();
         $this->owner = $owner;
         $collection->shift();
@@ -84,10 +83,6 @@ class OrderTrackingImport implements ToCollection
     }
 
     public function getOrderPackageCommodities($items){
-        /**
-         * @var OrderService $orderService
-         */
-        $orderService = app('OrderService');
         $packages = $this->getPackage($items[1],$items);
         $packages = collect($packages);
         if(!$packages||$packages->isEmpty()){

+ 8 - 1
app/Imports/OwnerPriceDirectLogisticDetailImport.php

@@ -11,11 +11,18 @@ use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Cache;
 use Maatwebsite\Excel\Concerns\ToCollection;
 use Maatwebsite\Excel\Concerns\WithHeadingRow;
+use Maatwebsite\Excel\Concerns\WithMultipleSheets;
 use Maatwebsite\Excel\Imports\HeadingRowFormatter;
 
 HeadingRowFormatter::default('none');
-class OwnerPriceDirectLogisticDetailImport implements ToCollection,WithHeadingRow
+class OwnerPriceDirectLogisticDetailImport implements ToCollection,WithHeadingRow,WithMultipleSheets
 {
+    public function sheets(): array
+    {
+        return [
+            0 => $this,
+        ];
+    }
     protected $model;
 
     public function __construct($model)

+ 1 - 1
app/Imports/StoreCheckingReceiveImport.php

@@ -10,12 +10,12 @@ use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Cache;
 use Maatwebsite\Excel\Concerns\ToCollection;
 use Maatwebsite\Excel\Concerns\WithHeadingRow;
+use Maatwebsite\Excel\Concerns\WithMultipleSheets;
 use Maatwebsite\Excel\Imports\HeadingRowFormatter;
 
 HeadingRowFormatter::default('none');
 class StoreCheckingReceiveImport implements ToCollection,WithHeadingRow
 {
-
     /**
      * @param Collection $collection
      * @return bool

+ 2 - 2
app/InventoryAccount.php

@@ -7,11 +7,11 @@ use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Support\Facades\Auth;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class InventoryAccount extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     use SoftDeletes;

+ 2 - 2
app/InventoryAccountMission.php

@@ -6,11 +6,11 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\Auth;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class InventoryAccountMission extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=[

+ 2 - 2
app/InventoryBlindReceiveExcel.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\Storage;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class InventoryBlindReceiveExcel extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     protected $fillable = [

+ 2 - 2
app/InventoryCompare.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class InventoryCompare extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=[

+ 2 - 2
app/InventoryDailyLog.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class InventoryDailyLog extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     public $timestamps=false;
     protected $fillable=[

+ 2 - 2
app/InventoryDailyLoggingOwner.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class InventoryDailyLoggingOwner extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable=[
         "owner_id","status"

+ 2 - 2
app/JobType.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class JobType extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
 }

+ 2 - 1
app/Jobs/OrderCreateInstantBill.php

@@ -36,7 +36,8 @@ class OrderCreateInstantBill implements ShouldQueue
     public function handle(OrderService $service)
     {
         try{
-            $service->createInstantBill($this->order);
+            if (!$service->createInstantBill($this->order))
+                LogService::log(__METHOD__,"ERROR-订单生成即时账单",$this->order->toJson());
         }catch (\Exception $e){
             LogService::log(__METHOD__,"ERROR-订单生成即时账单",$this->order->toJson()." | ".$e->getMessage());
         }

+ 5 - 2
app/Jobs/OrderFreeze.php

@@ -4,6 +4,7 @@ namespace App\Jobs;
 
 use App\Services\LogService;
 use App\Services\OrderFreezeService;
+use Carbon\Carbon;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
 use Illuminate\Foundation\Bus\Dispatchable;
@@ -51,7 +52,7 @@ class OrderFreeze implements ShouldQueue
     {
         $freezeOrders = [];
         foreach ($this->params as $param){
-            if (!$param["frozen"]=='是')continue;
+            if ($param["frozen"]=='是')continue;
             if (!$param["logistic_id"])continue;
             if ($this->isFreeze($param))$freezeOrders[] = $param["code"];
         }
@@ -64,6 +65,7 @@ class OrderFreeze implements ShouldQueue
         if (array_search($param["wms_status"],$status)===false)return false;
 
         foreach ($this->pool as $pool){
+            if ($pool["thawed_at"] && Carbon::parse($pool["thawed_at"])->lte(Carbon::today()))continue;
             if ($pool["logistic_id"]!=$param["logistic_id"])continue;
             if ($pool["province_name"] && (mb_strpos($param["province"],$pool["province_name"]) === false))continue;
             if ($pool["city_name"] && (mb_strpos($param["city"],$pool["city_name"]) === false))continue;
@@ -80,8 +82,9 @@ class OrderFreeze implements ShouldQueue
         if (!$freezeOrders)return;
         $where = "''";
         foreach ($freezeOrders as $f)$where .= ",'{$f}'";
+        $edit = date("Y-m-d H:i:s");
         $sql = <<<sql
-UPDATE DOC_ORDER_HEADER SET releasestatus = 'H',waveno='*',notes = CASE WHEN notes IS NULL THEN '停运' ELSE  notes||',停运' END where ORDERNO in ({$where})
+UPDATE DOC_ORDER_HEADER SET edittime = TO_DATE('{$edit}','yyyy-mm-dd hh24:mi:ss'),releasestatus = 'H',waveno='*',notes = CASE WHEN notes IS NULL THEN '停运' ELSE  notes||',停运' END where ORDERNO in ({$where})
 sql;
         DB::connection("oracle")->update($sql);
         LogService::log(__METHOD__,"订单同步-自动冻结",$sql);

+ 2 - 2
app/LaborCompany.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class LaborCompany extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=[

+ 2 - 2
app/LaborReport.php

@@ -10,11 +10,11 @@ use Illuminate\Support\Arr;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Gate;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class LaborReport extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     use SoftDeletes;

+ 2 - 2
app/LaborReportStatus.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class LaborReportStatus extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=[

+ 1 - 1
app/Log.php

@@ -7,7 +7,7 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Relations\HasOne;
 use Illuminate\Support\Str;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Log extends Model
 {

+ 2 - 2
app/Logistic.php

@@ -9,11 +9,11 @@ use Illuminate\Database\Eloquent\Model;
  * @method static Builder orderBy(string $string, string $string1)
  */use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Logistic extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable = ['name','code',"type","mobile","remark","delivery_fee"];

+ 2 - 2
app/LogisticNumberFeature.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class LogisticNumberFeature extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=['logistic_id','name','value','weight'];

+ 2 - 2
app/LogisticTiming.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class LogisticTiming extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     protected $fillable = [

+ 2 - 2
app/MailEvent.php

@@ -4,12 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 use Illuminate\Database\Eloquent\Relations\BelongsToMany;
 
 class MailEvent extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = ['name', 'event_name', 'remark', 'is_active', 'template'];
 

+ 2 - 2
app/MaterialBox.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class MaterialBox extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable=['code'];
 }

+ 2 - 2
app/MeasuringMachine.php

@@ -7,11 +7,11 @@ use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Support\Carbon;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class MeasuringMachine extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=[

+ 2 - 2
app/Menu.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Menu extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=[

+ 2 - 2
app/OperatorLog.php

@@ -5,11 +5,11 @@ namespace App;
 use DateTimeInterface;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OperatorLog extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     const UPDATED_AT = null;
     protected $fillable=[

+ 2 - 2
app/OracleActAllocationDetails.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleActAllocationDetails extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $connection="oracle";
     protected $primaryKey="ALLOCATIONDETAILSID";

+ 2 - 2
app/OracleActTransactionLog.php

@@ -10,11 +10,11 @@ use Illuminate\Database\Eloquent\Model;
  * TABLE:   ACT_TRANSACTION_LOG
  * EXPLAIN: 库存事务
  */
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleActTransactionLog extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $connection="oracle";
     protected $table="ACT_TRANSACTION_LOG";

+ 2 - 2
app/OracleBasCode.php

@@ -9,11 +9,11 @@ use Illuminate\Database\Eloquent\Model;
  * TABLE:   BAS_Codes
  * EXPLAIN: 系统代码内容
  */
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleBasCode extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $connection="oracle";
     protected $table="BAS_CODES";

+ 2 - 2
app/OracleBasCustomer.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleBasCustomer extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $connection="oracle";
     protected $table="BAS_CUSTOMER";

+ 2 - 2
app/OracleBasSKU.php

@@ -10,11 +10,11 @@ use Illuminate\Database\Eloquent\Model;
  */
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleBasSKU extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $connection="oracle";

+ 2 - 2
app/OracleDOCASNDetail.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleDOCASNDetail extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $connection="oracle";

+ 2 - 2
app/OracleDOCASNHeader.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleDOCASNHeader extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $connection="oracle";

+ 2 - 2
app/OracleDOCMovementDetail.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleDOCMovementDetail extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $connection="oracle";

+ 2 - 2
app/OracleDOCMovementHeader.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleDOCMovementHeader extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $connection="oracle";

+ 2 - 2
app/OracleDOCOrderDetail.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleDOCOrderDetail extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $connection="oracle";
     protected $table="DOC_Order_Details";

+ 2 - 2
app/OracleDOCOrderHeader.php

@@ -8,11 +8,11 @@ use App\Traits\HasCompositePrimaryKey;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleDOCOrderHeader extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $connection="oracle";

+ 2 - 2
app/OracleDOCWaveDetails.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleDOCWaveDetails extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $connection='oracle';
     protected $table='DOC_WAVE_DETAILS';

+ 2 - 2
app/OracleDOCWaveHeader.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleDOCWaveHeader extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable=[

+ 2 - 2
app/OracleDocOrderPackingSummary.php

@@ -6,11 +6,11 @@ use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleDocOrderPackingSummary extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $connection="oracle";
     protected $primaryKey="traceid";

+ 2 - 2
app/OracleIdxAsrsReceive.php

@@ -6,11 +6,11 @@ use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleIdxAsrsReceive extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $connection="oracle";
     protected $primaryKey="GROUPTASKID";

+ 2 - 2
app/OracleInvLotAtt.php

@@ -9,11 +9,11 @@ use Illuminate\Database\Eloquent\Model;
  * TABLE:   INV_LOT_ATT
  * EXPLAIN: 批次属性
  */
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleInvLotAtt extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     public function __construct(array $attributes = [])
     {

+ 2 - 2
app/OracleInvLotLocId.php

@@ -10,11 +10,11 @@ use Illuminate\Database\Eloquent\Model;
  * TABLE:   INV_LOT_LOC_ID
  * EXPLAIN: 库存状态
  */
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OracleInvLotLocId extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $connection="oracle";
     protected $table="INV_LOT_LOC_ID";

+ 2 - 2
app/Order.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Order extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     use ModelTimeFormat;

+ 2 - 2
app/OrderBin.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderBin extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         'order_id', 'number',

+ 2 - 2
app/OrderCommodity.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Http\Controllers\Controller;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderCommodity extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         'id', 'order_id','commodity_id', 'amount','wms_ptltaskid','location'

+ 2 - 2
app/OrderCommodityAssign.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderCommodityAssign extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable = [

+ 2 - 2
app/OrderCountingRecord.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderCountingRecord extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     protected $fillable = ['owner_id','shop_id' ,'warehouse_id' ,'logistic_id' ,'date_target' ,'counting_unit' ,'amount','year','month','week'];

+ 3 - 3
app/OrderFreeze.php

@@ -5,15 +5,15 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderFreeze extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
     use ModelTimeFormat;
 
     protected $fillable = [
-        "status","logistic_id","province_id","city_id","district_id","town_id","street_id"
+        "status","logistic_id","province_id","city_id","district_id","town_id","street_id","thawed_at"
     ];
 
     const status=[

+ 2 - 2
app/OrderIssue.php

@@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Relations\BelongsToMany;
 use Illuminate\Database\Eloquent\SoftDeletes;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 /**
  * @method Builder filter
@@ -16,7 +16,7 @@ use App\Traits\LogModelChanging;
 
 class OrderIssue extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     use ModelTimeFormat;

+ 2 - 2
app/OrderIssueOnTop.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderIssueOnTop extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     use ModelTimeFormat;

+ 2 - 2
app/OrderIssueProcessLog.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderIssueProcessLog extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     use ModelTimeFormat;

+ 2 - 2
app/OrderIssueRejectedBill.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderIssueRejectedBill extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
     protected $table='order_issue_rejected_bill';
     protected $fillable = [
         'order_issue_id','logistic_number_return'

+ 2 - 2
app/OrderIssueType.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderIssueType extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     use ModelTimeFormat;

+ 2 - 2
app/OrderPackage.php

@@ -14,11 +14,11 @@ use Illuminate\Support\Arr;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderPackage extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
 

+ 2 - 2
app/OrderPackageCommodities.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderPackageCommodities extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     use ModelTimeFormat;

+ 2 - 2
app/OrderPackageCountingRecord.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderPackageCountingRecord extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable=[
         "targeted_at","un_weigh_count","total_count"

+ 2 - 2
app/OrderTracking.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderTracking extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
 
     use ModelTimeFormat;

+ 2 - 2
app/OrderTrackingOwner.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OrderTrackingOwner extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     //
     use ModelTimeFormat;

+ 2 - 2
app/Owner.php

@@ -11,11 +11,11 @@ use Illuminate\Support\Facades\Auth;
  */
 use App\Traits\ModelTimeFormat;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class Owner extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     public $fillable = [

+ 2 - 2
app/OwnerAreaReport.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerAreaReport extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "owner_id",             //货主ID

+ 2 - 2
app/OwnerBillReport.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerBillReport extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
    protected $fillable = [
        "owner_id",       //项目ID

+ 2 - 2
app/OwnerContract.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerContract extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
 

+ 6 - 2
app/OwnerFeeDetail.php

@@ -5,11 +5,11 @@ namespace App;
 use App\Services\ProcessMethodService;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerFeeDetail extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "owner_id",         //货主ID
@@ -49,4 +49,8 @@ class OwnerFeeDetail extends Model
     {   //作业类型
         return $this->hasOne(ProcessMethod::class,"id","process_method_id");
     }
+    public function order()
+    {   //出库单
+        return $this->belongsTo(Order::class,"outer_id","id");
+    }
 }

+ 2 - 2
app/OwnerPriceDirectLogistic.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerPriceDirectLogistic extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "name",     //名称

+ 2 - 2
app/OwnerPriceDirectLogisticCar.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerPriceDirectLogisticCar extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "owner_price_direct_logistic_id",   //直发车计费ID

+ 2 - 2
app/OwnerPriceExpress.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerPriceExpress extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "name",             //名称

+ 2 - 2
app/OwnerPriceExpressProvince.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerPriceExpressProvince extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "owner_price_express_id",   //快递价格ID

+ 2 - 2
app/OwnerPriceLogistic.php

@@ -5,11 +5,11 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerPriceLogistic extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "name",             //名称

+ 2 - 2
app/OwnerPriceLogisticDetail.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerPriceLogisticDetail extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "owner_price_logistic_id",  //物流计费

+ 6 - 2
app/OwnerPriceOperation.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerPriceOperation extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "operation_type",   //操作类型
@@ -17,6 +17,10 @@ class OwnerPriceOperation extends Model
         "feature",          //特征
         "remark",           //备注
         "priority",         //优先级 值越大越高
+        "discount_count",   //减免值
+        "discount_date",    //减免阈值触发日
+        "total_price",      //按单计价
+        "total_discount_price",//按单计价减免
     ];
     public static $features = null;
     public static $columnMapping = null;

+ 3 - 2
app/OwnerPriceOperationItem.php

@@ -4,11 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerPriceOperationItem extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     protected $fillable = [
         "owner_price_operation_id",         //作业计费ID
@@ -18,6 +18,7 @@ class OwnerPriceOperationItem extends Model
         "unit_price",                       //单价
         "feature",                          //特征
         "priority",                         //优先级 值越大越高
+        "discount_price",                   //减免单价
     ];
     public $timestamps=false;
 

+ 2 - 2
app/OwnerReport.php

@@ -6,11 +6,11 @@ use App\Traits\ModelTimeFormat;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 
-use App\Traits\LogModelChanging;
+use App\Traits\ModelLogChanging;
 
 class OwnerReport extends Model
 {
-    use LogModelChanging;
+    use ModelLogChanging;
 
     use ModelTimeFormat;
     protected $fillable = [

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor