Commit 86967f22 authored by yaqizhang's avatar yaqizhang

详情按钮

parents 46b2acba a1ef3006
...@@ -3,7 +3,6 @@ package com.zehong.web.controller.device; ...@@ -3,7 +3,6 @@ package com.zehong.web.controller.device;
import com.zehong.common.annotation.Log; import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController; import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult; 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.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType; import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil; import com.zehong.common.utils.poi.ExcelUtil;
...@@ -55,9 +54,9 @@ public class TDeviceInfoController extends BaseController ...@@ -55,9 +54,9 @@ public class TDeviceInfoController extends BaseController
* 获取设备下拉树列表 * 获取设备下拉树列表
*/ */
@PutMapping("/deviceTree") @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));
} }
/** /**
......
package com.zehong.web.controller.webSocket;
import com.zehong.system.service.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/websocket")
public class WebSocketController {
@Autowired
private WebSocketServer webSocketServer;
@GetMapping("/send")
public void send(){
webSocketServer.batchSendMessage("dafdfafdas=======");
}
}
...@@ -119,6 +119,12 @@ ...@@ -119,6 +119,12 @@
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
</dependency> </dependency>
<!-- websocket 支持 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
package com.zehong.common.config;
import javax.servlet.http.HttpSession;
import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;
import javax.websocket.server.ServerEndpointConfig.Configurator;
/**
* <websocket获取HttpSession>
* <功能详细描述>
* @author wzh
* @version 2018-07-10 01:02
* @see [相关类/方法] (可选)
**/
public class GetHttpSessionConfigurator extends Configurator{
@Override
public void modifyHandshake(ServerEndpointConfig sec,HandshakeRequest request, HandshakeResponse response) {
HttpSession httpSession=(HttpSession) request.getHttpSession();
sec.getUserProperties().put(HttpSession.class.getName(),httpSession);
}
}
package com.zehong.common.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
@Configuration
public class WebSocketConfig {
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}
...@@ -97,7 +97,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter ...@@ -97,7 +97,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求 // 过滤请求
.authorizeRequests() .authorizeRequests()
// 对于登录login 验证码captchaImage 允许匿名访问 // 对于登录login 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/captchaImage").anonymous() .antMatchers("/login", "/captchaImage","/websocket/**","/websocketServer").anonymous()
.antMatchers( .antMatchers(
HttpMethod.GET, HttpMethod.GET,
"/*.html", "/*.html",
......
...@@ -31,7 +31,17 @@ public class TUserLocation extends BaseEntity ...@@ -31,7 +31,17 @@ public class TUserLocation extends BaseEntity
@Excel(name = "纬度") @Excel(name = "纬度")
private BigDecimal latitude; private BigDecimal latitude;
public void setLocationId(Long locationId) private String userName;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public void setLocationId(Long locationId)
{ {
this.locationId = locationId; this.locationId = locationId;
} }
......
...@@ -32,10 +32,13 @@ public class TWorkOrder extends BaseEntity ...@@ -32,10 +32,13 @@ public class TWorkOrder extends BaseEntity
@Excel(name = "工单名称") @Excel(name = "工单名称")
private String orderName; private String orderName;
/** 工单状态(0未接收,1已接收,2进行中,3已反馈,4已归档) */ /** 工单状态(0未接收,1已接收,2已反馈,3已归档) */
@Excel(name = "工单状态", readConverterExp = "0未接收,1已接收,2进行中,3已反馈,4已归档") @Excel(name = "工单状态", readConverterExp = "0未接收,1已接收,2进行中,3已反馈,4已归档")
private String orderStatus; private String orderStatus;
/** 归档信息 */
private String archiving;
/** 指定执行人员(巡检员id) */ /** 指定执行人员(巡检员id) */
@Excel(name = "指定执行人员", readConverterExp = "巡检员id") @Excel(name = "指定执行人员", readConverterExp = "巡检员id")
private Long appointInspector; private Long appointInspector;
...@@ -67,6 +70,7 @@ public class TWorkOrder extends BaseEntity ...@@ -67,6 +70,7 @@ public class TWorkOrder extends BaseEntity
{ {
return orderId; return orderId;
} }
public void setOrderType(String orderType) public void setOrderType(String orderType)
{ {
this.orderType = orderType; this.orderType = orderType;
...@@ -94,6 +98,7 @@ public class TWorkOrder extends BaseEntity ...@@ -94,6 +98,7 @@ public class TWorkOrder extends BaseEntity
{ {
return orderName; return orderName;
} }
public void setOrderStatus(String orderStatus) public void setOrderStatus(String orderStatus)
{ {
this.orderStatus = orderStatus; this.orderStatus = orderStatus;
...@@ -103,6 +108,15 @@ public class TWorkOrder extends BaseEntity ...@@ -103,6 +108,15 @@ public class TWorkOrder extends BaseEntity
{ {
return orderStatus; return orderStatus;
} }
public String getArchiving() {
return archiving;
}
public void setArchiving(String archiving) {
this.archiving = archiving;
}
public void setAppointInspector(Long appointInspector) public void setAppointInspector(Long appointInspector)
{ {
this.appointInspector = appointInspector; this.appointInspector = appointInspector;
...@@ -112,15 +126,17 @@ public class TWorkOrder extends BaseEntity ...@@ -112,15 +126,17 @@ public class TWorkOrder extends BaseEntity
{ {
return appointInspector; return appointInspector;
} }
public void setAllotTime(Date allotTime) public void setAllotTime(Date allotTime)
{ {
this.allotTime = allotTime; this.allotTime = allotTime;
} }
public Date getAllotTime() public Date getAllotTime()
{ {
return allotTime; return allotTime;
} }
public void setActualInspector(Long actualInspector) public void setActualInspector(Long actualInspector)
{ {
this.actualInspector = actualInspector; this.actualInspector = actualInspector;
...@@ -130,6 +146,7 @@ public class TWorkOrder extends BaseEntity ...@@ -130,6 +146,7 @@ public class TWorkOrder extends BaseEntity
{ {
return actualInspector; return actualInspector;
} }
public void setActualTime(Date actualTime) public void setActualTime(Date actualTime)
{ {
this.actualTime = actualTime; this.actualTime = actualTime;
...@@ -139,6 +156,7 @@ public class TWorkOrder extends BaseEntity ...@@ -139,6 +156,7 @@ public class TWorkOrder extends BaseEntity
{ {
return actualTime; return actualTime;
} }
public void setRemarks(String remarks) public void setRemarks(String remarks)
{ {
this.remarks = remarks; this.remarks = remarks;
......
package com.zehong.system.domain;
import javax.websocket.Session;
import java.util.concurrent.atomic.AtomicInteger;
/**
* <websocket信息对象>
* <用于存储secket连接信息>
* @author wzh
* @version 2018-07-08 18:49
* @see [相关类/方法] (可选)
**/
public class WebSocketBean {
/**
* 连接session对象
*/
private Session session;
/**
* 连接错误次数
*/
private AtomicInteger erroerLinkCount = new AtomicInteger(0);
public int getErroerLinkCount() {
// 线程安全,以原子方式将当前值加1,注意:这里返回的是自增前的值
return erroerLinkCount.getAndIncrement();
}
public void cleanErrorNum()
{
// 清空计数
erroerLinkCount = new AtomicInteger(0);
}
public Session getSession() {
return session;
}
public void setSession(Session session) {
this.session = session;
}
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ package com.zehong.system.domain.vo; ...@@ -3,7 +3,7 @@ package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.core.domain.BaseEntity; import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TDeviceInfo; 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.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
...@@ -42,6 +42,9 @@ public class WorkOrderVo extends BaseEntity ...@@ -42,6 +42,9 @@ public class WorkOrderVo extends BaseEntity
/** 设备列表 */ /** 设备列表 */
private List<TDeviceInfo> deviceInfoList; private List<TDeviceInfo> deviceInfoList;
/** 管道列表 */
private List<TPipe> pipeList;
/** 反馈信息列表 */ /** 反馈信息列表 */
private List<OrderFeedbackVo> feedbackList; private List<OrderFeedbackVo> feedbackList;
...@@ -156,6 +159,14 @@ public class WorkOrderVo extends BaseEntity ...@@ -156,6 +159,14 @@ public class WorkOrderVo extends BaseEntity
this.deviceInfoList = deviceInfoList; this.deviceInfoList = deviceInfoList;
} }
public List<TPipe> getPipeList() {
return pipeList;
}
public void setPipeList(List<TPipe> pipeList) {
this.pipeList = pipeList;
}
public List<OrderFeedbackVo> getFeedbackList() { public List<OrderFeedbackVo> getFeedbackList() {
return feedbackList; return feedbackList;
} }
......
...@@ -6,6 +6,7 @@ import java.util.Map; ...@@ -6,6 +6,7 @@ import java.util.Map;
import com.zehong.common.core.domain.TreeSelect; import com.zehong.common.core.domain.TreeSelect;
import com.zehong.common.core.domain.entity.SysDept; import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.system.domain.TDeviceInfo; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TPipe;
/** /**
* 设备信息Service接口 * 设备信息Service接口
...@@ -34,10 +35,10 @@ public interface ITDeviceInfoService ...@@ -34,10 +35,10 @@ public interface ITDeviceInfoService
/** /**
* 构建前端所需要下拉树结构 * 构建前端所需要下拉树结构
* *
* @param deviceInfoList 设备列表 * @param param 参数集合
* @return 下拉树结构列表 * @return 下拉树结构列表
*/ */
public List<Map<Object, Object>> buildDeviceTreeSelect(List<TDeviceInfo> deviceInfoList); public List<Map<Object, Object>> buildDeviceTreeSelect(Map<Object, List> param);
/** /**
* 统计各设备类型的设备总数 * 统计各设备类型的设备总数
......
package com.zehong.system.service;
import javax.websocket.EndpointConfig;
import javax.websocket.Session;
/**
* <基于javax websocket通讯>
* <功能详细描述>
* @author wzh
* @version 2018-07-08 17:11
* @see [相关类/方法] (可选)
**/
public interface WebSocketServer {
/**
* 连接建立成功调用的方法
* @param session session 对象
*/
public void onOpen(Session session,EndpointConfig config);
/**
* 断开连接方法
*/
public void onClose(Session session);
/**
* 收到客户端消息后调用的方法
* @param session session 对象
* @param message 返回客户端的消息
*/
public void onMessage(Session session, String message);
/**
* 发生异常时触发的方法
* @param session session 对象
* @param throwable 抛出的异常
*/
public void onError(Session session,Throwable throwable);
/**
* 向单个客户端发送消息
* @param session session 对象
* @param message 发送给客户端的消息
*/
public void sendMessage(Session session, String message);
/**
* 向所有在线用户群发消息
* @param message 发送给客户端的消息
*/
public void batchSendMessage(String message);
}
\ No newline at end of file
...@@ -5,6 +5,7 @@ import java.util.stream.Collectors; ...@@ -5,6 +5,7 @@ import java.util.stream.Collectors;
import com.zehong.common.core.domain.TreeSelect; import com.zehong.common.core.domain.TreeSelect;
import com.zehong.common.core.domain.entity.SysDept; import com.zehong.common.core.domain.entity.SysDept;
import com.zehong.system.domain.TPipe;
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.mapper.TDeviceInfoMapper; import com.zehong.system.mapper.TDeviceInfoMapper;
...@@ -51,20 +52,32 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService ...@@ -51,20 +52,32 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
/** /**
* 构建前端所需要下拉树结构 * 构建前端所需要下拉树结构
* *
* @param deviceInfoList 部门列表 * @param param 参数集合
* @return 下拉树结构列表 * @return 下拉树结构列表
*/ */
@Override @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>> list = new ArrayList<>();
List<Map<Object, Object>> deviceList = param.get("key1");
List<Map<Object, Object>> pipeList = param.get("key2");
for (TDeviceInfo deviceInfo : deviceInfoList) { if(deviceList.size() != 0) {
Map<Object, Object> map = new HashMap<>(); for (Map<Object, Object> temp : deviceList) {
map.put("id", deviceInfo.getDeviceId()); Map<Object, Object> map = new HashMap<>();
map.put("label", deviceInfo.getDeviceName()); 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; return list;
......
...@@ -73,6 +73,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -73,6 +73,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
int resourceId = tWorkOrder.getResourceId(); int resourceId = tWorkOrder.getResourceId();
List<TDeviceInfo> deviceInfoList = new ArrayList<>(); List<TDeviceInfo> deviceInfoList = new ArrayList<>();
List<TPipe> pipeList = new ArrayList<>();
if("1".equals(orderType)){ if("1".equals(orderType)){
...@@ -82,11 +83,22 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -82,11 +83,22 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
List<TInspectionData> totalList = tInspectionDataMapper.selectTInspectionDataList(data); List<TInspectionData> totalList = tInspectionDataMapper.selectTInspectionDataList(data);
workOrderVo.setDeviceNum(totalList.size()); workOrderVo.setDeviceNum(totalList.size());
TDeviceInfo deviceInfo = null; if(totalList.size() != 0) {
for(TInspectionData temp : totalList){ TDeviceInfo deviceInfo = null;
deviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(temp.getDeviceId()); TPipe pipe = null;
if(deviceInfo != null){
deviceInfoList.add(deviceInfo); 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 ...@@ -136,6 +148,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
} }
} }
workOrderVo.setDeviceInfoList(deviceInfoList); workOrderVo.setDeviceInfoList(deviceInfoList);
workOrderVo.setPipeList(pipeList);
List<TOrderFeedback> feedbackList = tOrderFeedbackMapper.selectTOrderFeedbackByOrderId(tWorkOrder.getOrderId()); List<TOrderFeedback> feedbackList = tOrderFeedbackMapper.selectTOrderFeedbackByOrderId(tWorkOrder.getOrderId());
List<OrderFeedbackVo> feedbackVoList = new ArrayList<>(); List<OrderFeedbackVo> feedbackVoList = new ArrayList<>();
......
package com.zehong.system.service.impl;
import com.zehong.common.config.GetHttpSessionConfigurator;
import com.zehong.system.domain.WebSocketBean;
import com.zehong.system.service.WebSocketServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpSession;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
/**
* <基于javax websocket通讯>
* <各个方法的参数都是可以根据项目的实际情况改的>
* @author wzh
* @version 2018-07-08 17:11
* @see [相关类/方法] (可选)
**/
@ServerEndpoint(value = "/websocketServer")
@Component("webSocketService")
public class WebSocketServiceImpl implements WebSocketServer {
private Logger log = LoggerFactory.getLogger(WebSocketServiceImpl.class);
/**
* 错误最大重试次数
*/
private static final int MAX_ERROR_NUM = 10;
/**
* 用来存放每个客户端对应的webSocket对象。
*/
private static Map<String,WebSocketBean> webSocketInfo;
static
{
// concurrent包的线程安全map
webSocketInfo = new ConcurrentHashMap<>();
}
@OnOpen
@Override
public void onOpen(Session session,EndpointConfig config) {
// 如果是session没有激活的情况,就是没有请求获取或session,这里可能会取出空,需要实际业务处理
/* HttpSession httpSession= (HttpSession) config.getUserProperties().get(HttpSession.class.getName());
if(httpSession != null)
{
log.info("获取到httpsession" + httpSession.getId());
}else {
log.error("未获取到httpsession");
}*/
// 连接成功当前对象放入websocket对象集合
WebSocketBean bean = new WebSocketBean();
bean.setSession(session);
webSocketInfo.put(session.getId(),bean);
log.info("客户端连接服务器session id :"+session.getId()+",当前连接数:" + webSocketInfo.size());
}
@OnClose
@Override
public void onClose(Session session) {
// 客户端断开连接移除websocket对象
webSocketInfo.remove(session.getId());
log.info("客户端断开连接,当前连接数:" + webSocketInfo.size());
}
@OnMessage
@Override
public void onMessage(Session session, String message) {
log.info("客户端 session id: "+session.getId()+",消息:" + message);
// 此方法为客户端给服务器发送消息后进行的处理,可以根据业务自己处理,这里返回页面
sendMessage(session, "服务端返回" + message);
}
@OnError
@Override
public void onError(Session session, Throwable throwable) {
log.error("发生错误"+ throwable.getMessage(),throwable);
}
@Override
public void sendMessage(Session session, String message) {
try
{
// 发送消息
session.getBasicRemote().sendText(message);
// 清空错误计数
webSocketInfo.get(session.getId()).cleanErrorNum();
}
catch (Exception e)
{
log.error("发送消息失败"+ e.getMessage(),e);
int errorNum = webSocketInfo.get(session.getId()).getErroerLinkCount();
// 小于最大重试次数重发
if(errorNum <= MAX_ERROR_NUM)
{
sendMessage(session, message);
}
else{
log.error("发送消息失败超过最大次数");
// 清空错误计数
webSocketInfo.get(session.getId()).cleanErrorNum();
}
}
}
@Override
public void batchSendMessage(String message) {
Set<Map.Entry<String, WebSocketBean>> set = webSocketInfo.entrySet();
for (Map.Entry<String, WebSocketBean> map : set)
{
sendMessage(map.getValue().getSession(),message);
}
}
}
...@@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTUserLocationVo"> <sql id="selectTUserLocationVo">
select location_id, user_id, longitude, latitude, create_time from t_user_location select location.location_id, location.user_id, location.longitude, location.latitude, location.create_time,(SELECT sysU.user_name FROM sys_user sysU WHERE sysU.user_id = location.user_id) AS userName from t_user_location location
</sql> </sql>
<select id="selectTUserLocationList" parameterType="TUserLocation" resultMap="TUserLocationResult"> <select id="selectTUserLocationList" parameterType="TUserLocation" resultMap="TUserLocationResult">
......
...@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="resourceId" column="resource_id" /> <result property="resourceId" column="resource_id" />
<result property="orderName" column="order_name" /> <result property="orderName" column="order_name" />
<result property="orderStatus" column="order_status" /> <result property="orderStatus" column="order_status" />
<result property="archiving" column="archiving" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="appointInspector" column="appoint_inspector" /> <result property="appointInspector" column="appoint_inspector" />
<result property="allotTime" column="allot_time" /> <result property="allotTime" column="allot_time" />
...@@ -23,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<sql id="selectTWorkOrderVo"> <sql id="selectTWorkOrderVo">
select t.order_id, t.order_type, t.resource_id, t.order_name, t.order_status, t.update_time, t.appoint_inspector, t.allot_time, t.actual_inspector, t.actual_time, t.remarks select t.order_id, t.order_type, t.resource_id, t.order_name, t.order_status, t.archiving, t.update_time, t.appoint_inspector, t.allot_time, t.actual_inspector, t.actual_time, t.remarks
from t_work_order t from t_work_order t
left join sys_user s on t.appoint_inspector = s.user_id left join sys_user s on t.appoint_inspector = s.user_id
</sql> </sql>
...@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="resourceId != null">resource_id,</if> <if test="resourceId != null">resource_id,</if>
<if test="orderName != null">order_name,</if> <if test="orderName != null">order_name,</if>
<if test="orderStatus != null">order_status,</if> <if test="orderStatus != null">order_status,</if>
<if test="archiving != null">archiving,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="appointInspector != null">appoint_inspector,</if> <if test="appointInspector != null">appoint_inspector,</if>
<if test="allotTime != null">allot_time,</if> <if test="allotTime != null">allot_time,</if>
...@@ -68,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -68,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="resourceId != null">#{resourceId},</if> <if test="resourceId != null">#{resourceId},</if>
<if test="orderName != null">#{orderName},</if> <if test="orderName != null">#{orderName},</if>
<if test="orderStatus != null">#{orderStatus},</if> <if test="orderStatus != null">#{orderStatus},</if>
<if test="archiving != null">#{archiving},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="appointInspector != null">#{appointInspector},</if> <if test="appointInspector != null">#{appointInspector},</if>
<if test="allotTime != null">#{allotTime},</if> <if test="allotTime != null">#{allotTime},</if>
...@@ -83,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -83,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderType != null">order_type = #{orderType},</if> <if test="orderType != null">order_type = #{orderType},</if>
<if test="orderName != null">order_name = #{orderName},</if> <if test="orderName != null">order_name = #{orderName},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if> <if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="archiving != null">archiving = #{archiving},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="appointInspector != null">appoint_inspector = #{appointInspector},</if> <if test="appointInspector != null">appoint_inspector = #{appointInspector},</if>
<if test="allotTime != null">allot_time = #{allotTime},</if> <if test="allotTime != null">allot_time = #{allotTime},</if>
......
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2692138 */ font-family: "iconfont"; /* Project id 2692138 */
src: url('//at.alicdn.com/t/font_2692138_r2b0jk88vrj.woff2?t=1627616466373') format('woff2'), src: url('//at.alicdn.com/t/font_2692138_cd9e8nk8yoo.woff2?t=1627718383904') format('woff2'),
url('//at.alicdn.com/t/font_2692138_r2b0jk88vrj.woff?t=1627616466373') format('woff'), url('//at.alicdn.com/t/font_2692138_cd9e8nk8yoo.woff?t=1627718383904') format('woff'),
url('//at.alicdn.com/t/font_2692138_r2b0jk88vrj.ttf?t=1627616466373') format('truetype'); url('//at.alicdn.com/t/font_2692138_cd9e8nk8yoo.ttf?t=1627718383904') format('truetype');
} }
.iconfont { .iconfont {
...@@ -13,6 +13,14 @@ ...@@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-zhibanrenyuan:before {
content: "\e613";
}
.icon-ylbgs:before {
content: "\e611";
}
.icon-gdcd:before { .icon-gdcd:before {
content: "\e615"; content: "\e615";
} }
...@@ -25,11 +33,7 @@ ...@@ -25,11 +33,7 @@
content: "\e612"; content: "\e612";
} }
.icon-rqbgs:before { .icon-lljgs:before {
content: "\e613";
}
.icon-ljsgs:before {
content: "\e614"; content: "\e614";
} }
......
...@@ -291,4 +291,6 @@ ...@@ -291,4 +291,6 @@
} }
} }
// background-color: ; // background-color: ;
}
\ No newline at end of file }
// 图片预览
...@@ -32,15 +32,24 @@ ...@@ -32,15 +32,24 @@
</template> </template>
的文件 的文件
</div> </div>
</el-upload> </el-upload>
<el-dialog <el-image v-show="false"
id="img"
ref="previewImg"
:src="dialogImageUrl"
:preview-src-list="bigImageArr"
:z-index="9999999"
></el-image>
<!-- <el-dialog
:center="true" :center="true"
width="50%" width="50%"
:modal="modal" :modal="modal"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
> >
<img :src="dialogImageUrl" alt="" /> <img :src="dialogImageUrl" alt="" />
</el-dialog> </el-dialog> -->
<!-- 文件列表 --> <!-- 文件列表 -->
<!-- <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul"> <!-- <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list"> <li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list">
...@@ -123,6 +132,9 @@ export default { ...@@ -123,6 +132,9 @@ export default {
return []; return [];
} }
}, },
bigImageArr() {
return [this.dialogImageUrl]
},
}, },
methods: { methods: {
// 上传前校检格式和大小 // 上传前校检格式和大小
...@@ -197,7 +209,9 @@ export default { ...@@ -197,7 +209,9 @@ export default {
this.dialogImageUrl = file.response ? file.response.url : file.url; this.dialogImageUrl = file.response ? file.response.url : file.url;
// this.dialogImageUrl =if(this.fileArr) this.fileArr[0].url; // this.dialogImageUrl =if(this.fileArr) this.fileArr[0].url;
this.dialogVisible = true; // this.dialogVisible = true;
this.$refs.previewImg.showViewer = true;
console.log(file); console.log(file);
// console.log(file.response.url) // console.log(file.response.url)
}, },
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
.pic { .pic {
width: 177px; width: 177px;
height: 129px; height: 129px;
background-color: black; // background-color: black;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
<template>
<div class="wrapper">
<span class="left">高雄:</span>
<span class="right">2019-99-99 15:21:21</span>
</div>
</template>
<script>
export default {};
</script>
<style lang="scss" scoped>
.wrapper{
width: 136px;
height: 54px;
background: #0D4F88;
font-size: 14px;
color:#fff;
box-sizing: border-box;
padding:7px 0px 7px 10px;
box-shadow: 0 0 20px -5px #0D4F88;
border-radius: 4px;
span{
word-break: break-all;
display: inline-block;
vertical-align: top;
&.right{
width:90px;
}
}
}
</style>
\ No newline at end of file
...@@ -6,9 +6,11 @@ import pipelineView from "../components/PopWindow/pipelineView.vue"; ...@@ -6,9 +6,11 @@ import pipelineView from "../components/PopWindow/pipelineView.vue";
import lineInfoWindow from "../components/PopWindow/lineInfoWindow.vue"; import lineInfoWindow from "../components/PopWindow/lineInfoWindow.vue";
import { delDeviceInfo } from "@/api/device/deviceInfo"; import { delDeviceInfo } from "@/api/device/deviceInfo";
import markerInfoWindow from "../components/PopWindow/markerInfoWindow.vue"; import markerInfoWindow from "../components/PopWindow/markerInfoWindow.vue";
import workerManInfowindow from "../components/PopWindow/workerManInfowindow.vue";
import { getArray } from "@/utils/gassafety.js"; import { getArray } from "@/utils/gassafety.js";
import { delPipe } from "@/api/device/pipe.js"; import { delPipe } from "@/api/device/pipe.js";
import vue from "../main"; import vue from "../main";
import {Card} from "element-ui"
let defaultCenter = "石家庄"; let defaultCenter = "石家庄";
export let map; export let map;
export const DEVICE_TYPE = { export const DEVICE_TYPE = {
...@@ -159,7 +161,43 @@ class gaodeMap { ...@@ -159,7 +161,43 @@ class gaodeMap {
offset: new AMap.Pixel(0, 5) offset: new AMap.Pixel(0, 5)
}); });
this.setMarkerIcon(marker); this.setMarkerIcon(marker);
if (DEVICE_TYPE.WORKORDER != markerType && DEVICE_TYPE.INSPECTOR != markerType) {
if (DEVICE_TYPE.INSPECTOR == markerType) {
// 存值
const { createTime,locationId,longitude,latitude} = data;
marker.setExtData({createTime, locationId ,pos:[longitude,latitude]});
// 值班人员的事件
marker.on("click", e => {
console.log(e);
console.log(e.target.getExtData())
// console.log(Card)
// e.target.content = this.getMarketContent(data);
});
marker.on("mouseover",(e)=>{
e.target.content = this.getMarketContent(data);
infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition());
e.target.cloneDom = infoWindow.dom.cloneNode(true);
// console.log(infoWindow.dom.offsetLeft);
// console.log(infoWindow.dom);
e.target.cloneDom.style.top = infoWindow.dom.offsetTop + 80 + "px";
e.target.cloneDom.style.left = infoWindow.dom.offsetLeft + 100 + "px";
// 先删除之前的,后增加现在的
// this.removeCloneDom();
that.removeCloneDom();
document.body.appendChild(e.target.cloneDom);
that.workerManCloneDom = e.target.cloneDom;
infoWindow.close();
that.workerManInfoWindow = infoWindow;
})
}
if (
DEVICE_TYPE.WORKORDER != markerType &&
DEVICE_TYPE.INSPECTOR != markerType
) {
marker.content = this.getMarketContent(data); marker.content = this.getMarketContent(data);
marker.on("mouseover", infoOpen); marker.on("mouseover", infoOpen);
marker.on("mouseout", infoClose); marker.on("mouseout", infoClose);
...@@ -238,16 +276,29 @@ class gaodeMap { ...@@ -238,16 +276,29 @@ class gaodeMap {
} }
function infoOpen(e) { function infoOpen(e) {
// 如果有cloneDom就删了 // 删除克隆出来的线的clonedom
console.log(that.cloneDom);
// 删除克隆出来的clonedom
that.removeCloneDom();
let options = map.getStatus(); let options = map.getStatus();
options.scrollWheel = false; options.scrollWheel = false;
map.setStatus(options); map.setStatus(options);
infoWindow.setContent(e.target.content); infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition()); infoWindow.open(map, e.target.getPosition());
// console.log(infoWindow.dom);
// 这个是为了盖住vue里的东西
e.target.cloneDom = infoWindow.dom.cloneNode(true);
// console.log(infoWindow.dom.offsetLeft);
// console.log(infoWindow.dom);
e.target.cloneDom.style.top = infoWindow.dom.offsetTop + 80 + "px";
e.target.cloneDom.style.left = infoWindow.dom.offsetLeft + 100 + "px";
// 先删除之前的,后增加现在的
// this.removeCloneDom();
that.removeCloneDom();
document.body.appendChild(e.target.cloneDom);
that.markerCloneDom = e.target.cloneDom;
infoWindow.close();
that.markerInfoWindow = infoWindow; that.markerInfoWindow = infoWindow;
} }
} }
...@@ -317,6 +368,17 @@ class gaodeMap { ...@@ -317,6 +368,17 @@ class gaodeMap {
dom.remove(); dom.remove();
return html; return html;
} }
case DEVICE_TYPE.INSPECTOR: {
const dom = createPop(workerManInfowindow, {
title: "值班人员",
data: data,
map: map
});
const html = dom.$el;
dom.remove();
return html;
}
} }
} }
...@@ -393,7 +455,7 @@ class gaodeMap { ...@@ -393,7 +455,7 @@ class gaodeMap {
case DEVICE_TYPE.INSPECTOR: { case DEVICE_TYPE.INSPECTOR: {
let icon = new AMap.Icon({ let icon = new AMap.Icon({
//size: new AMap.Size(51, 23), //size: new AMap.Size(51, 23),
image: require("../assets/images/zhibanrenyuan.png") image: require("../assets/images/zhibanrenyuan.jpg")
}); });
marker.setIcon(icon); marker.setIcon(icon);
break; break;
...@@ -510,8 +572,8 @@ class gaodeMap { ...@@ -510,8 +572,8 @@ class gaodeMap {
// 这个是为了盖住vue里的东西 // 这个是为了盖住vue里的东西
polyline.cloneDom = infoWindow.dom.cloneNode(true); polyline.cloneDom = infoWindow.dom.cloneNode(true);
console.log(infoWindow.dom.offsetLeft); // console.log(infoWindow.dom.offsetLeft);
console.log(infoWindow.dom); // console.log(infoWindow.dom);
polyline.cloneDom.style.top = infoWindow.dom.offsetTop + 80 + "px"; polyline.cloneDom.style.top = infoWindow.dom.offsetTop + 80 + "px";
polyline.cloneDom.style.left = infoWindow.dom.offsetLeft + 100 + "px"; polyline.cloneDom.style.left = infoWindow.dom.offsetLeft + 100 + "px";
// 先删除之前的,后增加现在的 // 先删除之前的,后增加现在的
...@@ -538,8 +600,17 @@ class gaodeMap { ...@@ -538,8 +600,17 @@ class gaodeMap {
} }
removeCloneDom() { removeCloneDom() {
// 线
this.cloneDom && document.body.removeChild(this.cloneDom); this.cloneDom && document.body.removeChild(this.cloneDom);
// 设备
this.markerCloneDom && document.body.removeChild(this.markerCloneDom);
// 值班人员
this.workerManCloneDom && document.body.removeChild(this.workerManCloneDom);
// that.workerManInfoWindow = infoWindow;
this.cloneDom = null; this.cloneDom = null;
this.markerCloneDom = null;
this.workerManCloneDom = null;
} }
// 创建一条新的线 // 创建一条新的线
......
...@@ -10,14 +10,16 @@ ...@@ -10,14 +10,16 @@
</div> </div>
<div class="right"> <div class="right">
<template v-for="item in list" > <template v-for="item in list">
<div class="right-content" :key="item.type"> <div class="right-content" :key="item.type">
<div class="text-icon"> <div class="text-icon">
<i class="iconfont icon-gdcd"></i> <i class="iconfont" :class="[iconClass(item),{iconFontSize: item.type==4 }]"></i>
</div> </div>
<div class="text"> <div class="text">
<div class="top">{{typeName[item.type]}}</div> <div class="top">{{ typeName[item.type] }}</div>
<div class="bottom">{{item.number}}{{item.type==99?"KM":"个" }}</div> <div class="bottom">
{{ item.number }}{{ item.type == 99 ? "KM" : "个" }}
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -32,21 +34,32 @@ export default { ...@@ -32,21 +34,32 @@ export default {
type: Array, type: Array,
}, },
}, },
data(){ data() {
return { return {
typeName:{ typeName: {
"1":"调压箱", 1: "调压箱",
"2":"阀门井", 2: "阀门井",
"3":"流量计", 3: "流量计",
"4":"压力表", 4: "压力表",
"99":"管道", 99: "管道",
}, },
// type iconList: {
} 1: "icon-tyxgs",
2: "icon-fmjgs",
3: "icon-lljgs",
4: "icon-ylbgs",
99: "icon-gdcd",
},
};
}, },
created() { created() {
console.log("list", this.list); console.log("list", this.list);
}, },
methods: {
iconClass(item) {
return this.iconList[item.type]
},
},
}; };
</script> </script>
...@@ -128,5 +141,9 @@ export default { ...@@ -128,5 +141,9 @@ export default {
} }
} }
} }
// 单独调整下最后一个icon的大小
.iconFontSize{
font-size: 50px !important;
}
} }
</style> </style>
\ No newline at end of file
...@@ -63,8 +63,6 @@ ...@@ -63,8 +63,6 @@
</div> </div>
</div> </div>
<el-input <el-input
v-model="keyWord" v-model="keyWord"
placeholder="点击输入" placeholder="点击输入"
...@@ -96,16 +94,20 @@ ...@@ -96,16 +94,20 @@
</div> </div>
</div> </div>
<RightBototmData :list="rightBototmData"/> <RightBototmData :list="rightBototmData" />
</div> </div>
</template> </template>
<script> <script>
// import from "utils/gaodeMapView.js"; // import from "utils/gaodeMapView.js";
import { pipeAllInfoList, countPipeLength } from "@/api/device/pipe.js"; import { pipeAllInfoList, countPipeLength } from "@/api/device/pipe.js";
import gaodeMap, { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMapView.js"; import gaodeMap, {
map,
DEVICE_TYPE,
mapOperateType,
} from "utils/gaodeMapView.js";
import { getAllDeviceInfo, countDeviceByType } from "@/api/device/deviceInfo"; import { getAllDeviceInfo, countDeviceByType } from "@/api/device/deviceInfo";
import RightBototmData from "./components/RightBototmData.vue"; import RightBototmData from "./components/RightBototmData.vue";
import { getInspectorLocations } from "@/api/inspectorLocation/location" import { getInspectorLocations } from "@/api/inspectorLocation/location";
export default { export default {
components: { components: {
...@@ -161,14 +163,17 @@ export default { ...@@ -161,14 +163,17 @@ export default {
}, },
async created() { async created() {
await countPipeLength().then((res) => { await countPipeLength().then((res) => {
console.log("管道管道管道管道管道管道", res); // console.log("管道管道管道管道管道管道", res);
const obj = { number: res.data, type: "99" }; const obj = { number: res.data, type: "99" };
this.rightBototmData.push(obj); this.rightBototmData.push(obj);
}); });
await countDeviceByType().then((res) => { await countDeviceByType().then((res) => {
console.log("markerresresresresresresresresresresresres", res); // console.log("markerresresresresresresresresresresresres", res);
this.rightBototmData.push(...res.data); this.rightBototmData.push(...res.data);
}); });
// 值班人员
this.getInspectorLocations();
console.log(this.rightBototmData); console.log(this.rightBototmData);
}, },
mounted() { mounted() {
...@@ -183,7 +188,6 @@ export default { ...@@ -183,7 +188,6 @@ export default {
gaoMap.searchTips("tipinput"); gaoMap.searchTips("tipinput");
this.getDeviceInfo(); this.getDeviceInfo();
this.getPipeList(); this.getPipeList();
this.getInspectorLocations();
}, },
// 左边的Bar修改值 // 左边的Bar修改值
leftBarChange(item) { leftBarChange(item) {
...@@ -374,14 +378,12 @@ export default { ...@@ -374,14 +378,12 @@ export default {
} }
}); });
}, },
getInspectorLocations(){ getInspectorLocations() {
getInspectorLocations().then((res) =>{ getInspectorLocations().then((res) => {
if(res.code == 200){ if (res.code == 200) {
for(var i =0; i<res.data.length; i++){ console.log(" 值班人员", res);
this.gaoMap.addMarker( for (var i = 0; i < res.data.length; i++) {
DEVICE_TYPE.INSPECTOR, this.gaoMap.addMarker(DEVICE_TYPE.INSPECTOR, res.data[i]);
res.data[i]
);
} }
} }
}); });
...@@ -430,7 +432,7 @@ export default { ...@@ -430,7 +432,7 @@ export default {
} }
// 辅助新建重新画线 // 辅助新建重新画线
// if (!this.gaoMap.lineFlag || this.gaoMap.lineType != 1) return; // if (!this.gaoMap.lineFlag || this.gaoMap.lineType != 1) return;
console.log("利用window把lineFlagh恢复"); // console.log("利用window把lineFlagh恢复");
this.gaoMap.lineFlag = false; this.gaoMap.lineFlag = false;
// this.gaoMap.createNewLine(); // this.gaoMap.createNewLine();
}, },
...@@ -453,10 +455,10 @@ export default { ...@@ -453,10 +455,10 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
#container{ #container {
position: fixed; position: fixed;
top: 80px; top: 80px;
bottom:0; bottom: 0;
width: 100%; width: 100%;
} }
// 左边的bar // 左边的bar
......
...@@ -103,7 +103,6 @@ ...@@ -103,7 +103,6 @@
</div> </div>
<el-divider></el-divider> <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;" v-if="form.feedbackList != null"> <div style="width: 100%;font-weight: 600;" v-if="form.feedbackList != null">
<div style="color: #31EAEA;width: 100%;height: 40px;"> <div style="color: #31EAEA;width: 100%;height: 40px;">
<ul><li>反馈信息</li></ul> <ul><li>反馈信息</li></ul>
...@@ -122,7 +121,7 @@ ...@@ -122,7 +121,7 @@
<span v-if="activity.deviceType == 3">流量计</span> <span v-if="activity.deviceType == 3">流量计</span>
<span v-if="activity.deviceType == 4">压力表</span> <span v-if="activity.deviceType == 4">压力表</span>
</p> </p>
<p>是否有隐患: <p>是否有隐患:
<span v-if="activity.isHiddenDanger == 1"></span> <span v-if="activity.isHiddenDanger == 1"></span>
<span v-if="activity.isHiddenDanger == 2"></span> <span v-if="activity.isHiddenDanger == 2"></span>
...@@ -141,7 +140,7 @@ ...@@ -141,7 +140,7 @@
<div style="float: left;margin-left: 50px; width: 250px;"> <div style="float: left;margin-left: 50px; width: 250px;">
<p>设备名称:{{activity.deviceName}}</p> <p>设备名称:{{activity.deviceName}}</p>
<p>反馈时间:{{activity.feedbackTime}}</p> <p>反馈时间:{{activity.feedbackTime}}</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -364,8 +363,8 @@ export default { ...@@ -364,8 +363,8 @@ export default {
} }
this.showAndHide = false; this.showAndHide = false;
} }
//$timeline.toggleRowExpansion(row,true) //$timeline.toggleRowExpansion(row,true)
}, },
...@@ -392,7 +391,6 @@ export default { ...@@ -392,7 +391,6 @@ export default {
getBasicsInfo (){ getBasicsInfo (){
getBasicsInfo(this.orderId).then(response =>{ getBasicsInfo(this.orderId).then(response =>{
this.form = response.data; this.form = response.data;
console.log(this.form.feedbackList,"00000000000")
this.active = parseInt(response.data.orderStatus) + 1; this.active = parseInt(response.data.orderStatus) + 1;
if(this.form.deviceInfoList.length>0){ if(this.form.deviceInfoList.length>0){
this.gaoMap.resetMapCenter([this.form.deviceInfoList[0].longitude,this.form.deviceInfoList[0].latitude]); this.gaoMap.resetMapCenter([this.form.deviceInfoList[0].longitude,this.form.deviceInfoList[0].latitude]);
...@@ -404,8 +402,10 @@ export default { ...@@ -404,8 +402,10 @@ export default {
if(this.form.orderType == '1') { if(this.form.orderType == '1') {
// 获取设备列表树 // 获取设备列表树
let data = this.form.deviceInfoList; let data = {
console.log(data, "===="); key1:this.form.deviceInfoList,
key2:this.form.pipeList
};
deviceTree(data).then(response => { deviceTree(data).then(response => {
this.deviceOptions[0].childList = response.data; 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