|
@@ -14,17 +14,18 @@ class CronAction extends Action {
|
|
|
|
|
|
private function createElectronicPlate( ){
|
|
|
$start = time();
|
|
|
- $pendingElectricPlate = Redis('jyzl_wait_create_eplate');
|
|
|
+ $pendingElectricPlate = Redis('jyzl_wait_create_eplate','queue');
|
|
|
$plateLocalPath = Redis('jyzl_wait_upload2oss_eplate', 'queue');
|
|
|
while( (time() - $start) < 60 ){
|
|
|
$licensPlate = $pendingElectricPlate->pop();
|
|
|
if(!$licensPlate){
|
|
|
echo 'no message!'.PHP_EOL;
|
|
|
sleep(1);
|
|
|
+ continue;
|
|
|
}
|
|
|
echo 'pop licensPlate:'.$licensPlate.PHP_EOL;
|
|
|
- $field = 'LicensPlate,VehicleColor, FullName, Address, FrameNumber, MotorNumber, VehicleBrand, RegistrationTime';
|
|
|
- $vehicleInfo = M('jms_vehicle')->where(array('LicensPlate' => $licensPlate))->field($field)->find();
|
|
|
+ $field = 'LicensePlate,VehicleColor, FullName, Address, FrameNumber, MotorNumber, VehicleBrand, RegistrationTime';
|
|
|
+ $vehicleInfo = M('jms_vehicle')->where(array('LicensePlate' => $licensPlate))->field($field)->find();
|
|
|
if(!$vehicleInfo){
|
|
|
echo 'vehicleInfo not existed,$licensPlate = '.$licensPlate .PHP_EOL;
|
|
|
continue;
|
|
@@ -41,7 +42,7 @@ class CronAction extends Action {
|
|
|
}
|
|
|
}
|
|
|
//生成的本地电子车牌,加入到待上传oss队列
|
|
|
- $up2ossWait = json_encode(array('licensPlate' => $licensPlate, 'localPath' => $localPath));
|
|
|
+ $up2ossWait = json_encode(array('LicensePlate' => $licensPlate, 'localPath' => $localPath));
|
|
|
$reslut = $plateLocalPath->add($up2ossWait);//push方法没有返回值,用add代替
|
|
|
if(!$result){
|
|
|
echo 'plateLocalPath->add() failed,$licensPlate = '.$licensPlate .PHP_EOL;
|
|
@@ -261,9 +262,9 @@ class CronAction extends Action {
|
|
|
|
|
|
|
|
|
private function createLocalElectronicPlate( $params ){
|
|
|
- $license_plate = $params['LicensPlate'];
|
|
|
+ $license_plate = $params['LicensePlate'];
|
|
|
if(!$license_plate){
|
|
|
- echo "LicensPlate empty!".PHP_EOL;
|
|
|
+ echo "LicensePlate empty!".PHP_EOL;
|
|
|
return false;
|
|
|
}
|
|
|
$vehicle_color = $params['VehicleColor'];
|
|
@@ -311,7 +312,7 @@ class CronAction extends Action {
|
|
|
|
|
|
$im = imagecreatetruecolor(500, 278); // 设置画布
|
|
|
//$bg = imagecreatefromjpeg('bg.jpg'); // 设置背景图片
|
|
|
- $front_img = './Public/images/front.jpg'
|
|
|
+ $front_img = './Public/images/front.jpg';
|
|
|
if(!is_file($front_img)){
|
|
|
echo "front_img not existed! front_img: ".$front_img.PHP_EOL;
|
|
|
return false;
|