Browse Source

gis接口及问题核实接口

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
a6b320e059
7 changed files with 162 additions and 3 deletions
  1. +17
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/QuestionTypeController.java
  2. +41
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/QuestionType.java
  3. +11
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/QuestionTypeMapper.java
  4. +8
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/IQuestionTypeService.java
  5. +61
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/InspectionFileServiceImpl.java
  6. +14
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionTypeServiceImpl.java
  7. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/QuestionTypeMapper.xml

+ 17
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/QuestionTypeController.java View File

@@ -0,0 +1,17 @@
package com.tuoheng.admin.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @Author ChengWang
* @Date 2022/11/29
*/
@RestController
@RequestMapping("/questionType")
public class QuestionTypeController {




}

+ 41
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/QuestionType.java View File

@@ -0,0 +1,41 @@
package com.tuoheng.admin.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.core.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
* @Author ChengWang
* @Date 2022/11/29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("th_question_type")
public class QuestionType extends BaseEntity {
private static final long serialVersionUID = 1L;

/**
*编号
*/
private String code;

/**
* 类型名称:1坑槽 2积水 3裂纹
*/
private Integer name;

/**
* 巡检内容
*/
private String content;

/**
* 排序
*/
private Integer sort;


}

+ 11
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/QuestionTypeMapper.java View File

@@ -0,0 +1,11 @@
package com.tuoheng.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuoheng.admin.entity.QuestionType;

/**
* @Author ChengWang
* @Date 2022/11/29
*/
public interface QuestionTypeMapper extends BaseMapper<QuestionType> {
}

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

@@ -0,0 +1,8 @@
package com.tuoheng.admin.service;

/**
* @Author ChengWang
* @Date 2022/11/29
*/
public interface IQuestionTypeService {
}

+ 61
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/InspectionFileServiceImpl.java View File

@@ -1,13 +1,28 @@
package com.tuoheng.admin.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionFile;
import com.tuoheng.admin.entity.QuestionType;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.mapper.QuestionTypeMapper;
import com.tuoheng.admin.service.IInspectionFileService;
import com.tuoheng.admin.utils.ShiroUtils;
import com.tuoheng.admin.vo.InspectionFileVo;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
* 任务问题管理 前端控制器
*
@@ -24,17 +39,60 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
@Autowired
private InspectionMapper inspectionMapper;

@Autowired
private QuestionTypeMapper questionTypeMapper;


/**
* 问题类型和任务名称
*
* @return
*/
@Override
public JsonResult getQuestionList() {
//String tenantId = ShiroUtils.getTenantId();
String tenantId = "0";
//查询区域范范围问题
List<InspectionFile> inspectionFileLists = new ArrayList<>();
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getMark, 1)
.eq(InspectionFile::getTenantId, tenantId));
if (null == inspectionFileList) {
return JsonResult.error("该覆盖区域范围内没有问题");
}
for (InspectionFile inspectionFile : inspectionFileList) {
//任务状态判断
Inspection inspection = inspectionMapper.selectById(inspectionFile.getInspectionId());
if (ObjectUtil.isNull(inspection)) {
JsonResult.error("问题所属的任务不存在");
}
//任务状态判断,已生成工单,问题未解决
Integer status = inspection.getStatus();
if (20 == status) {
inspectionFileLists.add(inspectionFile);
}
}
List<InspectionFileVo> list = inspectionFileLists.stream().map(x -> {
InspectionFileVo vo = new InspectionFileVo();
BeanUtils.copyProperties(x, vo);
//任务名称
if (StringUtils.isNotEmpty(x.getInspectionId())) {
Inspection inspection = inspectionMapper.selectById(x.getInspectionId());
if (ObjectUtil.isNull(inspection)) {
JsonResult.error();
}
vo.setName(inspection.getName());
//问题类型
if (StringUtils.isNotEmpty(x.getQuestionId())) {
QuestionType questionType = questionTypeMapper.selectById(x.getQuestionId());
if (null != questionType) {
vo.setType(questionType.getName());
}
}
}



return null;
return vo;
}).collect(Collectors.toList());
return JsonResult.success(list);
}
}

+ 14
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionTypeServiceImpl.java View File

@@ -0,0 +1,14 @@
package com.tuoheng.admin.service.impl;

import com.tuoheng.admin.service.IQuestionTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
* @Author ChengWang
* @Date 2022/11/29
*/
@Service
@Slf4j
public class QuestionTypeServiceImpl implements IQuestionTypeService {
}

+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/resources/mapper/QuestionTypeMapper.xml View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tuoheng.admin.mapper.QuestionTypeMapper">




</mapper>

Loading…
Cancel
Save