|
@@ -70,7 +70,44 @@ class Vehicle extends CatchController
|
|
];
|
|
];
|
|
return $response;
|
|
return $response;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // public function index(Request $request)
|
|
|
|
+ // {
|
|
|
|
+ // ini_set('memory_limit','3072M');
|
|
|
|
+ // set_time_limit(0);
|
|
|
|
+ // $cond=[
|
|
|
|
+ // '_string'=>'o.rfid_id = s.id',
|
|
|
|
+ // ];
|
|
|
|
+ // // $count=queryOracleCount('DSSC3.W_DW_NON_MOTOR o,DSSC3.W_DW_NON_MOTOR_OWNER r,DSSC3.W_DW_RFID_TAGS s',$cond);
|
|
|
|
+ // $count=queryOracleCount('DSSC3.W_DW_NON_MOTOR o,DSSC3.W_DW_RFID_TAGS s',$cond);
|
|
|
|
+ // $to=ceil($count/10000);
|
|
|
|
+ // var_dump($to);
|
|
|
|
+ // for($i=1;$i<=$to;$i++){
|
|
|
|
+ // var_dump($i);
|
|
|
|
+ // $cond['page']=$i;
|
|
|
|
+ // $cond['limit']=10000;
|
|
|
|
+ // // $rows=queryOracleSelect('DSSC3.W_DW_NON_MOTOR o,DSSC3.W_DW_NON_MOTOR_OWNER r,DSSC3.W_DW_RFID_TAGS s',$cond,'o.PLATE_NO,s.RFID_SN,r. NAME,r.ID_CARD_NUMBER,r.MOBILE_NUMBER,r.HOME_ADDRESS');
|
|
|
|
+ // $rows=queryOracleSelect('DSSC3.W_DW_NON_MOTOR o,DSSC3.W_DW_RFID_TAGS s',$cond,'o.PLATE_NO,o.CAR_TYPE,o.CAR_BRAND,s.ID,s.RFID_SN,s.INSTALLER,to_char(s.INSTA_DATE,\'yyyy-mm-dd hh24:mi:ss\') INSTA_DATE');
|
|
|
|
+ // // var_dump(count($rows));
|
|
|
|
+ // $data=[];
|
|
|
|
+ // foreach($rows as &$val){
|
|
|
|
+ // $item=array(
|
|
|
|
+ // 'license_plate'=>$val['PLATE_NO'],
|
|
|
|
+ // 'car_type'=>$val['CAR_TYPE'],
|
|
|
|
+ // 'brand_id'=>(int)$val['CAR_BRAND'],
|
|
|
|
+ // 'rfid_sn'=>$val['RFID_SN'],
|
|
|
|
+ // 'installer'=>$val['INSTALLER'],
|
|
|
|
+ // 'license_time'=>$val['INSTA_DATE'],
|
|
|
|
+ // );
|
|
|
|
+ // array_push($data,$item);
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // $success = Db::table('vehicles')->limit(1000)->insertAll($data);
|
|
|
|
+ // var_dump($success);
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 保存信息
|
|
* 保存信息
|
|
@@ -210,24 +247,29 @@ class Vehicle extends CatchController
|
|
// ->where('code', $value)
|
|
// ->where('code', $value)
|
|
// ->cache(true, 60)
|
|
// ->cache(true, 60)
|
|
// ->value('remark');
|
|
// ->value('remark');
|
|
|
|
+
|
|
|
|
+ $r=$this->execSaveVehicle($param);
|
|
$total += $highestRow - 1;
|
|
$total += $highestRow - 1;
|
|
for ($j = 2; $j <= $highestRow; $j++) {
|
|
for ($j = 2; $j <= $highestRow; $j++) {
|
|
$arr = array(); //每条设备信息
|
|
$arr = array(); //每条设备信息
|
|
$arr['PLATE_NO'] = strtoupper(trim($sheet->getCell("A" . $j)->getFormattedValue()));
|
|
$arr['PLATE_NO'] = strtoupper(trim($sheet->getCell("A" . $j)->getFormattedValue()));
|
|
$brand = trim($sheet->getCell("B" . $j)->getFormattedValue());
|
|
$brand = trim($sheet->getCell("B" . $j)->getFormattedValue());
|
|
-
|
|
|
|
- // $brand_id=Db::table("sys_dict_data")->where('type_id', $type_id)->where('code', $value)->value('remark');
|
|
|
|
|
|
+ $brand_id=Db::table("sys_dict_data")->where('type_id', $brand_type_id)->whereLike('value','%'.$brand.'%')->cache(60)->value('code');
|
|
|
|
+ $arr['CAR_BRAND']=$brand_id?$brand_id:'99';
|
|
|
|
+
|
|
$type = trim($sheet->getCell("C" . $j)->getFormattedValue());
|
|
$type = trim($sheet->getCell("C" . $j)->getFormattedValue());
|
|
|
|
+ $car_type=Db::table("sys_dict_data")->where('type_id', $car_type_id)->whereLike('value','%'.$type.'%')->cache(60)->value('code');
|
|
|
|
+ $arr['CAR_BRAND']=$car_type?$car_type:'4';
|
|
$arr['RFID_SN'] = trim($sheet->getCell("D" . $j)->getFormattedValue());
|
|
$arr['RFID_SN'] = trim($sheet->getCell("D" . $j)->getFormattedValue());
|
|
$arr['INSTA_DATE'] = trim($sheet->getCell("E" . $j)->getFormattedValue());
|
|
$arr['INSTA_DATE'] = trim($sheet->getCell("E" . $j)->getFormattedValue());
|
|
$arr['INSTALLER'] = trim($sheet->getCell("F" . $j)->getFormattedValue());
|
|
$arr['INSTALLER'] = trim($sheet->getCell("F" . $j)->getFormattedValue());
|
|
var_dump($arr);
|
|
var_dump($arr);
|
|
- // $r=$this->execSaveStation($arr);
|
|
|
|
- // if($r){
|
|
|
|
- // $success++;
|
|
|
|
- // }else{
|
|
|
|
- // $fail++;
|
|
|
|
- // }
|
|
|
|
|
|
+ $r=$this->execSaveStation($arr);
|
|
|
|
+ if($r){
|
|
|
|
+ $success++;
|
|
|
|
+ }else{
|
|
|
|
+ $fail++;
|
|
|
|
+ }
|
|
// var_dump($arr);
|
|
// var_dump($arr);
|
|
// array_push($data,$arr);
|
|
// array_push($data,$arr);
|
|
}
|
|
}
|
|
@@ -242,4 +284,5 @@ class Vehicle extends CatchController
|
|
// }
|
|
// }
|
|
// return CatchResponse::success(['error' => true, 'msg' => '导入失败']);
|
|
// return CatchResponse::success(['error' => true, 'msg' => '导入失败']);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|