Просмотр исходного кода

1、剩余车位数查询逻辑优化
2、进出场记录分别记录plateId

fulonglong 2 лет назад
Родитель
Сommit
927532d5c5

+ 6 - 1
src/main/java/com/charging/chargingparking/entity/ParkingRecord.java

@@ -31,10 +31,15 @@ public class ParkingRecord implements Serializable {
     private String carNum;
 
     /**
-     * 当前车牌id
+     * 入口当前车牌id
      */
     private Integer plateId;
 
+    /**
+     * 出口当前车牌id
+     */
+    private Integer outPlateId;
+
     /**
      * 停车时间
      */

+ 1 - 15
src/main/java/com/charging/chargingparking/modules/mobileController/ParkingRecordController.java

@@ -81,24 +81,10 @@ public class ParkingRecordController {
             receiveDeviceDTO.setChannelNum(channel_num);
             jsonObject = parkingChannelService.receiveDeviceInfo(receiveDeviceDTO);
 
-
-            /*if (jsonObject.get(ParkingConstant.RESPONSEKEY) != null){
-                ResponseAlarmInfoPlate responseAlarmInfoPlate = (ResponseAlarmInfoPlate) jsonObject.get(ParkingConstant.RESPONSEKEY);
-            }else {
-                Thread.sleep(3000);
-            }*/
-
             if (jsonObject.get(ParkingConstant.RESPONSEKEY) == null){
-                Thread.sleep(3000);
-            }
-
-
-
-
-            /*if (responseAlarmInfoPlate == null || StringUtils.isEmpty(responseAlarmInfoPlate.getInfo())) {
                 //说明不需要开门,线程休息3秒(设备心跳连接会维持60秒,超过60秒才会重连)
                 Thread.sleep(3000);
-            }*/
+            }
         } catch (Exception ex) {
             log.error(ex.getMessage(), ex);
         }

+ 49 - 33
src/main/java/com/charging/chargingparking/service/impl/ParkingInfoServiceImpl.java

@@ -17,8 +17,10 @@ import com.charging.chargingparking.modules.common.dto.Sort;
 import com.charging.chargingparking.service.ParkingInfoService;
 import com.charging.chargingparking.mapper.ParkingInfoMapper;
 import com.charging.chargingparking.service.ParkingRecordService;
+import org.apache.poi.xwpf.usermodel.XWPFEndnote;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
 import javax.annotation.Resource;
 import java.util.Date;
 import java.util.List;
@@ -29,9 +31,9 @@ import java.util.Map;
  */
 @Service
 public class ParkingInfoServiceImpl extends ServiceImpl<ParkingInfoMapper, ParkingInfo>
