1.修复停车记录重复记录的bug
This commit is contained in:
gaoben 2021-05-24 09:30:26 +08:00
parent 1e9f3c1822
commit 89eac4f794
1 changed files with 15 additions and 2 deletions

View File

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