人员删除问题修改

This commit is contained in:
张博 2024-11-12 16:15:28 +08:00
parent b921b3ce8a
commit 65cc7d4f54
2 changed files with 19 additions and 17 deletions

View File

@ -913,6 +913,7 @@ public class TenPersonServiceImpl implements TenPersonService {
tenPersonDao.logicDeleteById(personId, cellId);
tenRelationMapper.delete(new LambdaQueryWrapper<TenRelation>().eq(TenRelation::getStudentId,personId));
Map<String, String> snPersons = tenPersonSyncService.findGroupDevicePerson(personId,cellId);
if(snPersons!=null) {
String sn = snPersons.get("deviceSn");
TenDeviceEntity deviceEntity = tenDeviceService.findBySn(sn);
if(deviceEntity==null){
@ -930,7 +931,7 @@ public class TenPersonServiceImpl implements TenPersonService {
syncEntity.setState(Constant.PERSON_SYNC_DELETE);
tenPersonSyncService.updateById(syncEntity);
}
}
}

View File

@ -175,9 +175,10 @@
<select id="findGroupDevicePerson" resultType="map">
select device_sn as deviceSn,group_concat(person_id,"_",last_update_time separator ",") as plist
from ten_person_sync_${cellId} where 1= 1
<if test="personIds != null">
<if test="personId != null">
and person_id = #{personId}
</if>
group by device_sn
</select>
<select id="findDeviceAllDeletePersons" resultType="net.shapelight.modules.ten.entity.TenPersonSyncEntity">