-        implements ParkingInfoService{
+        implements ParkingInfoService {
 
-    @Resource(name="parkingInfoMapper")
+    @Resource(name = "parkingInfoMapper")
     private ParkingInfoMapper parkingInfoMapper;
 
     @Autowired
@@ -71,7 +73,7 @@ public class ParkingInfoServiceImpl extends ServiceImpl<ParkingInfoMapper, Parki
 
 
     @Override
-    public List<ParkingInfo> findByUserId(String userId){
+    public List<ParkingInfo> findByUserId(String userId) {
         return parkingInfoMapper.findByUserId(userId);
     }
 
@@ -85,41 +87,55 @@ public class ParkingInfoServiceImpl extends ServiceImpl<ParkingInfoMapper, Parki
         page.setCurrent(pageNumber);
         page.setSize(pageSize);
 
-        return parkingInfoMapper.search(searchParams,sortList,page);
+        return parkingInfoMapper.search(searchParams, sortList, page);
     }
 
     @Override
     public void updateSurplusParkingNumber(JSONObject jsonObject, ParkingChannel parkingChannel) {
 
-        synchronized (this){
-            try{
-               String obj = jsonObject.getString(ParkingConstant.RESPONSEKEY);
-               if (obj != null){
-                   ResponseAlarmInfoPlate responseAlarmInfoPlate = JSONObject.parseObject(obj,ResponseAlarmInfoPlate.class);
-                   String result = responseAlarmInfoPlate.getInfo();
-                   if (ParkingConstant.OK.equals(result)){
-                       ParkingInfo parkingInfo = getById(parkingChannel.getParkId());
-                       //入口车位数减少
-                       if ("1".equals(parkingChannel.getChannelType())){
-                           parkingInfo.setSurplusParkingNumber(parkingInfo.getSurplusParkingNumber()-1);
-                           //剩余车位不能小于停车场最小车位数
-                           if (parkingInfo.getSurplusParkingNumber() < parkingInfo.getMinParkingNumber()){
-                               parkingInfo.setSurplusParkingNumber(parkingInfo.getMinParkingNumber());
-                           }
-                       }
-                       //出口车位数增加
-                       else {
-                           parkingInfo.setSurplusParkingNumber(parkingInfo.getSurplusParkingNumber()+1);
-                           //最大车位不能大于总车位数
-                           if (parkingInfo.getSurplusParkingNumber()>parkingInfo.getTotalParkingNumber()){
-                               parkingInfo.setSurplusParkingNumber(parkingInfo.getTotalParkingNumber());
-                           }
-                       }
-                       updateById(parkingInfo);
-                   }
-               }
-            }catch (Exception ex){
-                log.error(ex.getMessage()+"剩余车位计算错误",ex);
+        synchronized (this) {
+            try {
+                ParkingInfo parkingInfo = getById(parkingChannel.getParkId());
+                String obj = jsonObject.getString(ParkingConstant.RESPONSEKEY);
+                if (obj != null) {
+                    ResponseAlarmInfoPlate responseAlarmInfoPlate = JSONObject.parseObject(obj, ResponseAlarmInfoPlate.class);
+                    String result = responseAlarmInfoPlate.getInfo();
+                    if (ParkingConstant.OK.equals(result)) {
+
+                        //入口车位数减少
+                        if ("1".equals(parkingChannel.getChannelType())) {
+                            parkingInfo.setSurplusParkingNumber(parkingInfo.getSurplusParkingNumber() - 1);
+                            //剩余车位不能小于停车场最小车位数
+                            if (parkingInfo.getSurplusParkingNumber() < parkingInfo.getMinParkingNumber()) {
+                                parkingInfo.setSurplusParkingNumber(parkingInfo.getMinParkingNumber());
+                            }
+                        }
+                        //出口车位数增加
+                        else {
+                            parkingInfo.setSurplusParkingNumber(parkingInfo.getSurplusParkingNumber() + 1);
+                            //最大车位不能大于总车位数
+                            if (parkingInfo.getSurplusParkingNumber() > parkingInfo.getTotalParkingNumber()) {
+                                parkingInfo.setSurplusParkingNumber(parkingInfo.getTotalParkingNumber());
+                            }
+                        }
+                        updateById(parkingInfo);
+                    }
+                }
+                //计算停车场内在场车辆(锦天停车场)
+                if ("5f8d343e-63d1-4ef0-9844-855ca020d92b".equals(parkingInfo.getId())){
+                    QueryWrapper queryWrapper = new QueryWrapper();
+                    queryWrapper.eq("park_id",parkingInfo.getId());
+                    queryWrapper.eq("release_status","0");
+                    List<ParkingRecord> list = parkingRecordService.list(queryWrapper);
+                    if (parkingInfo.getSurplusParkingNumber() !=parkingInfo.getTotalParkingNumber()-list.size()){
+                        parkingInfo.setSurplusParkingNumber(parkingInfo.getTotalParkingNumber()-list.size());
+                        updateById(parkingInfo);
+                    }
+
+                }
+
+            } catch (Exception ex) {
+                log.error(ex.getMessage() + "剩余车位计算错误", ex);
             }
         }
 

+ 277 - 277
src/main/java/com/charging/chargingparking/service/impl/ParkingRecordServiceImpl.java

@@ -108,12 +108,11 @@ public class ParkingRecordServiceImpl extends ServiceImpl<ParkingRecordMapper, P
         //传递的时间参数
         String dataStr = StringUtils.getAlarmInfoPlateTimeStr(alarmInfoPlate.getResult().getPlateResult().getTimeStamp().getTimeval());
         //比较时间与当前时间,如果相差30S则不处理
-        if (DateUtil.parse(dataStr).compareTo(DateUtil.offsetSecond(new Date(),-30)) <0){
-            throw new Exception(StrUtil.format("记录时间与创建时间相差超过30s,记录:{}",alarmInfoPlate));
+        if (DateUtil.parse(dataStr).compareTo(DateUtil.offsetSecond(new Date(), -30)) < 0) {
+            throw new Exception(StrUtil.format("记录时间与创建时间相差超过30s,记录:{}", alarmInfoPlate));
         }
 
 
-
         //图片小
         String imageFragmentFile = alarmInfoPlate.getResult().getPlateResult().getImageFragmentFile();
         //图片大
@@ -194,327 +193,328 @@ public class ParkingRecordServiceImpl extends ServiceImpl<ParkingRecordMapper, P
             record.setReleaseStatus("-1");
             save(record);
 
-        }
-
-        String memberType = parkingMemberService.getMemberType(parkingChannel.getParkId(), license);
-
-        //入口
-        if ("1".equals(parkingChannel.getChannelType())) {
-            QueryWrapper<ParkingRecord> parkingRecordQueryWrapper11 = new QueryWrapper<>();
-            parkingRecordQueryWrapper11.eq("park_id", parkingChannel.getParkId());
-            parkingRecordQueryWrapper11.eq("car_num", license);
-            parkingRecordQueryWrapper11.eq("plate_id", plateId);
-            parkingRecordQueryWrapper11.eq("in_channel_id", parkingChannel.getId());
-            parkingRecordQueryWrapper11.orderByDesc("create_time");
-
-            parkingRecordQueryWrapper11.last("LIMIT 1");
-            ParkingRecord parkingRecord11 = getOne(parkingRecordQueryWrapper11);
-            if (parkingRecord11 != null) {
-                throw new Exception(StrUtil.format("重复进场数据:{},记录id:{}", license,parkingRecord11.getId()));
-            }
-
-            QueryWrapper<ParkingRecord> parkingRecordQueryWrapper12 = new QueryWrapper<>();
-            parkingRecordQueryWrapper12.eq("car_num", license);
-            parkingRecordQueryWrapper12.eq("in_channel_id", parkingChannel.getId());
-            parkingRecordQueryWrapper12.eq("release_status", "0");
-            parkingRecordQueryWrapper12.gt("in_parking_time", DateUtil.offsetMinute(DateUtil.parse(dataStr), -2));
-            parkingRecordQueryWrapper12.orderByDesc("in_parking_time");
-
-            parkingRecordQueryWrapper12.last("LIMIT 1");
-            ParkingRecord parkingRecord12 = getOne(parkingRecordQueryWrapper12);
-            if (parkingRecord12 != null) {
-                throw new Exception(StrUtil.format("进口道闸重复数据,道闸:{},车牌:{},记录:{}", parkingChannel.getChannelName(), license,parkingRecord12.getId()));
-            }
-
-
-            //符合规则的车辆可入
-            if (parkingEnableVo.getOpen()) {
-                QueryWrapper queryWrapper1 = new QueryWrapper();
-                queryWrapper1.eq("car_num", license);
-                queryWrapper1.eq("park_id", parkingChannel.getParkId());
-                queryWrapper1.eq("release_status", "0");
-                List<ParkingRecord> parkingRecordList = list(queryWrapper1);
-                if (parkingRecordList.size() > 0) {
-                    for (ParkingRecord parkingRecord1 : parkingRecordList) {
-                        parkingRecord1.setReleaseStatus("1");
-                        parkingRecord1.setUpdateTime(new Date());
-                        updateById(parkingRecord1);
-                    }
-                }
-
+        } else {
+            String memberType = parkingMemberService.getMemberType(parkingChannel.getParkId(), license);
 
-                ParkingRecord parkingRecord = new ParkingRecord();
-                parkingRecord.setParkId(parkingChannel.getParkId());
-                parkingRecord.setCarNum(license);
-                parkingRecord.setPlateId(plateId);
-                parkingRecord.setInParkingTime(DateUtil.parse(dataStr));
-                parkingRecord.setProductTheme("停车费");
-                parkingRecord.setCarType(alarmInfoPlate.getResult().getPlateResult().getType().toString());
-                parkingRecord.setCType(alarmInfoPlate.getResult().getPlateResult().getTriggerType().toString());
-                parkingRecord.setCreateTime(new Date());
-                parkingRecord.setInChannelId(parkingChannel.getId());
-                parkingRecord.setInChannel(parkingChannel.getChannelName());
-                if (StrUtil.isNotBlank(imageFragmentFile)) {
-                    String fileUrl = fileUtil.uploadBase64(license + "入.png", imageFragmentFile);
-                    parkingRecord.setInFragmentImage(fileUrl);
-                }
-                if (StrUtil.isNotBlank(imageFile)) {
-                    String fileUrl = fileUtil.uploadBase64(license + "(大)入.png", imageFile);
-                    parkingRecord.setInImage(fileUrl);
-                }
-                parkingRecord.setMemberType(memberType);
-                if (StrUtil.isBlank(parkingRecord.getParkingNumLog())){
-                    parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
-                }else {
-                    parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog()+";"+StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
+            //入口
+            if ("1".equals(parkingChannel.getChannelType())) {
+                QueryWrapper<ParkingRecord> parkingRecordQueryWrapper11 = new QueryWrapper<>();
+                parkingRecordQueryWrapper11.eq("park_id", parkingChannel.getParkId());
+                parkingRecordQueryWrapper11.eq("car_num", license);
+                parkingRecordQueryWrapper11.eq("plate_id", plateId);
+                parkingRecordQueryWrapper11.eq("in_channel_id", parkingChannel.getId());
+                parkingRecordQueryWrapper11.orderByDesc("create_time");
+
+                parkingRecordQueryWrapper11.last("LIMIT 1");
+                ParkingRecord parkingRecord11 = getOne(parkingRecordQueryWrapper11);
+                if (parkingRecord11 != null) {
+                    throw new Exception(StrUtil.format("重复进场数据:{},记录:{}", license, parkingRecord11.getId()));
                 }
 
-                save(parkingRecord);
-
-                CarTypeVo carType = parkingMemberService.getCarType(license, parkingChannel.getParkId());
-                String sendContentAdd = "";
-                if (carType.getDays() > 0) {
-                    sendContentAdd = StrUtil.format(" 剩余{}天到期", carType.getDays());
+                QueryWrapper<ParkingRecord> parkingRecordQueryWrapper12 = new QueryWrapper<>();
+                parkingRecordQueryWrapper12.eq("car_num", license);
+                parkingRecordQueryWrapper12.eq("in_channel_id", parkingChannel.getId());
+                parkingRecordQueryWrapper12.eq("release_status", "0");
+                parkingRecordQueryWrapper12.gt("in_parking_time", DateUtil.offsetMinute(DateUtil.parse(dataStr), -2));
+                parkingRecordQueryWrapper12.orderByDesc("in_parking_time");
+
+                parkingRecordQueryWrapper12.last("LIMIT 1");
+                ParkingRecord parkingRecord12 = getOne(parkingRecordQueryWrapper12);
+                if (parkingRecord12 != null) {
+                    throw new Exception(StrUtil.format("进口道闸重复数据,道闸:{},车牌:{},记录:{}", parkingChannel.getChannelName(), license, parkingRecord12.getId()));
                 }
 
 
-                jsonObject.put("info", ParkingConstant.OK);
-                responseAlarmInfoPlate.setInfo(ParkingConstant.OK);
-                responseAlarmInfoPlate.setPlateid(parkingRecord.getPlateId());
-                responseAlarmInfoPlate.setSerialData(stringUtils.getSerialData(carType.getCarType() + license + ParkingConstant.INMESSAGE + sendContentAdd, null, null, carType.getCarType() + license + ParkingConstant.INMESSAGE + sendContentAdd, parkingChannel.getId(), true, true, 10L));
-            }
-            map.put(ParkingConstant.RESPONSEKEY, responseAlarmInfoPlate);
-        }
-        //出口
-        else {
-
-            QueryWrapper<ParkingRecord> parkingRecordQueryWrapper11 = new QueryWrapper<>();
-            parkingRecordQueryWrapper11.eq("park_id", parkingChannel.getParkId());
-            parkingRecordQueryWrapper11.eq("car_num", license);
-            parkingRecordQueryWrapper11.eq("plate_id", plateId);
-            parkingRecordQueryWrapper11.eq("out_channel_id", parkingChannel.getId());
-         //   parkingRecordQueryWrapper11.eq("out_parking_time", DateUtil.parse(dataStr));
-            parkingRecordQueryWrapper11.orderByDesc("create_time");
-
-            parkingRecordQueryWrapper11.last("LIMIT 1");
-            ParkingRecord parkingRecord11 = getOne(parkingRecordQueryWrapper11);
-            if (parkingRecord11 != null) {
-                throw new Exception(StrUtil.format("重复出场数据:{},记录:{}", license,parkingRecord11.getId()));
-            }
-
-            QueryWrapper<ParkingRecord> parkingRecordQueryWrapper12 = new QueryWrapper<>();
-            parkingRecordQueryWrapper12.eq("car_num", license);
-            parkingRecordQueryWrapper12.eq("out_channel_id", parkingChannel.getId());
-            parkingRecordQueryWrapper12.eq("release_status", "1");
-            parkingRecordQueryWrapper12.gt("out_parking_time", DateUtil.offsetMinute(DateUtil.parse(dataStr), -2));
-            parkingRecordQueryWrapper12.orderByDesc("out_parking_time");
-
-            parkingRecordQueryWrapper12.last("LIMIT 1");
-            ParkingRecord parkingRecord12 = getOne(parkingRecordQueryWrapper12);
-            if (parkingRecord12 != null) {
-                throw new Exception(StrUtil.format("出口道闸重复数据,道闸:{},车牌:{},记录id:{}", parkingChannel.getChannelName(), license,parkingRecord12.getId()));
-            }
-
-
-            if (parkingEnableVo.getOpen()) {
-
-                ParkingRecord parkingRecord0 = findParkingRecord(parkingChannel, license);
-
-                //荆鹏停车场:车辆出场时没有进场时间就采用上次的进场时间
-                if (parkingRecord0 == null && "1".equals(parkingInfo.getId())) {
-                    QueryWrapper<ParkingRecord> parkingRecordQueryWrapper1 = new QueryWrapper<>();
-                    parkingRecordQueryWrapper1.eq("park_id", parkingChannel.getParkId());
-                    parkingRecordQueryWrapper1.eq("car_num", license);
-                    parkingRecordQueryWrapper1.eq("release_status", "1");
-                    parkingRecordQueryWrapper1.orderByDesc("create_time");
-
-                    parkingRecordQueryWrapper1.last("LIMIT 1");
-                    ParkingRecord parkingRecord1 = getOne(parkingRecordQueryWrapper1);
-                    if (parkingRecord1 != null) {
-                        ParkingRecord parkingRecord = new ParkingRecord();
-                        parkingRecord.setParkId(parkingRecord1.getParkId());
-                        parkingRecord.setCarNum(license);
-                        parkingRecord.setPlateId(parkingRecord1.getPlateId());
-                        parkingRecord.setInParkingTime(parkingRecord1.getInParkingTime());
-                        parkingRecord.setProductTheme("停车费");
-                        parkingRecord.setCarType(parkingRecord1.getCarType());
-                        parkingRecord.setCType(parkingRecord1.getCType());
-                        parkingRecord.setCreateTime(new Date());
-                        parkingRecord.setInChannel(parkingRecord1.getInChannel());
-                        parkingRecord.setInChannelId(parkingRecord1.getInChannelId());
-                        parkingRecord.setMemberType(memberType);
-                        if (StrUtil.isBlank(parkingRecord.getParkingNumLog())){
-                            parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
-                        }else {
-                            parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog()+";"+StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
+                //符合规则的车辆可入
+                if (parkingEnableVo.getOpen()) {
+                    QueryWrapper queryWrapper1 = new QueryWrapper();
+                    queryWrapper1.eq("car_num", license);
+                    queryWrapper1.eq("park_id", plateId);
+                    queryWrapper1.eq("release_status", "0");
+                    List<ParkingRecord> parkingRecordList = list(queryWrapper1);
+                    if (parkingRecordList.size() > 0) {
+                        for (ParkingRecord parkingRecord1 : parkingRecordList) {
+                            parkingRecord1.setReleaseStatus("1");
+                            parkingRecord1.setUpdateTime(new Date());
+                            updateById(parkingRecord1);
                         }
-                        save(parkingRecord);
-                        parkingRecord0 = parkingRecord;
-                    }
-                }
-
-
-                if (parkingRecord0 == null) {
-
-                    QueryWrapper<ParkingRecord> parkingRecordQueryWrapper1 = new QueryWrapper<>();
-                    parkingRecordQueryWrapper1.eq("park_id", parkingChannel.getParkId());
-                    parkingRecordQueryWrapper1.eq("out_channel_id", parkingChannel.getId());
-                    parkingRecordQueryWrapper1.eq("car_num", license);
-                    parkingRecordQueryWrapper1.lt("out_parking_time", DateUtil.offsetSecond(DateUtil.parse(dataStr), 10));
-                    parkingRecordQueryWrapper1.gt("out_parking_time", DateUtil.offsetSecond(DateUtil.parse(dataStr), -10));
-                    parkingRecordQueryWrapper1.orderByDesc("create_time");
-
-                    parkingRecordQueryWrapper1.last("LIMIT 1");
-                    ParkingRecord parkingRecord1 = getOne(parkingRecordQueryWrapper1);
-                    if (parkingRecord1 != null) {
-                        throw new Exception(StrUtil.format("摄像头重复拍摄{}", license));
                     }
 
 
-                    //无记录默认放行,数据库记录
                     ParkingRecord parkingRecord = new ParkingRecord();
                     parkingRecord.setParkId(parkingChannel.getParkId());
                     parkingRecord.setCarNum(license);
                     parkingRecord.setPlateId(plateId);
-
-                    parkingRecord.setOutParkingTime(DateUtil.parse(dataStr));
+                    parkingRecord.setInParkingTime(DateUtil.parse(dataStr));
                     parkingRecord.setProductTheme("停车费");
                     parkingRecord.setCarType(alarmInfoPlate.getResult().getPlateResult().getType().toString());
                     parkingRecord.setCType(alarmInfoPlate.getResult().getPlateResult().getTriggerType().toString());
                     parkingRecord.setCreateTime(new Date());
-                    parkingRecord.setOutChannelId(parkingChannel.getId());
-                    parkingRecord.setOutChannel(parkingChannel.getChannelName());
+                    parkingRecord.setInChannelId(parkingChannel.getId());
+                    parkingRecord.setInChannel(parkingChannel.getChannelName());
                     if (StrUtil.isNotBlank(imageFragmentFile)) {
-                        String fileUrl = fileUtil.uploadBase64(license + ".png", imageFragmentFile);
-                        parkingRecord.setOutFragmentImage(fileUrl);
+                        String fileUrl = fileUtil.uploadBase64(license + "入.png", imageFragmentFile);
+                        parkingRecord.setInFragmentImage(fileUrl);
                     }
                     if (StrUtil.isNotBlank(imageFile)) {
-                        String fileUrl = fileUtil.uploadBase64(license + "(大).png", imageFile);
-                        parkingRecord.setOutImage(fileUrl);
+                        String fileUrl = fileUtil.uploadBase64(license + "(大)入.png", imageFile);
+                        parkingRecord.setInImage(fileUrl);
                     }
-                    parkingRecord.setReleaseStatus("1");
                     parkingRecord.setMemberType(memberType);
-                    if (StrUtil.isBlank(parkingRecord.getParkingNumLog())){
-                        parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
-                    }else {
-                        parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog()+";"+StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
+                    if (StrUtil.isBlank(parkingRecord.getParkingNumLog())) {
+                        parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+                    } else {
+                        parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog() + ";" + StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
                     }
-                    save(parkingRecord);
-                    /*//车辆进场修改停车场剩余车位
-                    parkingInfoService.updateSurplusParkingNumber(null, parkingChannel);*/
 
+                    save(parkingRecord);
 
                     CarTypeVo carType = parkingMemberService.getCarType(license, parkingChannel.getParkId());
+                    String sendContentAdd = "";
+                    if (carType.getDays() > 0) {
+                        sendContentAdd = StrUtil.format(" 剩余{}天到期", carType.getDays());
+                    }
+
 
                     jsonObject.put("info", ParkingConstant.OK);
                     responseAlarmInfoPlate.setInfo(ParkingConstant.OK);
-                    responseAlarmInfoPlate.setPlateid(parkingRecord.getPlateId());
-                    responseAlarmInfoPlate.setSerialData(stringUtils.getSerialData(carType.getCarType() + license + ParkingConstant.OUTMESSAGE, null, null, carType.getCarType() + license + ParkingConstant.OUTMESSAGE, parkingChannel.getId(), true, true, 10L));
-                    map.put(ParkingConstant.RESPONSEKEY, responseAlarmInfoPlate);
+                    responseAlarmInfoPlate.setPlateid(plateId);
+                    responseAlarmInfoPlate.setSerialData(stringUtils.getSerialData(carType.getCarType() + license + ParkingConstant.INMESSAGE + sendContentAdd, null, null, carType.getCarType() + license + ParkingConstant.INMESSAGE + sendContentAdd, parkingChannel.getId(), true, true, 10L));
                 }
-                //已存在记录,计算缴费金额
-                else {
-                    //出停车场的时间
-                    Date outParkingTime = DateUtil.parse(dataStr);
-                    //计算停车时间
-                    long parkingTimeLong = DateUtil.between(parkingRecord0.getInParkingTime(), outParkingTime, DateUnit.MINUTE);
-                    parkingRecord0.setParkingTime(Convert.toInt(parkingTimeLong));
-                    parkingRecord0.setOutChannelId(parkingChannel.getId());
-                    parkingRecord0.setOutChannel(parkingChannel.getChannelName());
-                    if (StrUtil.isNotBlank(imageFragmentFile)) {
-                        String fileUrl = fileUtil.uploadBase64(license + "出.png", imageFragmentFile);
-                        parkingRecord0.setOutFragmentImage(fileUrl);
-                    }
-                    if (StrUtil.isNotBlank(imageFile)) {
-                        String fileUrl = fileUtil.uploadBase64(license + "(大)出.png", imageFile);
-                        parkingRecord0.setOutImage(fileUrl);
+                map.put(ParkingConstant.RESPONSEKEY, responseAlarmInfoPlate);
+            }
+            //出口
+            else {
+
+                QueryWrapper<ParkingRecord> parkingRecordQueryWrapper11 = new QueryWrapper<>();
+                parkingRecordQueryWrapper11.eq("park_id", parkingChannel.getParkId());
+                parkingRecordQueryWrapper11.eq("car_num", license);
+                parkingRecordQueryWrapper11.eq("out_plate_id", plateId);
+                parkingRecordQueryWrapper11.eq("out_channel_id", parkingChannel.getId());
+                //   parkingRecordQueryWrapper11.eq("out_parking_time", DateUtil.parse(dataStr));
+                parkingRecordQueryWrapper11.orderByDesc("create_time");
+
+                parkingRecordQueryWrapper11.last("LIMIT 1");
+                ParkingRecord parkingRecord11 = getOne(parkingRecordQueryWrapper11);
+                if (parkingRecord11 != null) {
+                    throw new Exception(StrUtil.format("重复出场数据:{},记录:{}", license, parkingRecord11.getId()));
+                }
+
+                QueryWrapper<ParkingRecord> parkingRecordQueryWrapper12 = new QueryWrapper<>();
+                parkingRecordQueryWrapper12.eq("car_num", license);
+                parkingRecordQueryWrapper12.eq("out_channel_id", parkingChannel.getId());
+                parkingRecordQueryWrapper12.eq("release_status", "1");
+                parkingRecordQueryWrapper12.gt("out_parking_time", DateUtil.offsetMinute(DateUtil.parse(dataStr), -2));
+                parkingRecordQueryWrapper12.orderByDesc("out_parking_time");
+
+                parkingRecordQueryWrapper12.last("LIMIT 1");
+                ParkingRecord parkingRecord12 = getOne(parkingRecordQueryWrapper12);
+                if (parkingRecord12 != null) {
+                    throw new Exception(StrUtil.format("出口道闸重复数据,道闸:{},车牌:{},记录id:{}", parkingChannel.getChannelName(), license, parkingRecord12.getId()));
+                }
+
+
+                if (parkingEnableVo.getOpen()) {
+
+                    ParkingRecord parkingRecord0 = findParkingRecord(parkingChannel, license);
+
+                    //荆鹏停车场:车辆出场时没有进场时间就采用上次的进场时间
+                    if (parkingRecord0 == null && "1".equals(parkingInfo.getId())) {
+                        QueryWrapper<ParkingRecord> parkingRecordQueryWrapper1 = new QueryWrapper<>();
+                        parkingRecordQueryWrapper1.eq("park_id", parkingChannel.getParkId());
+                        parkingRecordQueryWrapper1.eq("car_num", license);
+                        parkingRecordQueryWrapper1.eq("release_status", "1");
+                        parkingRecordQueryWrapper1.orderByDesc("create_time");
+
+                        parkingRecordQueryWrapper1.last("LIMIT 1");
+                        ParkingRecord parkingRecord1 = getOne(parkingRecordQueryWrapper1);
+                        if (parkingRecord1 != null) {
+                            ParkingRecord parkingRecord = new ParkingRecord();
+                            parkingRecord.setParkId(parkingRecord1.getParkId());
+                            parkingRecord.setCarNum(license);
+                            parkingRecord.setOutPlateId(plateId);
+                            parkingRecord.setInParkingTime(parkingRecord1.getInParkingTime());
+                            parkingRecord.setProductTheme("停车费");
+                            parkingRecord.setCarType(parkingRecord1.getCarType());
+                            parkingRecord.setCType(parkingRecord1.getCType());
+                            parkingRecord.setCreateTime(new Date());
+                            parkingRecord.setInChannel(parkingRecord1.getInChannel());
+                            parkingRecord.setInChannelId(parkingRecord1.getInChannelId());
+                            parkingRecord.setMemberType(memberType);
+                            if (StrUtil.isBlank(parkingRecord.getParkingNumLog())) {
+                                parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+                            } else {
+                                parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog() + ";" + StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+                            }
+                            save(parkingRecord);
+                            parkingRecord0 = parkingRecord;
+                        }
                     }
-                    parkingRecord0.setOutParkingTime(outParkingTime);
 
 
-                    //获取车辆应缴费金额
-                    ParkingCostDTO parkingCostDTO = parkingFeeService.parkingCost2(parkingRecord0);
+                    if (parkingRecord0 == null) {
 
-                    BigDecimal parkingCost = parkingCostDTO.getNeedAmount();
+                        QueryWrapper<ParkingRecord> parkingRecordQueryWrapper1 = new QueryWrapper<>();
+                        parkingRecordQueryWrapper1.eq("park_id", parkingChannel.getParkId());
+                        parkingRecordQueryWrapper1.eq("out_channel_id", parkingChannel.getId());
+                        parkingRecordQueryWrapper1.eq("car_num", license);
+                        parkingRecordQueryWrapper1.lt("out_parking_time", DateUtil.offsetSecond(DateUtil.parse(dataStr), 10));
+                        parkingRecordQueryWrapper1.gt("out_parking_time", DateUtil.offsetSecond(DateUtil.parse(dataStr), -10));
+                        parkingRecordQueryWrapper1.orderByDesc("create_time");
+
+                        parkingRecordQueryWrapper1.last("LIMIT 1");
+                        ParkingRecord parkingRecord1 = getOne(parkingRecordQueryWrapper1);
+                        if (parkingRecord1 != null) {
+                            throw new Exception(StrUtil.format("摄像头重复拍摄{}", license));
+                        }
+
+
+                        //无记录默认放行,数据库记录
+                        ParkingRecord parkingRecord = new ParkingRecord();
+                        parkingRecord.setParkId(parkingChannel.getParkId());
+                        parkingRecord.setCarNum(license);
+                        parkingRecord.setOutPlateId(plateId);
+                        parkingRecord.setOutParkingTime(DateUtil.parse(dataStr));
+                        parkingRecord.setProductTheme("停车费");
+                        parkingRecord.setCarType(alarmInfoPlate.getResult().getPlateResult().getType().toString());
+                        parkingRecord.setCType(alarmInfoPlate.getResult().getPlateResult().getTriggerType().toString());
+                        parkingRecord.setCreateTime(new Date());
+                        parkingRecord.setOutChannelId(parkingChannel.getId());
+                        parkingRecord.setOutChannel(parkingChannel.getChannelName());
+                        if (StrUtil.isNotBlank(imageFragmentFile)) {
+                            String fileUrl = fileUtil.uploadBase64(license + "出.png", imageFragmentFile);
+                            parkingRecord.setOutFragmentImage(fileUrl);
+                        }
+                        if (StrUtil.isNotBlank(imageFile)) {
+                            String fileUrl = fileUtil.uploadBase64(license + "(大)出.png", imageFile);
+                            parkingRecord.setOutImage(fileUrl);
+                        }
+                        parkingRecord.setReleaseStatus("1");
+                        parkingRecord.setMemberType(memberType);
+                        if (StrUtil.isBlank(parkingRecord.getParkingNumLog())) {
+                            parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+                        } else {
+                            parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog() + ";" + StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+                        }
+                        save(parkingRecord);
+                    /*//车辆进场修改停车场剩余车位
+                    parkingInfoService.updateSurplusParkingNumber(null, parkingChannel);*/
 
-                    if (parkingCost.subtract(parkingRecord0.getPayAmount()).compareTo(BigDecimal.ZERO) == 0) {
 
-                        CarTypeVo carTypeVo = parkingMemberService.getCarType(license, parkingChannel.getParkId());
+                        CarTypeVo carType = parkingMemberService.getCarType(license, parkingChannel.getParkId());
 
                         jsonObject.put("info", ParkingConstant.OK);
                         responseAlarmInfoPlate.setInfo(ParkingConstant.OK);
-                        responseAlarmInfoPlate.setPlateid(parkingRecord0.getPlateId());
-                        responseAlarmInfoPlate.setSerialData(stringUtils.getSerialData(carTypeVo.getCarType() + license + ParkingConstant.OUTMESSAGE, null, null, carTypeVo.getCarType() + license + ParkingConstant.OUTMESSAGE, parkingChannel.getId(), true, true, 10L));
+                        responseAlarmInfoPlate.setPlateid(plateId);
+                        responseAlarmInfoPlate.setSerialData(stringUtils.getSerialData(carType.getCarType() + license + ParkingConstant.OUTMESSAGE, null, null, carType.getCarType() + license + ParkingConstant.OUTMESSAGE, parkingChannel.getId(), true, true, 10L));
                         map.put(ParkingConstant.RESPONSEKEY, responseAlarmInfoPlate);
-                        if (parkingCost.compareTo(BigDecimal.ZERO) == 0) {
-                            parkingRecord0.setTotalAmount(parkingCost);
+                    }
+                    //已存在记录,计算缴费金额
+                    else {
+                        //出停车场的时间
+                        Date outParkingTime = DateUtil.parse(dataStr);
+                        //计算停车时间
+                        long parkingTimeLong = DateUtil.between(parkingRecord0.getInParkingTime(), outParkingTime, DateUnit.MINUTE);
+                        parkingRecord0.setOutPlateId(plateId);
+                        parkingRecord0.setParkingTime(Convert.toInt(parkingTimeLong));
+                        parkingRecord0.setOutChannelId(parkingChannel.getId());
+                        parkingRecord0.setOutChannel(parkingChannel.getChannelName());
+                        if (StrUtil.isNotBlank(imageFragmentFile)) {
+                            String fileUrl = fileUtil.uploadBase64(license + "出.png", imageFragmentFile);
+                            parkingRecord0.setOutFragmentImage(fileUrl);
                         }
-                        parkingRecord0.setReleaseStatus("1");
-                        //有抵扣券则使用
-                        QueryWrapper queryWrapper1 = new QueryWrapper();
-                        queryWrapper1.eq("parking_record_id", parkingRecord0.getId());
-                        queryWrapper1.eq("use_status", false);
-                        queryWrapper1.orderByDesc("create_time");
-                        queryWrapper1.last("LIMIT 1");
-                        ParkingCoupon parkingCoupon = parkingCouponService.getOne(queryWrapper1);
-                        if (parkingCoupon != null) {
-                            parkingCoupon.setUseStatus(true);
-                            parkingCoupon.setUseTime(new Date());
-                            parkingCoupon.setVerifyTime(new Date());
+                        if (StrUtil.isNotBlank(imageFile)) {
+                            String fileUrl = fileUtil.uploadBase64(license + "(大)出.png", imageFile);
+                            parkingRecord0.setOutImage(fileUrl);
                         }
+                        parkingRecord0.setOutParkingTime(outParkingTime);
+
+
+                        //获取车辆应缴费金额
+                        ParkingCostDTO parkingCostDTO = parkingFeeService.parkingCost2(parkingRecord0);
+
+                        BigDecimal parkingCost = parkingCostDTO.getNeedAmount();
+
+                        if (parkingCost.subtract(parkingRecord0.getPayAmount()).compareTo(BigDecimal.ZERO) == 0) {
+
+                            CarTypeVo carTypeVo = parkingMemberService.getCarType(license, parkingChannel.getParkId());
+
+                            jsonObject.put("info", ParkingConstant.OK);
+                            responseAlarmInfoPlate.setInfo(ParkingConstant.OK);
+                            responseAlarmInfoPlate.setPlateid(plateId);
+                            responseAlarmInfoPlate.setSerialData(stringUtils.getSerialData(carTypeVo.getCarType() + license + ParkingConstant.OUTMESSAGE, null, null, carTypeVo.getCarType() + license + ParkingConstant.OUTMESSAGE, parkingChannel.getId(), true, true, 10L));
+                            map.put(ParkingConstant.RESPONSEKEY, responseAlarmInfoPlate);
+                            if (parkingCost.compareTo(BigDecimal.ZERO) == 0) {
+                                parkingRecord0.setTotalAmount(parkingCost);
+                            }
+                            parkingRecord0.setReleaseStatus("1");
+                            //有抵扣券则使用
+                            QueryWrapper queryWrapper1 = new QueryWrapper();
+                            queryWrapper1.eq("parking_record_id", parkingRecord0.getId());
+                            queryWrapper1.eq("use_status", false);
+                            queryWrapper1.orderByDesc("create_time");
+                            queryWrapper1.last("LIMIT 1");
+                            ParkingCoupon parkingCoupon = parkingCouponService.getOne(queryWrapper1);
+                            if (parkingCoupon != null) {
+                                parkingCoupon.setUseStatus(true);
+                                parkingCoupon.setUseTime(new Date());
+                                parkingCoupon.setVerifyTime(new Date());
+                            }
                        /* //车辆进场修改停车场剩余车位
                         parkingInfoService.updateSurplusParkingNumber(null, parkingChannel);*/
-                    } else {
-                        parkingRecord0.setTotalAmount(parkingCost);
+                        } else {
+                            parkingRecord0.setTotalAmount(parkingCost);
 
-                        responseAlarmInfoPlate.setInfo("");
-                        responseAlarmInfoPlate.setPlateid(parkingRecord0.getPlateId());
+                            responseAlarmInfoPlate.setInfo("");
+                            responseAlarmInfoPlate.setPlateid(plateId);
 
-                        List<SerialData> serialDataList = stringUtils.getSerialData(license, "时间:" + StringUtils.getParkingTimeStr(parkingRecord0.getParkingTime()), "费用:" + parkingCost.subtract(parkingRecord0.getPayAmount()), null, parkingChannel.getId(), true, false, 60L);
+                            List<SerialData> serialDataList = stringUtils.getSerialData(license, "时间:" + StringUtils.getParkingTimeStr(parkingRecord0.getParkingTime()), "费用:" + parkingCost.subtract(parkingRecord0.getPayAmount()), null, parkingChannel.getId(), true, false, 60L);
 
 
-                        responseAlarmInfoPlate.setSerialData(serialDataList);
+                            responseAlarmInfoPlate.setSerialData(serialDataList);
 
-                        delaySendVoice(parkingChannel, license, parkingRecord0, parkingCost);
+                            delaySendVoice(parkingChannel, license, parkingRecord0, parkingCost);
 
-                        // valueOperations.set(parkingChannel.getId() + "xp", new Date(), 20, TimeUnit.SECONDS);
+                            // valueOperations.set(parkingChannel.getId() + "xp", new Date(), 20, TimeUnit.SECONDS);
 
-                        map.put(ParkingConstant.RESPONSEKEY, responseAlarmInfoPlate);
-                    }
+                            map.put(ParkingConstant.RESPONSEKEY, responseAlarmInfoPlate);
+                        }
 
-                    parkingRecord0.setMemberType(memberType);
-                    if (StrUtil.isBlank(parkingRecord0.getParkingNumLog())){
-                        parkingRecord0.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
-                    }else {
-                        parkingRecord0.setParkingNumLog(parkingRecord0.getParkingNumLog()+";"+StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
-                    }
-                    updateById(parkingRecord0);
-                    //出停车场检测是否需要删除临时会员
-                    if (map.get(ParkingConstant.RESPONSEKEY) != null && "1".equals(parkingRecord0.getReleaseStatus())) {
-                        parkingMemberService.cloudDelete(null, parkingChannel.getParkId(), license);
-                    }
+                        parkingRecord0.setMemberType(memberType);
+                        if (StrUtil.isBlank(parkingRecord0.getParkingNumLog())) {
+                            parkingRecord0.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+                        } else {
+                            parkingRecord0.setParkingNumLog(parkingRecord0.getParkingNumLog() + ";" + StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+                        }
+                        updateById(parkingRecord0);
+                        //出停车场检测是否需要删除临时会员
+                        if (map.get(ParkingConstant.RESPONSEKEY) != null && "1".equals(parkingRecord0.getReleaseStatus())) {
+                            parkingMemberService.cloudDelete(null, parkingChannel.getParkId(), license);
+                        }
 
-                    if ("1".equals(parkingRecord0.getReleaseStatus())) {
-                        QueryWrapper queryWrapper1 = new QueryWrapper();
-                        queryWrapper1.eq("parking_record_id", parkingRecord0.getId());
-                        queryWrapper1.eq("use_status", false);
-                        ParkingCoupon parkingCoupon = parkingCouponService.getOne(queryWrapper1);
-                        if (parkingCoupon != null) {
-                            parkingCoupon.setUseStatus(true);
-                            parkingCoupon.setVerifyTime(parkingRecord0.getOutParkingTime());
-                            parkingCouponService.updateById(parkingCoupon);
+                        if ("1".equals(parkingRecord0.getReleaseStatus())) {
+                            QueryWrapper queryWrapper1 = new QueryWrapper();
+                            queryWrapper1.eq("parking_record_id", parkingRecord0.getId());
+                            queryWrapper1.eq("use_status", false);
+                            ParkingCoupon parkingCoupon = parkingCouponService.getOne(queryWrapper1);
+                            if (parkingCoupon != null) {
+                                parkingCoupon.setUseStatus(true);
+                                parkingCoupon.setVerifyTime(parkingRecord0.getOutParkingTime());
+                                parkingCouponService.updateById(parkingCoupon);
+                            }
                         }
                     }
-                }
 
+                }
             }
-        }
-        result.put(ParkingConstant.RESPONSEKEY, jsonObject);
+            result.put(ParkingConstant.RESPONSEKEY, jsonObject);
 
-        CompletableFuture.runAsync(() -> {
-            //车辆进场修改停车场剩余车位
-            parkingInfoService.updateSurplusParkingNumber(result, parkingChannel);
-        });
+            CompletableFuture.runAsync(() -> {
+                //车辆进场修改停车场剩余车位
+                parkingInfoService.updateSurplusParkingNumber(result, parkingChannel);
+            });
+
+        }
 
         return map;
     }
@@ -772,10 +772,10 @@ public class ParkingRecordServiceImpl extends ServiceImpl<ParkingRecordMapper, P
                 parkingRecord.setOpenId(temporaryVo.getOpenId());
                 parkingRecord.setCreateTime(new Date());
                 parkingRecord.setReleaseStatus("2");
-                if (StrUtil.isBlank(parkingRecord.getParkingNumLog())){
-                    parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
-                }else {
-                    parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog()+";"+StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
+                if (StrUtil.isBlank(parkingRecord.getParkingNumLog())) {
+                    parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+                } else {
+                    parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog() + ";" + StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
                 }
                 save(parkingRecord);
 
@@ -843,10 +843,10 @@ public class ParkingRecordServiceImpl extends ServiceImpl<ParkingRecordMapper, P
             parkingRecord0.setOutChannelId(parkingChannel.getId());
             parkingRecord0.setOutChannel(parkingChannel.getChannelName());
             parkingRecord0.setOutParkingTime(new Date());
-            if (StrUtil.isBlank(parkingRecord0.getParkingNumLog())){
-                parkingRecord0.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
-            }else {
-                parkingRecord0.setParkingNumLog(parkingRecord0.getParkingNumLog()+";"+StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
+            if (StrUtil.isBlank(parkingRecord0.getParkingNumLog())) {
+                parkingRecord0.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+            } else {
+                parkingRecord0.setParkingNumLog(parkingRecord0.getParkingNumLog() + ";" + StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
             }
             updateById(parkingRecord0);
         }
@@ -895,10 +895,10 @@ public class ParkingRecordServiceImpl extends ServiceImpl<ParkingRecordMapper, P
             parkingRecord.setInChannelId(temporaryVo.getChannelId());
             parkingRecord.setInChannel(parkingChannel.getChannelName());
             parkingRecord.setUpdateTime(new Date());
-            if (StrUtil.isBlank(parkingRecord.getParkingNumLog())){
-                parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
-            }else {
-                parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog()+";"+StrUtil.format("剩余车位数:{},时间:{}",parkingInfo.getSurplusParkingNumber(),DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")));
+            if (StrUtil.isBlank(parkingRecord.getParkingNumLog())) {
+                parkingRecord.setParkingNumLog(StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
+            } else {
+                parkingRecord.setParkingNumLog(parkingRecord.getParkingNumLog() + ";" + StrUtil.format("剩余车位数:{},时间:{}", parkingInfo.getSurplusParkingNumber(), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
             }
             parkingRecord.setReleaseStatus("0");
             updateById(parkingRecord);

+ 2 - 1
src/main/resources/mapper/ParkingRecordMapper.xml

@@ -8,7 +8,8 @@
             <id property="id" column="id" jdbcType="VARCHAR"/>
             <result property="parkId" column="park_id" jdbcType="VARCHAR"/>
             <result property="carNum" column="car_num" jdbcType="VARCHAR"/>
-            <result property="plateId" column="plate_id" jdbcType="VARCHAR"/>
+            <result property="plateId" column="plate_id" jdbcType="INTEGER"/>
+            <result property="outPlateId" column="out_plate_id" jdbcType="INTEGER"/>
             <result property="parkingTime" column="parking_time" jdbcType="DECIMAL"/>
             <result property="inParkingTime" column="in_parking_time" jdbcType="TIMESTAMP"/>
             <result property="paymentTime" column="payment_time" jdbcType="TIMESTAMP"/>