Commit 960177d5 authored by 纪泽龙's avatar 纪泽龙

合并jzl

parents be178b5c da2002dc
......@@ -41,10 +41,16 @@ public class TWorkOrderController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:list')")
@GetMapping("/list")
public TableDataInfo list(TWorkOrder tWorkOrder)
public TableDataInfo list(TWorkOrder tWorkOrder) throws Exception
{
startPage();
List<WorkOrderVo> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
List<WorkOrderVo> list = null;
try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("查询工单基础信息列表失败"));
}
return getDataTable(list);
}
......@@ -54,9 +60,15 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:export')")
@Log(title = "工单基础信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TWorkOrder tWorkOrder)
public AjaxResult export(TWorkOrder tWorkOrder) throws Exception
{
List<WorkOrderVo> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
List<WorkOrderVo> list = null;
try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("导出工单基础信息列表失败"));
}
ExcelUtil<WorkOrderVo> util = new ExcelUtil<WorkOrderVo>(WorkOrderVo.class);
return util.exportExcel(list, "工单基础信息数据");
}
......@@ -66,9 +78,16 @@ public class TWorkOrderController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:query')")
@GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") String orderId)
public AjaxResult getInfo(@PathVariable("orderId") String orderId) throws Exception
{
return AjaxResult.success(tWorkOrderService.selectTWorkOrderById(orderId));
WorkOrderVo workOrderVo = new WorkOrderVo();
try {
workOrderVo = tWorkOrderService.selectTWorkOrderById(orderId);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("获取工单({})工详细信息失败", orderId));
}
return AjaxResult.success(workOrderVo);
}
/**
......@@ -77,9 +96,15 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:add')")
@Log(title = "工单基础信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TWorkOrder tWorkOrder)
public AjaxResult add(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
return toAjax(tWorkOrderService.insertTWorkOrder(tWorkOrder));
try {
tWorkOrderService.insertTWorkOrder(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("工单({})信息有误", tWorkOrder.getOrderId()));
}
return AjaxResult.success();
}
/**
......@@ -88,15 +113,21 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:edit')")
@Log(title = "工单基础信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception {
public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
String orderStatus = tWorkOrder.getOrderStatus();
// 工单状态只有是0未下发或1已下发,才允许修改
if(!"0".equals(orderStatus) && !"1".equals(orderStatus)){
throw new Exception(StringUtils.format("工单({})当前状态不允许修改", tWorkOrder.getOrderId()));
throw new Exception(StringUtils.format("工单({})当前状态不允许修改", tWorkOrder.getOrderId()));
}
return toAjax(tWorkOrderService.updateTWorkOrder(tWorkOrder));
try {
tWorkOrderService.updateTWorkOrder(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("修改工单({})信息失败,", tWorkOrder.getOrderId()));
}
return AjaxResult.success();
}
/**
......@@ -105,11 +136,18 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:editStatus')")
@Log(title = "工单基础信息", businessType = BusinessType.UPDATE)
@PutMapping("/editStatus")
public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception {
public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
String orderStatus = tWorkOrder.getOrderStatus();
if("5".equals(orderStatus)) {
throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态。", tWorkOrder.getOrderId()));
throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态", tWorkOrder.getOrderId()));
}
try {
tWorkOrderService.updateTWorkOrder(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("修改工单({})状态失败", tWorkOrder.getOrderId()));
}
return AjaxResult.success();
}
......
package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TDeviceInfo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 工单基础信息对象 t_work_order
......@@ -32,7 +33,10 @@ public class WorkOrderVo extends BaseEntity
private String orderName;
/** 设备编号 */
private String deviceIds;
private String deviceCodes;
/** 设备列表 */
private List<TDeviceInfo> deviceInfoList;
/** 设备数量 */
private int deviceNum;
......@@ -78,6 +82,16 @@ public class WorkOrderVo extends BaseEntity
/** 备注 */
private String remarks;
/** 反馈内容 */
private String contents;
/** 反馈时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date feedbackTime;
/** 处理状态 */
private String dealStatus;
public void setOrderId(String orderId)
{
this.orderId = orderId;
......@@ -115,12 +129,20 @@ public class WorkOrderVo extends BaseEntity
return orderName;
}
public String getDeviceIds() {
return deviceIds;
public String getDeviceCodes() {
return deviceCodes;
}
public void setDeviceIds(String deviceIds) {
this.deviceIds = deviceIds;
public void setDeviceCodes(String deviceCodes) {
this.deviceCodes = deviceCodes;
}
public List<TDeviceInfo> getDeviceInfoList() {
return deviceInfoList;
}
public void setDeviceInfoList(List<TDeviceInfo> deviceInfoList) {
this.deviceInfoList = deviceInfoList;
}
public int getDeviceNum() {
......@@ -242,6 +264,30 @@ public class WorkOrderVo extends BaseEntity
this.actualInspectorName = actualInspectorName;
}
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public Date getFeedbackTime() {
return feedbackTime;
}
public void setFeedbackTime(Date feedbackTime) {
this.feedbackTime = feedbackTime;
}
public String getDealStatus() {
return dealStatus;
}
public void setDealStatus(String dealStatus) {
this.dealStatus = dealStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......@@ -249,7 +295,7 @@ public class WorkOrderVo extends BaseEntity
.append("orderType", getOrderType())
.append("resourceId", getResourceId())
.append("orderName", getOrderName())
.append("deviceIds", getDeviceIds())
.append("deviceCodes", getDeviceCodes())
.append("deviceNum", getDeviceNum())
.append("finishNum", getFinishNum())
.append("deviceType", getDeviceType())
......
......@@ -19,6 +19,14 @@ public interface TOrderFeedbackMapper
*/
public TOrderFeedback selectTOrderFeedbackById(int feedbackId);
/**
* 查询工单反馈信息列表
*
* @param orderId 工单信息id
* @return 工单反馈信息集合
*/
public List<TOrderFeedback> selectTOrderFeedbackByOrderId(String orderId);
/**
* 查询工单反馈信息列表
*
......
......@@ -19,7 +19,7 @@ public interface ITWorkOrderService
* @param orderId 工单基础信息ID
* @return 工单基础信息
*/
public WorkOrderVo selectTWorkOrderById(String orderId);
public WorkOrderVo selectTWorkOrderById(String orderId) throws Exception;
/**
* 查询工单基础信息列表
......@@ -27,7 +27,7 @@ public interface ITWorkOrderService
* @param tWorkOrder 工单基础信息
* @return 工单基础信息集合
*/
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder);
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception;
/**
* 新增工单基础信息
......@@ -35,7 +35,7 @@ public interface ITWorkOrderService
* @param tWorkOrder 工单基础信息
* @return 结果
*/
public int insertTWorkOrder(TWorkOrder tWorkOrder);
public int insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception;
/**
* 修改工单基础信息
......
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TOrderFeedbackMapper;
import com.zehong.system.domain.TOrderFeedback;
import com.zehong.system.service.ITOrderFeedbackService;
/**
......@@ -18,6 +19,14 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
{
@Autowired
private TOrderFeedbackMapper tOrderFeedbackMapper;
@Autowired
private TWorkOrderMapper tWorkOrderMapper;
@Autowired
private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private THiddenTroubleMapper tHiddenTroubleMapper;
@Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper;
/**
* 查询工单反馈信息
......@@ -53,10 +62,32 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback)
{
String deviceCode = tOrderFeedback.getDeviceCode();
// 更改巡检记录状态
if(deviceCode != null){
String dealStatus = tOrderFeedback.getDealStatus();
// 根据工单类型和源id修改源数据状态
TWorkOrder order = tWorkOrderMapper.selectTWorkOrderById(tOrderFeedback.getOrderId());
String orderType = order.getOrderType();
if("1".equals(orderType)){
TInspectionData data = tInspectionDataMapper.selectTInspectionDataByCode(deviceCode);
data.setDealStatus(dealStatus);
tInspectionDataMapper.updateTInspectionData(data);
} else if("2".equals(orderType)) {
THiddenTrouble trouble = tHiddenTroubleMapper.selectTHiddenTroubleById(order.getResourceId());
trouble.setDealStatus(dealStatus);
tHiddenTroubleMapper.updateTHiddenTrouble(trouble);
} else {
TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(order.getResourceId());
alarm.setDealStatus(dealStatus);
tDeviceAlarmMapper.updateTDeviceAlarm(alarm);
}
// 如果工单状态是进行中,修改状态为已反馈
if("2".equals(order.getOrderStatus())){
order.setOrderStatus("3");
tWorkOrderMapper.updateTWorkOrder(order);
}
return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback);
......
......@@ -26,12 +26,14 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
@Autowired
private TWorkOrderMapper tWorkOrderMapper;
@Autowired
private SysUserMapper sysUserMapper;
private TOrderFeedbackMapper tOrderFeedbackMapper;
@Autowired
private TInspectionDataMapper tInspectionDataMapper;
private SysUserMapper sysUserMapper;
@Autowired
private TInspectionPlanMapper tInspectionPlanMapper;
@Autowired
private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private THiddenTroubleMapper tHiddenTroubleMapper;
@Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper;
......@@ -50,7 +52,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 工单基础信息
*/
@Override
public WorkOrderVo selectTWorkOrderById(String orderId)
public WorkOrderVo selectTWorkOrderById(String orderId) throws Exception
{
WorkOrderVo workOrderVo = new WorkOrderVo();
TWorkOrder tWorkOrder = tWorkOrderMapper.selectTWorkOrderById(orderId);
......@@ -74,20 +76,31 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
if("1".equals(orderType)){
TInspectionPlan plan = tInspectionPlanMapper.selectTInspectionPlanById(resourceId);
workOrderVo.setDeviceIds(plan.getDeviceCodes());
workOrderVo.setDeviceCodes(plan.getDeviceCodes());
TInspectionData data = new TInspectionData();
data.setPlanId(resourceId);
List<TInspectionData> totalList = tInspectionDataMapper.selectTInspectionDataList(data);
workOrderVo.setDeviceNum(totalList.size());
List<TDeviceInfo> deviceInfoList = new ArrayList<>();
TDeviceInfo deviceInfo = null;
for(TInspectionData temp : totalList){
deviceInfo = tDeviceInfoMapper.selectTDeviceInfoByCode(temp.getDeviceCode());
if(deviceInfo != null){
deviceInfoList.add(deviceInfo);
}
}
int finish = tInspectionDataMapper.selectFinishTInspectionData(resourceId);
workOrderVo.setFinishNum(finish);
} else if("2".equals(orderType)){
THiddenTrouble trouble = tHiddenTroubleMapper.selectTHiddenTroubleById(resourceId);
workOrderVo.setDeviceIds((trouble.getDeviceCode() != null ? trouble.getDeviceCode() : null).toString());
workOrderVo.setDeviceCodes((trouble.getDeviceCode() != null ? trouble.getDeviceCode() : null).toString());
workOrderVo.setLongitude(trouble.getLongitude() != null ? trouble.getLongitude() : null);
workOrderVo.setLatitude(trouble.getLatitude() != null ? trouble.getLatitude() : null);
workOrderVo.setCoordinates(trouble.getCoordinates() != null ? trouble.getCoordinates() : null);
......@@ -97,7 +110,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(resourceId);
String deviceCode = alarm.getDeviceCode();
workOrderVo.setDeviceIds(String.valueOf(deviceCode));
workOrderVo.setDeviceCodes(String.valueOf(deviceCode));
String isPipe = alarm.getIsPipe();
if("0".equals(isPipe)){
......@@ -110,8 +123,16 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo.setLatitude(device.getLatitude());
workOrderVo.setDeviceType(device.getDeviceType());
}
}
List<TOrderFeedback> feedbackList = tOrderFeedbackMapper.selectTOrderFeedbackByOrderId(tWorkOrder.getOrderId());
if(feedbackList.size() != 0){
TOrderFeedback feedback = feedbackList.get(0);
workOrderVo.setContents(feedback.getContents());
workOrderVo.setFeedbackTime(feedback.getFeedbackTime());
workOrderVo.setDealStatus(feedback.getDealStatus());
}
return workOrderVo;
}
......@@ -122,7 +143,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 工单基础信息
*/
@Override
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder)
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception
{
List<WorkOrderVo> workOrderVoList = new ArrayList<WorkOrderVo>();
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectTWorkOrderList(tWorkOrder);
......@@ -157,12 +178,12 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 结果
*/
@Override
public int insertTWorkOrder(TWorkOrder tWorkOrder)
public int insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception
{
String orderId = tWorkOrderMapper.getWorkOrderId();
tWorkOrder.setOrderId(orderId);
tWorkOrder.setOrderStatus("0");
tWorkOrder.setCreateTime(DateUtils.getNowDate());
tWorkOrder.setAllotTime(DateUtils.getNowDate());
int planId = tWorkOrder.getResourceId();
// 修改巡检计划状态为已下发
......@@ -181,7 +202,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 结果
*/
@Override
public int updateTWorkOrder(TWorkOrder tWorkOrder)
public int updateTWorkOrder(TWorkOrder tWorkOrder) throws Exception
{
if("1".equals(tWorkOrder.getOrderStatus())){
......@@ -204,6 +225,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
tInspectionPlanService.updateTInspectionPlan(plan);
}
tWorkOrder.setUpdateTime(DateUtils.getNowDate());
return tWorkOrderMapper.updateTWorkOrder(tWorkOrder);
}
......
......@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTDeviceAlarmById" parameterType="Long" resultMap="TDeviceAlarmResult">
<select id="selectTDeviceAlarmById" parameterType="int" resultMap="TDeviceAlarmResult">
<include refid="selectTDeviceAlarmVo"/>
where alarm_id = #{alarmId}
</select>
......
......@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTDeviceInfoById" parameterType="Long" resultMap="TDeviceInfoResult">
<select id="selectTDeviceInfoById" parameterType="int" resultMap="TDeviceInfoResult">
<include refid="selectTDeviceInfoVo"/>
where device_id = #{deviceId}
</select>
......@@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTDeviceInfo" parameterType="TDeviceInfo" useGeneratedKeys="true" keyProperty="deviceId">
insert into t_device_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id,</if>
<if test="enterpriseId != null and enterpriseId != 0">enterprise_id,</if>
<if test="pipeCode != null">pipe_code,</if>
<if test="deviceName != null">device_name,</if>
<if test="deviceCode != null">device_code,</if>
......@@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">#{enterpriseId},</if>
<if test="enterpriseId != null and enterpriseId != 0">#{enterpriseId},</if>
<if test="pipeCode != null">#{pipeCode},</if>
<if test="deviceName != null">#{deviceName},</if>
<if test="deviceCode != null">#{deviceCode},</if>
......@@ -108,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateTDeviceInfo" parameterType="TDeviceInfo">
update t_device_info
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
<if test="enterpriseId != null and enterpriseId != 0">enterprise_id = #{enterpriseId},</if>
<if test="pipeCode != null">pipe_code = #{pipeCode},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
......
......@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTEnterpriseInfoById" parameterType="Long" resultMap="TEnterpriseInfoResult">
<select id="selectTEnterpriseInfoById" parameterType="int" resultMap="TEnterpriseInfoResult">
<include refid="selectTEnterpriseInfoVo"/>
where info_id = #{infoId}
</select>
......
......@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTHiddenTroubleById" parameterType="Long" resultMap="THiddenTroubleResult">
<select id="selectTHiddenTroubleById" parameterType="int" resultMap="THiddenTroubleResult">
<include refid="selectTHiddenTroubleVo"/>
where trouble_id = #{troubleId}
</select>
......
......@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectFinishTInspectionData" parameterType="int">
<select id="selectFinishTInspectionData" parameterType="int" resultType="int">
select count(*) from t_inspection_data
where plan_id = #{planId}
and deal_status != null
......
......@@ -38,11 +38,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTOrderFeedbackById" parameterType="Long" resultMap="TOrderFeedbackResult">
<select id="selectTOrderFeedbackById" parameterType="int" resultMap="TOrderFeedbackResult">
<include refid="selectTOrderFeedbackVo"/>
where feedback_id = #{feedbackId}
</select>
<select id="selectTOrderFeedbackByOrderId" parameterType="String" resultMap="TOrderFeedbackResult">
<include refid="selectTOrderFeedbackVo"/>
where order_id = #{orderId}
order by feedback_time desc
</select>
<insert id="insertTOrderFeedback" parameterType="TOrderFeedback">
insert into t_order_feedback
<trim prefix="(" suffix=")" suffixOverrides=",">
......
......@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTPipeList" parameterType="TPipe" resultMap="TPipeResult">
<include refid="selectTPipeVo"/>
<where>
<if test="enterpriseId != null "> and enterprise_id = #{enterpriseId}</if>
<if test="enterpriseId != null and enterpriseId != 0"> and enterprise_id = #{enterpriseId}</if>
<if test="pipeName != null and pipeName != ''"> and pipe_name like concat('%', #{pipeName}, '%')</if>
<if test="pipeCode != null and pipeCode != ''"> and pipe_code like concat('%', #{pipeCode}, '%')</if>
<if test="pipeAddr != null and pipeAddr != ''"> and pipe_addr = #{pipeAddr}</if>
......@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectTPipeById" parameterType="Long" resultMap="TPipeResult">
<select id="selectTPipeById" parameterType="int" resultMap="TPipeResult">
<include refid="selectTPipeVo"/>
where pipe_id = #{pipeId}
</select>
......@@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTPipe" parameterType="TPipe" useGeneratedKeys="true" keyProperty="pipeId">
insert into t_pipe
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id,</if>
<if test="enterpriseId != null and enterpriseId != 0">enterprise_id,</if>
<if test="pipeName != null">pipe_name,</if>
<if test="pipeCode != null">pipe_code,</if>
<if test="pipeAddr != null">pipe_addr,</if>
......@@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseId != null">#{enterpriseId},</if>
<if test="enterpriseId != null and enterpriseId != 0">#{enterpriseId},</if>
<if test="pipeName != null">#{pipeName},</if>
<if test="pipeCode != null">#{pipeCode},</if>
<if test="pipeAddr != null">#{pipeAddr},</if>
......@@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateTPipe" parameterType="TPipe">
update t_pipe
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
<if test="enterpriseId != null and enterpriseId != 0">enterprise_id = #{enterpriseId},</if>
<if test="pipeName != null">pipe_name = #{pipeName},</if>
<if test="pipeCode != null">pipe_code = #{pipeCode},</if>
<if test="pipeAddr != null">pipe_addr = #{pipeAddr},</if>
......
......@@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="resourceId" column="resource_id" />
<result property="orderName" column="order_name" />
<result property="orderStatus" column="order_status" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="appointInspector" column="appoint_inspector" />
<result property="allotTime" column="allot_time" />
<result property="actualInspector" column="actual_inspector" />
......@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<sql id="selectTWorkOrderVo">
select order_id, order_type, resource_id, order_name, order_status, create_time, appoint_inspector, allot_time, actual_inspector, actual_time, remarks from t_work_order
select order_id, order_type, resource_id, order_name, order_status, update_time, appoint_inspector, allot_time, actual_inspector, actual_time, remarks from t_work_order
</sql>
<select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult">
......@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="resourceId != null">resource_id,</if>
<if test="orderName != null">order_name,</if>
<if test="orderStatus != null">order_status,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="appointInspector != null">appoint_inspector,</if>
<if test="allotTime != null">allot_time,</if>
<if test="actualInspector != null">actual_inspector,</if>
......@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="resourceId != null">#{resourceId},</if>
<if test="orderName != null">#{orderName},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="appointInspector != null">#{appointInspector},</if>
<if test="allotTime != null">#{allotTime},</if>
<if test="actualInspector != null">#{actualInspector},</if>
......@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderType != null">order_type = #{orderType},</if>
<if test="orderName != null">order_name = #{orderName},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="appointInspector != null">appoint_inspector = #{appointInspector},</if>
<if test="allotTime != null">allot_time = #{allotTime},</if>
<if test="actualInspector != null">actual_inspector = #{actualInspector},</if>
......
......@@ -108,6 +108,7 @@
this.map.remove(this.obj);
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear();
this.msgSuccess("新增成功");
}else{
this.msgSuccess("新增失败");
......
<template>
<div class="wrapper">
<span class="dot-left"></span>
<div class="top display-default">
<div class="left text">裕华路地埋管线1111</div>
<div class="left text">{{title}}</div>
<div class="right text">
<img src="../../assets/images/closeBtn.png" alt="" />
<img src="../../assets/images/closeBtn.png" alt="" @click="map.clearInfoWindow()"/>
</div>
</div>
<!-- 设备信息 -->
<div class="eq-content display-default">
<div class="text-wrapper">
<div class="eq-text">设备编号:<span>aa</span></div>
<div class="eq-text">设备名称:<span>裕华路地埋管线</span></div>
<div class="eq-text">监测介质:<span>甲烷</span></div>
<div class="eq-text">设备名称:<span>{{data.deviceName}}</span></div>
<div class="eq-text">设备型号:<span>{{data.deviceModel}}</span></div>
<div class="eq-text">所属管道:<span>{{data.pipeCode}}</span></div>
<div class="eq-text">设备状态:<span>报警</span></div>
<div class="eq-text">用户信息:<span>中厨燃气</span></div>
</div>
<div class="pic">
<img src="" alt="" />
<img v-bind:src="data.iconUrl" alt="" />
</div>
</div>
<!-- 维修人员 -->
<div class="maintain-content">
<div>姓名: <span>高雄</span></div>
<div>电话: <span>13512451234</span></div>
<div>姓名: <span>{{data.linkman}}</span></div>
<div>电话: <span>{{data.phone}}</span></div>
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
</div>
<!-- 报警状态 -->
......@@ -30,10 +30,6 @@
<div>报警状态 <span>报警</span></div>
<div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
</div>
<div class="btn">
<el-button class="elbtn" type="primary">生成工单</el-button>
</div>
</div>
</template>
......@@ -42,7 +38,10 @@
export default {
props: {
obj: { typs: Object },
},
title: "",
data: {},
map: null
}
};
</script>
......@@ -57,7 +56,7 @@ export default {
.top {
width: 100%;
height: 51px;
background-color: #ff5a67;
background-color: #053B6A;
.text {
font-weight: 600;
font-size: 16px;
......@@ -69,6 +68,7 @@ export default {
}
.right {
padding-right: 16px;
cursor: pointer;
}
}
......@@ -95,6 +95,7 @@ export default {
background-color: black;
img {
width: 100%;
height: 100%;
}
}
}
......@@ -139,4 +140,56 @@ export default {
display: flex;
justify-content: space-between;
}
.dot-top {
font-size: 0;
line-height: 0;
border-width: 10px;
border-color: #053B6A;
border-top-width: 0;
border-style: dashed;
border-bottom-style: solid;
border-left-color: transparent;
border-right-color: transparent;
}
/* 向右的箭头 */
.dot-right {
font-size: 0;
line-height: 0;
border-width: 10px;
border-color: #053B6A;
border-right-width: 0;
border-style: dashed;
border-left-style: solid;
border-top-color: transparent;
border-bottom-color: transparent;
}
/* 向下的箭头 */
.dot-bottom {
font-size: 0;
line-height: 0;
border-width: 10px;
border-color: #053B6A;
border-bottom-width: 0;
border-style: dashed;
border-top-style: solid;
border-left-color: transparent;
border-right-color: transparent;
}
/* 向左的箭头 */
.dot-left {
position: absolute;
left: -12px;
top: 8px;
font-size: 0;
line-height: 0;
border-width: 13px;
border-color: #053B6A;
border-left-width: 0;
border-style: dashed;
border-right-style: solid;
border-top-color: transparent;
border-bottom-color: transparent;
}
</style>
......@@ -81,6 +81,9 @@
gaoMap : null
}
},
mounted(){
console.log(this.form.longitude,"===============")
},
components: {
FileUpload,
},
......@@ -108,6 +111,7 @@
this.map.remove(this.obj);
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear();
this.msgSuccess("新增成功");
}else{
this.msgSuccess("新增失败");
......
......@@ -108,6 +108,7 @@
this.map.remove(this.obj);
this.form.deviceId = response.data;
this.gaoMap.addMarker(this.gaoMap.deviceType,this.form);
this.gaoMap.placeSearch.clear();
this.msgSuccess("新增成功");
}else{
this.msgSuccess("新增失败");
......
......@@ -14,7 +14,8 @@ export const DEVICE_TYPE = {
REGEULATORBOX: "2",
VALUEWELL: "3",
FLOWMETER: "4",
DUTYPERSON: "5"
DUTYPERSON: "5",
WORKORDER: "6"
};
class gaodeMap {
// 所有线的数组
......@@ -101,14 +102,15 @@ class gaodeMap {
addMarker(markerType, data) {
let that = this;
that.markerType = markerType;
let infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(-13, -70) });
let infoWindow = new AMap.InfoWindow({ isCustom: true, offset: new AMap.Pixel(12, -65),anchor: "left-top" });
let marker = new AMap.Marker({
position: [data.longitude,data.latitude],
map: map,
offset: new AMap.Pixel(-13, -30)
});
marker.content = this.getMarketContent(data);
this.setMarkerIcon(marker);
if(DEVICE_TYPE.WORKORDER != markerType){
marker.content = this.getMarketContent(data);
marker.on("mouseover", infoOpen);
marker.on("mouseout", infoClose);
marker.setExtData(data);
......@@ -126,7 +128,9 @@ class gaodeMap {
} else {
map.setZoomAndCenter(13, e.target.getPosition());
let infoWindow = new AMap.InfoWindow({
offset: new AMap.Pixel(-13, -70)
isCustom: true,
offset: new AMap.Pixel(12, -65),
anchor: "left-top"
});
infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition());
......@@ -136,6 +140,9 @@ class gaodeMap {
editWindow.form.longitude = e.lnglat.lng;
editWindow.form.latitude = e.lnglat.lat;
});
}
this.markers.push(marker);
map.setZoom("11");
//map.setFitView();
......@@ -174,50 +181,38 @@ class gaodeMap {
* @returns {string}
*/
getMarketContent(data) {
/* const dom = createPop(markerInfoWindow,{});
const html = dom.$el;
dom.remove();
switch (this.markerType) {
case DEVICE_TYPE.REGEULATORBOX: {
const dom = createPop(markerInfoWindow,{
title: "调压箱",
data: data,
map:map
});
const html = dom.$el;
dom.remove();
return html;
}
case DEVICE_TYPE.VALUEWELL: {
const dom = createPop(markerInfoWindow,{
title: "阀门井",
data: data,
map:map
});
const html = dom.$el;
dom.remove();
return html;
}
case DEVICE_TYPE.FLOWMETER: {
const dom = createPop(markerInfoWindow,{
title: "流量计",
data: data,
map:map
});
const html = dom.$el;
dom.remove();
return html;
}
case DEVICE_TYPE.DUTYPERSON: {
return html;
}
}*/
let html = "<div>" +
"<table>" +
"<tr>" +
"<td>所属燃气公司</td>" +
"<td>正元</td>" +
"</tr>" +
"<tr>" +
"<td>名称</td>" +
"<td>1234</td>" +
"</tr>" +
"<tr>" +
"<td>地址</td>" +
"<td>石家庄市新华区</td>" +
"</tr>" +
"</table>" +
"</div>";
switch (this.markerType){
case DEVICE_TYPE.REGEULATORBOX :{
return html;
}
case DEVICE_TYPE.VALUEWELL :{
return html;
}
case DEVICE_TYPE.FLOWMETER :{
return html;
}
}
}
......@@ -271,6 +266,14 @@ class gaodeMap {
marker.setIcon(icon);
break;
}
case DEVICE_TYPE.WORKORDER: {
let icon = new AMap.Icon({
//size: new AMap.Size(51, 23),
image: require("../assets/images/zhibaorenyuan.png"),
});
marker.setIcon(icon);
break;
}
}
}
......@@ -571,9 +574,17 @@ class gaodeMap {
device.obj = e.obj;
device.gaoMap = that;
e.obj.on("click", function(aa) {
console.log(aa,"fdsfdsfdsa===click")
let postion = aa.target._position;
//兼容拖拽后单击事件,拖拽后点击事件返回位置为数组
if(postion instanceof Array){
device.form.longitude = postion[0];
device.form.latitude = postion[1];
}else{
device.form.longitude = postion.lng;
device.form.latitude = postion.lat;
}
device.show();
});
}
......@@ -675,5 +686,35 @@ class gaodeMap {
}
);
}
searchTips(inputId){
let that = this;
AMap.plugin(['AMap.AutoComplete', 'AMap.PlaceSearch'], function () {
//输入提示
var autoOptions = {
input: inputId
};
var auto = new AMap.AutoComplete(autoOptions);
that.placeSearch = new AMap.PlaceSearch({
map: map
});
//构造地点查询类
auto.on('select', function(e){
console.log(e,"eeeeee========")
that.placeSearch.clear();
that.placeSearch.setCity(e.poi.adcode);
that.placeSearch.search(e.poi.name); //关键字查询查询
})
})
}
searchKeyWord(keyWord){
AMap.plugin(['AMap.AutoComplete'], function () {
var placeSearch = new AMap.PlaceSearch({
map: map
});
placeSearch.search(keyWord); //关键字查询查询
})
}
}
export default gaodeMap;
......@@ -89,6 +89,27 @@
</div>
<!-- <el-select
<el-input v-model="keyWord" placeholder="点击输入" id="tipinput" class="search-input"/>
<el-button type="red" icon="el-icon-search" class="search-but" @click="search()">搜索</el-button>
<el-button
type="primary"
style="position: absolute; top: 100px; left: 75%"
@click="addDevice"
>新增</el-button
>
<el-button
type="primary"
style="position: absolute; top: 100px; left: 82%"
@click="editDevice"
>编辑</el-button
>
<el-button
type="primary"
style="position: absolute; top: 100px; left: 90%"
@click="deleteDevice"
>删除</el-button
>
<el-select
v-model="value"
placeholder="请选择..."
@change="selectDeviceType"
......@@ -186,6 +207,7 @@ export default {
label: "压力表",
},
],
keyWord:""
};
},
mounted() {
......@@ -209,6 +231,7 @@ export default {
];
gaoMap.addPolyline(path);
gaoMap.addMouseTool();
gaoMap.searchTips("tipinput");
this.getDeviceInfo();
},
methods: {
......@@ -269,6 +292,7 @@ export default {
this.deviceType = false;
this.gaoMap.mapOperateType = "edit";
this.gaoMap.addMarkerDragg();
this.gaoMap.placeSearch.clear();
},
deleteDevice() {
this.targetNum = this.targetNum != 3 ? 3 : 0;
......@@ -278,6 +302,7 @@ export default {
this.deviceType = false;
this.gaoMap.mapOperateType = "delete";
this.gaoMap.removeMarkerDragg();
this.gaoMap.placeSearch.clear();
},
selectDeviceType(val) {
// if("add" == this.operationType){
......@@ -310,6 +335,10 @@ export default {
this.loading = false;
});
},
search(){
this.gaoMap.placeSearch.clear();
this.gaoMap.placeSearch.search(this.keyWord)
}
},
};
......@@ -522,5 +551,17 @@ input[type="radio"] {
width: 4rem;
margin-right: 1rem;
}
.search-input{
position: absolute;
top: 100px;
left: 2%;
width:240px;
}
.search-but{
position: absolute;
top: 100px; left: 19%;
width:85px;color: white;
background-color: #053B6A;
}
</style>
......@@ -60,11 +60,11 @@
<div style="color: #31EAEA;width: 100%;height: 40px;">
<ul><li>接单信息</li></ul>
</div>
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="margin-left: 50px;">
<el-form-item label="接单人:" prop="actualInspectorName">
<el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="margin-left: 50px;height: 30px;width: 100%;">
<el-form-item label="接单人:" prop="actualInspectorName" style="float: left;width: 250px;">
<font>{{form.actualInspectorName}}</font>
</el-form-item>
<el-form-item label="接单时间:" prop="actualTime">
<el-form-item label="接单时间:" prop="actualTime" style="float: left;">
<font>{{form.actualTime}}</font>
</el-form-item>
</el-form>
......@@ -140,7 +140,7 @@
import { listBasicsInfo, getBasicsInfo, delBasicsInfo, addBasicsInfo, updateBasicsInfo, exportBasicsInfo } from "@/api/workOrder/basicsInfo";
import gaodeMap from "utils/gaodeMap.js"
import {map} from "utils/gaodeMap.js"
import {map, DEVICE_TYPE} from "utils/gaodeMap.js"
export default {
name: "BasicsInfo",
components: {
......@@ -201,7 +201,6 @@ export default {
created() {
// 如果是跳转来的,则接受初始化参数
// this.user_id = this.$route.query.id; //详细信息页接收参数
console.log(this.$route.query.orderId,"12234==========")
this.orderId = this.$route.query.orderId;
this.getList();
......@@ -215,6 +214,9 @@ export default {
},
mounted(){
let map = new gaodeMap("平山");
let data = {longitude:"114.208371",latitude:"38.267036"}
map.addMarker(DEVICE_TYPE.WORKORDER,data)
},
methods: {
......@@ -241,7 +243,6 @@ export default {
getBasicsInfo(this.orderId).then(response =>{
this.form = response.data;
this.active = parseInt(response.data.orderStatus) + 1;
console.log("response.data",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