|
|
@@ -40,23 +40,23 @@ public class QueryNewInspectionListService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JsonResult getList(InspectionFileQuery query) { |
|
|
|
if(null == query.getUserId()){ |
|
|
|
JsonResult.error(ListByDeptUserTypeEnum.QUERY_IS_FAILED.getCode(),ListByDeptUserTypeEnum.QUERY_IS_FAILED.getMsg()); |
|
|
|
} |
|
|
|
public JsonResult getList() { |
|
|
|
//获取登录用户信息 |
|
|
|
//String username = SecurityUserUtils.username(); |
|
|
|
// String username = "admin"; |
|
|
|
// if(StringUtils.isEmpty(username)){ |
|
|
|
// JsonResult.error(ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getMsg()); |
|
|
|
// } |
|
|
|
String username = "admin"; |
|
|
|
if(StringUtils.isEmpty(username)){ |
|
|
|
JsonResult.error(ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() |
|
|
|
.eq(User::getId, query.getUserId()).eq(User::getMark, 1)); |
|
|
|
.eq(User::getUsername, username).eq(User::getMark, 1)); |
|
|
|
if(ObjectUtil.isNull(user)){ |
|
|
|
JsonResult.error(ListByDeptUserTypeEnum.USER_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
String tenantId = user.getTenantId(); |
|
|
|
String deptId = user.getDeptId(); |
|
|
|
if(StringUtils.isEmpty(tenantId)){ |
|
|
|
JsonResult.error(ListByDeptUserTypeEnum.TENANT_ID_IS_NULL.getCode(),ListByDeptUserTypeEnum.TENANT_ID_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
|
|
|
|
//判断用户角色 1超级管理员 2部门管理员 3普通用户 |
|
|
|
if(null == user.getType()){ |
|
|
|
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); |
|
|
@@ -82,7 +82,7 @@ public class QueryNewInspectionListService { |
|
|
|
|
|
|
|
//若角色为部门管理员或普通用户,查询最新五条数据 |
|
|
|
if(UserTypeEnum.ADMIN.getCode()==user.getType() || UserTypeEnum.ORDINARY_USER.getCode()==user.getType()){ |
|
|
|
|
|
|
|
String deptId = user.getDeptId(); |
|
|
|
if(StringUtils.isEmpty(deptId)){ |
|
|
|
JsonResult.error(QueryInspectionListServiceEnum.DEPT_ID_IS_NULL.getCode(),QueryInspectionListServiceEnum.DEPT_ID_IS_NULL.getMsg()); |
|
|
|
} |