WorkOrderVerification.php 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use \think\Request;
  5. use \think\Db;
  6. use \think\cache;
  7. /**
  8. * 工单核验单维护接口
  9. */
  10. class WorkOrderVerification extends Api
  11. {
  12. protected $noNeedLogin = ['*'];
  13. protected $noNeedRight = ['*'];
  14. /**
  15. * 首页
  16. *
  17. */
  18. public function index()
  19. {
  20. $this->success('请求成功');
  21. }
  22. /**
  23. * 获取工单核验单侧边栏
  24. * @ApiMethod (GET)
  25. */
  26. public function getTab()
  27. {
  28. //get请求
  29. if(!$this->request->isGet()){
  30. $this->error('请求方式错误');
  31. }
  32. if(!cache('WorkOrderVerification-getTable')){
  33. $time = date('Y-m-d',time()-8640000);
  34. $rows = db()->table('db_qczl')
  35. ->field('LEFT(sys_rq, 10) as date, COUNT(*) as counts')
  36. ->where('sys_rq','>=',$time)
  37. ->group('date')
  38. ->order('date desc')
  39. ->limit(30)
  40. ->select();
  41. $arr = db()->table('db_qczl')
  42. ->field('LEFT(sys_rq, 10) as date, rtrim(sys_id) as sys_id, COUNT(*) as count')
  43. ->where('sys_rq','>=',$rows[count($rows)-1]['date'])
  44. ->group('date, sys_id')
  45. ->select();
  46. foreach($rows as $key=>$value){
  47. $rows[$key]['sys'] = [];
  48. foreach($arr as $k=>$v){
  49. if($value['date'] == $v['date']){
  50. unset($v['date']);
  51. array_push($rows[$key]['sys'],$v);
  52. unset($arr[$k]);
  53. }
  54. }
  55. $rows[$key]['date'] = str_replace('-', '.', $rows[$key]['date']);
  56. }
  57. //设置缓存
  58. cache('WorkOrderVerification-getTable',$rows,3600);
  59. }else{
  60. $rows = cache('WorkOrderVerification-getTable');
  61. }
  62. $this->success('成功',$rows);
  63. }
  64. /**
  65. * 获取工单核验单侧边栏通过工单编号
  66. * @ApiMethod (GET)
  67. */
  68. public function getTabByGdbh()
  69. {
  70. //get请求
  71. if(!$this->request->isGet()){
  72. $this->error('请求方式错误');
  73. }
  74. $date = date('Y-m-d',strtotime("-1 year"));
  75. $rows = db()->table('db_qczl')->alias('d')
  76. ->field('d.qczl_gdbh, rtrim(y.Gd_cpmc) as Gd_cpmc')
  77. ->join('工单_基本资料 y','y.Gd_gdbh = d.qczl_gdbh','left')
  78. ->where('d.sys_rq','>=',$date)
  79. ->group('d.qczl_gdbh')
  80. ->order('d.qczl_gdbh desc')
  81. ->limit(65)
  82. ->select();
  83. $arr = db()->table('db_qczl')
  84. ->field('qczl_gdbh, rtrim(sys_id) as sys_id, COUNT(*) as count')
  85. ->where('qczl_gdbh','>=',$rows[count($rows)-1]['qczl_gdbh'])
  86. ->group('qczl_gdbh, sys_id')
  87. ->select();
  88. foreach($rows as $key=>$value){
  89. $rows[$key]['sys'] = [];
  90. foreach($arr as $k=>$v){
  91. if($value['qczl_gdbh'] == $v['qczl_gdbh']){
  92. unset($v['qczl_gdbh']);
  93. array_push($rows[$key]['sys'],$v);
  94. unset($arr[$k]);
  95. }
  96. }
  97. }
  98. $this->success('成功',$rows);
  99. }
  100. /**
  101. * 获取工单核验单列表
  102. * @ApiMethod (GET)
  103. * @param string $date 时间
  104. * @param string $sys_id 用户
  105. */
  106. public function getList()
  107. {
  108. //get请求
  109. if(!$this->request->isGet()){
  110. $this->error('请求方式错误');
  111. }
  112. $req = $this->request->param();
  113. $page = 1;
  114. $limit = 15;
  115. if (isset($req['page']) && !empty($req['page'])) $page = $req['page'];
  116. if (isset($req['limit']) && !empty($req['limit'])) $limit = $req['limit'];
  117. $where = [];
  118. if (isset($req['date']) && !empty($req['date'])){
  119. $where['sys_rq'] = ['LIKE',$req['date'].'%'];
  120. }
  121. if (isset($req['sys_id']) && !empty($req['sys_id'])) $where['sys_id'] = ['LIKE',$req['sys_id'].'%'];
  122. if (isset($req['order']) && !empty($req['order'])) $where['qczl_gdbh'] = $req['order'];
  123. if (isset($req['cpmc']) && !empty($req['cpmc'])){
  124. //查询工单表
  125. $gd = db('工单_基本资料')
  126. ->where('Gd_cpmc', 'LIKE', '%'.$req['cpmc'].'%')
  127. ->column('Gd_gdbh');
  128. $where['qczl_gdbh'] = ['in', $gd];
  129. }
  130. $rows = db()->table('db_qczl')
  131. ->field('qczl_gdbh, qczl_yjno, LEFT(qczl_rq, 10) as qczl_rq, qczl_num, rtrim(qczl_NumDesc) as qczl_NumDesc, qczl_fp,
  132. fp_lb1, fp_lb2, fp_lb3, fp_lb4, fp_lb5, fp_lb6, fp_lb7, fp_lb8, fp_lb9, fp_lb10, fp_lb11, fp_lb12, fp_lb13, fp_lb14, fp_lb15, fp_lb16, fp_lb17,
  133. fp_sl1, fp_sl2, fp_sl3, fp_sl4, fp_sl5, fp_sl6, fp_sl7, fp_sl8, fp_sl9, fp_sl10, fp_sl11, fp_sl12, fp_sl13, fp_sl14, fp_sl15, fp_sl16, fp_sl17,
  134. rtrim(sys_id) as sys_id,UniqId')
  135. ->where($where)
  136. ->order('UniqId desc')
  137. ->page($page,$limit)
  138. ->select();
  139. $total = db()->table('db_qczl')->where($where)->count();
  140. $gd = db()->table('工单_基本资料')->column('Gd_gdbh, Gd_cpmc');
  141. foreach ($rows as $key=>$value){
  142. $rows[$key]['Gd_cpmc'] = array_key_exists($value['qczl_gdbh'],$gd) ? sprintf("%02d", $value['qczl_yjno']).'-'.trim($gd[$value['qczl_gdbh']]) : '';
  143. for ($i=1;$i<=17;$i++){
  144. if ($value['fp_sl'.$i]==0){
  145. $rows[$key]['sl_lb'.$i] = '';
  146. }else{
  147. $rows[$key]['sl_lb'.$i] = trim($value['fp_sl'.$i].'-->'.$value['fp_lb'.$i]);
  148. }
  149. unset($rows[$key]['fp_sl'.$i]);
  150. unset($rows[$key]['fp_lb'.$i]);
  151. }
  152. }
  153. $data = [
  154. 'total' => $total,
  155. 'rows' => $rows,
  156. ];
  157. $this->success('成功',$data);
  158. }
  159. /**
  160. * 获取工单核验单信息
  161. * @ApiMethod (GET)
  162. * @param string $UniqId UniqId
  163. */
  164. public function getInfo()
  165. {
  166. //get请求
  167. if(!$this->request->isGet()){
  168. $this->error('请求方式错误');
  169. }
  170. $req = $this->request->param();
  171. if (isset($req['UniqId']) && !empty($req['UniqId'])){
  172. $UniqId = $req['UniqId'];
  173. }else{
  174. $this->error('参数错误');
  175. }
  176. $rows = db()->table('db_qczl')->alias('d')
  177. ->field('d.*, ')
  178. ->join('工单_基本资料 g', 'd.')
  179. ->where('d.UniqId',$UniqId)
  180. ->select();
  181. $this->success('成功',$rows);
  182. }
  183. /**
  184. * 获取单个工单核检单信息
  185. * @ApiMethod GET
  186. * @params string UniqId
  187. */
  188. public function getOneWorkOrder(){
  189. if (Request::instance()->isGet() == false){
  190. $this->error('非法请求');
  191. }
  192. $params = Request::instance()->param();
  193. if (!isset($params['UniqId']) || empty($params['UniqId'])){
  194. $this->error('参数错误');
  195. }
  196. $field = 'qczl_gdbh,qczl_Pygd,qczl_yjno,qczl_gxh,qczl_gxmc,qczl_type,qczl_rq,qczl_num,qczl_fp,
  197. qczl_NumDesc,qczl_NumDesc1,qczl_NumDesc2,qczl_NumDesc3,qczl_NumDesc4,qczl_NumDesc5,qczl_NumDesc6,qczl_NumDesc7,qczl_NumDesc8,
  198. fp_lb1,fp_lb2,fp_lb3,fp_lb4,fp_lb5,fp_lb6,fp_lb7,fp_lb8,fp_lb9,fp_lb10,fp_lb11,fp_lb12,fp_lb13,trim(fp_lb14) as fp_lb14,trim(fp_lb15) as fp_lb15,trim(fp_lb16) as fp_lb16,trim(fp_lb17) as fp_lb17,
  199. fp_sl1,fp_sl2,fp_sl3,fp_sl4,fp_sl5,fp_sl6,fp_sl7,fp_sl8,fp_sl9,fp_sl10,fp_sl11,fp_sl12,fp_sl13,fp_sl14,fp_sl15,fp_sl16,fp_sl17,
  200. fp_bh1,fp_bh2,fp_bh3,fp_bh4,fp_bh5,fp_bh6,fp_bh7,fp_bh8,fp_bh9,fp_bh10,fp_bh11,fp_bh12,fp_bh13,
  201. fp_bz1,fp_bz2,fp_bz3,fp_bz4,fp_bz5,fp_bz6,fp_bz7,fp_bz8,fp_bz9,fp_bz10,fp_bz11,fp_bz12,fp_bz13,
  202. fp_gxmc1,fp_gxmc2,fp_gxmc3,fp_gxmc4,fp_gxmc5,fp_gxmc6,fp_gxmc7,fp_gxmc8,fp_gxmc9,fp_gxmc10,fp_gxmc11,fp_gxmc12,fp_gxmc13,
  203. sys_id,rtrim(sys_rq) as sys_rq,UniqId';
  204. $list = db('db_qczl')->where('UniqId',$params['UniqId'])->field($field)->find();
  205. $list['fp_name1'] = '';
  206. if (!empty($list['fp_bh1'])){
  207. $list['fp_name1'] = db('人事_基本资料')->where('员工编号',$list['fp_bh1'])->value('rtrim(员工姓名)');
  208. }
  209. $list['fp_name2'] = '';
  210. if (!empty($list['fp_bh2'])){
  211. $list['fp_name2'] = db('人事_基本资料')->where('员工编号',$list['fp_bh2'])->value('rtrim(员工姓名)');
  212. }
  213. $list['fp_name3'] = '';
  214. if (!empty($list['fp_bh3'])){
  215. $list['fp_name3'] = db('人事_基本资料')->where('员工编号',$list['fp_bh3'])->value('rtrim(员工姓名)');
  216. }
  217. $list['fp_name4'] = '';
  218. if (!empty($list['fp_bh4'])){
  219. $list['fp_name4'] = db('人事_基本资料')->where('员工编号',$list['fp_bh4'])->value('rtrim(员工姓名)');
  220. }
  221. $list['fp_name5'] = '';
  222. if (!empty($list['fp_bh5'])){
  223. $list['fp_name5'] = db('人事_基本资料')->where('员工编号',$list['fp_bh5'])->value('rtrim(员工姓名)');
  224. }
  225. $list['fp_name6'] = '';
  226. if (!empty($list['fp_bh6'])){
  227. $list['fp_name6'] = db('人事_基本资料')->where('员工编号',$list['fp_bh6'])->value('rtrim(员工姓名)');
  228. }
  229. $list['fp_name7'] = '';
  230. if (!empty($list['fp_bh7'])){
  231. $list['fp_name7'] = db('人事_基本资料')->where('员工编号',$list['fp_bh7'])->value('rtrim(员工姓名)');
  232. }
  233. $list['fp_name8'] = '';
  234. if (!empty($list['fp_bh8'])){
  235. $list['fp_name8'] = db('人事_基本资料')->where('员工编号',$list['fp_bh8'])->value('rtrim(员工姓名)');
  236. }
  237. $list['fp_name9'] = '';
  238. if (!empty($list['fp_bh9'])){
  239. $list['fp_name9'] = db('人事_基本资料')->where('员工编号',$list['fp_bh9'])->value('rtrim(员工姓名)');
  240. }
  241. $list['fp_name10'] = '';
  242. if (!empty($list['fp_bh10'])){
  243. $list['fp_name10'] = db('人事_基本资料')->where('员工编号',$list['fp_bh10'])->value('rtrim(员工姓名)');
  244. }
  245. $list['fp_name11'] = '';
  246. if (!empty($list['fp_bh11'])){
  247. $list['fp_name11'] = db('人事_基本资料')->where('员工编号',$list['fp_bh11'])->value('rtrim(员工姓名)');
  248. }
  249. $list['fp_name12'] = '';
  250. if (!empty($list['fp_bh12'])){
  251. $list['fp_name12'] = db('人事_基本资料')->where('员工编号',$list['fp_bh12'])->value('rtrim(员工姓名)');
  252. }
  253. $list['fp_name13'] = '';
  254. if (!empty($list['fp_bh13'])){
  255. $list['fp_name13'] = db('人事_基本资料')->where('员工编号',$list['fp_bh13'])->value('rtrim(员工姓名)');
  256. }
  257. $max = db('设备_产量计酬')->where('sczl_gdbh',$list['qczl_gdbh'])->field('MAX(sczl_num) as sczl_num')->find();
  258. $list['total_liucheng'] = $max['sczl_num'];
  259. $this->success('请求成功',$list);
  260. }
  261. /**
  262. * 获取工单基本信息
  263. * @ApiMethod GET
  264. * @params string order
  265. */
  266. public function getOrderInfo(){
  267. if (Request::instance()->isGet() == false){
  268. $this->error('非法请求');
  269. }
  270. $params = Request::instance()->param();
  271. if (!isset($params['order']) || empty($params['order'])){
  272. $this->error('参数错误');
  273. }
  274. $list = db('工单_基本资料')->alias('a')
  275. ->join('工单_印件资料 b','a.Gd_gdbh = b.Yj_Gdbh','left')
  276. ->where('a.Gd_gdbh',$params['order'])
  277. ->where('a.行号',1)
  278. ->field('a.Gd_cpmc,b.yj_Yjno,b.yj_yjmc')
  279. ->select();
  280. $this->success('请求成功',$list);
  281. }
  282. /**
  283. * 获取印件名称及工序
  284. * @ApiMethod GET
  285. * @params string order
  286. * @params string yj_no
  287. */
  288. public function getYjInfo(){
  289. if (Request::instance()->isGet() == false){
  290. $this->error('非法请求');
  291. }
  292. $params = Request::instance()->param();
  293. if (!isset($params['order']) || empty($params['order'])){
  294. $this->error('参数错误');
  295. }
  296. if (!isset($params['yj_no']) || empty($params['yj_no'])){
  297. $this->error('参数错误');
  298. }
  299. $where['Yj_Gdbh'] = $params['order'];
  300. $where['yj_Yjno'] = $params['yj_no'];
  301. $list = db('工单_印件资料')->where($where)->field('yj_yjmc')->find();
  302. $option['Gy0_gdbh'] = $params['order'];
  303. $option['Gy0_yjno'] = $params['yj_no'];
  304. // $option['Gy0_site'] = '印后车间';
  305. $option['Gy0_gxmc'] = array('not in',['包装','外发加工','废挑正','成品防护']);
  306. $gxList = db('工单_工艺资料')->where($option)->field('Gy0_gxh,rtrim(Gy0_gxmc) as Gy0_gxmc,rtrim(Add_gxmc) as Add_gxmc')->select();
  307. $max = db('设备_产量计酬')->where('sczl_gdbh',$params['order'])->where('sczl_yjno',$params['yj_no'])->field('MAX(sczl_num) as sczl_num')->value('sczl_num');
  308. $list['gx_data'] = $gxList;
  309. $list['max_num'] = $max;
  310. $this->success('请求成功',$list);
  311. }
  312. /**
  313. * 获取废品分类
  314. * @ApiMethod GET
  315. * @params string search
  316. */
  317. public function getWastInfo(){
  318. if (Request::instance()->isGet() == false){
  319. $this->error('非法请求');
  320. }
  321. $params = Request::instance()->param();
  322. $where['分类'] = '废品分类';
  323. if (!empty($params['search'])){
  324. $where['名称'] = array('like','%'.$params['search'].'%');
  325. }
  326. $data = db('erp_常用字典')->where($where)->column('名称');
  327. // 分割字符串并合并相同项
  328. $resultArray = [];
  329. foreach ($data as $item) {
  330. $parts = explode('_', $item);
  331. // 使用第一个部分作为一级键,第二个部分作为二级键
  332. $firstKey = $parts[0];
  333. $secondKey = $parts[1];
  334. $thirdValue = $parts[2];
  335. $resultArray[$firstKey][$secondKey][] = $thirdValue;
  336. }
  337. // 对废品分类下的数组进行升序排序
  338. if (isset($resultArray['data']['废品分类'])) {
  339. foreach ($resultArray['data']['废品分类'] as &$category) {
  340. // 判断是关联数组(单凹等)还是索引数组(分切等)
  341. if (is_array($category) && !empty($category) && is_array(current($category))) {
  342. foreach ($category as &$subCategory) {
  343. ksort($subCategory);
  344. }
  345. } else {
  346. ksort($category);
  347. }
  348. }
  349. }
  350. $this->success('请求成功',$resultArray);
  351. }
  352. /**
  353. *获取工序及责任组长
  354. * @ApiMethod GET
  355. * @params string type
  356. * @params string order
  357. */
  358. public function getGxAndLeader(){
  359. if (Request::instance()->isGet() == false){
  360. $this->error('非法请求');
  361. }
  362. $params = Request::instance()->param();
  363. if (!isset($params['type']) || empty($params['type'])){
  364. $this->error('参数错误');
  365. }
  366. if (!isset($params['order']) || empty($params['order'])){
  367. $this->error('参数错误');
  368. }
  369. $type = trim($params['type']);
  370. $waste = db('erp_常用字典')->where('名称','like','%'.$type.'%')->find();
  371. if (empty($waste)){
  372. $this->error('未查询到废品分类');
  373. }
  374. $wasteType = explode('_',substr($waste['名称'],0,-1));
  375. $searchArr = explode('-',$wasteType[1]);
  376. $search = substr($searchArr[1],0,6);
  377. $where['a.sczl_gdbh'] = $params['order'];
  378. $where['a.sczl_type'] = array('like','%'.$search.'%');
  379. $list = db('设备_产量计酬')->alias('a')
  380. ->join('人事_基本资料 b','a.sczl_bh1 = b.员工编号','left')
  381. ->where($where)->field('distinct(a.sczl_gxmc),a.sczl_bzdh,a.sczl_jtbh,a.sczl_bh1,b.员工姓名 as name')
  382. ->select();
  383. $count = count($list);
  384. $list[$count]['sczl_gxmc'] = '99-外发加工';
  385. $list[$count]['sczl_bzdh'] = 'A班';
  386. $list[$count]['sczl_jtbh'] = '';
  387. $list[$count]['sczl_bh1'] = '000000';
  388. $list[$count]['name'] = '计时工';
  389. $this->success('请求成功',$list);
  390. }
  391. /**
  392. * 修改工单核检单
  393. * @ApiMethod POST
  394. * @params array data
  395. */
  396. public function edit(){
  397. if (Request::instance()->isPost() == false){
  398. $this->error('非法请求');
  399. }
  400. $params = Request::instance()->post();
  401. if (!isset($params['UniqId'])){
  402. $this->error('参数不能为空');
  403. }
  404. $id = $params['UniqId'];
  405. unset($params['UniqId']);
  406. $sql = db('db_qczl')->where('UniqId',$id)->fetchSql(true)->update($params);
  407. $res = Db::query($sql);
  408. if ($res !== 0){
  409. cache('WorkOrderVerification-getTable',null);
  410. $this->success('更新成功');
  411. }else{
  412. $this->error('更新失败');
  413. }
  414. }
  415. /**
  416. * 新增工单核检单
  417. * @ApiMethod POST
  418. * @params array data
  419. */
  420. public function add(){
  421. if (Request::instance()->isPost() == false){
  422. $this->error('非法请求');
  423. }
  424. $params = Request::instance()->post();
  425. $UniqId = db('db_qczl')->order('UniqId desc')->value('UniqId');
  426. if ($UniqId < 10000000){
  427. $UniqId = 10000000;
  428. }else{
  429. $UniqId = $UniqId + 1;
  430. }
  431. $params['UniqId'] = $UniqId;
  432. $params['sys_rq'] = date('Y-m-d H:i:s');
  433. $res = \db('db_qczl')->insert($params);
  434. if ($res !== false){
  435. cache('WorkOrderVerification-getTable',null);
  436. $this->success('新增成功');
  437. }else{
  438. $this->error('新增失败');
  439. }
  440. }
  441. /**
  442. * 工单核检废品分布
  443. * @ApiMethod GET
  444. * @params string order
  445. */
  446. public function wasteDistribution(){
  447. if (Request::instance()->isGet() == false){
  448. $this->error('非法请求');
  449. }
  450. $params = Request::instance()->param();
  451. if (!isset($params['order']) || empty($params['order'])){
  452. $this->error('参数错误');
  453. }
  454. $field = '
  455. rtrim(fp_lb1) as fp_lb1,rtrim(fp_lb2) as fp_lb2,rtrim(fp_lb3) as fp_lb3,rtrim(fp_lb4) as fp_lb4,rtrim(fp_lb5) as fp_lb5,rtrim(fp_lb6) as fp_lb6,rtrim(fp_lb7) as fp_lb7,
  456. rtrim(fp_lb8) as fp_lb8,rtrim(fp_lb9) as fp_lb9,rtrim(fp_lb10) as fp_lb10,rtrim(fp_lb11) as fp_lb11,rtrim(fp_lb12) as fp_lb12,rtrim(fp_lb13) as fp_lb13,
  457. fp_sl1,fp_sl2,fp_sl3,fp_sl4,fp_sl5,fp_sl6,fp_sl7,fp_sl8,fp_sl9,fp_sl10,fp_sl11,fp_sl12,fp_sl13
  458. ';
  459. $data = db('db_qczl')->name('db_qczl')->where('qczl_gdbh',$params['order'])->field($field)->select();
  460. if (empty($data)){
  461. $this->error('暂无废品数据');
  462. }
  463. // 用于存储废品类别和对应废品数量的数组
  464. $categories = array();
  465. // 循环遍历原始数组
  466. foreach ($data as $item) {
  467. // 提取废品类别和对应废品数量
  468. foreach ($item as $key => $value) {
  469. if (strpos($key, "fp_lb") === 0) {
  470. $categoryKey = $key;
  471. $quantityKey = str_replace("fp_lb", "fp_sl", $key);
  472. $quantityValue = $item[$quantityKey];
  473. if (!isset($categories[$value])) {
  474. $categories[$value] = 0;
  475. }
  476. $categories[$value] += (int)$quantityValue;
  477. }
  478. }
  479. }
  480. ksort($categories);
  481. $wasteTotal = db('db_qczl')->where('qczl_gdbh',$params['order'])->sum('qczl_fp');
  482. if (empty($wasteTotal)){
  483. $wasteTotal = 0;
  484. }
  485. $where['a.Gd_gdbh'] = $params['order'];
  486. $where['a.行号'] = 1;
  487. $gdInfo = db('工单_基本资料')->alias('a')
  488. ->join('工单_印件资料 b','a.Gd_gdbh = b.Yj_Gdbh','left')
  489. ->where($where)->field('a.Gd_gdbh,a.实际投料,b.yj_Yjno,b.yj_yjmc')->find();
  490. $gdInfo['yj_Yjno'] = $gdInfo['yj_Yjno'] > 10 ? $gdInfo['yj_Yjno']:'0'.$gdInfo['yj_Yjno'];
  491. $gdInfo['实际投料'] = (int)($gdInfo['实际投料'] * 10000);
  492. $gdInfo['wasteTotal'] = $wasteTotal;
  493. $finishNum = db('成品入仓')->where('jjcp_gdbh',$params['order'])->sum('jjcp_sl');
  494. $gdInfo['passRate'] = '';
  495. if (!empty($finishNum)){
  496. $gdInfo['passRate'] = number_format((int)$finishNum/$gdInfo['实际投料']*100,2).'%';
  497. }
  498. //左侧废品数据
  499. $wasteData = array();
  500. $i = 0;
  501. foreach ($categories as $key=>$value){
  502. if ($value != 0){
  503. $wasteData[$i]['type'] = $key;
  504. $wasteData[$i]['num'] = $value;
  505. $wasteData[$i]['lossesRate'] = number_format($value/$gdInfo['实际投料']*100,4).'%';
  506. $wasteData[$i]['wasteRate'] = number_format($value/$wasteTotal*100,2).'%';
  507. $i++;
  508. }
  509. }
  510. // 按首字母相同的键将值相加
  511. $newArray = array();
  512. foreach ($categories as $key => $value) {
  513. $firstLetter = strtoupper(substr($key, 0, 1)); // 获取首字母并转换为大写
  514. if (!isset($newArray[$firstLetter])) {
  515. $newArray[$firstLetter] = 0;
  516. }
  517. $newArray[$firstLetter] += $value;
  518. }
  519. // 去掉值为零的项
  520. $newArray = array_filter($newArray, function($value) {
  521. return $value !== 0;
  522. });
  523. //右侧废品数据
  524. $rightData = array();
  525. $i = 0;
  526. $name = array();
  527. foreach ($newArray as $key=>$value){
  528. $item = db('erp_常用字典')->where('名称','like','%'.$key.'%')->value('名称');
  529. $item = explode('_',substr($item,0,-1));
  530. $rightData[$i]['type'] = $item[1];
  531. $rightData[$i]['rate'] = number_format($value/$wasteTotal*100,0).'%';
  532. $name[$i] = $item[1];
  533. $i++;
  534. }
  535. $gdInfo['wasteData'] = $wasteData;
  536. $gdInfo['rightData'] = $rightData;
  537. $gdInfo['rightTitle'] = $name;
  538. $this->success('请求成功',$gdInfo);
  539. }
  540. /**
  541. * 获取工单工序状态
  542. * @ApiMethod GET
  543. * @params string order
  544. * 计划产量计算方式:上个工序计划产量-(基础损耗+损耗率*上个工序计划产量)*损耗系数*计损色数)
  545. * lastNum - (Gy0_Rate0 + Gy0_Rate1 * lastNum )* 损耗系数(Gy0_Rate3) * Gy0_Ms
  546. */
  547. public function getOrderDate(){
  548. if (Request::instance()->isGet() == false){
  549. $this->error('非法请求');
  550. }
  551. $params = Request::instance()->param();
  552. if (!isset($params['order']) || empty($params['order'])){
  553. $this->error('参数错误');
  554. }
  555. $where['a.Gy0_gdbh'] = $params['order'];
  556. $where['a.Gy0_sbbh'] = array('neq',' ');
  557. $productNum = db('工单_基本资料')->where('Gd_gdbh',$params['order'])->value('计划投料');
  558. $gyData = db('工单_工艺资料')->alias('a')
  559. ->join('设备_产量计酬 b','a.Gy0_gdbh = b.sczl_gdbh and a.Gy0_gxh = b.sczl_gxh','left')
  560. ->where($where)
  561. ->field('a.Gy0_yjno,a.Gy0_gxh,rtrim(a.Gy0_gxmc) as Gy0_gxmc,a.Gy0_sbbh,a.Gy0_Rate0,a.Gy0_Rate1,a.损耗系数 as Gy0_Rate3,a.Gy0_Ms,a.Gy0_SITE,a.Gy0_计划接货数,a.PD_WG,
  562. a.UniqId,sum(b.sczl_cl) as cl')
  563. ->group('a.Gy0_gxh')
  564. ->select();
  565. $lastNum = $productNum;
  566. $res = [];
  567. foreach ($gyData as $key=> $process) {
  568. $res[$key]['UniqId'] = $process['UniqId'];
  569. $res[$key]['Gy0_yjno'] = $process['Gy0_yjno'] > 10 ? $process['Gy0_yjno'] : '0'.$process['Gy0_yjno'];
  570. $res[$key]['Gy0_gxh'] = $process['Gy0_gxh'] > 10 ? $process['Gy0_gxh'] : '0'.$process['Gy0_gxh'];
  571. $res[$key]['Gy0_gxmc'] = $process['Gy0_gxmc'];
  572. $res[$key]['Gy0_sbbh'] = rtrim($process['Gy0_sbbh']);
  573. $res[$key]['PD_WG'] = $process['PD_WG'];
  574. $res[$key]['finish'] = empty($process['cl']) ? 0: (int)$process['cl'];
  575. // 计算工序计划产量
  576. if ($process["Gy0_gxh"] == "1") {
  577. // 第一道工序直接使用初始计划产量
  578. $Num = $lastNum;
  579. } else {
  580. $Gy0_Ms = $gyData[$key-1]['Gy0_Ms'];
  581. $Gy0_Rate0 = $gyData[$key-1]['Gy0_Rate0'];
  582. $Gy0_Rate1 = $gyData[$key-1]['Gy0_Rate1'];
  583. $Gy0_Rate3 = $gyData[$key-1]['Gy0_Rate3'];
  584. // 大于第一道工序,使用上一道工序的计划产量
  585. // 根据公式计算工序计划产量
  586. if ($Gy0_Ms != "0.00") {
  587. $Num = $lastNum - ($Gy0_Rate0 + $Gy0_Rate1 * $lastNum) * $Gy0_Rate3 * $Gy0_Ms;
  588. } else {
  589. $Num = $lastNum - ($Gy0_Rate0 + $Gy0_Rate1 * $lastNum) * $Gy0_Rate3;
  590. }
  591. }
  592. if (trim($process['Gy0_SITE']) == '检验车间'){
  593. $res[$key]['plan'] = (int)$process['Gy0_计划接货数'];
  594. }else{
  595. $res[$key]['plan'] = (int)round($Num);
  596. }
  597. $finish_rate = $res[$key]['finish']/$res[$key]['plan'];
  598. $res[$key]['finish_rate'] = '';
  599. if ($finish_rate != 0){
  600. $res[$key]['finish_rate'] = number_format($finish_rate*100,2).'%';
  601. }
  602. // 更新 $lastNum 为当前工序的计划产量
  603. $lastNum = $Num;
  604. }
  605. $this->success('请求成功',$res);
  606. }
  607. /**
  608. * 工单工序状态更正
  609. * @ApiMethod POST
  610. * @params string UniqId
  611. * @params string date
  612. */
  613. public function editOrderFinishDate(){
  614. if (Request::instance()->isPost() == false){
  615. $this->error('非法请求');
  616. }
  617. $params = Request::instance()->post();
  618. if (!isset($params['UniqId']) || !isset($params['date'])){
  619. $this->error('参数错误');
  620. }
  621. if (empty($params['UniqId'])){
  622. $this->error('参数不能为空');
  623. }
  624. if (empty($params['date'])){
  625. $params['date'] = '1900-01-01 00:00:00';
  626. }
  627. $res = db('工单_工艺资料')->where('UniqId',$params['UniqId'])->setField('PD_WG',$params['date']);
  628. if ($res != false){
  629. $this->success('更新成功');
  630. }else{
  631. $this->error('更新失败');
  632. }
  633. }
  634. /**
  635. * 工单工序生产进程菜单栏
  636. * @ApiMethod GET
  637. * @params string order
  638. */
  639. public function getOrderProcessLeft(){
  640. if (Request::instance()->isGet() == false){
  641. $this->error('非法请求');
  642. }
  643. $params = Request::instance()->param();
  644. if (!isset($params['order']) || empty($params['order'])){
  645. $this->error('参数错误');
  646. }
  647. $where['Gd_gdbh'] = $params['order'];
  648. $where['行号'] = 1;
  649. //工单基本资料
  650. $info = db('工单_基本资料')->where($where)->field('rtrim(成品代号) as code,rtrim(成品名称) as name')->find();
  651. //工艺资料
  652. $option['Gy0_gdbh'] = $params['order'];
  653. $gyInfo = db('工单_工艺资料')
  654. ->where($option)
  655. ->where(function ($query) {
  656. $query->where('Gy0_sbbh', '<>', '')
  657. ->whereOr('Gy0_gxmc', '核检')
  658. ->whereOr('Gy0_gxmc', '成品防护');
  659. })
  660. ->field('Gy0_yjno,Gy0_gxh,rtrim(Gy0_gxmc) as Gy0_gxmc')
  661. ->select();
  662. foreach ($gyInfo as $key=>$value){
  663. $gyInfo[$key]['Gy0_yjno'] = $value['Gy0_yjno'] > 10 ? $value['Gy0_yjno'] : '0'.$value['Gy0_yjno'];
  664. $gyInfo[$key]['Gy0_gxh'] = $value['Gy0_gxh'] > 10 ? $value['Gy0_gxh'] : '0'.$value['Gy0_gxh'];
  665. }
  666. $res['Gd_info'] = $info;
  667. $res['Gy_info'] = $gyInfo;
  668. $this->success('请求成功',$res);
  669. }
  670. /**
  671. * 工单工序生产进程右侧
  672. * @ApiMethod GET
  673. * @params string order
  674. * @params string gxNo
  675. */
  676. public function getOrderProcessRight(){
  677. if (Request::instance()->isGet() == false){
  678. $this->error('非法请求');
  679. }
  680. $params = Request::instance()->param();
  681. if (!isset($params['order']) || empty($params['order'])){
  682. $this->error('参数错误');
  683. }
  684. if (!isset($params['gxNo']) || empty($params['gxNo'])){
  685. $this->error('参数错误');
  686. }
  687. $total = db('设备_产量计酬')->where('sczl_gdbh',$params['order'])->order('sczl_num')->column('distinct(sczl_num)');
  688. $where['sczl_gxh'] = (int)$params['gxNo'];
  689. $where['sczl_gdbh'] = $params['order'];
  690. //机器设备数据
  691. $process = db('设备_产量计酬')->where($where)->order('sczl_num')->column('distinct(sczl_num)');
  692. //手工数据
  693. $option['qczl_gdbh'] = $params['order'];
  694. $option['qczl_gxh'] = (int)$params['gxNo'];
  695. $handProcess = db('db_qczl')->where($option)->field('qczl_num,qczl_NumDesc1,qczl_NumDesc2,qczl_NumDesc3,qczl_NumDesc4,qczl_NumDesc5,qczl_NumDesc6,qczl_NumDesc7,qczl_NumDesc8')->select();
  696. // 提取数据
  697. $result = array();
  698. foreach ($handProcess as $subArray) {
  699. $qczl_num = $subArray["qczl_num"];
  700. $result[] = $qczl_num;
  701. // 提取以qczl_NumDesc开头的键对应的值
  702. for ($i = 1; $i <= 8; $i++) {
  703. $key = "qczl_NumDesc" . $i;
  704. if ($subArray[$key] != 0){
  705. $result[] = $subArray[$key];
  706. }
  707. }
  708. }
  709. // 去重
  710. $result = array_unique($result);
  711. // 对结果进行排序
  712. sort($result);
  713. $res['total_process'] = $total;
  714. $res['process'] = $process;
  715. if (empty($process)){
  716. $res['process'] = $result;
  717. }
  718. $this->success('请求成功',$res);
  719. }
  720. /**
  721. * 核检废品日统计
  722. * @ApiMethod GET
  723. * @params date start_date
  724. * @params date end_date
  725. */
  726. public function getDaysWast()
  727. {
  728. if (Request::instance()->isGet() == false) {
  729. $this->error('非法请求');
  730. }
  731. $params = Request::instance()->param();
  732. if (!isset($params['start_date']) || empty($params['start_date'])) {
  733. $this->error('参数错误');
  734. }
  735. if (!isset($params['end_date']) || empty($params['end_date'])) {
  736. $this->error('参数错误');
  737. }
  738. $where['qczl_rq'] = array('between time', [$params['start_date'], $params['end_date']]);
  739. $field = '
  740. rtrim(fp_lb1) as fp_lb1,rtrim(fp_lb2) as fp_lb2,rtrim(fp_lb3) as fp_lb3,rtrim(fp_lb4) as fp_lb4,rtrim(fp_lb5) as fp_lb5,rtrim(fp_lb6) as fp_lb6,rtrim(fp_lb7) as fp_lb7,
  741. rtrim(fp_lb8) as fp_lb8,rtrim(fp_lb9) as fp_lb9,rtrim(fp_lb10) as fp_lb10,rtrim(fp_lb11) as fp_lb11,rtrim(fp_lb12) as fp_lb12,rtrim(fp_lb13) as fp_lb13,
  742. fp_sl1,fp_sl2,fp_sl3,fp_sl4,fp_sl5,fp_sl6,fp_sl7,fp_sl8,fp_sl9,fp_sl10,fp_sl11,fp_sl12,fp_sl13,
  743. fp_bh1,fp_bh2,fp_bh3,fp_bh4,fp_bh5,fp_bh6,fp_bh7,fp_bh8,fp_bh9,fp_bh10,fp_bh11,fp_bh12,fp_bh13,
  744. rtrim(fp_bz1) as fp_bz1, rtrim(fp_bz2) as fp_bz2, rtrim(fp_bz3) as fp_bz3, rtrim(fp_bz4) as fp_bz4, rtrim(fp_bz5) as fp_bz5, rtrim(fp_bz6) as fp_bz6, rtrim(fp_bz7) as fp_bz7,
  745. rtrim(fp_bz8) as fp_bz8, rtrim(fp_bz9) as fp_bz9, rtrim(fp_bz10) as fp_bz10, rtrim(fp_bz11) as fp_bz11, rtrim(fp_bz12) as fp_bz12, rtrim(fp_bz13) as fp_bz13,
  746. qczl_rq
  747. ';
  748. $resultArray = array();
  749. $key = 'getDaysWast'.$params['start_date'].'/'.$params['end_date'];
  750. $is_have_cache = Cache::has($key);
  751. if ($is_have_cache === false){
  752. $data = db('db_qczl')
  753. ->where($where)
  754. ->where(function ($query) {
  755. for ($i = 1; $i <= 13; $i++) {
  756. $query->whereOr("fp_lb$i", 'like', '%K%','AND',"fp_sl$i",'>',0);
  757. }
  758. })
  759. ->field($field)->select();
  760. $list = [];
  761. $j = 0;
  762. foreach ($data as $entry) {
  763. for ($i = 1; $i <= 13; $i++) {
  764. $labelKey = "fp_lb" . $i;
  765. $slKey = "fp_sl" . $i;
  766. $bhKey = "fp_bh" . $i;
  767. $bzKey = "fp_bz" . $i;
  768. if (!empty($entry[$labelKey])) {
  769. if ((substr($entry[$labelKey],0,3) == 'K02' || substr($entry[$labelKey],0,3) == 'K01') && $entry[$slKey] != '0'){
  770. $list[$j]['fp_lb'] = $entry[$labelKey];
  771. $list[$j]['fp_sl'] = $entry[$slKey];
  772. $list[$j]['fp_bh'] = $entry[$bhKey];
  773. $name = db('人事_基本资料')->where('员工编号',$entry[$bhKey])->value('rtrim(员工姓名)');
  774. $list[$j]['fp_name'] = empty($name) ? '计时工' : $name;
  775. $list[$j]['fp_bz'] = $entry[$bzKey];
  776. $list[$j]['qczl_rq'] = $entry['qczl_rq'];
  777. $j++;
  778. }
  779. }
  780. }
  781. }
  782. foreach ($list as $item) {
  783. $found = false;
  784. foreach ($resultArray as &$resultItem) {
  785. if ($item["fp_lb"] === $resultItem["fp_lb"] && $item["fp_bh"] === $resultItem["fp_bh"]) {
  786. $resultItem["fp_sl"] += (int)$item["fp_sl"];
  787. $found = true;
  788. break;
  789. }
  790. }
  791. if (!$found) {
  792. $resultArray[] = $item;
  793. }
  794. }
  795. // 使用usort进行排序
  796. usort($resultArray, function($a, $b) {
  797. // First, sort by fp_lb (K01/K02)
  798. $compareLb = strcmp($a['fp_lb'], $b['fp_lb']);
  799. if ($compareLb !== 0) {
  800. return $compareLb;
  801. }
  802. // If fp_lb is the same, prioritize B班 over A班
  803. $compareBz = strcmp($a['fp_bz'], $b['fp_bz']);
  804. if ($compareBz !== 0) {
  805. return (trim($a['fp_bz']) === 'B班') ? -1 : 1;
  806. }
  807. // If fp_bz is the same, sort by fp_bh
  808. $compareBh = strcmp($a['fp_bh'], $b['fp_bh']);
  809. return $compareBh;
  810. });
  811. Cache::set($key,$resultArray,86400);
  812. }else{
  813. $resultArray = Cache::get($key);
  814. }
  815. $this->success('请求成功',$resultArray);
  816. }
  817. /**
  818. * 月度核检废品责任人统计
  819. * @ApiMethod GET
  820. * @params string date
  821. */
  822. public function getMonthPeopleTotal(){
  823. if (Request::instance()->isGet() == false) {
  824. $this->error('非法请求');
  825. }
  826. $params = Request::instance()->param();
  827. if (!isset($params['date']) || empty($params['date'])) {
  828. $this->error('参数错误');
  829. }
  830. }
  831. /**
  832. * 工单质检废品统计
  833. * @ApiMethod GET
  834. * @params string order
  835. */
  836. public function getOrderWasteTotal(){
  837. if (Request::instance()->isGet() == false) {
  838. $this->error('非法请求');
  839. }
  840. $params = Request::instance()->param();
  841. if (!isset($params['order']) || empty($params['order'])) {
  842. $this->error('参数错误');
  843. }
  844. $field = '
  845. rtrim(a.fp_lb1) as fp_lb1,rtrim(a.fp_lb2) as fp_lb2,rtrim(a.fp_lb3) as fp_lb3,rtrim(a.fp_lb4) as fp_lb4,rtrim(a.fp_lb5) as fp_lb5,rtrim(a.fp_lb6) as fp_lb6,rtrim(a.fp_lb7) as fp_lb7,
  846. rtrim(a.fp_lb8) as fp_lb8,rtrim(a.fp_lb9) as fp_lb9,rtrim(a.fp_lb10) as fp_lb10,rtrim(a.fp_lb11) as fp_lb11,rtrim(a.fp_lb12) as fp_lb12,rtrim(a.fp_lb13) as fp_lb13,
  847. a.fp_sl1,a.fp_sl2,a.fp_sl3,a.fp_sl4,a.fp_sl5,a.fp_sl6,a.fp_sl7,a.fp_sl8,a.fp_sl9,a.fp_sl10,a.fp_sl11,a.fp_sl12,a.fp_sl13,
  848. a.fp_bh1,a.fp_bh2,a.fp_bh3,a.fp_bh4,a.fp_bh5,a.fp_bh6,a.fp_bh7,a.fp_bh8,a.fp_bh9,a.fp_bh10,a.fp_bh11,a.fp_bh12,a.fp_bh13,
  849. rtrim(a.fp_gxmc1) as fp_gxmc1, rtrim(a.fp_gxmc2) as fp_gxmc2, rtrim(a.fp_gxmc3) as fp_gxmc3, rtrim(a.fp_gxmc4) as fp_gxmc4, rtrim(a.fp_gxmc5) as fp_gxmc5, rtrim(a.fp_gxmc6) as fp_gxmc6,
  850. rtrim(a.fp_gxmc7) as fp_gxmc7,rtrim(a.fp_gxmc8) as fp_gxmc8, rtrim(a.fp_gxmc9) as fp_gxmc9, rtrim(a.fp_gxmc10) as fp_gxmc10, rtrim(a.fp_gxmc11) as fp_gxmc11, rtrim(a.fp_gxmc12) as fp_gxmc12,
  851. rtrim(a.fp_gxmc13) as fp_gxmc13,a.qczl_num,a.qczl_yjno,rtrim(b.成品代号) as product_code,rtrim(b.成品名称) as product_name,b.订单数量,rtrim(b.计量单位) as 计量单位,b.实际投料,b.交货日期,
  852. c.yj_ls,d.jjcp_sl,d.jjcp_sj
  853. ';
  854. $where['a.qczl_gdbh'] = $params['order'];
  855. $where['b.行号'] = 1;
  856. $data = db('db_qczl')->alias('a')
  857. ->join('工单_基本资料 b','a.qczl_gdbh = b.Gd_gdbh','left')
  858. ->join('工单_印件资料 c','a.qczl_gdbh = c.Yj_Gdbh','left')
  859. ->join('成品入仓 d','a.qczl_gdbh = d.jjcp_gdbh','left')
  860. ->where($where)
  861. ->field($field)->select();
  862. $list = [];
  863. $j = 0;
  864. foreach ($data as $entry) {
  865. for ($i = 1; $i <= 13; $i++) {
  866. $labelKey = "fp_lb" . $i;
  867. $slKey = "fp_sl" . $i;
  868. $bhKey = "fp_bh" . $i;
  869. $gxhKey = "fp_gxmc". $i;
  870. if (!empty($entry[$labelKey]) && $entry[$slKey] > 0) {
  871. $list[$j]['fp_lb'] = $entry[$labelKey];
  872. $list[$j]['fp_sl'] = $entry[$slKey];
  873. $list[$j]['fp_bh'] = $entry[$bhKey];
  874. $name = db('人事_基本资料')->where('员工编号',$entry[$bhKey])->value('rtrim(员工姓名)');
  875. $list[$j]['fp_name'] = $name;
  876. $list[$j]['fp_gxh'] = empty(substr($entry[$gxhKey],0,2)) ? "0" : substr($entry[$gxhKey],0,2);
  877. $list[$j]['qczl_num'] = $entry['qczl_num'];
  878. $list[$j]['qczl_yjno'] = $entry['qczl_yjno'];
  879. $list[$j]['product_code'] = $entry['product_code'];
  880. $list[$j]['product_name'] = $entry['product_name'];
  881. $list[$j]['订单数量'] = $entry['订单数量'];
  882. $list[$j]['计量单位'] = $entry['计量单位'];
  883. $list[$j]['交货日期'] = substr($entry['交货日期'],0,10);
  884. $list[$j]['yj_ls'] = $entry['yj_ls'];
  885. $list[$j]['jjcp_sl'] = $entry['jjcp_sl'];
  886. $list[$j]['jjcp_sj'] = substr($entry['jjcp_sj'],0,10);
  887. $j++;
  888. }
  889. }
  890. }
  891. $summedData = [];
  892. foreach ($list as $item) {
  893. $key = $item['qczl_num'] . $item['fp_lb'];
  894. if (!isset($summedData[$key])) {
  895. $summedData[$key] = $item;
  896. } else {
  897. $summedData[$key]['fp_sl'] += $item['fp_sl'];
  898. }
  899. }
  900. $fpGxhColumn = array_column($summedData, 'fp_gxh');
  901. $qczlNumColumn = array_column($summedData, 'qczl_num');
  902. $fpLbColumn = array_column($summedData, 'fp_lb');
  903. array_multisort($fpGxhColumn, SORT_ASC, $qczlNumColumn, SORT_ASC, $fpLbColumn, SORT_ASC, $summedData);
  904. $summedData = array_values($summedData);
  905. $this->success('请求成功',$summedData);
  906. }
  907. }