TestController.php 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439
  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. $url = $data['url'];
  1219. $header = $data['header'];
  1220. $header = explode(',',$header);
  1221. $curl = curl_init();
  1222. curl_setopt_array($curl, array(
  1223. CURLOPT_URL => $url,
  1224. CURLOPT_RETURNTRANSFER => true,
  1225. CURLOPT_ENCODING => '',
  1226. CURLOPT_MAXREDIRS => 10,
  1227. CURLOPT_TIMEOUT => 0,
  1228. CURLOPT_FOLLOWLOCATION => true,
  1229. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  1230. CURLOPT_CUSTOMREQUEST => 'POST',
  1231. CURLOPT_POSTFIELDS => ['file' => new \CURLFile($filePath)],
  1232. // CURLOPT_HTTPHEADER => $header,
  1233. ));
  1234. $response = curl_exec($curl);
  1235. curl_close($curl);
  1236. Storage::disk('public')->delete('big_tree\\'.$filename);
  1237. return $this->json_return(200,'',json_decode($response,true));
  1238. }
  1239. public function uploadItemBillFile($file){
  1240. // 获取文件相关信息
  1241. $ext = $file->getClientOriginalExtension(); // 扩展名
  1242. $realPath = $file->getRealPath(); //临时文件的绝对路径
  1243. // 上传文件
  1244. $file_name = time().rand(1000,9999);
  1245. $filename = $file_name.'.' . $ext;
  1246. // 使用我们新建的uploads本地存储空间(目录)
  1247. Storage::disk('public')->put('big_tree/'.$filename, file_get_contents($realPath));
  1248. return $file_name. '.' .$ext;
  1249. }
  1250. public function testaa(Request $request){
  1251. $data = $request->all();
  1252. $url = $data['url'];
  1253. $post = $data['post'];
  1254. $header = $data['header'];
  1255. $curl = curl_init();
  1256. $json = str_replace('"workflowSearchBean":{}','"workflowSearchBean":[]',json_encode($post));
  1257. $json = str_replace('"workflowSearchBean":[]','"workflowSearchBean":{}',json_encode($post));
  1258. file_put_contents('1.txt',$json);
  1259. curl_setopt_array($curl, array(
  1260. CURLOPT_URL => $url,
  1261. CURLOPT_RETURNTRANSFER => true,
  1262. CURLOPT_ENCODING => '',
  1263. CURLOPT_MAXREDIRS => 10,
  1264. CURLOPT_TIMEOUT => 0,
  1265. CURLOPT_FOLLOWLOCATION => true,
  1266. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  1267. CURLOPT_CUSTOMREQUEST => 'POST',
  1268. CURLOPT_POSTFIELDS => $json,
  1269. CURLOPT_HTTPHEADER => $header,
  1270. ));
  1271. $response = curl_exec($curl);
  1272. curl_close($curl);
  1273. return $this->json_return(200,'',json_decode($response,true));
  1274. }
  1275. public function testa(Request $request){
  1276. $data = $request->all();
  1277. $url = $data['url'];
  1278. $header = $data['header'];
  1279. $curl = curl_init();
  1280. curl_setopt_array($curl, array(
  1281. CURLOPT_URL => $url,
  1282. CURLOPT_RETURNTRANSFER => true,
  1283. CURLOPT_ENCODING => '',
  1284. CURLOPT_MAXREDIRS => 10,
  1285. CURLOPT_TIMEOUT => 0,
  1286. CURLOPT_FOLLOWLOCATION => true,
  1287. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  1288. CURLOPT_CUSTOMREQUEST => 'GET',
  1289. CURLOPT_HTTPHEADER => $header,
  1290. ));
  1291. $response = curl_exec($curl);
  1292. curl_close($curl);
  1293. return $this->json_return(200,'',json_decode($response,true));
  1294. }
  1295. public function testaa1(Request $request){
  1296. $curl = curl_init();
  1297. curl_setopt_array($curl, array(
  1298. CURLOPT_URL => 'http://121.36.142.167:7774/jbl/api/module-data/team_list/page',
  1299. CURLOPT_RETURNTRANSFER => true,
  1300. CURLOPT_ENCODING => '',
  1301. CURLOPT_MAXREDIRS => 10,
  1302. CURLOPT_TIMEOUT => 0,
  1303. CURLOPT_FOLLOWLOCATION => true,
  1304. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  1305. CURLOPT_CUSTOMREQUEST => 'POST',
  1306. CURLOPT_POSTFIELDS =>'{"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[],"size":15,"specialConditions":[],"dynamicFormCode":"team","developmentSystemId":null,"debugFlag":true}',
  1307. CURLOPT_HTTPHEADER => array(
  1308. 'Content-Sign: 88cb27fd67215452422c18f3ed71028e',
  1309. 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0MTUwODMxfQ.1_Adx5tdReisZdgyyQfBjU4VCXzGDKNiztJ-WjPlZ3bG0EQHzcKZs7Pi0yk2xxQn1XWp0dNVHqUPbTMpkEU1aA',
  1310. 'Content-Type: application/json',
  1311. ),
  1312. ));
  1313. $response = curl_exec($curl);
  1314. curl_close($curl);
  1315. echo $response;
  1316. }
  1317. public function testapp(){
  1318. $curl=curl_init();
  1319. curl_setopt_array($curl,array(
  1320. CURLOPT_URL=>'http://121.36.142.167:7774/jbl/api/module-data/dispatch_orders/page',
  1321. CURLOPT_RETURNTRANSFER=>true,
  1322. CURLOPT_ENCODING=>'',
  1323. CURLOPT_MAXREDIRS=>10,
  1324. CURLOPT_TIMEOUT=>0,
  1325. CURLOPT_FOLLOWLOCATION=>true,
  1326. CURLOPT_HTTP_VERSION=>CURL_HTTP_VERSION_1_1,
  1327. CURLOPT_CUSTOMREQUEST=>'POST',
  1328. 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}',
  1329. CURLOPT_HTTPHEADER=>array(
  1330. 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOLFJPTEVfSU5URVJGQUNFIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0Njc0MTE0fQ.L3Di3K_cpF0rWSgvzbcLufLm8bkCxd3Y-xudfKzSm4F-qdpDr0hYWWQP5K5BYTNuZnu4tWpGmSW2KRHU0pjt-A',
  1331. 'Content-Type:application/json',
  1332. ),
  1333. ));
  1334. $response=curl_exec($curl);
  1335. curl_close($curl);
  1336. dump(json_decode($response,true));die;
  1337. $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]}}';
  1338. $data = json_decode($str,true);
  1339. list($status,$msg) = (new FinishedOrderService())->addInJob($data['result'],$data['data']);
  1340. dump($msg);die;
  1341. }
  1342. public function te(){dump(222);die;
  1343. $query = DB::table('orders_product_bom_process_202301_03 as bom')
  1344. ->join('orders_product as op', function ($join) {
  1345. $join->on('op.order_no', '=', 'bom.order_no')
  1346. ->on('op.product_no', '=', 'bom.product_no')
  1347. ->on('op.out_order_no', '=', 'bom.out_order_no');
  1348. })
  1349. ->where('bom.order_product_id', 4461)
  1350. ->orderBy('bom.id','asc')
  1351. ->select('bom.id','op.id as oid')
  1352. ->chunk(10, function ($results) {dump($results);die;
  1353. foreach ($results as $result) {
  1354. // 处理每个分块的数据
  1355. $id = $result->id;
  1356. $orderProductId = $result->order_product_id;
  1357. $oid = $result->oid;
  1358. // 在这里进行你的逻辑处理
  1359. }
  1360. });
  1361. }
  1362. }