|
@@ -0,0 +1,60 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Http\Controllers\Api;
|
|
|
+
|
|
|
+use App\Service\InOutOptionService;
|
|
|
+use Illuminate\Http\Request;
|
|
|
+use Illuminate\Support\Facades\Redis;
|
|
|
+
|
|
|
+class InOutOptionController extends BaseController
|
|
|
+{
|
|
|
+ public function setOrderNumber(Request $request){
|
|
|
+ $service = new InOutOptionService();
|
|
|
+ list($status,$data) = $service->setOrderNumber($request->all());
|
|
|
+
|
|
|
+ echo 'ok';die;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getOrderNumber(Request $request){
|
|
|
+ $service = new InOutOptionService();
|
|
|
+ list($status,$data) = $service->getOrderNumber($request->all());
|
|
|
+
|
|
|
+ if($status){
|
|
|
+ return $this->json_return(200,'',$data);
|
|
|
+ }else{
|
|
|
+ return $this->json_return(201,$data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public function inout(){
|
|
|
+ $i = 'inout_key_state';
|
|
|
+ $s = Redis::get($i);
|
|
|
+ if($s){
|
|
|
+ $key = 'inout_key';
|
|
|
+ $a = Redis::get($key);
|
|
|
+ if(empty($a)){
|
|
|
+ $a = 1;
|
|
|
+ } else{
|
|
|
+ if($a == 1) $a = 2;
|
|
|
+ else $a = 1;
|
|
|
+ }
|
|
|
+ Redis::set($key,$a);
|
|
|
+
|
|
|
+ if($a == 1) $type = '出库';
|
|
|
+ else $type = '入库';
|
|
|
+
|
|
|
+ $detail = [
|
|
|
+ 'project'=>'南京福猴建材有限公司',
|
|
|
+ 'type'=>$type,
|
|
|
+ 'num'=>'2',
|
|
|
+ 'order_no'=>'PG2023101900818',
|
|
|
+ '时间'=>date('Y-m-d H:i:s'),
|
|
|
+ ];
|
|
|
+ Redis::del($i);
|
|
|
+ return $this->json_return(200,'',$detail);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this->json_return(200,'',[]);
|
|
|
+
|
|
|
+ }
|
|
|
+}
|