m3 Security Fixes
This commit is contained in:
@@ -96,7 +96,7 @@ class M3InventoryReport extends Controller
|
||||
$data = ['SHMACPKR'=>$DELIVERYNO,'SHDT'=> date('Y-m-d'),'SHTIME'=> date('H:i:s') ,'SHERROR'=> 'X','SHINTBOX'=> '','SHTYPE'=> 'M3-Res-out' ,
|
||||
'SHDATA'=>$responseStatusCode.$M3Errors.$M3SessionId ,'SHUSER'=> $SHUSER,'SHSOURCE'=> $SHSOURCE,'SHCO'=>'','SHWHS'=>$WHS ];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
# Send Response
|
||||
return response()->json([
|
||||
'code'=>'405',
|
||||
@@ -126,7 +126,7 @@ class M3InventoryReport extends Controller
|
||||
$data = ['SHMACPKR'=>$DELIVERYNO,'SHDT'=> date('Y-m-d'),'SHTIME'=> date('H:i:s') ,'SHERROR'=> 'X','SHINTBOX'=> '','SHTYPE'=> 'M3-Res-out' ,
|
||||
'SHDATA'=>'Curl Error: Communication with M3 Timed Out'.' M3-JSN-out'.$JSON ,'SHUSER'=> $SHUSER,'SHSOURCE'=> $SHSOURCE,'SHCO'=>'','SHWHS'=>$WHS];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
return response()->json([
|
||||
'code'=>'405',
|
||||
'status'=>'error',
|
||||
@@ -172,7 +172,7 @@ class M3InventoryReport extends Controller
|
||||
$WHS = isset($urlParams["WHS"]) ? $urlParams["WHS"] : '';
|
||||
$MACPKR = isset($urlParams["MACPKR"]) ? $urlParams["MACPKR"] : '000000'; # Delivery Number
|
||||
$PKLN = isset($urlParams["PKLN"]) ? $urlParams["PKLN"] : '';
|
||||
|
||||
|
||||
if($urlParams!=''){
|
||||
$IncomingParams = ['CO'=> $CO,'WHS'=> $WHS,'MACPKR'=> $MACPKR,'PKLN'=> $PKLN,'REQPKWS'=> $REQPKWS,'REQKPKUS'=> $REQKPKUS];
|
||||
$IncomingParams = json_encode($IncomingParams);
|
||||
@@ -211,11 +211,11 @@ class M3InventoryReport extends Controller
|
||||
$PARTS[] = ["PART"=> $PART , "LOT"=>$LOT];
|
||||
$PICKERARR[$PART] = $ICM688M2->A5SENTPKR;
|
||||
}
|
||||
// Log::info($PARTS);
|
||||
// Log::info($PARTS);
|
||||
// dump($PARTS);
|
||||
$JSON = json_encode( ["WHS" => $WHS,"PARTS"=> $PARTS ] );
|
||||
// Log::info($JSON);
|
||||
|
||||
// Log::info($JSON);
|
||||
|
||||
# Get Token
|
||||
$tokenResponse = Helper::checkReceiveTokenV2();
|
||||
$tokenData = $tokenResponse->getData();
|
||||
@@ -234,7 +234,7 @@ class M3InventoryReport extends Controller
|
||||
# Call ionapi with Params
|
||||
$endPointURL = env('ENDPOINTURL').'APIFLOWS/Sentinel/M3InventoryReportList?ionapiRespStyle=sync';
|
||||
$token = $IonToken;
|
||||
|
||||
|
||||
$response = Http::withHeaders([
|
||||
'accept' => 'application/json',
|
||||
'Content-Type' => 'application/json'
|
||||
@@ -260,13 +260,13 @@ class M3InventoryReport extends Controller
|
||||
$M3Errors = 'Error: No Response from M3';
|
||||
}
|
||||
|
||||
# Validate response From M3
|
||||
# Validate response From M3
|
||||
if ($M3Errors!='') {
|
||||
# Write to Logs : Error
|
||||
$data = ['SHMACPKR'=>$MACPKR,'SHDT'=> date('Y-m-d'),'SHTIME'=> date('H:i:s') ,'SHERROR'=> 'X','SHINTBOX'=> '','SHTYPE'=> 'M3-Res-out' ,
|
||||
'SHDATA'=>$responseStatusCode.'-'.$M3Errors.$M3SessionId ,'SHUSER'=> $SHUSER,'SHSOURCE'=> $SHSOURCE,'SHCO'=>$CO,'SHWHS'=>$WHS ];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
# Send Response
|
||||
return response()->json([
|
||||
'code'=>'405',
|
||||
@@ -285,7 +285,7 @@ class M3InventoryReport extends Controller
|
||||
foreach ($responseTMP as $key => $value) {
|
||||
// dump($value);
|
||||
$dataToWrite = [];
|
||||
|
||||
|
||||
foreach ($value as $key2 => $content) {
|
||||
if($key2!='Locations'){
|
||||
$dataToWrite[$key2] = $content;
|
||||
@@ -317,12 +317,12 @@ class M3InventoryReport extends Controller
|
||||
->where('VLOCID',$value['Location'])
|
||||
->first();
|
||||
// dd($DE640MSQLSEL);
|
||||
|
||||
|
||||
$LocationExist = isset($DE640MSQLSEL->VLOCID) ? trim($DE640MSQLSEL->VLOCID) : '';
|
||||
$WHExist = isset($DE640MSQLSEL->WSELOC) ? trim($DE640MSQLSEL->WSELOC) : '';
|
||||
$COExist = isset($DE640MSQLSEL->LVCO) ? trim($DE640MSQLSEL->LVCO) : '';
|
||||
// dd($LocationExist .': '.$WHExist.': '.$COExist);
|
||||
|
||||
|
||||
# if No records Founds insert New Record
|
||||
if ( $LocationExist=='' && $WHExist=='' && $COExist=='' ) {
|
||||
$SQLInsertPrep640M['LVCO'] = $CO; # Company
|
||||
@@ -364,7 +364,7 @@ class M3InventoryReport extends Controller
|
||||
$SQLInsertPrep630M['LLIZLCF'] = trim($value['LotNumber'])!='' ? '1' : ''; # Lot control flag
|
||||
$SQLInsertPrep630M['LLCMDESC'] = $value['Description']; # Description
|
||||
$SQLInsertPrep630M['LLSPR10A01'] = isset($value['Allocation']) ? $value['Allocation'] : ''; # Allocation
|
||||
$SQLInsertPrep630M['LLSPR15A01'] = isset($value['AllocatedTo']) ? $value['AllocatedTo'] : ''; # AllocatedTo
|
||||
$SQLInsertPrep630M['LLSPR15A01'] = isset($value['AllocatedTo']) ? $value['AllocatedTo'] : ''; # AllocatedTo
|
||||
|
||||
DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')->insert($SQLInsertPrep630M);
|
||||
}
|
||||
@@ -431,7 +431,7 @@ class M3InventoryReport extends Controller
|
||||
$SHERROR = 'X';
|
||||
$word = 'Duplicate key value specified';
|
||||
$position = strpos($th, $word);
|
||||
|
||||
|
||||
if ($position !== false) {
|
||||
$SHERROR = 'Z';
|
||||
}
|
||||
@@ -439,7 +439,7 @@ class M3InventoryReport extends Controller
|
||||
$data = ['SHMACPKR'=>$MACPKR,'SHDT'=> date('Y-m-d'),'SHTIME'=> date('H:i:s') ,'SHERROR'=> $SHERROR,'SHINTBOX'=> '','SHTYPE'=> 'M3-Res-out' ,
|
||||
'SHDATA'=>'An Error Occured-'.substr($th,0,300) ,'SHUSER'=> $REQKPKUS,'SHSOURCE'=> $SHSOURCE,'SHCO'=>$CO,'SHWHS'=>$WHS];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
Log::error($th);
|
||||
return response()->json([
|
||||
'code'=>'405',
|
||||
|
||||
Reference in New Issue
Block a user