TestController.php 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444
  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use App\Model\BoxDetail;
  4. use App\Model\DispatchSub;
  5. use App\Model\OrdersProduct;
  6. use App\Model\SaleOrdersProduct;
  7. use App\Service\FinishedOrderService;
  8. use App\Service\MeasureService;
  9. use Illuminate\Http\Request;
  10. use Illuminate\Support\Facades\DB;
  11. use Illuminate\Support\Facades\Storage;
  12. class TestController extends BaseController
  13. {
  14. public function tt(){
  15. // die('d');
  16. $list = SaleOrdersProduct::where('out_order_no_time','<','1693497600')->where('production_quantity',0)->orderBy('id','desc')->get()->toArray();
  17. $url = 'https://fyy_api.qingyaokeji.com/api/productionAdd';
  18. echo count($list);
  19. die;
  20. foreach ($list as $v){
  21. $header = [
  22. 'Authorization' => '[personalComputer]eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2OTc0NDMzMzMsIm5iZiI6MTY5NzQ0MzMzMiwiZXhwIjoxNzA2MDgzMzMzLCJkYXRhIjp7InVzZXJfaWQiOjF9fQ.wP5c0fPquR6mWYWdAIudf-J60aUBQiSYAmCaI0bWx6k',
  23. 'Zt'=> '999'
  24. ];
  25. $post = [
  26. 'id' => [$v['id']],
  27. 'quantity' => [$v['order_quantity']],
  28. ];
  29. $a = $this->curlOpen($url,['header'=>$header,'post'=>$post]);
  30. echo $a;
  31. }
  32. }
  33. public function tt1(){
  34. $list = SaleOrdersProduct::where('out_order_no_time','<','1693497600')->where('production_quantity',0)->get()->toArray();
  35. $url = 'https://fyy_api.qingyaokeji.com/api/productionAdd';
  36. echo count($list);
  37. foreach ($list as $v){
  38. $header = [
  39. 'Authorization' => '[personalComputer]eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2OTc0NDMzMzMsIm5iZiI6MTY5NzQ0MzMzMiwiZXhwIjoxNzA2MDgzMzMzLCJkYXRhIjp7InVzZXJfaWQiOjF9fQ.wP5c0fPquR6mWYWdAIudf-J60aUBQiSYAmCaI0bWx6k',
  40. 'Zt'=> '999'
  41. ];
  42. $post = [
  43. 'id' => [$v['id']],
  44. 'quantity' => [$v['order_quantity']],
  45. ];
  46. $a = $this->curlOpen($url,['header'=>$header,'post'=>$post]);
  47. echo $a;
  48. }
  49. }
  50. public function ttt(){
  51. $list = OrdersProduct::where('production_time','>','1697385600')->where('dispatch_complete_quantity',0)->get()->toArray();
  52. $url = 'https://fyy_api.qingyaokeji.com/api/dispatchAdd';
  53. $n = 0;
  54. $ids = [];
  55. $out_order_no_times = [];
  56. foreach ($list as $v){
  57. $header = [
  58. 'Authorization' => '[personalComputer]eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2OTc0NDMzMzMsIm5iZiI6MTY5NzQ0MzMzMiwiZXhwIjoxNzA2MDgzMzMzLCJkYXRhIjp7InVzZXJfaWQiOjF9fQ.wP5c0fPquR6mWYWdAIudf-J60aUBQiSYAmCaI0bWx6k',
  59. 'Zt'=> '999'
  60. ];
  61. if($n < 20){
  62. $ids[] = $v['id'];
  63. $out_order_no_times[] = $v['order_quantity'];
  64. $n++;
  65. }
  66. if($n == 20){
  67. $post = [
  68. 'dispatch_time' => [$v['out_order_no_time']+86400,$v['out_order_no_time']+(86400*2)],
  69. 'employee_id' => [rand(431,432)],
  70. 'equipment_id' => 11,
  71. 'id' => $ids,
  72. 'is_split' => 1,
  73. 'out_order_no_time' => [$v['out_order_no_time']+86400,$v['out_order_no_time']+(86400*2)],
  74. 'process_id' => 9,
  75. 'quantity' => $out_order_no_times,
  76. 'team_id' => 68,
  77. ];
  78. $a = $this->curlOpen($url,['header'=>$header,'post'=>$post]);
  79. var_dump($a);
  80. $n = 0;
  81. $ids = [];
  82. $out_order_no_times = [];
  83. }
  84. }
  85. }
  86. public function ttt1(){
  87. $list = OrdersProduct::where('production_time','>','1697385600')->where('dispatch_complete_quantity',0)->orderBy('id','desc')->get()->toArray();
  88. $url = 'https://fyy_api.qingyaokeji.com/api/dispatchAdd';
  89. var_dump(count($list));
  90. $n = 0;
  91. foreach ($list as $v){
  92. $header = [
  93. 'Authorization' => '[personalComputer]eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2OTc0NDMzMzMsIm5iZiI6MTY5NzQ0MzMzMiwiZXhwIjoxNzA2MDgzMzMzLCJkYXRhIjp7InVzZXJfaWQiOjF9fQ.wP5c0fPquR6mWYWdAIudf-J60aUBQiSYAmCaI0bWx6k',
  94. 'Zt'=> '999'
  95. ];
  96. if($n < 20){
  97. $ids[] = $v['id'];
  98. $out_order_no_times[] = $v['order_quantity'];
  99. $n++;
  100. }
  101. if($n == 20){
  102. $post = [
  103. 'dispatch_time' => [$v['out_order_no_time']+86400,$v['out_order_no_time']+(86400*2)],
  104. 'employee_id' => [rand(431,432)],
  105. 'equipment_id' => 11,
  106. 'id' => $ids,
  107. 'is_split' => 1,
  108. 'out_order_no_time' => [$v['out_order_no_time']+86400,$v['out_order_no_time']+(86400*2)],
  109. 'process_id' => 9,
  110. 'quantity' => $out_order_no_times,
  111. 'team_id' => 68,
  112. ];
  113. $a = $this->curlOpen($url,['header'=>$header,'post'=>$post]);
  114. var_dump($a);
  115. $n = 0;
  116. $ids = [];
  117. $out_order_no_times = [];
  118. }
  119. }
  120. }
  121. public function tttt(){
  122. ini_set('output_buffering', 'off');
  123. // 立即发送所有输出
  124. ini_set('implicit_flush', 'on');
  125. // 设置执行时间不限制
  126. set_time_limit(0);
  127. $list = DispatchSub::where('crt_time','>','1697385600')->where('finished_num',0)->get()->toArray();
  128. $url = 'https://fyy_api.qingyaokeji.com/api/finishedOrderAdd';
  129. echo count($list);
  130. $n = 0;
  131. $ids = [];
  132. $out_order_no_times = [];
  133. foreach ($list as $v){
  134. $header = [
  135. 'Authorization' => '[personalComputer]eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2OTc0NDMzMzMsIm5iZiI6MTY5NzQ0MzMzMiwiZXhwIjoxNzA2MDgzMzMzLCJkYXRhIjp7InVzZXJfaWQiOjF9fQ.wP5c0fPquR6mWYWdAIudf-J60aUBQiSYAmCaI0bWx6k',
  136. 'Zt'=> '999'
  137. ];
  138. if($n < 2){
  139. $ids[] = $v['id'];
  140. $out_order_no_times[] = $v['dispatch_quantity'];
  141. $n++;
  142. }
  143. if($n == 2){
  144. $post = [
  145. 'equipment_id' => 11,
  146. 'finish_id' => [rand(431,432)],
  147. 'id' => $ids,
  148. 'quantity' => $out_order_no_times,
  149. 'team_id' => 68,
  150. 'waste' => [[]],
  151. ];
  152. sleep(10);
  153. $a = $this->curlOpen($url,['header'=>$header,'post'=>$post]);
  154. echo $a;
  155. $n = 0;
  156. $ids = [];
  157. $out_order_no_times = [];
  158. }
  159. // flush();die;
  160. }
  161. }
  162. public function tttt1(){
  163. ini_set('output_buffering', 'off');
  164. // 立即发送所有输出
  165. ini_set('implicit_flush', 'on');
  166. // 设置执行时间不限制
  167. set_time_limit(0);
  168. $list = DispatchSub::where('crt_time','>','1697385600')->where('finished_num',0)->get()->toArray();
  169. $url = 'https://fyy_api.qingyaokeji.com/api/finishedOrderAdd';
  170. echo count($list);
  171. $n = 0;
  172. $ids = [];
  173. $out_order_no_times = [];
  174. foreach ($list as $v){
  175. $header = [
  176. 'Authorization' => '[personalComputer]eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2OTc0NDMzMzMsIm5iZiI6MTY5NzQ0MzMzMiwiZXhwIjoxNzA2MDgzMzMzLCJkYXRhIjp7InVzZXJfaWQiOjF9fQ.wP5c0fPquR6mWYWdAIudf-J60aUBQiSYAmCaI0bWx6k',
  177. 'Zt'=> '999'
  178. ];
  179. if($n < 2){
  180. $ids[] = $v['id'];
  181. $out_order_no_times[] = $v['dispatch_quantity'];
  182. $n++;
  183. }
  184. if($n == 2){
  185. $post = [
  186. 'equipment_id' => 11,
  187. 'finish_id' => [rand(431,432)],
  188. 'id' => $ids,
  189. 'quantity' => $out_order_no_times,
  190. 'team_id' => 68,
  191. 'waste' => [[]],
  192. ];
  193. sleep(10);
  194. $a = $this->curlOpen($url,['header'=>$header,'post'=>$post]);
  195. echo $a;
  196. $n = 0;
  197. $ids = [];
  198. $out_order_no_times = [];
  199. }
  200. // flush();die;
  201. }
  202. }
  203. public function aa1(){
  204. ini_set('output_buffering', 'off');
  205. // 立即发送所有输出
  206. ini_set('implicit_flush', 'on');
  207. // 设置执行时间不限制
  208. set_time_limit(0);
  209. $list = DispatchSub::where('crt_time','>','1697385600')->where('finished_num',0)->get()->toArray();
  210. $url = 'https://fyy_api.qingyaokeji.com/api/finishedOrderAdd';
  211. echo count($list);
  212. $n = 0;
  213. $ids = [];
  214. $out_order_no_times = [];
  215. foreach ($list as $v){
  216. $header = [
  217. 'Authorization' => '[personalComputer]eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2OTc0NDMzMzMsIm5iZiI6MTY5NzQ0MzMzMiwiZXhwIjoxNzA2MDgzMzMzLCJkYXRhIjp7InVzZXJfaWQiOjF9fQ.wP5c0fPquR6mWYWdAIudf-J60aUBQiSYAmCaI0bWx6k',
  218. 'Zt'=> '999'
  219. ];
  220. if($n < 1){
  221. $ids[] = $v['id'];
  222. $out_order_no_times[] = $v['dispatch_quantity'];
  223. $n++;
  224. }
  225. if($n == 1){
  226. $post = [
  227. 'equipment_id' => 11,
  228. 'finish_id' => [rand(431,432)],
  229. 'id' => $ids,
  230. 'quantity' => $out_order_no_times,
  231. 'team_id' => 68,
  232. 'waste' => [[]],
  233. ];
  234. var_dump($post);
  235. $a = $this->curlOpen($url,['header'=>$header,'post'=>$post]);
  236. var_dump($a);die;
  237. $n = 0;
  238. $ids = [];
  239. $out_order_no_times = [];
  240. }
  241. // flush();die;
  242. }
  243. }
  244. function curlOpen($url, $config = array())
  245. {
  246. $arr = array('post' => false,'referer' => $url,'cookie' => '', 'useragent' => 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; customie8)', 'timeout' => 100, 'return' => true, 'proxy' => '', 'userpwd' => '', 'nobody' => false,'header'=>array(),'gzip'=>true,'ssl'=>true,'isupfile'=>false,'returnheader'=>false,'request'=>'post');
  247. $arr = array_merge($arr, $config);
  248. $ch = curl_init();
  249. curl_setopt($ch, CURLOPT_URL, $url);
  250. curl_setopt($ch, CURLOPT_RETURNTRANSFER, $arr['return']);
  251. curl_setopt($ch, CURLOPT_NOBODY, $arr['nobody']);
  252. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  253. curl_setopt($ch, CURLOPT_USERAGENT, $arr['useragent']);
  254. curl_setopt($ch, CURLOPT_REFERER, $arr['referer']);
  255. curl_setopt($ch, CURLOPT_TIMEOUT, $arr['timeout']);
  256. curl_setopt($ch, CURLOPT_HEADER, $arr['returnheader']);//��ȡheader
  257. if($arr['gzip']) curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
  258. if($arr['ssl'])
  259. {
  260. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  261. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  262. }
  263. if(!empty($arr['cookie']))
  264. {
  265. curl_setopt($ch, CURLOPT_COOKIEJAR, $arr['cookie']);
  266. curl_setopt($ch, CURLOPT_COOKIEFILE, $arr['cookie']);
  267. }
  268. if(!empty($arr['proxy']))
  269. {
  270. //curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
  271. curl_setopt ($ch, CURLOPT_PROXY, $arr['proxy']);
  272. if(!empty($arr['userpwd']))
  273. {
  274. curl_setopt($ch,CURLOPT_PROXYUSERPWD,$arr['userpwd']);
  275. }
  276. }
  277. //ip�Ƚ����⣬�ü�ֵ��ʾ
  278. if(!empty($arr['header']['ip']))
  279. {
  280. array_push($arr['header'],'X-FORWARDED-FOR:'.$arr['header']['ip'],'CLIENT-IP:'.$arr['header']['ip']);
  281. unset($arr['header']['ip']);
  282. }
  283. $arr['header'] = array_filter($arr['header']);
  284. if(!empty($arr['header']))
  285. {
  286. $header = [];
  287. foreach ($arr['header'] as $k=>$v){
  288. $header[] = $k.':'.$v;
  289. }
  290. $header[] = 'Content-Type: application/json';
  291. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  292. }
  293. if($arr['request'] === 'put'){
  294. curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "PUT");
  295. curl_setopt($ch, CURLOPT_POSTFIELDS,$arr['post']);
  296. }elseif($arr['post'] != false)
  297. {
  298. curl_setopt($ch, CURLOPT_POST, true);
  299. // if(is_array($arr['post']) && $arr['isupfile'] === false)
  300. // {
  301. // $post = http_build_query($arr['post']);
  302. // }
  303. // else
  304. // {
  305. // $post = $arr['post'];
  306. // }
  307. curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($arr['post']));
  308. }
  309. $result = curl_exec($ch);
  310. curl_close($ch);
  311. return $result;
  312. }
  313. public function aa(){
  314. $data = [
  315. 'out_order_no' => 'test123',
  316. 'top_id' => '1',
  317. 'ext_1' => '1',
  318. 'ext_2' => '2',
  319. 'ext_3' => '3',
  320. 'ext_4' => '4',
  321. 'ext_5' => '5',
  322. 'detail' => [
  323. [
  324. 'top_id' => '1',
  325. 'code' => '001',
  326. 'title' => '产品名称',
  327. 'ext_1' => '1',
  328. 'ext_2' => '2',
  329. 'ext_3' => '3',
  330. 'ext_4' => '4',
  331. 'ext_5' => '5',
  332. ],[
  333. 'top_id' => '2',
  334. 'code' => '002',
  335. 'title' => '产品名称1',
  336. 'ext_1' => '11',
  337. 'ext_2' => '22',
  338. 'ext_3' => '33',
  339. 'ext_4' => '44',
  340. 'ext_5' => '55',
  341. ],
  342. ],
  343. ];
  344. var_dump(json_encode($data));die;
  345. $service = BoxHookService::getInstance();
  346. list($status,$msg) = $service->boxInsert($data);
  347. var_dump($status);
  348. var_dump($msg);
  349. }
  350. // public function aa(){
  351. // $service = BoxHookService::getInstance();
  352. //
  353. // list($status,$msg) = $service->boxDetail(['order_no'=>'202306130543108902']);
  354. // var_dump($status);
  355. // var_dump($msg);
  356. // }
  357. public function testData(Request $request){
  358. date_default_timezone_set('PRC');
  359. $arr = ['title' => json_encode($request->all()),
  360. 'crt_time' => date('Y-m-d H:i:s')
  361. ];
  362. DB::table('test_shebei')->insert($arr);
  363. // DB::table('test_shebei')->insert(['title' => '2223354']);
  364. }
  365. public function order_process1(Request $request) {
  366. $arr = [
  367. 0 => ['Code' => "SO202307270001", 'CustomerName' => "金华市金东区方氏防火建材经营部", 'rate' => 55],
  368. 1 => ['Code' => "SO202307270002", 'CustomerName' => "岳阳耀东翔建筑材料有限公司", 'rate' => 20],
  369. 2 => ['Code' => "SO202307270003", 'CustomerName' => "森泓(内蒙古)建材有限公司", 'rate' => 99],
  370. 3 => ['Code' => "SO202307270004", 'CustomerName' => "重庆渝人实业有限公司", 'rate' => 65],
  371. 4 => ['Code' => "SO202307270005", 'CustomerName' => "九龙坡区优源木业销售中心", 'rate' => 37],
  372. 5 => ['Code' => "SO202307270006", 'CustomerName' => "湖北嘉宜木业有限公司", 'rate' => 16],
  373. 6 => ['Code' => "SO202307270007", 'CustomerName' => "中牟县国威家居建材商行", 'rate' => 44],
  374. 7 => ['Code' => "SO202307270008", 'CustomerName' => "绵阳市森元高科林业有限公司", 'rate' => 66],
  375. 8 => ['Code' => "SO202307270009", 'CustomerName' => "红花岗区美梦晨建材经营部", 'rate' => 22],
  376. 9 => ['Code' => "SO202307270010", 'CustomerName' => "茅箭区火车站鸿发装饰部", 'rate' => 15],
  377. 10 => ['Code' => "SO202307270011", 'CustomerName' => "郯城县王钦红建材五金店", 'rate' => 80],
  378. 11 => ['Code' => "SO202307270012", 'CustomerName' => "合肥麦凯森新材料科技有限公司", 'rate' => 15],
  379. 12 => ['Code' => "SO202307270013", 'CustomerName' => "湖北旺百福建材有限公司", 'rate' => 78],
  380. 13 => ['Code' => "SO202307270014", 'CustomerName' => "义乌市鼎泰建材有限公司", 'rate' => 15],
  381. 14 => ['Code' => "SO202307270015", 'CustomerName' => "平舆县艾力熊板材销售店", 'rate' => 40],
  382. 15 => ['Code' => "SO202307270016", 'CustomerName' => "杭州德兔装饰材料有限公司", 'rate' => 14],
  383. 16 => ['Code' => "SO202307270017", 'CustomerName' => "徐州美尔娜装饰材料有限公司", 'rate' => 88],
  384. 17 => ['Code' => "SO202307270018", 'CustomerName' => "合肥市包河区郭玉春建材经营部", 'rate' => 84],
  385. 18 => ['Code' => "SO202307270019", 'CustomerName' => "深圳雅匠新材料科技有限公司", 'rate' => 82],
  386. 19 => ['Code' => "SO202307270020", 'CustomerName' => "乌鲁木齐市米东区信和建材商行", 'rate' => 72],
  387. ];
  388. return $this->json_return(200,'',$arr);
  389. }
  390. public function project_region(Request $request){
  391. $arr = [
  392. "all_num" => 2373,
  393. "num" => 188,
  394. ];
  395. return $this->json_return(200,'',$arr);
  396. }
  397. public function output_value_month1(Request $request){
  398. $arr = [
  399. [
  400. "value"=> "2023-01-01",
  401. "num"=> "20"
  402. ],
  403. [
  404. "value"=> "2023-01-02",
  405. "num"=> "40"
  406. ],
  407. [
  408. "value"=> "2023-01-03",
  409. "num"=> "35"
  410. ],
  411. [
  412. "value"=> "2023-01-04",
  413. "num"=> "15"
  414. ],
  415. [
  416. "value"=> "2023-01-05",
  417. "num"=> "40",
  418. ]
  419. ];
  420. return $this->json_return(200,'',$arr);
  421. }
  422. public function output_value_efficiency(Request $request){
  423. $arr = [
  424. [
  425. "time"=> "2023-01-01",
  426. "output"=> "0"
  427. ],
  428. [
  429. "time"=> "2023-01-02",
  430. "output"=> "0"
  431. ],
  432. [
  433. "time"=> "2023-01-03",
  434. "output"=> "2711"
  435. ],
  436. [
  437. "time"=> "2023-01-04",
  438. "output"=> "2239"
  439. ],
  440. [
  441. "time"=> "2023-01-05",
  442. "output"=> "1101"
  443. ]
  444. ];
  445. return $this->json_return(200,'',$arr);
  446. }
  447. public function capacity(Request $request){
  448. $arr = [
  449. [
  450. [
  451. "title"=> "压贴",
  452. "rate"=> "70"
  453. ],
  454. [
  455. "title"=> "包装",
  456. "rate"=> "50"
  457. ]
  458. ],
  459. ];
  460. return $this->json_return(200,'',['data' => $arr]);
  461. }
  462. public function product_num(Request $request){
  463. $arr = [
  464. [
  465. "machine_day_num"=> "4903.69",
  466. "machine_month_num"=> "139.64",
  467. "machine_week_num"=> "47.21",
  468. "break_day_num"=> "0",
  469. "break_month_num"=> "10",
  470. "break_week_num"=> "3",
  471. "start_time"=> date("Y-m-d H:i:s",time()),
  472. "day_num"=> "766",
  473. "week_num"=> "4598",
  474. "month_num"=> "14489",
  475. "rate"=> "72"
  476. ],
  477. [
  478. "machine_day_num"=> "469591.19",
  479. "machine_month_num"=> "107.03",
  480. "machine_week_num"=> "35.23",
  481. "break_day_num"=> 0,
  482. "break_month_num"=> "210",
  483. "break_week_num"=> "18",
  484. "start_time"=> date("Y-m-d H:i:s",time()),
  485. "day_num"=> 0,
  486. "week_num"=> "2353",
  487. "month_num"=> "6255",
  488. "rate"=> 0
  489. ],
  490. [
  491. "machine_day_num"=> "0",
  492. "machine_month_num"=> "14.02",
  493. "machine_week_num"=> "6.88",
  494. "break_day_num"=> "0",
  495. "break_month_num"=> "0",
  496. "break_week_num"=> "0",
  497. "start_time"=> date("Y-m-d H:i:s",time()),
  498. "day_num"=> "0",
  499. "week_num"=> "494",
  500. "month_num"=> "3058",
  501. "rate"=> "0"
  502. ],
  503. [
  504. "machine_day_num"=> "4903.77",
  505. "machine_month_num"=> "149.14",
  506. "machine_week_num"=> "56.72",
  507. "break_day_num"=> "0",
  508. "break_month_num"=> "0",
  509. "break_week_num"=> "0",
  510. "start_time"=> date("Y-m-d H:i:s",time()),
  511. "day_num"=> "626",
  512. "week_num"=> "4460",
  513. "month_num"=> "13034",
  514. "rate"=> "48"
  515. ]
  516. ];
  517. return $this->json_return(200,'',$arr);
  518. }
  519. public function work_order(Request $request){
  520. $arr = [
  521. "K23070127_1_8"=>[
  522. "order_no"=>"SO202307270001",
  523. "product_title"=>"大王椰600经典型E0全桉-免漆板W",
  524. "procedure"=>"压贴",
  525. "product_num"=>6,
  526. "finish_num"=>0
  527. ],
  528. "K23070127_1_5"=>[
  529. "order_no"=>"SO202307270002",
  530. "product_title"=>"大王椰600经典型E0全桉-免漆板W",
  531. "procedure"=>"压贴",
  532. "product_num"=>6,
  533. "finish_num"=>0
  534. ],
  535. "K23070127_1_41"=>[
  536. "order_no"=>"SO202307270003",
  537. "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
  538. "procedure"=>"压贴",
  539. "product_num"=>6,
  540. "finish_num"=>0
  541. ],
  542. "K23070127_1_40"=>[
  543. "order_no"=>"SO202307270004",
  544. "product_title"=>"大王椰1700金装型ENF香杉木-智能生态免漆板W",
  545. "procedure"=>"压贴",
  546. "product_num"=>6,
  547. "finish_num"=>0
  548. ],
  549. "K23070127_1_12"=>[
  550. "order_no"=>"SO202307270005",
  551. "product_title"=>"大王椰900尊贵型E0-家具专用背板BW",
  552. "procedure"=>"压贴",
  553. "product_num"=>6,
  554. "finish_num"=>0
  555. ],
  556. "K23070127_1_3"=>[
  557. "order_no"=>"SO202307270006",
  558. "product_title"=>"家具A6森芯背板E0商标使用费",
  559. "procedure"=>"压贴",
  560. "product_num"=>6,
  561. "finish_num"=>0
  562. ],
  563. "K23070127_1_46"=>[
  564. "order_no"=>"SO202307270007",
  565. "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
  566. "procedure"=>"压贴",
  567. "product_num"=>12,
  568. "finish_num"=>0
  569. ],
  570. "K23070127_1_43"=>[
  571. "order_no"=>"SO202307270008",
  572. "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
  573. "procedure"=>"压贴",
  574. "product_num"=>12,
  575. "finish_num"=>0
  576. ],
  577. "K23070127_1_39"=>[
  578. "order_no"=>"SO202307270009",
  579. "product_title"=>"大王椰1800尊贵型ENF指接芯香杉木-智能生态免漆板W",
  580. "procedure"=>"压贴",
  581. "product_num"=>12,
  582. "finish_num"=>0
  583. ],
  584. "K23070127_1_36"=>[
  585. "order_no"=>"SO202307270010",
  586. "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
  587. "procedure"=>"压贴",
  588. "product_num"=>12,
  589. "finish_num"=>0
  590. ],
  591. "K23070127_1_37"=>[
  592. "order_no"=>"SO202307270011",
  593. "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
  594. "procedure"=>"压贴",
  595. "product_num"=>12,
  596. "finish_num"=>0
  597. ],
  598. "K23070127_1_33"=>[
  599. "order_no"=>"SO202307270012",
  600. "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
  601. "procedure"=>"压贴",
  602. "product_num"=>12,
  603. "finish_num"=>0
  604. ],
  605. "K23070127_1_11"=>[
  606. "order_no"=>"SO202307270013",
  607. "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
  608. "procedure"=>"压贴",
  609. "product_num"=>12,
  610. "finish_num"=>0
  611. ],
  612. "K23070127_1_28"=>[
  613. "order_no"=>"SO202307270014",
  614. "product_title"=>"大王椰1800尊贵型E0-家具柜门板PLW",
  615. "procedure"=>"压贴",
  616. "product_num"=>6,
  617. "finish_num"=>0
  618. ],
  619. "K23070127_1_27"=>[
  620. "order_no"=>"SO202307270015",
  621. "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
  622. "procedure"=>"压贴",
  623. "product_num"=>6,
  624. "finish_num"=>0
  625. ],
  626. "K23070127_1_26"=>[
  627. "order_no"=>"SO202307270016",
  628. "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
  629. "procedure"=>"压贴",
  630. "product_num"=>6,
  631. "finish_num"=>0
  632. ],
  633. "K23070127_1_24"=>[
  634. "order_no"=>"SO202307270017",
  635. "product_title"=>"大王椰700尊贵型E0全桉-免漆板W",
  636. "procedure"=>"压贴",
  637. "product_num"=>6,
  638. "finish_num"=>0
  639. ],"K23070127_1_34"=>[
  640. "order_no"=>"SO202307270018",
  641. "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
  642. "procedure"=>"压贴",
  643. "product_num"=>61,
  644. "finish_num"=>0
  645. ],
  646. "K23070127_1_55"=>[
  647. "order_no"=>"SO202307270019",
  648. "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
  649. "procedure"=>"压贴",
  650. "product_num"=>6,
  651. "finish_num"=>0
  652. ],
  653. "K23070127_1_22"=>[
  654. "order_no"=>"SO202307270020",
  655. "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
  656. "procedure"=>"压贴",
  657. "product_num"=>12,
  658. "finish_num"=>0
  659. ],
  660. "K23070127_1_31"=>[
  661. "order_no"=>"SO202307270021",
  662. "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
  663. "procedure"=>"压贴",
  664. "product_num"=>12,
  665. "finish_num"=>0
  666. ],
  667. "K23070127_1_54"=>[
  668. "order_no"=>"SO202307270022",
  669. "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
  670. "procedure"=>"压贴",
  671. "product_num"=>12,
  672. "finish_num"=>0
  673. ],
  674. ];
  675. return $this->json_return(200,'',$arr);
  676. }
  677. public function nu_work_order(Request $request){
  678. $arr = [
  679. "K23070127_1_8"=>[
  680. "order_no"=>"SO202307270001",
  681. "product_title"=>"大王椰600经典型E0全桉-免漆板W",
  682. "procedure"=>"压贴",
  683. "product_num"=>6,
  684. "finish_num"=>0
  685. ],
  686. "K23070127_1_5"=>[
  687. "order_no"=>"SO202307270002",
  688. "product_title"=>"大王椰600经典型E0全桉-免漆板W",
  689. "procedure"=>"压贴",
  690. "product_num"=>6,
  691. "finish_num"=>0
  692. ],
  693. "K23070127_1_41"=>[
  694. "order_no"=>"SO202307270003",
  695. "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
  696. "procedure"=>"压贴",
  697. "product_num"=>6,
  698. "finish_num"=>0
  699. ],
  700. "K23070127_1_40"=>[
  701. "order_no"=>"SO202307270004",
  702. "product_title"=>"大王椰1700金装型ENF香杉木-智能生态免漆板W",
  703. "procedure"=>"压贴",
  704. "product_num"=>6,
  705. "finish_num"=>0
  706. ],
  707. "K23070127_1_12"=>[
  708. "order_no"=>"SO202307270005",
  709. "product_title"=>"大王椰900尊贵型E0-家具专用背板BW",
  710. "procedure"=>"压贴",
  711. "product_num"=>6,
  712. "finish_num"=>0
  713. ],
  714. "K23070127_1_3"=>[
  715. "order_no"=>"SO202307270006",
  716. "product_title"=>"家具A6森芯背板E0商标使用费",
  717. "procedure"=>"压贴",
  718. "product_num"=>6,
  719. "finish_num"=>0
  720. ],
  721. "K23070127_1_46"=>[
  722. "order_no"=>"SO202307270007",
  723. "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
  724. "procedure"=>"压贴",
  725. "product_num"=>12,
  726. "finish_num"=>0
  727. ],
  728. "K23070127_1_43"=>[
  729. "order_no"=>"SO202307270008",
  730. "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
  731. "procedure"=>"压贴",
  732. "product_num"=>12,
  733. "finish_num"=>0
  734. ],
  735. "K23070127_1_39"=>[
  736. "order_no"=>"SO202307270009",
  737. "product_title"=>"大王椰1800尊贵型ENF指接芯香杉木-智能生态免漆板W",
  738. "procedure"=>"压贴",
  739. "product_num"=>12,
  740. "finish_num"=>0
  741. ],
  742. "K23070127_1_36"=>[
  743. "order_no"=>"SO202307270010",
  744. "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
  745. "procedure"=>"压贴",
  746. "product_num"=>12,
  747. "finish_num"=>0
  748. ],
  749. "K23070127_1_37"=>[
  750. "order_no"=>"SO202307270011",
  751. "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
  752. "procedure"=>"压贴",
  753. "product_num"=>12,
  754. "finish_num"=>0
  755. ],
  756. "K23070127_1_33"=>[
  757. "order_no"=>"SO202307270012",
  758. "product_title"=>"大王椰封边皮家具2.2CM×1.0×6卷/件",
  759. "procedure"=>"压贴",
  760. "product_num"=>12,
  761. "finish_num"=>0
  762. ],
  763. "K23070127_1_11"=>[
  764. "order_no"=>"SO202307270013",
  765. "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
  766. "procedure"=>"压贴",
  767. "product_num"=>12,
  768. "finish_num"=>0
  769. ],
  770. "K23070127_1_28"=>[
  771. "order_no"=>"SO202307270014",
  772. "product_title"=>"大王椰1800尊贵型E0-家具柜门板PLW",
  773. "procedure"=>"压贴",
  774. "product_num"=>6,
  775. "finish_num"=>0
  776. ],
  777. "K23070127_1_27"=>[
  778. "order_no"=>"SO202307270015",
  779. "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
  780. "procedure"=>"压贴",
  781. "product_num"=>6,
  782. "finish_num"=>0
  783. ],
  784. "K23070127_1_26"=>[
  785. "order_no"=>"SO202307270016",
  786. "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
  787. "procedure"=>"压贴",
  788. "product_num"=>6,
  789. "finish_num"=>0
  790. ],
  791. "K23070127_1_24"=>[
  792. "order_no"=>"SO202307270017",
  793. "product_title"=>"大王椰700尊贵型E0全桉-免漆板W",
  794. "procedure"=>"压贴",
  795. "product_num"=>6,
  796. "finish_num"=>0
  797. ],
  798. "K23070127_1_34"=>[
  799. "order_no"=>"SO202307270018",
  800. "product_title"=>"大王椰1700金装型E0香杉木-智能生态免漆板W",
  801. "procedure"=>"压贴",
  802. "product_num"=>61,
  803. "finish_num"=>0
  804. ],
  805. "K23070127_1_55"=>[
  806. "order_no"=>"SO202307270019",
  807. "product_title"=>"大王椰1800尊贵型E0指接芯香杉木-智能生态免漆板W",
  808. "procedure"=>"压贴",
  809. "product_num"=>6,
  810. "finish_num"=>0
  811. ],
  812. "K23070127_1_22"=>[
  813. "order_no"=>"SO202307270020",
  814. "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
  815. "procedure"=>"压贴",
  816. "product_num"=>12,
  817. "finish_num"=>0
  818. ],
  819. "K23070127_1_31"=>[
  820. "order_no"=>"SO202307270021",
  821. "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
  822. "procedure"=>"压贴",
  823. "product_num"=>12,
  824. "finish_num"=>0
  825. ],
  826. "K23070127_1_54"=>[
  827. "order_no"=>"SO202307270022",
  828. "product_title"=>"大王椰1800尊贵型ENF-柜门板PLW",
  829. "procedure"=>"压贴",
  830. "product_num"=>12,
  831. "finish_num"=>0
  832. ],
  833. ];
  834. return $this->json_return(200,'',$arr);
  835. }
  836. // public function product_num(Request $request){
  837. // $arr = [
  838. // [
  839. // "machine_day_num"=> "5.69",
  840. // "machine_month_num"=> "139.64",
  841. // "machine_week_num"=> "47.21",
  842. // "break_day_num"=> "0",
  843. // "break_month_num"=> "10",
  844. // "break_week_num"=> "3",
  845. // "start_time"=> date("Y-m-d H:i:s",time()),
  846. // "day_num"=> "766",
  847. // "week_num"=> "4598",
  848. // "month_num"=> "14489",
  849. // "rate"=> "72"
  850. // ],
  851. // [
  852. // "machine_day_num"=> "4.19",
  853. // "machine_month_num"=> "107.03",
  854. // "machine_week_num"=> "35.23",
  855. // "break_day_num"=> 0,
  856. // "break_month_num"=> "210",
  857. // "break_week_num"=> "18",
  858. // "start_time"=> date("Y-m-d H:i:s",time()),
  859. // "day_num"=> 0,
  860. // "week_num"=> "2353",
  861. // "month_num"=> "6255",
  862. // "rate"=> 0
  863. // ],
  864. // [
  865. // "machine_day_num"=> "0",
  866. // "machine_month_num"=> "14.02",
  867. // "machine_week_num"=> "6.88",
  868. // "break_day_num"=> "0",
  869. // "break_month_num"=> "0",
  870. // "break_week_num"=> "0",
  871. // "start_time"=> date("Y-m-d H:i:s",time()),
  872. // "day_num"=> "0",
  873. // "week_num"=> "494",
  874. // "month_num"=> "3058",
  875. // "rate"=> "0"
  876. // ],
  877. // [
  878. // "machine_day_num"=> "4.77",
  879. // "machine_month_num"=> "149.14",
  880. // "machine_week_num"=> "56.72",
  881. // "break_day_num"=> "0",
  882. // "break_month_num"=> "0",
  883. // "break_week_num"=> "0",
  884. // "start_time"=> date("Y-m-d H:i:s",time()),
  885. // "day_num"=> "626",
  886. // "week_num"=> "4460",
  887. // "month_num"=> "13034",
  888. // "rate"=> "48"
  889. // ]
  890. // ];
  891. // return $this->json_return(200,'',$arr);
  892. // }
  893. //
  894. // public function work_order(Request $request){
  895. // $arr = [
  896. // "K23070127_1_8"=>[
  897. // "order_no"=>"SO202307270001",
  898. // "product_title"=>"银梨4号 AH68491-3油 科技木皮",
  899. // "procedure"=>"压贴",
  900. // "product_num"=>6,
  901. // "finish_num"=>0
  902. // ],
  903. // "K23070127_1_5"=>[
  904. // "order_no"=>"SO202307270002",
  905. // "product_title"=>"K4001K 科技木皮",
  906. // "procedure"=>"压贴",
  907. // "product_num"=>6,
  908. // "finish_num"=>0
  909. // ],
  910. // "K23070127_1_41"=>[
  911. // "order_no"=>"SO202307270003",
  912. // "product_title"=>"尤加利 AH53386-2-科技木皮",
  913. // "procedure"=>"压贴",
  914. // "product_num"=>6,
  915. // "finish_num"=>0
  916. // ],
  917. // "K23070127_1_40"=>[
  918. // "order_no"=>"SO202307270004",
  919. // "product_title"=>"混油橡木-2 科技木皮",
  920. // "procedure"=>"压贴",
  921. // "product_num"=>6,
  922. // "finish_num"=>0
  923. // ],
  924. // "K23070127_1_12"=>[
  925. // "order_no"=>"SO202307270005",
  926. // "product_title"=>"混油胡桃-2 科技木皮",
  927. // "procedure"=>"压贴",
  928. // "product_num"=>6,
  929. // "finish_num"=>0
  930. // ],
  931. // "K23070127_1_3"=>[
  932. // "order_no"=>"SO202307270006",
  933. // "product_title"=>"混油胡桃-3 科技木皮",
  934. // "procedure"=>"压贴",
  935. // "product_num"=>6,
  936. // "finish_num"=>0
  937. // ],
  938. // "K23070127_1_46"=>[
  939. // "order_no"=>"SO202307270007",
  940. // "product_title"=>"科技木2号科技木皮",
  941. // "procedure"=>"压贴",
  942. // "product_num"=>12,
  943. // "finish_num"=>0
  944. // ],
  945. // "K23070127_1_43"=>[
  946. // "order_no"=>"SO202307270008",
  947. // "product_title"=>"YC 71310-2油 半透胡桃3号 科技木皮",
  948. // "procedure"=>"压贴",
  949. // "product_num"=>12,
  950. // "finish_num"=>0
  951. // ],
  952. // "K23070127_1_39"=>[
  953. // "order_no"=>"SO202307270009",
  954. // "product_title"=>"科技木2号科技木皮",
  955. // "procedure"=>"压贴",
  956. // "product_num"=>12,
  957. // "finish_num"=>0
  958. // ],
  959. // "K23070127_1_36"=>[
  960. // "order_no"=>"SO202307270010",
  961. // "product_title"=>"90167-6橡木色1号 科技木皮",
  962. // "procedure"=>"压贴",
  963. // "product_num"=>12,
  964. // "finish_num"=>0
  965. // ],
  966. // "K23070127_1_37"=>[
  967. // "order_no"=>"SO202307270011",
  968. // "product_title"=>"YC 71310-2油 半透胡桃3号 科技木皮",
  969. // "procedure"=>"压贴",
  970. // "product_num"=>12,
  971. // "finish_num"=>0
  972. // ],
  973. // "K23070127_1_33"=>[
  974. // "order_no"=>"SO202307270012",
  975. // "product_title"=>"6293-70 科技木皮",
  976. // "procedure"=>"压贴",
  977. // "product_num"=>12,
  978. // "finish_num"=>0
  979. // ],
  980. // "K23070127_1_11"=>[
  981. // "order_no"=>"SO202307270013",
  982. // "product_title"=>"时光流离-6 科技木皮",
  983. // "procedure"=>"压贴",
  984. // "product_num"=>12,
  985. // "finish_num"=>0
  986. // ],
  987. // "K23070127_1_28"=>[
  988. // "order_no"=>"SO202307270014",
  989. // "product_title"=>"风调雨顺 科技木皮",
  990. // "procedure"=>"压贴",
  991. // "product_num"=>6,
  992. // "finish_num"=>0
  993. // ],
  994. // "K23070127_1_27"=>[
  995. // "order_no"=>"SO202307270015",
  996. // "product_title"=>"科技木3号科技木皮",
  997. // "procedure"=>"压贴",
  998. // "product_num"=>6,
  999. // "finish_num"=>0
  1000. // ],
  1001. // "K23070127_1_26"=>[
  1002. // "order_no"=>"SO202307270016",
  1003. // "product_title"=>"诗和远方-科技木皮",
  1004. // "procedure"=>"压贴",
  1005. // "product_num"=>6,
  1006. // "finish_num"=>0
  1007. // ],
  1008. // "K23070127_1_24"=>[
  1009. // "order_no"=>"SO202307270017",
  1010. // "product_title"=>"88036-1Y 银梨1007-7 -科技木皮",
  1011. // "procedure"=>"压贴",
  1012. // "product_num"=>6,
  1013. // "finish_num"=>0
  1014. // ],"K23070127_1_34"=>[
  1015. // "order_no"=>"SO202307270018",
  1016. // "product_title"=>"天使白小浮雕 -科技木皮",
  1017. // "procedure"=>"压贴",
  1018. // "product_num"=>61,
  1019. // "finish_num"=>0
  1020. // ],
  1021. // "K23070127_1_55"=>[
  1022. // "order_no"=>"SO202307270019",
  1023. // "product_title"=>"YC 71310-2油 半透胡桃3号 科技木皮",
  1024. // "procedure"=>"压贴",
  1025. // "product_num"=>6,
  1026. // "finish_num"=>0
  1027. // ],
  1028. // "K23070127_1_22"=>[
  1029. // "order_no"=>"SO202307270020",
  1030. // "product_title"=>"烟熏橡木 科技木皮",
  1031. // "procedure"=>"压贴",
  1032. // "product_num"=>12,
  1033. // "finish_num"=>0
  1034. // ],
  1035. // "K23070127_1_31"=>[
  1036. // "order_no"=>"SO202307270021",
  1037. // "product_title"=>"博尔诺胡桃-科技木皮",
  1038. // "procedure"=>"压贴",
  1039. // "product_num"=>12,
  1040. // "finish_num"=>0
  1041. // ],
  1042. // "K23070127_1_54"=>[
  1043. // "order_no"=>"SO202307270022",
  1044. // "product_title"=>"整装1号-科技木皮",
  1045. // "procedure"=>"压贴",
  1046. // "product_num"=>12,
  1047. // "finish_num"=>0
  1048. // ],
  1049. // ];
  1050. //
  1051. // return $this->json_return(200,'',$arr);
  1052. // }
  1053. //
  1054. // public function nu_work_order(Request $request){
  1055. // $arr = [
  1056. // "K23070127_1_8"=>[
  1057. // "order_no"=>"SO202307270001",
  1058. // "product_title"=>"银梨4号 AH68491-3油 科技木皮",
  1059. // "procedure"=>"压贴",
  1060. // "product_num"=>6,
  1061. // "finish_num"=>0
  1062. // ],
  1063. // "K23070127_1_5"=>[
  1064. // "order_no"=>"SO202307270002",
  1065. // "product_title"=>"K4001K 科技木皮",
  1066. // "procedure"=>"压贴",
  1067. // "product_num"=>6,
  1068. // "finish_num"=>0
  1069. // ],
  1070. // "K23070127_1_41"=>[
  1071. // "order_no"=>"SO202307270003",
  1072. // "product_title"=>"尤加利 AH53386-2-科技木皮",
  1073. // "procedure"=>"压贴",
  1074. // "product_num"=>6,
  1075. // "finish_num"=>0
  1076. // ],
  1077. // "K23070127_1_40"=>[
  1078. // "order_no"=>"SO202307270004",
  1079. // "product_title"=>"混油橡木-2 科技木皮",
  1080. // "procedure"=>"压贴",
  1081. // "product_num"=>6,
  1082. // "finish_num"=>0
  1083. // ],
  1084. // "K23070127_1_12"=>[
  1085. // "order_no"=>"SO202307270005",
  1086. // "product_title"=>"混油胡桃-2 科技木皮",
  1087. // "procedure"=>"压贴",
  1088. // "product_num"=>6,
  1089. // "finish_num"=>0
  1090. // ],
  1091. // "K23070127_1_3"=>[
  1092. // "order_no"=>"SO202307270006",
  1093. // "product_title"=>"混油胡桃-3 科技木皮",
  1094. // "procedure"=>"压贴",
  1095. // "product_num"=>6,
  1096. // "finish_num"=>0
  1097. // ],
  1098. // "K23070127_1_46"=>[
  1099. // "order_no"=>"SO202307270007",
  1100. // "product_title"=>"科技木2号科技木皮",
  1101. // "procedure"=>"压贴",
  1102. // "product_num"=>12,
  1103. // "finish_num"=>0
  1104. // ],
  1105. // "K23070127_1_43"=>[
  1106. // "order_no"=>"SO202307270008",
  1107. // "product_title"=>"YC 71310-2油 半透胡桃3号 科技木皮",
  1108. // "procedure"=>"压贴",
  1109. // "product_num"=>12,
  1110. // "finish_num"=>0
  1111. // ],
  1112. // "K23070127_1_39"=>[
  1113. // "order_no"=>"SO202307270009",
  1114. // "product_title"=>"科技木2号科技木皮",
  1115. // "procedure"=>"压贴",
  1116. // "product_num"=>12,
  1117. // "finish_num"=>0
  1118. // ],
  1119. // "K23070127_1_36"=>[
  1120. // "order_no"=>"SO202307270010",
  1121. // "product_title"=>"90167-6橡木色1号 科技木皮",
  1122. // "procedure"=>"压贴",
  1123. // "product_num"=>12,
  1124. // "finish_num"=>0
  1125. // ],
  1126. // "K23070127_1_37"=>[
  1127. // "order_no"=>"SO202307270011",
  1128. // "product_title"=>"YC 71310-2油 半透胡桃3号 科技木皮",
  1129. // "procedure"=>"压贴",
  1130. // "product_num"=>12,
  1131. // "finish_num"=>0
  1132. // ],
  1133. // "K23070127_1_33"=>[
  1134. // "order_no"=>"SO202307270012",
  1135. // "product_title"=>"6293-70 科技木皮",
  1136. // "procedure"=>"压贴",
  1137. // "product_num"=>12,
  1138. // "finish_num"=>0
  1139. // ],
  1140. // "K23070127_1_11"=>[
  1141. // "order_no"=>"SO202307270013",
  1142. // "product_title"=>"时光流离-6 科技木皮",
  1143. // "procedure"=>"压贴",
  1144. // "product_num"=>12,
  1145. // "finish_num"=>0
  1146. // ],
  1147. // "K23070127_1_28"=>[
  1148. // "order_no"=>"SO202307270014",
  1149. // "product_title"=>"风调雨顺 科技木皮",
  1150. // "procedure"=>"压贴",
  1151. // "product_num"=>6,
  1152. // "finish_num"=>0
  1153. // ],
  1154. // "K23070127_1_27"=>[
  1155. // "order_no"=>"SO202307270015",
  1156. // "product_title"=>"科技木3号科技木皮",
  1157. // "procedure"=>"压贴",
  1158. // "product_num"=>6,
  1159. // "finish_num"=>0
  1160. // ],
  1161. // "K23070127_1_26"=>[
  1162. // "order_no"=>"SO202307270016",
  1163. // "product_title"=>"诗和远方-科技木皮",
  1164. // "procedure"=>"压贴",
  1165. // "product_num"=>6,
  1166. // "finish_num"=>0
  1167. // ],
  1168. // "K23070127_1_24"=>[
  1169. // "order_no"=>"SO202307270017",
  1170. // "product_title"=>"88036-1Y 银梨1007-7 -科技木皮",
  1171. // "procedure"=>"压贴",
  1172. // "product_num"=>6,
  1173. // "finish_num"=>0
  1174. // ],"K23070127_1_34"=>[
  1175. // "order_no"=>"SO202307270018",
  1176. // "product_title"=>"天使白小浮雕 -科技木皮",
  1177. // "procedure"=>"压贴",
  1178. // "product_num"=>61,
  1179. // "finish_num"=>0
  1180. // ],
  1181. // "K23070127_1_55"=>[
  1182. // "order_no"=>"SO202307270019",
  1183. // "product_title"=>"YC 71310-2油 半透胡桃3号 科技木皮",
  1184. // "procedure"=>"压贴",
  1185. // "product_num"=>6,
  1186. // "finish_num"=>0
  1187. // ],
  1188. // "K23070127_1_22"=>[
  1189. // "order_no"=>"SO202307270020",
  1190. // "product_title"=>"烟熏橡木 科技木皮",
  1191. // "procedure"=>"压贴",
  1192. // "product_num"=>12,
  1193. // "finish_num"=>0
  1194. // ],
  1195. // "K23070127_1_31"=>[
  1196. // "order_no"=>"SO202307270021",
  1197. // "product_title"=>"博尔诺胡桃-科技木皮",
  1198. // "procedure"=>"压贴",
  1199. // "product_num"=>12,
  1200. // "finish_num"=>0
  1201. // ],
  1202. // "K23070127_1_54"=>[
  1203. // "order_no"=>"SO202307270022",
  1204. // "product_title"=>"整装1号-科技木皮",
  1205. // "procedure"=>"压贴",
  1206. // "product_num"=>12,
  1207. // "finish_num"=>0
  1208. // ],
  1209. // ];
  1210. // return $this->json_return(200,'',$arr);
  1211. // }
  1212. public function testFile(Request $request){
  1213. $data = $request->all();
  1214. $file = $request->file('file');
  1215. $filename = $this->uploadItemBillFile($file);
  1216. // 使用 'public' 磁盘驱动来获取文件路径
  1217. $filePath = Storage::disk('public')->path('big_tree/'.$filename);
  1218. $realPath = realpath($filePath);
  1219. $url = $data['url'];
  1220. $header = $data['header'];
  1221. $header = explode(',',$header);
  1222. $curl = curl_init();
  1223. curl_setopt_array($curl, array(
  1224. CURLOPT_URL => $url,
  1225. // CURLOPT_VERBOSE => true,
  1226. CURLOPT_RETURNTRANSFER => true,
  1227. CURLOPT_ENCODING => '',
  1228. CURLOPT_MAXREDIRS => 10,
  1229. CURLOPT_TIMEOUT => 0,
  1230. CURLOPT_FOLLOWLOCATION => true,
  1231. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  1232. CURLOPT_CUSTOMREQUEST => 'POST',
  1233. CURLOPT_POSTFIELDS => ['file' => new \CURLFile($realPath)],
  1234. // CURLOPT_HTTPHEADER => ["Content-Type:application/json;charset=UTF-8"],
  1235. ));
  1236. $response = curl_exec($curl);
  1237. // $info = curl_getinfo($curl);
  1238. curl_close($curl);
  1239. Storage::disk('public')->delete('big_tree\\'.$filename);
  1240. return $this->json_return(200,'',['data' => json_decode($response,true)]);
  1241. }
  1242. public function uploadItemBillFile($file){
  1243. // 获取文件相关信息
  1244. $ext = $file->getClientOriginalExtension(); // 扩展名
  1245. $realPath = $file->getRealPath(); //临时文件的绝对路径
  1246. $filename = $file->getClientOriginalName();//上传文件名
  1247. // 上传文件
  1248. // $file_name = time().rand(1000,9999);
  1249. // $filename = $file_name.'.' . $ext;
  1250. // 使用我们新建的uploads本地存储空间(目录)
  1251. Storage::disk('public')->put('big_tree/'.$filename, file_get_contents($realPath));
  1252. return $filename;
  1253. }
  1254. public function testaa(Request $request){
  1255. $data = $request->all();
  1256. $url = $data['url'];
  1257. $post = $data['post'];
  1258. $header = $data['header'];
  1259. $curl = curl_init();
  1260. $json = str_replace('"workflowSearchBean":{}','"workflowSearchBean":[]',json_encode($post));
  1261. $json = str_replace('"workflowSearchBean":[]','"workflowSearchBean":{}',json_encode($post));
  1262. file_put_contents('1.txt',$json);
  1263. curl_setopt_array($curl, array(
  1264. CURLOPT_URL => $url,
  1265. CURLOPT_RETURNTRANSFER => true,
  1266. CURLOPT_ENCODING => '',
  1267. CURLOPT_MAXREDIRS => 10,
  1268. CURLOPT_TIMEOUT => 0,
  1269. CURLOPT_FOLLOWLOCATION => true,
  1270. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  1271. CURLOPT_CUSTOMREQUEST => 'POST',
  1272. CURLOPT_POSTFIELDS => $json,
  1273. CURLOPT_HTTPHEADER => $header,
  1274. ));
  1275. $response = curl_exec($curl);
  1276. curl_close($curl);
  1277. return $this->json_return(200,'',json_decode($response,true));
  1278. }
  1279. public function testa(Request $request){
  1280. $data = $request->all();
  1281. $url = $data['url'];
  1282. $header = $data['header'];
  1283. $curl = curl_init();
  1284. curl_setopt_array($curl, array(
  1285. CURLOPT_URL => $url,
  1286. CURLOPT_RETURNTRANSFER => true,
  1287. CURLOPT_ENCODING => '',
  1288. CURLOPT_MAXREDIRS => 10,
  1289. CURLOPT_TIMEOUT => 0,
  1290. CURLOPT_FOLLOWLOCATION => true,
  1291. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  1292. CURLOPT_CUSTOMREQUEST => 'GET',
  1293. CURLOPT_HTTPHEADER => $header,
  1294. ));
  1295. $response = curl_exec($curl);
  1296. curl_close($curl);
  1297. return $this->json_return(200,'',json_decode($response,true));
  1298. }
  1299. public function testaa1(Request $request){
  1300. $curl = curl_init();
  1301. curl_setopt_array($curl, array(
  1302. CURLOPT_URL => 'http://121.36.142.167:7774/jbl/api/module-data/team_list/page',
  1303. CURLOPT_RETURNTRANSFER => true,
  1304. CURLOPT_ENCODING => '',
  1305. CURLOPT_MAXREDIRS => 10,
  1306. CURLOPT_TIMEOUT => 0,
  1307. CURLOPT_FOLLOWLOCATION => true,
  1308. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  1309. CURLOPT_CUSTOMREQUEST => 'POST',
  1310. CURLOPT_POSTFIELDS =>'{"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"team","developmentSystemId":null,"debugFlag":true}',
  1311. CURLOPT_HTTPHEADER => array(
  1312. 'Content-Sign: 88cb27fd67215452422c18f3ed71028e',
  1313. 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MTUwODMxfQ.1_Adx5tdReisZdgyyQfBjU4VCXzGDKNiztJ-WjPlZ3bG0EQHzcKZs7Pi0yk2xxQn1XWp0dNVHqUPbTMpkEU1aA',
  1314. 'Content-Type: application/json',
  1315. ),
  1316. ));
  1317. $response = curl_exec($curl);
  1318. curl_close($curl);
  1319. echo $response;
  1320. }
  1321. public function testapp(){
  1322. $curl=curl_init();
  1323. curl_setopt_array($curl,array(
  1324. CURLOPT_URL=>'http://121.36.142.167:7774/jbl/api/module-data/dispatch_orders/page',
  1325. CURLOPT_RETURNTRANSFER=>true,
  1326. CURLOPT_ENCODING=>'',
  1327. CURLOPT_MAXREDIRS=>10,
  1328. CURLOPT_TIMEOUT=>0,
  1329. CURLOPT_FOLLOWLOCATION=>true,
  1330. CURLOPT_HTTP_VERSION=>CURL_HTTP_VERSION_1_1,
  1331. CURLOPT_CUSTOMREQUEST=>'POST',
  1332. CURLOPT_POSTFIELDS=>'{"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[{"field":"dispatch_orders.dispatch_no","option":"LIKE_ANYWHERE","values":["PG2023081400027"]},{"field":"product_no","option":"LIKE_ANYWHERE","values":["BC030101000001"]}],"size":15,"specialConditions":[],"workflowSearchBean":{},"dynamicFormCode":"dispatch_orders","dynamicFormTable":null,"ignoreField":true,"developmentSystemId":null,"debugFlag":true}',
  1333. CURLOPT_HTTPHEADER=>array(
  1334. 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOLFJPTEVfSU5URVJGQUNFIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0Njc0MTE0fQ.L3Di3K_cpF0rWSgvzbcLufLm8bkCxd3Y-xudfKzSm4F-qdpDr0hYWWQP5K5BYTNuZnu4tWpGmSW2KRHU0pjt-A',
  1335. 'Content-Type:application/json',
  1336. ),
  1337. ));
  1338. $response=curl_exec($curl);
  1339. curl_close($curl);
  1340. dump(json_decode($response,true));die;
  1341. $str = '{"result":[{"id":121,"finished_num":0,"dispatch_quantity":100,"out_order_no_time":"1691683200","process_id":9,"dispatch_no":"20230811001","order_product_id":119,"sale_orders_product_id":4499,"order_no":"2023081116917417502029","product_no":"00031412","product_title":"\u65b0\u897f\u5170\u677e","price":"10.0000000000","customer_name":"\u6c5f\u897f\u5fb7\u514b\u65af\u8bfa\uff08\u4e0a\u6d77\u5ba6\u821f\u53a8\u5177\u6709\u9650\u516c\u53f8\uff09"}],"data":{"id":[121],"quantity":["10"],"team_id":[68],"equipment_id":[8],"waste":[[]],"finish_id":[0]}}';
  1342. $data = json_decode($str,true);
  1343. list($status,$msg) = (new FinishedOrderService())->addInJob($data['result'],$data['data']);
  1344. dump($msg);die;
  1345. }
  1346. public function te(){dump(222);die;
  1347. $query = DB::table('orders_product_bom_process_202301_03 as bom')
  1348. ->join('orders_product as op', function ($join) {
  1349. $join->on('op.order_no', '=', 'bom.order_no')
  1350. ->on('op.product_no', '=', 'bom.product_no')
  1351. ->on('op.out_order_no', '=', 'bom.out_order_no');
  1352. })
  1353. ->where('bom.order_product_id', 4461)
  1354. ->orderBy('bom.id','asc')
  1355. ->select('bom.id','op.id as oid')
  1356. ->chunk(10, function ($results) {dump($results);die;
  1357. foreach ($results as $result) {
  1358. // 处理每个分块的数据
  1359. $id = $result->id;
  1360. $orderProductId = $result->order_product_id;
  1361. $oid = $result->oid;
  1362. // 在这里进行你的逻辑处理
  1363. }
  1364. });
  1365. }
  1366. }