Commit a1ef3006 authored by 王晓倩's avatar 王晓倩

工单详情设备列表添加管道

parent f41b507e
......@@ -3,7 +3,6 @@ package com.zehong.web.controller.device;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
......@@ -55,9 +54,9 @@ public class TDeviceInfoController extends BaseController
* 获取设备下拉树列表
*/
@PutMapping("/deviceTree")
public AjaxResult deviceTree(@RequestBody List<TDeviceInfo> deviceInfoList)
public AjaxResult deviceTree(@RequestBody Map<Object, List> param)
{
return AjaxResult.success(tDeviceInfoService.buildDeviceTreeSelect(deviceInfoList));
return AjaxResult.success(tDeviceInfoService.buildDeviceTreeSelect(param));
}
/**
......
......@@ -3,7 +3,7 @@ package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TOrderFeedback;
import com.zehong.system.domain.TPipe;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
......@@ -42,6 +42,9 @@ public class WorkOrderVo extends BaseEntity
/** 设备列表 */
private List<TDeviceInfo> deviceInfoList;
/** 管道列表 */
private List<TPipe> pipeList;
/** 反馈信息列表 */
private List<OrderFeedbackVo> feedbackList;
......@@ -156,6 +159,14 @@ public class WorkOrderVo extends BaseEntity
this.deviceInfoList = deviceInfoList;
}
public List<TPipe> getPipeList() {
return pipeList;
}
public void setPipeList(List<TPipe> pipeList) {
this.pipeList = pipeList;
}
public List<OrderFeedbackVo> getFeedbackList() {
return feedbackList;
}
......
......@@ -6,6 +6,7 @@ import java.util.Map;
import com.zehong.common.core.domain.TreeSelect;
import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TPipe;
/**
* 设备信息Service接口
......@@ -34,10 +35,10 @@ public interface ITDeviceInfoService
/**
* 构建前端所需要下拉树结构
*
* @param deviceInfoList 设备列表
* @param param 参数集合
* @return 下拉树结构列表
*/
public List<Map<Object, Object>> buildDeviceTreeSelect(List<TDeviceInfo> deviceInfoList);
public List<Map<Object, Object>> buildDeviceTreeSelect(Map<Object, List> param);
/**
* 统计各设备类型的设备总数
......
......@@ -5,6 +5,7 @@ import java.util.stream.Collectors;
import com.zehong.common.core.domain.TreeSelect;
import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.system.domain.TPipe;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceInfoMapper;
......@@ -51,20 +52,32 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
/**
* 构建前端所需要下拉树结构
*
* @param deviceInfoList 部门列表
* @param param 参数集合
* @return 下拉树结构列表
*/
@Override
public List<Map<Object, Object>> buildDeviceTreeSelect(List<TDeviceInfo> deviceInfoList)
public List<Map<Object, Object>> buildDeviceTreeSelect(Map<Object, List> param)
{
List<Map<Object, Object>> list = new ArrayList<>();
List<Map<Object, Object>> deviceList = param.get("key1");
List<Map<Object, Object>> pipeList = param.get("key2");
for (TDeviceInfo deviceInfo : deviceInfoList) {
Map<Object, Object> map = new HashMap<>();
map.put("id", deviceInfo.getDeviceId());
map.put("label", deviceInfo.getDeviceName());
if(deviceList.size() != 0) {
for (Map<Object, Object> temp : deviceList) {
Map<Object, Object> map = new HashMap<>();
map.put("id", temp.get("deviceId"));
map.put("label", temp.get("deviceName"));
list.add(map);
}
}
list.add(map);
if(pipeList.size() != 0){
for(Map<Object, Object> temp : pipeList){
Map<Object, Object> map = new HashMap<>();
map.put("id", temp.get("pipeId"));
map.put("label", temp.get("pipeName"));
list.add(map);
}
}
return list;
......
......@@ -73,6 +73,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
int resourceId = tWorkOrder.getResourceId();
List<TDeviceInfo> deviceInfoList = new ArrayList<>();
List<TPipe> pipeList = new ArrayList<>();
if("1".equals(orderType)){
......@@ -82,11 +83,22 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
List<TInspectionData> totalList = tInspectionDataMapper.selectTInspectionDataList(data);
workOrderVo.setDeviceNum(totalList.size());
TDeviceInfo deviceInfo = null;
for(TInspectionData temp : totalList){
deviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(temp.getDeviceId());
if(deviceInfo != null){
deviceInfoList.add(deviceInfo);
if(totalList.size() != 0) {
TDeviceInfo deviceInfo = null;
TPipe pipe = null;
for (TInspectionData temp : totalList) {
if(!"0".equals(temp.getDeviceType())) {
deviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(temp.getDeviceId());
if (deviceInfo != null) {
deviceInfoList.add(deviceInfo);
}
} else {
pipe = tPipeMapper.selectTPipeById(temp.getDeviceId());
if(pipe != null){
pipeList.add(pipe);
}
}
}
}
......@@ -136,6 +148,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
}
}
workOrderVo.setDeviceInfoList(deviceInfoList);
workOrderVo.setPipeList(pipeList);
List<TOrderFeedback> feedbackList = tOrderFeedbackMapper.selectTOrderFeedbackByOrderId(tWorkOrder.getOrderId());
List<OrderFeedbackVo> feedbackVoList = new ArrayList<>();
......
......@@ -104,7 +104,7 @@
<el-divider></el-divider>
<!-- 反馈信息 -->
<!-- <div style="width: 100%;font-weight: 600;" v-if="activity.deviceType != '' && activity.deviceType != null"> -->
<div style="width: 100%;font-weight: 600;">
<div style="width: 100%;font-weight: 600;">
<div style="color: #31EAEA;width: 100%;height: 40px;">
<ul><li>反馈信息</li></ul>
</div>
......@@ -122,7 +122,7 @@
<span v-if="activity.deviceType == 3">流量计</span>
<span v-if="activity.deviceType == 4">压力表</span>
</p>
<p>是否有隐患:
<span v-if="activity.isHiddenDanger == 1"></span>
<span v-if="activity.isHiddenDanger == 2"></span>
......@@ -141,7 +141,7 @@
<div style="float: left;margin-left: 50px; width: 250px;">
<p>设备名称:{{activity.deviceName}}</p>
<p>反馈时间:{{activity.feedbackTime}}</p>
</div>
</div>
</div>
......@@ -321,8 +321,8 @@ export default {
}
this.showAndHide = false;
}
//$timeline.toggleRowExpansion(row,true)
},
......@@ -349,7 +349,6 @@ export default {
getBasicsInfo (){
getBasicsInfo(this.orderId).then(response =>{
this.form = response.data;
console.log(this.form.feedbackList,"00000000000")
this.active = parseInt(response.data.orderStatus) + 1;
if(this.form.deviceInfoList.length>0){
this.gaoMap.resetMapCenter([this.form.deviceInfoList[0].longitude,this.form.deviceInfoList[0].latitude]);
......@@ -361,8 +360,10 @@ export default {
if(this.form.orderType == '1') {
// 获取设备列表树
let data = this.form.deviceInfoList;
console.log(data, "====");
let data = {
key1:this.form.deviceInfoList,
key2:this.form.pipeList
};
deviceTree(data).then(response => {
this.deviceOptions[0].childList = response.data;
});
......
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