Commit fb2ef0fe by 杨林龙

修改kafka试驾消费, 如果重合度为0 则数据不入库

1 parent 043da62f
...@@ -38,6 +38,12 @@ public class FenceDriverConsumer extends MessageReceiver { ...@@ -38,6 +38,12 @@ public class FenceDriverConsumer extends MessageReceiver {
log.info("非新e盾的【试驾】围栏数据,不予入库。"); log.info("非新e盾的【试驾】围栏数据,不予入库。");
return; return;
} }
if (fenceDrive.getPercent() == 0) {
log.info("新e盾的【试驾】围栏数据,重合度为0,不予入库。");
return;
}
//判断是否存在相同的数据 //判断是否存在相同的数据
List<ElectricFenceDto> newFenceDriveList = driverService.getFenceDrive(fenceDrive); List<ElectricFenceDto> newFenceDriveList = driverService.getFenceDrive(fenceDrive);
if (CollectionUtil.isNotEmpty(newFenceDriveList)) { if (CollectionUtil.isNotEmpty(newFenceDriveList)) {
......
...@@ -33,12 +33,12 @@ public class ElectricInStoreServiceTest { ...@@ -33,12 +33,12 @@ public class ElectricInStoreServiceTest {
@Test @Test
public void test01() { public void test01() {
ElectricInStoreDto electricInStoreDrive = new ElectricInStoreDto(); ElectricInStoreDto electricInStoreDrive = new ElectricInStoreDto();
electricInStoreDrive.setSn("4000518278"); electricInStoreDrive.setSn("8700922798");
electricInStoreDrive.setFenceId(0); electricInStoreDrive.setFenceId(19);
electricInStoreDrive.setSveSystemId(13); electricInStoreDrive.setSveSystemId(13);
electricInStoreDrive.setPositionState(0); electricInStoreDrive.setPositionState(0);
electricInStoreDrive.setGpsState(0); electricInStoreDrive.setGpsState(1);
electricInStoreDrive.setGpsTime(DateUtil.parseDateTime("2021-08-23 14:50:22")); electricInStoreDrive.setGpsTime(DateUtil.parseDateTime("2021-08-21 11:21:42"));
electricInStoreDrive.setCreatedTime(new Date()); electricInStoreDrive.setCreatedTime(new Date());
electricInStoreDrive.setUpdatedTime(new Date()); electricInStoreDrive.setUpdatedTime(new Date());
List<ElectricInStoreDto> electricInStoreList = electricInStoreService.getElectricInStore(electricInStoreDrive); List<ElectricInStoreDto> electricInStoreList = electricInStoreService.getElectricInStore(electricInStoreDrive);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!