From 2a9a63e3693ec1b88160b61b5892082d2f76c24c Mon Sep 17 00:00:00 2001 From: ma <1062634917@qq.com> Date: Fri, 21 May 2021 09:26:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=985.20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/logistics/Util/Constant.java | 18 ++++++++++++++++++ .../ccsens/logistics/bean/dto/MbpsDto.java | 2 +- .../service/CarIdentificationService.java | 19 ++++++++++++++++--- .../ccsens/logistics/service/MbpsService.java | 7 ++++++- logistics/src/main/resources/application.yml | 4 ++-- .../LogisticsHeatImagingRecordDao.xml | 2 +- 6 files changed, 44 insertions(+), 8 deletions(-) diff --git a/logistics/src/main/java/com/ccsens/logistics/Util/Constant.java b/logistics/src/main/java/com/ccsens/logistics/Util/Constant.java index a4f87c61..413c86b5 100644 --- a/logistics/src/main/java/com/ccsens/logistics/Util/Constant.java +++ b/logistics/src/main/java/com/ccsens/logistics/Util/Constant.java @@ -42,4 +42,22 @@ public class Constant { * 在线获取数据 */ public static final String ONLINE = "online"; + + //车辆类型 + /** + * 非机动车 + */ + public static final String NON_MOTOR = "非机动车"; + public static final Long NON_MOTOR_WEIGHT = 1L; + /** + * 轿车 + */ + public static final String SMALL_CAR = "轿车"; + public static final Long SMALL_CAR_WEIGHT = 1L; + /** + * 面包车 + */ + public static final String MEDIUM_CAR = "面包车"; + public static final Long MEDIUM_CAR_WEIGHT = 20L; + } diff --git a/logistics/src/main/java/com/ccsens/logistics/bean/dto/MbpsDto.java b/logistics/src/main/java/com/ccsens/logistics/bean/dto/MbpsDto.java index 4ef11c44..21aee9b1 100644 --- a/logistics/src/main/java/com/ccsens/logistics/bean/dto/MbpsDto.java +++ b/logistics/src/main/java/com/ccsens/logistics/bean/dto/MbpsDto.java @@ -54,7 +54,7 @@ public class MbpsDto { @Data @ApiModel(value = "查询是否有火灾水灾") - public static class SelFireOrFlood{ + public static class SelFireOrFlood{ @NotNull(message = "请选择园区") @ApiModelProperty("园区id") private Long parkId; diff --git a/logistics/src/main/java/com/ccsens/logistics/service/CarIdentificationService.java b/logistics/src/main/java/com/ccsens/logistics/service/CarIdentificationService.java index 12c2d3c9..c662b7e6 100644 --- a/logistics/src/main/java/com/ccsens/logistics/service/CarIdentificationService.java +++ b/logistics/src/main/java/com/ccsens/logistics/service/CarIdentificationService.java @@ -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","无"); diff --git a/logistics/src/main/java/com/ccsens/logistics/service/MbpsService.java b/logistics/src/main/java/com/ccsens/logistics/service/MbpsService.java index c74b1f88..566fb7a4 100644 --- a/logistics/src/main/java/com/ccsens/logistics/service/MbpsService.java +++ b/logistics/src/main/java/com/ccsens/logistics/service/MbpsService.java @@ -116,7 +116,12 @@ public class MbpsService implements IMbpsService { public MbpsVo.SelTempAndHumidity selTeamAndHumidity(MbpsDto.SelTeamAndHumidity param) { MbpsVo.SelTempAndHumidity tempAndHumidity = new MbpsVo.SelTempAndHumidity(); - String[] countArr = new String[param.getQueryOfDay()]; + String[] countArr; + if (ObjectUtil.isNotNull(param.getQueryOfDay())){ + countArr = new String[param.getQueryOfDay()]; + }else{ + countArr = new String[5]; + } //查找当前时间 Date date = new Date(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH"); diff --git a/logistics/src/main/resources/application.yml b/logistics/src/main/resources/application.yml index 7e037ef8..ea3545e5 100644 --- a/logistics/src/main/resources/application.yml +++ b/logistics/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - active: dev - include: common,util-dev + active: prod + include: common,util-prod diff --git a/logistics/src/main/resources/mapper_dao/LogisticsHeatImagingRecordDao.xml b/logistics/src/main/resources/mapper_dao/LogisticsHeatImagingRecordDao.xml index 558569d0..becda785 100644 --- a/logistics/src/main/resources/mapper_dao/LogisticsHeatImagingRecordDao.xml +++ b/logistics/src/main/resources/mapper_dao/LogisticsHeatImagingRecordDao.xml @@ -15,7 +15,7 @@ AND le.rec_status = 0 WHERE ir.rec_status = 0 - + AND le.id = #{id}