|
@@ -46,27 +46,30 @@ class RejectedPushJob implements ShouldQueue
|
|
|
public function handle()
|
|
public function handle()
|
|
|
{
|
|
{
|
|
|
$result = array();
|
|
$result = array();
|
|
|
- $array=array();
|
|
|
|
|
- if (count($this->asnHerders)>0){
|
|
|
|
|
- foreach ($this->asnHerders as $asnHerder){
|
|
|
|
|
- if ($asnHerder->asntype=='THRK'&&$asnHerder->notes){
|
|
|
|
|
|
|
+ $array = array();
|
|
|
|
|
+ if (count($this->asnHerders) > 0) {
|
|
|
|
|
+ foreach ($this->asnHerders as $asnHerder) {
|
|
|
|
|
+ if ($asnHerder->asntype == 'THRK' && $asnHerder->notes) {
|
|
|
preg_match('/^[A-Z]{2}[0-9]{8}\d{0,8}/', $asnHerder->notes, $result);
|
|
preg_match('/^[A-Z]{2}[0-9]{8}\d{0,8}/', $asnHerder->notes, $result);
|
|
|
- if (count($result)<1) continue;
|
|
|
|
|
- $details=OracleDOCASNDetail::query()->select('sku','linestatus')->where('asnno',$asnHerder->asnno)->get();
|
|
|
|
|
- if (count($details)<1)continue;
|
|
|
|
|
- foreach ($details as $detail){
|
|
|
|
|
|
|
+ if (count($result) < 1) continue;
|
|
|
|
|
+ $details = OracleDOCASNDetail::query()->select('sku', 'linestatus')->where('asnno', $asnHerder->asnno)->get();
|
|
|
|
|
+ if (count($details) < 1) continue;
|
|
|
|
|
+ foreach ($details as $detail) {
|
|
|
$array[][] = [
|
|
$array[][] = [
|
|
|
- 'sku'=>$detail->sku,
|
|
|
|
|
- 'taskNum'=>$result[0],
|
|
|
|
|
- 'asnNo'=>$asnHerder->asnno,
|
|
|
|
|
- 'type'=>$detail->linestatus=='99'?'上架':'推单'
|
|
|
|
|
|
|
+ 'sku' => $detail->sku,
|
|
|
|
|
+ 'taskNum' => $result[0],
|
|
|
|
|
+ 'asnNo' => $asnHerder->asnno,
|
|
|
|
|
+ 'type' => $detail->linestatus == '99' ? '上架' : '推单'
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
$url = config('api.java.wms.rejectedPushTask.receivePush');
|
|
$url = config('api.java.wms.rejectedPushTask.receivePush');
|
|
|
- $response = Http::post($url, $array);
|
|
|
|
|
- Log::info("推送信息!", ['res' => $response->body(), 'req' => $array]);
|
|
|
|
|
|
|
+ if (count($array) > 0) {
|
|
|
|
|
+ $response = Http::post($url, $array);
|
|
|
|
|
+ Log::info("推送信息!", ['res' => $response->body(), 'req' => $array]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|