Facility.php 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 设备运行跟踪
  7. */
  8. class Facility extends Api
  9. {
  10. protected $noNeedLogin = ['*'];
  11. protected $noNeedRight = ['*'];
  12. /**
  13. * 左侧菜单栏
  14. * @ApiMethod (GET)
  15. * @return void
  16. * @throws \think\db\exception\DataNotFoundException
  17. * @throws \think\db\exception\ModelNotFoundException
  18. * @throws \think\exception\DbException
  19. */
  20. public function getTab()
  21. {
  22. if ($this->request->isGet() === false){
  23. $this->error('请求错误');
  24. }
  25. $data = [];
  26. $department = Db::table('设备_基本资料')->distinct(true)->column('使用部门');
  27. $date = date('Y-m-d H:i:s',time()-3888000);
  28. if (empty($department)){
  29. $this->error('未获取到机台数据');
  30. }
  31. foreach ($department as $value){
  32. if (rtrim($value) !== '研发中心'){
  33. $machine = Db::table('设备_基本资料')->where('使用部门',$value)->field('rtrim(设备编号) as 设备编号,rtrim(设备名称) as 设备名称')->select();
  34. foreach ($machine as $kk=>$vv){
  35. if ($vv['设备编号'] !== 'ZH01#'){
  36. $date = Db::table('设备_产量计酬')
  37. ->where('sczl_jtbh',$vv['设备编号'])
  38. ->where('sczl_rq','> time',$date)
  39. ->distinct(true)
  40. ->cache(true)
  41. ->limit(40)
  42. ->order('UniqId desc')
  43. ->column('sczl_rq');
  44. $data[rtrim($value)][$vv['设备编号'].'【'.$vv['设备名称'].'】'] = $date;
  45. }
  46. }
  47. }
  48. }
  49. $this->success('成功',$data);
  50. }
  51. /**
  52. * 机台每日产量
  53. * @ApiMethod (GET)
  54. * @param string $machine 机台编号
  55. * @param string $date 日期
  56. * @return void
  57. * @throws \think\db\exception\DataNotFoundException
  58. * @throws \think\db\exception\ModelNotFoundException
  59. * @throws \think\exception\DbException
  60. */
  61. public function chanLiang()
  62. {
  63. if ($this->request->isGet() === false){
  64. $this->error('请求错误');
  65. }
  66. $machine = input('machine').'#';
  67. $date = input('date');
  68. $where = [
  69. 'sczl_jtbh' => $machine,
  70. 'sczl_rq' => date('Y-m-d H:i:s',strtotime($date.' 00:00:00')),
  71. ];
  72. $field = 'rtrim(sczl_gdbh) as 工单编号,rtrim(sczl_yjno) as yjno,rtrim(sczl_gxmc) as gxmc,rtrim(sczl_num) as num,rtrim(sczl_sj1) as sj1,
  73. rtrim(sczl_sj2) as sj2,rtrim(sczl_cl) as 产量,rtrim(sczl_bzdh) as bzdh,rtrim(sczl_zcfp) as 制程废品,rtrim(sczl_zccp) as 制程次品,rtrim(sczl_前工序废) as 前工序废,rtrim(sczl_来料少数) as 来料异常,
  74. rtrim(sczl_装版工时) as 装版工时,rtrim(sczl_保养工时) as 保养工时,rtrim(sczl_打样工时) as 打样工时,rtrim(sczl_异常停机工时) as 异常总工时,rtrim(sczl_设备运行工时) as 通电工时,
  75. rtrim(码开始行) as 码开始行,rtrim(码结束行) as 码结束行,rtrim(码包) as 码包,rtrim(主电表) as 主电表,rtrim(辅电表) as 辅电表,rtrim(sczl_ms) as 色度数,
  76. rtrim(sys_id) as 用户,rtrim(mod_rq) as 更新时间,rtrim(sczl_异常工时1) as 异常补时,rtrim(sczl_异常类型1) as 异常类型,sczl_bh1,sczl_bh2,
  77. sczl_bh3,sczl_bh4,sczl_bh5,sczl_bh6,sczl_bh7,sczl_bh8,sczl_bh9,sczl_bh10,sczl_rate1,sczl_rate2,sczl_rate3,sczl_rate4,sczl_rate5,sczl_rate6,sczl_rate7,
  78. sczl_rate8,sczl_rate9,sczl_rate10';
  79. //机台信息
  80. $machineDetail = Db::table('设备_基本资料')->where('设备编号',$machine)->field('rtrim(千件工价) as 千件工价,rtrim(日定额) as 日定额')->find();
  81. //工单编号
  82. $Gd_gdbh = Db::table('设备_产量计酬')->where($where)->distinct(true)->column('sczl_gdbh');
  83. //产品名称
  84. $productName = Db::table('工单_基本资料')->whereIn('Gd_gdbh',$Gd_gdbh)->column('Gd_cpmc','Gd_gdbh');
  85. //组员信息
  86. $list = Db::table('设备_产量计酬')->where($where)->field($field)->select();
  87. $totalA = Db::table('设备_产量计酬')->where($where)->where('sczl_bzdh','A班')->field('SUM(sczl_cl) as 产量')->select();
  88. $totalB = Db::table('设备_产量计酬')->where($where)->where('sczl_bzdh','B班')->field('SUM(sczl_cl) as 产量')->select();
  89. if (empty($list)){
  90. $this->error('未找到机台数据');
  91. }
  92. foreach ($list as $key=>$value){
  93. $list[$key]['产品名称'] = $value['工单编号'].'---'.$productName[$value['工单编号']];
  94. if ($value['yjno']<10){
  95. $list[$key]['yjno'] = '0'.$value['yjno'];
  96. }
  97. $list[$key]['工序'] = $list[$key]['yjno'].'-'.$list[$key]['gxmc'];
  98. $list[$key]['备注'] = $value['bzdh'].'('.$value['num'].')'.date('H:i',strtotime($value['sj1'])).'<-->'.date('H:i',strtotime($value['sj2']));
  99. $list[$key]['千件工价'] = $machineDetail['千件工价'];
  100. $list[$key]['日定额'] = $machineDetail['日定额'];
  101. for ($i=1;$i<11;$i++){
  102. if (isset($value['sczl_bh'.$i])){
  103. $name = Db::table('人事_基本资料')->where('员工编号',$value['sczl_bh'.$i])->field('rtrim(员工姓名) as name')->find();
  104. if (isset($name['name'])){
  105. $list[$key]['组员'.$i] = $value['sczl_bh'.$i].$name['name'].'('.((float)$value['sczl_rate'.$i]*100).'%'.')';
  106. }
  107. }
  108. unset($list[$key]['sczl_bh'.$i],$list[$key]['sczl_rate'.$i]);
  109. }
  110. unset($list[$key]['工序编号'],$list[$key]['yjno'],$list[$key]['gxmc'],$list[$key]['num'],$list[$key]['sj1'],$list[$key]['sj2'],$list[$key]['bzdh']);
  111. }
  112. $list['totalA'] = $totalA[0]['产量'];
  113. $list['totalB'] = $totalB[0]['产量'];
  114. $this->success('成功',$list);
  115. }
  116. /**
  117. * 当日制程检验记录
  118. * @ApiMethod (GET)
  119. * @param string $machine 机台编号
  120. * @param string $date 日期
  121. * @return void
  122. * @throws \think\db\exception\DataNotFoundException
  123. * @throws \think\db\exception\ModelNotFoundException
  124. * @throws \think\exception\DbException
  125. */
  126. public function Inspect()
  127. {
  128. if ($this->request->isGet() === false){
  129. $this->error('请求错误');
  130. }
  131. $machine = input('machine');
  132. $date = input('date');
  133. if (empty($machine) || empty($date)){
  134. $this->error('参数错误');
  135. }
  136. $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
  137. $startId = $last_id['UniqId']-1000000;
  138. $where = [
  139. '设备编号' => $machine,
  140. '开工时间' => ['between',[date('Y-m-d 08:00:00',strtotime($date)),date('Y-m-d 08:00:00',strtotime($date)+86400)]],
  141. '类别' => ['in',['IPQC检验','机台检验']],
  142. 'UniqId' => ['>',$startId],
  143. ];
  144. $begin = Db::table('制程检验_记录')->where($where)->field('UniqId')->find();
  145. $end = Db::table('制程检验_记录')->where($where)->order('UniqId desc')->field('UniqId')->find();
  146. $where['UniqId'] = ['between',[$begin['UniqId'],$end['UniqId']+1]];
  147. //检验项目筛选
  148. $itemA = Db::table('制程检验_记录')->where($where)->distinct(true)->where('班组编号','A班')->column('rtrim(检验项目)');
  149. $itemB = Db::table('制程检验_记录')->where($where)->distinct(true)->where('班组编号','B班')->column('rtrim(检验项目)');
  150. //检验时间
  151. $InspectionTime = Db::table('制程检验_记录')->where($where)->distinct(true)->column('提交时间');
  152. foreach ($InspectionTime as $k=>$v){
  153. $InspectionTime[$k] = date('H:i',strtotime($v));
  154. }
  155. //检测记录详情
  156. $field = 'rtrim(工单编号) as 工单编号,rtrim(印件号) as 印件号,rtrim(工序名称) as 工序名称';
  157. $nameDetailA = Db::table('制程检验_记录')->where($where)->field($field)->where('班组编号','A班')->find();
  158. $nameDetailB = Db::table('制程检验_记录')->where($where)->field($field)->where('班组编号','B班')->find();
  159. $list = $data1 = $data2 = [];
  160. //A班检测数据
  161. foreach ($itemA as $key=>$value){
  162. $SubmissionTime = Db::table('制程检验_记录')->where($where)
  163. ->where('班组编号','A班')
  164. ->where('检验项目',$value)
  165. ->where('检验结果','合格')
  166. ->field('rtrim(提交时间) as 提交时间')
  167. ->select();
  168. $time = [];
  169. foreach ($SubmissionTime as $k=>$v){
  170. $time[$k] = date('H:i',strtotime($v['提交时间']));
  171. }
  172. $data1[$key] = [
  173. '工单编号' => $nameDetailA['工单编号'],
  174. '印件号' => $nameDetailA['印件号'],
  175. '工序名称' => $nameDetailA['工序名称'],
  176. '检验项目' => $value,
  177. 'inspectresult' => implode(',',$time),
  178. ];
  179. }
  180. //B班数据详情
  181. foreach ($itemB as $key=>$value){
  182. $SubmissionTime = Db::table('制程检验_记录')->where($where)
  183. ->where('班组编号','B班')
  184. ->where('检验项目',$value)
  185. ->where('检验结果','合格')
  186. ->field('rtrim(提交时间) as 提交时间')
  187. ->select();
  188. $time = [];
  189. foreach ($SubmissionTime as $k=>$v){
  190. $time[$k] = date('H:i',strtotime($v['提交时间']));
  191. }
  192. $data2[$key] = [
  193. '工单编号' => $nameDetailB['工单编号'],
  194. '印件号' => $nameDetailB['印件号'],
  195. '工序名称' => $nameDetailB['工序名称'],
  196. '检验项目' => $value,
  197. 'inspectresult' => implode(',',$time),
  198. ];
  199. }
  200. $list = array_merge($data2,$data1);
  201. $list['inspectiontime'] = $InspectionTime;
  202. $this->success('成功',$list);
  203. }
  204. /**
  205. * 设备生产中工单信息
  206. * @ApiMethod (GET)
  207. * @param string $machine 机台编号
  208. * @return void
  209. * @throws \think\Exception
  210. * @throws \think\db\exception\DataNotFoundException
  211. * @throws \think\db\exception\ModelNotFoundException
  212. * @throws \think\exception\DbException
  213. */
  214. public function Production()
  215. {
  216. if ($this->request->isGet() === false){
  217. $this->error('请求错误');
  218. }
  219. $machine = input('machine');
  220. if (empty($machine)){
  221. $this->error('参数错误');
  222. }
  223. $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
  224. $startUniqid = $lastUniqid['UniqId']-10000;
  225. $workOrder = Db::table('设备_产量计酬')->where('sczl_jtbh',$machine)->where('UniqId','>',$startUniqid)->field('sczl_gdbh')->order('UniqId desc')->find();
  226. if (empty($workOrder)){
  227. $this->error('未找到正在生产工单');
  228. }
  229. $where = [
  230. 'Gy0_sbbh' => $machine,
  231. 'Gy0_gdbh' => $workOrder['sczl_gdbh']
  232. ];
  233. $list = Db::table('工单_工艺资料')->where($where)->find();
  234. if (empty($list)){
  235. $this->error('未找到正在生产工单');
  236. }
  237. $facilityWhere = [
  238. 'sczl_jtbh'=>$machine,
  239. 'sczl_gdbh'=>$list['Gy0_gdbh']
  240. ];
  241. $facilityField = 'sczl_bh1,sczl_bh2,sczl_bh3,sczl_bh4,sczl_bh5,sczl_bh6,sczl_bh7,sczl_bh8,sczl_bh9,sczl_bh10';
  242. $Ctaff = Db::table('设备_产量计酬')->where($facilityWhere)->where('UniqId','>',$startUniqid)->field($facilityField)->order('UniqId desc')->find();
  243. $data = [];
  244. foreach ($Ctaff as $key=>$value){
  245. if (!empty($value)){
  246. $staffName = Db::table('人事_基本资料')->where('员工编号',$value)->field('员工姓名,员工编号')->find();
  247. $data[$key] = [
  248. '员工编号' => rtrim($staffName['员工编号']),
  249. '员工姓名' => rtrim($staffName['员工姓名']),
  250. ];
  251. }
  252. }
  253. if ($list['Gy0_yjno']<10){
  254. $list['Gy0_yjno'] = '0'.$list['Gy0_yjno'];
  255. }
  256. if ($list['Gy0_gxh']<10){
  257. $list['Gy0_gxh'] = '0'.$list['Gy0_gxh'];
  258. }
  259. $data['工单编号'] = rtrim($list['Gy0_gdbh']);
  260. $data['印件编号'] = rtrim($list['Gy0_yjno']);
  261. $data['工序名称'] = rtrim($list['Gy0_gxh']).'-'.rtrim($list['Gy0_gxmc']).'【'.rtrim($list['Add_gxmc']).'】';
  262. $data['产品名称'] = Db::table('工单_基本资料')->where('Gd_gdbh',rtrim($list['Gy0_gdbh']))->field('rtrim(Gd_cpmc) as 产品名称')->find()['产品名称'];
  263. $this->success('成功',$data);
  264. }
  265. /**
  266. * 设备工作清单
  267. * @ApiMethod (GET)
  268. * @param string $machine 机台编号
  269. * @return void
  270. * @throws \think\db\exception\DataNotFoundException
  271. * @throws \think\db\exception\ModelNotFoundException
  272. * @throws \think\exception\DbException
  273. */
  274. public function EquipmentWorklist()
  275. {
  276. if ($this->request->isGet() === false){
  277. $this->error('请求错误');
  278. }
  279. $machine = input('machine');
  280. if (empty($machine)){
  281. $this->error('参数错误');
  282. }
  283. $lastTechonUniqId = Db::table('工单_工艺资料')->field('UniqId')->order('UniqId desc')->find();
  284. $startTechonUniqId = $lastTechonUniqId['UniqId']-10000;
  285. $lastYieldUniqId = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
  286. $startYieldUniqId = $lastYieldUniqId['UniqId']-100000;
  287. $workOrder = Db::table('设备_产量计酬')->where('sczl_jtbh',$machine)->field('sczl_gdbh')->where('UniqId','>',$startYieldUniqId)->order('UniqId desc')->find();
  288. $startTime = Db::table('工单_工艺资料')->where('Gy0_gdbh',$workOrder['sczl_gdbh'])->where('Gy0_sbbh',$machine)->where('UniqId','>',$startTechonUniqId)->field('Gy0_sj1')->order('UniqId desc')->find();
  289. $where = [
  290. 'UniqId' => ['>',$startTechonUniqId],
  291. 'Gy0_sbbh' => $machine,
  292. 'Gy0_sj1' => ['>= time',$startTime['Gy0_sj1']],
  293. ];
  294. $field = 'rtrim(Gy0_gdbh) as gdbh,rtrim(质量要求) as 质量信息,rtrim(Gy0_yjno) as yjno,rtrim(Gy0_gxh) as gxh,rtrim(Gy0_gxmc) as gxmc,
  295. rtrim(Add_gxmc) as add_gxmc,rtrim(Gy0_辅助工时) as 装版时数,rtrim(Gy0_小时产能) as 工序产能,rtrim(Gy0_生产工时) as 计划工时,
  296. rtrim(Gy0_sj1) as sj1,rtrim(Gy0_sj2) as sj2,rtrim(工序备注) as 排产备注';
  297. $orderList = Db::table('工单_工艺资料')
  298. ->where($where)
  299. ->where('Gy0_sj1','<','2099-01-01 00:00:00')
  300. ->field($field)
  301. ->order('UniqId desc')
  302. ->select();
  303. foreach ($orderList as $key=>$value){
  304. $orderList[$key]['工单编号|质量信息'] = $value['gdbh'].'|'.$value['质量信息'];
  305. $name = Db::table('工单_印件资料')->where(['Yj_Gdbh'=>$value['gdbh'],'yj_Yjno'=>$value['yjno']])->field('yj_yjmc')->find();
  306. if ($value['yjno']<10){
  307. $orderList[$key]['yjno'] = '0'.$value['yjno'];
  308. }
  309. if ($value['gxh']<10){
  310. $orderList[$key]['gxh'] = '0'.$value['gxh'];
  311. }
  312. $orderList[$key]['印件资料'] = $orderList[$key]['yjno'].'-'.rtrim($name['yj_yjmc']);
  313. $orderList[$key]['工序名称'] = $orderList[$key]['gxh'].'-'.$value['gxmc'].'【'.$value['add_gxmc'].'】';
  314. $scheduled = Db::table('工单_基本资料')->where('Gd_gdbh',$value['gdbh'])->field('rtrim(计划投料) as 计划产量')->find();
  315. $finished = Db::table('设备_产量计酬')
  316. ->where('sczl_gdbh',$value['gdbh'])
  317. ->where('sczl_jtbh',$machine)
  318. ->where('UniqId','>',$startYieldUniqId)
  319. ->order('UniqId desc')
  320. ->field('SUM(sczl_cl) as cl')
  321. ->select();
  322. $orderList[$key]['计划产量/已完成'] = $scheduled['计划产量'].'/'.$finished[0]['cl']=null?'':(int)$finished[0]['cl'];
  323. $orderList[$key]['计划生产时段'] =substr($value['sj1'],5,5).' '.substr($value['sj1'],11,5).'<-->'.substr($value['sj2'],5,5).' '.substr($value['sj2'],11,5);
  324. $orderList[$key]['产品名称'] = rtrim($name['yj_yjmc']);
  325. unset($orderList[$key]['gdbh'],$orderList[$key]['质量信息'],$orderList[$key]['yjno'],$orderList[$key]['gxh'],$orderList[$key]['gxmc'],$orderList[$key]['add_gxmc'],$orderList[$key]['sj1'],$orderList[$key]['sj2']);
  326. }
  327. $this->success('成功',$orderList);
  328. }
  329. /**
  330. * 工序、印件、完成数量
  331. * @ApiMethod (GET)
  332. * @param string $workOrder 工单编号
  333. * @return void
  334. * @throws \think\Exception
  335. * @throws \think\db\exception\DataNotFoundException
  336. * @throws \think\db\exception\ModelNotFoundException
  337. * @throws \think\exception\DbException
  338. */
  339. public function Procedure()
  340. {
  341. if ($this->request->isGet() === false){
  342. $this->error('请求错误');
  343. }
  344. $workOrder = input('Gd_gdbh');
  345. if (empty($workOrder)){
  346. $this->error('参数错误');
  347. }
  348. $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
  349. $startUniqid = $lastUniqid['UniqId']-100000;
  350. //右边工艺及完成数量
  351. $Process = Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)->where('UniqId','>',$startUniqid)->distinct(true)->order('sczl_gxh')->column('sczl_gxh');
  352. $data = [];
  353. foreach ($Process as $k=>$v){
  354. $res= Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)
  355. ->where('UniqId','>',$startUniqid)
  356. ->where('sczl_gxh',$v)
  357. ->field('rtrim(sczl_yjno) as sczl_yjno,rtrim(sczl_gxmc) as sczl_gxmc')
  358. ->find();
  359. if ($res['sczl_yjno']<10){
  360. $res['sczl_yjno'] = '0'.$res['sczl_yjno'];
  361. }
  362. $processList['process'] = $res['sczl_yjno'].'-'.$res['sczl_gxmc'];
  363. $processList['completed'] = Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)->where('UniqId','>',$startUniqid)->where('sczl_gxh',$v)->count();
  364. array_push($data,$processList);
  365. }
  366. $this->success('成功',$data);
  367. }
  368. /**
  369. * 班组人员及分配比例
  370. * @ApiMethod (GET)
  371. * @param string $machine 机台编号
  372. * @return void
  373. * @throws \think\db\exception\DataNotFoundException
  374. * @throws \think\db\exception\ModelNotFoundException
  375. * @throws \think\exception\DbException
  376. */
  377. public function Team()
  378. {
  379. if ($this->request->isGet() === false){
  380. $this->error('请求错误');
  381. }
  382. $machine = input('machine');
  383. if (empty($machine)){
  384. $this->error('参数错误');
  385. }
  386. $where = [
  387. 'sczl_jtbh' => $machine,
  388. ];
  389. $field = 'rtrim(sczl_bzdh) as 班组号,rtrim(sczl_bh1) as bh1,rtrim(sczl_bh2) as bh2,rtrim(sczl_bh3) as bh3,rtrim(sczl_bh4) as bh4,
  390. rtrim(sczl_bh5) as bh5,rtrim(sczl_bh6) as bh6,rtrim(sczl_bh7) as bh7,rtrim(sczl_bh8) as bh8,rtrim(sczl_bh9) as bh9,
  391. rtrim(sczl_bh10) as bh10,rtrim(sczl_rate1) as rate1,rtrim(sczl_rate2) as rate2,rtrim(sczl_rate3) as rate3,rtrim(sczl_rate4) as rate4,
  392. rtrim(sczl_rate5) as rate5,rtrim(sczl_rate6) as rate6,rtrim(sczl_rate7) as rate7,rtrim(sczl_rate8) as rate8,
  393. rtrim(sczl_rate9) as rate9,rtrim(sczl_rate10) as rate10,rtrim(UniqId) as ID';
  394. $team = Db::table('设备_产量计酬')
  395. ->where('sczl_jtbh',$machine)
  396. ->field($field)
  397. ->order('UniqId desc')
  398. ->find();
  399. $list = Db::table('设备_班组资料')->where($where)->field($field)->select();
  400. $data = [];
  401. foreach ($list as $k=>$v){
  402. if ($team == $v){
  403. $data[$k]['status'] = 1;
  404. }else{
  405. $data[$k]['status'] = 0;
  406. }
  407. $data[$k]['ID'] = $v['ID'];
  408. $data[$k]['班组号'] = $v['班组号'];
  409. for ($i=1;$i<11;$i++){
  410. if ($v['bh'.$i] != '' && $v['bh'.$i] != '000000'){
  411. $name = Db::table('人事_基本资料')->where('员工编号',$v['bh'.$i])->field('rtrim(员工姓名) as 姓名')->find();
  412. $data[$k][$i-1] = $v['bh'.$i].' '.$name['姓名'].' ('.number_format($v['rate'.$i]*100,2).'%'.')';
  413. }
  414. }
  415. }
  416. $this->success('成功',$data);
  417. }
  418. /**
  419. * 当班产量明细
  420. * @ApiMethod (GET)
  421. * @param string $machine 机台编号
  422. * @param string $workOrder 工单编号
  423. * @param string $team 班次
  424. * @return void
  425. * @throws \think\db\exception\DataNotFoundException
  426. * @throws \think\db\exception\ModelNotFoundException
  427. * @throws \think\exception\DbException
  428. */
  429. public function OutputDetail()
  430. {
  431. if ($this->request->isGet() === false){
  432. $this->error('请求错误');
  433. }
  434. $machine = input('machine');
  435. $workOrder = input('Gd_gdbh');
  436. $team = input('team');
  437. if (empty($machine) || empty($workOrder) || empty($team)){
  438. $this->error('参数错误');
  439. }
  440. $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
  441. $startUniqid = $lastUniqid['UniqId']-100000;
  442. $name = Db::table('工单_基本资料')->where('Gd_gdbh',$workOrder)->field('rtrim(Gd_cpmc) as productName')->find();
  443. $where = [
  444. 'UniqId' => ['>',$startUniqid],
  445. 'sczl_gdbh' => $workOrder,
  446. 'sczl_jtbh' => $machine,
  447. 'sczl_cl' => ['<>',0.0],
  448. 'sczl_bzdh' => $team,
  449. ];
  450. $field = 'rtrim(sczl_gdbh) as 工单编号,rtrim(sczl_yjno) as yjno,rtrim(sczl_gxmc) as gxmc,rtrim(sczl_num) as 标牌号,rtrim(sczl_cl) as 产量,
  451. rtrim(sczl_zcfp) as 制程废品,rtrim(sczl_zccp) as 制程次品,rtrim(sczl_前工序废) as 前工序废,rtrim(sczl_来料少数) as 来料异常,rtrim(sczl_装版工时) as 装版工时,
  452. rtrim(sczl_保养工时) as 保养工时,rtrim(sczl_打样工时) as 打样工时,rtrim(sczl_异常停机工时) as 异常停机工时,rtrim(sczl_设备运行工时) as 通电工时,
  453. rtrim(码开始行) as 码开始行,rtrim(码结束行) as 码结束行,rtrim(码包) as 码包,rtrim(主电表) as 主电表,rtrim(辅电表) as 辅电表,rtrim(sczl_ms) as 色度,
  454. rtrim(sczl_sj1) as sj1,rtrim(sczl_sj2) as sj2';
  455. $list = Db::table('设备_产量计酬')->where($where)->field($field)->order('UniqId desc')->select();
  456. if (empty($list)){
  457. $this->error('未找到生产记录');
  458. }
  459. foreach ($list as $k=>$v){
  460. if ($v['yjno']<10){
  461. $list[$k]['yjno'] = '0'.$v['yjno'];
  462. }
  463. $list[$k]['印件及工序'] = $list[$k]['yjno'].'-'.$v['gxmc'];
  464. $list[$k]['生产时间段'] = substr($v['sj1'],5,5).' '.substr($v['sj1'],11,5).'<-->'.substr($v['sj2'],5,5).' '.substr($v['sj2'],11,5);
  465. $list[$k]['产品名称'] = $name['productName'];
  466. unset($list[$k]['yjno'],$list[$k]['gxmc'],$list[$k]['sj1'],$list[$k]['sj2']);
  467. }
  468. $field1 = 'SUM(sczl_cl) as 产量,SUM(sczl_zcfp) as 制程废品,SUM(sczl_zccp) as 制程次品,SUM(sczl_前工序废) as 前工序废,
  469. SUM(sczl_来料少数) as 来料异常,SUM(sczl_装版工时) as 装版工时,SUM(sczl_保养工时) as 保养工时,SUM(sczl_打样工时) as 打样工时,
  470. SUM(sczl_异常停机工时) as 异常停机工时,SUM(sczl_设备运行工时) as 通电工时,SUM(码开始行) as 码开始行,SUM(码结束行) as 码结束行,
  471. SUM(码包) as 码包,SUM(主电表) as 主电表,SUM(辅电表) as 辅电表';
  472. $total = Db::table('设备_产量计酬')->where($where)->field($field1)->order('UniqId desc')->select();
  473. $total[0]['版数'] = count($list);
  474. $list['total'] = $total[0];
  475. $this->success('成功',$list);
  476. }
  477. /**
  478. * 检验记录
  479. * @ApiMethod (GET)
  480. * @param string $machine 机台编号
  481. * @param string $workOrder 工单编号
  482. * @param string $team 班次
  483. * @return void
  484. * @throws \think\db\exception\DataNotFoundException
  485. * @throws \think\db\exception\ModelNotFoundException
  486. * @throws \think\exception\DbException
  487. */
  488. public function InspectionRecord()
  489. {
  490. if ($this->request->isGet() === false){
  491. $this->error('请求失败');
  492. }
  493. $machine = input('machine');
  494. $workOrder = input('Gd_gdbh');
  495. $team = input('team');
  496. if (empty($machine) || empty($workOrder) || empty($team)){
  497. $this->error('参数错误');
  498. }
  499. $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
  500. $startId = $last_id['UniqId']-100000;
  501. $where = [
  502. '设备编号' => $machine,
  503. '工单编号' => $workOrder,
  504. '班组编号' => $team,
  505. '类别' => ['in',['IPQC检验','机台检验']],
  506. 'UniqId' => ['>',$startId],
  507. ];
  508. //检验项目筛选
  509. $item = Db::table('制程检验_记录')->where($where)->distinct(true)->column('rtrim(检验项目)');
  510. //检验时间
  511. $InspectionTime = Db::table('制程检验_记录')->where($where)->distinct(true)->column('提交时间');
  512. foreach ($InspectionTime as $k=>$v){
  513. $InspectionTime[$k] = date('H:i',strtotime($v));
  514. }
  515. //检测记录详情
  516. $field = 'rtrim(工单编号) as 工单编号,rtrim(印件号) as 印件号,rtrim(工序名称) as 工序名称';
  517. $nameDetail = Db::table('制程检验_记录')->where($where)->field($field)->find();
  518. $data = [];
  519. //检测数据
  520. foreach ($item as $key=>$value){
  521. $SubmissionTime = Db::table('制程检验_记录')->where($where)
  522. ->where('检验项目',$value)
  523. ->where('检验结果','合格')
  524. ->field('rtrim(提交时间) as 提交时间')
  525. ->select();
  526. $time = [];
  527. foreach ($SubmissionTime as $k=>$v){
  528. $time[$k] = date('H:i',strtotime($v['提交时间']));
  529. }
  530. $data[$key] = [
  531. '工单编号' => $nameDetail['工单编号'],
  532. '印件号' => $nameDetail['印件号'],
  533. '工序名称' => $nameDetail['工序名称'],
  534. '检验项目' => $value,
  535. 'inspectresult' => implode(',',$time),
  536. ];
  537. }
  538. $data['inspectiontime'] = $InspectionTime;
  539. $this->success('成功',$data);
  540. }
  541. //班组维护
  542. public function TeamMaintenance()
  543. {
  544. if ($this->request->isPost() === false){
  545. $this->error('请求错误');
  546. }
  547. $data = $this->request->param();
  548. if (empty($data)){
  549. $this->error('参数错误');
  550. }
  551. $field = 'rtrim(sczl_bzdh) as sczl_bzdh,rtrim(sczl_bh1) as sczl_bh1,rtrim(sczl_bh2) as sczl_bh2,rtrim(sczl_bh3) as sczl_bh3,rtrim(sczl_bh4) as sczl_bh4,
  552. rtrim(sczl_bh5) as sczl_bh5,rtrim(sczl_bh6) as sczl_bh6,rtrim(sczl_bh7) as sczl_bh7,rtrim(sczl_bh8) as sczl_bh8,rtrim(sczl_bh9) as sczl_bh9,
  553. rtrim(sczl_bh10) as sczl_bh10,rtrim(sczl_rate1) as sczl_rate1,rtrim(sczl_rate2) as sczl_rate2,rtrim(sczl_rate3) as sczl_rate3,rtrim(sczl_rate4) as sczl_rate4,
  554. rtrim(sczl_rate5) as sczl_rate5,rtrim(sczl_rate6) as sczl_rate6,rtrim(sczl_rate7) as sczl_rate7,rtrim(sczl_rate8) as sczl_rate8,
  555. rtrim(sczl_rate9) as sczl_rate9,rtrim(sczl_rate10) as sczl_rate10';
  556. $TeamList = Db::table('设备_班组资料')->where('UniqId',$data['ID'])->field($field)->find();
  557. }
  558. /**
  559. * 机台编号列表
  560. * @ApiMethod (GET)
  561. * @return void
  562. */
  563. public function MachineList()
  564. {
  565. if ($this->request->isGet() === false){
  566. $this->error('请求错误');
  567. }
  568. $list = Db::table('设备_基本资料')->column('设备编号');
  569. if (empty($list)){
  570. $this->error('未找到机台编号');
  571. }
  572. $this->success('成功',$list);
  573. }
  574. /**
  575. * 删除班组信息
  576. * @ApiMethod (GET)
  577. * @param void
  578. * @return void
  579. * @throws \think\Exception
  580. * @throws \think\exception\PDOException
  581. */
  582. public function teamDel()
  583. {
  584. if ($this->request->isPost() === false){
  585. $this->error('请求错误');
  586. }
  587. $param = $this->request->param();
  588. if (empty($param)){
  589. $this->error('参数错误');
  590. }
  591. $res = Db::table('设备_班组资料')
  592. ->where('UniqId',$param['UniqId'])
  593. ->delete();
  594. if ($res !== false){
  595. $this->success('成功');
  596. }else{
  597. $this->error('失败');
  598. }
  599. }
  600. //制程检验记录->指标检验
  601. public function ProcessInspectionRecords()
  602. {
  603. if ($this->request->isGet() === false){
  604. $this->error('请求错误');
  605. }
  606. $param = $this->request->param();
  607. if (empty($param)){
  608. $this->error('参数错误');
  609. }
  610. // $filed = ''
  611. }
  612. /**
  613. * 管理人员现场巡检记录->展示
  614. * @ApiMethod (GET)
  615. * @param void
  616. * @return void
  617. * @throws \think\db\exception\DataNotFoundException
  618. * @throws \think\db\exception\ModelNotFoundException
  619. * @throws \think\exception\DbException
  620. */
  621. public function FieldInspectionRecord()
  622. {
  623. if ($this->request->isGet() === false){
  624. $this->error('请求错误');
  625. }
  626. $param = $this->request->param();
  627. if (empty($param)){
  628. $this->error('参数错误');
  629. }
  630. $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
  631. $startId = $last_id['UniqId']-100000;
  632. $date = date('Y-m-d H:i:s',time());
  633. $startTime = date('Y-m-d 08:30:00',time());
  634. if ($date<$startTime){
  635. $startTime = date('Y-m-d H:i:s',strtotime($startTime)-86400);
  636. }
  637. $where = [
  638. '工单编号' => $param['workOrder'],
  639. '开工时间' => $startTime,
  640. '类别' => '现场巡查记录',
  641. '班组编号' => $param['team']
  642. ];
  643. $filed = 'rtrim(工单编号) as 工单编号,rtrim(印件号) as 印件号,rtrim(工序名称) as 工序名称,rtrim(流程单号) as 流程单号,
  644. rtrim(设备编号) as 设备编号,rtrim(班组编号) as 班组编号,rtrim(检验项目) as 现场管理人员,rtrim(检验备注) as 检验备注,
  645. rtrim(提交时间) as 提交时间,rtrim(开工时间) as 开工时间';
  646. $list = Db::table('制程检验_记录')->where($where)
  647. ->where('UniqId','>',$startId)
  648. ->field($filed)
  649. // ->fetchSql(true)
  650. ->select();
  651. if (empty($list)){
  652. $this->error('未找到该工单当前班次巡检记录');
  653. }
  654. foreach ($list as $key=>$value){
  655. $number = floor((strtotime($value['提交时间'])-strtotime($value['开工时间']))/(15*60));
  656. $list[$key]['归属时段'] = $value['开工时间'];
  657. $list[$key]['分钟差数'] = $number;
  658. if ($number != 0){
  659. $list[$key]['归属时段'] = date('Y-m-d H:i:s',strtotime($value['开工时间'])+$number*15*60);
  660. }
  661. }
  662. $this->success('成功',$list);
  663. }
  664. /**
  665. * 管理人员现场巡检记录->添加
  666. * @ApiMethod (POST)
  667. * @param void
  668. * @return void
  669. */
  670. public function FieldInspectionRecordAdd()
  671. {
  672. if ($this->request->isPost() === false){
  673. $this->error('请求错误');
  674. }
  675. $param = $this->request->param();
  676. if (empty($param)){
  677. $this->error('参数错误');
  678. }
  679. if ($param['processCode']<10){
  680. $param['processCode'] = '0'.$param['processCode'];
  681. }
  682. $date = date('Y-m-d H:i:s',time());
  683. $startTime = date('Y-m-d 08:30:00',time());
  684. if ($date<$startTime){
  685. $startTime = date('Y-m-d H:i:s',strtotime($startTime)-86400);
  686. }
  687. $data = [
  688. '类别' => $param['category'],
  689. '工单编号' => $param['workOrder'],
  690. '印件号' => $param['printCode'],
  691. '工序名称' => $param['processCode'].'-'.$param['process'],
  692. '流程单号' => $param['flowCode'],
  693. '设备编号' => $param['machine'],
  694. '班组编号' => $param['team'],
  695. '检验项目' => '['.$param['employeeCode'].'/'.$param['employeeName'].']',
  696. '相关标准' => '',
  697. '量测仪器' => '',
  698. '检验结果' => '',
  699. '检验备注' => $param['remark'],
  700. '提交时间' => date('Y-m-d H:i:s',time()),
  701. '开工时间' => $startTime,
  702. 'sys_id' => '',
  703. 'sys_rq' => date('Y-m-d H:i:s',time()),
  704. 'mod_rq' => '',
  705. 'UniqId' => Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find()['UniqId']+1
  706. ];
  707. $sql = Db::table('制程检验_记录')->fetchSql(true)->insert($data);
  708. $res = Db::query($sql);
  709. if ($res !== false){
  710. $this->success('成功');
  711. }else{
  712. $this->error('失败');
  713. }
  714. }
  715. /**
  716. * 设备点检->左侧菜单栏
  717. * @ApiMethod (GET)
  718. * @param void
  719. * @return void
  720. */
  721. public function SpotCheckItem()
  722. {
  723. if ($this->request->isGet() === false){
  724. $this->error('请求错误');
  725. }
  726. $param = $this->request->param();
  727. if (empty($param)){
  728. $this->error('参数错误');
  729. }
  730. $list = Db::table('设备_点检项目')
  731. ->where('适用机型','LIKE','%;'.$param['machine'].';%')
  732. ->distinct(true)
  733. ->column('部件名称','部件编号');
  734. if (empty($list)){
  735. $this->error('未找到检验项目');
  736. }
  737. $this->success('成功',$list);
  738. }
  739. /**
  740. * 设备点检->检测项目
  741. * @ApiMethod (GET)
  742. * @param void
  743. * @return void
  744. * @throws \think\db\exception\DataNotFoundException
  745. * @throws \think\db\exception\ModelNotFoundException
  746. * @throws \think\exception\DbException
  747. */
  748. public function InspectionItem()
  749. {
  750. if ($this->request->isGet() === false){
  751. $this->error('请求错误');
  752. }
  753. $param = $this->request->param();
  754. if (empty($param)){
  755. $this->error('参数错误');
  756. }
  757. $list = Db::table('设备_点检项目')
  758. ->where('部件名称',$param['unitName'])
  759. ->field('rtrim(检验项目) as 检验项目,rtrim(判定标准) as 判定标准,rtrim(点检方法) as 点检方法')
  760. ->select();
  761. if (empty($list)){
  762. $this->error('未找到检测项目');
  763. }
  764. $this->success('成功',$list);
  765. }
  766. /**
  767. * 设备点检->检测记录添加
  768. * @ApiMethod (POST)
  769. * @param void
  770. * @return void
  771. * @throws \think\db\exception\DataNotFoundException
  772. * @throws \think\db\exception\ModelNotFoundException
  773. * @throws \think\exception\DbException
  774. */
  775. public function InspectionItemAdd()
  776. {
  777. if ($this->request->isPost() === false){
  778. $this->error('请求错误');
  779. }
  780. $param = $this->request->param();
  781. if (empty($param)){
  782. $this->error('参数错误');
  783. }
  784. $data = [
  785. 'team' => $param['team'],
  786. 'machine' => $param['machine'],
  787. 'unitName' => $param['unitName']
  788. ];
  789. unset($param['team'],$param['machine'],$param['unitName']);
  790. $lastId = Db::table('设备_点检记录')->field('rtrim(Uniqid) as id')->order('Uniqid desc')->find();
  791. $unitCode = Db::table('设备_点检项目')->where('部件名称',$data['unitName'])->field('rtrim(部件编号) as 部件编号')->find();
  792. $row = [];
  793. $param = array_values($param);
  794. foreach ($param as $key=>$value){
  795. $value = explode(';',$value);
  796. $row[$key] = [
  797. '日期' => date('Y-m-d 00:00:00',time()),
  798. '班组编号' => $data['team'],
  799. '点检设备' => $data['machine'],
  800. '部件编号' => $unitCode['部件编号'],
  801. '部件名称' => $data['unitName'],
  802. '检验项目' => $value[0],
  803. '判定标准' => $value[4],
  804. '点检方法' => $value[1],
  805. '点检结果' => $value[2],
  806. '备注说明' => $value[3],
  807. 'Sys_id' =>'',
  808. 'Sys_rq' => date('Y-m-d H:i:s',time()),
  809. 'Mod_rq' => '',
  810. 'Uniqid' => $lastId['id']+$key+1
  811. ];
  812. }
  813. $sql = Db::table('设备_点检记录')->fetchSql(true)->insertAll($row);
  814. $res = Db::query($sql);
  815. if ($res !== false){
  816. $this->success('成功');
  817. }else{
  818. $this->error('失败');
  819. }
  820. }
  821. /**
  822. * 机台印版领用->左侧菜单
  823. * @ApiMethod (GET)
  824. * @param void
  825. * @return void
  826. */
  827. public function PrintGetTab()
  828. {
  829. if ($this->request->isGet() === false){
  830. $this->error('请求错误');
  831. }
  832. $param = $this->request->param();
  833. if (empty($param)){
  834. $this->error('参数错误');
  835. }
  836. $productCode = $param['productCode'];
  837. $sql = "SELECT DISTINCT(RTRIM(b.`名称`)) as `印版分类`,RTRIM(b.`编号`) as `编号` FROM `产品_印版资料` as a
  838. JOIN `物料_存货结构` as b ON b.`编号` = SUBSTRING(a.`存货编码`,1,4)
  839. WHERE a.YB_Cpdh = '{$productCode}'";
  840. $res = Db::query($sql);
  841. if (empty($res)){
  842. $this->error('未找到该产品印版资料');
  843. }
  844. $this->success('成功',$res);
  845. }
  846. /**
  847. * 机台印版领用记录->数据详情
  848. * @ApiMethod (GET)
  849. * @param void
  850. * @return void
  851. */
  852. public function PrintDetail()
  853. {
  854. if ($this->request->isGet() === false){
  855. $this->error('请求失败');
  856. }
  857. $param = $this->request->param();
  858. if (empty($param)){
  859. $this->error('参数错误');
  860. }
  861. $productCode = $param['productCode'];
  862. $code = $param['code'].'%';
  863. $workOrder = $param['workOrder'];
  864. $sql = "SELECT
  865. RTRIM(a.`存货编码`) as `存货编码`,
  866. RTRIM(c.`物料名称`) as `存货名称`,
  867. RTRIM(b.`印版名称`) as `印版名称`,
  868. RTRIM(b.`供方批号`) as `供方批号`,
  869. RTRIM(b.`制造日期`) as `制造日期`,
  870. SUM(d.`Yb_印数`) as `印数`,
  871. RTRIM(e.`名称`) as `印版类别`,
  872. SUBSTRING(a.YB_Cpdh,1,4) as `客户编号`,
  873. RTRIM(f.`Gd_客户名称`) as `客户名称`,
  874. RTRIM(a.YB_Cpdh) as `产品编号`,
  875. RTRIM(f.Gd_cpmc) as `产品名称`
  876. FROM `产品_印版资料` as a
  877. LEFT JOIN `产品_印版库` as b ON b.`存货编码` = a.`存货编码`
  878. JOIN `物料_存货编码` as c ON c.`物料代码` = a.`存货编码`
  879. LEFT JOIN `工单_印版领用记录` as d ON d.`Yb_供方批号` = b.`供方批号`
  880. JOIN `物料_存货结构` as e ON e.`编号` = SUBSTRING(a.`存货编码`,1,4)
  881. JOIN `工单_基本资料` as f ON a.YB_Cpdh = f.Gd_cpdh
  882. WHERE a.YB_Cpdh = '{$productCode}'
  883. AND a.`存货编码` LIKE '{$code}'
  884. AND f.Gd_gdbh = '{$workOrder}'
  885. AND b.`报废日期` = '1900-01-01 00:00:00'
  886. GROUP BY b.`供方批号`
  887. ORDER BY a.`存货编码`";
  888. $list = Db::query($sql);
  889. if (empty($list)){
  890. $this->error('未找到印版');
  891. }
  892. $this->success('成功',$list);
  893. }
  894. //换型清场记录->左侧菜单栏
  895. public function remodelGetTab()
  896. {
  897. if ($this->request->isGet() === false){
  898. $this->error('请求错误');
  899. }
  900. $date = date('Y-m-d 00:00:00',time()-3888000);
  901. $nowTime = date('Y-m-d H:i:s',time());
  902. $list = Db::table('设备_基本资料')->where('使用状态',1)->order('设备编号')->column('设备编号');
  903. if (empty($list)){
  904. $this->error('失败');
  905. }
  906. $sql = "SELECT RTRIM(a.`设备编号`) as `设备编号`,RTRIM(b.`日期`) as `日期`,RTRIM(b.UniqId) as UniqId FROM `设备_基本资料` as a
  907. LEFT JOIN `制程_换型清场` as b ON b.`机台编号` = a.`设备编号`
  908. WHERE b.`日期` > '{$date}' AND b.日期 < '{$nowTime}' ORDER BY b.`日期`";
  909. $res = Db::query($sql);
  910. $data = [];
  911. foreach ($list as $key=>$value){
  912. $i=0;
  913. $data[$value] = [];
  914. foreach ($res as $k=>$v){
  915. $row = [];
  916. if ($value === $v['设备编号']){
  917. $row[$i] = [
  918. '日期' => $v['日期'],
  919. 'id' => $v['UniqId']
  920. ];
  921. $i++;
  922. foreach ($row as $vv){
  923. }
  924. array_push($data[$value],$row);
  925. }
  926. }
  927. }
  928. $this->success('成功',$data);
  929. }
  930. }