Bladeren bron

客户管理-模型工厂测试数据

Zhouzhendong 5 jaren geleden
bovenliggende
commit
af1d0e4b4a
100 gewijzigde bestanden met toevoegingen van 1013 en 818 verwijderingen
  1. 14 0
      app/Customer.php
  2. 14 0
      app/Feature.php
  3. 5 4
      app/Http/Controllers/CustomerController.php
  4. 11 0
      app/Http/Controllers/PriceModelController.php
  5. 24 1
      app/Owner.php
  6. 23 0
      app/OwnerAreaReport.php
  7. 22 0
      app/OwnerBillReport.php
  8. 47 0
      app/OwnerFeeDetail.php
  9. 20 0
      app/OwnerInStorageRule.php
  10. 23 0
      app/OwnerOutStorageRule.php
  11. 18 0
      app/OwnerPriceDirectLogistic.php
  12. 20 0
      app/OwnerPriceDirectLogisticCar.php
  13. 23 0
      app/OwnerPriceExpress.php
  14. 24 0
      app/OwnerPriceExpressProvince.php
  15. 36 0
      app/OwnerPriceLogistic.php
  16. 34 0
      app/OwnerPriceLogisticDetail.php
  17. 25 0
      app/OwnerPriceOperation.php
  18. 30 0
      app/OwnerReport.php
  19. 23 0
      app/OwnerStoragePriceModel.php
  20. 6 1
      app/ProcessMethod.php
  21. 2 0
      app/Providers/AppServiceProvider.php
  22. 40 0
      app/Services/OwnerReportService.php
  23. 1 2
      app/Services/WaybillService.php
  24. 12 0
      app/UserOwnerGroup.php
  25. 0 12
      database/factories/AuthorityFactory.php
  26. 0 12
      database/factories/CommodityBarcodeFactory.php
  27. 0 12
      database/factories/CommodityFactory.php
  28. 0 12
      database/factories/CustomFieldFactory.php
  29. 14 0
      database/factories/CustomerFactory.php
  30. 0 12
      database/factories/DepositoryFactory.php
  31. 0 23
      database/factories/InventoryFactory.php
  32. 0 31
      database/factories/InventoryMissionFactory.php
  33. 0 12
      database/factories/LogFactory.php
  34. 0 12
      database/factories/LogisticFactory.php
  35. 0 12
      database/factories/LogisticNumberFeatureFactory.php
  36. 0 12
      database/factories/MeasuringMachineFactory.php
  37. 0 12
      database/factories/OrderFactory.php
  38. 0 12
      database/factories/OrderIssueFactory.php
  39. 0 12
      database/factories/OrderIssueOnTopFactory.php
  40. 0 12
      database/factories/OrderIssueProcessLogFactory.php
  41. 0 12
      database/factories/OrderIssueTypeFactory.php
  42. 0 12
      database/factories/OrderItemsFactory.php
  43. 0 12
      database/factories/OrderOnTopFactory.php
  44. 0 12
      database/factories/OrderPackageCommoditiesFactory.php
  45. 0 12
      database/factories/OrderPackageFactory.php
  46. 0 12
      database/factories/OrderTrackingFactory.php
  47. 0 12
      database/factories/OrderTrackingOwnerFactory.php
  48. 20 0
      database/factories/OwnerBillReportFactory.php
  49. 12 1
      database/factories/OwnerFactory.php
  50. 17 0
      database/factories/OwnerReportFactory.php
  51. 0 12
      database/factories/PaperBoxFactory.php
  52. 0 12
      database/factories/QualityLabelFactory.php
  53. 0 12
      database/factories/RejectedBillFactory.php
  54. 0 12
      database/factories/RejectedBillItemFactory.php
  55. 0 12
      database/factories/RejectedFactory.php
  56. 0 12
      database/factories/RejectedItemFactory.php
  57. 0 12
      database/factories/RoleFactory.php
  58. 0 12
      database/factories/ShopFactory.php
  59. 0 12
      database/factories/StoreFactory.php
  60. 0 12
      database/factories/StoreItemsFactory.php
  61. 3 3
      database/factories/UserOwnerGroupFactory.php
  62. 0 12
      database/factories/WMSWaybillFactory.php
  63. 0 12
      database/factories/WMSWaybillOrderFactory.php
  64. 0 12
      database/factories/WarehouseFactory.php
  65. 0 12
      database/factories/WaybillOnTopFactory.php
  66. 0 33
      database/migrations/2020_10_20_134819_create_customers_table.php
  67. 1 1
      database/migrations/2020_10_27_142647_create_owner_storage_price_model_table.php
  68. 3 1
      database/migrations/2020_10_27_162056_add_column_unit_id_table_process_methods.php
  69. 34 0
      database/migrations/2020_10_28_162458_create_owner_price_expresses_table.php
  70. 35 0
      database/migrations/2020_10_28_162533_create_owner_price_expresses_provinces_table.php
  71. 31 0
      database/migrations/2020_10_28_162651_create_owner_price_express_owner_table.php
  72. 31 0
      database/migrations/2020_10_28_162743_create_owner_price_express_logistic_table.php
  73. 67 0
      database/migrations/2020_10_28_170858_save_customer_authority_data.php
  74. 39 0
      database/migrations/2020_10_28_175756_create_owner_price_logistics_table.php
  75. 41 0
      database/migrations/2020_10_28_175828_create_owner_price_logistic_details_table.php
  76. 31 0
      database/migrations/2020_10_28_175905_create_owner_price_logistic_owner_table.php
  77. 31 0
      database/migrations/2020_10_28_175928_create_owner_price_logistic_logistic_table.php
  78. 33 0
      database/migrations/2020_10_29_103017_create_owner_price_direct_logistics_table.php
  79. 36 0
      database/migrations/2020_10_29_103104_create_owner_price_direct_logistic_cars_table.php
  80. 32 0
      database/migrations/2020_10_29_144729_create_user_owner_groups_table.php
  81. 0 22
      database/seeds/CarTypesSeeder.php
  82. 0 20
      database/seeds/CarriersSeeder.php
  83. 0 21
      database/seeds/CitiesSeeder.php
  84. 0 16
      database/seeds/CustomFieldSeeder.php
  85. 3 0
      database/seeds/DatabaseSeeder.php
  86. 0 16
      database/seeds/LogisticTimingSeeder.php
  87. 0 16
      database/seeds/OrderIssueOnTopSeeder.php
  88. 0 16
      database/seeds/OrderIssueSeeder.php
  89. 0 16
      database/seeds/OrderIssueTypeSeeder.php
  90. 0 16
      database/seeds/OrderItemsSeeder.php
  91. 0 16
      database/seeds/OrderOnTopSeeder.php
  92. 0 16
      database/seeds/OrderPackageCommoditiesSeeder.php
  93. 0 16
      database/seeds/OrderPackageSeeder.php
  94. 0 16
      database/seeds/OrderSeeder.php
  95. 0 16
      database/seeds/OrderTrackingOwnerSeeder.php
  96. 0 16
      database/seeds/OrderTrackingSeeder.php
  97. 2 2
      database/seeds/OwnerReportSeeder.php
  98. 0 18
      database/seeds/ProvincesSeeder.php
  99. 0 16
      database/seeds/ShopSeeder.php
  100. 0 18
      database/seeds/UnitsSeeder.php

