Commit 844789d2 authored by 王晓倩's avatar 王晓倩

地图隐患信息列表接口调整

parent 7a637053
...@@ -55,7 +55,7 @@ public class THiddenTroubleController extends BaseController ...@@ -55,7 +55,7 @@ public class THiddenTroubleController extends BaseController
@GetMapping("/getMapHiddenTroublelist") @GetMapping("/getMapHiddenTroublelist")
public AjaxResult getMapHiddenTroublelist() public AjaxResult getMapHiddenTroublelist()
{ {
List<THiddenTrouble> list = tHiddenTroubleService.getMapTHiddenTroubleList(); List<HiddenTroubleVo> list = tHiddenTroubleService.getMapTHiddenTroubleList();
return AjaxResult.success(list); return AjaxResult.success(list);
} }
......
...@@ -3,6 +3,7 @@ package com.zehong.system.domain.vo; ...@@ -3,6 +3,7 @@ package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel; import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity; import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TOrderFeedback;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
...@@ -45,7 +46,7 @@ public class HiddenTroubleVo extends BaseEntity ...@@ -45,7 +46,7 @@ public class HiddenTroubleVo extends BaseEntity
private Date allotTime; private Date allotTime;
/** 反馈信息列表 */ /** 反馈信息列表 */
private List<OrderFeedbackVo> feedbackList; private List<TOrderFeedback> feedbackList;
/** 设备id */ /** 设备id */
@Excel(name = "设备id") @Excel(name = "设备id")
...@@ -165,11 +166,11 @@ public class HiddenTroubleVo extends BaseEntity ...@@ -165,11 +166,11 @@ public class HiddenTroubleVo extends BaseEntity
this.allotTime = allotTime; this.allotTime = allotTime;
} }
public List<OrderFeedbackVo> getFeedbackList() { public List<TOrderFeedback> getFeedbackList() {
return feedbackList; return feedbackList;
} }
public void setFeedbackList(List<OrderFeedbackVo> feedbackList) { public void setFeedbackList(List<TOrderFeedback> feedbackList) {
this.feedbackList = feedbackList; this.feedbackList = feedbackList;
} }
......
...@@ -34,7 +34,7 @@ public interface ITHiddenTroubleService ...@@ -34,7 +34,7 @@ public interface ITHiddenTroubleService
* @param * @param
* @return 隐患信息集合 * @return 隐患信息集合
*/ */
public List<THiddenTrouble> getMapTHiddenTroubleList(); public List<HiddenTroubleVo> getMapTHiddenTroubleList();
/** /**
* 新增隐患信息 * 新增隐患信息
......
...@@ -3,16 +3,17 @@ package com.zehong.system.service.impl; ...@@ -3,16 +3,17 @@ package com.zehong.system.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.zehong.common.core.domain.entity.SysDictData;
import com.zehong.common.core.domain.entity.SysUser; import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TPipe; import com.zehong.system.domain.*;
import com.zehong.system.domain.vo.HiddenTroubleVo; import com.zehong.system.domain.vo.HiddenTroubleVo;
import com.zehong.system.mapper.*; import com.zehong.system.mapper.*;
import com.zehong.system.service.ISysDictTypeService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.domain.THiddenTrouble;
import com.zehong.system.service.ITHiddenTroubleService; import com.zehong.system.service.ITHiddenTroubleService;
/** /**
...@@ -36,6 +37,8 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService ...@@ -36,6 +37,8 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService
private TWorkOrderMapper tWorkOrderMapper; private TWorkOrderMapper tWorkOrderMapper;
@Autowired @Autowired
private TOrderFeedbackMapper tOrderFeedbackMapper; private TOrderFeedbackMapper tOrderFeedbackMapper;
@Autowired
private ISysDictTypeService iSysDictTypeService;
/** /**
* 查询隐患信息 * 查询隐患信息
...@@ -44,12 +47,42 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService ...@@ -44,12 +47,42 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService
* @return 隐患信息 * @return 隐患信息
*/ */
@Override @Override
public HiddenTroubleVo selectTHiddenTroubleById(int troubleId) public HiddenTroubleVo selectTHiddenTroubleById(int troubleId) throws Exception
{ {
HiddenTroubleVo hiddenTroubleVo = new HiddenTroubleVo(); HiddenTroubleVo hiddenTroubleVo = new HiddenTroubleVo();
THiddenTrouble tHiddenTrouble = tHiddenTroubleMapper.selectTHiddenTroubleById(troubleId); THiddenTrouble tHiddenTrouble = tHiddenTroubleMapper.selectTHiddenTroubleById(troubleId);
BeanUtils.copyProperties(tHiddenTrouble, hiddenTroubleVo); BeanUtils.copyProperties(tHiddenTrouble, hiddenTroubleVo);
SysUser sysUser = sysUserMapper.selectUserById(tHiddenTrouble.getReportMan());
hiddenTroubleVo.setReportManName(sysUser.getNickName());
if (StringUtils.isNotEmpty(tHiddenTrouble.getTroubleType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_trouble_type");
for (SysDictData sysDictData : sysDictDataList) {
if (tHiddenTrouble.getTroubleType().equals(sysDictData.getDictValue())) {
hiddenTroubleVo.setTroubleType(sysDictData.getDictLabel());
}
}
}
if (StringUtils.isNotEmpty(tHiddenTrouble.getTroubleLevel())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_trouble_level");
for (SysDictData sysDictData : sysDictDataList) {
if (tHiddenTrouble.getTroubleLevel().equals(sysDictData.getDictValue())) {
hiddenTroubleVo.setTroubleLevel(sysDictData.getDictLabel());
}
}
}
if (StringUtils.isNotEmpty(tHiddenTrouble.getDealStatus())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_deal_status");
for (SysDictData sysDictData : sysDictDataList) {
if(tHiddenTrouble.getDealStatus() == null){
hiddenTroubleVo.setDealStatus("暂未处理");
} else if (tHiddenTrouble.getDealStatus().equals(sysDictData.getDictValue())) {
hiddenTroubleVo.setDealStatus(sysDictData.getDictLabel());
}
}
}
if(tHiddenTrouble.getDeviceId() != null){ if(tHiddenTrouble.getDeviceId() != null){
if("0".equals(tHiddenTrouble.getDeviceType())){ if("0".equals(tHiddenTrouble.getDeviceType())){
TPipe pipe = tPipeMapper.selectTPipeById(tHiddenTrouble.getDeviceId()); TPipe pipe = tPipeMapper.selectTPipeById(tHiddenTrouble.getDeviceId());
...@@ -59,6 +92,20 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService ...@@ -59,6 +92,20 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService
hiddenTroubleVo.setDeviceName(device.getDeviceName()); hiddenTroubleVo.setDeviceName(device.getDeviceName());
} }
} }
if(tHiddenTrouble.getOrderId() != null && !"".equals(tHiddenTrouble.getOrderId())) {
TWorkOrder tWorkOrder = tWorkOrderMapper.selectTWorkOrderById(tHiddenTrouble.getOrderId());
hiddenTroubleVo.setAllotTime(tWorkOrder.getAllotTime());
// 获取巡检员姓名
SysUser appointInspector = sysUserMapper.selectUserById(tWorkOrder.getAppointInspector());
hiddenTroubleVo.setAppointInspectorName(appointInspector.getNickName());
List<TOrderFeedback> orderFeedbackList = tOrderFeedbackMapper.selectTOrderFeedbackByOrderId(tHiddenTrouble.getOrderId());
if(orderFeedbackList.size() != 0){
hiddenTroubleVo.setFeedbackList(orderFeedbackList);
}
}
return hiddenTroubleVo; return hiddenTroubleVo;
} }
...@@ -80,8 +127,26 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService ...@@ -80,8 +127,26 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService
BeanUtils.copyProperties(trouble, hiddenTroubleVo); BeanUtils.copyProperties(trouble, hiddenTroubleVo);
SysUser sysUser = sysUserMapper.selectUserById(trouble.getReportMan()); SysUser sysUser = sysUserMapper.selectUserById(trouble.getReportMan());
hiddenTroubleVo.setReportManName(sysUser.getNickName()); if(sysUser != null) {
hiddenTroubleVo.setReportManName(sysUser.getNickName());
}
if (StringUtils.isNotEmpty(trouble.getTroubleType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_trouble_type");
for (SysDictData sysDictData : sysDictDataList) {
if (trouble.getTroubleType().equals(sysDictData.getDictValue())) {
hiddenTroubleVo.setTroubleType(sysDictData.getDictLabel());
}
}
}
if (StringUtils.isNotEmpty(trouble.getTroubleLevel())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_trouble_level");
for (SysDictData sysDictData : sysDictDataList) {
if (trouble.getTroubleLevel().equals(sysDictData.getDictValue())) {
hiddenTroubleVo.setTroubleLevel(sysDictData.getDictLabel());
}
}
}
list.add(hiddenTroubleVo); list.add(hiddenTroubleVo);
} }
} }
...@@ -95,9 +160,52 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService ...@@ -95,9 +160,52 @@ public class THiddenTroubleServiceImpl implements ITHiddenTroubleService
* @return 隐患信息集合 * @return 隐患信息集合
*/ */
@Override @Override
public List<THiddenTrouble> getMapTHiddenTroubleList() public List<HiddenTroubleVo> getMapTHiddenTroubleList()
{ {
return tHiddenTroubleMapper.getMapTHiddenTroubleList(); List<HiddenTroubleVo> list = new ArrayList<>();
List<THiddenTrouble> troubleList = tHiddenTroubleMapper.getMapTHiddenTroubleList();
if(troubleList.size() != 0) {
for (THiddenTrouble temp : troubleList) {
HiddenTroubleVo hiddenTroubleVo = new HiddenTroubleVo();
BeanUtils.copyProperties(temp, hiddenTroubleVo);
SysUser sysUser = sysUserMapper.selectUserById(temp.getReportMan());
if(sysUser != null) {
hiddenTroubleVo.setReportManName(sysUser.getNickName());
}
if (StringUtils.isNotEmpty(temp.getTroubleType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_trouble_type");
for (SysDictData sysDictData : sysDictDataList) {
if (temp.getTroubleType().equals(sysDictData.getDictValue())) {
hiddenTroubleVo.setTroubleType(sysDictData.getDictLabel());
}
}
}
if (StringUtils.isNotEmpty(temp.getTroubleLevel())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_trouble_level");
for (SysDictData sysDictData : sysDictDataList) {
if (temp.getTroubleLevel().equals(sysDictData.getDictValue())) {
hiddenTroubleVo.setTroubleLevel(sysDictData.getDictLabel());
}
}
}
if (StringUtils.isNotEmpty(temp.getDealStatus())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_deal_status");
for (SysDictData sysDictData : sysDictDataList) {
if(temp.getDealStatus() == null){
hiddenTroubleVo.setDealStatus("暂未处理");
} else if (temp.getDealStatus().equals(sysDictData.getDictValue())) {
hiddenTroubleVo.setDealStatus(sysDictData.getDictLabel());
}
}
}
list.add(hiddenTroubleVo);
}
}
return list;
} }
/** /**
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.orderId == null || scope.row.orderId == ''">未生成工单</span> <span v-if="scope.row.orderId == null || scope.row.orderId == ''">未生成工单</span>
<span v-if="(scope.row.dealStatus == null || scope.row.dealStatus == '') && <span v-if="(scope.row.dealStatus == null || scope.row.dealStatus == '') &&
scope.row.orderId != null && scope.row.orderId != ''">未处理</span> scope.row.orderId != null && scope.row.orderId != ''">未处理</span>
<span v-if="scope.row.dealStatus == 1">不需处理</span> <span v-if="scope.row.dealStatus == 1">不需处理</span>
<span v-if="scope.row.dealStatus == 2">已处理完成</span> <span v-if="scope.row.dealStatus == 2">已处理完成</span>
<span v-if="scope.row.dealStatus == 3">未处理完成</span> <span v-if="scope.row.dealStatus == 3">未处理完成</span>
......
...@@ -41,19 +41,8 @@ ...@@ -41,19 +41,8 @@
<el-table v-loading="loading" :data="hiddenTroubleList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="hiddenTroubleList" @selection-change="handleSelectionChange">
<el-table-column label="隐患名称" align="center" prop="troubleName" /> <el-table-column label="隐患名称" align="center" prop="troubleName" />
<el-table-column label="隐患类型" align="center" prop="troubleType" > <el-table-column label="隐患类型" align="center" prop="troubleType" />
<template slot-scope="scope"> <el-table-column label="隐患级别" align="center" prop="troubleLevel" />
<span v-if="scope.row.troubleType == 1">设备老化</span>
<span v-if="scope.row.troubleType == 2">质保过期</span>
</template>
</el-table-column>
<el-table-column label="隐患级别" align="center" prop="troubleLevel" >
<template slot-scope="scope">
<span v-if="scope.row.troubleLevel == 1">Ⅰ级</span>
<span v-if="scope.row.troubleLevel == 2">Ⅱ级</span>
<span v-if="scope.row.troubleLevel == 3">Ⅲ级</span>
</template>
</el-table-column>
<el-table-column label="图片" align="center" prop="pictureUrl" > <el-table-column label="图片" align="center" prop="pictureUrl" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-image :src="scope.row.pictureUrl" :preview-src-list="[scope.row.pictureUrl]" v-if="scope.row.pictureUrl != '' && scope.row.pictureUrl != null" style="width: 16px;"></el-image> <el-image :src="scope.row.pictureUrl" :preview-src-list="[scope.row.pictureUrl]" v-if="scope.row.pictureUrl != '' && scope.row.pictureUrl != null" style="width: 16px;"></el-image>
...@@ -66,7 +55,7 @@ ...@@ -66,7 +55,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.orderId == null || scope.row.orderId == ''">未生成工单</span> <span v-if="scope.row.orderId == null || scope.row.orderId == ''">未生成工单</span>
<span v-if="(scope.row.dealStatus == null || scope.row.dealStatus == '') && <span v-if="(scope.row.dealStatus == null || scope.row.dealStatus == '') &&
scope.row.orderId != null && scope.row.orderId != ''">未处理</span> scope.row.orderId != null && scope.row.orderId != ''">未处理</span>
<span v-if="scope.row.dealStatus == 1">不需处理</span> <span v-if="scope.row.dealStatus == 1">不需处理</span>
<span v-if="scope.row.dealStatus == 2">已处理完成</span> <span v-if="scope.row.dealStatus == 2">已处理完成</span>
<span v-if="scope.row.dealStatus == 3">未处理完成</span> <span v-if="scope.row.dealStatus == 3">未处理完成</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment