|
@@ -34,7 +34,7 @@ class WorkOrder extends Api
|
|
|
if (isset($param['sort'])){
|
|
if (isset($param['sort'])){
|
|
|
$where['工单分类'] = 2;
|
|
$where['工单分类'] = 2;
|
|
|
}else{
|
|
}else{
|
|
|
- $where['工单分类'] = 1;
|
|
|
|
|
|
|
+ $where['工单分类'] = ['in',[1,3]];
|
|
|
}
|
|
}
|
|
|
$where['行号'] = ['in',['1','10']];
|
|
$where['行号'] = ['in',['1','10']];
|
|
|
//获取总计划中数量和总生产中数量
|
|
//获取总计划中数量和总生产中数量
|
|
@@ -43,7 +43,7 @@ class WorkOrder extends Api
|
|
|
$data = [
|
|
$data = [
|
|
|
'productingAll' => $productingAll,
|
|
'productingAll' => $productingAll,
|
|
|
'progressAll' => $progressAll,
|
|
'progressAll' => $progressAll,
|
|
|
- '客户编号' => []
|
|
|
|
|
|
|
+// '客户编号' => []
|
|
|
];
|
|
];
|
|
|
$list = \db('产品_基本资料')
|
|
$list = \db('产品_基本资料')
|
|
|
->where('客户编号','<>','')
|
|
->where('客户编号','<>','')
|
|
@@ -54,6 +54,7 @@ class WorkOrder extends Api
|
|
|
if (empty($list)){
|
|
if (empty($list)){
|
|
|
$this->success('',[]);
|
|
$this->success('',[]);
|
|
|
}
|
|
}
|
|
|
|
|
+ $data['翌星工单']=$data['MN工单']=[];
|
|
|
foreach ($list as $key=>$value){
|
|
foreach ($list as $key=>$value){
|
|
|
$value['客户编号'] = rtrim($value['客户编号']);
|
|
$value['客户编号'] = rtrim($value['客户编号']);
|
|
|
//这条sql查出来的数据可能不对,试一下以下sql
|
|
//这条sql查出来的数据可能不对,试一下以下sql
|
|
@@ -67,13 +68,13 @@ class WorkOrder extends Api
|
|
|
$string = $string."计划中:".$proGress;
|
|
$string = $string."计划中:".$proGress;
|
|
|
}
|
|
}
|
|
|
if ($string !== ''){
|
|
if ($string !== ''){
|
|
|
- $name = $value['客户编号'].'【'.$string.'】'.$value['客户名称'];
|
|
|
|
|
-// if (strpos($value['客户编号'],'J') !== false){
|
|
|
|
|
-// array_push($data['糊盒工单'],$name);
|
|
|
|
|
-// }else{
|
|
|
|
|
-// array_push($data['印刷工单'],$name);
|
|
|
|
|
-// }
|
|
|
|
|
- array_push($data['客户编号'],$name);
|
|
|
|
|
|
|
+ $name = $value['客户编号'].'【'.$string.'】'.rtrim($value['客户名称']);
|
|
|
|
|
+ if (strpos($value['客户编号'],'J') !== false || strpos($value['客户编号'],'Y') !== false){
|
|
|
|
|
+ array_push($data['翌星工单'],$name);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ array_push($data['MN工单'],$name);
|
|
|
|
|
+ }
|
|
|
|
|
+// array_push($data['客户编号'],$name);
|
|
|
}
|
|
}
|
|
|
// else{
|
|
// else{
|
|
|
// $name = $value['客户编号'].$value['客户名称'];
|
|
// $name = $value['客户编号'].$value['客户名称'];
|
|
@@ -116,17 +117,21 @@ class WorkOrder extends Api
|
|
|
}
|
|
}
|
|
|
$where = [];
|
|
$where = [];
|
|
|
if (!empty($clientNumber)){
|
|
if (!empty($clientNumber)){
|
|
|
|
|
+ if (substr($clientNumber,0,1) !== 'Y' && substr($clientNumber,0,1) !== 'J')
|
|
|
|
|
+ {
|
|
|
|
|
+ $clientNumber = substr($clientNumber,0,4);
|
|
|
|
|
+ }
|
|
|
if ($clientNumber === 'Y1401'){
|
|
if ($clientNumber === 'Y1401'){
|
|
|
$where['Gd_cpdh'] = ['like',$clientNumber.'%'];
|
|
$where['Gd_cpdh'] = ['like',$clientNumber.'%'];
|
|
|
}else{
|
|
}else{
|
|
|
$where['成品代号'] = ['like',$clientNumber.'%'];
|
|
$where['成品代号'] = ['like',$clientNumber.'%'];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (substr($clientNumber,0,1) === 'Y'){
|
|
|
|
|
- $where['工单分类'] = 1;
|
|
|
|
|
- }elseif (substr($clientNumber,0,1) === 'J'){
|
|
|
|
|
- $where['工单分类'] = 2;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (substr($clientNumber,0,1) === 'Y'){
|
|
|
|
|
+// $where['工单分类'] = 1;
|
|
|
|
|
+// }elseif (substr($clientNumber,0,1) === 'J'){
|
|
|
|
|
+// $where['工单分类'] = 2;
|
|
|
|
|
+// }
|
|
|
if (!empty($workOrder)){
|
|
if (!empty($workOrder)){
|
|
|
$where['Gd_gdbh'] = $workOrder;
|
|
$where['Gd_gdbh'] = $workOrder;
|
|
|
}
|
|
}
|
|
@@ -139,7 +144,7 @@ class WorkOrder extends Api
|
|
|
if (!empty($startTime) && !empty($endTime)){
|
|
if (!empty($startTime) && !empty($endTime)){
|
|
|
$where['接单日期'] = ['between',[$startTime,$endTime]];
|
|
$where['接单日期'] = ['between',[$startTime,$endTime]];
|
|
|
}
|
|
}
|
|
|
- $where['工单分类'] = $sort;
|
|
|
|
|
|
|
+// $where['工单分类'] = $sort;
|
|
|
// $where['行号'] = ['in',['1','10']];
|
|
// $where['行号'] = ['in',['1','10']];
|
|
|
$total = \db('工单_基本资料')->where($where)->distinct(true)->field('Gd_gdbh')->count();
|
|
$total = \db('工单_基本资料')->where($where)->distinct(true)->field('Gd_gdbh')->count();
|
|
|
$list = \db('工单_基本资料')
|
|
$list = \db('工单_基本资料')
|
|
@@ -2151,10 +2156,10 @@ class WorkOrder extends Api
|
|
|
}
|
|
}
|
|
|
if (isset($param['sort'])){
|
|
if (isset($param['sort'])){
|
|
|
$priWhere['yj_yjno'] = ['>=',10];
|
|
$priWhere['yj_yjno'] = ['>=',10];
|
|
|
- $proWhere['Gy0_yjno'] = ['>=',10];
|
|
|
|
|
|
|
+ $proWhere['a.Gy0_yjno'] = ['>=',10];
|
|
|
}else{
|
|
}else{
|
|
|
$priWhere['yj_yjno'] = ['<',10];
|
|
$priWhere['yj_yjno'] = ['<',10];
|
|
|
- $proWhere['Gy0_yjno'] = ['<',10];
|
|
|
|
|
|
|
+ $proWhere['a.Gy0_yjno'] = ['<',10];
|
|
|
}
|
|
}
|
|
|
$list = \db('工单_基本资料')
|
|
$list = \db('工单_基本资料')
|
|
|
->where('Gd_gdbh',$param['workorder'])
|
|
->where('Gd_gdbh',$param['workorder'])
|
|
@@ -2205,16 +2210,18 @@ class WorkOrder extends Api
|
|
|
}
|
|
}
|
|
|
//引用工艺资料
|
|
//引用工艺资料
|
|
|
$processWhere = [
|
|
$processWhere = [
|
|
|
- 'Gy0_方案' => $param['option'],
|
|
|
|
|
- 'Gy0_cpdh' => $param['productCode']
|
|
|
|
|
|
|
+ 'a.Gy0_方案' => $param['option'],
|
|
|
|
|
+ 'a.Gy0_cpdh' => $param['productCode']
|
|
|
];
|
|
];
|
|
|
$yjnolist = \db('工单_基本资料')
|
|
$yjnolist = \db('工单_基本资料')
|
|
|
->where('Gd_gdbh',$param['workorder'])
|
|
->where('Gd_gdbh',$param['workorder'])
|
|
|
- ->column('行号');
|
|
|
|
|
|
|
+ ->column('Gd_cpdh');
|
|
|
$ProcessList = \db('产品_工艺资料')
|
|
$ProcessList = \db('产品_工艺资料')
|
|
|
|
|
+ ->alias('a')
|
|
|
|
|
+ ->join('产品_印件资料 b','a.Gy0_cpdh = b.yj_cpdh AND a.Gy0_yjno = yj_yjno')
|
|
|
->where($processWhere)
|
|
->where($processWhere)
|
|
|
->where($proWhere)
|
|
->where($proWhere)
|
|
|
- ->whereIn('Gy0_yjno',$yjnolist)
|
|
|
|
|
|
|
+ ->whereIn('b.yj_yjdh',$yjnolist)
|
|
|
->order('Gy0_yjno,Gy0_gxh')
|
|
->order('Gy0_yjno,Gy0_gxh')
|
|
|
->select();
|
|
->select();
|
|
|
if (empty($ProcessList)){
|
|
if (empty($ProcessList)){
|