kongdeqiang
2024-04-19 a2312c7a34971aa5d0122fa179f5b8d1da28e78c
src/main/java/com/boying/controller/car/PlateServlet3.java
@@ -132,6 +132,14 @@
        out.close();
    }
    protected void easyOpen2(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.setContentType("text/json");
        PrintWriter out = response.getWriter();
        out.println("{\"Response_AlarmInfoPlate\":{\"ivs_ioctrl\":{\"delay\":1000,\"io\":0,\"value\":2}}}");
        out.flush();
        out.close();
    }
    protected void easyNoOpen(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.setContentType("text/json");
        PrintWriter out = response.getWriter();
@@ -653,7 +661,7 @@
            writeTxt2(s);
            String jsonValue = JSON.toJSONString(outPark);
            redisTemplate.opsForValue().set("outPark_dif_"+ barrierId, jsonValue);
            outLedShow(barrier.getCode(),barrier.getCarNo(),outPark.getPrice(),toDayHrMinSec,barrier.getParkId(),request,response,0);
            outLedShow(outPark,barrier.getCode(),barrier.getCarNo(),outPark.getPrice(),toDayHrMinSec,barrier.getParkId(),request,response,0);
        }else {
            //需要缴费或者有违章
            System.out.println(outPark.getCarNo()+"该车需要缴费"+outPark.getPrice());
@@ -665,7 +673,7 @@
            outParkLogService.saveOrUpdate(byOutPark);
            String jsonValue = JSON.toJSONString(outPark);
            redisTemplate.opsForValue().set("outPark_dif_"+ barrierId, jsonValue);
            outLedShow(barrier.getCode(),barrier.getCarNo(),outPark.getPrice(),toDayHrMinSec,barrier.getParkId(),request,response,1);
            outLedShow(outPark,barrier.getCode(),barrier.getCarNo(),outPark.getPrice(),toDayHrMinSec,barrier.getParkId(),request,response,1);
        }
        return money;
    }
@@ -818,7 +826,7 @@
        noOpen(request,response,data1);//入场开闸
    }
    public void outLedShow(String ledId,String carNo,Double price,String timeStamp,Integer parkId,HttpServletRequest request, HttpServletResponse response,int type) throws ServletException, IOException {
    public void outLedShow(OutPark outPark,String ledId,String carNo,Double price,String timeStamp,Integer parkId,HttpServletRequest request, HttpServletResponse response,int type) throws ServletException, IOException {
        String redisnum = redisTemplate.opsForValue().get("car_park_" + parkId);
        Park park = parkService.getById(parkId);
        LedBean ledBean = new LedBean();
@@ -870,6 +878,11 @@
                }else {
                    //开闸
                    open(request,response,data1);
                    //缓存在redis里,心跳接口去抬杆
                    String jsonValue = JSON.toJSONString(outPark);
                    redisTemplate.opsForValue().set("outPark-"+outPark.getBarrierId(), jsonValue);
                    enterParkService.deleteByCarNo(carNo, parkId);
                    redisTemplate.opsForValue().set("park_change_in_"+parkId,"true",1, TimeUnit.DAYS);
                    int i = Integer.parseInt(redisnum);