From 89eac4f7947e1612ddc5f30de37736cdcb609a77 Mon Sep 17 00:00:00 2001 From: gaoben Date: Mon, 24 May 2021 09:30:26 +0800 Subject: [PATCH] =?UTF-8?q?v2.0.9=201.=E4=BF=AE=E5=A4=8D=E5=81=9C=E8=BD=A6?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E9=87=8D=E5=A4=8D=E8=AE=B0=E5=BD=95=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/car/controller/CarOpenApi.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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", "成功");