Sfoglia il codice sorgente

优化代码

tags/v1.1.0^2
chengwang 1 anno fa
parent
commit
b76bd60e0d
32 ha cambiato i file con 130 aggiunte e 93 eliminazioni
  1. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/PermissionController.java
  2. +3
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/MarkEnum.java
  3. +7
    -7
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/business/BusinessServiceImpl.java
  4. +5
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/add/AddDeptService.java
  5. +4
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/delete/DeleteDeptService.java
  6. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/query/QueryChildListService.java
  7. +5
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/add/AddInspectionService.java
  8. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionByIdService.java
  9. +3
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionDetailsByIdService.java
  10. +3
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionListService.java
  11. +3
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryNewInspectionListService.java
  12. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/ProblemCountHandle.java
  13. +4
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/resubmit/ResubmitInspectionService.java
  14. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateExecuteTaskStatusService.java
  15. +3
    -8
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateFlightStatusService.java
  16. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateInspectionStatusService.java
  17. +5
    -7
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java
  18. +3
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/upload/UploadFlightUrlService.java
  19. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/confirm/InspectionFileConfirmService.java
  20. +5
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/handle/QueryInspectionFileHandleByInspectionFileIdService.java
  21. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/ignore/InspectionFileIgnoreService.java
  22. +3
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/processing/InspectionFileProcessingService.java
  23. +3
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFilePageListByInspectionIdService.java
  24. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/questiontype/query/QueryQuestionTypeListService.java
  25. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/ExportInspectionHandleReportService.java
  26. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/ExportInspectionReportService.java
  27. +7
    -6
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/road/RoadInformationServiceImpl.java
  28. +4
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/road/query/QueryRoadListByDeptIdService.java
  29. +10
    -9
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/role/RoleServiceImpl.java
  30. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/task/AirportTask.java
  31. +24
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/enums/MarkEnum.java
  32. +2
    -1
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileHandleServiceImpl.java

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/PermissionController.java Vedi File

@@ -2,9 +2,9 @@ package com.tuoheng.admin.controller;

import com.tuoheng.admin.dto.GetPermissionRoleIdListByApiUrlDto;
import com.tuoheng.admin.entity.OpPermissions;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.query.RoleClientQuery;
import com.tuoheng.admin.service.permissions.OpPermissionsService;
import com.tuoheng.common.core.common.BaseController;
import com.tuoheng.common.core.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -72,7 +72,7 @@ public class PermissionController{
*/
@DeleteMapping("/delete/{id}")
public JsonResult delete(@PathVariable("id") Integer id) {
boolean flag = permissionService.update().eq("id",id).set("mark", 0).update();
boolean flag = permissionService.update().eq("id",id).set("mark", MarkEnum.NOTVALID.getCode()).update();
if (flag) {
return JsonResult.success();
} else {

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/MarkTypeEnum.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/MarkEnum.java Vedi File

@@ -6,12 +6,13 @@ import lombok.Getter;
* 逻辑删除标记类型
* @author chenyukun
*/
public enum MarkTypeEnum {

public enum MarkEnum {
VALID(1,"有效"),

NOTVALID(0,"失效");

MarkTypeEnum(int code, String description){
MarkEnum(int code, String description){
this.code = code;
this.description = description;
}

+ 7
- 7
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/business/BusinessServiceImpl.java Vedi File

@@ -3,7 +3,7 @@ package com.tuoheng.admin.service.business;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.Business;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.BusinessMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.utils.CurrentUserUtil;
@@ -44,19 +44,19 @@ public class BusinessServiceImpl extends BaseServiceImpl<BusinessMapper, Busines
business.setUpdateUser(CurrentUserUtil.getUserId());
business.setUpdateTime(DateUtils.now());
business.setTenantId(CurrentUserUtil.getTenantId());
business.setMark(MarkTypeEnum.VALID.getCode());
business.setMark(MarkEnum.VALID.getCode());
log.info("thbusiness:{}", JacksonUtil.obj2StringPretty(business));
// 查询任务是否存在
int result = businessMapper.selectCount(new LambdaQueryWrapper<Business>()
.eq(Business::getMsgId, msgId)
.eq(Business::getTenantId, CurrentUserUtil.getTenantId())
.eq(Business::getMark, MarkTypeEnum.VALID.getCode()));
.eq(Business::getMark, MarkEnum.VALID.getCode()));
if(result > 0){
log.info("更新");
businessMapper.update(business, new LambdaQueryWrapper<Business>()
.eq(Business::getMsgId, msgId)
.eq(Business::getTenantId, CurrentUserUtil.getTenantId())
.eq(Business::getMark, MarkTypeEnum.VALID.getCode()));
.eq(Business::getMark, MarkEnum.VALID.getCode()));
} else {
log.info("插入");
businessMapper.insert(business);
@@ -82,20 +82,20 @@ public class BusinessServiceImpl extends BaseServiceImpl<BusinessMapper, Busines
business.setUpdateUser(inspection.getUpdateUser());
business.setUpdateTime(DateUtils.now());
business.setTenantId(inspection.getTenantId());
business.setMark(MarkTypeEnum.VALID.getCode());
business.setMark(MarkEnum.VALID.getCode());
log.info("thbusiness:{}", JacksonUtil.obj2StringPretty(business));

// 查询任务是否存在
int result = businessMapper.selectCount(new LambdaQueryWrapper<Business>()
.eq(Business::getMsgId, msgId)
.eq(Business::getTenantId, inspection.getTenantId())
.eq(Business::getMark, MarkTypeEnum.VALID.getCode()));
.eq(Business::getMark, MarkEnum.VALID.getCode()));
if(result > 0){
log.info("更新");
businessMapper.update(business, new LambdaQueryWrapper<Business>()
.eq(Business::getMsgId, msgId)
.eq(Business::getTenantId, inspection.getTenantId())
.eq(Business::getMark, MarkTypeEnum.VALID.getCode()));
.eq(Business::getMark, MarkEnum.VALID.getCode()));
} else {
log.info("插入");
businessMapper.insert(business);

+ 5
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/add/AddDeptService.java Vedi File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.dto.RoadSectionDto;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.dept.AddDeptCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.mapper.RoadDeptMapper;
@@ -103,7 +104,7 @@ public class AddDeptService {
Integer count = deptMapper.selectCount(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getPid, addDeptRequest.getPid())
.eq(Dept::getMark, 1));
.eq(Dept::getMark, MarkEnum.VALID.getCode()));

// 顶级部门只能创建一个
if (count > 0) {
@@ -114,7 +115,7 @@ public class AddDeptService {
Integer count = deptMapper.selectCount(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, addDeptRequest.getPid())
.eq(Dept::getMark, 1));
.eq(Dept::getMark, MarkEnum.VALID.getCode()));
if (count <= 0) {
return JsonResult.error(AddDeptCodeEnum.PARENT_DEPT_IS_NOT_EXIST.getCode(), AddDeptCodeEnum.PARENT_DEPT_IS_NOT_EXIST.getMsg());
}
@@ -124,7 +125,7 @@ public class AddDeptService {
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getPid, addDeptRequest.getPid())
.eq(Dept::getName, addDeptRequest.getName())
.eq(Dept::getMark, 1));
.eq(Dept::getMark, MarkEnum.VALID.getCode()));

// 系统中已存在
if (count > 0) {
@@ -270,7 +271,7 @@ public class AddDeptService {
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>()
.eq(User::getTenantId, tenantId)
.eq(User::getRoleId, 1)
.eq(User::getMark, 1));
.eq(User::getMark, MarkEnum.VALID.getCode()));
if (CollectionUtils.isEmpty(userList)) {
log.info("用户为空");
return;

+ 4
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/delete/DeleteDeptService.java Vedi File

@@ -2,6 +2,7 @@ package com.tuoheng.admin.service.dept.delete;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.dept.DeleteDeptCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.mapper.RoadDeptMapper;
@@ -91,7 +92,7 @@ public class DeleteDeptService {
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, id)
.eq(Dept::getMark, 1));
.eq(Dept::getMark, MarkEnum.VALID.getCode()));
if (null == dept) {
return JsonResult.error(DeleteDeptCodeEnum.DEPT_IS_NOT_EXIST.getCode(), DeleteDeptCodeEnum.DEPT_IS_NOT_EXIST.getMsg());
}
@@ -100,7 +101,7 @@ public class DeleteDeptService {
Integer count = userMapper.selectCount(new LambdaQueryWrapper<User>()
.eq(User::getTenantId, tenantId)
.eq(User::getDeptId, id)
.eq(User::getMark, 1));
.eq(User::getMark, MarkEnum.VALID.getCode()));
if (count > 0) {
return JsonResult.error(DeleteDeptCodeEnum.DEPT_IEXIST_USER.getCode(), DeleteDeptCodeEnum.DEPT_IEXIST_USER.getMsg());
}
@@ -109,7 +110,7 @@ public class DeleteDeptService {
count = deptMapper.selectCount(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getPid, id)
.eq(Dept::getMark, 1));
.eq(Dept::getMark, MarkEnum.VALID.getCode()));
if (count > 0) {
return JsonResult.error(DeleteDeptCodeEnum.DEPT_IEXIST_CHILDREN_DEPT.getCode(), DeleteDeptCodeEnum.DEPT_IEXIST_CHILDREN_DEPT.getMsg());
}

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/query/QueryChildListService.java Vedi File

