|  |  |  | 
|---|
|  |  |  | public class HkSyncPrivilegeServiceImpl extends HkSyncBaseServiceImpl { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private DeviceRoleMapper DeviceRoleMapper; | 
|---|
|  |  |  | private DeviceRoleMapper deviceRoleMapper; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 同步海康访客组权限数据 | 
|---|
|  |  |  | * @param param | 
|---|
|  |  |  | 
|---|
|  |  |  | List<Integer> types = new ArrayList<>(); | 
|---|
|  |  |  | types.add(Constants.DOOR_ROLE_TYPE.fk); | 
|---|
|  |  |  | types.add(Constants.DOOR_ROLE_TYPE.lw); | 
|---|
|  |  |  | List<DeviceRole> allList = DeviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda().in(DeviceRole::getType,types).eq(DeviceRole::getIsdeleted,Constants.ZERO)); | 
|---|
|  |  |  | List<DeviceRole> allList = deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda().in(DeviceRole::getType,types).eq(DeviceRole::getIsdeleted,Constants.ZERO)); | 
|---|
|  |  |  | boolean hasNext = true; | 
|---|
|  |  |  | int curTotal = 0; | 
|---|
|  |  |  | int curPage = 1; | 
|---|
|  |  |  | 
|---|
|  |  |  | if(deleteList.size()>0){ | 
|---|
|  |  |  | //逻辑删除 | 
|---|
|  |  |  | for(DeviceRole d : deleteList){ | 
|---|
|  |  |  | DeviceRoleMapper.updateById(d); | 
|---|
|  |  |  | deviceRoleMapper.updateById(d); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(addList.size()>0){ | 
|---|
|  |  |  | DeviceRoleMapper.insert(addList); | 
|---|
|  |  |  | deviceRoleMapper.insert(addList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(editList.size()>0){ | 
|---|
|  |  |  | for(DeviceRole d : editList){ | 
|---|
|  |  |  | DeviceRoleMapper.updateById(d); | 
|---|
|  |  |  | deviceRoleMapper.updateById(d); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return "同步数据:新增【"+addList.size()+"】条,更新【"+editList.size()+"】条,删除【"+deleteList.size()+"】条"; | 
|---|