|
|
@@ -9,12 +9,15 @@ use App\Components\ErrorPush;
|
|
|
use App\ErrorTemp;
|
|
|
use App\Feature;
|
|
|
use App\Jobs\CacheShelfTaskJob;
|
|
|
+use App\Jobs\OrderCreateInstantBill;
|
|
|
use App\Jobs\OrderCreateWaybill;
|
|
|
+use App\Jobs\StoreCreateInstantBill;
|
|
|
use App\MaterialBox;
|
|
|
use App\MaterialBoxModel;
|
|
|
use App\Order;
|
|
|
use App\Owner;
|
|
|
use App\OwnerFeeDetail;
|
|
|
+use App\OwnerFeeDetailLogistic;
|
|
|
use App\OwnerFeeExpress;
|
|
|
use App\OwnerFeeLogistic;
|
|
|
use App\OwnerFeeOperation;
|
|
|
@@ -30,6 +33,7 @@ use App\Services\StorageService;
|
|
|
use App\Station;
|
|
|
use App\StationTask;
|
|
|
use App\StationTaskMaterialBox;
|
|
|
+use App\Store;
|
|
|
use App\TaskTransaction;
|
|
|
use App\Unit;
|
|
|
use App\Waybill;
|
|
|
@@ -58,34 +62,58 @@ class TestController extends Controller
|
|
|
{
|
|
|
return call_user_func([$this, $method], $request);
|
|
|
}
|
|
|
- public function lightUp()
|
|
|
- {
|
|
|
- app("CacheShelfService")->lightUp('HAIB1-02-02','3','0');
|
|
|
- }
|
|
|
- public function lightOff()
|
|
|
- {
|
|
|
- $params = [
|
|
|
- "areaCode" => "1004",
|
|
|
- 'locCode' => "HAIB1-02-02",
|
|
|
- 'PTLAction' => 0,
|
|
|
- ];
|
|
|
- $response = Http::post(config('api.haiq.storage.light'), $params);
|
|
|
- return json_decode($response->body());
|
|
|
+ public function test1(){
|
|
|
+ ini_set('max_execution_time',-1);
|
|
|
+ $date = date("Y-m-d H:i:s");
|
|
|
+ ErrorTemp::query()->truncate();
|
|
|
+ OwnerFeeStorage::query()->truncate();
|
|
|
+ OwnerFeeExpress::query()->truncate();
|
|
|
+ OwnerFeeLogistic::query()->truncate();
|
|
|
+ OwnerFeeOperation::query()->truncate();
|
|
|
+ OwnerFeeOperationDetail::query()->truncate();
|
|
|
+ foreach (Order::query()->where("wms_edittime",">=","2021-08-16 00:00:00")
|
|
|
+ ->where("wms_status","订单完成")
|
|
|
+ ->where("wms_edittime","<",$date)->get() as $order){
|
|
|
+ $fee = OwnerFeeDetail::query()->where("outer_table_name","orders")->where("outer_id",$order->id)->first();
|
|
|
+ if ($fee){
|
|
|
+ OwnerFeeDetailLogistic::query()->where("owner_fee_detail_id",$fee->id)->delete();
|
|
|
+ $fee->delete();
|
|
|
+ }
|
|
|
+ $a = new Collection([$order]);
|
|
|
+ $this->dispatch(new OrderCreateInstantBill($a));
|
|
|
+ }
|
|
|
+ foreach (Store::query()->where("updated_at",">=","2021-08-16 00:00:00")
|
|
|
+ ->where("status","已入库")
|
|
|
+ ->where("updated_at","<",$date)->get() as $store){
|
|
|
+ OwnerFeeDetail::query()->where("outer_table_name","stores")->where("outer_id",$store->id)->delete();
|
|
|
+ $a = new Collection([$store]);
|
|
|
+ $this->dispatch(new StoreCreateInstantBill($a));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function test()
|
|
|
{
|
|
|
+ ini_set('max_execution_time',-1);
|
|
|
$day = (string)\request("day");
|
|
|
$d = (int)$day+1;
|
|
|
$d = $d<10 ? '0'.(string)$d : (string)$d;
|
|
|
- dd($day,$d);
|
|
|
- OwnerFeeStorage::query()->truncate();
|
|
|
- OwnerFeeExpress::query()->truncate();
|
|
|
- OwnerFeeLogistic::query()->truncate();
|
|
|
- OwnerFeeOperation::query()->truncate();
|
|
|
- OwnerFeeOperationDetail::query()->truncate();
|
|
|
foreach (Order::query()->where("wms_edittime",">=","2021-08-{$day} 00:00:00")
|
|
|
->where("wms_status","订单完成")
|
|
|
- ->where("wms_edittime","<=",date("Y-m-d H:i:s"))->get() as $order);
|
|
|
+ ->where("wms_edittime","<","2021-08-{$d} 00:00:00")->get() as $order){
|
|
|
+ $fee = OwnerFeeDetail::query()->where("outer_table_name","orders")->where("outer_id",$order->id)->first();
|
|
|
+ if ($fee){
|
|
|
+ OwnerFeeDetailLogistic::query()->where("owner_fee_detail_id",$fee->id)->delete();
|
|
|
+ $fee->delete();
|
|
|
+ }
|
|
|
+ $a = new Collection([$order]);
|
|
|
+ $this->dispatch(new OrderCreateInstantBill($a));
|
|
|
+ }
|
|
|
+ foreach (Store::query()->where("updated_at",">=","2021-08-{$day} 00:00:00")
|
|
|
+ ->where("status","已入库")
|
|
|
+ ->where("updated_at","<","2021-08-{$d} 00:00:00")->get() as $store){
|
|
|
+ OwnerFeeDetail::query()->where("outer_table_name","stores")->where("outer_id",$store->id)->delete();
|
|
|
+ $a = new Collection([$store]);
|
|
|
+ $this->dispatch(new StoreCreateInstantBill($a));
|
|
|
+ }
|
|
|
}
|
|
|
}
|