|
|
@@ -55,16 +55,20 @@ use App\Services\StoreService;
|
|
|
use App\Services\WarehouseService;
|
|
|
use App\Store;
|
|
|
use App\StoreCheckingReceiveItem;
|
|
|
+use App\StoreItems;
|
|
|
use App\User;
|
|
|
use App\Warehouse;
|
|
|
use App\Waybill;
|
|
|
use App\WaybillPriceModel;
|
|
|
use Carbon\Carbon;
|
|
|
+use Exception;
|
|
|
+use GuzzleHttp\Client;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
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;
|
|
|
@@ -106,18 +110,77 @@ class TestController extends Controller
|
|
|
app(BatchUpdateService::class)->batchUpdate('inventory_accounts', $updateParams);
|
|
|
}
|
|
|
}
|
|
|
+ public function zui(){
|
|
|
+ $a = new \Illuminate\Support\Collection(["a"=>"b"]);
|
|
|
+ foreach ($a as $i=>$l)dump($i,$l);
|
|
|
+ }
|
|
|
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."',";
|
|
|
+ $post=Http::post("http://localhost:9722",["type"=>"base","format"=>[
|
|
|
+ "method"=>"warpText",
|
|
|
+ "mergeColumn"=>["column"],
|
|
|
+ "mergeRow"=>["row"=>"row"],
|
|
|
+ "datum"=>"datum",
|
|
|
+ ],"connection"=>[
|
|
|
+ "driver"=>"mysql",
|
|
|
+ "host"=>"host",
|
|
|
+ "port"=>"port",
|
|
|
+ "database"=>"databse",
|
|
|
+ "username"=>"username",
|
|
|
+ "password"=>"password",
|
|
|
+ "charset"=>"char",
|
|
|
+ "parsetime"=>"pars",
|
|
|
+ "sid"=>"",
|
|
|
+ ],"data"=>[
|
|
|
+ "row"=>["sql-row"],
|
|
|
+ "list"=>[["sql-list"]],
|
|
|
+ "sql"=>"sql",
|
|
|
+ "rule"=>["sql"=>"rule"],
|
|
|
+ ],"path"=>[
|
|
|
+ "log"=>"log",
|
|
|
+ "file"=>""
|
|
|
+ ]]);
|
|
|
+ $http = new Client();
|
|
|
+ $response = $http->get("http://localhost:9722", ["type"=>"base","format"=>[
|
|
|
+ "method"=>"warpText",
|
|
|
+ "mergeColumn"=>["column"],
|
|
|
+ "mergeRow"=>["row"=>"row"],
|
|
|
+ "datum"=>"datum",
|
|
|
+ ],"connection"=>[
|
|
|
+ "driver"=>"mysql",
|
|
|
+ "host"=>"host",
|
|
|
+ "port"=>"port",
|
|
|
+ "database"=>"databse",
|
|
|
+ "username"=>"username",
|
|
|
+ "password"=>"password",
|
|
|
+ "charset"=>"char",
|
|
|
+ "parsetime"=>"pars",
|
|
|
+ "sid"=>"",
|
|
|
+ ],"data"=>[
|
|
|
+ "row"=>["sql-row"],
|
|
|
+ "list"=>[["sql-list"]],
|
|
|
+ "sql"=>"sql",
|
|
|
+ "rule"=>["sql"=>"rule"],
|
|
|
+ ],"path"=>[
|
|
|
+ "log"=>"log",
|
|
|
+ "file"=>""
|
|
|
+ ]]);
|
|
|
+ if ($response->getStatusCode() == 500){
|
|
|
+ throw new \Exception($response->getHeader("Msg"));
|
|
|
+ }
|
|
|
+ return \response($response,200, [
|
|
|
+ "Content-type"=>"application/octet-stream",
|
|
|
+ "Content-Disposition"=>"attachment; filename=测试.xlsx",
|
|
|
+ ]);
|
|
|
+
|
|
|
+ if ($post->status() == 500){
|
|
|
+ throw new Exception($post->header("Msg"));
|
|
|
}
|
|
|
- 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);
|
|
|
+ $test = "test";
|
|
|
+ return response($response->get,200, [
|
|
|
+ "Content-type"=>"application/octet-stream",
|
|
|
+ "Content-Disposition"=>"attachment; filename=".$test."-".date('ymdHis').'.xlsx',
|
|
|
+ ]);
|
|
|
}
|
|
|
|
|
|
public function mergeCarrier(){
|
|
|
@@ -1266,37 +1329,12 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
|
|
|
dd($requests);
|
|
|
}
|
|
|
|
|
|
- public function testGetCommodity()
|
|
|
- {
|
|
|
- /**
|
|
|
- * @var CommodityService $commodityService
|
|
|
- */
|
|
|
- $ownerIds=['13'];
|
|
|
- $barcodes = 'BH08B4029E027110';
|
|
|
- $skus = ['BH08B4029E027110'];
|
|
|
- $commodityService = app(CommodityService::class);
|
|
|
- //$commodities=$commodityService->get_($ownerIds,$skus,[],true);
|
|
|
-// dd($commodities->first());
|
|
|
- $ownerId=13;
|
|
|
- $sku='BH08B4029E027110';
|
|
|
- $commodity=$commodityService->syncBarcodes($barcodes,$ownerId,$sku);
|
|
|
- dd($commodity);
|
|
|
- }
|
|
|
-
|
|
|
public function syncOrderTracking()
|
|
|
{
|
|
|
+ $startDate = \Illuminate\Support\Carbon::parse('2020-12-12 00:00:00')->toDateTimeString();
|
|
|
/** @var OrderTrackingService $orderTrackingService */
|
|
|
$orderTrackingService = app('OrderTrackingService');
|
|
|
- /** @var OrderService $orderService */
|
|
|
- $orderService = app(OrderService::class);
|
|
|
- /*$owners = app(OrderTrackingOwnerService::class)->getTrackingOrderOwner();*/
|
|
|
- /*$startDate = \Illuminate\Support\Carbon::parse('2020-10-28 00:00:00')->toDateTimeString();*/
|
|
|
- $orderNos = ['SO201205001735', 'SO201204003891', 'SO201204003706', 'SO201204002877', 'SO201203003771'];
|
|
|
- $orderHeaders = OracleDOCOrderHeader::query()->with(['oracleDOCOrderDetails', 'actAllocationDetails', 'oracleBASCode'])
|
|
|
- ->whereIn('orderno', $orderNos)
|
|
|
- ->get();
|
|
|
- $orderService->updateByWmsOrders($orderHeaders);
|
|
|
- $orderTrackingService->createByWmsOrderHeader($orderHeaders);
|
|
|
+ $orderTrackingService->trackingWmsOrder($startDate);
|
|
|
}
|
|
|
|
|
|
public function testSyncOrderTask(){
|