Commit bfb032ab by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents a2d5c291 8b22b0dc
...@@ -101,4 +101,14 @@ public interface ResourceApiService { ...@@ -101,4 +101,14 @@ public interface ResourceApiService {
* @throws * @throws
*/ */
ServiceResponse<OrderResourceDTO> getOrderResourceByUserId(Integer userId); ServiceResponse<OrderResourceDTO> getOrderResourceByUserId(Integer userId);
/**
* @Title: getUserResourceByUserId
* @Description:
* @author zhiwj
* @param userId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.OrderResourceDTO> 返回null表示没有授权 返回 -1 表示全部
* @throws
*/
ServiceResponse<Long> getUserResourceByUserId(Integer userId);
} }
...@@ -85,12 +85,14 @@ public class AuditorApiServiceImpl implements AuditorApiService { ...@@ -85,12 +85,14 @@ public class AuditorApiServiceImpl implements AuditorApiService {
if (auditedGroupIsNotExist) { if (auditedGroupIsNotExist) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR); return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR);
} }
TabSysUser user = userService.getUserById(auditorDTO.getUserId()); if (auditorDTO.getUserId() != null) {
if (user == null) { TabSysUser user = userService.getUserById(auditorDTO.getUserId());
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS); if (user == null) {
} return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
if (!StringUtils.equals(auditorDTO.getPhone(), user.getPhoneNumber())) { }
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "关联管理员手机号不一致"); if (!StringUtils.equals(auditorDTO.getPhone(), user.getPhoneNumber())) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "关联管理员手机号不一致");
}
} }
auditorDTO.setIsUse(auditorDTO.getUserId() == null ? 0 : 1); auditorDTO.setIsUse(auditorDTO.getUserId() == null ? 0 : 1);
...@@ -217,6 +219,7 @@ public class AuditorApiServiceImpl implements AuditorApiService { ...@@ -217,6 +219,7 @@ public class AuditorApiServiceImpl implements AuditorApiService {
AuditorDTO auditorDTO = new AuditorDTO(); AuditorDTO auditorDTO = new AuditorDTO();
auditorDTO.setAuditorId(auditorId); auditorDTO.setAuditorId(auditorId);
auditorDTO.setOpenid(openid); auditorDTO.setOpenid(openid);
auditorDTO.setIsUse(1);
this.auditorService.update(auditorDTO); this.auditorService.update(auditorDTO);
} }
} }
......
...@@ -342,4 +342,20 @@ public class ResourceApiServiceImpl implements ResourceApiService { ...@@ -342,4 +342,20 @@ public class ResourceApiServiceImpl implements ResourceApiService {
return EnterpriseServiceResponse.success(defaultResource); return EnterpriseServiceResponse.success(defaultResource);
} }
@Override
public ServiceResponse<Long> getUserResourceByUserId(Integer userId) {
TabSysUser user = userService.getUserById(userId);
if (user.getSuperAdmin() == 1) {
// 是超管就返回所有
return EnterpriseServiceResponse.success(-1L);
}
List<UserResourceDTO> resourceDTOList = this.userResourceService.listUserResourceByUserId(userId);
if (CollectionUtils.isEmpty(resourceDTOList)) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
UserResourceDTO userResourceDTO = resourceDTOList.get(0);
TabSysResource resource = this.resourceService.getResource(userResourceDTO.getResourceId());
return EnterpriseServiceResponse.success(resource.getUserResource());
}
} }
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