TestController.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use App\Model\BoxDetail;
  4. use App\Service\MeasureService;
  5. use Illuminate\Http\Request;
  6. use Illuminate\Support\Facades\DB;
  7. class TestController extends BaseController
  8. {
  9. public function aa(){
  10. $data = [
  11. 'out_order_no' => 'test123',
  12. 'top_id' => '1',
  13. 'ext_1' => '1',
  14. 'ext_2' => '2',
  15. 'ext_3' => '3',
  16. 'ext_4' => '4',
  17. 'ext_5' => '5',
  18. 'detail' => [
  19. [
  20. 'top_id' => '1',
  21. 'code' => '001',
  22. 'title' => '产品名称',
  23. 'ext_1' => '1',
  24. 'ext_2' => '2',
  25. 'ext_3' => '3',
  26. 'ext_4' => '4',
  27. 'ext_5' => '5',
  28. ],[
  29. 'top_id' => '2',
  30. 'code' => '002',
  31. 'title' => '产品名称1',
  32. 'ext_1' => '11',
  33. 'ext_2' => '22',
  34. 'ext_3' => '33',
  35. 'ext_4' => '44',
  36. 'ext_5' => '55',
  37. ],
  38. ],
  39. ];
  40. var_dump(json_encode($data));die;
  41. $service = BoxHookService::getInstance();
  42. list($status,$msg) = $service->boxInsert($data);
  43. var_dump($status);
  44. var_dump($msg);
  45. }
  46. // public function aa(){
  47. // $service = BoxHookService::getInstance();
  48. //
  49. // list($status,$msg) = $service->boxDetail(['order_no'=>'202306130543108902']);
  50. // var_dump($status);
  51. // var_dump($msg);
  52. // }
  53. public function testData(Request $request){
  54. date_default_timezone_set('PRC');
  55. $arr = ['title' => json_encode($request->all()),
  56. 'crt_time' => date('Y-m-d H:i:s')
  57. ];
  58. DB::table('test_shebei')->insert($arr);
  59. // DB::table('test_shebei')->insert(['title' => '2223354']);
  60. }
  61. public function order_process1(Request $request) {
  62. $arr = [
  63. 0 => ['Code' => "S23070197", 'CustomerName' => "方侦涛", 'rate' => 20],
  64. 1 => ['Code' => "S23070196", 'CustomerName' => "杭州速方", 'rate' => 20],
  65. 2 => ['Code' => "S23070194", 'CustomerName' => "杭州速方", 'rate' => 19],
  66. 3 => ['Code' => "S23070193", 'CustomerName' => "方侦涛", 'rate' => 19],
  67. 4 => ['Code' => "S23070180", 'CustomerName' => "杭州速方", 'rate' => 16],
  68. 5 => ['Code' => "S23070179", 'CustomerName' => "杭州速方", 'rate' => 16],
  69. 6 => ['Code' => "S23070178", 'CustomerName' => "杭州速方", 'rate' => 16],
  70. 7 => ['Code' => "S23070177", 'CustomerName' => "杭州速方", 'rate' => 16],
  71. 8 => ['Code' => "S23070176", 'CustomerName' => "杭州速方", 'rate' => 16],
  72. 9 => ['Code' => "S23070175", 'CustomerName' => "杭州速方", 'rate' => 15],
  73. 10 => ['Code' => "S23070174", 'CustomerName' => "杭州速方", 'rate' => 15],
  74. 11 => ['Code' => "S23070173", 'CustomerName' => "杭州速方", 'rate' => 15],
  75. 12 => ['Code' => "S23070172", 'CustomerName' => "杭州速方", 'rate' => 15],
  76. 13 => ['Code' => "S23070171", 'CustomerName' => "杭州速方", 'rate' => 15],
  77. 14 => ['Code' => "S23070170", 'CustomerName' => "杭州速方", 'rate' => 15],
  78. 15 => ['Code' => "S23070169", 'CustomerName' => "杭州速方", 'rate' => 14],
  79. 16 => ['Code' => "S23070144", 'CustomerName' => "方侦涛", 'rate' => 88],
  80. 17 => ['Code' => "S23070142", 'CustomerName' => "王玉", 'rate' => 84],
  81. 18 => ['Code' => "S23070141", 'CustomerName' => "王玉", 'rate' => 82],
  82. 19 => ['Code' => "S23070136", 'CustomerName' => "杭州速方", 'rate' => 72],
  83. 20 => ['Code' => "S23070135", 'CustomerName' => "杭州速方", 'rate' => 70],
  84. 21 => ['Code' => "S23070133", 'CustomerName' => "杭州速方", 'rate' => 66],
  85. 22 => ['Code' => "S23070126", 'CustomerName' => "杭州速方", 'rate' => 52],
  86. 23 => ['Code' => "S23070125", 'CustomerName' => "杭州速方", 'rate' => 50],
  87. 24 => ['Code' => "S23070124", 'CustomerName' => "王玉", 'rate' => 48],
  88. 25 => ['Code' => "S23070122", 'CustomerName' => "方侦涛", 'rate' => 44],
  89. 26 => ['Code' => "S23070120", 'CustomerName' => "杭州速方", 'rate' => 40],
  90. 27 => ['Code' => "S23070115", 'CustomerName' => "杭州速方", 'rate' => 30],
  91. 28 => ['Code' => "S23070114", 'CustomerName' => "杭州速方", 'rate' => 29],
  92. 29 => ['Code' => "S23070113", 'CustomerName' => "方侦涛", 'rate' => 26],
  93. 30 => ['Code' => "S23070109", 'CustomerName' => "方侦涛", 'rate' => 18],
  94. ];
  95. return $this->json_return(200,'',$arr);
  96. }
  97. public function project_region(Request $request){
  98. $arr = [
  99. "all_num" => 2373,
  100. "num" => 188,
  101. ];
  102. return $this->json_return(200,'',$arr);
  103. }
  104. public function output_value_month1(Request $request){
  105. $arr = [
  106. [
  107. "value"=> "2023-01-01",
  108. "num"=> "0"
  109. ],
  110. [
  111. "value"=> "2023-01-02",
  112. "num"=> "0"
  113. ],
  114. [
  115. "value"=> "2023-01-03",
  116. "num"=> "0"
  117. ],
  118. [
  119. "value"=> "2023-01-04",
  120. "num"=> "0"
  121. ],
  122. [
  123. "value"=> "2023-01-05",
  124. "num"=> "0",
  125. ],
  126. ["num" => 0]
  127. ];
  128. return $this->json_return(200,'',$arr);
  129. }
  130. public function output_value_efficiency(Request $request){
  131. $arr = [
  132. [
  133. "time"=> "2023-01-01",
  134. "output"=> "0"
  135. ],
  136. [
  137. "time"=> "2023-01-02",
  138. "output"=> "0"
  139. ],
  140. [
  141. "time"=> "2023-01-03",
  142. "output"=> "2711"
  143. ],
  144. [
  145. "time"=> "2023-01-04",
  146. "output"=> "2239"
  147. ],
  148. [
  149. "time"=> "2023-01-05",
  150. "output"=> "1101"
  151. ],
  152. [
  153. "output"=> 0
  154. ]
  155. ];
  156. return $this->json_return(200,'',$arr);
  157. }
  158. public function capacity(Request $request){
  159. $arr = [
  160. [
  161. [
  162. "title"=> "直贴",
  163. "rate"=> "70"
  164. ],
  165. [
  166. "title"=> "包装",
  167. "rate"=> "50"
  168. ]
  169. ],
  170. ];
  171. return $this->json_return(200,'',['data' => $arr]);
  172. }
  173. public function product_num(Request $request){
  174. $arr = [
  175. [
  176. "machine_day_num"=> "4903.69",
  177. "machine_month_num"=> "139.64",
  178. "machine_week_num"=> "47.21",
  179. "break_day_num"=> "0",
  180. "break_month_num"=> "10",
  181. "break_week_num"=> "3",
  182. "start_time"=> date("Y-m-d H:i:s",time()),
  183. "day_num"=> "766",
  184. "week_num"=> "4598",
  185. "month_num"=> "14489",
  186. "rate"=> "72"
  187. ],
  188. [
  189. "machine_day_num"=> "469591.19",
  190. "machine_month_num"=> "107.03",
  191. "machine_week_num"=> "35.23",
  192. "break_day_num"=> 0,
  193. "break_month_num"=> "210",
  194. "break_week_num"=> "18",
  195. "start_time"=> date("Y-m-d H:i:s",time()),
  196. "day_num"=> 0,
  197. "week_num"=> "2353",
  198. "month_num"=> "6255",
  199. "rate"=> 0
  200. ],
  201. [
  202. "machine_day_num"=> "0",
  203. "machine_month_num"=> "14.02",
  204. "machine_week_num"=> "6.88",
  205. "break_day_num"=> "0",
  206. "break_month_num"=> "0",
  207. "break_week_num"=> "0",
  208. "start_time"=> date("Y-m-d H:i:s",time()),
  209. "day_num"=> "0",
  210. "week_num"=> "494",
  211. "month_num"=> "3058",
  212. "rate"=> "0"
  213. ],
  214. [
  215. "machine_day_num"=> "4903.77",
  216. "machine_month_num"=> "149.14",
  217. "machine_week_num"=> "56.72",
  218. "break_day_num"=> "0",
  219. "break_month_num"=> "0",
  220. "break_week_num"=> "0",
  221. "start_time"=> date("Y-m-d H:i:s",time()),
  222. "day_num"=> "626",
  223. "week_num"=> "4460",
  224. "month_num"=> "13034",
  225. "rate"=> "48"
  226. ]
  227. ];
  228. return $this->json_return(200,'',$arr);
  229. }
  230. public function work_order(Request $request){
  231. $arr = [
  232. "K23070127_1_8"=>[
  233. "order_no"=>"K23070127",
  234. "product_title"=>"单开门",
  235. "procedure"=>"四边锯清边",
  236. "product_num"=>6,
  237. "finish_num"=>0
  238. ],
  239. "K23070127_1_5"=>[
  240. "order_no"=>"K23070127",
  241. "product_title"=>"单开门",
  242. "procedure"=>"压门",
  243. "product_num"=>6,
  244. "finish_num"=>0
  245. ],
  246. "K23070127_1_41"=>[
  247. "order_no"=>"K23070127",
  248. "product_title"=>"单开门",
  249. "procedure"=>"凹槽喷漆",
  250. "product_num"=>6,
  251. "finish_num"=>0
  252. ],
  253. "K23070127_1_40"=>[
  254. "order_no"=>"K23070127",
  255. "product_title"=>"单开门",
  256. "procedure"=>"凹槽刷漆",
  257. "product_num"=>6,
  258. "finish_num"=>0
  259. ],
  260. "K23070127_1_12"=>[
  261. "order_no"=>"K23070127",
  262. "product_title"=>"单开门",
  263. "procedure"=>"雕刻",
  264. "product_num"=>6,
  265. "finish_num"=>0
  266. ],
  267. "K23070127_1_3"=>[
  268. "order_no"=>"K23070127",
  269. "product_title"=>"单开门",
  270. "procedure"=>"电子锯开料",
  271. "product_num"=>6,
  272. "finish_num"=>0
  273. ],
  274. "K23070127_1_46"=>[
  275. "order_no"=>"K23070127",
  276. "product_title"=>"单开门",
  277. "procedure"=>"发货",
  278. "product_num"=>12,
  279. "finish_num"=>0
  280. ],
  281. "K23070127_1_43"=>[
  282. "order_no"=>"K23070127",
  283. "product_title"=>"单开门",
  284. "procedure"=>"包装",
  285. "product_num"=>12,
  286. "finish_num"=>0
  287. ],
  288. "K23070127_1_39"=>[
  289. "order_no"=>"K23070127",
  290. "product_title"=>"单开门",
  291. "procedure"=>"面检",
  292. "product_num"=>12,
  293. "finish_num"=>0
  294. ],
  295. "K23070127_1_36"=>[
  296. "order_no"=>"K23070127",
  297. "product_title"=>"单开门",
  298. "procedure"=>"面漆",
  299. "product_num"=>12,
  300. "finish_num"=>0
  301. ],
  302. "K23070127_1_37"=>[
  303. "order_no"=>"K23070127",
  304. "product_title"=>"单开门",
  305. "procedure"=>"底检",
  306. "product_num"=>12,
  307. "finish_num"=>0
  308. ],
  309. "K23070127_1_33"=>[
  310. "order_no"=>"K23070127",
  311. "product_title"=>"单开门",
  312. "procedure"=>"打磨",
  313. "product_num"=>12,
  314. "finish_num"=>0
  315. ],
  316. "K23070127_1_11"=>[
  317. "order_no"=>"K23070127",
  318. "product_title"=>"单开门",
  319. "procedure"=>"配套质检",
  320. "product_num"=>12,
  321. "finish_num"=>0
  322. ],
  323. "K23070127_1_28"=>[
  324. "order_no"=>"K23070127",
  325. "product_title"=>"单开门",
  326. "procedure"=>"订背面条",
  327. "product_num"=>6,
  328. "finish_num"=>0
  329. ],
  330. "K23070127_1_27"=>[
  331. "order_no"=>"K23070127",
  332. "product_title"=>"单开门",
  333. "procedure"=>"组装",
  334. "product_num"=>6,
  335. "finish_num"=>0
  336. ],
  337. "K23070127_1_26"=>[
  338. "order_no"=>"K23070127",
  339. "product_title"=>"单开门",
  340. "procedure"=>"开横板启口",
  341. "product_num"=>6,
  342. "finish_num"=>0
  343. ],
  344. "K23070127_1_24"=>[
  345. "order_no"=>"K23070127",
  346. "product_title"=>"单开门",
  347. "procedure"=>"开组装槽",
  348. "product_num"=>6,
  349. "finish_num"=>0
  350. ],
  351. "K23070127_1_10"=>[
  352. "order_no"=>"K23070127",
  353. "product_title"=>"单开门",
  354. "procedure"=>"UV",
  355. "product_num"=>12,
  356. "finish_num"=>0
  357. ],
  358. "K23070127_1_7"=>[
  359. "order_no"=>"K23070127",
  360. "product_title"=>"单开门",
  361. "procedure"=>"封边",
  362. "product_num"=>12,
  363. "finish_num"=>0
  364. ],
  365. "K23070127_1_23"=>[
  366. "order_no"=>"K23070127",
  367. "product_title"=>"单开门",
  368. "procedure"=>"数控开料",
  369. "product_num"=>6,
  370. "finish_num"=>0
  371. ],
  372. "K23070127_4_46"=>[
  373. "order_no"=>"K23070127",
  374. "product_title"=>"双垭口",
  375. "procedure"=>"发货",
  376. "product_num"=>1,
  377. "finish_num"=>0
  378. ]
  379. ];
  380. return $this->json_return(200,'',$arr);
  381. }
  382. public function nu_work_order(Request $request){
  383. $arr = [
  384. "K23070188_1_28"=>[
  385. "order_no"=>"K23070188",
  386. "product_title"=>"单开门",
  387. "procedure"=>"订背面条",
  388. "product_num"=>8
  389. ],
  390. "K23070188_1_27"=>[
  391. "order_no"=>"K23070188",
  392. "product_title"=>"单开门",
  393. "procedure"=>"组装",
  394. "product_num"=>8
  395. ],
  396. "K23070188_1_26"=>[
  397. "order_no"=>"K23070188",
  398. "product_title"=>"单开门",
  399. "procedure"=>"开横板启口",
  400. "product_num"=>8
  401. ],
  402. "K23070188_1_24"=>[
  403. "order_no"=>"K23070188",
  404. "product_title"=>"单开门",
  405. "procedure"=>"开组装槽",
  406. "product_num"=>8
  407. ],
  408. "K23070188_1_23"=>[
  409. "order_no"=>"K23070188",
  410. "product_title"=>"单开门",
  411. "procedure"=>"数控开料",
  412. "product_num"=>8
  413. ],
  414. "K23070188_1_46"=>[
  415. "order_no"=>"K23070188",
  416. "product_title"=>"单开门",
  417. "procedure"=>"发货",
  418. "product_num"=>16
  419. ],
  420. "K23070188_1_43"=>[
  421. "order_no"=>"K23070188",
  422. "product_title"=>"单开门",
  423. "procedure"=>"包装",
  424. "product_num"=>16
  425. ],
  426. "K23070188_1_39"=>[
  427. "order_no"=>"K23070188",
  428. "product_title"=>"单开门",
  429. "procedure"=>"面检",
  430. "product_num"=>16
  431. ],
  432. "K23070188_1_36"=>[
  433. "order_no"=>"K23070188",
  434. "product_title"=>"单开门",
  435. "procedure"=>"面漆",
  436. "product_num"=>16
  437. ],
  438. "K23070188_1_35"=>[
  439. "order_no"=>"K23070188",
  440. "product_title"=>"单开门",
  441. "procedure"=>"底漆",
  442. "product_num"=>16
  443. ],
  444. "K23070188_1_37"=>[
  445. "order_no"=>"K23070188",
  446. "product_title"=>"单开门",
  447. "procedure"=>"底检",
  448. "product_num"=>16
  449. ],
  450. "K23070188_1_33"=>[
  451. "order_no"=>"K23070188",
  452. "product_title"=>"单开门",
  453. "procedure"=>"打磨",
  454. "product_num"=>16
  455. ],
  456. "K23070188_1_11"=>[
  457. "order_no"=>"K23070188",
  458. "product_title"=>"单开门",
  459. "procedure"=>"配套质检",
  460. "product_num"=>16
  461. ],
  462. "K23070188_1_7"=>[
  463. "order_no"=>"K23070188",
  464. "product_title"=>"单开门",
  465. "procedure"=>"封边",
  466. "product_num"=>16
  467. ],
  468. "K23070188_1_8"=>[
  469. "order_no"=>"K23070188",
  470. "product_title"=>"单开门",
  471. "procedure"=>"四边锯清边",
  472. "product_num"=>8
  473. ],
  474. "K23070188_1_5"=>[
  475. "order_no"=>"K23070188",
  476. "product_title"=>"单开门",
  477. "procedure"=>"压门",
  478. "product_num"=>8
  479. ],
  480. "D22120382_1_7" => [
  481. "order_no"=> "D22120382",
  482. "product_title"=>"单开门",
  483. "procedure"=>"封边",
  484. "product_num"=>4
  485. ],
  486. "D22120382_1_11" => [
  487. "order_no"=>"D22120382",
  488. "product_title"=>"单开门",
  489. "procedure"=>"四边锯清边",
  490. "product_num"=>2
  491. ],
  492. "D22120382_1_24" => [
  493. "order_no"=>"D22120382",
  494. "product_title"=>"单开门",
  495. "procedure"=>"开组装槽",
  496. "product_num"=>2
  497. ],
  498. "D22120382_1_26" =>[
  499. "order_no"=>"D22120382",
  500. "product_title"=>"单开门",
  501. "procedure"=>"开横板启口",
  502. "product_num"=>2
  503. ],
  504. ];
  505. return $this->json_return(200,'',$arr);
  506. }
  507. }