diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/car/controller/CarOpenApi.java b/shapelight-admin/src/main/java/net/shapelight/modules/car/controller/CarOpenApi.java index 90ac1c2..37370da 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/car/controller/CarOpenApi.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/car/controller/CarOpenApi.java @@ -18,6 +18,7 @@ import java.net.URL; import java.net.URLDecoder; import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Map; @@ -424,7 +425,13 @@ public class CarOpenApi { enter.setChannalCode(channalCode); if (fileName.length() > 0) enter.setImage(fileName); - this.tenPackRecordEnterService.save(enter); + //查重 + List checkRecord = tenPackRecordEnterService.list(new QueryWrapper() + .eq("plate_number",enter.getParkName()) + .eq("enter_time",enter.getEnterTime())); + if(checkRecord.size()==0){ + this.tenPackRecordEnterService.save(enter); + } } else if (serviceName.equals("exit")) { long exitTimeLong = bizContent.getLongValue("exitTime"); Date exitTime = new Date(exitTimeLong * 1000L); @@ -446,7 +453,13 @@ public class CarOpenApi { exit.setChannalCode(channalCode); if (fileName.length() > 0) exit.setImage(fileName); - this.tenPackRecordExitService.save(exit); + //查重 + List checkRecord = tenPackRecordExitService.list(new QueryWrapper() + .eq("plate_number",exit.getParkName()) + .eq("exit_time",exit.getExitTime())); + if(checkRecord.size()==0){ + this.tenPackRecordExitService.save(exit); + } } res.put("code", "200"); res.put("msg", "成功");