import { jsonToFormData } from "@/utils/common";
import request from "@/utils/request";
//查询标准风机信息
export function getWindEngineGroupRatedListByFieldCodePage(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/getWindEngineGroupRatedListByFieldCodePage",
    method: "post",
    data,
  });
}
// 查询
export function getAllWindCompany(data) {
  return request({
    url: "/energy-manage-service/api/wind/company/getAllWindCompany",
    method: "post",
    data,
  });
}
// 新增
export function addCompany(data) {
  return request({
    url: "/energy-manage-service/api/wind/company/addCompany",
    method: "post",
    data,
  });
}
// 编辑
export function updateCompany(data) {
  return request({
    url: "/energy-manage-service/api/wind/company/updateCompany",
    method: "post",
    data,
  });
}
// 更改状态
export function updateStateCompany(data) {
  return request({
    url: "/energy-manage-service/api/wind/company/updateStateCompany",
    method: "post",
    data,
  });
}

// 省
export function findAllProvince(data) {
  return request({
    url: "/energy-manage-service/api/area/findAllProvince",
    method: "post",
    data,
  });
}

// 省
export function getCitiesByPId(data) {
  return request({
    url: "/energy-manage-service/api/area/getCitiesByPId",
    method: "get",
    data,
  });
}

//编辑回显
export function getWindCompany(data) {
  return request({
    url: "/energy-manage-service/api/wind/company/getWindCompany",
    method: "post",
    data,
  });
}

//删除
export function delCompany(data) {
  return request({
    url: "/energy-manage-service/api/wind/company/delCompany",
    method: "post",
    data,
  });
}
//企业查询风场
export function getWindFieldVos(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/getWindFieldVos",
    method: "post",
    data: jsonToFormData(data),
  });
}

// .........................测风塔页面
// 查询
export function getAnemometerTowerPage(data) {
  return request({
    url: "/energy-manage-service/api/anemometer/tower/getAnemometerTowerPage",
    method: "post",
    data,
  });
}
// 创建测风塔
export function createAnemometerTower(data) {
  return request({
    url: "/energy-manage-service/api/anemometer/tower/createAnemometerTower",
    method: "post",
    data,
  });
}

// 更新测风塔
export function updateAnemometerTower(data) {
  return request({
    url: "/energy-manage-service/api/anemometer/tower/updateAnemometerTower",
    method: "post",
    data,
  });
}

// 查看详情
export function getAnemometerTower(data) {
  return request({
    url: "/energy-manage-service/api/anemometer/tower/getAnemometerTower",
    method: "post",
    data,
  });
}

// 测风塔状态
export function updateAnemometerTowerState(data) {
  return request({
    url: "/energy-manage-service/api/anemometer/tower/updateAnemometerTowerState",
    method: "post",
    data,
  });
}

// 删除测风塔
export function delAnemometerTower(data) {
  return request({
    url: "/energy-manage-service/api/anemometer/tower/delAnemometerTower",
    method: "post",
    data,
  });
}

// .....................机型信息
// 查询
export function windEngineMillPage(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/mill/windEngineMillPage",
    method: "post",
    data,
  });
}

// 更改状态/修改
export function updateWindEngineMill(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/mill/updateWindEngineMill",
    method: "post",
    data,
  });
}

// 获取机型类型
export function getDictList(data) {
  return request({
    url: "/energy-manage-service/dict/getDictList",
    method: "post",
    data,
  });
}
// 创建机型
export function createEngineMill(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/mill/createEngineMill",
    method: "post",
    data,
  });
}

// 删除机型
export function delWindEngineMill(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/mill/delWindEngineMill",
    method: "post",
    data,
  });
}

// 机型详情
export function getWindEngineMillPageVo(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/mill/getWindEngineMillPageVo",
    method: "post",
    data,
  });
}
//
// 风机查询
export function windEngineGrouPage(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/windEngineGrouPage",
    method: "post",
    data,
  });
}
// 风机状态
export function updateStateWindEngineGroup(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/updateStateWindEngineGroup",
    method: "post",
    data,
  });
}

// 风机详情
export function getWindEngineGroup(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/getWindEngineGroup",
    method: "post",
    data,
  });
}

// 获取风场
export function getWindFieldNames(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/getWindFieldNames",
    method: "post",
    data,
  });
}

// 删除风机
export function delWindEngineGroup(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/delWindEngineGroup",
    method: "post",
    data,
  });
}

// 编辑风机
export function updateWindEngineGroup(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/updateWindEngineGroup",
    method: "post",
    data,
  });
}

// 创建
export function createWindEngineGroup(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/createWindEngineGroup",
    method: "post",
    data,
  });
}

// 关联机型
export function getWindEngineMillList(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/mill/getWindEngineMillList",
    method: "post",
    data,
  });
}

