mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-21 21:44:09 +00:00
Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development
This commit is contained in:
+2
-6
@@ -126,7 +126,7 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$start = $start ? $start : Carbon::now()->subDays(30);
|
||||
$start = $start ? $start : Carbon::now()->subDays(10);
|
||||
|
||||
$startLimit = Carbon::parse('11-08-2021');
|
||||
|
||||
@@ -141,10 +141,7 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
|
||||
$containers = $this->fetchesDataFRomVTPortal->getResponseBody($containersRequest);
|
||||
|
||||
foreach ($containers->Rows as $index => $container){
|
||||
if($index !== 2){
|
||||
continue;
|
||||
}
|
||||
foreach ($containers->Rows as $container){
|
||||
$filter = '["ContainerID:=%js%'.$container[11].'"]';
|
||||
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
|
||||
|
||||
@@ -160,7 +157,6 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
|
||||
}
|
||||
|
||||
dd($containerDetail->Rows);
|
||||
foreach($containerDetail->Rows as $packingList){
|
||||
$marking = explode('/', explode('CIEF/', $packingList[13])[1]);
|
||||
|
||||
|
||||
+4
-3
@@ -310,7 +310,8 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
if($containerReference) {
|
||||
try {
|
||||
$container = $this->fetchesContainer->execute(['reference' => $containerReference]);
|
||||
$container->packingLists()->syncWithoutDetaching([$packingList->id]);
|
||||
$container->packingLists()->detach($packingList);
|
||||
$container->packingLists()->attach($packingList);
|
||||
} catch (ResourceNotFoundException $exception){
|
||||
|
||||
if (!$allow_contract) {
|
||||
@@ -326,8 +327,8 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
/** @var Container $container */
|
||||
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
|
||||
|
||||
$container->packingLists()->detach($packingList);
|
||||
$container->packingLists()->attach($packingList);
|
||||
$container->packingLists()->detach($packingList);
|
||||
$container->packingLists()->attach($packingList);
|
||||
|
||||
$transport = $container->transports()->first();
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ class FetchPackingListFromVTPortalProcessor
|
||||
})->get();
|
||||
|
||||
foreach($packingLists as $packingList){
|
||||
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
@@ -60,9 +59,7 @@ class FetchPackingListFromVTPortalProcessor
|
||||
$shippingPackingListsRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
|
||||
|
||||
$shippingPackingLists = $this->fetchesDataFRomVTPortal->getResponseBody($shippingPackingListsRequest);
|
||||
|
||||
if(count($shippingPackingLists->Rows)) {
|
||||
|
||||
$packingList->packages()->delete();
|
||||
|
||||
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
|
||||
|
||||
try {
|
||||
|
||||
$start = $start ? $start : Carbon::now()->subMonths(2);
|
||||
$start = $start ? $start : Carbon::now()->subMonth();
|
||||
|
||||
$startLimit = Carbon::parse('11-08-2021');
|
||||
|
||||
|
||||
@@ -30,7 +30,9 @@ class ContainerResource extends JsonResource
|
||||
'remarks' => RemarkResource::collection($this->remarks),
|
||||
'status' => $this->status,
|
||||
'packing_lists' => $this->whenLoaded('packingLists', PackingListResource::collection($this->whenLoaded('packingLists', function(){
|
||||
return $this->packingLists()->whereHas('packages')->get();
|
||||
return $this->packingLists()->whereHas('packages')->get()->sortBy(function ($packingList) {
|
||||
return $packingList->owner->company_module_id;
|
||||
});
|
||||
})))
|
||||
];
|
||||
}
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ Route::get('/orders/refresh', function(){
|
||||
|
||||
Route::get('/containers/refresh', function(){
|
||||
|
||||
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchLoadedContainersFromVTPortalProcessor::class))->execute();
|
||||
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchPackingListFromVTPortalProcessor::class))->execute();
|
||||
// FetchLoadedContainersFromVTPortalJob::dispatch();
|
||||
// FetchContainersStatusUpdateFromVTPortalJob::dispatch();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user