qiuenguang 1 год назад
Родитель
Сommit
f6eb370bb5

+ 1 - 2
application/api/controller/OrderSuperLoss.php

@@ -477,7 +477,7 @@ class OrderSuperLoss extends Api
             ->where('a.行号',$params['yjno'])
             ->where('c.yj_Yjno',$params['yjno'])
             ->where('b.仓库编号','Y101')
-            ->where('c.质量考核',0)
+            ->where('c.质量考核',null)
             ->field($field)
             ->find();
         if (empty($data)){
@@ -1076,7 +1076,6 @@ class OrderSuperLoss extends Api
                 LEFT JOIN db_sczl c ON a.Gy0_gdbh = c.sczl_gdbh AND a.Gy0_yjno = c.sczl_yjno AND a.Gy0_gxh = c.sczl_gxh
                 WHERE a.Gy0_gdbh = '{$order}' and a.GY0_Yjno = '{$yjno}' GROUP BY a.Gy0_yjno, a.Gy0_gxh ORDER BY a.Gy0_yjno, a.Gy0_gxh";
         $data = Db::query($sql);
-
         //手检数据
         $handData =db('db_手工检验')->where('sczl_gdbh',$order)->field('sum(sczl_cl) as cl,rtrim(sczl_yjgx) as sczl_gxh')->select();
         //包装及成品防护数据

+ 19 - 1
application/api/controller/Product.php

@@ -337,7 +337,7 @@ class Product extends Api
             $this->error('非法请求');
         }
         $params = Request::instance()->post();
-        if (empty($params['from_code']) || empty($params['from_pro']) || empty($params['to_code']) ){
+        if (empty($params['from_code']) || empty($params['to_code']) ){
             $this->error('参数不能为空');
         }
         if ($params['is_copy_gy'] == 1){
@@ -359,6 +359,18 @@ class Product extends Api
                 $gyList[$key]['Gy0_cpdh'] = $params['to_code'];
                 $gyList[$key]['UniqID'] = $UniqID;
             }
+            //查出参考的印件资料
+            $yjList = db('产品_印件资料')->where('yj_cpdh',$params['from_code'])->select();
+            if (empty($yjList)){
+                $this->error('参考产品无印件资料数据');
+            }
+            $Uniqid = db('产品_印件资料')->order('UniqId desc')->value('UniqId');
+            foreach ($yjList as $key=>$value){
+                unset($yjList[$key]['UniqId']);
+                $Uniqid ++;
+                $yjList[$key]['yj_cpdh'] = $params['to_code'];
+                $yjList[$key]['UniqId'] = $Uniqid;
+            }
         }
         if ($params['is_copy_yb'] == 1){
             $UniqId = db('产品_印版资料')->order('UniqID desc')->value('UniqID');
@@ -376,6 +388,9 @@ class Product extends Api
         }
         if ($params['is_copy_gy'] == 1 && $params['is_copy_yb'] == 1){
             $gyResult = db('产品_工艺资料')->insertAll($gyList);
+            if (\db('产品_印件资料')->where('yj_cpdh',$params['to_code'])->where('yj_yjno',$yjList[0]['yj_yjno'])->find() === null){
+                \db('产品_印件资料')->insertAll($yjList);
+            }
             if (!$gyResult){
                 $this->error('复制产品工艺资料数据失败');
             }
@@ -385,6 +400,9 @@ class Product extends Api
             }
         }elseif ($params['is_copy_gy'] == 1 && $params['is_copy_yb'] == 0){
             $gyResult = db('产品_工艺资料')->insertAll($gyList);
+            if (\db('产品_印件资料')->where('yj_cpdh',$params['to_code'])->where('yj_yjno',$yjList[0]['yj_yjno'])->find() === null){
+                \db('产品_印件资料')->insertAll($yjList);
+            }
             if (!$gyResult){
                 $this->error('复制产品工艺资料数据失败');
             }

+ 3 - 0
application/api/controller/Staff.php

@@ -158,6 +158,9 @@ class Staff extends Api
         if (empty($params['员工编号'])){
             $this->error('参数不能为空');
         }
+        if ($params['转正日期'] === ''){
+            $params['转正日期'] = null;
+        }
         $staffCode = $params['员工编号'];
         unset($params['员工编号']);
         $sql = db('人事_基本资料')->where('员工编号',$staffCode)->fetchSql(true)->update($params);

+ 3 - 0
application/api/controller/WorkOrder.php

@@ -1637,6 +1637,8 @@ class WorkOrder extends Api
         if (empty($list)){
             $this->success('未获取到产品数据');
         }
+        $res = db('产品_工艺资料')->where('Gy0_cpdh',$list[0]['产品编号'])->distinct(true)->column('rtrim(Gy0_方案) as gy_plan');
+        $list[0]['gy'] = $res;
         foreach ($list as $key=>$value){
             $list[$key]['name'] = $value['产品编号'].'【'.$value['产品名称'].'】';
         }
@@ -1711,6 +1713,7 @@ class WorkOrder extends Api
         $param['Gy0_sj2'] = '1900-01-01 00:00:00';
         $param['PD_WG'] = '1900-01-01 00:00:00';
         $param['UniqId'] = $lastId;
+        //添加工序
         $sql = \db('工单_工艺资料')
             ->fetchSql(true)
             ->insert($param);