| | |
| | | import ledshow.LedBean; |
| | | import ledshow.ResultData; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | outPark.setStatus2(1); |
| | | outParkService.saveOrUpdate(outPark); |
| | | easyOpen(request,response); |
| | | enterParkService.deleteByCarNo(outPark.getCarNo(), barrier.getParkId()); |
| | | } |
| | | if(barrier.getType() == 1){ |
| | | boolean in = barrierService.getDateDifIn(barrier.getId()); |
| | |
| | | barrier.setCarNo(carNo); |
| | | //led展示 |
| | | if(toDayHrMinSec == null){ |
| | | toDayHrMinSec = "不足两小时"; |
| | | toDayHrMinSec = "入场记录异常,请联系管理员"; |
| | | } |
| | | //判断是否在白名单 |
| | | QueryWrapper<WhiteList> wrapper = new QueryWrapper<>(); |
| | |
| | | if(carNo.equals("无车牌")){ |
| | | noOpen(request,response,data1); |
| | | }else { |
| | | //开闸 |
| | | open(request,response,data1); |
| | | redisTemplate.opsForValue().set("park_change_in_"+parkId,"true",1, TimeUnit.DAYS); |
| | | int i = Integer.parseInt(redisnum); |
| | | i--; |
| | | if(i<0){ |
| | | String s= "2."+carNo+",场内停车数为0\n"; |
| | | writeTxt2(s); |
| | | redisTemplate.opsForValue().set("car_park_" + parkId,"0",30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + parkId,"true",30, TimeUnit.DAYS); |
| | | if(timeStamp.contains("记录异常")){ |
| | | noOpen(request,response,data1); |
| | | }else { |
| | | String s= "2."+carNo+",场内停车数为"+i+"\n"; |
| | | writeTxt2(s); |
| | | redisTemplate.opsForValue().set("car_park_" + parkId,Integer.toString(i),30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + parkId,"true",30, TimeUnit.DAYS); |
| | | //开闸 |
| | | open(request,response,data1); |
| | | redisTemplate.opsForValue().set("park_change_in_"+parkId,"true",1, TimeUnit.DAYS); |
| | | int i = Integer.parseInt(redisnum); |
| | | i--; |
| | | if(i<0){ |
| | | String s= "2."+carNo+",场内停车数为0\n"; |
| | | writeTxt2(s); |
| | | redisTemplate.opsForValue().set("car_park_" + parkId,"0",30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + parkId,"true",30, TimeUnit.DAYS); |
| | | }else { |
| | | String s= "2."+carNo+",场内停车数为"+i+"\n"; |
| | | writeTxt2(s); |
| | | redisTemplate.opsForValue().set("car_park_" + parkId,Integer.toString(i),30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + parkId,"true",30, TimeUnit.DAYS); |
| | | } |
| | | } |
| | | |
| | | } |
| | | }else { |
| | | noOpen(request,response,data1); |