ソースを参照

Merge branch 'wanjing' into develop

tags/v1.0.0^2
wanjing 1年前
コミット
1c5818a3cd
15個のファイルの変更46行の追加59行の削除
  1. +0
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/User.java
  2. +5
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/RoleEnum.java
  3. +4
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/InspectionFileServiceImpl.java
  4. +5
    -10
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/RoadInformationServiceImpl.java
  5. +4
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/delete/DeleteInspectionService.java
  6. +4
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java
  7. +5
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryNewInspectionListService.java
  8. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/ExecuteHandle.java
  9. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFileDistributionListService.java
  10. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFilePageListService.java
  11. +0
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/user/add/AddUserService.java
  12. +4
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/workorder/distribution/DistributionWorkorderService.java
  13. +4
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/workorder/generate/GenerateWorkorderService.java
  14. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/workorder/query/QueryWorkOrderPageListService.java
  15. +1
    -2
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/UserMapper.xml

+ 0
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/User.java ファイルの表示

@@ -124,11 +124,6 @@ public class User implements Serializable {
*/
private String password;

/**
* 用户类型:1管理员
*/
private Integer type;

/**
* 驾照类型:1飞行执照 2飞行许可证
*/

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/UserTypeEnum.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/RoleEnum.java ファイルの表示

@@ -12,13 +12,13 @@ import java.util.Map;
* @team tuoheng
* @date 2022-11-25
*/
public enum UserTypeEnum {
public enum RoleEnum {

SUPER_ADMIN(1,"超级管理员"),
ADMIN(2,"管理员"),
ORDINARY_USER(3,"普通用户");

UserTypeEnum(int code, String description){
RoleEnum(int code, String description){
this.code = code;
this.description = description;
}
@@ -29,15 +29,15 @@ public enum UserTypeEnum {
@Getter
private String description;

private static Map<Integer, UserTypeEnum> data = new HashMap<>();
private static Map<Integer, RoleEnum> data = new HashMap<>();

static {
for (UserTypeEnum type : UserTypeEnum.values()) {
for (RoleEnum type : RoleEnum.values()) {
data.put(type.code, type);
}
}

public static UserTypeEnum parse(int code) {
public static RoleEnum parse(int code) {
if (data.containsKey(code)) {
return data.get(code);
}

+ 4
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/InspectionFileServiceImpl.java ファイルの表示

@@ -8,7 +8,7 @@ import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.entity.QuestionType;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.code.inspectionfile.ListByDeptUserTypeEnum;
import com.tuoheng.admin.enums.code.questiontype.QuestionTypeEnum;
import com.tuoheng.admin.mapper.*;
@@ -178,7 +178,7 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
}
String tenantId = CurrentUserUtil.getTenantId();
//用户角色判断 1超级管理员 2部门管理员 3普通用户
if(null == user.getType()){
if(null == user.getRoleId()){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
List<ListByDeptUserTypeVo> list = new ArrayList<>();
@@ -199,7 +199,7 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
//5块状裂纹
Integer massiveCrack = 0;
//若角色为超级管理员,查看状态为已生成工单和和问题已处理
if(UserTypeEnum.SUPER_ADMIN.getCode()==user.getType()){
if(RoleEnum.SUPER_ADMIN.getCode()==user.getRoleId()){
//直接查问题列表
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getMark, 1)
@@ -256,7 +256,7 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
// list.add(vo4);
}
//若角色为部门管理员或普通用户
if(UserTypeEnum.ADMIN.getCode()== user.getType() || UserTypeEnum.ORDINARY_USER.getCode()== user.getType()){
if(RoleEnum.ADMIN.getCode()== user.getRoleId() || RoleEnum.ORDINARY_USER.getCode()== user.getRoleId()){
//获取用户对应的部门
String deptId = user.getDeptId();
if(StringUtils.isEmpty(deptId)){

+ 5
- 10
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/RoadInformationServiceImpl.java ファイルの表示

@@ -1,15 +1,12 @@
package com.tuoheng.admin.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.query.RoadInformationQuery;
import com.tuoheng.admin.service.RoadInformationService;
@@ -19,8 +16,6 @@ import com.tuoheng.common.core.common.BaseServiceImpl;
import com.tuoheng.common.core.enums.ServiceExceptionEnum;
import com.tuoheng.common.core.exception.ServiceException;
import com.tuoheng.common.core.utils.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@@ -155,7 +150,7 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
//获取租户id
String tenantId = user.getTenantId();
//用户类型角色判断 1超级管理员 2 部门管理员 3普通用户
if(null == user.getType()){
if(null == user.getRoleId()){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//登录用户若为部门管理员或普通用户需要查询所在部门
@@ -164,12 +159,12 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
List<RoadInformation> roadInformationList = new ArrayList<>();
if(null == deptId){
//超级管理员
if(UserTypeEnum.SUPER_ADMIN.getCode()== user.getType()){
if(RoleEnum.SUPER_ADMIN.getCode()== user.getRoleId()){
roadInformationList = this.getAllRoadInformationList(tenantId);
}
}
//部门管理员
if(UserTypeEnum.ADMIN.getCode() == user.getType()){
if(RoleEnum.ADMIN.getCode() == user.getRoleId()){
//根据当前用户对应的部门id获取该部门及子部门的id集合
List<String> deptIdList = deptMapper.selectAllChildListById(deptId);
if(CollectionUtil.isEmpty(deptIdList)){
@@ -179,7 +174,7 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
roadInformationList = this.getRoadInformationList(tenantId, list);
}
//普通用户
if(UserTypeEnum.ORDINARY_USER.getCode() == user.getType()){
if(RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()){
List<RoadDept> roadDeptList = roadDeptMapper.selectList(new LambdaQueryWrapper<RoadDept>()
.eq(RoadDept::getTenantId, tenantId)
.eq(RoadDept::getDeptId, deptId));

+ 4
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/delete/DeleteInspectionService.java ファイルの表示

@@ -6,7 +6,7 @@ import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.code.inspection.DeleteInspectionCodeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.utils.CurrentUserUtil;
@@ -160,14 +160,14 @@ public class DeleteInspectionService {
.eq(User::getTenantId, tenantId)
.eq(User::getId, userId)
.eq(User::getMark, 1));
if (UserTypeEnum.SUPER_ADMIN.getCode() == user.getType()) {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
return JsonResult.success();
} else if (UserTypeEnum.ADMIN.getCode() == user.getType()) {
} else if (RoleEnum.ADMIN.getCode() == user.getRoleId()) {
if (user.getDeptId().equals(inspection.getDeptId())) {
return JsonResult.success();
}
return JsonResult.error(DeleteInspectionCodeEnum.ADMIN_NOT_DELETE_CHILD_INSPECTION.getCode(), DeleteInspectionCodeEnum.ADMIN_NOT_DELETE_CHILD_INSPECTION.getMsg());
} else if (UserTypeEnum.ORDINARY_USER.getCode() == user.getType()) {
} else if (RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {
return JsonResult.error(DeleteInspectionCodeEnum.ORDINARY_USER_NO_PERMISSION_TO_DELETE.getCode(), DeleteInspectionCodeEnum.ORDINARY_USER_NO_PERMISSION_TO_DELETE.getMsg());
}
return JsonResult.error();

+ 4
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java ファイルの表示

@@ -7,7 +7,7 @@ import com.tuoheng.admin.conver.InspectionConverMapper;
import com.tuoheng.admin.entity.Dept;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionPageListCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.mapper.InspectionFileMapper;
@@ -118,11 +118,11 @@ public class QueryInspectionPageListService {
.eq(Dept::getMark, 1));

IPage<Inspection> pageData = null;
if (UserTypeEnum.SUPER_ADMIN.getCode() == user.getType()) {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
pageData = this.getAllList(request);
} else if (UserTypeEnum.ADMIN.getCode() == user.getType()) {
} else if (RoleEnum.ADMIN.getCode() == user.getRoleId()) {
pageData = this.getListByDept(request);
} else if (UserTypeEnum.ORDINARY_USER.getCode() == user.getType()) {
} else if (RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {
pageData = this.getListByDept(request);
}


+ 5
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryNewInspectionListService.java ファイルの表示

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionListServiceEnum;
import com.tuoheng.admin.enums.code.inspectionfile.ListByDeptUserTypeEnum;
import com.tuoheng.admin.mapper.InspectionMapper;
@@ -57,11 +57,11 @@ public class QueryNewInspectionListService {
}

//判断用户角色 1超级管理员 2部门管理员 3普通用户
if(null == user.getType()){
if(null == user.getRoleId()){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//若角色为超级管理员,查询任务表最新五条数据
if(UserTypeEnum.SUPER_ADMIN.getCode()==user.getType()) {
if(RoleEnum.SUPER_ADMIN.getCode()==user.getRoleId()) {
List<Inspection> inspectionList = inspectionMapper.selectList(Wrappers.<Inspection>lambdaQuery()
.eq(Inspection::getTenantId, tenantId)
.eq(Inspection::getMark, 1)
@@ -70,7 +70,7 @@ public class QueryNewInspectionListService {
if (inspectionList == null) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
if (UserTypeEnum.SUPER_ADMIN.getCode() == user.getType() || UserTypeEnum.ORDINARY_USER.getCode() == user.getType()) {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId() || RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {
Stream<InspectionListVo> inspections = this.getInspectionListVoStream(inspectionList);

return JsonResult.success(inspections);
@@ -80,7 +80,7 @@ public class QueryNewInspectionListService {


//若角色为部门管理员或普通用户,查询最新五条数据
if(UserTypeEnum.ADMIN.getCode()==user.getType() || UserTypeEnum.ORDINARY_USER.getCode()==user.getType()){
if(RoleEnum.ADMIN.getCode()==user.getRoleId() || RoleEnum.ORDINARY_USER.getCode()==user.getRoleId()){
String deptId = user.getDeptId();
if(StringUtils.isEmpty(deptId)){
JsonResult.error(QueryInspectionListServiceEnum.DEPT_ID_IS_NULL.getCode(),QueryInspectionListServiceEnum.DEPT_ID_IS_NULL.getMsg());

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/ExecuteHandle.java ファイルの表示

@@ -4,7 +4,7 @@ import com.tuoheng.admin.entity.Dept;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.InspectionTypeEnum;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.vo.inspection.InspectionVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -45,12 +45,12 @@ public class ExecuteHandle implements GenerateInspectionFieldHander {
return;
}

if (UserTypeEnum.ADMIN.getCode() == user.getType()) {
if (RoleEnum.ADMIN.getCode() == user.getRoleId()) {
// 管理员可对本部门的任务执行此操作
if (user.getDeptId().equals(inspectionVo.getDeptId())) {
inspectionVo.setExecute(true);
}
} else if (UserTypeEnum.ORDINARY_USER.getCode() == user.getType()) {
} else if (RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {
// 普通用户可对自己创建的任务执行此操作
if (user.getId().equals(inspectionVo.getCreateUser())) {
inspectionVo.setExecute(true);

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFileDistributionListService.java ファイルの表示

@@ -3,7 +3,7 @@ package com.tuoheng.admin.service.inspectionfile.query;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.conver.InspectionFileConverMapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionPageListCodeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.inspectionfile.QueryInspectionFileDistributionListRequest;
@@ -101,7 +101,7 @@ public class QueryInspectionFileDistributionListService {
User user = userMapper.selectOne(new LambdaQueryWrapper<User>()
.eq(User::getId, userId)
.eq(User::getMark, 1));
if (UserTypeEnum.SUPER_ADMIN.getCode() == user.getType()) {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
return null;
} else {
deptIdList = deptMapper.selectAllChildListById(user.getDeptId());

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFilePageListService.java ファイルの表示

@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.conver.InspectionFileConverMapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionPageListCodeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.inspectionfile.QueryInspectionFilePageListRequest;
@@ -121,7 +121,7 @@ public class QueryInspectionFilePageListService {
User user = userMapper.selectOne(new LambdaQueryWrapper<User>()
.eq(User::getId, userId)
.eq(User::getMark, 1));
if (UserTypeEnum.SUPER_ADMIN.getCode() == user.getType()) {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
return null;
} else {
deptIdList = deptMapper.selectAllChildListById(user.getDeptId());

+ 0
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/user/add/AddUserService.java ファイルの表示

@@ -6,7 +6,6 @@ import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.entity.Role;
import com.tuoheng.admin.entity.Tenant;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.code.user.AddUserCodeEnum;
import com.tuoheng.admin.mapper.RoleMapper;
import com.tuoheng.admin.mapper.TenantMapper;

+ 4
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/workorder/distribution/DistributionWorkorderService.java ファイルの表示

@@ -3,7 +3,7 @@ package com.tuoheng.admin.service.workorder.distribution;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.entity.WorkOrder;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.WorkOrderStatusEnum;
import com.tuoheng.admin.enums.code.workorder.DistributionWorkorderCodeEnum;
import com.tuoheng.admin.enums.code.workorder.GenerateWorkorderCodeEnum;
@@ -116,15 +116,14 @@ public class DistributionWorkorderService {
.eq(User::getId, userId)
.eq(User::getTenantId, tenantId)
.eq(User::getMark, 1));
user.setType(UserTypeEnum.ADMIN.getCode());
if (UserTypeEnum.SUPER_ADMIN.getCode() == user.getType()) {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
return JsonResult.error(DistributionWorkorderCodeEnum.SUPER_ADMIN_NOT_DISTRIBUTION.getCode(), DistributionWorkorderCodeEnum.SUPER_ADMIN_NOT_DISTRIBUTION.getMsg());
} else if (UserTypeEnum.ADMIN.getCode() == user.getType()) {
} else if (RoleEnum.ADMIN.getCode() == user.getRoleId()) {
if (!user.getDeptId().equals(workOrder.getDeptId())) {
return JsonResult.error(DistributionWorkorderCodeEnum.ADMIN_NOT_DISTRIBUTION_CHILD_DEPT_WORK_ORDER.getCode(), DistributionWorkorderCodeEnum.ADMIN_NOT_DISTRIBUTION_CHILD_DEPT_WORK_ORDER.getMsg());
}
return JsonResult.success(user);
} else if (UserTypeEnum.ORDINARY_USER.getCode() == user.getType()) {
} else if (RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {
return JsonResult.error(DistributionWorkorderCodeEnum.ORDINARY_USER_NOT_DISTRIBUTION.getCode(), DistributionWorkorderCodeEnum.ORDINARY_USER_NOT_DISTRIBUTION.getMsg());
}
return JsonResult.error();

+ 4
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/workorder/generate/GenerateWorkorderService.java ファイルの表示

@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.WorkOrderStatusEnum;
import com.tuoheng.admin.enums.code.workorder.GenerateWorkorderCodeEnum;
import com.tuoheng.admin.mapper.*;
@@ -126,16 +126,16 @@ public class GenerateWorkorderService {
* @return
*/
private JsonResult checkPermission(User user, List<Inspection> inspectionList) {
if (UserTypeEnum.SUPER_ADMIN.getCode() == user.getType()) {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
return JsonResult.success(user);
} else if (UserTypeEnum.ADMIN.getCode() == user.getType()) {
} else if (RoleEnum.ADMIN.getCode() == user.getRoleId()) {
for (Inspection inspection : inspectionList) {
if (!user.getDeptId().equals(inspection.getDeptId())) {
return JsonResult.error(GenerateWorkorderCodeEnum.ADMIN_NOT_GENERATE_CHILD_WORKORDER.getCode(), GenerateWorkorderCodeEnum.ADMIN_NOT_GENERATE_CHILD_WORKORDER.getMsg());
}
}
return JsonResult.success(user);
} else if (UserTypeEnum.ORDINARY_USER.getCode() == user.getType()) {
} else if (RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {
return JsonResult.error(GenerateWorkorderCodeEnum.ORDINARY_USER_NO_PERMISSION_TO_GENERATE.getCode(), GenerateWorkorderCodeEnum.ORDINARY_USER_NO_PERMISSION_TO_GENERATE.getMsg());
}
return JsonResult.error();

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/workorder/query/QueryWorkOrderPageListService.java ファイルの表示

@@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.conver.WorkOrderConverMapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionPageListCodeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.workorder.QueryWorkOrderPageListRequest;
@@ -67,7 +67,7 @@ public class QueryWorkOrderPageListService {
User user = userMapper.selectOne(new LambdaQueryWrapper<User>()
.eq(User::getId, userId)
.eq(User::getMark, 1));
if (UserTypeEnum.SUPER_ADMIN.getCode() != user.getType()) {
if (RoleEnum.SUPER_ADMIN.getCode() != user.getRoleId()) {
request.setUserDeptId(user.getDeptId());
}

@@ -126,7 +126,7 @@ public class QueryWorkOrderPageListService {
deptIdList.add(deptId);
return deptIdList;
}
if (UserTypeEnum.SUPER_ADMIN.getCode() == user.getType()) {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
return null;
} else {
deptIdList = deptMapper.selectAllChildListById(user.getDeptId());

+ 1
- 2
tuoheng-service/tuoheng-admin/src/main/resources/mapper/UserMapper.xml ファイルの表示

@@ -24,7 +24,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cityName" column="city_name" />
<result property="username" column="username" />
<result property="password" column="password" />
<result property="type" column="type" />
<result property="driverType" column="driver_type" />
<result property="driverCode" column="driver_code" />
<result property="salt" column="salt" />
@@ -45,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectUserVo">
id, tenant_id, code, realname, nickname, gender, avatar, mobile, email, birthday, dept_id, province_code, city_code, district_code, street_code, address, city_name, username, password, type, driver_type, driver_code, salt, intro, status, note, sort, login_num, login_ip, login_time, create_user, create_time, update_user, update_time, role_id, client_id, mark
id, tenant_id, code, realname, nickname, gender, avatar, mobile, email, birthday, dept_id, province_code, city_code, district_code, street_code, address, city_name, username, password, driver_type, driver_code, salt, intro, status, note, sort, login_num, login_ip, login_time, create_user, create_time, update_user, update_time, role_id, client_id, mark
</sql>
<update id="updateByIdList" parameterType="hashmap">

読み込み中…
キャンセル
保存