kongdeqiang
2024-03-18 ffa5f49a2bcb6311486d00777b3629538eb3e6f0
src/main/java/com/boying/controller/car/PlateServlet3.java
@@ -12,6 +12,7 @@
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;
@@ -61,6 +62,7 @@
    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";
    /**
@@ -140,7 +142,7 @@
    @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){
@@ -171,12 +173,23 @@
                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){
@@ -197,11 +210,12 @@
                    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());