Browse Source

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_freeway into feature_v1.0

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
92236aef83
21 changed files with 211 additions and 126 deletions
  1. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AirPortController.java
  2. +4
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/DeptController.java
  3. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java
  4. +49
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/QueryInspectionByIdCodeEnum.java
  5. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/QueryInspectionPageListCodeEnum.java
  6. +8
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/DeptMapper.java
  7. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/dept/QueryDeptChildPageListRequest.java
  8. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/AddInspectionRequest.java
  9. +7
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/QueryInspectionPageListRequest.java
  10. +5
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/AirportServiceImpl.java
  11. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/DeptServiceImpl.java
  12. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/IDeptService.java
  13. +10
    -27
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/query/QueryChildListService.java
  14. +7
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/InspectionServiceImpl.java
  15. +16
    -43
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionByIdService.java
  16. +73
    -25
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java
  17. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/ExecuteHandle.java
  18. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/LiveHandle.java
  19. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/ResubmitHandle.java
  20. +9
    -0
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/DeptMapper.xml
  21. +7
    -6
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/InspectionMapper.xml

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AirPortController.java View File

@@ -35,7 +35,7 @@ public class AirPortController {
* @param droneId 机场列表里面的droneId
* @return
*/
@GetMapping("/line/{droneId}")
@GetMapping("/line/list/{droneId}")
public JsonResult getAirLineList(@PathVariable("droneId") Integer droneId) {
return airportService.getAirLineList(droneId);
}

+ 4
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/DeptController.java View File

@@ -39,10 +39,10 @@ public class DeptController {
/**
* 根据id查询子部门列表
*/
@GetMapping("/child/page/list/{id}")
public JsonResult getChildList(@RequestBody QueryDeptChildPageListRequest queryDeptChildPageListRequest) {
log.info("进入获取子部门分页列表列表接口, id:{}", queryDeptChildPageListRequest.getId());
return deptService.getChildPageList(queryDeptChildPageListRequest);
@GetMapping("/child/list/{id}")
public JsonResult getChildList(@PathVariable("id") String id) {
log.info("进入获取子部门分页列表列表接口, id:{}", id);
return deptService.getChildList(id);
}

/**

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java View File

@@ -29,8 +29,8 @@ public class InspectionController {
* 查询巡检任务分页列表
*/
@GetMapping("/page/list")
public JsonResult list(QueryInspectionPageListRequest request) {
log.info("进入查询巡检任务分页列表");
public JsonResult list(@RequestBody QueryInspectionPageListRequest request) {
log.info("进入查询巡检任务分页列表接口");
return iInspectionService.selectPageList(request);
}


+ 49
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/QueryInspectionByIdCodeEnum.java View File

@@ -0,0 +1,49 @@
package com.tuoheng.admin.enums.code.inspection;

/**
* 查询巡检任务详情返回码
* 模块代码:23(公路管理)
* 接口代码:05 (查询巡检任务详情)
*
* @author wanjing
* @team tuoheng
* @date 2022-11-24
*/
public enum QueryInspectionByIdCodeEnum {

QUERY_IS_FAILED(1230500, "获取数据失败"),
INSPECTION_ID_IS_NULL(1230501, "任务id为空"),
INSPECTION_IS_NOT_EXIST(1230502, "任务不存在");

/**
* 错误码
*/
private int code;

/**
* 错误信息
*/
private String msg;

QueryInspectionByIdCodeEnum(int code, String msg){
this.code = code;
this.msg = msg;
}

public int getCode() {
return code;
}

public void setCode(int code) {
this.code = code;
}

public String getMsg() {
return msg;
}

public void setMsg(String msg) {
this.msg = msg;
}

}

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/QueryInspectionPageListCodeEnum.java View File

@@ -3,7 +3,7 @@ package com.tuoheng.admin.enums.code.inspection;
/**
* 查询巡检任务分页列表返回码
* 模块代码:23(公路管理)
* 接口代码:04 (根据部门id获取该部门下公路列表)
* 接口代码:04 (查询巡检任务分页列表)
*
* @author wanjing
* @team tuoheng

+ 8
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/DeptMapper.java View File

@@ -22,6 +22,14 @@ public interface DeptMapper extends BaseMapper<Dept> {
*/
List<String> selectAllChildListById(String id);

/**
* 通过部门idList,查找部门列表
*
* @param idList 部门id列表
* @return 结果
*/
List<Dept> selectListByIdList(List<String> idList);

/**
* 修改部门
*

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/dept/QueryDeptChildPageListRequest.java View File

@@ -15,7 +15,7 @@ import java.util.List;
* @date 2022-11-22
*/
@Data
public class QueryDeptChildPageListRequest extends BaseQuery {
public class QueryDeptChildPageListRequest {

private static final long serialVersionUID = 1L;


+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/AddInspectionRequest.java View File

@@ -74,7 +74,7 @@ public class AddInspectionRequest {
private String sectionName;

/**
* 是否实时,1:实时 2:离线 默认:null
* 是否直播,1:实时 2:离线 默认:null
*/
private Integer isLive;


+ 7
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/QueryInspectionPageListRequest.java View File

@@ -3,6 +3,8 @@ package com.tuoheng.admin.request.inspection;
import com.tuoheng.common.core.common.BaseQuery;
import lombok.Data;

import java.util.List;

/**
* 查询巡检任务请求实体
*
@@ -68,4 +70,9 @@ public class QueryInspectionPageListRequest extends BaseQuery {
*/
private String deptId;

/**
* 部门及子部门Id列表
*/
private List<String> deptIdList;

}

+ 5
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airport/AirportServiceImpl.java View File

@@ -18,6 +18,9 @@ import java.util.Objects;
@Service
public class AirportServiceImpl implements AirportService {

private final static String API_AIRPORT_LIST = "/api/airportInterface/airportList";
private final static String API_AIRPORT_LINE_LIST = "/api/airportInterface/taskByDroneId";

@Autowired
private TenantMapper tenantMapper;

@@ -34,7 +37,7 @@ public class AirportServiceImpl implements AirportService {
return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg());
}

String url = tenant.getAirportUrl() + "/api/airportInterface/airportList";
String url = tenant.getAirportUrl() + API_AIRPORT_LIST;
String param = "page=1&limit=10";
String airPortStr = HttpUtils.sendGet(url, param);

@@ -57,7 +60,7 @@ public class AirportServiceImpl implements AirportService {
return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg());
}

String url = tenant.getAirportUrl() + "/api/airportInterface/taskByDroneId";
String url = tenant.getAirportUrl() + API_AIRPORT_LINE_LIST;
String param = "page=1&limit=100&droneId=" + droneId;
String airPortStr = HttpUtils.sendGet(url, param);
JsonResult<AirLineVO> jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class);

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/DeptServiceImpl.java View File

@@ -64,8 +64,8 @@ public class DeptServiceImpl implements IDeptService {
* @return 部门
*/
@Override
public JsonResult getChildPageList(QueryDeptChildPageListRequest queryDeptChildPageListRequest) {
return queryChildListService.getChildPageList(queryDeptChildPageListRequest);
public JsonResult getChildList(String id) {
return queryChildListService.getChildList(id);
}
/**

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/IDeptService.java View File

@@ -37,7 +37,7 @@ public interface IDeptService {
*
* @return 部门集合
*/
JsonResult getChildPageList(QueryDeptChildPageListRequest queryDeptChildPageListRequest);
JsonResult getChildList(String id);
/**

+ 10
- 27
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/dept/query/QueryChildListService.java View File

@@ -38,45 +38,29 @@ public class QueryChildListService {
*
* @return
*/
public JsonResult getChildPageList(QueryDeptChildPageListRequest queryDeptChildPageListRequest) {
public JsonResult getChildList(String deptId) {
log.info("进入查询子部门列表业务");
String tenantId = ShiroUtils.getTenantId();
String deptId = queryDeptChildPageListRequest.getId();

JsonResult result = this.check(tenantId, deptId);
JsonResult result = this.check(deptId);
if (0 != result.getCode()) {
log.info("根据id查询子部门列表业务:校验失败:{}", result.getMsg());
return result;
}

// 查询所有有效的子部门数据
IPage<Dept> page = new Page<>(queryDeptChildPageListRequest.getPage(), queryDeptChildPageListRequest.getLimit());
IPage<Dept> pageData = deptMapper.selectPage(page, Wrappers.<Dept>lambdaQuery()
.eq(Dept::getMark, 1)
.eq(Dept::getTenantId, tenantId)
.orderByDesc(Dept::getCreateTime));
List<Dept> deptList = pageData.getRecords();
List<Dept> list = new ArrayList<>();
for (Dept record : deptList) {
list.add(record);
}
pageData.setRecords(list);

if (CollectionUtil.isEmpty(deptList)) {
log.info("获取子部门列表为空");
return JsonResult.error(QueryDeptChildListCodeEnum.DEPT_LIST_IS_NULL.getCode(), QueryDeptChildListCodeEnum.DEPT_LIST_IS_NULL.getMsg());
List<String> deptIdList = deptMapper.selectAllChildListById(deptId);
if (CollectionUtil.isEmpty(deptIdList)) {
log.info("获取部门列表为空");
return JsonResult.error(QueryDeptChildListCodeEnum.DEPT_LIST_IS_FAILED.getCode(), QueryDeptChildListCodeEnum.DEPT_LIST_IS_FAILED.getMsg());
}
return JsonResult.success(pageData);
List<Dept> deptList = deptMapper.selectListByIdList(deptIdList);
return JsonResult.success(deptList);
}

/**
* 检查参数
* @param tenantId
*
* @param id
* @return
*/
private JsonResult check(String tenantId, String id) {
private JsonResult check(String id) {
// 判断id是否为空
if (StringUtils.isEmpty(id)) {
return JsonResult.error(QueryDeptChildListCodeEnum.DEPT_ID_IS_NULL.getCode(), QueryDeptChildListCodeEnum.DEPT_ID_IS_NULL.getMsg());
@@ -84,7 +68,6 @@ public class QueryChildListService {

// 判断部门是否存在
Integer count = deptMapper.selectCount(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, id)
.eq(Dept::getMark, 1));
if (count <= 0) {

+ 7
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/InspectionServiceImpl.java View File

@@ -9,6 +9,7 @@ import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest;
import com.tuoheng.admin.service.inspection.add.AddInspectionService;
import com.tuoheng.admin.service.inspection.delete.DeleteInspectionService;

import com.tuoheng.admin.service.inspection.query.QueryInspectionByIdService;
import com.tuoheng.admin.service.inspection.query.QueryInspectionListService;
import com.tuoheng.admin.service.inspection.query.QueryInspectionPageListService;
import com.tuoheng.admin.service.inspection.query.QueryVideoService;
@@ -30,12 +31,16 @@ import java.util.List;
@Slf4j
@Service
public class InspectionServiceImpl implements IInspectionService {

@Autowired
private InspectionMapper inspectionMapper;

@Autowired
private QueryInspectionPageListService queryInspectionPageListService;

@Autowired
private QueryInspectionByIdService queryInspectionByIdService;

@Autowired
private AddInspectionService addinspectionService;

@@ -63,15 +68,14 @@ public class InspectionServiceImpl implements IInspectionService {
}

/**
* 查询巡检任务
* 查询巡检任务详情
*
* @param id 巡检任务id
* @return 巡检任务
*/
@Override
public JsonResult selectOneById(String id) {

return JsonResult.success();
return queryInspectionByIdService.getInfo(id);
}

/**

+ 16
- 43
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionByIdService.java View File

@@ -1,22 +1,17 @@
package com.tuoheng.admin.service.inspection.query;

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.code.inspection.QueryInspectionPageListCodeEnum;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionByIdCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.utils.ShiroUtils;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 根据Id查询巡检任务详情业务层处理
*
@@ -37,59 +32,37 @@ public class QueryInspectionByIdService {

public JsonResult getInfo(String id) {
log.info("进入查询巡检任务详情业务");

String userId = ShiroUtils.getUserId();
String tenantId = ShiroUtils.getTenantId();

JsonResult result = this.check(tenantId, id);
JsonResult result = this.check(id);
if (0 != result.getCode()) {
log.info("进入查询巡检任务详情业务:校验失败:{}", result.getMsg());
return result;
}

Integer confirmedProblemCount = 0;
Integer discoverProblemCount = 0;
Inspection inspection = (Inspection) result.getData();

List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>()
.eq(InspectionFile::getTenantId, tenantId)
.eq(InspectionFile::getInspectionId,id)
.eq(InspectionFile::getMark, 1));

if (CollectionUtil.isEmpty(inspectionFileList)) {
discoverProblemCount = inspectionFileList.size();
for (InspectionFile inspectionFile : inspectionFileList) {
if (InspectionFileStatusEnum.CONFIRMED.getCode() == inspectionFile.getStatus()) {
confirmedProblemCount++;
}
}
}

// inspectionVo.setConfirmedProblemCount(confirmedProblemCount);
// inspectionVo.setDiscoverProblemCount(discoverProblemCount);
return JsonResult.success();
}

/**
* 检查参数
* @param tenantId
* @param id
* @return
*/
private JsonResult check(String tenantId, String id) {
// 判断部门id是否为空
private JsonResult check(String id) {
// 判断任务id是否为空
if (StringUtils.isEmpty(id)) {
return JsonResult.error(QueryInspectionPageListCodeEnum.DEPT_ID_IS_NULL.getCode(), QueryInspectionPageListCodeEnum.DEPT_ID_IS_NULL.getMsg());
return JsonResult.error(QueryInspectionByIdCodeEnum.INSPECTION_ID_IS_NULL.getCode(), QueryInspectionByIdCodeEnum.INSPECTION_ID_IS_NULL.getMsg());
}

// // 判断部门是否存在
// Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
// .eq(Dept::getTenantId, tenantId)
// .eq(Dept::getId, queryInspectionRequest.getDeptId())
// .eq(Dept::getMark, 1));
// if (null == dept) {
// return JsonResult.error(QueryInspectionPageListCodeEnum.DEPT_IS_NOT_EXIST.getCode(), QueryInspectionPageListCodeEnum.DEPT_IS_NOT_EXIST.getMsg());
// }
return JsonResult.success();
// 判断任务是否存在
Inspection inspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getId, id)
.eq(Inspection::getMark, 1));
if (null == inspection) {
return JsonResult.error(QueryInspectionByIdCodeEnum.INSPECTION_IS_NOT_EXIST.getCode(), QueryInspectionByIdCodeEnum.INSPECTION_IS_NOT_EXIST.getMsg());
}
return JsonResult.success(inspection);
}

}

+ 73
- 25
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java View File

@@ -1,15 +1,17 @@
package com.tuoheng.admin.service.inspection.query;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.InspectionTypeEnum;
import com.tuoheng.admin.enums.UserTypeEnum;
import com.tuoheng.admin.enums.code.inspection.AddInspectionCodeEnum;
import com.tuoheng.admin.enums.code.dept.QueryDeptChildListCodeEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionPageListCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
@@ -19,16 +21,18 @@ import com.tuoheng.admin.service.inspection.query.handle.GenerateInspectionField
import com.tuoheng.admin.utils.ShiroUtils;
import com.tuoheng.admin.vo.InspectionVo;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;

/**
* 查询巡检任务分页列表业务层处理
* 查询巡检任务分页列表业务层处理
*
* @author wanjing
* @team tuoheng
@@ -87,13 +91,13 @@ public class QueryInspectionPageListService {
problemCountHandle.setNextHandler(resubmitHandle);
}

public JsonResult getPageList(QueryInspectionPageListRequest queryInspectionRequest) {
public JsonResult getPageList(QueryInspectionPageListRequest request) {
log.info("进入查询巡检任务分页列表业务");

String userId = ShiroUtils.getUserId();
String tenantId = ShiroUtils.getTenantId();

JsonResult result = this.check(tenantId, queryInspectionRequest);
JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
log.info("进入查询巡检任务分页列表业务:校验失败:{}", result.getMsg());
return result;
@@ -109,38 +113,37 @@ public class QueryInspectionPageListService {
.eq(Dept::getId, user.getDeptId())
.eq(Dept::getMark, 1));

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

// if (InspectionTypeEnum.MABNNEDFLIGHT.getCode() == queryInspectionRequest.getInspectionType()) {
// queryInspectionRequest.setAirportId(0);
// queryInspectionRequest.setInspectionLine(0);
// }

// 获取本部门及子孙部门id列表
List<String> deptIdList = deptMapper.selectAllChildListById(queryInspectionRequest.getDeptId());

// 设置分页参数
IPage<Inspection> page = new Page<>(queryInspectionRequest.getPage(), queryInspectionRequest.getLimit());

// 查询结果
IPage<Inspection> pageData = inspectionMapper.selectPageList(page, queryInspectionRequest);

List<Inspection> inspectionList = pageData.getRecords();
if (null == pageData || pageData.getTotal() == 0) {
log.info("获取任务分页列表为空");
return JsonResult.error(QueryInspectionPageListCodeEnum.QUERY_IS_FAILED.getCode(), QueryInspectionPageListCodeEnum.QUERY_IS_FAILED.getMsg());
}

List<InspectionVo> inspectionVoList = buildIspectionVoList(user, dept, inspectionList);
// 构造返回结果对象
List<InspectionVo> inspectionVoList = buildIspectionVoList(user, dept, pageData.getRecords());

// 重写返回结果对象
IPage<InspectionVo> inspectionVoPageData = new Page<>();
inspectionVoPageData.setPages(pageData.getPages());
inspectionVoPageData.setCurrent(pageData.getCurrent());
inspectionVoPageData.setSize(pageData.getSize());
inspectionVoPageData.setTotal(pageData.getTotal());
inspectionVoPageData.setRecords(inspectionVoList);

return JsonResult.success(inspectionVoList);
return JsonResult.success(inspectionVoPageData);
}

/**
* 检查参数
*
* @param tenantId
* @param queryInspectionRequest
* @return
@@ -162,6 +165,51 @@ public class QueryInspectionPageListService {
return JsonResult.success();
}

/**
* 超级管理员可查全部的任务
*
* @param request
* @return
*/
private IPage<Inspection> getAllList(QueryInspectionPageListRequest request) {
// 设置分页参数
IPage<Inspection> page = new Page<>(request.getPage(), request.getLimit());
// 查询结果
IPage<Inspection> pageData = inspectionMapper.selectPageList(page, request);
return pageData;
}

/**
* 管理员和普通用户可查本部门及子部门的任务
* 1)、如果前端检索条件,传了部门Id,则根据deptId来查
* 2)、如果前端检索条件,部门Id为空,则表示查本部门及子部门的任务
*
* @param request
* @return
*/
private IPage<Inspection> getListByDept(QueryInspectionPageListRequest request) {
// 获取本部门及子孙部门id列表
if (StringUtils.isEmpty(request.getDeptId())) {
List<String> deptIdList = deptMapper.selectAllChildListById(request.getDeptId());
request.setDeptIdList(deptIdList);
}

// 设置分页参数
IPage<Inspection> page = new Page<>(request.getPage(), request.getLimit());
// 查询结果
IPage<Inspection> pageData = inspectionMapper.selectPageList(page, request);
return pageData;
}

/**
* 1)、查找已确认问题数、发现问题数字段
* 2)、判断是否有操作权限:立即执行、直播、回放、问题详情、问题核实、重新提交
*
* @param user
* @param dept
* @param inspectionList
* @return
*/
private List<InspectionVo> buildIspectionVoList(User user, Dept dept, List<Inspection> inspectionList) {
List<InspectionVo> inspectionVoList = InspectionConverMapper.INSTANCE.fromInspectionListToInspectionVoList(inspectionList);
for (InspectionVo inspectionVo : inspectionVoList) {

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

@@ -34,15 +34,15 @@ public class ExecuteHandle implements GenerateInspectionFieldHander {
if (InspectionStatusEnum.WAIT_FLIGHT.getCode() != inspectionVo.getStatus()) {
if (null != handler) {
handler.handler(user, dept, inspectionVo);
return;
}
return;
}

if (InspectionTypeEnum.AIRPORT.getCode() != inspectionVo.getInspectionType()) {
if (null != handler) {
handler.handler(user, dept, inspectionVo);
return;
}
return;
}

if (UserTypeEnum.ADMIN.getCode() == user.getType()) {

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/LiveHandle.java View File

@@ -33,17 +33,17 @@ public class LiveHandle implements GenerateInspectionFieldHander {
if (InspectionStatusEnum.IN_FLIGHT.getCode() != inspectionVo.getStatus()) {
if (null != handler) {
handler.handler(user, dept, inspectionVo);
return;
}
return;
}
if (InspectionTypeEnum.MABNNEDFLIGHT.getCode() != inspectionVo.getInspectionType()) {
if (null != handler) {
handler.handler(user, dept, inspectionVo);
return;
}
return;
}

if (1 == inspectionVo.getIsLive()) {
if (null != inspectionVo.getIsLive() && 1 == inspectionVo.getIsLive()) {
inspectionVo.setLive(true);
}


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

@@ -32,14 +32,14 @@ public class ResubmitHandle implements GenerateInspectionFieldHander {
if (InspectionStatusEnum.FLIGHT_FAILED.getCode() != inspectionVo.getStatus()) {
if (null != handler) {
handler.handler(user, dept, inspectionVo);
return;
}
return;
}
if (InspectionTypeEnum.AIRPORT.getCode() != inspectionVo.getInspectionType()) {
if (null != handler) {
handler.handler(user, dept,inspectionVo);
return;
}
return;
}
inspectionVo.setResubmit(true);
if (null != handler) {

+ 9
- 0
tuoheng-service/tuoheng-admin/src/main/resources/mapper/DeptMapper.xml View File

@@ -35,6 +35,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
join th_dept u2 on find_in_set(u2.id, convert(u1.p_ids using utf8) collate utf8_unicode_ci)
</select>

<select id="selectListByIdList" parameterType="list" resultMap="DeptResult">
select <include refid="Base_Column_List"/>
from th_dept
where mark = 1 and id in
<foreach collection="list" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</select>

<update id="update" parameterType="com.tuoheng.admin.entity.Dept">
update th_dept
<trim prefix="SET" suffixOverrides=",">

+ 7
- 6
tuoheng-service/tuoheng-admin/src/main/resources/mapper/InspectionMapper.xml View File

@@ -89,12 +89,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if>
<if test="request.status != null and request.status != 0"> and status = #{request.status} </if>
<if test="request.inspectionType != null and request.inspectionType != 0"> and inspection_type = #{request.inspectionType} </if>
<!-- <if test="request.name != null and request.name != ''">-->
<!-- and dept_id in-->
<!-- <foreach item="id" collection="array" open="(" separator="," close=")">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="request.deptId != null and request.deptId != ''"> and dept_id = #{request.deptId} </if>
<if test="request.deptIdList != null and request.deptIdList.size() > 0">
and dept_id in
<foreach item="deptId" collection="request.deptIdList" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
</where>
</select>


Loading…
Cancel
Save