|
|
@@ -50,6 +50,7 @@ class Inspect extends Api
|
|
|
}
|
|
|
$this->success('请求成功',$list);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 获取某个日期手工单据
|
|
|
*
|
|
|
@@ -93,6 +94,7 @@ class Inspect extends Api
|
|
|
|
|
|
$this->success('请求成功',$data);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 获取机器检验左侧菜单栏
|
|
|
*
|
|
|
@@ -121,6 +123,7 @@ class Inspect extends Api
|
|
|
}
|
|
|
$this->success('请求成功',$list);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 获取某个日期机器单据
|
|
|
*
|
|
|
@@ -168,4 +171,354 @@ class Inspect extends Api
|
|
|
$data['total'] = $count;
|
|
|
$this->success('请求成功',$data);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 定位
|
|
|
+ * @ApiMethod (GET)
|
|
|
+ * @param string $gdbh 工单编号
|
|
|
+ * @param string $cpmc 产品名称
|
|
|
+ * @param string $page 页码
|
|
|
+ * @param string $limit 数量
|
|
|
+ */
|
|
|
+ public function locate()
|
|
|
+ {
|
|
|
+ //get请求
|
|
|
+ if(!$this->request->isGet()){
|
|
|
+ $this->error('请求方式错误');
|
|
|
+ }
|
|
|
+ $req = $this->request->param();
|
|
|
+
|
|
|
+ $page = 1;
|
|
|
+ $limit = 15;
|
|
|
+ if (isset($req['page']) && !empty($req['page'])) $page = $req['page'];
|
|
|
+ if (isset($req['limit']) && !empty($req['limit'])) $limit = $req['limit'];
|
|
|
+
|
|
|
+ if (isset($req['gdbh']) && !empty($req['gdbh'])){
|
|
|
+ $where = [
|
|
|
+ 'a.sczl_gdbh'=>[ 'like', '%' . $req['gdbh'] . '%']
|
|
|
+ ];
|
|
|
+
|
|
|
+ $field = 'a.sczl_gdbh,a.sczl_yjgx,rtrim(a.sczl_gxmc) as sczl_gxmc,DATE(a.sczl_rq) as sczl_rq,a.sczl_cl,a.sczl_dedh,a.sczl_废品率系数,a.sczl_检验类别,a.sczl_bh0,
|
|
|
+ rtrim(a.qczl_NumDesc) as qczl_NumDesc,rtrim(a.sys_id) as sys_id,a.sys_rq,a.mod_rq,a.UniqId,b.千件工价,b.日定额,rtrim(c.员工姓名) as 员工姓名,rtrim(d.yj_yjmc) as yj_yjmc';
|
|
|
+ $rows = Db::name('db_手工检验')->alias('a')
|
|
|
+ ->join('dic_lzde b','a.sczl_dedh = b.sys_bh','left')
|
|
|
+ ->join('人事_基本资料 c','a.sczl_bh0 = c.员工编号','left')
|
|
|
+ ->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
+ ->where($where)
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->field($field)->page($page,$limit)->order('a.sczl_rq,a.UniqId asc')->select();
|
|
|
+
|
|
|
+ $option['sczl_gdbh'] = [ 'like', '%' . $req['gdbh'] . '%'];
|
|
|
+ $total = Db::name('db_手工检验')->where($option)->count();
|
|
|
+ }else{
|
|
|
+ if (isset($req['cpmc']) && !empty($req['cpmc'])){
|
|
|
+ //查询工单表
|
|
|
+ $gd = db()->table('工单_基本资料')
|
|
|
+ ->where('Gd_cpmc', 'LIKE', '%'.$req['cpmc'].'%')
|
|
|
+ ->column('Gd_gdbh');
|
|
|
+ $where = [
|
|
|
+ 'a.sczl_gdbh'=>['in', $gd]
|
|
|
+ ];
|
|
|
+ $field = 'a.sczl_gdbh,a.sczl_yjgx,rtrim(a.sczl_gxmc) as sczl_gxmc,DATE(a.sczl_rq) as sczl_rq,a.sczl_cl,a.sczl_dedh,a.sczl_废品率系数,a.sczl_检验类别,a.sczl_bh0,
|
|
|
+ rtrim(a.qczl_NumDesc) as qczl_NumDesc,rtrim(a.sys_id) as sys_id,a.sys_rq,a.mod_rq,a.UniqId,b.千件工价,b.日定额,rtrim(c.员工姓名) as 员工姓名,rtrim(d.yj_yjmc) as yj_yjmc';
|
|
|
+ $rows = Db::name('db_手工检验')->alias('a')
|
|
|
+ ->join('dic_lzde b','a.sczl_dedh = b.sys_bh','left')
|
|
|
+ ->join('人事_基本资料 c','a.sczl_bh0 = c.员工编号','left')
|
|
|
+ ->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
+ ->where($where)
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->field($field)->page($page,$limit)->order('a.sczl_rq,a.UniqId asc')->select();
|
|
|
+
|
|
|
+ $option['sczl_gdbh'] = ['in', $gd];
|
|
|
+ $total = Db::name('db_手工检验')->where($option)->count();
|
|
|
+ }else{
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $data = [
|
|
|
+ 'total' => $total,
|
|
|
+ 'rows' => $rows,
|
|
|
+ ];
|
|
|
+ $this->success('成功',$data);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 定位
|
|
|
+ * @ApiMethod (GET)
|
|
|
+ * @param string $gdbh 工单编号
|
|
|
+ * @param string $cpmc 产品名称
|
|
|
+ * @param string $page 页码
|
|
|
+ * @param string $limit 数量
|
|
|
+ */
|
|
|
+ public function machineLocate()
|
|
|
+ {
|
|
|
+ //get请求
|
|
|
+ if(!$this->request->isGet()){
|
|
|
+ $this->error('请求方式错误');
|
|
|
+ }
|
|
|
+ $req = $this->request->param();
|
|
|
+
|
|
|
+ $page = 1;
|
|
|
+ $limit = 15;
|
|
|
+ if (isset($req['page']) && !empty($req['page'])) $page = $req['page'];
|
|
|
+ if (isset($req['limit']) && !empty($req['limit'])) $limit = $req['limit'];
|
|
|
+
|
|
|
+ if (isset($req['gdbh']) && !empty($req['gdbh'])){
|
|
|
+ $where = [
|
|
|
+ 'sczl_gdbh'=>[ 'like', '%' . $req['gdbh'] . '%']
|
|
|
+ ];
|
|
|
+ $where['a.sczl_单据类型'] = '初检单';
|
|
|
+ $field = 'a.sczl_gdbh,trim(a.sczl_yjgx) as sczl_yjgx,rtrim(a.sczl_gxmc) as sczl_gxmc,a.sczl_jtbh,a.sczl_bzdh,DATE(a.sczl_rq) as sczl_rq,a.sczl_cl,rtrim(a.sczl_单据类型) as sczl_单据类型,
|
|
|
+ a.sczl_设备运行工时,a.sczl_dedh,a.sczl_废品率系数,rtrim(a.sczl_检验类别) as sczl_检验类别,a.sczl_bh1,a.sczl_bh2,a.sczl_bh3,a.sczl_bh4,a.qczl_NumDesc,rtrim(a.sys_id) as sys_id,
|
|
|
+ a.sys_rq,a.mod_rq,a.UniqId,b.千件工价,b.日定额,rtrim(c1.员工姓名) as sczl_bh1_name,rtrim(c2.员工姓名) as sczl_bh2_name,rtrim(c3.员工姓名) as sczl_bh3_name,
|
|
|
+ rtrim(c4.员工姓名) as sczl_bh4_name,rtrim(d.yj_yjmc) as yj_yjmc';
|
|
|
+ $rows = Db::name('db_机器检验')->alias('a')
|
|
|
+ ->join('dic_lzde b','a.sczl_dedh = b.sys_bh','left')
|
|
|
+ ->join('人事_基本资料 c1','a.sczl_bh1 = c1.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c2','a.sczl_bh2 = c2.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c3','a.sczl_bh3 = c3.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c4','a.sczl_bh4 = c4.员工编号','left')
|
|
|
+ ->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
+ ->where($where)
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->field($field)->page($page,$limit)->order('a.sczl_rq asc,a.UniqId desc')->select();
|
|
|
+ $option['sczl_单据类型'] = '初检单';
|
|
|
+ $option['sczl_gdbh'] = [ 'like', '%' . $req['gdbh'] . '%'];
|
|
|
+ $total = Db::name('db_机器检验')->where($option)->count();
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if (isset($req['cpmc']) && !empty($req['cpmc'])){
|
|
|
+ //查询工单表
|
|
|
+ $gd = db()->table('工单_基本资料')
|
|
|
+ ->where('Gd_cpmc', 'LIKE', '%'.$req['cpmc'].'%')
|
|
|
+ ->column('Gd_gdbh');
|
|
|
+ $where = [
|
|
|
+ 'sczl_gdbh'=>['in', $gd]
|
|
|
+ ];
|
|
|
+ $where['a.sczl_单据类型'] = '初检单';
|
|
|
+ $field = 'a.sczl_gdbh,trim(a.sczl_yjgx) as sczl_yjgx,rtrim(a.sczl_gxmc) as sczl_gxmc,a.sczl_jtbh,a.sczl_bzdh,DATE(a.sczl_rq) as sczl_rq,a.sczl_cl,rtrim(a.sczl_单据类型) as sczl_单据类型,
|
|
|
+ a.sczl_设备运行工时,a.sczl_dedh,a.sczl_废品率系数,rtrim(a.sczl_检验类别) as sczl_检验类别,a.sczl_bh1,a.sczl_bh2,a.sczl_bh3,a.sczl_bh4,a.qczl_NumDesc,rtrim(a.sys_id) as sys_id,
|
|
|
+ a.sys_rq,a.mod_rq,a.UniqId,b.千件工价,b.日定额,rtrim(c1.员工姓名) as sczl_bh1_name,rtrim(c2.员工姓名) as sczl_bh2_name,rtrim(c3.员工姓名) as sczl_bh3_name,
|
|
|
+ rtrim(c4.员工姓名) as sczl_bh4_name,rtrim(d.yj_yjmc) as yj_yjmc';
|
|
|
+ $rows = Db::name('db_机器检验')->alias('a')
|
|
|
+ ->join('dic_lzde b','a.sczl_dedh = b.sys_bh','left')
|
|
|
+ ->join('人事_基本资料 c1','a.sczl_bh1 = c1.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c2','a.sczl_bh2 = c2.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c3','a.sczl_bh3 = c3.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c4','a.sczl_bh4 = c4.员工编号','left')
|
|
|
+ ->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
+ ->where($where)
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->field($field)->page($page,$limit)->order('a.sczl_rq asc,a.UniqId desc')->select();
|
|
|
+ $option['sczl_单据类型'] = '初检单';
|
|
|
+ $option['sczl_gdbh'] = ['in', $gd];
|
|
|
+ $total = Db::name('db_机器检验')->where($option)->count();
|
|
|
+ }else{
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $data = [
|
|
|
+ 'total' => $total,
|
|
|
+ 'rows' => $rows,
|
|
|
+ ];
|
|
|
+ $this->success('成功',$data);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取信息
|
|
|
+ * @ApiMethod (GET)
|
|
|
+ * @param string $UniqId UniqId
|
|
|
+ */
|
|
|
+ public function getInfo()
|
|
|
+ {
|
|
|
+ //get请求
|
|
|
+ if(!$this->request->isGet()){
|
|
|
+ $this->error('请求方式错误');
|
|
|
+ }
|
|
|
+ $req = $this->request->param();
|
|
|
+ if (isset($req['UniqId']) && !empty($req['UniqId'])){
|
|
|
+ $UniqId = $req['UniqId'];
|
|
|
+ }else{
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ $where['a.UniqId'] = $UniqId;
|
|
|
+ $field = 'DATE(a.sczl_rq) as sczl_rq, a.sczl_bzdh,a.sczl_bh0, rtrim(c0.员工姓名) as sczl_bh0_name, a.sczl_cl0, a.sczl_fp0,
|
|
|
+ a.sczl_gdbh,trim(a.sczl_yjgx) as sczl_yjgx,rtrim(a.sczl_gxmc) as sczl_gxmc,rtrim(d.yj_yjmc) as yj_yjmc,
|
|
|
+ a.sczl_cl,rtrim(a.sczl_dedh) as sczl_dedh,rtrim(a.sczl_检验类别) as sczl_检验类别,a.sczl_废品率系数,
|
|
|
+ a.sczl_jsss,a.sczl_冲定额,a.qczl_Num as 流程单号1,a.qczl_NumDesc1 as 流程单号2,a.qczl_NumDesc2 as 流程单号3,
|
|
|
+ a.qczl_NumDesc3 as 流程单号4,a.qczl_NumDesc4 as 流程单号5,a.qczl_NumDesc5 as 流程单号6,
|
|
|
+ a.qczl_NumDesc6 as 流程单号7,a.qczl_NumDesc7 as 流程单号8,a.qczl_NumDesc8 as 流程单号9,
|
|
|
+ rtrim(a.qczl_NumDesc) as qczl_NumDesc,rtrim(a.sczl_desc) as sczl_desc,
|
|
|
+ a.sczl_bh1,a.sczl_bh2,a.sczl_bh3,a.sczl_bh4,a.sczl_bh5, a.sczl_bh6,
|
|
|
+ a.sczl_bh7,a.sczl_bh8,a.sczl_bh9,a.sczl_bh10,a.sczl_bh11, a.sczl_bh12,
|
|
|
+ rtrim(c1.员工姓名) as sczl_bh1_name,rtrim(c2.员工姓名) as sczl_bh2_name,
|
|
|
+ rtrim(c3.员工姓名) as sczl_bh3_name,rtrim(c4.员工姓名) as sczl_bh4_name,
|
|
|
+ rtrim(c5.员工姓名) as sczl_bh5_name,rtrim(c6.员工姓名) as sczl_bh6_name,
|
|
|
+ rtrim(c7.员工姓名) as sczl_bh7_name,rtrim(c8.员工姓名) as sczl_bh8_name,
|
|
|
+ rtrim(c9.员工姓名) as sczl_bh9_name,rtrim(c10.员工姓名) as sczl_bh10_name,
|
|
|
+ rtrim(c11.员工姓名) as sczl_bh11_name,rtrim(c12.员工姓名) as sczl_bh12_name,
|
|
|
+ a.sczl_cl1,a.sczl_cl2,a.sczl_cl3,a.sczl_cl4,a.sczl_cl5,a.sczl_cl6,
|
|
|
+ a.sczl_cl7,a.sczl_cl8,a.sczl_cl9,a.sczl_cl10,a.sczl_cl11,a.sczl_cl12,
|
|
|
+ a.sczl_fp1,a.sczl_fp2,a.sczl_fp3,a.sczl_fp4,a.sczl_fp5,a.sczl_fp6,
|
|
|
+ a.sczl_fp7,a.sczl_fp8,a.sczl_fp9,a.sczl_fp10,a.sczl_fp11,a.sczl_fp12';
|
|
|
+ $rows = Db::name('db_手工检验')->alias('a')
|
|
|
+ ->join('人事_基本资料 c0','a.sczl_bh0 = c0.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c1','a.sczl_bh1 = c1.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c2','a.sczl_bh2 = c2.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c3','a.sczl_bh3 = c3.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c4','a.sczl_bh4 = c4.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c5','a.sczl_bh5 = c5.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c6','a.sczl_bh6 = c6.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c7','a.sczl_bh7 = c7.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c8','a.sczl_bh8 = c8.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c9','a.sczl_bh9 = c9.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c10','a.sczl_bh10 = c10.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c11','a.sczl_bh11 = c11.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c12','a.sczl_bh12 = c12.员工编号','left')
|
|
|
+ ->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
+ ->where($where)
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->field($field)->find();
|
|
|
+
|
|
|
+ $this->success('成功',$rows);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取信息
|
|
|
+ * @ApiMethod (GET)
|
|
|
+ * @param string $UniqId UniqId
|
|
|
+ */
|
|
|
+ public function getMachineInfo()
|
|
|
+ {
|
|
|
+ //get请求
|
|
|
+ if(!$this->request->isGet()){
|
|
|
+ $this->error('请求方式错误');
|
|
|
+ }
|
|
|
+ $req = $this->request->param();
|
|
|
+ if (isset($req['UniqId']) && !empty($req['UniqId'])){
|
|
|
+ $UniqId = $req['UniqId'];
|
|
|
+ }else{
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ $where['a.UniqId'] = $UniqId;
|
|
|
+ $field = 'a.sczl_gdbh,trim(a.sczl_yjgx) as sczl_yjgx,rtrim(a.sczl_gxmc) as sczl_gxmc,
|
|
|
+ a.sczl_jtbh,a.sczl_bzdh,DATE(a.sczl_rq) as sczl_rq,a.sczl_cl,a.sczl_PgCl,
|
|
|
+ rtrim(a.sczl_单据类型) as sczl_单据类型,rtrim(a.sczl_dedh) as sczl_dedh,
|
|
|
+ a.sczl_装版工时,a.sczl_保养工时,a.sczl_异常停机工时,a.sczl_设备运行工时,
|
|
|
+ a.sczl_废品率系数,rtrim(a.sczl_检验类别) as sczl_检验类别,
|
|
|
+ a.sczl_bh1,a.sczl_bh2,a.sczl_bh3,a.sczl_bh4,a.sczl_bh5, a.sczl_bh6,a.sczl_bh7,a.sczl_bh8,
|
|
|
+ a.qczl_Num as 流程单号1,a.qczl_NumDesc1 as 流程单号2,a.qczl_NumDesc2 as 流程单号3,
|
|
|
+ a.qczl_NumDesc3 as 流程单号4,a.qczl_NumDesc4 as 流程单号5,a.qczl_NumDesc5 as 流程单号6,
|
|
|
+ a.qczl_NumDesc6 as 流程单号7,a.qczl_NumDesc7 as 流程单号8,a.qczl_NumDesc8 as 流程单号9,
|
|
|
+ a.qczl_NumDesc,a.sczl_desc,
|
|
|
+ rtrim(c1.员工姓名) as sczl_bh1_name,rtrim(c2.员工姓名) as sczl_bh2_name,
|
|
|
+ rtrim(c3.员工姓名) as sczl_bh3_name,rtrim(c4.员工姓名) as sczl_bh4_name,
|
|
|
+ rtrim(c5.员工姓名) as sczl_bh5_name,rtrim(c6.员工姓名) as sczl_bh6_name,
|
|
|
+ rtrim(c7.员工姓名) as sczl_bh7_name,rtrim(c8.员工姓名) as sczl_bh8_name,
|
|
|
+ rtrim(d.yj_yjmc) as yj_yjmc';
|
|
|
+ $rows = Db::name('db_机器检验')->alias('a')
|
|
|
+ ->join('dic_lzde b','a.sczl_dedh = b.sys_bh','left')
|
|
|
+ ->join('人事_基本资料 c1','a.sczl_bh1 = c1.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c2','a.sczl_bh2 = c2.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c3','a.sczl_bh3 = c3.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c4','a.sczl_bh4 = c4.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c5','a.sczl_bh5 = c5.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c6','a.sczl_bh6 = c6.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c7','a.sczl_bh7 = c7.员工编号','left')
|
|
|
+ ->join('人事_基本资料 c8','a.sczl_bh8 = c8.员工编号','left')
|
|
|
+ ->join('工单_印件资料 d','a.sczl_gdbh = d.Yj_Gdbh','left')
|
|
|
+ ->where($where)
|
|
|
+ ->where('SUBSTR(a.sczl_yjgx,1,2) = d.yj_yjno')
|
|
|
+ ->field($field)->find();
|
|
|
+
|
|
|
+ $this->success('成功',$rows);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询印件工序及产品名称
|
|
|
+ * @ApiMethod (GET)
|
|
|
+ * @param string $gdbh 工单编号
|
|
|
+ * @param string $gxmc 工序名称
|
|
|
+ */
|
|
|
+ public function getGxMc()
|
|
|
+ {
|
|
|
+ //get请求
|
|
|
+ if(!$this->request->isGet()){
|
|
|
+ $this->error('请求方式错误');
|
|
|
+ }
|
|
|
+ $req = $this->request->param();
|
|
|
+ if (isset($req['gdbh']) && !empty($req['gdbh'])){
|
|
|
+ $gdbh = $req['gdbh'];
|
|
|
+ }else{
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ $gxmc = ['手检','手检(圆切)','次品检','抽检','大张翻检'];
|
|
|
+
|
|
|
+ $gxmcs = [];
|
|
|
+ foreach ($gxmc as $k=>$v){
|
|
|
+ array_push($gxmcs,['like','%'.$v.'%']);
|
|
|
+ }
|
|
|
+ array_push($gxmcs,'OR');
|
|
|
+
|
|
|
+ $rows = db()->table('工单_基本资料')->alias('g')
|
|
|
+ ->field('rtrim(g.Gd_cpmc) as Gd_cpmc, c.Gy0_yjno, c.Gy0_gxh, rtrim(c.Gy0_gxmc) as Gy0_gxmc')
|
|
|
+ ->where(['g.Gd_gdbh'=>$gdbh])
|
|
|
+ ->where(['c.Gy0_gxmc'=>$gxmcs])
|
|
|
+ ->join(['产品_印件资料'=>'j'],'g.Gd_cpdh=j.yj_yjdh and g.成品代号=j.yj_cpdh')
|
|
|
+ ->join(['工单_工艺资料'=>'c'],'c.Gy0_gdbh=g.Gd_gdbh and c.Gy0_yjno=j.yj_yjno')
|
|
|
+ ->select();
|
|
|
+
|
|
|
+ foreach ($rows as $key=>$value){
|
|
|
+ $rows[$key]['jyGx'] = sprintf("%02d", $value['Gy0_yjno']).'-'.$value['Gy0_gxh'];
|
|
|
+ unset($rows[$key]['Gy0_yjno']);
|
|
|
+ unset($rows[$key]['Gy0_gxh']);
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->success('成功',$rows);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询印件工序及产品名称
|
|
|
+ * @ApiMethod (GET)
|
|
|
+ * @param string $gdbh 工单编号
|
|
|
+ * @param string $gxmc 工序名称
|
|
|
+ */
|
|
|
+ public function getMachineGxMc()
|
|
|
+ {
|
|
|
+ //get请求
|
|
|
+ if(!$this->request->isGet()){
|
|
|
+ $this->error('请求方式错误');
|
|
|
+ }
|
|
|
+ $req = $this->request->param();
|
|
|
+ if (isset($req['gdbh']) && !empty($req['gdbh'])){
|
|
|
+ $gdbh = $req['gdbh'];
|
|
|
+ }else{
|
|
|
+ $this->error('参数错误');
|
|
|
+ }
|
|
|
+ $gxmc = ['机检'];
|
|
|
+
|
|
|
+ $gxmcs = [];
|
|
|
+ foreach ($gxmc as $k=>$v){
|
|
|
+ array_push($gxmcs,['like','%'.$v.'%']);
|
|
|
+ }
|
|
|
+ array_push($gxmcs,'OR');
|
|
|
+
|
|
|
+ $rows = db()->table('工单_基本资料')->alias('g')
|
|
|
+ ->field('rtrim(g.Gd_cpmc) as Gd_cpmc, c.Gy0_yjno, c.Gy0_gxh, rtrim(c.Gy0_gxmc) as Gy0_gxmc')
|
|
|
+ ->where(['g.Gd_gdbh'=>$gdbh])
|
|
|
+ ->where(['c.Gy0_gxmc'=>$gxmcs])
|
|
|
+ ->join(['产品_印件资料'=>'j'],'g.Gd_cpdh=j.yj_yjdh and g.成品代号=j.yj_cpdh')
|
|
|
+ ->join(['工单_工艺资料'=>'c'],'c.Gy0_gdbh=g.Gd_gdbh and c.Gy0_yjno=j.yj_yjno')
|
|
|
+ ->select();
|
|
|
+
|
|
|
+ foreach ($rows as $key=>$value){
|
|
|
+ $rows[$key]['jyGx'] = sprintf("%02d", $value['Gy0_yjno']).'-'.$value['Gy0_gxh'];
|
|
|
+ unset($rows[$key]['Gy0_yjno']);
|
|
|
+ unset($rows[$key]['Gy0_gxh']);
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->success('成功',$rows);
|
|
|
+ }
|
|
|
}
|