haozi 4 лет назад
Родитель
Сommit
305b453e15
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      app/Services/HandInStorageService.php

+ 5 - 2
app/Services/HandInStorageService.php

@@ -586,6 +586,7 @@ sql;
 
             // 6: flux 更新 asn_detail 和 asn_header 状态
             $result=$this->updateFluxAsn($info, $invlotatt, $time, $who,$asnDetail);
+            if ($result===1){$db->rollBack();return 1;}//超收
             if (!$result){$db->rollBack();return false;}
             $db->commit();
             return true;
@@ -617,10 +618,11 @@ sql;
      * @param array $invlotatt
      * @param $time
      * @param $who
-     * @return bool
+     * @param $asnDetail
+     * @return bool|int
      * 更新asn状态
      */
-    public function updateFluxAsn(array $info, array $invlotatt, $time, $who,$asnDetail): bool
+    public function updateFluxAsn(array $info, array $invlotatt, $time, $who,$asnDetail)
     {
         $db = DB::connection("oracle");
         $asn = OracleDOCASNHeader::query()
@@ -665,6 +667,7 @@ sql;
                     [$time, $who, $info['asnno']]);
             }
         }
+        if ($receivedQty+$amount>$expectedQty)return 1; //超收
         return true;
     }