import request from '../utils/gw_ajax_request.js';

const baseurl = '';

// 获取人员   地图
export function getPersonListForMap(data) {
  return request({
    url: baseurl + '/pers/position/findPersListByOrgId',
    method: 'get',
    params: data,
  });
}
// 获取人员工作情况
export function getPersonGzqk(persId) {
  return request({
    url: baseurl + '/dc/general/info/getWorkInfoByPersId',
    method: 'get',
    params: {
      persId: persId,
    },
  });
}
// 获取人员工作情况
export function getPersonGzqkPointList(persId, lon, lat) {
  return request({
    url: baseurl + '/dc/general/info/getSttmEntmByPersId',
    method: 'get',
    params: {
      persId: persId,
      lon: lon,
      lat: lat,
    },
  });
}
//获取人员轨迹
export function getPersonTrack(userId, sttm, ettm) {
  return request({
    url: baseurl + '/pers/position/fingPositionByPersid',
    method: 'get',
    params: {
      persid: userId,
      sttm: sttm,
      entm: ettm,
    },
  });
}
// 获取所有水库列表
export function getSkList(data) {
  return request({
    url: baseurl + '/dc/general/info/getRsSupData',
    method: 'POST',
    data: data,
  });
}
//获取农村饮水工程基础信息  查询基础表
export function getNcysgcBaseInfo(cwsCode) {
  return request({
    url: baseurl + '/dc/att/cwsBase/' + cwsCode,
    method: 'GET',
    params: {},
  });
}
//获取水库基础信息  查询基础表
export function getResBaseInfo(resCode) {
  return request({
    url: baseurl + '/dc/att/rsBase/' + resCode,
    method: 'GET',
    params: {},
  });
}
//获取地下水基础信息  查询基础表
export function getDxsBaseInfo(code) {
  return request({
    url: baseurl + '/dc/insp/base/getGroundWaterByCode',
    method: 'GET',
    params: {
      code: code,
    },
  });
}
//获取150县基础信息  查询基础表
export function get150BaseInfo(adCode) {
  return request({
    url: baseurl + '/dc/insp/base/getAdXByCode',
    method: 'GET',
    params: {
      code: adCode,
    },
  });
}
//获取水源地基础信息  查询基础表
export function getSydBaseInfo(adCode) {
  return request({
    url: baseurl + '/dc/insp/proSourceProtect/' + adCode,
    method: 'GET',
    params: {},
  });
}

//获取水毁基础信息  查询基础表
export function getShuihuiBaseInfo(adCode) {
  return request({
    url: baseurl + '/dc/insp/base/getWtdstByCode',
    method: 'GET',
    params: {
      code: adCode,
    },
  });
}
//获取水毁基础信息  查询基础表
export function getShuizaBaseInfo(objCode) {
  return request({
    url: baseurl + '/att/waga/base/' + objCode,
    method: 'GET',
  });
}