// 。。。。。。。。。。。。。。。。。。。。。。。。。
// 风场查询
export function WindFieldListPage(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/WindFieldListPage",
    method: "post",
    data,
  });
}
// 获取测风塔集合
export function getAnemometerTowerNameList(data) {
  return request({
    url: "/energy-manage-service/api/anemometer/tower/getAnemometerTowerNameList",
    method: "post",
    data,
  });
}

// 获取风场状态
export function updateWindFieldStateById(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/updateWindFieldStateById",
    method: "post",
    data,
  });
}

// 查看风场详情
export function getWindFieldVo(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/getWindFieldVo",
    method: "post",
    data,
  });
}

// 创建风场
export function createWindField(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/createWindField",
    method: "post",
    data,
  });
}

// 编辑风场
export function windFieldDto(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/WindFieldDto",
    method: "post",
    data,
  });
}

// 查看车缝他
export function getAnemometerTowerByField(data) {
  return request({
    url: "/energy-manage-service/api/anemometer/tower/getAnemometerTowerByField",
    method: "post",
    data,
  });
}

// 查看车缝他
export function delWindFieldById(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/delWindFieldById",
    method: "post",
    data,
  });
}

// 。。。。。。。。。。。。。。。。。。。。。上传下载

// 下载模板
export function getAllTemplate(data) {
  return request({
    url: "/energy-manage-service/sysTemplate/getAllTemplate",
    method: "post",
    data,
  });
}
// 机型上传附件
export function powerWordCriterionImportData(data) {
  return request({
    url: "/energy-manage-service/api/powerword/criterion/powerWordCriterionImportData",
    method: "post",
    data: jsonToFormData(data),
  });
}

// 风机上传附件
export function uploadFile(data) {
  return request({
    url: "/upload",
    method: "post",
    data,
  });
}

// 风场导入
export function windFieldImportData(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/windFieldImportData",
    method: "post",
    data: jsonToFormData(data),
  });
}

// 合同附件提交
export function powerWordContractImportData(data) {
  return request({
    url: "/energy-manage-service/api/powerword/contract/powerWordContractImportData",
    method: "post",
    data: jsonToFormData(data),
  });
}

// 风场导入
export function windEngineGroupImportData(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/windEngineGroupImportData",
    method: "post",
    data: jsonToFormData(data),
  });
}

// 风场资源文件上传
export function saveWindFieldResource(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/saveWindFieldResource",
    method: "post",
    data,
  });
}

// 风场资源文件删除
export function delWindFieldResource(data) {
  return request({
    url: "/energy-manage-service/api/wind/field/delWindFieldResource",
    method: "post",
    data,
  });
}

// 驾驶舱接口
// 获取统计数
export function getCompanyFieldNumberVo(data) {
  return request({
    url: "/energy-manage-service/sysOrganizationAuth/getCompanyFieldNumberVo",
    method: "post",
    data,
  });
}
// 驾驶舱tree树接口
export function getSysOrganizationAuthTreeByRoleId(data) {
  return request({
    url: "/energy-manage-service/sysOrganizationAuth/getSysOrganizationAuthTreeByRoleId",
    method: "post",
    data,
  });
}

// 电子地图接口
export function getWindEngineGroupByFieldCode(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/getWindEngineGroupByFieldCode",
    method: "post",
    data,
  });
}

// 驾驶舱右侧
export function queryStatistics(data) {
  return request({
    url: "/energy-manage-service/homePage/queryStatistics",
    method: "get",
    data,
  });
}

export function queryOptionRecords(data) {
  return request({
    url: "/energy-manage-service/homePage/queryOptionRecords",
    method: "get",
    data,
  });
}
// 风机异常信息
export function queryErrDescByEngine(data) {
  return request({
    url: "/energy-manage-service/analysisErr/queryErrDescByEngine",
    method: "get",
    data,
  });
}

// 获取批量更改
export function getWindEngineGroupListByFieldCode(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/getWindEngineGroupListByFieldCode",
    method: "post",
    data,
  });
}
// 获取批量更改
export function bathUpdateWindEngineGroup(data) {
  return request({
    url: "/energy-manage-service/api/wind/engine/group/bathUpdateWindEngineGroup",
    method: "post",
    data,
  });
}

// 合同功率曲线
export function getWindFieldContractByFieldCode(data) {
  return request({
    url: "/energy-manage-service/api/powerword/contract/getWindFieldContractByFieldCode",
    method: "post",
    data,
  });
}

// 删除合同功率曲线
export function delWindFieldContractById(data) {
  return request({
    url: "/energy-manage-service/api/powerword/contract/delWindFieldContractById",
    method: "post",
    data,
  });
}
