Przeglądaj źródła

'地图接口'

master
daixiantong 4 lat temu
rodzic
commit
a76c8d789e
6 zmienionych plików z 110 dodań i 1 usunięć
  1. +2
    -1
      src/main/java/com/taauav/admin/mapper/TauvInspectFileMapper.xml
  2. +8
    -0
      src/main/java/com/taauav/admin/service/ITauvInspectFileService.java
  3. +46
    -0
      src/main/java/com/taauav/admin/service/impl/TauvInspectFileServiceImpl.java
  4. +13
    -0
      src/main/java/com/taauav/front/controller/LSAdminController.java
  5. +36
    -0
      src/main/java/com/taauav/front/vo/LSInspectFileDataVo.java
  6. +5
    -0
      src/main/java/com/taauav/front/vo/LsInspectFileVo.java

+ 2
- 1
src/main/java/com/taauav/admin/mapper/TauvInspectFileMapper.xml Wyświetl plik

@@ -43,7 +43,7 @@
<select id="getInspectFileList" resultType="com.taauav.front.vo.LsInspectFileVo">
select f.id, q.id as 'questionId', i.id as 'inspectDriverId', d.id as 'driverId', a.realname as 'driverManagerName',
i.execution_time, f.gaode_latitude as 'latitude', f.gaode_longitude as 'longitude'
i.execution_time, f.gaode_latitude as 'latitude', f.gaode_longitude as 'longitude', d.name as 'driverName'
from tauv_inspect_file as f
left join tauv_question_options as q on f.question_id = q.id
left join tauv_inspect_driver as i on f.inspect_driver_id = i.id
@@ -60,5 +60,6 @@
<if test="param != null and param.beginTime != null and param.beginTime != ''">
and i.execution_time between concat(#{param.beginTime}, ' 00:00:00') and concat(#{param.endTime}, ' 23:59:59')
</if>
order by i.execution_time desc
</select>
</mapper>

+ 8
- 0
src/main/java/com/taauav/admin/service/ITauvInspectFileService.java Wyświetl plik

@@ -3,6 +3,7 @@ package com.taauav.admin.service;
import com.taauav.common.bean.Response;
import com.taauav.admin.entity.TauvInspectFile;
import com.taauav.common.service.IBaseService;
import com.taauav.front.vo.LSInspectFileDataVo;

import java.io.File;
import java.io.IOException;
@@ -134,4 +135,11 @@ public interface ITauvInspectFileService extends IBaseService<TauvInspectFile> {
* @return
*/
TauvInspectFile getInfoByDriverIdAndQuestionId(Integer inspectDriverId, Integer questionId);

/**
* 根据附件id获取数据
* @param fileId
* @return
*/
Response getDetailById(Integer fileId);
}

+ 46
- 0
src/main/java/com/taauav/admin/service/impl/TauvInspectFileServiceImpl.java Wyświetl plik

@@ -13,6 +13,7 @@ import com.taauav.admin.mapper.TauvReportMapper;
import com.taauav.admin.service.*;
import com.taauav.common.service.impl.BaseServiceImpl;
import com.taauav.common.util.*;
import com.taauav.front.vo.LSInspectFileDataVo;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -1096,4 +1097,49 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM
TauvInspectFile fileInfo = getOne(wrapper);
return fileInfo;
}