//获取172  查询基础表
export function get172BaseInfo(code) {
  return request({
    url: baseurl + '/bis/insp/empwtprj/base/' + code,
    method: 'GET',
  });
}
//获取取水口 查询基础表
export function getQskBaseInfo(code) {
  return request({
    url: baseurl + '/dc/insp/base/getWainByCode?code=' + code,
    method: 'GET',
  });
}
//获取水源地基础信息  查询基础表
export function getSydNewBaseInfo(id) {
  return request({
    url: baseurl + '/dc/att/swhs/base/' + id,
    method: 'GET',
    params: {},
  });
}
//获取3水毁工程 2行政村
export function getShgcListForMap(
  persGuid,
  objType,
  adCode,
  maxLgtd,
  maxLttd,
  minLgtd,
  minLttd,
  desWasuScal,
) {
  return request({
    url: baseurl + '/dc/insp/obj/getObjByPersId',
    method: 'get',
    params: {
      persGuid: persGuid,
      adCode: adCode,
      objType: objType,
      maxLgtd: maxLgtd,
      maxLttd: maxLttd,
      minLgtd: minLgtd,
      minLttd: minLttd,
      desWasuScal: desWasuScal,
    },
  });
}
// 添加兴趣点
export function addInterest(des, inteName, inteTime, lgtd, lttd, persid) {
  return request({
    url: '/dc/general/info/insertInte',
    method: 'POST',
    data: {
      des: des,
      inteName: inteName,
      inteTime: inteTime,
      lgtd: lgtd,
      lttd: lttd,
      persid: persid,
    },
  });
}
//获取兴趣点列表
export function getMyBiaoJi(userId, bjName, sttm, entm, pageIndex, pageSize) {
  return request({
    url: baseurl + '/dc/general/info/getIntePage',
    method: 'get',
    params: {
      persGuid: userId,
      name: bjName,
      sttm: sttm,
      entm: entm,
      pageNum: pageIndex,
      pageSize: pageSize,
    },
  });
}
//删除兴趣点
export function deleteMyBiaoJi(id) {
  return request({
    url: baseurl + '/dc/general/info/deleteInte',
    method: 'get',
    params: {
      id: id,
    },
  });
}
// 编辑兴趣点
export function editInterest(id, inteName, des, inteTime) {
  return request({
    url: '/dc/general/info/updateInte',
    method: 'POST',
    data: {
      id: id,
      des: des,
      inteName: inteName,
      inteTime: inteTime,
    },
  });
}
// 获取所有水闸
export function getAllSZList(
  adCode,
  maxLgtd,
  maxLttd,
  minLgtd,
  minLttd,
  gateFlow,
  displayLevel,
) {
  return request({
    url: '/att/waga/base/getWagaList',
    method: 'POST',
    data: {
      adCode: adCode,
      maxLgtd: maxLgtd,
      maxLttd: maxLttd,
      minLgtd: minLgtd,
      minLttd: minLttd,
      gateFlow: '',
      displayLevel: displayLevel,
    },
  });
}
// 获取所有取水口
export function getAllQskList(
  adCode,
  maxLgtd,
  maxLttd,
  minLgtd,
  minLttd,
  wintFlow,
  displayLevel,
) {
  return request({
    url: '/att/wain/base/findListByPersId',
    method: 'get',
    params: {
      adCode: adCode,
      maxLgtd: maxLgtd,
      maxLttd: maxLttd,
      minLgtd: minLgtd,
      minLttd: minLttd,
      wintFlow: '',
      displayLevel: displayLevel,
    },
  });
}
// 获取地表水水源地
export function getDbssyd(
  adCode,
  maxLgtd,
  maxLttd,
  minLgtd,
  minLttd,
  desAnnWasuPop,
  displayLevel,
) {
  return request({
    url: '/dc/att/swhs/base/findList',
    method: 'POST',
    data: {
      adCode: adCode,
      maxLgtd: maxLgtd,
      maxLttd: maxLttd,
      minLgtd: minLgtd,
      minLttd: minLttd,
      desAnnWasuPop: '',
      displayLevel: displayLevel,
    },
  });
}
// 获取水文站
export function getSwenz(adCode, maxLgtd, maxLttd, minLgtd, minLttd, frgrd) {
  return request({
    url: '/st/stbprp/base/findList',
    method: 'POST',
    data: {
      adCode: adCode,
      maxLgtd: maxLgtd,
      maxLttd: maxLttd,
      minLgtd: minLgtd,
      minLttd: minLttd,
      frgrd: frgrd,
    },
  });
}
// 获取扶贫县不分页
export function getFuPinXianList(data) {
  return request({
    url: '/att/pkx/base/list',
    method: 'POST',
    data: data,
  });
}
// 获取扶贫县 分页
export function getFuPinXianPage(data) {
  return request({
    url: '/att/pkx/base/page',
    method: 'POST',
    data: data,
  });
}
// 综合信息  模糊查询
export function queryByName(obj) {
  return request({
    url: '/dc/general/info/getObjByNameAndType',
    method: 'get',
    params: obj,
  });
}
//根据个人id获取路书列表
export function getLushuList(persId) {
  return request({
    url: '/bis/insp/travel/plan/getMyTravelPlan/' + persId,
    method: 'get',
    params: {},
  });
}
//添加路书
export function addLushuHandler(data) {
  return request({
    url: '/bis/insp/travel/plan/add',
    method: 'POST',
    data: data,
  });
}
//删除路书
export function deleteLushuHandler(id) {
  return request({
    url: '/bis/insp/travel/plan/delete/' + id,
    method: 'POST',
    data: {},
  });
}
//删除分享的路书
export function deleteShareLushuHandler(id) {
  return request({
    url: '/bis/insp/travel/plan/share/delete/' + id,
    method: 'POST',
    data: {},
  });
}
//收藏路书
export function collectRoadbookHandler(data) {
  return request({
    url: '/bis/insp/travel/plan/sharePoint',
    method: 'POST',
    params: data,
  });
}
// 分享路书
export function shareRoadbookHandler(data) {
  return request({
    url: '/bis/insp/travel/plan/share/addList',
    method: 'POST',
    data: data,
  });
}
// 分享给我的路书列表
export function getShareLushuList(data) {
  return request({
    url: '/bis/insp/travel/plan/share/findList',
    method: 'POST',
    data: data,
  });
}
// 更新排序后的路书列表
export function updateLocationSort(data) {
  return request({
    url: '/bis/insp/travel/plan/point/addList',
    method: 'POST',
    data: data,
  });
}
//根据id获取路书详情
export function getLushuDetail(id) {
  return request({
    url: '/bis/insp/travel/plan/' + id,
    method: 'get',
    params: {},
  });
}
//编辑路书基本信息
export function editLushuHandler(data) {
  return request({
    url: '/bis/insp/travel/plan/update',
    method: 'POST',
    data: data,
  });
}
//获取路书日程列表
export function getLushuDayList(id) {
  return request({
    url: '/bis/insp/travel/plan/day/getTravelPlanDay/' + id,
    method: 'get',
    params: {},
  });
}
//添加路书日程到路书
export function addDayToLushu(data) {
  return request({
    url: '/bis/insp/travel/plan/day/add',
    method: 'POST',
    data: data,
  });
}
//删除日程
export function deleteDay(id) {
  return request({
    url: '/bis/insp/travel/plan/day/delete/' + id,
    method: 'POST',
    data: {},
  });
}
//给某一天 添加点
export function addPointToDay(data) {
  return request({
    url: '/bis/insp/travel/plan/point/add',
    method: 'POST',
    data: data,
  });
}
//获取路书某一天的途经点信息
export function getPointByDayId(id) {
  return request({
    url: '/bis/insp/travel/plan/point/getPointByDayId/' + id,
    method: 'get',
    params: {},
  });
}
//从某一天中删除某一点
export function deletePoint(id) {
  return request({
    url: '/bis/insp/travel/plan/point/delete/' + id,
    method: 'POST',
    data: {},
  });
}
//给某一天 添加点之后 更新两点之间距离及驾车所需时间
export function updatePoint(data) {
  return request({
    url: '/bis/insp/travel/plan/point/update',
    method: 'POST',
    data: data,
  });
}
//根据人员id获取所属督查组
export function getTreeDataApi(data) {
  return request({
    url: '/dc/user/getGroupByPersid',
    method: 'GET',
    params: data,
  });
}
// 路书关联督查计划
export function connectToPlanApi(data) {
  return request({
    url: '/bis/insp/travel/plan/update',
    method: 'POST',
    data: data,
  });
}
// 根据督查组id获取路书列表
export function getLushuListByGroupid(groupId) {
  return request({
    url: `/bis/insp/travel/plan/getTravelByPlanId/${groupId}`,
    method: 'GET',
  });
}
// 下载路书行程
export function downloadRoadbook(data) {
  return request({
    url: `/bis/insp/travel/plan/getTravelPlanInfo`,
    method: 'POST',
    params: data,
  });
}
