|
|
@@ -56,6 +56,7 @@ use App\Services\WarehouseService;
|
|
|
use App\Store;
|
|
|
use App\StationTaskBatch;
|
|
|
use App\StoreCheckingReceiveItem;
|
|
|
+use App\StoreItems;
|
|
|
use App\User;
|
|
|
use App\Warehouse;
|
|
|
use App\Waybill;
|
|
|
@@ -66,6 +67,7 @@ use Illuminate\Support\Facades\Auth;
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
use Illuminate\Http\Request;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
+use Illuminate\Support\Facades\Http;
|
|
|
use Illuminate\Support\Str;
|
|
|
use Maatwebsite\Excel\Facades\Excel;
|
|
|
use Ramsey\Collection\Collection;
|
|
|
@@ -109,16 +111,30 @@ class TestController extends Controller
|
|
|
}
|
|
|
public function zzd()
|
|
|
{
|
|
|
- $a = DB::connection("oracle")->select(DB::raw("select * from DOC_WAVE_DETAILS where WAVENO = 'W201210000112'"));
|
|
|
- $str="";
|
|
|
- $a = array_column($a,"orderno");
|
|
|
- foreach ($a as $t){
|
|
|
- $str.="'".$t."',";
|
|
|
+ foreach (StoreItems::query()->with(["depository","store"])->where("store_id",0)->cursor() as $flight){
|
|
|
+ $sql = <<<sql
|
|
|
+ select ASNNO from DOC_ASN_DETAILS left join bas_sku on DOC_ASN_DETAILS.SKU= BAS_SKU.SKU
|
|
|
+ WHERE asnlineno = ? AND skudescrc = ?
|
|
|
+ AND BAS_SKU.sku = ? AND alternate_sku1 = ? AND expectedqty_each = ? and LINESTATUS = '99'
|
|
|
+sql;
|
|
|
+ $param = [$flight->asn_line_code,$flight->name,$flight->sku,$flight->barcode,$flight->amount];
|
|
|
+ if ($flight->depository)$sql.= " AND LOTATT05 = '".$flight->depository->code."' ";
|
|
|
+ else $sql .=" AND LOTATT05 IS NULL";
|
|
|
+ $r = DB::connection("oracle")->select(DB::raw($sql),$param);
|
|
|
+ $dd = [];
|
|
|
+ foreach ($r as $data){
|
|
|
+ $store = Store::query()->where("asn_code",$data->asnno)->where("stored_method","快速入库")->first();
|
|
|
+ if ($store){
|
|
|
+ $dd[] = $store->id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($dd){
|
|
|
+ if (count($dd) == 1){
|
|
|
+ StoreItems::query()->where("id",$flight->id)->where("store_id",0)->update(["store_id"=>$dd[0]]);
|
|
|
+ echo "更改ID“".$flight->id."”的store_id为:".$dd[0]."<br>";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- dd($str);
|
|
|
- $str = rtrim($str,",");
|
|
|
- $c = DB::connection("oracle")->select(DB::raw("select SUM(qtyordered) s from DOC_ORDER_DETAILS where ORDERNO IN (".$str.")"));
|
|
|
- dd($c);
|
|
|
}
|
|
|
|
|
|
public function mergeCarrier(){
|
|
|
@@ -275,8 +291,8 @@ class TestController extends Controller
|
|
|
|
|
|
function t1(Request $request)
|
|
|
{
|
|
|
- $obj=StationTaskBatch::query()->firstOrCreate(['batch_id'=>1,'station_id'=>1,'station_task_batch_type_id'=>1,'status'=>'未处理']);
|
|
|
- dd(get_class($obj));
|
|
|
+ $args = Http::post('https://wcs.baoshi56.com/api/thirdPart/flux/sorting/newBatch', []);
|
|
|
+ dd($args->body());
|
|
|
}
|
|
|
function packageT(Request $request)
|
|
|
{
|