|  |  |  | 
|---|
|  |  |  | package com.moral.api.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
|---|
|  |  |  | import com.moral.api.entity.ManageAccountRole; | 
|---|
|  |  |  | import com.moral.api.entity.ManageMenu; | 
|---|
|  |  |  | import com.moral.api.entity.ManageRole; | 
|---|
|  |  |  | import com.moral.api.mapper.ManageAccountRoleMapper; | 
|---|
|  |  |  | import com.moral.api.mapper.ManageRoleMapper; | 
|---|
|  |  |  | import com.moral.api.mapper.ManageRoleMenuMapper; | 
|---|
|  |  |  | import com.moral.api.service.ManageRoleService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | import com.moral.constant.Constants; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.data.domain.Page; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.util.StringUtils; | 
|---|
|  |  |  | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | @Autowired(required = false) | 
|---|
|  |  |  | private ManageRoleMapper manageRoleMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | @Autowired(required = false) | 
|---|
|  |  |  | private ManageRoleMenuMapper manageRoleMenuMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired(required = false) | 
|---|
|  |  |  | private ManageAccountRoleMapper manageAccountRoleMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public List<ManageRole> getAll() { | 
|---|
|  |  |  | return manageRoleMapper.getAll(); | 
|---|
|  |  |  | public List<ManageRole> getAllWithPagingQuery(Map map) { | 
|---|
|  |  |  | com.baomidou.mybatisplus.extension.plugins.pagination.Page<ManageRole> page = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(Integer.parseInt(map.get("current").toString()), Integer.parseInt(map.get("size").toString())); | 
|---|
|  |  |  | QueryWrapper<ManageRole> wrapper = new QueryWrapper(); | 
|---|
|  |  |  | wrapper.eq("is_delete",0); | 
|---|
|  |  |  | com.baomidou.mybatisplus.extension.plugins.pagination.Page resultpage = manageRoleMapper.selectPage(page,wrapper); | 
|---|
|  |  |  | List<ManageRole> manageRoles = resultpage.getRecords(); | 
|---|
|  |  |  | return manageRoles; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public List<ManageRole> getManageRoleByNameFuzzy(ManageRole manageRole) { | 
|---|
|  |  |  | return manageRoleMapper.getManageRoleByNameFuzzy(manageRole); | 
|---|
|  |  |  | public List<ManageRole> getManageRoleByNameFuzzy(Map map) { | 
|---|
|  |  |  | com.baomidou.mybatisplus.extension.plugins.pagination.Page<ManageRole> page = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(Integer.parseInt(map.get("current").toString()), Integer.parseInt(map.get("size").toString())); | 
|---|
|  |  |  | QueryWrapper<ManageRole> wrapper = new QueryWrapper(); | 
|---|
|  |  |  | wrapper.eq("is_delete",0); | 
|---|
|  |  |  | wrapper.like("name",map.get("name")); | 
|---|
|  |  |  | com.baomidou.mybatisplus.extension.plugins.pagination.Page resultpage = manageRoleMapper.selectPage(page,wrapper); | 
|---|
|  |  |  | List<ManageRole> manageRoles = resultpage.getRecords(); | 
|---|
|  |  |  | return manageRoles; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | deleteMap.put("id",Integer.parseInt(map.get("id").toString())); | 
|---|
|  |  |  | deleteMap.put("is_delete",1); | 
|---|
|  |  |  | manageRoleMapper.updateManageRoleById(deleteMap); | 
|---|
|  |  |  | ManageAccountRole manageAccountRole = new ManageAccountRole(); | 
|---|
|  |  |  | manageAccountRole.setIsDelete("1"); | 
|---|
|  |  |  | QueryWrapper<ManageAccountRole> wrapper = new QueryWrapper(); | 
|---|
|  |  |  | wrapper.eq("role_id",Integer.parseInt(map.get("id").toString())); | 
|---|
|  |  |  | manageAccountRoleMapper.update(manageAccountRole,wrapper); | 
|---|
|  |  |  | resultMap.put("flag",true); | 
|---|
|  |  |  | resultMap.put("msg","删除成功!"); | 
|---|
|  |  |  | } | 
|---|