|
@@ -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);
|