| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace App\Http\Controllers;
- use App\Components\AsyncResponse;
- use App\Components\Database;
- use App\Components\ErrorPush;
- use App\Order;
- use App\OrderIssue;
- use App\Services\OrderIssueService;
- use App\Services\OrderIssueTypeService;
- use App\Services\OrderRejectedBillRelationService;
- use App\Services\OrderService;
- use App\Services\WaybillService;
- use App\Waybill;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- class TestController extends Controller
- {
- use AsyncResponse, ErrorPush, Database;
- const ASNREFERENCE_2 = 'ASNREFERENCE2';
- public function __construct()
- {
- $this->data["active_test"] = "active";
- }
- public function method(Request $request, $method)
- {
- try {
- return call_user_func([$this, $method], $request);
- }catch (\BadMethodCallException $e){
- dd("方法不存在");
- }
- }
- public function test(){
- $sql = <<<SQL
- select * from equipment where id in (
- select parent_id from equipment where parent_id in (select id from equipment where info like '%"id":2%' and code like 'H%')
- group by parent_id having (count(*)<5)
- );
- SQL;
- $arr = DB::connection("aliyunMysql")->select(DB::raw($sql));
- $insert = <<<SQL
- insert into equipment(repository_id, code, parent_id, info, depth, width, height, containers, location_tab, created_at, updated_at, tandem)
- values (?,?,?,null,?,?,1.8,null,'0-0','2022-01-13 16:08:00','2022-01-13 16:08:00',null)
- SQL;
- foreach ($arr as $item){
- DB::connection("aliyunMysql")->insert($insert, [$item->repository_id,$item->code."-1",$item->id,$item->depth,$item->width]);
- }
- }
- public function batch(){
- /** @var OrderIssueTypeService $issueTypeService */
- $issueTypeService = app(OrderIssueTypeService::class);
- $types = $issueTypeService->getWorkOrderIssueType();
- return view("order.workOrder.batch.index",compact("types"));
- }
- public function test1(){
- $arr1 = ["123","1234","12345"];
- $arr2 = ["1234"];
- dd(array_diff($arr1,$arr2));
- }
- public function syncOrder(){
- /** @var OrderService $service */
- $service = app(OrderService::class);
- $service->syncOrderInfoByWmsOrderNos(['SO220331003419','SO220331003387','SO220331003378','SO220331003356']);
- }
- }
|