|
|
@@ -13,6 +13,7 @@ use App\OwnerPriceExpressProvince;
|
|
|
use App\OwnerPriceLogistic;
|
|
|
use App\OwnerPriceOperation;
|
|
|
use App\Services\common\ExportService;
|
|
|
+use App\Services\LogService;
|
|
|
use App\Services\OwnerOutStorageRuleService;
|
|
|
use App\Services\OwnerPriceOperationService;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
@@ -43,6 +44,7 @@ class PriceModelController extends Controller
|
|
|
if(!Gate::allows('计费模型-仓储-录入')){ return redirect('denied'); }
|
|
|
$this->storageValidator($request->input())->validate();
|
|
|
app('OwnerStoragePriceModelService')->create($request->input());
|
|
|
+ LogService::log(__METHOD__,"计费模型-创建仓储计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo('maintenance/priceModel/storage')->with('successTip',"创建成功!");
|
|
|
}
|
|
|
|
|
|
@@ -66,12 +68,14 @@ class PriceModelController extends Controller
|
|
|
"discount_value"=> $request->input("discount_value"),
|
|
|
"unit_id" => $request->input("unit_id"),
|
|
|
]);
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改仓储计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo('maintenance/priceModel/storage')->with('successTip',"更新成功!");
|
|
|
}
|
|
|
|
|
|
public function storageDestroy($id)
|
|
|
{
|
|
|
app("OwnerStoragePriceModelService")->destroy($id);
|
|
|
+ LogService::log(__METHOD__,"计费模型-删除仓储计费",$id);
|
|
|
return ["success"=>true];
|
|
|
}
|
|
|
|
|
|
@@ -129,7 +133,10 @@ class PriceModelController extends Controller
|
|
|
"unit_id"=>$request->input("unit_id"),
|
|
|
"priority"=>$request->input("priority"),
|
|
|
"unit_price"=>$request->input("unit_price")]);
|
|
|
- if ($row == 1) return ["success"=>true];
|
|
|
+ if ($row == 1){
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改出库规则",json_encode($request->input()));
|
|
|
+ return ["success"=>true];
|
|
|
+ }
|
|
|
return ["success"=>false,"data"=>"受影响数据数为:".$row];
|
|
|
}
|
|
|
|
|
|
@@ -149,6 +156,7 @@ class PriceModelController extends Controller
|
|
|
break;
|
|
|
}
|
|
|
$data = $service->create($request->input());
|
|
|
+ LogService::log(__METHOD__,"计费模型-录入出库规则",json_encode($request->input()));
|
|
|
$data->load("unit");
|
|
|
return ["success"=>true,"data"=>$data];
|
|
|
}
|
|
|
@@ -177,6 +185,7 @@ class PriceModelController extends Controller
|
|
|
if (count($stack) > 0)return ["success"=>false,"data"=>"组标记错误,起始与结束标记必须对应"];
|
|
|
$row = app('OwnerOutStorageRuleService')->update(["id"=>$id],["feature"=>$feature]);
|
|
|
if ($row != 1)return ["success"=>false,"data"=>"影响了“".$row."”行"];
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改出库特征",json_encode($request->input()));
|
|
|
OwnerOutStorageRule::$features = $result["map"];
|
|
|
$rule = app('OwnerOutStorageRuleService')->find($id)->append("featureFormat");
|
|
|
return ["success"=>true,"data"=>["featureFormat"=>$rule->featureFormat,"feature"=>$feature]];
|
|
|
@@ -205,7 +214,10 @@ class PriceModelController extends Controller
|
|
|
{
|
|
|
if(!Gate::allows('计费模型-作业-删除')){ return ["success"=>false,"data"=>"无权操作"]; }
|
|
|
$row = app("OwnerPriceOperationService")->destroy($id);
|
|
|
- if ($row == 1)return ["success"=>true];
|
|
|
+ if ($row == 1){
|
|
|
+ LogService::log(__METHOD__,"计费模型-删除作业计费",$id);
|
|
|
+ return ["success"=>true];
|
|
|
+ }
|
|
|
return ["success"=>false,"data"=>"影响了“".$row."”行"];
|
|
|
}
|
|
|
|
|
|
@@ -259,6 +271,7 @@ class PriceModelController extends Controller
|
|
|
//录入中间表
|
|
|
/** @var OwnerPriceOperation $model */
|
|
|
if ($request->input("owner_id"))$model->ownerPriceOperationOwners()->sync($request->input("owner_id"));
|
|
|
+ LogService::log(__METHOD__,"计费模型-录入作业计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/operation")->with("successTip","创建“".$request->input("name")."”成功");
|
|
|
}
|
|
|
|
|
|
@@ -314,6 +327,7 @@ class PriceModelController extends Controller
|
|
|
//录入中间表
|
|
|
/** @var OwnerPriceOperation $model */
|
|
|
if ($request->input("owner_id"))$model->ownerPriceOperationOwners()->sync($request->input("owner_id"));
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改作业计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/operation")->with("successTip","修改“".$request->input("name")."”成功");
|
|
|
}
|
|
|
|
|
|
@@ -394,6 +408,7 @@ class PriceModelController extends Controller
|
|
|
]);
|
|
|
$detail->load("province");
|
|
|
}
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改快递计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return ["success"=>true,"data"=>$detail];
|
|
|
}
|
|
|
|
|
|
@@ -403,6 +418,7 @@ class PriceModelController extends Controller
|
|
|
$id = $request->input("id");
|
|
|
if (!$id)return ["success"=>false,"data"=>"非法参数"];
|
|
|
app("OwnerPriceExpressService")->destroyDetail($id);
|
|
|
+ LogService::log(__METHOD__,"计费模型-删除快递计费",$id);
|
|
|
return ["success"=>true];
|
|
|
}
|
|
|
|
|
|
@@ -443,6 +459,7 @@ class PriceModelController extends Controller
|
|
|
]);
|
|
|
$model->owners()->sync($request->input("owner_id"));
|
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
|
+ LogService::log(__METHOD__,"计费模型-录入快递计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/express")->with("successTip","录入“".$request->input("name")."”成功");
|
|
|
}
|
|
|
|
|
|
@@ -472,6 +489,7 @@ class PriceModelController extends Controller
|
|
|
$model->id = $id;
|
|
|
$model->owners()->sync($request->input("owner_id"));
|
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改快递计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/express")->with("successTip","修改“".$request->input("name")."”成功");
|
|
|
}
|
|
|
|
|
|
@@ -503,6 +521,7 @@ class PriceModelController extends Controller
|
|
|
{
|
|
|
if(!Gate::allows('计费模型-快递-删除')){ return ["success"=>false,"data"=>"无权操作"]; };
|
|
|
app("OwnerPriceExpressService")->destroy($id);
|
|
|
+ LogService::log(__METHOD__,"计费模型-删除快递计费",$id);
|
|
|
return ["success"=>true];
|
|
|
}
|
|
|
|
|
|
@@ -541,6 +560,7 @@ class PriceModelController extends Controller
|
|
|
]);
|
|
|
$model->owners()->sync($request->input("owner_id"));
|
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
|
+ LogService::log(__METHOD__,"计费模型-录入物流计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/logistic")->with("successTip","创建“".$request->input("name")."”成功");
|
|
|
}
|
|
|
|
|
|
@@ -574,6 +594,7 @@ class PriceModelController extends Controller
|
|
|
$model->id = $id;
|
|
|
$model->owners()->sync($request->input("owner_id"));
|
|
|
$model->logistics()->sync($request->input("logistic_id"));
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改物流计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/logistic")->with("successTip","修改“".$request->input("name")."”成功");
|
|
|
}
|
|
|
|
|
|
@@ -719,6 +740,7 @@ class PriceModelController extends Controller
|
|
|
]);
|
|
|
$detail->load("province","unit","city");
|
|
|
}
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改物流计费详情",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return ["success"=>true,"data"=>$detail];
|
|
|
}
|
|
|
|
|
|
@@ -728,6 +750,7 @@ class PriceModelController extends Controller
|
|
|
$id = $request->input("id");
|
|
|
if (!$id)return ["success"=>false,"data"=>"非法参数"];
|
|
|
app("OwnerPriceLogisticService")->destroyDetail($id);
|
|
|
+ LogService::log(__METHOD__,"计费模型-删除物流计费详情",$id);
|
|
|
return ["success"=>true];
|
|
|
}
|
|
|
|
|
|
@@ -788,6 +811,7 @@ class PriceModelController extends Controller
|
|
|
"base_km" => $request->input("base_km"),
|
|
|
]);
|
|
|
$model->owners()->sync($request->input("owner_id"));
|
|
|
+ LogService::log(__METHOD__,"计费模型-录入直发车计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/directLogistic")->with("successTip","创建“".$request->input("name")."”成功");
|
|
|
}
|
|
|
|
|
|
@@ -795,7 +819,10 @@ class PriceModelController extends Controller
|
|
|
{
|
|
|
if(!Gate::allows('计费模型-直发-删除')){ return ["success"=>false,"data"=>"无权操作"]; }
|
|
|
$row = app("OwnerPriceDirectLogisticService")->destroy($id);
|
|
|
- if ($row == 1)return ["success"=>true];
|
|
|
+ if ($row == 1){
|
|
|
+ LogService::log(__METHOD__,"计费模型-删除直发车计费",$id);
|
|
|
+ return ["success"=>true];
|
|
|
+ }
|
|
|
return ["success"=>false,"data"=>"影响了“".$row."”行"];
|
|
|
}
|
|
|
|
|
|
@@ -819,6 +846,7 @@ class PriceModelController extends Controller
|
|
|
$model = new OwnerPriceDirectLogistic();
|
|
|
$model->id = $id;
|
|
|
$model->owners()->sync($request->input("owner_id"));
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改直发车计费",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return response()->redirectTo("maintenance/priceModel/directLogistic")->with("successTip","修改“".$request->input("name")."”成功");
|
|
|
}
|
|
|
|
|
|
@@ -876,6 +904,7 @@ class PriceModelController extends Controller
|
|
|
]);
|
|
|
$detail->load("carType");
|
|
|
}
|
|
|
+ LogService::log(__METHOD__,"计费模型-修改直发车计费详情",json_encode($request->input(),JSON_UNESCAPED_UNICODE));
|
|
|
return ["success"=>true,"data"=>$detail];
|
|
|
}
|
|
|
|
|
|
@@ -885,6 +914,7 @@ class PriceModelController extends Controller
|
|
|
$id = $request->input("id");
|
|
|
if (!$id)return ["success"=>false,"data"=>"非法参数"];
|
|
|
app("OwnerPriceDirectLogisticService")->destroyDetail($id);
|
|
|
+ LogService::log(__METHOD__,"计费模型-删除直发车计费详情",$id);
|
|
|
return ["success"=>true];
|
|
|
}
|
|
|
|