ReportFormsController.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use App\Model\SystemL;
  4. use App\Service\EquipmentService;
  5. use App\Service\ReportFormsService;
  6. use Illuminate\Http\Request;
  7. class ReportFormsController extends BaseController
  8. {
  9. //生产进度
  10. public function productionReport(Request $request){
  11. $service = new ReportFormsService();
  12. list($status,$data) = $service->productionReport($request->all());
  13. if($status){
  14. return $this->json_return(200,'',$data);
  15. }else{
  16. return $this->json_return(201,$data);
  17. }
  18. }
  19. //班组
  20. public function teamReport(Request $request){
  21. $service = new ReportFormsService();
  22. list($status,$data) = $service->teamReport($request->all());
  23. if($status){
  24. return $this->json_return(200,'',$data);
  25. }else{
  26. return $this->json_return(201,$data);
  27. }
  28. }
  29. //班组 详情
  30. public function teamReportDetail(Request $request){
  31. $service = new ReportFormsService();
  32. list($status,$data) = $service->teamReportDetail($request->all());
  33. if($status){
  34. return $this->json_return(200,'',$data);
  35. }else{
  36. return $this->json_return(201,$data);
  37. }
  38. }
  39. public function badGoodsReason(Request $request){
  40. $service = new ReportFormsService();
  41. list($status,$data) = $service->badGoodsReason($request->all());
  42. if($status){
  43. return $this->json_return(200,'',$data);
  44. }else{
  45. return $this->json_return(201,$data);
  46. }
  47. }
  48. //不良品
  49. public function badGoodsReport(Request $request){
  50. $service = new ReportFormsService();
  51. list($status,$data) = $service->badGoodsReport($request->all());
  52. if($status){
  53. return $this->json_return(200,'',$data);
  54. }else{
  55. return $this->json_return(201,$data);
  56. }
  57. }
  58. //不良品 详情
  59. public function badGoodsReportDetail(Request $request){
  60. $service = new ReportFormsService();
  61. list($status,$data) = $service->badGoodsReportDetail($request->all());
  62. if($status){
  63. return $this->json_return(200,'',$data);
  64. }else{
  65. return $this->json_return(201,$data);
  66. }
  67. }
  68. //不良品原因
  69. public function badGoodsReasonReport(Request $request){
  70. $service = new ReportFormsService();
  71. list($status,$data) = $service->badGoodsReasonReport($request->all());
  72. if($status){
  73. return $this->json_return(200,'',$data);
  74. }else{
  75. return $this->json_return(201,$data);
  76. }
  77. }
  78. //不良品原因详情
  79. public function badGoodsReasonReportDetail(Request $request){
  80. $service = new ReportFormsService();
  81. list($status,$data) = $service->badGoodsReasonReportDetail($request->all());
  82. if($status){
  83. return $this->json_return(200,'',$data);
  84. }else{
  85. return $this->json_return(201,$data);
  86. }
  87. }
  88. public function deviceList(Request $request){
  89. $device = (new EquipmentService())->getDeviceList();
  90. $data = [];
  91. foreach ($device as $k => $v){
  92. $data[] = [
  93. 'device_name' => $k,
  94. 'device_no' => $v
  95. ];
  96. }
  97. return $this->json_return(200,'',$data);
  98. }
  99. //设备统计报表
  100. public function deviceStatisticsReport(Request $request){
  101. $service = new ReportFormsService();
  102. list($status,$data) = $service->deviceStatisticsReport($request->all());
  103. if($status){
  104. return $this->json_return(200,'',$data);
  105. }else{
  106. return $this->json_return(201,$data);
  107. }
  108. }
  109. //设备统计报表详情
  110. public function deviceStatisticsReportDetail(Request $request){
  111. $service = new ReportFormsService();
  112. list($status,$data) = $service->deviceStatisticsReportDetail($request->all());
  113. if($status){
  114. return $this->json_return(200,'',$data);
  115. }else{
  116. return $this->json_return(201,$data);
  117. }
  118. }
  119. //设备统计报表
  120. public function deviceStatisticsReportChart(Request $request){
  121. $service = new ReportFormsService();
  122. list($status,$data) = $service->deviceStatisticsReportChart($request->all());
  123. if($status){
  124. return $this->json_return(200,'',$data);
  125. }else{
  126. return $this->json_return(201,$data);
  127. }
  128. }
  129. //设备统计OEE报表
  130. public function deviceStatisticsReportOEEChart(Request $request){
  131. $service = new ReportFormsService();
  132. list($status,$data) = $service->deviceStatisticsReportOEEChart($request->all());
  133. if($status){
  134. return $this->json_return(200,'',$data);
  135. }else{
  136. return $this->json_return(201,$data);
  137. }
  138. }
  139. //报工单报表
  140. public function statisticsReportWorkingChart(Request $request){
  141. $service = new ReportFormsService();
  142. list($status,$data) = $service->statisticsReportWorkingChart($request->all());
  143. if($status){
  144. return $this->json_return(200,'',$data);
  145. }else{
  146. return $this->json_return(201,$data);
  147. }
  148. }
  149. public function statisticsReportWorkingChartDetail(Request $request){
  150. $service = new ReportFormsService();
  151. list($status,$data) = $service->statisticsReportWorkingChartDetail($request->all());
  152. if($status){
  153. return $this->json_return(200,'',$data);
  154. }else{
  155. return $this->json_return(201,$data);
  156. }
  157. }
  158. public function xsReport(Request $request){
  159. $service = new ReportFormsService();
  160. list($status,$data) = $service->xsReport($request->all());
  161. if($status){
  162. return $this->json_return(200,'',$data);
  163. }else{
  164. return $this->json_return(201,$data);
  165. }
  166. }
  167. }