From 65cc7d4f549a5c65f3513a6f72135c927546d69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=8D=9A?= Date: Tue, 12 Nov 2024 16:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=88=A0=E9=99=A4=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TenPersonServiceImpl.java | 33 ++++++++++--------- .../resources/mapper/ten/TenPersonSyncDao.xml | 3 +- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java index b6f7dc0..ed68693 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenPersonServiceImpl.java @@ -913,25 +913,26 @@ public class TenPersonServiceImpl implements TenPersonService { tenPersonDao.logicDeleteById(personId, cellId); tenRelationMapper.delete(new LambdaQueryWrapper().eq(TenRelation::getStudentId,personId)); Map snPersons = tenPersonSyncService.findGroupDevicePerson(personId,cellId); - String sn = snPersons.get("deviceSn"); - TenDeviceEntity deviceEntity = tenDeviceService.findBySn(sn); - if(deviceEntity==null){ - continue; - } - String[] persons = snPersons.get("plist").split(","); - List list = new ArrayList<>(); - for (String personStr : persons) { - String[] personInfoStr = personStr.split("_"); - Long personCode = Long.parseLong(personInfoStr[0]); - Date lastUpdateTime = DateUtils.stringToDate(personInfoStr[1], DateUtils.DATE_TIME_PATTERN); + if(snPersons!=null) { + String sn = snPersons.get("deviceSn"); + TenDeviceEntity deviceEntity = tenDeviceService.findBySn(sn); + if(deviceEntity==null){ + continue; + } + String[] persons = snPersons.get("plist").split(","); + List list = new ArrayList<>(); + for (String personStr : persons) { + String[] personInfoStr = personStr.split("_"); + Long personCode = Long.parseLong(personInfoStr[0]); + Date lastUpdateTime = DateUtils.stringToDate(personInfoStr[1], DateUtils.DATE_TIME_PATTERN); - TenPersonSyncEntity syncEntity = tenPersonSyncService.findByDeviceIdAndPersonId(deviceEntity.getDeviceId(), personCode, cellId); - syncEntity.setLastUpdateTime(lastUpdateTime); - syncEntity.setState(Constant.PERSON_SYNC_DELETE); - tenPersonSyncService.updateById(syncEntity); + TenPersonSyncEntity syncEntity = tenPersonSyncService.findByDeviceIdAndPersonId(deviceEntity.getDeviceId(), personCode, cellId); + syncEntity.setLastUpdateTime(lastUpdateTime); + syncEntity.setState(Constant.PERSON_SYNC_DELETE); + tenPersonSyncService.updateById(syncEntity); + } } - } diff --git a/shapelight-admin/src/main/resources/mapper/ten/TenPersonSyncDao.xml b/shapelight-admin/src/main/resources/mapper/ten/TenPersonSyncDao.xml index db929eb..3dc17b5 100644 --- a/shapelight-admin/src/main/resources/mapper/ten/TenPersonSyncDao.xml +++ b/shapelight-admin/src/main/resources/mapper/ten/TenPersonSyncDao.xml @@ -175,9 +175,10 @@