|
|
@ -23,7 +23,9 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dto.RoleDifficultDeptDTO; |
|
|
|
import com.elink.esua.epdc.dto.RoleOverseeDeptRelationDTO; |
|
|
|
import com.elink.esua.epdc.modules.item.dao.RoleDifficultDeptDao; |
|
|
|
import com.elink.esua.epdc.modules.item.entity.RoleDifficultDeptEntity; |
|
|
|
import com.elink.esua.epdc.modules.item.redis.RoleDifficultDeptRedis; |
|
|
@ -33,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -101,4 +104,32 @@ public class RoleDifficultDeptServiceImpl extends BaseServiceImpl<RoleDifficultD |
|
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
public Result saveRoleOverseeRelation(RoleOverseeDeptRelationDTO realationDto) { |
|
|
|
List<RoleDifficultDeptEntity> entityList = new ArrayList<>(); |
|
|
|
for(Long de : realationDto.getOverseeMenuIdList()){ |
|
|
|
RoleDifficultDeptEntity entity = new RoleDifficultDeptEntity(); |
|
|
|
entity.setRoleId(realationDto.getId()); |
|
|
|
entity.setDeptId(de); |
|
|
|
entityList.add(entity); |
|
|
|
} |
|
|
|
insertBatch(entityList); |
|
|
|
return new Result().ok("插入成功"); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional |
|
|
|
@Override |
|
|
|
public Result updateRoleOverseeRelation(RoleOverseeDeptRelationDTO realationDto) { |
|
|
|
baseDao.deleteByRoleId(realationDto.getId()); |
|
|
|
saveRoleOverseeRelation(realationDto); |
|
|
|
return new Result().ok("更新成功"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<List<Long>> getOverseeMenuIdList(Long roleId) { |
|
|
|
List<Long> result = baseDao.getOverseeMenuIdList(roleId); |
|
|
|
return new Result().ok(result); |
|
|
|
} |
|
|
|
|
|
|
|
} |