| | |
| | | import com.boying.service.*; |
| | | import com.boying.util.DateUtilOther; |
| | | import com.boying.util.FileUtil; |
| | | import com.boying.util.RedisJsonUtil; |
| | | import com.boying.util.StringUtil; |
| | | import com.google.gson.JsonObject; |
| | | import com.google.gson.JsonParser; |
| | |
| | | private final FileInfoService fileInfoService; |
| | | private final TicketBlackService ticketBlackService; |
| | | private final OutParkLogService outParkLogService; |
| | | private final RedisJsonUtil redisJsonUtil; |
| | | private final String LEDURL = "http://192.168.31.212:9988/LedShow/IGetResultDataAllLine"; |
| | | |
| | | /** |
| | |
| | | @PostMapping("/status") |
| | | public void heart(String serialno,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { |
| | | Barrier barrier = barrierService.findByCode(serialno); |
| | | Park park = parkService.getById(barrier.getParkId()); |
| | | Park park = parkService.getOneById(barrier.getParkId()); |
| | | String redis = redisTemplate.opsForValue().get("park_up_" + park.getId()); |
| | | String redisnum = redisTemplate.opsForValue().get("car_park_" + park.getId()); |
| | | if(barrier!=null){ |
| | |
| | | barrier.setStatus(0); |
| | | barrier.setUpdateTime(LocalDateTime.now()); |
| | | barrierService.saveOrUpdate(barrier); |
| | | try { |
| | | redisJsonUtil.set("barrier-"+barrier.getCode(),barrier); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | easyOpen(request,response); |
| | | }else { |
| | | //不需开闸 |
| | | barrier.setStatus(0); |
| | | barrier.setUpdateTime(LocalDateTime.now()); |
| | | barrierService.saveOrUpdate(barrier); |
| | | try { |
| | | redisJsonUtil.set("barrier-"+barrier.getCode(),barrier); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(barrier.getType() == 0){ |
| | | OutPark outPark = outParkService.count4(barrier.getId()); |
| | | if(outPark!=null){ |
| | | if(barrier.getType() == 0){ |
| | |
| | | outPark.setStatus2(1); |
| | | outParkService.saveOrUpdate(outPark); |
| | | easyOpen(request,response); |
| | | easyOpen(request,response); |
| | | OutParkLog byOutPark = outParkLogService.getByOutPark(outPark.getCarNo(), outPark.getId()); |
| | | byOutPark.setOpenTime(LocalDateTime.now()); |
| | | outParkLogService.saveOrUpdate(byOutPark); |
| | | enterParkService.deleteByCarNo(outPark.getCarNo(), barrier.getParkId()); |
| | | redisJsonUtil.del("outPark-"+outPark.getBarrierId()); |
| | | } |
| | | } |
| | | if(barrier.getType() == 1){ |
| | | boolean in = barrierService.getDateDifIn(barrier.getId()); |