Ver Fonte

提交数据超期未交接

lvhao há 5 meses atrás
pai
commit
8adeb161e3
2 ficheiros alterados com 44 adições e 22 exclusões
  1. 20 22
      core/CoreApp/controllers/Apicjgx.php
  2. 24 0
      core/CoreApp/controllers/Transfer.php

+ 20 - 22
core/CoreApp/controllers/Apicjgx.php

@@ -63,8 +63,6 @@ class Apicjgx extends Start_Controller {
             // }
             $this->checkCirculat($info,$lbrk[0]);
             return ;
-        }else{
-            $this->cancelWjf($info);
         }
 
         //如果是 成品库 布标打印 发块 滞销款 不做处理  再次判定状态是否是 超时一次 超时两次 
@@ -112,26 +110,26 @@ class Apicjgx extends Start_Controller {
 
     }
 
-    public function cancelWjf($info){
-        $fid = $info['id'];
-        $list = $this->systemtransfer_cr->find_all("fid = ".$fid,"*",'id desc',0,2);
-        if(empty($list)){
-            return;
-        }
-        //如果没2条就不执行了  因为
-        if(count($list) < 2){
-            return ;
-        }
-        //操作车间一致  就直接返回
-        if($list[0]['lx'] ==  $list[1]['lx']){
-            return ;
-        }
-        if($list[1]['extra_status'] == 1){
-            $this->systemtransfer_cr->save([
-                'extra_status'=>0
-            ],$list[1]['id']);
-        }
-    }
+    // public function cancelWjf($info){
+    //     $fid = $info['id'];
+    //     $list = $this->systemtransfer_cr->find_all("fid = ".$fid,"*",'id desc',0,2);
+    //     if(empty($list)){
+    //         return;
+    //     }
+    //     //如果没2条就不执行了  因为
+    //     if(count($list) < 2){
+    //         return ;
+    //     }
+    //     //操作车间一致  就直接返回
+    //     if($list[0]['lx'] ==  $list[1]['lx']){
+    //         return ;
+    //     }
+    //     if($list[1]['extra_status'] == 1){
+    //         $this->systemtransfer_cr->save([
+    //             'extra_status'=>0
+    //         ],$list[1]['id']);
+    //     }
+    // }
     //如果检测到最后的入库是
     /**
      * $id  工单主键id

+ 24 - 0
core/CoreApp/controllers/Transfer.php

@@ -1048,6 +1048,7 @@ class Transfer extends Start_Controller {
 					echo json_encode(array('msg'=>'已有出库记录,不可连续重复录入!','success'=>false));exit;
 				}
 			}
+			$this->_doCancelWlz($lb['id']);
 			$cztime = 'ctime'.$transfer;
 			$this->logic_ding->sendToDing("检测货物流转打印情况".$transfer."|".$cz."|".$lb['number']."|".$lb['id']);
 			if(($transfer == 3 && $lb['dbapi'] < 99 && $cz == 2) || ($transfer == 13 && $lb['dbapi'] < 99 && $cz == 1))//出入库用这个
@@ -1225,6 +1226,29 @@ class Transfer extends Start_Controller {
 		}
 		$this->systemtransfer_cr->save(['orver_flag'=>3],$list[0]['id']);
 		
+	}
+	//检测是否可以取消长期未流转
+	private function _doCancelWlz($fid){
+		
+		$info = $this->systemtransfer->read($fid);
+		
+		$list = $this->systemtransfer_cr->find_all("fid = ".$fid,'*','id desc');
+		if(empty($list)){
+			return;
+		}
+		$id = $list[0]['id'];
+		$scan_time = $list[0]['time'];
+	
+		if(time() - $scan_time < 3600 * 24 * 3){
+			$this->systemtransfer_cr->save([
+				'extra_status'=>0,
+			],$id);
+		}else{
+			$this->systemtransfer_cr->save([
+				'extra_status'=>2,
+			],$id);
+		}
+		
 	}
 	
 	//检测是否超时  车间流转环节