+ 14 - 0
app/Customer.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Customer extends Model
+{
+    protected $fillable = [
+        "code",         //客户名称
+        "name",         //客户代码
+        "company_name"  //公司名称
+    ];
+}

+ 14 - 0
app/Feature.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Feature extends Model
+{
+    protected $fillable = [
+        "type",     //类型
+        "logic",    //逻辑
+        "describe", //特征
+    ];
+}

+ 5 - 4
app/Http/Controllers/CustomerController.php

@@ -10,13 +10,14 @@ class CustomerController extends Controller
 {
     /**
      * Display a listing of the resource.
-     *
+     * @param Request $request
      * @return Response
      */
-    public function projectReport()
+    public function projectReport(Request $request)
     {
-        if(!Gate::allows('客户管理-项目-报表')){ return redirect('denied');  }
-        return response()->view('customer.project.report');
+        if(!Gate::allows('客户管理-项目-报表')){ return view('customer.index');  }
+        $reports = app("ownerReportService")->paginate($request->input());
+        return response()->view('customer.project.report',compact("reports"));
     }
 
     public function projectIndex()

+ 11 - 0
app/Http/Controllers/PriceModelController.php

@@ -48,4 +48,15 @@ class PriceModelController extends Controller
         if(!Gate::allows('计费模型-物流-录入')){ return redirect('denied');  }
         return response()->view('maintenance.priceModel.logistic.create');
     }
+
+    public function directLogisticIndex(){
+        if(!Gate::allows('计费模型-直发-查询')){ return redirect('denied');  }
+        return response()->view('maintenance.priceModel.directLogistic.index');
+    }
+
+    public function directLogisticCreate(){
+        if(!Gate::allows('计费模型-直发-录入')){ return redirect('denied');  }
+        return response()->view('maintenance.priceModel.directLogistic.create');
+    }
+
 }

+ 24 - 1
app/Owner.php

