667ecad990e50ba2ed28d0cff53edc41f20b28ea..2eb9f18e9eba37ddd6c3a1fe2a39d5dba880fbd4
5 天以前 kongdeqiang
fix :文件存储修改
2eb9f1 对比 | 目录
5 天以前 kongdeqiang
fix : 修改打包文件
35f6a6 对比 | 目录
5 天以前 kongdeqiang
fix : 修改出场车位数减2的bug
a4b0bb 对比 | 目录
1个文件已添加
6个文件已修改
159 ■■■■■ 已修改文件
ifsp-signature-1.1.0.6.jar 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/boying/Application.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/boying/controller/car/PlateServlet3.java 120 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/boying/controller/phone/YCPayController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/boying/entity/OutPark.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/boying/util/FileUtil.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ifsp-signature-1.1.0.6.jar
Binary files differ
pom.xml
@@ -120,6 +120,9 @@
            <groupId>com.ruim.ifsp</groupId>
            <artifactId>signature</artifactId>
            <version>1.1.0.6</version>
            <scope>system</scope>
            <!-- 路径对应项目中JAR的位置(比如放在resources/lib下,这里要调整实际路径) -->
            <systemPath>${project.basedir}/ifsp-signature-1.1.0.6.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.eclipse.paho</groupId>
@@ -136,16 +139,21 @@
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>1.6.14</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>com.led</groupId>-->
<!--            <artifactId>show</artifactId>-->
<!--            <version>0.0.0.1</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>net.sf</groupId>-->
<!--            <artifactId>jni4net</artifactId>-->
<!--            <version>0.8.8.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>com.led</groupId>
            <artifactId>ledshow</artifactId>
            <version>1.0.0</version>
            <scope>system</scope>
            <!-- 路径对应项目中JAR的位置(比如放在resources/lib下,这里要调整实际路径) -->
            <systemPath>${project.basedir}/LedShow.j4n.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>net.sf</groupId>
            <artifactId>jni4net</artifactId>
            <version>0.8.8.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/jni4net.j-0.8.8.0.jar</systemPath>
        </dependency>
    </dependencies>
