| | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.openapi.request.RoleListRequest; |
| | | import com.doumee.core.model.openapi.response.DeviceListResponse; |
| | | import com.doumee.core.model.openapi.response.RoleListResponse; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.DeviceMapper; |
| | | import com.doumee.dao.business.DeviceRoleMapper; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.dao.business.model.DeviceRole; |
| | | import com.doumee.dao.web.response.DeviceRoleVO; |
| | | import com.doumee.service.business.DeviceRoleService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 门禁角色信息表Service实现 |
| | |
| | | |
| | | @Autowired |
| | | private DeviceRoleMapper deviceRoleMapper; |
| | | |
| | | |
| | | @Override |
| | | public Integer create(DeviceRole deviceRole) { |
| | |
| | | QueryWrapper<DeviceRole> wrapper = new QueryWrapper<>(deviceRole); |
| | | return deviceRoleMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeviceRoleVO> findListByType(Integer type) { |
| | | List<DeviceRole> deviceRoleList = deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda() |
| | | .eq(DeviceRole::getType,type) |
| | | .eq(DeviceRole::getIsdeleted, Constants.ZERO) |
| | | .eq(DeviceRole::getStatus, Constants.ZERO) |
| | | ); |
| | | List<DeviceRoleVO> deviceRoleVOList = new ArrayList<>(); |
| | | for (DeviceRole deviceRole:deviceRoleList) { |
| | | DeviceRoleVO deviceRoleVO = new DeviceRoleVO(); |
| | | BeanUtils.copyProperties(deviceRole,deviceRoleVO); |
| | | deviceRoleVOList.add(deviceRoleVO); |
| | | } |
| | | return deviceRoleVOList; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |