|
@@ -93,6 +93,7 @@ class Facility extends Api
|
|
|
$productName = Db::table('工单_基本资料')->whereIn('Gd_gdbh',$Gd_gdbh)->column('Gd_cpmc','Gd_gdbh');
|
|
$productName = Db::table('工单_基本资料')->whereIn('Gd_gdbh',$Gd_gdbh)->column('Gd_cpmc','Gd_gdbh');
|
|
|
//组员信息
|
|
//组员信息
|
|
|
$list = Db::table('设备_产量计酬')->where($where)->field($field)->select();
|
|
$list = Db::table('设备_产量计酬')->where($where)->field($field)->select();
|
|
|
|
|
+ halt($list);
|
|
|
$totalA = Db::table('设备_产量计酬')->where($where)->where('sczl_bzdh','A班')->field('SUM(sczl_cl) as 产量')->select();
|
|
$totalA = Db::table('设备_产量计酬')->where($where)->where('sczl_bzdh','A班')->field('SUM(sczl_cl) as 产量')->select();
|
|
|
$totalB = Db::table('设备_产量计酬')->where($where)->where('sczl_bzdh','B班')->field('SUM(sczl_cl) as 产量')->select();
|
|
$totalB = Db::table('设备_产量计酬')->where($where)->where('sczl_bzdh','B班')->field('SUM(sczl_cl) as 产量')->select();
|
|
|
if (empty($list)){
|
|
if (empty($list)){
|
|
@@ -143,13 +144,13 @@ class Facility extends Api
|
|
|
if (empty($machine) || empty($date)){
|
|
if (empty($machine) || empty($date)){
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
- $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
|
|
- $startId = $last_id['UniqId']-1000000;
|
|
|
|
|
|
|
+// $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
|
|
+// $startId = $last_id['UniqId']-1000000;
|
|
|
$where = [
|
|
$where = [
|
|
|
'设备编号' => $machine,
|
|
'设备编号' => $machine,
|
|
|
'开工时间' => ['between',[date('Y-m-d 08:00:00',strtotime($date)),date('Y-m-d 08:00:00',strtotime($date)+86400)]],
|
|
'开工时间' => ['between',[date('Y-m-d 08:00:00',strtotime($date)),date('Y-m-d 08:00:00',strtotime($date)+86400)]],
|
|
|
'类别' => ['in',['IPQC检验','机台检验']],
|
|
'类别' => ['in',['IPQC检验','机台检验']],
|
|
|
- 'UniqId' => ['>',$startId],
|
|
|
|
|
|
|
+// 'UniqId' => ['>',$startId],
|
|
|
];
|
|
];
|
|
|
$begin = Db::table('制程检验_记录')->where($where)->field('UniqId')->find();
|
|
$begin = Db::table('制程检验_记录')->where($where)->field('UniqId')->find();
|
|
|
$end = Db::table('制程检验_记录')->where($where)->order('UniqId desc')->field('UniqId')->find();
|
|
$end = Db::table('制程检验_记录')->where($where)->order('UniqId desc')->field('UniqId')->find();
|
|
@@ -231,9 +232,11 @@ class Facility extends Api
|
|
|
if (empty($machine)){
|
|
if (empty($machine)){
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
- $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
|
|
- $startUniqid = $lastUniqid['UniqId']-10000;
|
|
|
|
|
- $workOrder = Db::table('设备_产量计酬')->where('sczl_jtbh',$machine)->where('UniqId','>',$startUniqid)->field('sczl_gdbh')->order('UniqId desc')->find();
|
|
|
|
|
|
|
+// $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
|
|
+// $startUniqid = $lastUniqid['UniqId']-10000;
|
|
|
|
|
+// halt($lastUniqid);
|
|
|
|
|
+ $workOrder = Db::table('设备_产量计酬')->where('sczl_jtbh',$machine)->field('sczl_gdbh')->order('UniqId desc')->find();
|
|
|
|
|
+
|
|
|
if (empty($workOrder)){
|
|
if (empty($workOrder)){
|
|
|
$this->error('未找到正在生产工单');
|
|
$this->error('未找到正在生产工单');
|
|
|
}
|
|
}
|
|
@@ -250,7 +253,7 @@ class Facility extends Api
|
|
|
'sczl_gdbh'=>$list['Gy0_gdbh']
|
|
'sczl_gdbh'=>$list['Gy0_gdbh']
|
|
|
];
|
|
];
|
|
|
$facilityField = 'sczl_bh1,sczl_bh2,sczl_bh3,sczl_bh4,sczl_bh5,sczl_bh6,sczl_bh7,sczl_bh8,sczl_bh9,sczl_bh10';
|
|
$facilityField = 'sczl_bh1,sczl_bh2,sczl_bh3,sczl_bh4,sczl_bh5,sczl_bh6,sczl_bh7,sczl_bh8,sczl_bh9,sczl_bh10';
|
|
|
- $Ctaff = Db::table('设备_产量计酬')->where($facilityWhere)->where('UniqId','>',$startUniqid)->field($facilityField)->order('UniqId desc')->find();
|
|
|
|
|
|
|
+ $Ctaff = Db::table('设备_产量计酬')->where($facilityWhere)->field($facilityField)->order('UniqId desc')->find();
|
|
|
$data = [];
|
|
$data = [];
|
|
|
foreach ($Ctaff as $key=>$value){
|
|
foreach ($Ctaff as $key=>$value){
|
|
|
if (!empty($value)){
|
|
if (!empty($value)){
|
|
@@ -295,12 +298,12 @@ class Facility extends Api
|
|
|
}
|
|
}
|
|
|
$lastTechonUniqId = Db::table('工单_工艺资料')->field('UniqId')->order('UniqId desc')->find();
|
|
$lastTechonUniqId = Db::table('工单_工艺资料')->field('UniqId')->order('UniqId desc')->find();
|
|
|
$startTechonUniqId = $lastTechonUniqId['UniqId']-10000;
|
|
$startTechonUniqId = $lastTechonUniqId['UniqId']-10000;
|
|
|
- $lastYieldUniqId = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
|
|
- $startYieldUniqId = $lastYieldUniqId['UniqId']-100000;
|
|
|
|
|
|
|
+// $lastYieldUniqId = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
|
|
+// $startYieldUniqId = $lastYieldUniqId['UniqId']-100000;
|
|
|
$workOrder = Db::table('设备_产量计酬')->where('sczl_jtbh',$machine)->field('sczl_gdbh')->where('UniqId','>',$startYieldUniqId)->order('UniqId desc')->find();
|
|
$workOrder = Db::table('设备_产量计酬')->where('sczl_jtbh',$machine)->field('sczl_gdbh')->where('UniqId','>',$startYieldUniqId)->order('UniqId desc')->find();
|
|
|
$startTime = Db::table('工单_工艺资料')->where('Gy0_gdbh',$workOrder['sczl_gdbh'])->where('Gy0_sbbh',$machine)->where('UniqId','>',$startTechonUniqId)->field('Gy0_sj1')->order('UniqId desc')->find();
|
|
$startTime = Db::table('工单_工艺资料')->where('Gy0_gdbh',$workOrder['sczl_gdbh'])->where('Gy0_sbbh',$machine)->where('UniqId','>',$startTechonUniqId)->field('Gy0_sj1')->order('UniqId desc')->find();
|
|
|
$where = [
|
|
$where = [
|
|
|
- 'UniqId' => ['>',$startTechonUniqId],
|
|
|
|
|
|
|
+// 'UniqId' => ['>',$startTechonUniqId],
|
|
|
'Gy0_sbbh' => $machine,
|
|
'Gy0_sbbh' => $machine,
|
|
|
'Gy0_sj1' => ['>= time',$startTime['Gy0_sj1']],
|
|
'Gy0_sj1' => ['>= time',$startTime['Gy0_sj1']],
|
|
|
];
|
|
];
|
|
@@ -328,7 +331,7 @@ class Facility extends Api
|
|
|
$finished = Db::table('设备_产量计酬')
|
|
$finished = Db::table('设备_产量计酬')
|
|
|
->where('sczl_gdbh',$value['gdbh'])
|
|
->where('sczl_gdbh',$value['gdbh'])
|
|
|
->where('sczl_jtbh',$machine)
|
|
->where('sczl_jtbh',$machine)
|
|
|
- ->where('UniqId','>',$startYieldUniqId)
|
|
|
|
|
|
|
+// ->where('UniqId','>',$startYieldUniqId)
|
|
|
->order('UniqId desc')
|
|
->order('UniqId desc')
|
|
|
->field('SUM(sczl_cl) as cl')
|
|
->field('SUM(sczl_cl) as cl')
|
|
|
->select();
|
|
->select();
|
|
@@ -361,14 +364,17 @@ class Facility extends Api
|
|
|
if (empty($workOrder)){
|
|
if (empty($workOrder)){
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
- $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
|
|
- $startUniqid = $lastUniqid['UniqId']-100000;
|
|
|
|
|
|
|
+// $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
|
|
+// $startUniqid = $lastUniqid['UniqId']-100000;
|
|
|
//右边工艺及完成数量
|
|
//右边工艺及完成数量
|
|
|
- $Process = Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)->where('UniqId','>',$startUniqid)->distinct(true)->order('sczl_gxh')->column('sczl_gxh');
|
|
|
|
|
|
|
+ $Process = Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)
|
|
|
|
|
+// ->where('UniqId','>',$startUniqid)
|
|
|
|
|
+ ->distinct(true)->order('sczl_gxh')
|
|
|
|
|
+ ->column('sczl_gxh');
|
|
|
$data = [];
|
|
$data = [];
|
|
|
foreach ($Process as $k=>$v){
|
|
foreach ($Process as $k=>$v){
|
|
|
$res= Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)
|
|
$res= Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)
|
|
|
- ->where('UniqId','>',$startUniqid)
|
|
|
|
|
|
|
+// ->where('UniqId','>',$startUniqid)
|
|
|
->where('sczl_gxh',$v)
|
|
->where('sczl_gxh',$v)
|
|
|
->field('rtrim(sczl_yjno) as sczl_yjno,rtrim(sczl_gxmc) as sczl_gxmc')
|
|
->field('rtrim(sczl_yjno) as sczl_yjno,rtrim(sczl_gxmc) as sczl_gxmc')
|
|
|
->find();
|
|
->find();
|
|
@@ -376,7 +382,11 @@ class Facility extends Api
|
|
|
$res['sczl_yjno'] = '0'.$res['sczl_yjno'];
|
|
$res['sczl_yjno'] = '0'.$res['sczl_yjno'];
|
|
|
}
|
|
}
|
|
|
$processList['process'] = $res['sczl_yjno'].'-'.$res['sczl_gxmc'];
|
|
$processList['process'] = $res['sczl_yjno'].'-'.$res['sczl_gxmc'];
|
|
|
- $processList['completed'] = Db::table('设备_产量计酬')->where('sczl_gdbh',$workOrder)->where('UniqId','>',$startUniqid)->where('sczl_gxh',$v)->count();
|
|
|
|
|
|
|
+ $processList['completed'] = Db::table('设备_产量计酬')
|
|
|
|
|
+ ->where('sczl_gdbh',$workOrder)
|
|
|
|
|
+// ->where('UniqId','>',$startUniqid)
|
|
|
|
|
+ ->where('sczl_gxh',$v)
|
|
|
|
|
+ ->count();
|
|
|
array_push($data,$processList);
|
|
array_push($data,$processList);
|
|
|
}
|
|
}
|
|
|
$this->success('成功',$data);
|
|
$this->success('成功',$data);
|
|
@@ -458,11 +468,11 @@ class Facility extends Api
|
|
|
if (empty($machine) || empty($workOrder) || empty($team)){
|
|
if (empty($machine) || empty($workOrder) || empty($team)){
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
- $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
|
|
- $startUniqid = $lastUniqid['UniqId']-100000;
|
|
|
|
|
|
|
+// $lastUniqid = Db::table('设备_产量计酬')->field('UniqId')->order('UniqId desc')->find();
|
|
|
|
|
+// $startUniqid = $lastUniqid['UniqId']-100000;
|
|
|
$name = Db::table('工单_基本资料')->where('Gd_gdbh',$workOrder)->field('rtrim(Gd_cpmc) as productName')->find();
|
|
$name = Db::table('工单_基本资料')->where('Gd_gdbh',$workOrder)->field('rtrim(Gd_cpmc) as productName')->find();
|
|
|
$where = [
|
|
$where = [
|
|
|
- 'UniqId' => ['>',$startUniqid],
|
|
|
|
|
|
|
+// 'UniqId' => ['>',$startUniqid],
|
|
|
'sczl_gdbh' => $workOrder,
|
|
'sczl_gdbh' => $workOrder,
|
|
|
'sczl_jtbh' => $machine,
|
|
'sczl_jtbh' => $machine,
|
|
|
'sczl_cl' => ['<>',0.0],
|
|
'sczl_cl' => ['<>',0.0],
|
|
@@ -518,14 +528,14 @@ class Facility extends Api
|
|
|
if (empty($machine) || empty($workOrder) || empty($team)){
|
|
if (empty($machine) || empty($workOrder) || empty($team)){
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
- $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
|
|
- $startId = $last_id['UniqId']-100000;
|
|
|
|
|
|
|
+// $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
|
|
+// $startId = $last_id['UniqId']-100000;
|
|
|
$where = [
|
|
$where = [
|
|
|
'设备编号' => $machine,
|
|
'设备编号' => $machine,
|
|
|
'工单编号' => $workOrder,
|
|
'工单编号' => $workOrder,
|
|
|
'班组编号' => $team,
|
|
'班组编号' => $team,
|
|
|
'类别' => ['in',['IPQC检验','机台检验']],
|
|
'类别' => ['in',['IPQC检验','机台检验']],
|
|
|
- 'UniqId' => ['>',$startId],
|
|
|
|
|
|
|
+// 'UniqId' => ['>',$startId],
|
|
|
];
|
|
];
|
|
|
//检验项目筛选
|
|
//检验项目筛选
|
|
|
$item = Db::table('制程检验_记录')->where($where)->distinct(true)->column('rtrim(检验项目)');
|
|
$item = Db::table('制程检验_记录')->where($where)->distinct(true)->column('rtrim(检验项目)');
|
|
@@ -659,8 +669,8 @@ class Facility extends Api
|
|
|
if (empty($param)){
|
|
if (empty($param)){
|
|
|
$this->error('参数错误');
|
|
$this->error('参数错误');
|
|
|
}
|
|
}
|
|
|
- $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
|
|
- $startId = $last_id['UniqId']-100000;
|
|
|
|
|
|
|
+// $last_id = Db::table('制程检验_记录')->order('UniqId desc')->field('UniqId')->find();
|
|
|
|
|
+// $startId = $last_id['UniqId']-100000;
|
|
|
$date = date('Y-m-d H:i:s',time());
|
|
$date = date('Y-m-d H:i:s',time());
|
|
|
$startTime = date('Y-m-d 08:30:00',time());
|
|
$startTime = date('Y-m-d 08:30:00',time());
|
|
|
if ($date<$startTime){
|
|
if ($date<$startTime){
|
|
@@ -676,7 +686,7 @@ class Facility extends Api
|
|
|
rtrim(设备编号) as 设备编号,rtrim(班组编号) as 班组编号,rtrim(检验项目) as 现场管理人员,rtrim(检验备注) as 检验备注,
|
|
rtrim(设备编号) as 设备编号,rtrim(班组编号) as 班组编号,rtrim(检验项目) as 现场管理人员,rtrim(检验备注) as 检验备注,
|
|
|
rtrim(提交时间) as 提交时间,rtrim(开工时间) as 开工时间';
|
|
rtrim(提交时间) as 提交时间,rtrim(开工时间) as 开工时间';
|
|
|
$list = Db::table('制程检验_记录')->where($where)
|
|
$list = Db::table('制程检验_记录')->where($where)
|
|
|
- ->where('UniqId','>',$startId)
|
|
|
|
|
|
|
+// ->where('UniqId','>',$startId)
|
|
|
->field($filed)
|
|
->field($filed)
|
|
|
// ->fetchSql(true)
|
|
// ->fetchSql(true)
|
|
|
->select();
|
|
->select();
|