| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.boying.common.R; |
| | | import com.boying.common.SystemConfigProperties; |
| | |
| | | private final CostRuleService costRuleService; |
| | | private final WhiteListService whiteListService; |
| | | private final FileInfoService fileInfoService; |
| | | private final TicketBlackService ticketBlackService; |
| | | private final String LEDURL = "http://192.168.31.212:9988/LedShow/IGetResultDataAllLine"; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | public void enterPark(String carNo,Integer barrierId,Integer parkId,FileInfo fileInfo) { |
| | | Park park = parkService.getById(parkId); |
| | | // int num = 0; |
| | | // String s = redisTemplate.opsForValue().get("car_park_" + parkId); |
| | | // if(park != null){ |
| | | // num = park.getNum(); |
| | | // if(s !=null){ |
| | | // if(Integer.parseInt(s) >= num){ |
| | | // redisTemplate.opsForValue().set("park_up_" + parkId,"false",30, TimeUnit.DAYS); |
| | | // return; |
| | | // } |
| | | // }else { |
| | | // s= "0"; |
| | | // redisTemplate.opsForValue().set("car_park_" + parkId,s,30, TimeUnit.DAYS); |
| | | // redisTemplate.opsForValue().set("park_up_" + parkId,"true",30, TimeUnit.DAYS); |
| | | // } |
| | | // } |
| | | TicketBlack black = ticketBlackService.getByCarNo(carNo, 1); |
| | | if(black != null){ |
| | | System.out.println("黑名单车辆"+carNo); |
| | | }else { |
| | | enterParkService.deleteByCarNo(carNo,parkId); |
| | | EnterPark enterPark = new EnterPark(); |
| | | enterPark.setCarNo(carNo); |
| | |
| | | enterPark.setImgId(fileInfo.getId()); |
| | | } |
| | | enterParkService.saveOrUpdate(enterPark); |
| | | |
| | | // Barrier barrier = barrierService.getById(barrierId); |
| | | // barrier.setType2(1); |
| | | // barrierService.saveOrUpdate(barrier); |
| | | } |
| | | } |
| | | |
| | | public double outPark(String carNo,Integer barrierId,Integer parkId,HttpServletRequest request, HttpServletResponse response,FileInfo fileInfo) throws ServletException, IOException { |
| | |
| | | |
| | | |
| | | public void inLedShow(String ledId,String carNo,Integer parkId,HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
| | | TicketBlack black = ticketBlackService.getByCarNo(carNo, 1); |
| | | if(black != null){ |
| | | LedBean ledBean = new LedBean(); |
| | | ledBean.setcolor1(0); |
| | | ledBean.setcolor2(0); |
| | | ledBean.setcolor3(0); |
| | | ledBean.setcolor4(0); |
| | | ledBean.setcontent1(carNo); |
| | | ledBean.setcontent2("黑名单车辆"); |
| | | ledBean.setcontent3("禁止驶入"); |
| | | ledBean.setcontent4("联系管理员"); |
| | | ledBean.setdisMode1(0); |
| | | ledBean.setdisMode2(0); |
| | | ledBean.setdisMode3(0); |
| | | ledBean.setdisMode4(0); |
| | | ledBean.setvoiceContent("黑名单车辆"+carNo+",禁止驶入"); |
| | | ResultData resultData = CodeUtil.GetResultDataAllLine(ledBean); |
| | | byte[] dataX = new byte[resultData.getlenth()]; |
| | | System.arraycopy(resultData.getdatas(),0,dataX,0,resultData.getlenth()); |
| | | String data1 = Base64.getMimeEncoder().encodeToString(dataX) + "="; |
| | | data1 = data1.replaceAll("\r\n", ""); |
| | | noOpen(request,response,data1); |
| | | }else { |
| | | String num = redisTemplate.opsForValue().get("car_park_" + parkId); |
| | | if(num == null){ |
| | | num = "0"; |
| | |
| | | }else { |
| | | noOpen(request,response,data1); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | public void inLedFullShow(String ledId, String carNo, Integer parkId,HttpServletRequest request, HttpServletResponse response) throws IOException { |