@@ -3,6 +3,7 @@ package com.tuoheng.admin.service.dept.query;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.Dept;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.dept.QueryDeptChildListCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.utils.CurrentUserUtil;
@@ -68,7 +69,7 @@ public class QueryChildListService {
Integer count = deptMapper.selectCount(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, id)
.eq(Dept::getMark, 1));
.eq(Dept::getMark, MarkEnum.VALID.getCode()));
if (count <= 0) {
return JsonResult.error(QueryDeptChildListCodeEnum.DEPT_IS_NOT_EXIST.getCode(), QueryDeptChildListCodeEnum.DEPT_IS_NOT_EXIST.getMsg());
}

+ 5
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/add/AddInspectionService.java Vedi File

@@ -6,6 +6,7 @@ import com.tuoheng.admin.conver.InspectionConverMapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.InspectionTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.AddInspectionCodeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.inspection.AddInspectionRequest;
@@ -146,7 +147,7 @@ public class AddInspectionService {
Integer roadCount = roadInformationMapper.selectCount(Wrappers.<RoadInformation>lambdaQuery()
.eq(RoadInformation::getTenantId, tenantId)
.eq(RoadInformation::getId, addInspectionRequest.getRoadId())
.eq(RoadInformation::getMark, 1));
.eq(RoadInformation::getMark, MarkEnum.VALID.getCode()));

if (roadCount <= 0) {
return JsonResult.error(AddInspectionCodeEnum.ROAD_IS_NOT_EXIST.getCode(), AddInspectionCodeEnum.ROAD_IS_NOT_EXIST.getMsg());
@@ -155,7 +156,7 @@ public class AddInspectionService {
Integer sectionCount = sectionMapper.selectCount(Wrappers.<Section>lambdaQuery()
.eq(Section::getTenantId, tenantId)
.eq(Section::getId, addInspectionRequest.getSectionId())
.eq(Section::getMark, 1));
.eq(Section::getMark, MarkEnum.VALID.getCode()));
if (sectionCount <= 0) {
return JsonResult.error(AddInspectionCodeEnum.SECTION_IS_NOT_EXIST.getCode(), AddInspectionCodeEnum.SECTION_IS_NOT_EXIST.getMsg());
}
@@ -163,7 +164,7 @@ public class AddInspectionService {
User user = userMapper.selectOne(new LambdaQueryWrapper<User>()
.eq(User::getTenantId, tenantId)
.eq(User::getId, userId)
.eq(User::getMark, 1));
.eq(User::getMark, MarkEnum.VALID.getCode()));
if (null == user) {
return JsonResult.error(AddInspectionCodeEnum.USER_IS_NOT_EXIST.getCode(), AddInspectionCodeEnum.USER_IS_NOT_EXIST.getMsg());
}
@@ -171,7 +172,7 @@ public class AddInspectionService {
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, user.getDeptId())
.eq(Dept::getMark, 1));
.eq(Dept::getMark, MarkEnum.VALID.getCode()));
if (null == dept) {
return JsonResult.error(AddInspectionCodeEnum.DEPT_IS_NOT_EXIST.getCode(), AddInspectionCodeEnum.DEPT_IS_NOT_EXIST.getMsg());
}

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionByIdService.java Vedi File