@@ -14,7 +14,22 @@ use App\Traits\ModelTimeFormat;
 class Owner extends Model
 {
     use ModelTimeFormat;
-    public $fillable = ['name','code','checking_count','deleted_at'];
+    public $fillable = [
+        'name',                 //名称
+        'code',                 //代码
+        'checking_count',       //审核数量
+        'deleted_at',           //删除时间
+        "customer_id",          //客户ID
+        "tax_rate",             //税率
+        "contract_number",      //合同号
+        "salesman",             //销售名称
+        "linkman",              //联系人
+        "phone_number",         //联系电话
+        "user_owner_group_id",  //项目组ID
+        "waring_line_on",       //月单量预警
+        "description"           //描述
+    ];
+
     public static function filterAuthorities(){
         $user=Auth::user();
         $query = (new static)->newQuery();
@@ -47,4 +62,12 @@ class Owner extends Model
     public function order(){
         return $this->hasOne(Order::class,'owner_id','id');
     }
+    public function customer()
+    {   //客户
+        return $this->hasOne(Customer::class,"id","customer_id");
+    }
+    public function userOwnerGroup()
+    {   //项目组
+        return $this->hasOne(UserOwnerGroup::class,"id","user_owner_group_id");
+    }
 }

+ 23 - 0
app/OwnerAreaReport.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerAreaReport extends Model
+{
+    protected $fillable = [
+        "owner_id",         //货主ID
+        "counting_month",   //结算月
+        "area_on_tray",     //货物整托
+        "area_on_half_tray",//货物半托
+        "area_on_flat",     //平面区面积
+        "accounting_area",  //结算面积
+        "status"            //状态
+    ];
+
+    public function owner()
+    {   //货主
+        return $this->hasOne(Owner::class,"id","owner_id");
+    }
+}

+ 22 - 0
app/OwnerBillReport.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerBillReport extends Model
+{
+   protected $fillable = [
+       "owner_id",       //项目ID
+       "counting_month", //结算月
+       "initial_fee",    //原始账单金额
+       "confirm_fee",    //确认账单金额
+       "difference",     //差额
+       "confirmed",      //确认状态
+   ];
+
+   public function owner()
+   {   //货主
+       $this->hasOne(Owner::class,"id","owner_id");
+   }
+}

+ 47 - 0
app/OwnerFeeDetail.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace App;
+
+use App\Services\ProcessMethodService;
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerFeeDetail extends Model
+{
+    protected $fillable = [
+        "owner_id",         //货主ID
+        "counting_month",   //结算月
+        "worked_at",        //作业时间
+        "type",             //类型
+        "shop_id",          //店铺ID
+        "operation_bill",   //发/收/退/提货单号
+        "consignee_name",   //收件人
+        "consignee_phone",  //收件人电话
+        "commodity_amount", //商品数量
+        "logistic_bill",    //快递单号
+        "volume",           //体积
+        "weight",           //重量
+        "logistic_id",      //物流ID
+        "process_method_id",//加工类型ID
+        "work_fee",         //作业费
+        "logistic_fee",     //物流费
+        "created_at",       //创建时间
+    ];
+    public $timestamps = false;
+
+    public function owner()
+    {   //货主
+        return $this->hasOne(Owner::class,"id","owner_id");
+    }
+    public function shop()
+    {   //店铺
+        return $this->hasOne(Shop::class,"id","shop_id");
+    }
+    public function logistic()
+    {   //物流
+        return $this->hasOne(Logistic::class,"id","logistic_id");
+    }
+    public function processMethod()
+    {   //作业类型
+        return $this->hasOne(ProcessMethod::class,"id","process_method_id");
+    }
+}

+ 20 - 0
app/OwnerInStorageRule.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerInStorageRule extends Model
+{
+    protected $fillable = [
+        "owner_price_operation_id", //作业计费ID
+        "amount",                   //计量
+        "unit_id",                  //单位ID
+        "unit_price",               //单价
+    ];
+
+    public function unit()
+    {   //单位
+        return $this->hasOne(Unit::class,"id","unit_id");
+    }
+}

+ 23 - 0
app/OwnerOutStorageRule.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerOutStorageRule extends Model
+{
+    protected $fillable = [
+        "owner_price_operation_id",         //作业计费ID
+        "owner_price_operation_strategy",   //作业计费策略
+        "strategy",                         //出库策略
+        "amount",                           //起步数
+        "unit_id",                          //单位ID
+        "unit_price",                       //单价
+        "feature",                          //特征
+    ];
+
+    public function unit()
+    {   //单位
+        return $this->hasOne(Unit::class,"id","unit_id");
+    }
+}

+ 18 - 0
app/OwnerPriceDirectLogistic.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerPriceDirectLogistic extends Model
+{
+    protected $fillable = [
+        "name",     //名称
+        "base_km"   //起步公里数
+    ];
+
+    public function ownerPriceDirectLogisticCars()
+    {   //直发车计费对应车型费
+        return $this->hasMany(OwnerPriceDirectLogisticCar::class,"owner_price_direct_logistic_id","id");
+    }
+}

+ 20 - 0
app/OwnerPriceDirectLogisticCar.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerPriceDirectLogisticCar extends Model
+{
+    protected $fillable = [
+        "owner_price_direct_logistic_id",   //直发车计费ID
+        "car_type_id",                      //车型ID
+        "base_fee",                         //起步费
+        "additional_fee",                   //续费(元/KM)
+    ];
+
+    public function carType()
+    {   //车型
+        return $this->hasOne(CarType::class,"id","car_type_id");
+    }
+}

+ 23 - 0
app/OwnerPriceExpress.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerPriceExpress extends Model
+{
+    protected $fillable = [
+        "name",                     //名称
+        "initial_weight_unit_id",   //首重单位
+        "additional_weight_unit_id",//续重单位
+    ];
+
+    public function owners()
+    {   //货主
+        $this->belongsToMany(Owner::class,"owner_price_express_owner","owner_price_express_id","owner_id");
+    }
+    public function logistics()
+    {   //物流
+        $this->belongsToMany(Logistic::class,"owner_price_express_logistic","owner_price_express_id","logistic_id");
+    }
+}

+ 24 - 0
app/OwnerPriceExpressProvince.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerPriceExpressProvince extends Model
+{
+    protected $fillable = [
+        "owner_price_express_id",   //快递价格ID
+        "province_id",              //省份ID
+        "initial_weight_price",     //初始单价
+        "additional_weight_price",  //续重单价
+    ];
+
+    public function ownerPriceExpress()
+    {   //快递计费
+        $this->belongsTo(OwnerPriceExpress::class,"owner_price_express_id","id");
+    }
+    public function province()
+    {   //省份
+        $this->hasOne(Province::class,"id","province_id");
+    }
+}

+ 36 - 0
app/OwnerPriceLogistic.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerPriceLogistic extends Model
+{
+    protected $fillable = [
+        "name",             //名称
+        "unit_range",       //单价一区间
+        "unit_id",          //单位一ID
+        "other_unit_range", //单位二区间
+        "other_unit_id",    //单位二ID
+        "pick_up_price",    //提货费
+        "fuel_price",       //燃油附加费
+        "service_price",    //信息服务费
+    ];
+
+    public function unit()
+    {   //单位一
+        return $this->hasOne(Unit::class,"id","unit_id");
+    }
+    public function otherUnit()
+    {   //单位二
+        return $this->hasOne(Unit::class,"id","other_unit_id");
+    }
+    public function owners()
+    {   //货主
+        return $this->belongsToMany(Owner::class,"owner_price_logistic_owner","owner_price_logistic_id","owner_id");
+    }
+    public function logistics()
+    {   //物流
+        return $this->belongsToMany(Logistic::class,"owner_price_logistic_logistic","owner_price_logistic_id","logistic_id");
+    }
+}

+ 34 - 0
app/OwnerPriceLogisticDetail.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerPriceLogisticDetail extends Model
+{
+    protected $fillable = [
+        "owner_price_logistic_id",  //物流计费
+        "unit_id",                  //单位ID
+        "range",                    //区间
+        "province_id",              //省份ID
+        "city_id",                  //城市ID
+        "unit_price",               //单价
+        "delivery_fee",             //送货费
+        "initial_fee",              //起始计费
+        "initial_amount",           //起始计数
+        "rate",                     //费率
+    ];
+
+    public function unit()
+    { //单位
+        return $this->hasOne(Unit::class,"id","unit_id");
+    }
+    public function province()
+    { //省份
+        return $this->hasOne(Province::class,"id","province_id");
+    }
+    public function city()
+    { //城市
+        return $this->hasOne(City::class,"id","city_id");
+    }
+}

+ 25 - 0
app/OwnerPriceOperation.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerPriceOperation extends Model
+{
+    protected $fillable = [
+        "operation_type",   //操作类型
+        "name",             //名称
+        "strategy",         //策略
+        "feature",          //特征
+        "remark",           //备注
+    ];
+
+    public function ownerInStorageRule()
+    {   //入库规则
+        return $this->hasOne(OwnerInStorageRule::class,"owner_price_operation_id","id");
+    }
+    public function ownerOutStorageRules()
+    {   //出库规则
+        return $this->hasMany(OwnerOutStorageRule::class,"owner_price_operation_id","id");
+    }
+}

+ 30 - 0
app/OwnerReport.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App;
+
+use App\Traits\ModelTimeFormat;
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerReport extends Model
+{
+    use ModelTimeFormat;
+    protected $fillable = [
+        "owner_id",                     //货主ID
+        "counting_month",               //结算月
+        "daily_average_order_amount",   //日均单量
+        "current_month_counting_area",  //结算月盘点面积
+        "last_month_counting_area",     //结算月上月盘点面积
+        "owner_bill_report_id"          //账单ID
+    ];
+
+    public $timestamps = false;
+
+    public function owner()
+    {   //货主
+        return $this->hasOne(Owner::class,"id","owner_id");
+    }
+    public function ownerBillReport()
+    {   //账单
+        return $this->hasOne(OwnerBillReport::class,"id","owner_bill_report_id");
+    }
+}

+ 23 - 0
app/OwnerStoragePriceModel.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class OwnerStoragePriceModel extends Model
+{
+    protected $fillable = [
+        "counting_type",    //计费类型
+        "using_type",       //用仓类型
+        "minimum_area",     //最低起租面积
+        "price",            //单价
+        "discount_type",    //减免类型
+        "discount_value",   //减免值
+        "unit_id",          //单位ID
+    ];
+
+    public function unit()
+    {   //单位
+        return $this->hasOne(Unit::class,"id","unit_id");
+    }
+}

+ 6 - 1
app/ProcessMethod.php

@@ -8,5 +8,10 @@ use App\Traits\ModelTimeFormat;
 class ProcessMethod extends Model
 {
     use ModelTimeFormat;
-    protected $fillable=['name'];
+    protected $fillable=['name',"unit_id","unit_price"];
+
+    public function unit()
+    {   //单位
+        return $this->hasOne(Unit::class,"id","unit_id");
+    }
 }

+ 2 - 0
app/Providers/AppServiceProvider.php

@@ -25,6 +25,7 @@ use App\Services\OrderService;
 use App\Services\OrderIssueWorkLoadService;
 use App\Services\OrderPackageCommoditiesService;
 use App\Services\OrderTrackingService;
+use App\Services\OwnerReportService;
 use App\Services\OwnerService;
 use App\Services\PackageStatisticsService;
 use App\Services\ProcessesContentService;
@@ -123,6 +124,7 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('storeService',StoreService::class);
         app()->singleton('warehouseService',WarehouseService::class);
         app()->singleton('storeItemService',StoreItemService::class);
+        app()->singleton('ownerReportService',OwnerReportService::class);
 
         $this->loadingOrderModuleService();
         $this->loadingBasedModuleService();

+ 40 - 0
app/Services/OwnerReportService.php

@@ -0,0 +1,40 @@
+<?php 
+
+namespace App\Services; 
+
+use App\OwnerReport;
+use App\Services\common\QueryService;
+use Illuminate\Database\Eloquent\Builder;
+
+Class OwnerReportService
+{
+    /**
+     * @param Builder $builder
+     * @param array $params
+     * @return Builder
+     */
+    private function query(Builder $builder, array $params)
+    {
+        $columnQueryRules = [
+            'counting_month_start' => ['alias' => 'counting_month', 'startDate' => '-01'],
+            'counting_month_end' => ['alias' => 'counting_month', 'endDate' => '-31'],
+            'owner_id' => ['multi' => ','],
+        ];
+        return app(QueryService::class)->query($params, $builder, $columnQueryRules,"owner_reports");
+    }
+
+    public function get(array $params, array $withs = null)
+    {
+        $query = OwnerReport::query();
+        if ($withs)$query->with($withs);
+        return $this->query($query,$params)->get();
+    }
+
+    public function paginate(array $params, array $withs = null)
+    {
+        $query = OwnerReport::query();
+        if ($withs)$query->with($withs);
+        return $this->query($query,$params)->paginate($params["paginate"] ?? 50);
+    }
+
+}

+ 1 - 2
app/Services/WaybillService.php

@@ -20,8 +20,7 @@ Class WaybillService
         $waybills = Waybill::filterAuthorities()->with(['owner','carrier','originationCity','destinationCity'=>function($query){
             $query->with('province');
         },'uploadFile','amountUnit','priceModel','warehouseWeightUnit','carrierWeightUnit',
-            'warehouseWeightUnitOther','carrierWeightUnitOther','carType','uploadFile',
-            'wmsCommodities','waybillAuditLogs' => function ($query) {
+            'warehouseWeightUnitOther','carrierWeightUnitOther','carType','uploadFile','waybillAuditLogs' => function ($query) {
             $query->with('user');
         }])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
             ->leftJoin('waybill_on_tops','waybill_on_tops.waybill_id','=','waybills.id')

+ 12 - 0
app/UserOwnerGroup.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class UserOwnerGroup extends Model
+{
+    protected $fillable = [
+        "name"  //名称
+    ];
+}

+ 0 - 12
database/factories/AuthorityFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Authority;
-use Faker\Generator as Faker;
-
-$factory->define(Authority::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/CommodityBarcodeFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\CommodityBarcode;
-use Faker\Generator as Faker;
-
-$factory->define(CommodityBarcode::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/CommodityFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Commodity;
-use Faker\Generator as Faker;
-
-$factory->define(Commodity::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/CustomFieldFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\CustomField;
-use Faker\Generator as Faker;
-
-$factory->define(CustomField::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 14 - 0
database/factories/CustomerFactory.php

@@ -0,0 +1,14 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\Customer;
+use Faker\Generator as Faker;
+
+$factory->define(Customer::class, function (Faker $faker) {
+    return [
+        "code" => \Illuminate\Support\Str::random(5).date('yymmdd'),         //客户名称
+        "name" => $faker->name,         //客户代码
+        "company_name" => $faker->name  //公司名称
+    ];
+});

+ 0 - 12
database/factories/DepositoryFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Depository;
-use Faker\Generator as Faker;
-
-$factory->define(Depository::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 23
database/factories/InventoryFactory.php

@@ -1,23 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\InventoryAccount;
-use App\Owner;
-use Faker\Generator as Faker;
-
-$factory->define(InventoryAccount::class, function (Faker $faker) {
-    $owners=Owner::select('id')->get();
-    return [
-        'owner_id'=>$owners[1],
-        'type'=>'动盘',
-        'start_at'=>now(),
-        'end_at'=>now(),
-        'total'=>3,
-        'processed'=>0,
-        'difference'=>0,
-        'returned'=>0,
-        'deleted_at'=>null,
-        'created_at'=>now(),
-    ];
-});

+ 0 - 31
database/factories/InventoryMissionFactory.php

@@ -1,31 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\InventoryAccountMission;
-use App\Commodity;
-use Faker\Generator as Faker;
-use Illuminate\Support\Str;
-
-$factory->define(InventoryAccountMission::class, function (Faker $faker) {
-    $commoditys=Commodity::get();
-    return [
-        'inventory_account_id'=>'',
-        'location'=>Str::random(5),
-        'commodity_id'=>$commoditys[0]['id'],
-        'produced_at'=>'',
-        'valid_at'=>'',
-        'stored_at'=>'',
-        'batch_number'=>'',
-        'erp_type_position'=>'',
-        'quality'=>'',
-        'stored_amount'=>50,
-        'valid_amount'=>'',
-        'verified_amount'=>'',
-        're_checked_amount'=>'',
-        'difference_amount'=>'',
-        'occupied_amount'=>'',
-        'checked'=>'否',
-        'returned'=>'无',
-    ];
-});

+ 0 - 12
database/factories/LogFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/* @var $factory \Illuminate\Database\Eloquent\Factory */
-
-use App\Log;
-use Faker\Generator as Faker;
-
-$factory->define(Log::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/LogisticFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Logistic;
-use Faker\Generator as Faker;
-
-$factory->define(Logistic::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/LogisticNumberFeatureFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\LogisticNumberFeature;
-use Faker\Generator as Faker;
-
-$factory->define(LogisticNumberFeature::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/MeasuringMachineFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\MeasuringMachine;
-use Faker\Generator as Faker;
-
-$factory->define(MeasuringMachine::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Order;
-use Faker\Generator as Faker;
-
-$factory->define(Order::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderIssueFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderIssue;
-use Faker\Generator as Faker;
-
-$factory->define(OrderIssue::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderIssueOnTopFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderIssueOnTop;
-use Faker\Generator as Faker;
-
-$factory->define(OrderIssueOnTop::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderIssueProcessLogFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderIssueProcessLog;
-use Faker\Generator as Faker;
-
-$factory->define(OrderIssueProcessLog::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderIssueTypeFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderIssueType;
-use Faker\Generator as Faker;
-
-$factory->define(OrderIssueType::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderItemsFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderItems;
-use Faker\Generator as Faker;
-
-$factory->define(OrderItems::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderOnTopFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderOnTop;
-use Faker\Generator as Faker;
-
-$factory->define(OrderOnTop::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderPackageCommoditiesFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderPackageCommodities;
-use Faker\Generator as Faker;
-
-$factory->define(OrderPackageCommodities::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderPackageFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderPackage;
-use Faker\Generator as Faker;
-
-$factory->define(OrderPackage::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderTrackingFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderTracking;
-use Faker\Generator as Faker;
-
-$factory->define(OrderTracking::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/OrderTrackingOwnerFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\OrderTrackingOwner;
-use Faker\Generator as Faker;
-
-$factory->define(OrderTrackingOwner::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 20 - 0
database/factories/OwnerBillReportFactory.php

@@ -0,0 +1,20 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\OwnerBillReport;
+use Faker\Generator as Faker;
+
+$factory->define(OwnerBillReport::class, function (Faker $faker) {
+    $owner = \App\Owner::query()->whereNotNull("user_owner_group_id")->first();
+    $initial_fee = mt_rand(0,50000) / 10;
+    $confirm_fee = mt_rand(0,50000) / 10;
+    return [
+        "owner_id" => $owner ? $owner->id : factory(\App\Owner::class),       //项目ID
+        "counting_month" => $faker->date(), //结算月
+        "initial_fee" => $initial_fee,    //原始账单金额
+        "confirm_fee" => $confirm_fee,    //确认账单金额
+        "difference" => $confirm_fee - $initial_fee,     //差额
+        "confirmed" => "否",      //确认状态
+    ];
+});

+ 12 - 1
database/factories/OwnerFactory.php

@@ -7,6 +7,17 @@ use Faker\Generator as Faker;
 
 $factory->define(Owner::class, function (Faker $faker) {
     return [
-        //
+        'name' => $faker->name,                 //名称
+        'code' => \Illuminate\Support\Str::random(5).date('yymmdd'),                 //代码
+        'checking_count' => mt_rand(0,5),       //审核数量
+        "customer_id" => factory(App\Customer::class),          //客户ID
+        "tax_rate" => mt_rand(0,100) / 10,             //税率
+        "contract_number" => \Illuminate\Support\Str::random(5).date('yymmdd'),      //合同号
+        "salesman" => $faker->name,             //销售名称
+        "linkman" => $faker->name,              //联系人
+        "phone_number" => $faker->phoneNumber,         //联系电话
+        "user_owner_group_id" => factory(\App\UserOwnerGroup::class),  //项目组ID
+        "waring_line_on" => mt_rand(0,1000),       //月单量预警
+        "description" => $faker->text           //描述
     ];
 });

+ 17 - 0
database/factories/OwnerReportFactory.php

@@ -0,0 +1,17 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\OwnerReport;
+use Faker\Generator as Faker;
+
+$factory->define(OwnerReport::class, function (Faker $faker) {
+    return [
+        "owner_id" => factory(App\Owner::class),                     //货主ID
+        "counting_month" => $faker->date(),               //结算月
+        "daily_average_order_amount" => mt_rand(0,10000),  //日均单量
+        "current_month_counting_area" => mt_rand(100,100000) / 50,  //结算月盘点面积
+        "last_month_counting_area"   => mt_rand(100,100000) / 50,  //结算月上月盘点面积
+        "owner_bill_report_id"  =>factory(App\OwnerBillReport::class)        //账单ID
+    ];
+});

+ 0 - 12
database/factories/PaperBoxFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\PaperBox;
-use Faker\Generator as Faker;
-
-$factory->define(PaperBox::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/QualityLabelFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\QualityLabel;
-use Faker\Generator as Faker;
-
-$factory->define(QualityLabel::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/RejectedBillFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\RejectedBill;
-use Faker\Generator as Faker;
-
-$factory->define(RejectedBill::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/RejectedBillItemFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\RejectedBillItem;
-use Faker\Generator as Faker;
-
-$factory->define(RejectedBillItem::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/RejectedFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Rejected;
-use Faker\Generator as Faker;
-
-$factory->define(Rejected::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/RejectedItemFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\RejectedItem;
-use Faker\Generator as Faker;
-
-$factory->define(RejectedItem::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/RoleFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Role;
-use Faker\Generator as Faker;
-
-$factory->define(Role::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/ShopFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Shop;
-use Faker\Generator as Faker;
-
-$factory->define(Shop::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/StoreFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Store;
-use Faker\Generator as Faker;
-
-$factory->define(Store::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/StoreItemsFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\StoreItems;
-use Faker\Generator as Faker;
-
-$factory->define(StoreItems::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 3 - 3
database/factories/LogisticTimingFactory.php → database/factories/UserOwnerGroupFactory.php

@@ -2,11 +2,11 @@
 
 /** @var \Illuminate\Database\Eloquent\Factory $factory */
 
-use App\LogisticTiming;
+use App\UserOwnerGroup;
 use Faker\Generator as Faker;
 
-$factory->define(LogisticTiming::class, function (Faker $faker) {
+$factory->define(UserOwnerGroup::class, function (Faker $faker) {
     return [
-        //
+        "name"  => $faker->name
     ];
 });

+ 0 - 12
database/factories/WMSWaybillFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\WMSWaybill;
-use Faker\Generator as Faker;
-
-$factory->define(WMSWaybill::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/WMSWaybillOrderFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\WMSWaybillOrder;
-use Faker\Generator as Faker;
-
-$factory->define(WMSWaybillOrder::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/WarehouseFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\Warehouse;
-use Faker\Generator as Faker;
-
-$factory->define(Warehouse::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 12
database/factories/WaybillOnTopFactory.php

@@ -1,12 +0,0 @@
-<?php
-
-/** @var \Illuminate\Database\Eloquent\Factory $factory */
-
-use App\WaybillOnTop;
-use Faker\Generator as Faker;
-
-$factory->define(WaybillOnTop::class, function (Faker $faker) {
-    return [
-        //
-    ];
-});

+ 0 - 33
database/migrations/2020_10_20_134819_create_customers_table.php

@@ -7,33 +7,6 @@ use Illuminate\Support\Facades\Schema;
 
 class CreateCustomersTable extends Migration
 {
-    protected $authNames=[
-        '客户管理',
-        '客户管理-项目',
-        '客户管理-项目-报表',
-        '客户管理-项目-查询',
-        '客户管理-项目-录入',
-        '客户管理-项目-面积',
-        '客户管理-财务-即时账单',
-        '客户管理-财务-账单确认',
-        '计费模型-仓储',
-        '计费模型-仓储-录入',
-        '客户',
-        '客户-查询',
-        '客户-录入',
-        '项目组',
-        '项目组-查询',
-        '项目组-录入',
-        '作业类型',
-        '作业类型-查询',
-        '作业类型-录入',
-        '特征',
-        '特征-录入',
-        '特征-查询',
-        '计费模型-作业',
-        '计费模型-作业-查询',
-        '计费模型-作业-录入',
-    ];
     /**
      * Run the migrations.
      *
@@ -48,9 +21,6 @@ class CreateCustomersTable extends Migration
             $table->string('company_name')->comment('公司名称');
             $table->timestamps();
         });
-        foreach ($this->authNames as $name){
-            if(!Authority::query()->where('name',$name)->first())(new Authority(['name'=>$name,'alias_name'=>$name]))->save();
-        }
     }
 
     /**
@@ -61,8 +31,5 @@ class CreateCustomersTable extends Migration
     public function down()
     {
         Schema::dropIfExists('customers');
-        foreach ($this->authNames as $name){
-            Authority::query()->where('name',$name)->delete();
-        }
     }
 }

+ 1 - 1
database/migrations/2020_10_27_142647_create_owner_storage_price_model_table.php

@@ -19,7 +19,7 @@ class CreateOwnerStoragePriceModelTable extends Migration
             $table->enum("using_type",["常温","恒温"])->default("常温")->comment('用仓类型');
             $table->decimal("minimum_area")->default(0)->comment("最低起租面积");
             $table->decimal("price",8,3)->comment("单价");
-            $table->enum("discount_type",["无减免","按单减免","固定减免"])->default("无减免")->comment("最低起租面积");
+            $table->enum("discount_type",["无减免","按单减免","固定减免"])->default("无减免")->comment("减免类型");
             $table->decimal("discount_value")->nullable()->comment("减免值");
             $table->bigInteger("unit_id")->nullable()->index()->comment("外键单位");
             $table->timestamps();

+ 3 - 1
database/migrations/2020_10_27_162056_add_column_unit_id_table_process_methods.php

@@ -14,7 +14,8 @@ class AddColumnUnitIdTableProcessMethods extends Migration
     public function up()
     {
         Schema::table('process_methods', function (Blueprint $table) {
-            $table->bigInteger("unit_id")->nullable()->index()->comment('单位');
+            $table->bigInteger("unit_id")->nullable()->index()->comment('外键单位');
+            $table->decimal("unit_price",8,4)->nullable()->comment("单价");
         });
     }
 
@@ -27,6 +28,7 @@ class AddColumnUnitIdTableProcessMethods extends Migration
     {
         Schema::table('process_methods', function (Blueprint $table) {
             $table->dropColumn("unit_id");
+            $table->dropColumn("unit_price");
         });
     }
 }

+ 34 - 0
database/migrations/2020_10_28_162458_create_owner_price_expresses_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceExpressesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_expresses', function (Blueprint $table) {
+            $table->id();
+            $table->string("name")->comment("价格名称");
+            $table->bigInteger("initial_weight_unit_id")->index()->comment("首重单位");
+            $table->bigInteger("additional_weight_unit_id")->index()->comment("续重单位");
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_expresses');
+    }
+}

+ 35 - 0
database/migrations/2020_10_28_162533_create_owner_price_expresses_provinces_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceExpressesProvincesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_express_provinces', function (Blueprint $table) {
+            $table->id();
+            $table->bigInteger("owner_price_express_id")->index()->comment("外键快递价格");
+            $table->bigInteger("province_id")->index()->comment("外键省份");
+            $table->decimal("initial_weight_price",8,4)->comment("初始单价");
+            $table->decimal("additional_weight_price",8,4)->comment("续重单价");
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_expresses_provinces');
+    }
+}

+ 31 - 0
database/migrations/2020_10_28_162651_create_owner_price_express_owner_table.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceExpressOwnerTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_express_owner', function (Blueprint $table) {
+            $table->bigInteger("owner_price_express_id")->index()->comment("外键快递价格");
+            $table->bigInteger("owner_id")->index()->comment("外键货主");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_express_owner');
+    }
+}

+ 31 - 0
database/migrations/2020_10_28_162743_create_owner_price_express_logistic_table.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceExpressLogisticTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_express_logistic', function (Blueprint $table) {
+            $table->bigInteger("owner_price_express_id")->index()->comment("外键快递价格");
+            $table->bigInteger("logistic_id")->index()->comment("外键快递");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_express_logistic');
+    }
+}

+ 67 - 0
database/migrations/2020_10_28_170858_save_customer_authority_data.php

@@ -0,0 +1,67 @@
+<?php
+
+use App\Authority;
+use Illuminate\Database\Migrations\Migration;
+
+class SaveCustomerAuthorityData extends Migration
+{
+    protected $authNames=[
+        '客户管理',
+        '客户管理-项目',
+        '客户管理-项目-报表',
+        '客户管理-项目-查询',
+        '客户管理-项目-录入',
+        '客户管理-项目-面积',
+        '客户管理-财务-即时账单',
+        '客户管理-财务-账单确认',
+        '计费模型-仓储',
+        '计费模型-仓储-录入',
+        '客户',
+        '客户-查询',
+        '客户-录入',
+        '项目组',
+        '项目组-查询',
+        '项目组-录入',
+        '作业类型',
+        '作业类型-查询',
+        '作业类型-录入',
+        '特征',
+        '特征-录入',
+        '特征-查询',
+        '计费模型-作业',
+        '计费模型-作业-查询',
+        '计费模型-作业-录入',
+        '计费模型-快递',
+        '计费模型-快递-查询',
+        '计费模型-快递-录入',
+        '计费模型-物流',
+        '计费模型-物流-查询',
+        '计费模型-物流-录入',
+        '计费模型-直发',
+        '计费模型-直发-查询',
+        '计费模型-直发-录入',
+    ];
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        foreach ($this->authNames as $name){
+            if(!Authority::query()->where('name',$name)->first())(new Authority(['name'=>$name,'alias_name'=>$name]))->save();
+        }
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        foreach ($this->authNames as $name){
+            Authority::query()->where('name',$name)->delete();
+        }
+    }
+}

+ 39 - 0
database/migrations/2020_10_28_175756_create_owner_price_logistics_table.php

@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceLogisticsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_logistics', function (Blueprint $table) {
+            $table->id();
+            $table->string("name")->comment("名称");
+            $table->string("unit_range")->nullable()->comment("单位一区间");
+            $table->bigInteger("unit_id")->index()->comment("外键单位:单位一");
+            $table->string("other_unit_range")->nullable()->comment("单位二区间");
+            $table->bigInteger("other_unit_id")->index()->comment("外键单位:单位二");
+            $table->decimal("pick_up_price",8,4)->nullable()->comment("提货费");
+            $table->decimal("fuel_price",8,4)->nullable()->comment("燃油附加费");
+            $table->decimal("service_price",8,4)->nullable()->comment("信息服务费");
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_logistics');
+    }
+}

+ 41 - 0
database/migrations/2020_10_28_175828_create_owner_price_logistic_details_table.php

@@ -0,0 +1,41 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceLogisticDetailsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_logistic_details', function (Blueprint $table) {
+            $table->id();
+            $table->bigInteger("owner_price_logistic_id")->index()->comment("外键物流计费");
+            $table->bigInteger("unit_id")->index()->comment("单位");
+            $table->string("range")->nullable()->comment("区间");
+            $table->bigInteger("province_id")->nullable()->index()->comment("外键省份");
+            $table->bigInteger("city_id")->nullable()->index()->comment("外键城市");
+            $table->decimal("unit_price",8,4)->nullable()->comment("单价");
+            $table->decimal("delivery_fee",8,4)->nullable()->comment("送货费");
+            $table->decimal("initial_fee",8,4)->nullable()->comment("起始计费");
+            $table->integer("initial_amount")->nullable()->comment("起始计数");
+            $table->decimal("rate")->nullable()->comment("费率");
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_logistic_details');
+    }
+}

+ 31 - 0
database/migrations/2020_10_28_175905_create_owner_price_logistic_owner_table.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceLogisticOwnerTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_logistic_owner', function (Blueprint $table) {
+            $table->bigInteger("owner_price_logistic_id")->comment("外键物流计费");
+            $table->bigInteger("owner_id")->comment("外键货主");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_logistic_owner');
+    }
+}

+ 31 - 0
database/migrations/2020_10_28_175928_create_owner_price_logistic_logistic_table.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceLogisticLogisticTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_logistic_logistic', function (Blueprint $table) {
+            $table->bigInteger("owner_price_logistic_id")->comment("外键物流计费");
+            $table->bigInteger("logistic_id")->comment("外键承运商");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_logistic_logistic');
+    }
+}

+ 33 - 0
database/migrations/2020_10_29_103017_create_owner_price_direct_logistics_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceDirectLogisticsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_direct_logistics', function (Blueprint $table) {
+            $table->id();
+            $table->string("name")->nullable()->comment("价格名称");
+            $table->decimal("base_km")->nullable()->comment("起步公里数");
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_direct_logistics');
+    }
+}

+ 36 - 0
database/migrations/2020_10_29_103104_create_owner_price_direct_logistic_cars_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateOwnerPriceDirectLogisticCarsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('owner_price_direct_logistic_cars', function (Blueprint $table) {
+            $table->id();
+            $table->bigInteger("owner_price_direct_logistic_id")->index('opdl_opdlc_index')->comment("外键直发计费");
+            $table->bigInteger("car_type_id")->index()->comment("车型");
+            $table->decimal("base_fee",8,4)->nullable()->comment("起步费");
+            $table->decimal("additional_fee",8,4)->comment("续费(元/KM)");
+            $table->timestamps();
+        });
+
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('owner_price_direct_logistic_cars');
+    }
+}

+ 32 - 0
database/migrations/2020_10_29_144729_create_user_owner_groups_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateUserOwnerGroupsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('user_owner_groups', function (Blueprint $table) {
+            $table->id();
+            $table->string("name")->unique()->comment("项目组名称");
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('user_owner_groups');
+    }
+}

+ 0 - 22
database/seeds/CarTypesSeeder.php

@@ -1,22 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class CarTypesSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        \App\CarType::create([
-            'name'=>'东风',
-            'model'=>'mnb102',
-            'length'=>5.5,
-            'load'=>18.2,
-            'remark'=>'勤'
-        ]);
-    }
-}

+ 0 - 20
database/seeds/CarriersSeeder.php

@@ -1,20 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class CarriersSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        \App\Carrier::create([
-            'name'=>'货拉拉',
-            'mobile'=>'012-58414542',
-            'remark'=>'大件'
-        ]);
-    }
-}

+ 0 - 21
database/seeds/CitiesSeeder.php

@@ -1,21 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class CitiesSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        \App\City::create([
-            'province_id'=>1,
-            'name'=>'廊坊'
-        ]);
-
-
-    }
-}

+ 0 - 16
database/seeds/CustomFieldSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class CustomFieldSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 3 - 0
database/seeds/DatabaseSeeder.php

@@ -12,5 +12,8 @@ class DatabaseSeeder extends Seeder
     public function run()
     {
         // $this->call(UsersTableSeeder::class);
+        $this->call([
+            OwnerReportSeeder::class,
+        ]);
     }
 }

+ 0 - 16
database/seeds/LogisticTimingSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class LogisticTimingSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderIssueOnTopSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderIssueOnTopSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderIssueSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderIssueSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderIssueTypeSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderIssueTypeSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderItemsSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderItemsSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderOnTopSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderOnTopSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderPackageCommoditiesSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderPackageCommoditiesSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderPackageSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderPackageSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderTrackingOwnerSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderTrackingOwnerSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 16
database/seeds/OrderTrackingSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class OrderTrackingSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 2 - 2
database/seeds/OrderIssueProcessLogSeeder.php → database/seeds/OwnerReportSeeder.php

@@ -2,7 +2,7 @@
 
 use Illuminate\Database\Seeder;
 
-class OrderIssueProcessLogSeeder extends Seeder
+class OwnerReportSeeder extends Seeder
 {
     /**
      * Run the database seeds.
@@ -11,6 +11,6 @@ class OrderIssueProcessLogSeeder extends Seeder
      */
     public function run()
     {
-        //
+        factory(App\OwnerReport::class,2)->create();
     }
 }

+ 0 - 18
database/seeds/ProvincesSeeder.php

@@ -1,18 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class ProvincesSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        \App\Province::create([
-            'name'=>'河北'
-        ]);
-    }
-}

+ 0 - 16
database/seeds/ShopSeeder.php

@@ -1,16 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class ShopSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        //
-    }
-}

+ 0 - 18
database/seeds/UnitsSeeder.php

@@ -1,18 +0,0 @@
-<?php
-
-use Illuminate\Database\Seeder;
-
-class UnitsSeeder extends Seeder
-{
-    /**
-     * Run the database seeds.
-     *
-     * @return void
-     */
-    public function run()
-    {
-        \App\Unit::create([
-            'name'=>'kg'
-        ]);
-    }
-}

Some files were not shown because too many files changed in this diff