Selaa lähdekoodia

设备运行跟踪

qiuenguang 1 vuosi sitten
vanhempi
commit
0e9042b0eb
1 muutettua tiedostoa jossa 46 lisäystä ja 1 poistoa
  1. 46 1
      application/api/controller/Facility.php

+ 46 - 1
application/api/controller/Facility.php

@@ -42,7 +42,7 @@ class Facility extends Api
                     if ($vv['设备编号'] !== 'ZH01#'){
                         $date = Db::table('设备_产量计酬')
                             ->where('sczl_jtbh',$vv['设备编号'])
-                            ->where('sczl_rq','> time',$date)
+//                            ->where('sczl_rq','> time',$date)
                             ->distinct(true)
                             ->cache(true)
                             ->limit(40)
@@ -972,4 +972,49 @@ class Facility extends Api
         }
         $this->success('成功',$data);
     }
+
+    /**
+     * 换型清场->详情
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function RemodelDetail()
+    {
+        if ($this->request->isGet() === false){
+            $this->error('请求错误');
+        }
+        $param = $this->request->param();
+        if (empty($param)){
+            $this->error('参数错误');
+        }
+        $field = 'rtrim(日期) as 日期,rtrim(班组) as 班组,rtrim(机台编号) as 机台编号,rtrim(工单编号A) as 工单编号A,rtrim(印件工序A) as 印件工序A,
+        rtrim(码包号A) as 码包号A,rtrim(工单编号B) as 工单编号B,rtrim(印件工序B) as 印件工序B,rtrim(码包号B) as 码包B,
+        rtrim(清场项目A) as 项目1,rtrim(清场项目B) as 项目2,rtrim(清场项目C) as 项目3,rtrim(清场项目D) as 项目4,rtrim(清场项目E) as 项目5,
+        rtrim(机长) as 机长,rtrim(班长) as 班长,rtrim(质量巡查员) as 质量巡查员';
+        $list = Db::table('制程_换型清场')->where('UniqId',$param['UniqId'])->field($field)->find();
+        if (empty($list)){
+            $this->error('未找到该条清场记录');
+        }
+        $list['日期'] = date('Y-m-d',strtotime($list['日期']));
+        $list['印件名称A'] = Db::table('工单_印件资料')->where('Yj_Gdbh',$list['工单编号A'])->field('rtrim(yj_yjmc) as yjmc')->find()['yjmc'];
+        $list['印件名称B'] = Db::table('工单_印件资料')->where('Yj_Gdbh',$list['工单编号B'])->field('rtrim(yj_yjmc) as yjmc')->find()['yjmc'];
+        $this->success('成功',$list);
+    }
+
+    //换型清场->当前清场记录
+    public function ModelChangeRecord()
+    {
+        if ($this->request->isGet() === false){
+            $this->error('请求错误');
+        }
+        $param = $this->request->param();
+        if (empty($param)){
+            $this->error('参数错误');
+        }
+        $date = date('Y-m-d 00:00:00',time()-3888000);
+        $nowTime = date('Y-m-d H:i:s',time());
+
+    }
 }