Commit f87b2b09 authored by 耿迪迪's avatar 耿迪迪

值班人员文件还原 gengdidi

parent ee14ceb8
......@@ -3,12 +3,10 @@ package com.zehong.web.controller.deviceInspection;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TInspectionData;
import com.zehong.system.domain.form.InspectionDataFrom;
import com.zehong.system.service.ITInspectionDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -106,9 +104,4 @@ public class TInspectionDataController extends BaseController
{
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
*/
@PreAuthorize("@ss.hasPermi('system:user:inspectorList')")
@GetMapping("/inspectorList")
public AjaxResult inspectorList(SysUser sysUser)
public AjaxResult inspectorList()
{
List<SysUser> list = userService.selectInspectorList(sysUser);
List<SysUser> list = userService.selectInspectorList();
return AjaxResult.success(list);
}
......
......@@ -25,7 +25,7 @@ public interface SysUserMapper
* @param
* @return 用户信息集合信息
*/
public List<SysUser> selectInspectorList(SysUser sysUser);
public List<SysUser> selectInspectorList();
/**
* 通过用户名查询用户
......
package com.zehong.system.mapper;
import com.zehong.system.domain.TInspectionData;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TInspectionData;
/**
* 巡检记录Mapper接口
......@@ -76,6 +74,4 @@ public interface TInspectionDataMapper
* @return 结果
*/
public int deleteTInspectionDataByIds(int[] dataIds);
List<TInspectionData> selectTInspectionDataListByMap(Map<String,Object> map);
}
......@@ -24,7 +24,7 @@ public interface ISysUserService
* @param
* @return 用户信息集合信息
*/
public List<SysUser> selectInspectorList(SysUser sysUser);
public List<SysUser> selectInspectorList();
/**
* 通过用户名查询用户
......
package com.zehong.system.service;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.system.domain.TInspectionData;
import com.zehong.system.domain.form.InspectionDataFrom;
import com.zehong.system.domain.vo.InspectionDataVo;
/**
* 巡检记录Service接口
......@@ -62,6 +58,4 @@ public interface ITInspectionDataService
* @return 结果
*/
public int deleteTInspectionDataById(int dataId);
List<InspectionDataVo> getInspectionDataByInspector(InspectionDataFrom form) throws Exception;
}
......@@ -73,9 +73,9 @@ public class SysUserServiceImpl implements ISysUserService
* @return 用户信息集合信息
*/
@Override
public List<SysUser> selectInspectorList(SysUser sysUser)
public List<SysUser> selectInspectorList()
{
return userMapper.selectInspectorList(sysUser);
return userMapper.selectInspectorList();
}
/**
......
package com.zehong.system.service.impl;
import com.zehong.common.core.domain.entity.SysUser;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TDeviceInfo;
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.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;
import com.zehong.system.mapper.TInspectionDataMapper;
import com.zehong.system.domain.TInspectionData;
import com.zehong.system.service.ITInspectionDataService;
/**
* 巡检记录Service业务层处理
......@@ -36,20 +17,8 @@ import java.util.Map;
@Service
public class TInspectionDataServiceImpl implements ITInspectionDataService
{
@Resource
private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private ISysUserService userService;
@Autowired
private ITWorkOrderService itWorkOrderService;
@Autowired
private ITInspectionPlanService itInspectionPlanService;
@Resource
private TDeviceInfoMapper tDeviceInfoMapper;
private TInspectionDataMapper tInspectionDataMapper;
/**
* 查询巡检记录
......@@ -124,66 +93,4 @@ public class TInspectionDataServiceImpl implements ITInspectionDataService
{
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,12 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where u.user_id = #{userId}
</select>
<select id="selectInspectorList" parameterType="SysUser" resultMap="SysUserResult">
<select id="selectInspectorList" resultMap="SysUserResult">
<include refid="selectUserVo"/>
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 id="checkUserNameUnique" parameterType="String" resultType="int">
......
......@@ -30,21 +30,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isHiddenDanger != null and isHiddenDanger != ''"> and is_hidden_danger = #{isHiddenDanger}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</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 id="selectFinishTInspectionData" parameterType="int" resultType="int">
......
......@@ -60,11 +60,3 @@ export function exportInspectionData(query) {
params: query
})
}
export function getInspectionDataByInspector(query) {
return request({
url: '/deviceInspection/inspectionData/getInspectionDataByInspector',
method: 'get',
params: query
})
}
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