@@ -2,6 +2,7 @@ package com.tuoheng.admin.service.inspection.query;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionInfoByIdCodeEnum;
import com.tuoheng.admin.mapper.InspectionHistoryMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
@@ -55,7 +56,7 @@ public class QueryInspectionByIdService {
Inspection inspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getTenantId, tenantId)
.eq(Inspection::getId, id)
.eq(Inspection::getMark, 1));
.eq(Inspection::getMark, MarkEnum.VALID.getCode()));
if (null == inspection) {
return JsonResult.error(QueryInspectionInfoByIdCodeEnum.INSPECTION_IS_NOT_EXIST.getCode(), QueryInspectionInfoByIdCodeEnum.INSPECTION_IS_NOT_EXIST.getMsg());
}

+ 3
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionDetailsByIdService.java Vedi File

@@ -6,6 +6,7 @@ import com.tuoheng.admin.conver.InspectionConverMapper;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionHistory;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionDetailsByIdCodeEnum;
import com.tuoheng.admin.mapper.InspectionHistoryMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
@@ -77,7 +78,7 @@ public class QueryInspectionDetailsByIdService {
Inspection inspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getTenantId, tenantId)
.eq(Inspection::getId, id)
.eq(Inspection::getMark, 1));
.eq(Inspection::getMark, MarkEnum.VALID.getCode()));

if (null == inspection) {
return JsonResult.error(QueryInspectionDetailsByIdCodeEnum.INSPECTION_IS_NOT_EXIST.getCode(), QueryInspectionDetailsByIdCodeEnum.INSPECTION_IS_NOT_EXIST.getMsg());
@@ -94,7 +95,7 @@ public class QueryInspectionDetailsByIdService {
private List<InspectionHistory> getInspectionHistoryList(String id) {
List<InspectionHistory> inspectionHistoryList = inspectionHistoryMapper.selectList(new LambdaQueryWrapper<InspectionHistory>()
.eq(InspectionHistory::getInspectionId, id)
.eq(InspectionHistory::getMark, 1));
.eq(InspectionHistory::getMark, MarkEnum.VALID.getCode()));
return inspectionHistoryList;
}


+ 3
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionListService.java Vedi File

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.dto.InspectionDto;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionListServiceEnum;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
@@ -46,7 +47,7 @@ public class QueryInspectionListService {
return JsonResult.error(QueryInspectionListServiceEnum.QUERY_IS_FAILED.getCode(),QueryInspectionListServiceEnum.QUERY_IS_FAILED.getMsg());
}
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1).eq(User::getStatus,1)
.eq(User::getMark, MarkEnum.VALID.getCode()).eq(User::getStatus,1)
.eq(User::getUsername,username));

