|
@@ -22,8 +22,10 @@ use Illuminate\Routing\Redirector;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
|
|
+use Illuminate\Support\Str;
|
|
|
use Illuminate\View\View;
|
|
use Illuminate\View\View;
|
|
|
use App\Http\Controllers\Api\thirdPart\flux\StoreController as FStoreController;
|
|
use App\Http\Controllers\Api\thirdPart\flux\StoreController as FStoreController;
|
|
|
|
|
+use Ramsey\Uuid\Uuid;
|
|
|
|
|
|
|
|
class StoreController extends Controller
|
|
class StoreController extends Controller
|
|
|
{
|
|
{
|
|
@@ -174,15 +176,20 @@ class StoreController extends Controller
|
|
|
return ['success'=>false, 'data'=>"失败!请检查错误日志"];
|
|
return ['success'=>false, 'data'=>"失败!请检查错误日志"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function quickStorage($asnno,$quality,$depository_code)
|
|
|
|
|
|
|
+ public function quickStorage($asnno,$quality,$depository_code,$isVerification = true)
|
|
|
{
|
|
{
|
|
|
|
|
+ $task = Store::query()->where("asn_code",$asnno)->where("stored_method","快速入库")
|
|
|
|
|
+ ->where("status","已入库")->first();
|
|
|
|
|
+ if ($task)return ['success'=>false, 'data'=>"已被快速入库"];
|
|
|
$db = DB::connection('oracle');
|
|
$db = DB::connection('oracle');
|
|
|
$query = DB::raw("SELECT * FROM DOC_ASN_HEADER WHERE ASNNO = ?");
|
|
$query = DB::raw("SELECT * FROM DOC_ASN_HEADER WHERE ASNNO = ?");
|
|
|
$asn = $db->selectOne($query,[$asnno]);
|
|
$asn = $db->selectOne($query,[$asnno]);
|
|
|
if (!$asn) return ['success'=>false, 'data'=>"单据号不存在"];
|
|
if (!$asn) return ['success'=>false, 'data'=>"单据号不存在"];
|
|
|
if ($asn->asnstatus != '00')return ['success'=>false, 'data'=>'单据号状态非创建订单'];
|
|
if ($asn->asnstatus != '00')return ['success'=>false, 'data'=>'单据号状态非创建订单'];
|
|
|
- if (array_search($asn->customerid,array_values(config('stores.owners'))) === false)return ['success'=>false, 'data'=>"不允许该货主快速入库"];
|
|
|
|
|
- if (array_search($asn->asntype,array_values(config('stores.types'))) === false)return ['success'=>false, 'data'=>"该单据类型不允许被入库"];
|
|
|
|
|
|
|
+ if ($isVerification){
|
|
|
|
|
+ if (array_search($asn->customerid,array_values(config('stores.owners'))) === false)return ['success'=>false, 'data'=>"不允许该货主快速入库"];
|
|
|
|
|
+ if (array_search($asn->asntype,array_values(config('stores.types'))) === false)return ['success'=>false, 'data'=>"该单据类型不允许被入库"];
|
|
|
|
|
+ }
|
|
|
$query = DB::raw("SELECT b.ALTERNATE_SKU1,h.WAREHOUSEID,h.asnno,d.ASNLINENO,d.SKUDESCRC,h.CUSTOMERID,d.SKU,d.PACKID,d.RECEIVEDQTY_EACH,d.EXPECTEDQTY_EACH,d.LOTATT01,d.LOTATT02,d.lotatt04,".
|
|
$query = DB::raw("SELECT b.ALTERNATE_SKU1,h.WAREHOUSEID,h.asnno,d.ASNLINENO,d.SKUDESCRC,h.CUSTOMERID,d.SKU,d.PACKID,d.RECEIVEDQTY_EACH,d.EXPECTEDQTY_EACH,d.LOTATT01,d.LOTATT02,d.lotatt04,".
|
|
|
"d.lotatt05,d.lotatt08,d.USERDEFINE1,d.USERDEFINE2,d.USERDEFINE3,d.USERDEFINE4,d.USERDEFINE5,d.RECEIVINGLOCATION FROM DOC_ASN_DETAILS d ".
|
|
"d.lotatt05,d.lotatt08,d.USERDEFINE1,d.USERDEFINE2,d.USERDEFINE3,d.USERDEFINE4,d.USERDEFINE5,d.RECEIVINGLOCATION FROM DOC_ASN_DETAILS d ".
|
|
|
" LEFT JOIN BAS_SKU b ON d.CUSTOMERID = b.CUSTOMERID AND d.SKU = b.SKU INNER JOIN DOC_ASN_HEADER h ON d.ASNNO = h.ASNNO WHERE h.ASNNO = ?");
|
|
" LEFT JOIN BAS_SKU b ON d.CUSTOMERID = b.CUSTOMERID AND d.SKU = b.SKU INNER JOIN DOC_ASN_HEADER h ON d.ASNNO = h.ASNNO WHERE h.ASNNO = ?");
|
|
@@ -202,8 +209,9 @@ class StoreController extends Controller
|
|
|
$items = [];
|
|
$items = [];
|
|
|
$toDay = Carbon::now()->toDateTimeString();
|
|
$toDay = Carbon::now()->toDateTimeString();
|
|
|
$depositories = [];
|
|
$depositories = [];
|
|
|
|
|
+ $traceId = rand(100,999);
|
|
|
foreach ($details as $detail) {
|
|
foreach ($details as $detail) {
|
|
|
- $result = $this->executeSP($detail,$asnno,$depository_code,$db,$quality,$conn,$sql_sp);
|
|
|
|
|
|
|
+ $result = $this->executeSP($detail,$asnno,$depository_code,$db,$quality,$conn,$sql_sp,$traceId);
|
|
|
if (substr($result, 0, 3) != '000') {
|
|
if (substr($result, 0, 3) != '000') {
|
|
|
oci_close($conn);
|
|
oci_close($conn);
|
|
|
app('LogService')->log(__METHOD__,"快速入库-FLUX收货失败","ASNNO:".$asnno.";ERROR:".$result);
|
|
app('LogService')->log(__METHOD__,"快速入库-FLUX收货失败","ASNNO:".$asnno.";ERROR:".$result);
|
|
@@ -245,13 +253,13 @@ class StoreController extends Controller
|
|
|
return ['success'=>true,"data"=>"已成功将“".$asnno."”入库"];
|
|
return ['success'=>true,"data"=>"已成功将“".$asnno."”入库"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function executeSP($detail, $asnno, $depository_code, $db, $quality, $conn, $sql_sp){
|
|
|
|
|
|
|
+ private function executeSP($detail, $asnno, $depository_code, $db, $quality, $conn, $sql_sp,$traceId){
|
|
|
$IN_Warehouse = $detail->warehouseid ?? '';
|
|
$IN_Warehouse = $detail->warehouseid ?? '';
|
|
|
$In_Process_Action = '3';
|
|
$In_Process_Action = '3';
|
|
|
$In_ASNNo_C = $detail->asnno ?? '';
|
|
$In_ASNNo_C = $detail->asnno ?? '';
|
|
|
$In_ASNLineNo_C = $detail->asnlineno ?? '';
|
|
$In_ASNLineNo_C = $detail->asnlineno ?? '';
|
|
|
$In_FMTraceID_C = '';
|
|
$In_FMTraceID_C = '';
|
|
|
- $In_New_TraceID_C = '';
|
|
|
|
|
|
|
+ $In_New_TraceID_C = $traceId;
|
|
|
$In_ProductStatus = '00';
|
|
$In_ProductStatus = '00';
|
|
|
$In_ProductStatus_Descr = '正常';
|
|
$In_ProductStatus_Descr = '正常';
|
|
|
$In_HoldRejectCode_C = 'OK';
|
|
$In_HoldRejectCode_C = 'OK';
|