|  |  | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.doumee.core.constants.ResponseStatus; | 
 |  |  | import com.doumee.core.exception.BusinessException; | 
 |  |  | import com.doumee.core.haikang.model.HKConstants; | 
 |  |  | import com.doumee.core.haikang.model.param.BaseResponse; | 
 |  |  | import com.doumee.core.haikang.model.param.request.PrivilegeGroupRequest; | 
 |  |  | import com.doumee.core.haikang.model.param.respose.PrivilegeGroupInfoResponse; | 
 |  |  | 
 |  |  | 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()+"】条"; | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private boolean isDeletedData(DeviceRole device, List<PrivilegeGroupInfoResponse> allHkList) { | 
 |  |  |         if(allHkList.size()>0){ | 
 |  |  |             for(PrivilegeGroupInfoResponse r : allHkList){ | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         return  true; | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |      | 
 |  |  | } |