if(ObjectUtil.isNull(user)){
@@ -57,7 +58,7 @@ public class QueryInspectionListService {
return JsonResult.error(QueryInspectionListServiceEnum.DEPT_ID_IS_NULL.getCode(),QueryInspectionListServiceEnum.DEPT_ID_IS_NULL.getMsg());
}
List<Inspection> inspections = inspectionMapper.selectList(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getMark, 1)
.eq(Inspection::getMark, MarkEnum.VALID.getCode())
.eq(Inspection::getTenantId, CurrentUserUtil.getTenantId())
.eq(Inspection::getDeptId, deptId)
.eq(Inspection::getAirportId, dto.getAirportId())

+ 3
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryNewInspectionListService.java Vedi File

@@ -6,6 +6,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.MarkEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionListServiceEnum;
import com.tuoheng.admin.enums.code.inspectionfile.ListByDeptUserTypeEnum;
@@ -59,7 +60,7 @@ public class QueryNewInspectionListService {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
List<Inspection> inspectionList = inspectionMapper.selectList(Wrappers.<Inspection>lambdaQuery()
.eq(Inspection::getTenantId, tenantId)
.eq(Inspection::getMark, 1)
.eq(Inspection::getMark, MarkEnum.VALID.getCode())
.orderByDesc(Inspection::getCreateTime)
.last("limit 5"));
if (CollectionUtil.isEmpty(inspectionList)) {
@@ -80,7 +81,7 @@ public class QueryNewInspectionListService {
List<Inspection> inspectionList = inspectionMapper.selectList(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getTenantId, tenantId)
.eq(Inspection::getDeptId, deptId)
.eq(Inspection::getMark, 1)
.eq(Inspection::getMark, MarkEnum.VALID.getCode())
.orderByDesc(Inspection::getCreateTime)
.last("limit 5"));
if (CollectionUtil.isEmpty(inspectionList)) {

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/ProblemCountHandle.java Vedi File

@@ -6,7 +6,7 @@ import com.tuoheng.admin.entity.Dept;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.vo.inspection.InspectionVo;
import lombok.extern.slf4j.Slf4j;
@@ -34,7 +34,7 @@ public class ProblemCountHandle implements GenerateInspectionFieldHander {
// log.info("处理问题数字段");
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>()
.eq(InspectionFile::getInspectionId, inspectionVo.getId())
.eq(InspectionFile::getMark, 1));
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode()));
Integer confirmedProblemCount = 0;
Integer discoverProblemCount = 0;
if (CollectionUtil.isNotEmpty(inspectionFileList)) {

+ 4
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/resubmit/ResubmitInspectionService.java Vedi File

@@ -6,6 +6,7 @@ import com.tuoheng.admin.conver.InspectionConverMapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.InspectionTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.ResubmitInspectionCodeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.inspection.EditInspectionRequest;
@@ -163,7 +164,7 @@ public class ResubmitInspectionService {
Integer roadCount = roadInformationMapper.selectCount(Wrappers.<RoadInformation>lambdaQuery()
.eq(RoadInformation::getTenantId, tenantId)
.eq(RoadInformation::getId, request.getRoadId())
.eq(RoadInformation::getMark, 1));
.eq(RoadInformation::getMark, MarkEnum.VALID.getCode()));

if (roadCount <= 0) {
return JsonResult.error(ResubmitInspectionCodeEnum.ROAD_IS_NOT_EXIST.getCode(), ResubmitInspectionCodeEnum.ROAD_IS_NOT_EXIST.getMsg());
@@ -172,7 +173,7 @@ public class ResubmitInspectionService {
Integer sectionCount = sectionMapper.selectCount(Wrappers.<Section>lambdaQuery()
.eq(Section::getTenantId, tenantId)
.eq(Section::getId, request.getSectionId())
.eq(Section::getMark, 1));
.eq(Section::getMark, MarkEnum.VALID.getCode()));
if (sectionCount <= 0) {
return JsonResult.error(ResubmitInspectionCodeEnum.SECTION_IS_NOT_EXIST.getCode(), ResubmitInspectionCodeEnum.SECTION_IS_NOT_EXIST.getMsg());
}
@@ -192,7 +193,7 @@ public class ResubmitInspectionService {
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, user.getDeptId())
.eq(Dept::getMark, 1));
.eq(Dept::getMark, MarkEnum.VALID.getCode()));
if (null == dept) {
return JsonResult.error(ResubmitInspectionCodeEnum.DEPT_IS_NOT_EXIST.getCode(), ResubmitInspectionCodeEnum.DEPT_IS_NOT_EXIST.getMsg());
}

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateExecuteTaskStatusService.java Vedi File

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionHistory;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.InspectionHistoryMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.request.inspection.ExecuteTaskStatusRequest;
@@ -67,7 +67,7 @@ public class UpdateExecuteTaskStatusService {
private JsonResult check(ExecuteTaskStatusRequest executeTaskStatusRequest) {
//查询出对应的巡检任务
Inspection inspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getMark, MarkTypeEnum.VALID.getCode())
.eq(Inspection::getMark, MarkEnum.VALID.getCode())
.eq(Inspection::getId, executeTaskStatusRequest.getRequestId()));
if (ObjectUtil.isEmpty(inspection)) {
log.info("任务不存在, inspectionId:{}", executeTaskStatusRequest.getRequestId());

+ 3
- 8
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateFlightStatusService.java Vedi File

@@ -2,7 +2,6 @@ package com.tuoheng.admin.service.inspection.update.status;

import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -11,9 +10,7 @@ import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.LiveChannel;
import com.tuoheng.admin.entity.Report;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.enums.code.inspection.EditInspectionStatusCodeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.inspection.MissionStatusRequest;
import com.tuoheng.admin.service.third.dsp.IDspService;
@@ -23,8 +20,6 @@ import com.tuoheng.common.core.utils.JacksonUtil;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;

@Slf4j
@@ -107,7 +102,7 @@ public class UpdateFlightStatusService {
// 查验是否存在
LiveChannel liveChannelQuery = liveChannelMapper.selectOne(new LambdaQueryWrapper<LiveChannel>()
.eq(LiveChannel::getInspectionId, inspection.getId())
.eq(LiveChannel::getMark, MarkTypeEnum.VALID.getCode()));
.eq(LiveChannel::getMark, MarkEnum.VALID.getCode()));
if (liveChannelQuery == null) {
// 添加通道使用记录
liveChannel.setCreateTime(DateUtils.now());
@@ -146,7 +141,7 @@ public class UpdateFlightStatusService {
private void updateReport(Inspection inspection) {
Report report = reportMapper.selectOne(Wrappers.<Report>lambdaQuery()
.eq(Report::getInspectionId, inspection.getId())
.eq(Report::getMark, 1));
.eq(Report::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNull(report)) {
log.info("该任务还没有生成报告,不需要修改报告的完成时间和状态");
return;

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateInspectionStatusService.java Vedi File

@@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.enums.AirPortTaskStatusEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.EditInspectionStatusCodeEnum;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.request.inspection.MissionStatusRequest;
@@ -74,7 +74,7 @@ public class UpdateInspectionStatusService {
private JsonResult check(MissionStatusRequest missionStatusRequest) {
//查询出对应的巡检任务
Inspection inspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getMark, MarkTypeEnum.VALID.getCode())
.eq(Inspection::getMark, MarkEnum.VALID.getCode())
.eq(Inspection::getId, missionStatusRequest.getRequestId())
.eq(Inspection::getInspectionLine, missionStatusRequest.getId()));
if (ObjectUtil.isEmpty(inspection)) {

+ 5
- 7
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java Vedi File

@@ -7,8 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.AiAnalyseStatusEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.enums.code.inspection.EditInspectionStatusCodeEnum;
import com.tuoheng.admin.mapper.*;
@@ -18,7 +17,6 @@ import com.tuoheng.admin.vo.AirWeatherVO;
import com.tuoheng.common.core.utils.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;

import java.util.List;
@@ -54,7 +52,7 @@ public class UpdateWaittStatusService {

List<Business> businessList = businessMapper.selectList(new LambdaQueryWrapper<Business>()
.eq(Business::getTypeId, inspection.getId())
.eq(Business::getMark, MarkTypeEnum.VALID.getCode())
.eq(Business::getMark, MarkEnum.VALID.getCode())
.orderByDesc(Business::getCreateTime));

if (CollectionUtil.isEmpty(businessList)) {
@@ -84,14 +82,14 @@ public class UpdateWaittStatusService {
Integer flightDataCount = flightDataMapper.selectCount(new LambdaQueryWrapper<FlightData>()
.eq(FlightData::getInspectionId, inspection.getId())
.eq(FlightData::getTenantId, inspection.getTenantId())
.eq(FlightData::getMark, MarkTypeEnum.VALID.getCode()));
.eq(FlightData::getMark, MarkEnum.VALID.getCode()));
log.info("坐标数据,flightDataCount:{}", flightDataCount);
if (flightDataCount > 0) {
int index = (int) Math.ceil((double) flightDataCount / 2);
FlightData flightData = flightDataMapper.selectOne(new LambdaQueryWrapper<FlightData>()
.eq(FlightData::getInspectionId, inspection.getId())
.eq(FlightData::getTenantId, inspection.getTenantId())
.eq(FlightData::getMark, MarkTypeEnum.VALID.getCode())
.eq(FlightData::getMark, MarkEnum.VALID.getCode())
.orderByDesc(FlightData::getTimestamp)
.last("limit " + index + ",1"));
if (ObjectUtil.isNotNull(flightData)) {
@@ -127,7 +125,7 @@ public class UpdateWaittStatusService {
private void updateReport(Inspection inspection) {
Report report = reportMapper.selectOne(Wrappers.<Report>lambdaQuery()
.eq(Report::getInspectionId, inspection.getId())
.eq(Report::getMark, 1));
.eq(Report::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNull(report)) {
log.info("该任务还没有生成报告,不需要修改报告的完成时间和状态");
return;

+ 3
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/upload/UploadFlightUrlService.java Vedi File

@@ -8,7 +8,7 @@ import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.enums.AiAnalyseStatusEnum;
import com.tuoheng.admin.enums.AiAnalyseTypeEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.mapper.FlightDataMapper;
import com.tuoheng.admin.mapper.InspectionFileMapper;
@@ -17,7 +17,6 @@ import com.tuoheng.admin.request.inspection.UploadFlightUrlRequest;
import com.tuoheng.admin.service.flightdata.AsyncService;
import com.tuoheng.admin.service.business.IBusinessService;
import com.tuoheng.admin.service.third.dsp.IDspService;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.utils.SrtDataUtil;
import com.tuoheng.common.core.config.common.CommonConfig;
import com.tuoheng.common.core.enums.HttpStatusEnum;
@@ -36,7 +35,6 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
* 上传离线视频业务层处理
@@ -146,7 +144,7 @@ public class UploadFlightUrlService {
}
Inspection inspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getCode, request.getTaskCode())
.eq(Inspection::getMark, MarkTypeEnum.VALID.getCode()));
.eq(Inspection::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtils.isEmpty(inspection)) {
log.info("巡检任务不存在!");
throw new ServiceException(ServiceExceptionEnum.TASK_DOES_NOT_EXIST);
@@ -201,7 +199,7 @@ public class UploadFlightUrlService {
flightDataMapper.delete(new LambdaQueryWrapper<FlightData>()
.eq(FlightData::getInspectionId, inspectionId)
.eq(FlightData::getTenantId, tenantId)
.eq(FlightData::getMark, MarkTypeEnum.VALID.getCode()));
.eq(FlightData::getMark, MarkEnum.VALID.getCode()));
List<List> lists = this.splitList(flightDataList, 100);
//线程池使用多线程插入数据
for (List list : lists) {

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/confirm/InspectionFileConfirmService.java Vedi File

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspectionfile.InspectionFileConfirmCodeEnum;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
@@ -66,7 +67,7 @@ public class InspectionFileConfirmService {
// 判断任务是否存在
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>()
.in(InspectionFile::getId, idList)
.eq(InspectionFile::getMark, 1));
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode()));

if (CollectionUtil.isEmpty(inspectionFileList)) {
return JsonResult.error(InspectionFileConfirmCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getCode(), InspectionFileConfirmCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getMsg());

+ 5
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/handle/QueryInspectionFileHandleByInspectionFileIdService.java Vedi File

@@ -7,6 +7,7 @@ import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.entity.InspectionFileHandle;
import com.tuoheng.admin.entity.QuestionType;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspectionfilehandle.QueryInspectionFileHandleByInspectionFileIdCodeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.vo.inspection.InspectionFileHandleVo;
@@ -58,7 +59,7 @@ public class QueryInspectionFileHandleByInspectionFileIdService {

InspectionFileHandle inspectionFileHandle = inspectionFileHandleMapper.selectOne(new LambdaQueryWrapper<InspectionFileHandle>()
.eq(InspectionFileHandle::getInspectionFileId, id)
.eq(InspectionFileHandle::getMark, 1));
.eq(InspectionFileHandle::getMark, MarkEnum.VALID.getCode()));

InspectionFileHandleVo inspectionFileHandleVo = this.buildInspectionFileHandleVo(inspectionFile, inspectionFileHandle);

@@ -79,7 +80,7 @@ public class QueryInspectionFileHandleByInspectionFileIdService {
// 判断任务是否存在
InspectionFile inspectionFile = inspectionFileMapper.selectOne(new LambdaQueryWrapper<InspectionFile>()
.eq(InspectionFile::getId, id)
.eq(InspectionFile::getMark, 1));
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode()));

if (null == inspectionFile) {
return JsonResult.error(QueryInspectionFileHandleByInspectionFileIdCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getCode(), QueryInspectionFileHandleByInspectionFileIdCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getMsg());
@@ -111,14 +112,14 @@ public class QueryInspectionFileHandleByInspectionFileIdService {
}
QuestionType questionType = questionTypeMapper.selectOne(new LambdaQueryWrapper<QuestionType>()
.eq(QuestionType::getCode, inspectionFile.getQuestionCode())
.eq(QuestionType::getMark, 1));
.eq(QuestionType::getMark, MarkEnum.VALID.getCode()));
if (null != questionType) {
inspectionFileHandleVo.setQuestionName(questionType.getContent());
}
if (StringUtils.isNotEmpty(inspectionFileHandleVo.getHandlerUser())) {
User user = userMapper.selectOne(new LambdaQueryWrapper<User>()
.eq(User::getId, inspectionFileHandleVo.getHandlerUser())
.eq(User::getMark, 1));
.eq(User::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNotNull(user)) {
inspectionFileHandleVo.setHandlerUsername(user.getRealname());
}

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/ignore/InspectionFileIgnoreService.java Vedi File

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspectionfile.InspectionFileIgnoreCodeEnum;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
@@ -65,7 +66,7 @@ public class InspectionFileIgnoreService {
// 判断任务是否存在
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>()
.in(InspectionFile::getId, idList)
.eq(InspectionFile::getMark, 1));
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode()));

if (CollectionUtil.isEmpty(inspectionFileList)) {
return JsonResult.error(InspectionFileIgnoreCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getCode(), InspectionFileIgnoreCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getMsg());

+ 3
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/processing/InspectionFileProcessingService.java Vedi File

@@ -3,6 +3,7 @@ package com.tuoheng.admin.service.inspectionfile.processing;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.WorkOrderStatusEnum;
import com.tuoheng.admin.enums.code.inspectionfilehandle.InspectionFileProcessingCodeEnum;
import com.tuoheng.admin.mapper.*;
@@ -90,7 +91,7 @@ public class InspectionFileProcessingService {
// 判断工单是否存在
WorkOrder workOrder = workOrderMapper.selectOne(new LambdaQueryWrapper<WorkOrder>()
.eq(WorkOrder::getId, request.getWorkOrderId())
.eq(WorkOrder::getMark, 1));
.eq(WorkOrder::getMark, MarkEnum.VALID.getCode()));
if (null == workOrder) {
return JsonResult.error(InspectionFileProcessingCodeEnum.WORK_ORDER_IS_NOT_EXIST.getCode(), InspectionFileProcessingCodeEnum.WORK_ORDER_IS_NOT_EXIST.getMsg());
}
@@ -101,7 +102,7 @@ public class InspectionFileProcessingService {
// 判断任务问题是否存在
InspectionFile inspectionFile = inspectionFileMapper.selectOne(new LambdaQueryWrapper<InspectionFile>()
.eq(InspectionFile::getId, request.getInspectionFileId())
.eq(InspectionFile::getMark, 1));
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode()));
if (null == inspectionFile) {
log.info("任务问题不存在,inspectionFileId:{}", request.getInspectionFileId());
return JsonResult.error(InspectionFileProcessingCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getCode(), InspectionFileProcessingCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getMsg());

+ 3
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFilePageListByInspectionIdService.java Vedi File

@@ -7,6 +7,7 @@ import com.tuoheng.admin.conver.InspectionFileConverMapper;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.entity.QuestionType;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionPageListCodeEnum;
import com.tuoheng.admin.enums.code.inspectionfile.QueryInspectionFilePageListByInspectionIdCodeEnum;
import com.tuoheng.admin.mapper.*;
@@ -90,7 +91,7 @@ public class QueryInspectionFilePageListByInspectionIdService {
// 判断任务是否存在
Inspection inspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getId, request.getInspectionId())
.eq(Inspection::getMark, 1));
.eq(Inspection::getMark, MarkEnum.VALID.getCode()));

if (null == inspection) {
return JsonResult.error(QueryInspectionFilePageListByInspectionIdCodeEnum.INSPECTION_IS_NOT_EXIST.getCode(), QueryInspectionFilePageListByInspectionIdCodeEnum.INSPECTION_IS_NOT_EXIST.getMsg());
@@ -107,7 +108,7 @@ public class QueryInspectionFilePageListByInspectionIdService {
*/
private List<InspectionFilePageListByInspectionIdVo> buildInspectionFilePageListVoList(List<InspectionFile> inspectionFileList) {
List<QuestionType> questionTypeList = questionTypeMapper.selectList(new LambdaQueryWrapper<QuestionType>()
.eq(QuestionType::getMark, 1));
.eq(QuestionType::getMark, MarkEnum.VALID.getCode()));
List<InspectionFilePageListByInspectionIdVo> inspectionFilePageListVoList = InspectionFileConverMapper.INSTANCE.fromInspectionFileListToInspectionFilePageByInspectionIdListVoList(inspectionFileList);
for (InspectionFilePageListByInspectionIdVo inspectionFilePageListVo : inspectionFilePageListVoList) {


+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/questiontype/query/QueryQuestionTypeListService.java Vedi File

@@ -3,6 +3,7 @@ package com.tuoheng.admin.service.questiontype.query;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.QuestionType;
import com.tuoheng.admin.entity.Structure;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.QuestionTypeMapper;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
@@ -28,7 +29,7 @@ public class QueryQuestionTypeListService {
public JsonResult getist() {
log.info("进入查询问题类型列表业务");
List<QuestionType> questionTypeList = questionTypeMapper.selectList(new LambdaQueryWrapper<QuestionType>()
.eq(QuestionType::getMark, 1));
.eq(QuestionType::getMark, MarkEnum.VALID.getCode()));
return JsonResult.success(questionTypeList);
}


+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/ExportInspectionHandleReportService.java Vedi File

@@ -8,6 +8,7 @@ import com.tuoheng.admin.entity.InspectionFileHandle;
import com.tuoheng.admin.entity.Report;
import com.tuoheng.admin.entity.Tenant;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.report.ExportInspectionHandleReportCodeEnum;
import com.tuoheng.admin.mapper.InspectionFileHandleMapper;
import com.tuoheng.admin.mapper.InspectionFileMapper;
@@ -116,7 +117,7 @@ public class ExportInspectionHandleReportService {
}
Report report = reportMapper.selectOne(Wrappers.<Report>lambdaQuery()
.eq(Report::getId, id)
.eq(Report::getMark, 1));
.eq(Report::getMark, MarkEnum.VALID.getCode()));
if (null == report) {
return JsonResult.error(ExportInspectionHandleReportCodeEnum.REPORT_IS_NOT_EXIST.getCode(), ExportInspectionHandleReportCodeEnum.REPORT_IS_NOT_EXIST.getMsg());
}

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/ExportInspectionReportService.java Vedi File

@@ -7,6 +7,7 @@ import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.entity.Report;
import com.tuoheng.admin.entity.Tenant;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.report.ExportInspectionReportReportCodeEnum;
import com.tuoheng.admin.mapper.InspectionFileHandleMapper;
import com.tuoheng.admin.mapper.InspectionFileMapper;
@@ -109,7 +110,7 @@ public class ExportInspectionReportService {
}
Report report = reportMapper.selectOne(Wrappers.<Report>lambdaQuery()
.eq(Report::getId, id)
.eq(Report::getMark, 1));
.eq(Report::getMark, MarkEnum.VALID.getCode()));
if (null == report) {
return JsonResult.error(ExportInspectionReportReportCodeEnum.REPORT_IS_NOT_EXIST.getCode(), ExportInspectionReportReportCodeEnum.REPORT_IS_NOT_EXIST.getMsg());
}

+ 7
- 6
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/road/RoadInformationServiceImpl.java Vedi File

@@ -6,6 +6,7 @@ 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.MarkEnum;
import com.tuoheng.admin.enums.RoleEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.query.RoadInformationQuery;
@@ -63,7 +64,7 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
//获取分页数据
IPage<RoadInformation> page = new Page<>(query.getPage(), query.getLimit());
IPage<RoadInformation> pageData = roadInformationMapper.selectPage(page, Wrappers.<RoadInformation>lambdaQuery()
.eq(RoadInformation::getMark, 1)
.eq(RoadInformation::getMark, MarkEnum.VALID.getCode())
.eq(RoadInformation::getTenantId, tenantId)
.orderByDesc(RoadInformation::getCreateTime));
List<RoadInformation> records = pageData.getRecords();
@@ -87,7 +88,7 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
}
//当前租户下所有公路信息
List<RoadInformation> roadInformationList = roadInformationMapper.selectList(new LambdaQueryWrapper<RoadInformation>()
.eq(RoadInformation::getMark, 1)
.eq(RoadInformation::getMark, MarkEnum.VALID.getCode())
.eq(RoadInformation::getTenantId, tenantId));
List<RoadInformation> list = new ArrayList<>();
for (RoadInformation roadInformation : roadInformationList) {
@@ -139,7 +140,7 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
private boolean getInformationListByCode(RoadInformation entity) {
List<RoadInformation> roadInformationList = roadInformationMapper.selectList(new LambdaQueryWrapper<RoadInformation>()
.eq(RoadInformation::getTenantId, CurrentUserUtil.getTenantId())
.eq(RoadInformation::getMark, 1)
.eq(RoadInformation::getMark, MarkEnum.VALID.getCode())
.eq(RoadInformation::getCode,entity.getCode()));
if(CollectionUtil.isNotEmpty(roadInformationList)){
for (RoadInformation roadInformation : roadInformationList) {
@@ -211,7 +212,7 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
Map<String, Object> map = new HashMap<>();
map.put("tenantId", tenantId);
map.put("roadIdList", roadIdList);
map.put("mark",1);
map.put("mark",MarkEnum.VALID.getCode());
roadInformationList = roadInformationMapper.getListByMap(map);
return roadInformationList;
}
@@ -225,7 +226,7 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
private List<RoadInformation> getAllRoadInformationList(String tenantId) {
List<RoadInformation> roadInformationList = roadInformationMapper.selectList(new LambdaQueryWrapper<RoadInformation>()
.eq(RoadInformation::getTenantId, tenantId)
.eq(RoadInformation::getMark, 1));
.eq(RoadInformation::getMark, MarkEnum.VALID.getCode()));
if (CollectionUtil.isEmpty(roadInformationList)) {
return null;
}
@@ -239,7 +240,7 @@ public class RoadInformationServiceImpl extends BaseServiceImpl<RoadInformationM
*/
private void RoadRelation(RoadInformation roadInformation) {
List<Section> sectionList = sectionMapper.selectList(new LambdaQueryWrapper<Section>()
.eq(Section::getMark, 1)
.eq(Section::getMark, MarkEnum.VALID.getCode())
.eq(Section::getTenantId, CurrentUserUtil.getTenantId())
.eq(Section::getRoadId, roadInformation.getId()));
if (StringUtils.isNotEmpty(sectionList)) {

+ 4
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/road/query/QueryRoadListByDeptIdService.java Vedi File

@@ -6,6 +6,7 @@ import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.entity.Dept;
import com.tuoheng.admin.entity.RoadDept;
import com.tuoheng.admin.entity.RoadInformation;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.road.QueryRoadListByDeptIdCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.mapper.RoadDeptMapper;
@@ -90,7 +91,7 @@ public class QueryRoadListByDeptIdService {
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, id)
.eq(Dept::getMark, 1));
.eq(Dept::getMark, MarkEnum.VALID.getCode()));
if (null == dept) {
return JsonResult.error(QueryRoadListByDeptIdCodeEnum.DEPT_IS_NOT_EXIST.getCode(), QueryRoadListByDeptIdCodeEnum.DEPT_IS_NOT_EXIST.getMsg());
}
@@ -106,7 +107,7 @@ public class QueryRoadListByDeptIdService {
private List<RoadInformation> getAllRoadInformationList(String tenantId) {
List<RoadInformation> roadList = roadInformationMapper.selectList(new LambdaQueryWrapper<RoadInformation>()
.eq(RoadInformation::getTenantId, tenantId)
.eq(RoadInformation::getMark, 1));
.eq(RoadInformation::getMark, MarkEnum.VALID.getCode()));
if (CollectionUtil.isEmpty(roadList)) {
return null;
}
@@ -131,7 +132,7 @@ public class QueryRoadListByDeptIdService {
Map<String, Object> map = new HashMap<>();
map.put("tenantId", tenantId);
map.put("roadIdList", roadIdList);
map.put("mark",1);
map.put("mark",MarkEnum.VALID.getCode());
List<RoadInformation> roadInformationList = roadInformationMapper.getListByMap(map);
return roadInformationList;
}

+ 10
- 9
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/role/RoleServiceImpl.java Vedi File

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.dto.*;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.role.RoleDeleteEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.query.RoleClientQuery;
@@ -81,7 +82,7 @@ public class RoleServiceImpl implements IRoleService {
if (!StringUtils.isEmpty(roleQuery.getRoleName())) {
queryWrapper.like("role_name", roleQuery.getRoleName());
}
queryWrapper.eq("mark", 1);
queryWrapper.eq("mark", MarkEnum.VALID.getCode());
//queryWrapper.orderByAsc("sort");
queryWrapper.orderByAsc("create_time");
queryWrapper.ne("id", "1");
@@ -103,7 +104,7 @@ public class RoleServiceImpl implements IRoleService {
.ne(Role::getId, entity.getId())
.eq(Role::getTenantId, CurrentUserUtil.getTenantId())
.eq(Role::getCode, entity.getCode())
.eq(Role::getMark, 1));
.eq(Role::getMark, MarkEnum.VALID.getCode()));
//当前用户
entity.setUpdateUser(CurrentUserUtil.getUserId());
entity.setUpdateTime(DateUtils.now());
@@ -115,7 +116,7 @@ public class RoleServiceImpl implements IRoleService {
Integer count = roleMapper.selectCount(new LambdaQueryWrapper<Role>()
.eq(Role::getTenantId, CurrentUserUtil.getTenantId())
.eq(Role::getCode, entity.getCode())
.eq(Role::getMark, 1));
.eq(Role::getMark, MarkEnum.VALID.getCode()));
if (count > 0) {
return JsonResult.error("系统中已存在相同的角色编码");
}
@@ -151,12 +152,12 @@ public class RoleServiceImpl implements IRoleService {
//根据roleId查询是否关联的有用户
for (Integer roleId : roleIds) {
List<User> userList = userMapper.selectList(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1).eq(User::getRoleId, roleId));
.eq(User::getMark, MarkEnum.VALID.getCode()).eq(User::getRoleId, roleId));
if(userList.size()>0 && StringUtils.isNotEmpty(userList)){
return JsonResult.error("该角色已经绑定用户,不能删除");
}
Role role = roleMapper.selectById(roleId);
role.setMark(0);
role.setMark(MarkEnum.NOTVALID.getCode());
int result = roleMapper.updateById(role);
if(result<=0){
return JsonResult.error();
@@ -198,7 +199,7 @@ public class RoleServiceImpl implements IRoleService {
queryWrapper.ne("code", "001");
// queryWrapper.eq("tenant_id", CurrentUserUtil.getTenantId());
queryWrapper.eq("status", 1);
queryWrapper.eq("mark", 1);
queryWrapper.eq("mark", MarkEnum.VALID.getCode());
queryWrapper.orderByAsc("create_time");
List<Role> rolesLists = roleMapper.selectList(queryWrapper);

@@ -215,7 +216,7 @@ public class RoleServiceImpl implements IRoleService {
RoleMenuPermissionDto dto = new RoleMenuPermissionDto();
Integer roleId = query.getRoleId();
List<Menu> menuList = menuMapper.selectList(Wrappers.<Menu>lambdaQuery()
.eq(Menu::getMark, 1)
.eq(Menu::getMark, MarkEnum.VALID.getCode())
.eq(Menu::getStatus, 1)
.eq(StringUtils.isNotEmpty(query.getClientId()), Menu::getClientId, query.getClientId())
.orderByAsc(Menu::getSort));
@@ -243,7 +244,7 @@ public class RoleServiceImpl implements IRoleService {
dto.setOpMenusList(collect);
//根基小程序或者pc标识
List<OpPermissions> permissions = opPermissionsMapper.selectList(Wrappers.<OpPermissions>lambdaQuery()
.eq(OpPermissions::getMark, 1)
.eq(OpPermissions::getMark, MarkEnum.VALID.getCode())
.eq(StringUtils.isNotEmpty(query.getClientId()), OpPermissions::getClientId, query.getClientId()));
if(!permissions.isEmpty()){
//获取角色菜单列表
@@ -333,7 +334,7 @@ public class RoleServiceImpl implements IRoleService {
for (Integer id : ids) {
//批量初始化租户对应角色配置
List<Role> roles = roleMapper.selectList(Wrappers.<Role>lambdaQuery()
.eq(Role::getMark, 1).eq(Role::getStatus, 1)
.eq(Role::getMark, MarkEnum.VALID.getCode()).eq(Role::getStatus, 1)
.eq(Role::getTenantId, 1)
.ne(Role::getCode, "super"));
for (Role role : roles) {

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/task/AirportTask.java Vedi File

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.InspectionTypeEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.service.third.airport.AirportService;
import com.tuoheng.common.core.utils.StringUtils;
@@ -40,7 +40,7 @@ public class AirportTask {

log.info("执行定时执行飞行任务:" + LocalDateTime.now());
List<Inspection> inspectionList = inspectionMapper.selectList(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getMark, MarkTypeEnum.VALID.getCode())
.eq(Inspection::getMark, MarkEnum.VALID.getCode())
.between(Inspection::getInspectionTime, startTime, endTime)
//查询巡检方式为机场的任务
.eq(Inspection::getInspectionType, InspectionTypeEnum.AIRPORT.getCode())

+ 24
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/enums/MarkEnum.java Vedi File

@@ -0,0 +1,24 @@
package com.tuoheng.miniprogram.enums;

import lombok.Getter;

/**
* 逻辑删除标记类型
* @author chenyukun
*/
public enum MarkEnum {
VALID(1,"有效"),

NOTVALID(0,"失效");

MarkEnum(int code, String description){
this.code = code;
this.description = description;
}

@Getter
private int code;

@Getter
private String description;
}

+ 2
- 1
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileHandleServiceImpl.java Vedi File

@@ -12,6 +12,7 @@ import com.tuoheng.miniprogram.dao.*;
import com.tuoheng.miniprogram.entity.*;
import com.tuoheng.miniprogram.entity.dto.UploadResultDto;
import com.tuoheng.miniprogram.enums.InspectionFileHandleEnum;
import com.tuoheng.miniprogram.enums.MarkEnum;
import com.tuoheng.miniprogram.enums.ServiceExceptionEnum;
import com.tuoheng.miniprogram.service.IInspectionFileHandleService;
import com.tuoheng.miniprogram.utils.CurrentUserUtil;
@@ -58,7 +59,7 @@ public class InspectionFileHandleServiceImpl implements IInspectionFileHandleSer
return JsonResult.error(InspectionFileHandleEnum.USER_NAME_IS_NULL.getCode(),InspectionFileHandleEnum.USER_NAME_IS_NULL.getMsg());
}
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.eq(User::getMark, 1)
.eq(User::getMark, MarkEnum.VALID.getCode())
.eq(User::getUsername, username));
if(ObjectUtil.isNull(user)){
return JsonResult.error(InspectionFileHandleEnum.USER_IS_NOT_EXIST.getCode(),InspectionFileHandleEnum.USER_IS_NOT_EXIST.getMsg());

Loading…
Annulla
Salva