|
@@ -37,23 +37,6 @@ class PackageCollectingAllocation implements ShouldQueue
|
|
|
{
|
|
{
|
|
|
/** @var OrderPackageService $orderPackageService */
|
|
/** @var OrderPackageService $orderPackageService */
|
|
|
$orderPackageService = app('OrderPackageService');
|
|
$orderPackageService = app('OrderPackageService');
|
|
|
- DB::beginTransaction();
|
|
|
|
|
- try {
|
|
|
|
|
- $result = OrderPackage::query()->where("id",$this->orderPackage->id)
|
|
|
|
|
- ->where("collecting_status",0)->update(["collecting_status"=>1]);
|
|
|
|
|
- if ($result==1){
|
|
|
|
|
- $result = $orderPackageService->collectUpload([$this->orderPackage->logistic_number]);
|
|
|
|
|
- if (!$result["success"]){
|
|
|
|
|
- DB::rollBack();
|
|
|
|
|
- Log::warning("自动揽收失败",["message"=>$result["message"],"param"=>$this->orderPackage->logistic_number]);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- }else Log::warning("自动揽收异常",["message"=>"未能成功修改揽收标记","param"=>["id"=>$this->orderPackage->id,
|
|
|
|
|
- "number"=>$this->orderPackage->logistic_number],"line"=>$result]);
|
|
|
|
|
- DB::commit();
|
|
|
|
|
- }catch (\Exception $e){
|
|
|
|
|
- DB::rollBack();
|
|
|
|
|
- Log::warning("自动揽收错误",["param"=>$this->orderPackage->toJson()]);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $orderPackageService->collectUpload([$this->orderPackage->logistic_number]);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|