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

+ 20 - 0
application/api/controller/FinishedProductWarehousing.php

@@ -500,6 +500,10 @@ class FinishedProductWarehousing extends Api
             } catch (ModelNotFoundException $e) {
             } catch (DbException $e) {
             }
+            db('工单_质量考核汇总')
+                ->where('Gy0_gdbh',$data['jjcp_gdbh'])
+                ->where('印件及工序',$data['jjcp_yjno'])
+                ->delete();
             $sql = db('工单_质量考核汇总')->fetchSql(true)->insertAll($result);
             $res = db()->query($sql);
             if($res===false) $this->error('失败');
@@ -570,6 +574,22 @@ class FinishedProductWarehousing extends Api
             db()->rollback();
             $this->error($e->getMessage());
         }
+        $oederLoss = new \app\api\controller\OrderSuperLoss();
+        if (strpos($data['jjcp_smb'],'末') !== false){
+            try {
+                $result = $oederLoss->OneOrderSuperLoss($data['jjcp_gdbh'], $data['jjcp_yjno']);
+            } catch (DataNotFoundException $e) {
+            } catch (ModelNotFoundException $e) {
+            } catch (DbException $e) {
+            }
+            db('工单_质量考核汇总')
+                ->where('Gy0_gdbh',$data['jjcp_gdbh'])
+                ->where('印件及工序',$data['jjcp_yjno'])
+                ->delete();
+            $sql = db('工单_质量考核汇总')->fetchSql(true)->insertAll($result);
+            $res = db()->query($sql);
+            if($res===false) $this->error('失败');
+        }
 
         if($bool===false) $this->error('失败');
 

+ 8 - 0
application/api/controller/OrderSuperLoss.php

@@ -905,6 +905,14 @@ class OrderSuperLoss extends Api
         $where['yj_Yjno'] = $params['yj_yjno'];
         $sql =db('工单_印件资料')->where($where)->fetchSql(true)->update(['质量考核'=>$examine]);
         $res = \db()->query($sql);
+        $returnData = $this->OneOrderSuperLoss($where['Yj_Gdbh'],$where['yj_Yjno']);
+        db('工单_质量考核汇总')
+            ->where('Gy0_gdbh',$where['Yj_Gdbh'])
+            ->where('印件及工序',$where['yj_Yjno'])
+            ->delete();
+        $sql = db('工单_质量考核汇总')->fetchSql(true)->insertAll($returnData);
+        $result = db()->query($sql);
+        if($result===false) $this->error('失败');
         if ($res !== false){
             $this->success('更新成功');
         }else{