|
|
@@ -56,10 +56,11 @@ class WorkOrder extends Api
|
|
|
}
|
|
|
$data['翌星工单']=$data['MN工单']=[];
|
|
|
foreach ($list as $key=>$value){
|
|
|
- $value['客户编号'] = rtrim($value['客户编号']);
|
|
|
+// $value['客户编号'] = rtrim($value['客户编号']);
|
|
|
+ $value['客户编号'] = '1006';
|
|
|
//这条sql查出来的数据可能不对,试一下以下sql
|
|
|
- $productIng = \db('工单_基本资料')->where($where)->where('Gd_cpdh','LIKE',rtrim($value['客户编号']).'%')->where('gd_statu','2-生产中')->count();
|
|
|
- $proGress = \db('工单_基本资料')->where($where)->where('Gd_cpdh','LIKE',rtrim($value['客户编号']).'%')->where('gd_statu','3-计划中')->count();
|
|
|
+ $productIng = \db('工单_基本资料')->where($where)->where('Gd_cpdh|成品代号','LIKE',rtrim($value['客户编号']).'%')->where('gd_statu','2-生产中')->count();
|
|
|
+ $proGress = \db('工单_基本资料')->where($where)->where('Gd_cpdh|成品代号','LIKE',rtrim($value['客户编号']).'%')->where('gd_statu','3-计划中')->count();
|
|
|
$string = '';
|
|
|
if ($productIng != 0){
|
|
|
$string = $string."生产中:".$productIng;
|
|
|
@@ -2178,7 +2179,6 @@ class WorkOrder extends Api
|
|
|
if (empty($PrintList)){
|
|
|
$this->error('未找到印件资料');
|
|
|
}
|
|
|
- $PrintLastId = \db('工单_印件资料')->order('Uniqid desc')->value('rtrim(Uniqid)');
|
|
|
$number = \db('工单_基本资料')
|
|
|
->where('Gd_gdbh',$param['workorder'])
|
|
|
->where('成品代号',$param['productCode'])
|
|
|
@@ -2186,7 +2186,7 @@ class WorkOrder extends Api
|
|
|
$arr = [];
|
|
|
foreach ($PrintList as $key => $value){
|
|
|
foreach ($list as $k=>$v){
|
|
|
- if ($value['yj_yjdh'] === $v['Gd_cpdh']){
|
|
|
+ if (rtrim($value['yj_yjdh']) === $v['Gd_cpdh']){
|
|
|
$PrintList[$key]['Yj_Gdbh'] = $param['workorder'];
|
|
|
$PrintList[$key]['yj_Yjno'] = $value['yj_yjno'];
|
|
|
$PrintList[$key]['yj_Yjdh'] = $value['yj_yjdh'];
|
|
|
@@ -2194,7 +2194,7 @@ class WorkOrder extends Api
|
|
|
$PrintList[$key]['yj_ls'] = $value['yj_ls'];
|
|
|
$PrintList[$key]['yj_平张投料'] = $number;
|
|
|
$PrintList[$key]['Sys_id'] = $value['sys_id'];
|
|
|
- $PrintList[$key]['Uniqid'] = $PrintLastId + $key + 1;
|
|
|
+// $PrintList[$key]['Uniqid'] = $PrintLastId + $key + 1;
|
|
|
$PrintList[$key]['Sys_rq'] = date('Y-m-d H:i:s',time());
|
|
|
$PrintList[$key]['Mod_rq'] = date('Y-m-d H:i:s',time());
|
|
|
array_push($arr,[$value['yj_yjno'],$v['行号']]);
|
|
|
@@ -2265,7 +2265,7 @@ class WorkOrder extends Api
|
|
|
$ProcessList[$key]['超节损核算单价'] = 0;
|
|
|
$ProcessList[$key]['Gy0_sj1'] = '1900-01-01 00:00:00';
|
|
|
$ProcessList[$key]['Gy0_sj2'] = '1900-01-01 00:00:00';
|
|
|
- $ProcessList[$key]['UniqId'] = $ProcesslastId + $key + 1;
|
|
|
+// $ProcessList[$key]['UniqId'] = $ProcesslastId + $key + 1;
|
|
|
$ProcessList[$key]['PD_WG'] = '1900-01-01 00:00:00';
|
|
|
$ProcessList[$key]['Sys_rq'] = date('Y-m-d H:i:s', time());
|
|
|
unset($ProcessList[$key]['Gy0_Oil'],$ProcessList[$key]['Gy0_Ms'],$ProcessList[$key]['Gy0_Ks'],$ProcessList[$key]['UniqID'],$ProcessList[$key]['Gy0_cpdh'],$ProcessList[$key]['gy0_gxmc'],$ProcessList[$key]['Gy0_site']);
|
|
|
@@ -2282,6 +2282,7 @@ class WorkOrder extends Api
|
|
|
\db()->commit();
|
|
|
}catch (\Exception $e){
|
|
|
\db()->rollback();
|
|
|
+// echo $e->getMessage();
|
|
|
}
|
|
|
//计算工序计划生产数量
|
|
|
if ($number !== null){
|