|
@@ -209,6 +209,8 @@ class Vehicle extends CatchController
|
|
|
$param['INSTA_DATE']=date('Y-m-d H:i:s',time());
|
|
|
$param['INSTALLER']=$installer;
|
|
|
$r=$this->execSaveVehicle($param);
|
|
|
+ $param['DATA_TYPE']='vehicle_save';
|
|
|
+ pushDataToRedisList($param);
|
|
|
return CatchResponse::success($r);
|
|
|
}
|
|
|
private function execSaveVehicle($data){
|
|
@@ -237,10 +239,20 @@ class Vehicle extends CatchController
|
|
|
public function update(Request $request, $id) : \think\Response
|
|
|
{
|
|
|
$params=$request->post();
|
|
|
+ $conn=getOracleConnect();
|
|
|
+ //查老的车牌
|
|
|
+ $vehicle_sql='SELECT o.PLATE_NO FROM DSSC3.W_DW_NON_MOTOR o WHERE o.RFID_ID =\''.$id.'\' ';
|
|
|
+ $OLD_NO='';
|
|
|
+ $stid = oci_parse($conn, $vehicle_sql);
|
|
|
+ oci_define_by_name($stid, 'PLATE_NO', $OLD_NO);
|
|
|
+ oci_execute($stid);
|
|
|
+ oci_fetch($stid);
|
|
|
+ $params['OLD_NO']=$OLD_NO;
|
|
|
+
|
|
|
$params['RFID_SN']=strtoupper($params['RFID_SN']);
|
|
|
$params['PLATE_NO']=strtoupper($params['PLATE_NO']);
|
|
|
// var_dump($params);
|
|
|
- $conn=getOracleConnect();
|
|
|
+
|
|
|
// //更新
|
|
|
$sql='UPDATE DSSC3.W_DW_RFID_TAGS SET RFID_SN = \''.$params['RFID_SN'].'\' WHERE ID = \''.$id.'\' ';
|
|
|
$stid = oci_parse($conn, $sql);
|
|
@@ -251,6 +263,9 @@ class Vehicle extends CatchController
|
|
|
$stid2 = oci_parse($conn, $sql);
|
|
|
$r2 = oci_execute($stid2);
|
|
|
|
|
|
+ $params['DATA_TYPE']='vehicle_update';
|
|
|
+ pushDataToRedisList($params);
|
|
|
+
|
|
|
return CatchResponse::success('修改成功');
|
|
|
|
|
|
}
|
|
@@ -263,6 +278,18 @@ class Vehicle extends CatchController
|
|
|
public function delete($id) : \think\Response
|
|
|
{
|
|
|
$conn=getOracleConnect();
|
|
|
+
|
|
|
+ $sql='SELECT PLATE_NO FROM DSSC3.W_DW_NON_MOTOR WHERE RFID_ID in ('.$id.')';
|
|
|
+ $stid = oci_parse($conn, $sql);
|
|
|
+ $r = oci_execute($stid);
|
|
|
+ $rows=[];
|
|
|
+ while($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
|
|
|
+ $rows[]=$row['PLATE_NO'];
|
|
|
+ }
|
|
|
+ $delete_data['PLATE_NO']=$rows;
|
|
|
+ $delete_data['DATA_TYPE']='vehicle_delete';
|
|
|
+
|
|
|
+
|
|
|
$sql='DELETE FROM DSSC3.W_DW_RFID_TAGS WHERE ID in ('.$id.')';
|
|
|
|
|
|
$stid = oci_parse($conn, $sql);
|
|
@@ -271,6 +298,8 @@ class Vehicle extends CatchController
|
|
|
$sql='DELETE FROM DSSC3.W_DW_NON_MOTOR WHERE RFID_ID in ('.$id.')';
|
|
|
$stid = oci_parse($conn, $sql);
|
|
|
$r = oci_execute($stid);
|
|
|
+
|
|
|
+ pushDataToRedisList($delete_data);
|
|
|
return CatchResponse::success($r);
|
|
|
}
|
|
|
/**
|
|
@@ -351,6 +380,8 @@ class Vehicle extends CatchController
|
|
|
// var_dump($arr);
|
|
|
$r=$this->execSaveVehicle($arr);
|
|
|
if($r){
|
|
|
+ $arr['DATA_TYPE']='vehicle_save';
|
|
|
+ pushDataToRedisList($arr);
|
|
|
$success++;
|
|
|
}else{
|
|
|
$fail++;
|