src/main/java/com/boying/Application.java
@@ -23,6 +23,7 @@
@EnableScheduling
public class Application {
    public static void main(String[] args) {
        System.out.println("项目文件夹为:"+System.getProperty("user.dir"));
        SpringApplication.run(Application.class, args);
    }
src/main/java/com/boying/controller/car/PlateServlet3.java
@@ -157,8 +157,6 @@
            return;
        }
        Park park = parkService.getOneById(barrier.getParkId());
       // Park park = parkService.getById(barrier.getParkId());
       // String redis = redisTemplate.opsForValue().get("park_up_" + park.getId());
        String redisnum = redisTemplate.opsForValue().get("car_park_" + park.getId());
        if(StringUtils.isBlank(redisnum)){
            redisnum = "0";
@@ -212,43 +210,43 @@
                if(barrier.getType() == 0){
                    OutPark outPark = outParkService.count4(barrier.getId());
                    if(outPark!=null){
                        if(barrier.getType() == 0){
                            int i = Integer.parseInt(redisnum);
                            i--;
                            if(i<0){
                                String s= "2."+outPark.getCarNo()+"缴费完成,场内停车数为"+i+"\n";
                                writeTxt2(s);
                                redisTemplate.opsForValue().set("car_park_" + park.getId(),"0",30, TimeUnit.DAYS);
                                redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS);
                            }else {
                                String s= "2."+outPark.getCarNo()+"缴费完成,场内停车数为"+i+"\n";
                                writeTxt2(s);
                                redisTemplate.opsForValue().set("car_park_" + park.getId(),Integer.toString(i),30, TimeUnit.DAYS);
                                redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS);
                            }
                        int i = Integer.parseInt(redisnum);
                        i--;
                        if(i<=0){
                            String s= "2."+outPark.getCarNo()+"缴费完成,场内停车数为"+i+"\n";
                            writeTxt2(s);
                            redisTemplate.opsForValue().set("car_park_" + park.getId(),"0",30, TimeUnit.DAYS);
                            redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS);
                        }else {
                            String s= "2."+outPark.getCarNo()+"缴费完成,场内停车数为"+i+"\n";
                            writeTxt2(s);
                            redisTemplate.opsForValue().set("car_park_" + park.getId(),Integer.toString(i),30, TimeUnit.DAYS);
                            redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS);
                        }
                        outPark.setStatus2(1);
                        outParkService.saveOrUpdate(outPark);
                        easyOpen(request,response);
                        OutParkLog byOutPark = outParkLogService.getByOutPark(outPark.getCarNo(), outPark.getId());
                        byOutPark.setOpenTime(LocalDateTime.now());
                        outParkLogService.saveOrUpdate(byOutPark);
                        enterParkService.deleteByCarNo(outPark.getCarNo(), barrier.getParkId());
                        redisTemplate.delete("outPark-"+outPark.getBarrierId());
                        easyOpen(request,response);
                    }else {
                        boolean out = barrierService.getDateDifOut(barrier.getId());
                        if(out){
                            outLedShowDefault(request,response);
                        }
                    }
                }else {
                    boolean in = barrierService.getDateDifIn(park.getId());
                    if(in){
                        inLedShowDefault(park.getId(),request,response);
                    }
                }
            }
            if(barrier.getType() == 1){
                boolean in = barrierService.getDateDifIn(park.getId());
                if(in){
                    inLedShowDefault(park.getId(),request,response);
                }
            }else if(barrier.getType() == 0){
                boolean out = barrierService.getDateDifOut(barrier.getId());
                if(out){
                    outLedShowDefault(request,response);
                }
            }
        }else {
            easyNoOpen(request,response);
@@ -647,7 +645,6 @@
        if(all.size() >0){
            for(WhiteList w : all){
                if(w.getType()==0){
                    outLedShowYueZu(barrier.getCarNo(),"月租车",parkId,request,response,0);
                    OutPark byCarNoAndBarrierId = outParkService.findByCarNoAndBarrierId(carNo, barrierId);
                    byCarNoAndBarrierId.setStatus(2);
                    byCarNoAndBarrierId.setStatus2(1);
@@ -655,8 +652,8 @@
                    barrierService.saveOrUpdate(barrier);
                    String jsonValue2 = JSON.toJSONString(barrier);
                    redisTemplate.opsForValue().set("barrier-"+barrier.getCode(), jsonValue2);
                    String jsonValue = JSON.toJSONString(byCarNoAndBarrierId);
                    redisTemplate.opsForValue().set("outPark_dif_"+ barrierId, jsonValue);
                    outLedShowYueZu(outPark,barrier.getCarNo(),"月租车",parkId,request,response,0);
                    return 0.0;
                }else{
                    if(StringUtils.isNotBlank(w.getParkIds())){
@@ -666,7 +663,6 @@
                            for (String s : split) {
                                int pid = Integer.parseInt(s);
                                if(pid == outPark.getParkId() && System.currentTimeMillis()<w.getEndTime().getTime()){
                                    outLedShowYueZu(barrier.getCarNo(),"月租车",parkId,request,response,0);
                                    OutPark byCarNoAndBarrierId = outParkService.findByCarNoAndBarrierId(carNo, barrierId);
                                    byCarNoAndBarrierId.setStatus(2);
                                    byCarNoAndBarrierId.setStatus2(1);
@@ -674,8 +670,8 @@
                                    barrierService.saveOrUpdate(barrier);
                                    String jsonValue2 = JSON.toJSONString(barrier);
                                    redisTemplate.opsForValue().set("barrier-"+barrier.getCode(), jsonValue2);
                                    String jsonValue = JSON.toJSONString(byCarNoAndBarrierId);
                                    redisTemplate.opsForValue().set("outPark_dif_"+ barrierId, jsonValue);
                                    outLedShowYueZu(outPark,barrier.getCarNo(),"月租车",parkId,request,response,0);
                                    return 0.0;
                                }
                            }
@@ -887,51 +883,18 @@
                if(timeStamp.contains("记录异常")){
                    OutPark by5min = outParkService.findBy5min(carNo, parkId, LocalDateTime.now());
                    if(by5min != null){
                        enterParkService.deleteByCarNo(carNo, parkId);
                        //开闸
                        open(request,response,data1);
                        enterParkService.deleteByCarNo(carNo, parkId);
                        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);
                    }
                }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);
//                    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);
@@ -939,7 +902,7 @@
    }
    public void outLedShowYueZu(String carNo,String text,Integer parkId,HttpServletRequest request, HttpServletResponse response,int type) throws ServletException, IOException{
    public void outLedShowYueZu(OutPark outPark,String carNo,String text,Integer parkId,HttpServletRequest request, HttpServletResponse response,int type) throws ServletException, IOException{
        String redisnum = redisTemplate.opsForValue().get("car_park_" + parkId);
        LedBean ledBean = new LedBean();
        ledBean.setcolor1(0);
@@ -961,23 +924,10 @@
        String data1 = Base64.getMimeEncoder().encodeToString(dataX) + "=";
        data1 = data1.replaceAll("\r\n", "");
        if(type == 0){
            //开闸
            open(request,response,data1);
            enterParkService.deleteByCarNo(carNo,parkId);
            //缓存在redis里,心跳接口去抬杆
            String jsonValue = JSON.toJSONString(outPark);
            redisTemplate.opsForValue().set("outPark-"+outPark.getBarrierId(), jsonValue);
            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);
        }
src/main/java/com/boying/controller/phone/YCPayController.java
@@ -35,6 +35,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
@@ -715,6 +716,7 @@
                //缓存在redis里
                String jsonValue = JSON.toJSONString(outPark);
                redisTemplate.opsForValue().set("outPark-"+outPark.getBarrierId(), jsonValue);
                redisTemplate.opsForValue().set("park_change_in_"+outPark.getParkId(),"true",1, TimeUnit.DAYS);
            }
        }
    }
src/main/java/com/boying/entity/OutPark.java
@@ -111,7 +111,7 @@
    /**
     * 0:未缴费  1:缴费
     * 0:未缴费  1:缴费 2:月租车
     */
    private int status;
src/main/java/com/boying/util/FileUtil.java
@@ -15,6 +15,8 @@
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;
import java.util.UUID;
@@ -75,6 +77,8 @@
    }
    public static FileInfo generateBase64StringToFile(String fileString,int t,int type){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String format = sdf.format(new Date());
        String lastname= null;
        //文件id
        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
@@ -83,7 +87,7 @@
        }else {
            lastname=".pdf";
        }
        String filePath = "D:\\FFproject\\file\\";
        String filePath = "D:\\FFproject\\file\\"+format+"\\";
        if(fileString == null){
            return null;
        }else {