|
|
@ -52,13 +52,26 @@ public class CarIdentificationService implements ICarIdentificationService{ |
|
|
|
carRecord.setPlateType(param.get("plate_color")); |
|
|
|
carRecord.setCamId(param.get("cam_id")); |
|
|
|
carRecord.setRecordTime(Long.parseLong(param.get("start_time"))*1000); |
|
|
|
String pictureBase64 = param.get("picture"); |
|
|
|
|
|
|
|
String pictureBase64 = param.get("picture"); |
|
|
|
String newPictureBase64 = pictureBase64.replace(".", "=").replace("_", "/").replace("-", "+"); |
|
|
|
|
|
|
|
String pictureUrl = Base64FileUtil.base64ToFile("data:image/png;base64,"+newPictureBase64,PropUtil.path, "/file/" + DateUtil.today() + "/"); |
|
|
|
carRecord.setPicture(PropUtil.imgDomain+pictureUrl); |
|
|
|
|
|
|
|
carRecord.setPicture(pictureUrl); |
|
|
|
//根据车型预估重量
|
|
|
|
switch(param.get("vehicle_type")){ |
|
|
|
case Constant.NON_MOTOR: |
|
|
|
carRecord.setCarWeight(Constant.NON_MOTOR_WEIGHT); |
|
|
|
break; |
|
|
|
case Constant.SMALL_CAR: |
|
|
|
carRecord.setCarWeight(Constant.SMALL_CAR_WEIGHT); |
|
|
|
break; |
|
|
|
case Constant.MEDIUM_CAR: |
|
|
|
carRecord.setCarWeight(Constant.MEDIUM_CAR_WEIGHT); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
carRecordDao.insertSelective(carRecord); |
|
|
|
jsonObject.put("error_num","0"); |
|
|
|
jsonObject.put("error_str","无"); |
|
|
|