@Override
public Response getDetailById(Integer fileId) {
LSInspectFileDataVo inspectFileDataVo = new LSInspectFileDataVo();
TauvInspectFile inspectFile = getInfoById(fileId);
if (inspectFile == null) {
return response.failure("问题数据不存在!");
}
inspectFileDataVo.setId(fileId);
inspectFileDataVo.setInspectDriverId(inspectFile.getInspectDriverId());
if (inspectFile.getThumbImg() != null && inspectFile.getThumbImg() != "") {
String path = inspectFile.getThumbImg().replace("_1", "_2");
inspectFileDataVo.setFilePath(uploadUrl + path);
}

TauvInspectDriver inspectDriver = inspectDriverMapper.selectById(inspectFile.getInspectDriverId());
if (inspectDriver != null) {
inspectFileDataVo.setDriverName(inspectDriver.getDriverName());
inspectFileDataVo.setExecutionTime(inspectDriver.getExecutionTime());
String cityText = iSysCityService.getCityName(inspectDriver.getDriverArea());
inspectFileDataVo.setDriverAreaName(cityText);
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("inspect_driver_id", inspectDriver.getId());
wrapper.eq("num", inspectDriver.getNum());
wrapper.eq("mark", 1);
wrapper.eq("status", 3);
wrapper.last("limit 1");
TauvReport report = reportMapper.selectOne(wrapper);
if (report != null) {
inspectFileDataVo.setReportId(report.getId());
}
}
TauvQuestionOptions questionOptions = questionOptionsMapper.selectById(inspectFile.getQuestionId());
if (questionOptions != null) {
Map<Integer, String> categoryList = questionOptions.getCategoryList();
String categoryText = !StringUtils.isEmpty(categoryList.get(questionOptions.getCategory())) ? categoryList.get(questionOptions.getCategory()) : "";
inspectFileDataVo.setCategoryText(categoryText);
Map<Integer, String> typeList = questionOptions.getTypeList();
String typeText = !StringUtils.isEmpty(typeList.get(questionOptions.getType())) ? typeList.get(questionOptions.getType()) : "";
inspectFileDataVo.setQuestionTypeText(typeText);
inspectFileDataVo.setQuestionContent(questionOptions.getContent());
}

return response.success(inspectFileDataVo);
}
}

+ 13
- 0
src/main/java/com/taauav/front/controller/LSAdminController.java Wyświetl plik

@@ -5,6 +5,7 @@ import com.taauav.admin.entity.TauvInspectFile;
import com.taauav.admin.service.ILsAdminService;
import com.taauav.admin.service.ILsAuthGroupService;
import com.taauav.admin.service.ILsCityService;
import com.taauav.admin.service.ITauvInspectFileService;
import com.taauav.common.bean.Response;
import com.taauav.common.util.StringUtils;
import com.taauav.front.dto.LsInspectFileDTO;
@@ -34,6 +35,8 @@ public class LSAdminController extends FrontBaseController {
private ILsAdminService lsAdminService;
@Autowired
private Response response;
@Autowired
private ITauvInspectFileService inspectFileService;

/**
* 获取地图权限内区、镇/街道级数据
@@ -74,4 +77,14 @@ public class LSAdminController extends FrontBaseController {
public Response getQuestionPointList(LsInspectFileDTO inspectFileDTO) {
return lsAdminService.getQuestionList(inspectFileDTO);
}

/**
* 获取问题详情
* @param inspectFileId
* @return
*/
@GetMapping("/detail")
public Response getQuestionDetail(@RequestParam("inspectFileId") Integer inspectFileId) {
return inspectFileService.getDetailById(inspectFileId);
}
}

+ 36
- 0
src/main/java/com/taauav/front/vo/LSInspectFileDataVo.java Wyświetl plik

@@ -0,0 +1,36 @@
package com.taauav.front.vo;

import lombok.Data;

import java.util.Date;

/**
* @author daixiantong
*/
@Data
public class LSInspectFileDataVo {

private Integer id;

private Integer driverId;

private Integer inspectDriverId;

private Integer reportId;

private String driverName;

private String driverAreaName;

private Date executionTime;

private String categoryText;

private String questionTypeText;

private String questionContent;

private String filePath;


}

+ 5
- 0
src/main/java/com/taauav/front/vo/LsInspectFileVo.java Wyświetl plik

@@ -28,6 +28,11 @@ public class LsInspectFileVo {
*/
private Integer inspectDriverId;

/**
* 河湖名称
*/
private String driverName;

/**
* 河长姓名
*/

Ładowanie…
Anuluj
Zapisz