Commit 67d39375 by guojuxing

根据用户ID查询数据权限

parent 39f4c212
......@@ -19,4 +19,6 @@ public interface DataAuthApiService {
ServiceResponse<Page<DataAuthDTO>> pageDataAuth(Integer enterpriseId, String dataAuthName, Integer currentPage, Integer pageSize);
ServiceResponse<List<DataAuthDTO>> listDataAuth(Integer enterpriseId, String dataAuthName);
ServiceResponse<DataAuthDTO> ggetDataAuthByUserId(Integer enterpriseId, Integer userId);
}
......@@ -5,6 +5,7 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.DataAuthDTO;
import com.gic.cloud.dto.UserDTO;
import com.gic.cloud.entity.TabSysDataAuth;
import com.gic.cloud.entity.TabSysUser;
import com.gic.cloud.service.DataAuthApiService;
import com.gic.cloud.service.DataAuthService;
import com.gic.cloud.service.UserService;
......@@ -90,6 +91,15 @@ public class DataAuthApiServiceImpl implements DataAuthApiService{
dataAuthService.listDataAuth(enterpriseId, dataAuthName))).orElse(Collections.EMPTY_LIST));
}
@Override
public ServiceResponse<DataAuthDTO> ggetDataAuthByUserId(Integer enterpriseId, Integer userId) {
TabSysUser user = userService.getUser(userId);
if (user == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "用户ID错误,查无数据");
}
return getDataAuth(user.getDataAuthId());
}
private ServiceResponse validParam(DataAuthDTO dto) {
if (dto.getDataAuthId() != null) {
TabSysDataAuth record = dataAuthService.getDataAuth(dto.getDataAuthId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment