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 @@