|
|
@@ -88,6 +88,7 @@ use App\Services\StoreService;
|
|
|
use App\Services\SupplierService;
|
|
|
use App\Station;
|
|
|
use App\StationTask;
|
|
|
+use App\StationTaskCommodity;
|
|
|
use App\StationTaskMaterialBox;
|
|
|
use App\Store;
|
|
|
use App\StationTaskBatch;
|
|
|
@@ -147,9 +148,9 @@ class TestController extends Controller
|
|
|
|
|
|
$this->test1(...$aa);
|
|
|
}
|
|
|
- public function test($a,$b,$c)
|
|
|
+ public function test()
|
|
|
{
|
|
|
- app('StorageService')->clearTask(['HAIB2-02-01']);
|
|
|
+ app('StorageService')->clearTask(['HAIB2-02-02','HAIB2-01-01']);
|
|
|
dd();
|
|
|
ini_set('max_execution_time', 0);
|
|
|
$orders = Order::query()->whereBetween("wms_edittime",["2021-06-01 00:00:00","2021-06-30 23:59:59"])
|
|
|
@@ -165,6 +166,23 @@ class TestController extends Controller
|
|
|
$ser->createInstantBill($order);
|
|
|
dd("order create bill success");
|
|
|
}
|
|
|
+ function mp(){
|
|
|
+ $stationTaskCommodities=StationTaskCommodity::query()->where('id',19942)->get();
|
|
|
+ StationTaskCommodity::query()
|
|
|
+ ->whereIn('id',data_get($stationTaskCommodities,'*.id')??[])
|
|
|
+ ->update(['status'=>'完成']);
|
|
|
+ $stationTaskMaterialBoxes=StationTaskMaterialBox::query()
|
|
|
+ ->whereIn('id', data_get($stationTaskCommodities, '*.station_task_material_box_id') ?? [])
|
|
|
+ ->get('material_box_id');
|
|
|
+ $storages= \App\Storage::query()->whereIn('commodity_id',data_get($stationTaskCommodities,'*.commodity_id')??[])
|
|
|
+ ->whereIn('material_box_id',data_get($stationTaskMaterialBoxes,'*.material_box_id')??[])
|
|
|
+ ->get();
|
|
|
+ foreach($storages as $storage){
|
|
|
+ $amountReducing=$stationTaskCommodities->where('material_box_id',$storage['material_box_id'])->first()['amount']??0;
|
|
|
+ $storage['amount']-=$amountReducing;
|
|
|
+ $storage->update();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public function supplementMarchOwnerReport()
|
|
|
{
|