Commit 2b50332d authored by 耿迪迪's avatar 耿迪迪

值班人员接口修改 gengdidi

parent 4e8e021e
...@@ -3,10 +3,12 @@ package com.zehong.web.controller.deviceInspection; ...@@ -3,10 +3,12 @@ package com.zehong.web.controller.deviceInspection;
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.SysUser;
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;
import com.zehong.system.domain.TInspectionData; import com.zehong.system.domain.TInspectionData;
import com.zehong.system.domain.form.InspectionDataFrom;
import com.zehong.system.service.ITInspectionDataService; import com.zehong.system.service.ITInspectionDataService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
...@@ -104,4 +106,9 @@ public class TInspectionDataController extends BaseController ...@@ -104,4 +106,9 @@ public class TInspectionDataController extends BaseController
{ {
return toAjax(tInspectionDataService.deleteTInspectionDataByIds(dataIds)); return toAjax(tInspectionDataService.deleteTInspectionDataByIds(dataIds));
} }
@GetMapping("getInspectionDataByInspector")
public AjaxResult getInspectionDataByInspector(InspectionDataFrom form) throws Exception {
return AjaxResult.success(tInspectionDataService.getInspectionDataByInspector(form));
}
} }
...@@ -72,9 +72,9 @@ public class SysUserController extends BaseController ...@@ -72,9 +72,9 @@ public class SysUserController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:user:inspectorList')") @PreAuthorize("@ss.hasPermi('system:user:inspectorList')")
@GetMapping("/inspectorList") @GetMapping("/inspectorList")
public AjaxResult inspectorList() public AjaxResult inspectorList(SysUser sysUser)
{ {
List<SysUser> list = userService.selectInspectorList(); List<SysUser> list = userService.selectInspectorList(sysUser);
return AjaxResult.success(list); return AjaxResult.success(list);
} }
......
package com.zehong.system.domain.form;
import java.util.Date;
public class InspectionDataFrom {
private Long userId;
private Date beginTime;
private Date endTime;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
}
package com.zehong.system.domain.vo;
import com.zehong.common.core.domain.entity.SysUser;
import java.util.List;
public class InspectionDataVo {
private SysUser sysUser;
private List<TInspectionDataVo> inspectionDataVo;
public SysUser getSysUser() {
return sysUser;
}
public void setSysUser(SysUser sysUser) {
this.sysUser = sysUser;
}
public List<TInspectionDataVo> getInspectionDataVo() {
return inspectionDataVo;
}
public void setInspectionDataVo(List<TInspectionDataVo> inspectionDataVo) {
this.inspectionDataVo = inspectionDataVo;
}
}
package com.zehong.system.domain.vo;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TInspectionData;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 巡检记录对象 t_inspection_data
*
* @author zehong
* @date 2021-07-21
*/
public class TInspectionDataVo extends TInspectionData
{
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
public BigDecimal getLongitude() {
return longitude;
}
public void setLongitude(BigDecimal longitude) {
this.longitude = longitude;
}
public BigDecimal getLatitude() {
return latitude;
}
public void setLatitude(BigDecimal latitude) {
this.latitude = latitude;
}
}
...@@ -25,7 +25,7 @@ public interface SysUserMapper ...@@ -25,7 +25,7 @@ public interface SysUserMapper
* @param * @param
* @return 用户信息集合信息 * @return 用户信息集合信息
*/ */
public List<SysUser> selectInspectorList(); public List<SysUser> selectInspectorList(SysUser sysUser);
/** /**
* 通过用户名查询用户 * 通过用户名查询用户
......
package com.zehong.system.mapper; package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TInspectionData; import com.zehong.system.domain.TInspectionData;
import java.util.List;
import java.util.Map;
/** /**
* 巡检记录Mapper接口 * 巡检记录Mapper接口
* *
...@@ -74,4 +76,6 @@ public interface TInspectionDataMapper ...@@ -74,4 +76,6 @@ public interface TInspectionDataMapper
* @return 结果 * @return 结果
*/ */
public int deleteTInspectionDataByIds(int[] dataIds); public int deleteTInspectionDataByIds(int[] dataIds);
List<TInspectionData> selectTInspectionDataListByMap(Map<String,Object> map);
} }
...@@ -24,7 +24,7 @@ public interface ISysUserService ...@@ -24,7 +24,7 @@ public interface ISysUserService
* @param * @param
* @return 用户信息集合信息 * @return 用户信息集合信息
*/ */
public List<SysUser> selectInspectorList(); public List<SysUser> selectInspectorList(SysUser sysUser);
/** /**
* 通过用户名查询用户 * 通过用户名查询用户
......
package com.zehong.system.service; package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.system.domain.TInspectionData; import com.zehong.system.domain.TInspectionData;
import com.zehong.system.domain.form.InspectionDataFrom;
import com.zehong.system.domain.vo.InspectionDataVo;
/** /**
* 巡检记录Service接口 * 巡检记录Service接口
...@@ -58,4 +62,6 @@ public interface ITInspectionDataService ...@@ -58,4 +62,6 @@ public interface ITInspectionDataService
* @return 结果 * @return 结果
*/ */
public int deleteTInspectionDataById(int dataId); public int deleteTInspectionDataById(int dataId);
List<InspectionDataVo> getInspectionDataByInspector(InspectionDataFrom form) throws Exception;
} }
...@@ -73,9 +73,9 @@ public class SysUserServiceImpl implements ISysUserService ...@@ -73,9 +73,9 @@ public class SysUserServiceImpl implements ISysUserService
* @return 用户信息集合信息 * @return 用户信息集合信息
*/ */
@Override @Override
public List<SysUser> selectInspectorList() public List<SysUser> selectInspectorList(SysUser sysUser)
{ {
return userMapper.selectInspectorList(); return userMapper.selectInspectorList(sysUser);
} }
/** /**
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.List; import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import com.zehong.common.utils.StringUtils;
import org.springframework.stereotype.Service; import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.mapper.TInspectionDataMapper;
import com.zehong.system.domain.TInspectionData; import com.zehong.system.domain.TInspectionData;
import com.zehong.system.domain.TInspectionPlan;
import com.zehong.system.domain.form.InspectionDataFrom;
import com.zehong.system.domain.form.TWorkOrderForm;
import com.zehong.system.domain.vo.InspectionDataVo;
import com.zehong.system.domain.vo.TInspectionDataVo;
import com.zehong.system.domain.vo.WorkOrderVo;
import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.mapper.TInspectionDataMapper;
import com.zehong.system.service.ISysUserService;
import com.zehong.system.service.ITInspectionDataService; import com.zehong.system.service.ITInspectionDataService;
import com.zehong.system.service.ITInspectionPlanService;
import com.zehong.system.service.ITWorkOrderService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 巡检记录Service业务层处理 * 巡检记录Service业务层处理
...@@ -17,9 +36,21 @@ import com.zehong.system.service.ITInspectionDataService; ...@@ -17,9 +36,21 @@ import com.zehong.system.service.ITInspectionDataService;
@Service @Service
public class TInspectionDataServiceImpl implements ITInspectionDataService public class TInspectionDataServiceImpl implements ITInspectionDataService
{ {
@Autowired @Resource
private TInspectionDataMapper tInspectionDataMapper; private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private ISysUserService userService;
@Autowired
private ITWorkOrderService itWorkOrderService;
@Autowired
private ITInspectionPlanService itInspectionPlanService;
@Resource
private TDeviceInfoMapper tDeviceInfoMapper;
/** /**
* 查询巡检记录 * 查询巡检记录
* *
...@@ -93,4 +124,66 @@ public class TInspectionDataServiceImpl implements ITInspectionDataService ...@@ -93,4 +124,66 @@ public class TInspectionDataServiceImpl implements ITInspectionDataService
{ {
return tInspectionDataMapper.deleteTInspectionDataById(dataId); return tInspectionDataMapper.deleteTInspectionDataById(dataId);
} }
/**
* 获取值班人员巡检路线
*/
@Override
public List<InspectionDataVo> getInspectionDataByInspector(InspectionDataFrom form) throws Exception {
List<InspectionDataVo> result = new ArrayList<>();
if(null == form.getUserId()){
//获取巡检人员
List<SysUser> inspectorlist = userService.selectInspectorList(new SysUser());
for(SysUser inspector : inspectorlist){
InspectionDataVo inspectionDataVo = new InspectionDataVo();
inspectionDataVo.setSysUser(inspector);
form.setUserId(inspector.getUserId());
inspectionDataVo.setInspectionDataVo(getinspectionDataVo(form));
result.add(inspectionDataVo);
}
}else{
InspectionDataVo inspectionDataVo = new InspectionDataVo();
SysUser user = userService.selectUserById(form.getUserId());
inspectionDataVo.setSysUser(user);
inspectionDataVo.setInspectionDataVo(getinspectionDataVo(form));
result.add(inspectionDataVo);
}
return result;
}
private List<TInspectionDataVo> getinspectionDataVo(InspectionDataFrom form) throws Exception {
//获取巡检人员工单
TWorkOrderForm workOrderForm = new TWorkOrderForm();
workOrderForm.setAppointInspector(form.getUserId());
List<WorkOrderVo> workOrderInfo = itWorkOrderService.selectTWorkOrderList(workOrderForm);
List<TInspectionDataVo> inspectionDataVos = new ArrayList<>();
for(WorkOrderVo workOrder : workOrderInfo ){
//获取巡检人员巡检计划
TInspectionPlan tInspectionPlan = new TInspectionPlan();
tInspectionPlan.setOrderId(workOrder.getOrderId());
List<TInspectionPlan> inspectionPlans = itInspectionPlanService.selectTInspectionPlanList(tInspectionPlan);
for(TInspectionPlan inspectionPlan : inspectionPlans){
//获取巡检员巡检记录
Map<String,Object> map = new HashMap<>();
map.put("planId",inspectionPlan.getPlanId());
map.put("beginTime",form.getBeginTime());
map.put("endTime",form.getEndTime());
List<TInspectionData> inspectionDataList = tInspectionDataMapper.selectTInspectionDataListByMap(map);
//查询设备信息
for(TInspectionData inspectionData : inspectionDataList){
TInspectionDataVo tInspectionDataVo = new TInspectionDataVo();
TDeviceInfo device = tDeviceInfoMapper.selectTDeviceInfoByCode(inspectionData.getDeviceCode());
BeanUtils.copyProperties(inspectionData, tInspectionDataVo);
tInspectionDataVo.setLatitude(device.getLatitude());
tInspectionDataVo.setLongitude(device.getLongitude());
inspectionDataVos.add(tInspectionDataVo);
}
}
}
return inspectionDataVos;
}
} }
...@@ -91,9 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -91,9 +91,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where u.user_id = #{userId} where u.user_id = #{userId}
</select> </select>
<select id="selectInspectorList" resultMap="SysUserResult"> <select id="selectInspectorList" parameterType="SysUser" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.del_flag = '0' and r.role_key = 'inspector' where u.del_flag = '0' and r.role_key = 'inspector'
<if test="userId != null and userId != ''">
AND u.user_id = 'user_id'
</if>
</select> </select>
<select id="checkUserNameUnique" parameterType="String" resultType="int"> <select id="checkUserNameUnique" parameterType="String" resultType="int">
......
...@@ -30,6 +30,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -30,6 +30,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isHiddenDanger != null and isHiddenDanger != ''"> and is_hidden_danger = #{isHiddenDanger}</if> <if test="isHiddenDanger != null and isHiddenDanger != ''"> and is_hidden_danger = #{isHiddenDanger}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where> </where>
ORDER BY create_time DESC
</select>
<select id="selectTInspectionDataListByMap" parameterType="java.util.Map" resultMap="TInspectionDataResult">
<include refid="selectTInspectionDataVo"/>
<where>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="deviceCode != null "> and device_code = #{deviceCode}</if>
<if test="deviceType != null "> and device_type = #{deviceType}</if>
<if test="dealStatus != null and dealStatus != ''"> and deal_status = #{dealStatus}</if>
<if test="isHiddenDanger != null and isHiddenDanger != ''"> and is_hidden_danger = #{isHiddenDanger}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="beginTime != null and endTime !=null"> and create_time BETWEEN #{beginTime} and #{endTime}</if>
</where>
ORDER BY create_time DESC
</select> </select>
<select id="selectFinishTInspectionData" parameterType="int" resultType="int"> <select id="selectFinishTInspectionData" parameterType="int" resultType="int">
......
...@@ -60,3 +60,11 @@ export function exportInspectionData(query) { ...@@ -60,3 +60,11 @@ export function exportInspectionData(query) {
params: query params: query
}) })
} }
export function getInspectionDataByInspector(query) {
return request({
url: '/deviceInspection/inspectionData/getInspectionDataByInspector',
method: 'get',
params: query
})
}
...@@ -18,7 +18,8 @@ export const DEVICE_TYPE = { ...@@ -18,7 +18,8 @@ export const DEVICE_TYPE = {
FLOWMETER: "4", FLOWMETER: "4",
DUTYPERSON: "5", DUTYPERSON: "5",
WORKORDER: "6", WORKORDER: "6",
PRESSUREGAGE: "7" PRESSUREGAGE: "7",
INSPECTOR: "8"
}; };
class gaodeMap { class gaodeMap {
// 所有线的数组 // 所有线的数组
...@@ -158,7 +159,7 @@ class gaodeMap { ...@@ -158,7 +159,7 @@ 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) { 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);
...@@ -349,7 +350,7 @@ class gaodeMap { ...@@ -349,7 +350,7 @@ class gaodeMap {
case DEVICE_TYPE.DUTYPERSON: { case DEVICE_TYPE.DUTYPERSON: {
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/zhibaorenyuan.png") image: require("../assets/images/zhibanrenyuan.png")
}); });
marker.setIcon(icon); marker.setIcon(icon);
break; break;
...@@ -357,7 +358,7 @@ class gaodeMap { ...@@ -357,7 +358,7 @@ class gaodeMap {
case DEVICE_TYPE.WORKORDER: { case DEVICE_TYPE.WORKORDER: {
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/zhibaorenyuan.png") image: require("../assets/images/zhibanrenyuan.png")
}); });
marker.setIcon(icon); marker.setIcon(icon);
break; break;
...@@ -370,6 +371,14 @@ class gaodeMap { ...@@ -370,6 +371,14 @@ class gaodeMap {
marker.setIcon(icon); marker.setIcon(icon);
break; break;
} }
case DEVICE_TYPE.INSPECTOR: {
let icon = new AMap.Icon({
//size: new AMap.Size(51, 23),
image: require("../assets/images/zhibanrenyuan.png")
});
marker.setIcon(icon);
break;
}
} }
} }
......
...@@ -100,6 +100,7 @@ import gaodeMap from "utils/gaodeMap.js"; ...@@ -100,6 +100,7 @@ import gaodeMap from "utils/gaodeMap.js";
import { pipeAllInfoList } from "@/api/device/pipe.js"; import { pipeAllInfoList } from "@/api/device/pipe.js";
import { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMap.js"; import { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMap.js";
import { getAllDeviceInfo } from "@/api/device/deviceInfo"; import { getAllDeviceInfo } from "@/api/device/deviceInfo";
import { getInspectionDataByInspector } from "@/api/deviceInspection/inspectionData"
export default { export default {
data() { data() {
return { return {
...@@ -159,6 +160,7 @@ export default { ...@@ -159,6 +160,7 @@ export default {
gaoMap.searchTips("tipinput"); gaoMap.searchTips("tipinput");
this.getDeviceInfo(); this.getDeviceInfo();
this.getPipeList(); this.getPipeList();
this.getInspectionDataByInspector();
}, },
// 左边的Bar修改值 // 左边的Bar修改值
leftBarChange(item) { leftBarChange(item) {
...@@ -349,6 +351,19 @@ export default { ...@@ -349,6 +351,19 @@ export default {
} }
}); });
}, },
getInspectionDataByInspector(){
getInspectionDataByInspector().then((res) =>{
if(res.code == 200){
for(var i =0; i<res.data.length; i++){
console.log(res.data[i].inspectionDataVo[0],"fdafdsfd================")
this.gaoMap.addMarker(
DEVICE_TYPE.INSPECTOR,
res.data[i].inspectionDataVo[0]
);
}
}
});
},
searchClear() { searchClear() {
this.iconClass = "icon-create"; this.iconClass = "icon-create";
this.createValue = 0; this.createValue = 0;
......
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