|
|
@@ -60,11 +60,14 @@ 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 +109,83 @@ class TestController extends Controller
|
|
|
app(BatchUpdateService::class)->batchUpdate('inventory_accounts', $updateParams);
|
|
|
}
|
|
|
}
|
|
|
+ public function zui(){
|
|
|
+
|
|
|
+ $d = ["ada","超管","hospital_1","测试","hospital_5"];
|
|
|
+ $a = [];
|
|
|
+ foreach ($d as $item){
|
|
|
+ $arr = explode("_",$item);
|
|
|
+ if (count($arr) === 2 && $arr[0] == 'hospital' && is_numeric($arr[1]))$a[] = $arr[1];
|
|
|
+ }
|
|
|
+ dd($a);
|
|
|
+ }
|
|
|
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"));
|
|
|
}
|
|
|
- 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);
|
|
|
+ return \response($response,200, [
|
|
|
+ "Content-type"=>"application/octet-stream",
|
|
|
+ "Content-Disposition"=>"attachment; filename=测试.xlsx",
|
|
|
+ ]);
|
|
|
+
|
|
|
+ if ($post->status() == 500){
|
|
|
+ throw new Exception($post->header("Msg"));
|
|
|
+ }
|
|
|
+ $test = "test";
|
|
|
+ return response($response->get,200, [
|
|
|
+ "Content-type"=>"application/octet-stream",
|
|
|
+ "Content-Disposition"=>"attachment; filename=".$test."-".date('ymdHis').'.xlsx',
|
|
|
+ ]);
|
|
|
}
|
|
|
|
|
|
public function mergeCarrier(){
|