import request from '@/utils/request'
/** 学生端----------------------------------------------------------------------- */
/* 资格申请------------------------------ */
// 获取当前登录用户信息

// 查询气瓶数据信息
export function getBottleInfo(query) {
  return request({
    url: '/laboratory/subject/getBottleInfo',
    method: 'get',
    params: query
  })
}

export function getLoginUser(query) {
  return request({
    url: '/airbottle/qualificationApplyManage/getLoginUser',
    method: 'get',
    params: query
  })
}
// 获取气瓶列表
export function getListGood(query) {
  return request({
    url: '/airbottle/taskManage/listGood',
    method: 'get',
    params: query
  })
}

// 新增资格申请
export function qualificationApplyAdd(data) {
  return request({
    url: '/airbottle/qualificationApplyManage',
    method: 'post',
    data: data
  })
}
// 获取资格申请列表
export function qualificationApplyList(query) {
  return request({
    url: '/airbottle/qualificationApplyManage/list',
    method: 'get',
    params: query
  })
}
// 获取资格申请详情
export function qualificationApplyDetail(query) {
  return request({
    url: '/airbottle/qualificationApplyManage/getById',
    method: 'get',
    params: query
  })
}
// 新增资格申请-重新提交
export function qualificationApplyAnew(data) {
  return request({
    url: '/airbottle/qualificationApply/reapply',
    method: 'post',
    data: data
  })
}
/* 用气申请------------------------------ */
// 获取使用气体列表
export function googsListGoogs(query) {
  return request({
    url: '/airbottle/googs/listGoogs',
    method: 'get',
    params: query
  })
}
// 新增用气申请
export function useAgsApplyAdd(data) {
  return request({
    url: '/airbottle/useAgsApplyManage',
    method: 'post',
    data: data
  })
}
// 获取用气申请列表
export function useAgsApplyList(query) {
  return request({
    url: '/airbottle/useAgsApplyManage/list',
    method: 'get',
    params: query
  })
}
// 获取资格申请详情
export function useAgsApplyDetail(query) {
  return request({
    url: '/airbottle/useAgsApplyManage/getById',
    method: 'get',
    params: query
  })
}
// 校验实验室的准入资格
export function getValidApply(query) {
  return request({
    url: '/laboratory/apply/getValidApply',
    method: 'get',
    params: query
  })
}
// 新增资格申请-重新提交
export function useAgsApplyAnew(data) {
  return request({
    url: '/airbottle/useAgsApplyManage/reapply',
    method: 'post',
    data: data
  })
}
/* 气瓶申请------------------------------ */
// 获取气瓶申请列表
export function gasApplyList(query) {
  return request({
    url: '/airbottle/taskManage/list',
    method: 'get',
    params: query
  })
}
// 获取气瓶申请详情
export function gasApplyDetail(data) {
  return request({
    url: '/airbottle/taskManage/'+data,
    method: 'get',
  })
}

/* 气瓶信息------------------------------ */
// 获取气瓶信息列表
export function gasInfoList(query) {
  return request({
    url: '/airbottle/taskManage/taskListDetail',
    method: 'get',
    params: query
  })
}
// 获取气瓶信息详情
export function gasInfoDetail(query) {
  return request({
    url: '/airbottle/taskManage/bottleDetails',
    method: 'get',
    params: query
  })
}
/** 管理端----------------------------------------------------------------------- */
/* 供应商管理 */
// 查询资质证照列表
export function certificateList(query) {
  return request({
    url: '/airbottle/qualification/certificate/list',
    method: 'get',
    params: query
  })
}
// 供应商管理-新增
export function supplierAdd(data) {
  return request({
    url: '/airbottle/supplier/add',
    method: 'post',
    data: data
  })
}
// 供应商管理-编辑
export function supplierUpdate(data) {
  return request({
    url: '/airbottle/supplier/update',
    method: 'put',
    data: data
  })
}
// 供应商管理-列表
export function supplierList(query) {
  return request({
    url: '/airbottle/supplier/list',
    method: 'get',
    params: query
  })
}
// 供应商管理-停用-启用
export function supplierStop(data) {
  return request({
    url: '/airbottle/supplier/stop/'+data.id+'/'+data.status,
    method: 'put',
  })
}
// 供应商管理-列表
export function supplierDelete(data) {
  return request({
    url: '/airbottle/supplier/'+data,
    method: 'delete',
  })
}
// 供应商管理-详情
export function supplierDetail(query) {
  return request({
    url: '/airbottle/supplier/'+query,
    method: 'get',
  })
}
// 供应商管理-未审核
export function supplierCheckList(query) {
  return request({
    url: '/airbottle/supplier/checkList',
    method: 'get',
    params: query
  })
}
// 供应商管理-未审核-审核
export function supplierCheck(data) {
  return request({
    url: '/airbottle/supplierSyntheticalAudit/edit',
    method: 'put',
    data: data
  })
}
// 供应商管理-审核记录列表
export function supplierCheckRecordList(query) {
  return request({
    url: '/airbottle/supplierSyntheticalAudit/list',
    method: 'get',
    params: query
  })
}
// 供应商管理-供应商名称校验
export function supplierNameVerify(query) {
  return request({
    url: '/airbottle/supplier/check',
    method: 'get',
    params: query
  })
}
//审核运输车辆列表
export function carCheckRecordList(query) {
  return request({
    url: '/airbottle/car/checkList',
    method: 'get',
    params: query
  })
}
//审核运输人员列表
export function userCheckRecordList(query) {
  return request({
    url: '/airbottle/user/checkList',
    method: 'get',
    params: query
  })
}
//审核记录列表
export function CheckRecordList(query) {
  return request({
    url: '/airbottle/supplierSyntheticalAudit/list',
    method: 'get',
    params: query
  })
}
// 运输车辆管理-详情
export function carDetail(query) {
  return request({
    url: '/airbottle/car/'+query,
    method: 'get',
  })
}
// 运输人员管理-详情
export function userDetail(query) {
  return request({
    url: '/airbottle/user/'+query,
    method: 'get',
  })
}


// 获取供应商详情-审核记录
export function supplierSyntheticalAudit(query) {
  return request({
    url: '/airbottle/supplierSyntheticalAudit/supplier/'+query,
    method: 'get',
  })
}

/* 资格管理 */
//资格管理-列表
export function qualificationList(query) {
  return request({
    url: '/airbottle/qualificationApplyManage/listManage',
    method: 'get',
    params: query
  })
}
//资格审核-列表
export function qualificationCheckList(query) {
  return request({
    url: '/airbottle/qualificationApplyManage/auditList',
    method: 'get',
    params: query
  })
}
//资格审核-详情
export function qualificationCheckDetail(query) {
  return request({
    url: '/airbottle/qualificationApplyManage/getById',
    method: 'get',
    params: query
  })
}
//资格审核-实验室负责人审核
export function qualificationlabCheck(data) {
  return request({
    url: '/airbottle/qualificationApplyManage/leadExamine',
    method: 'post',
    data: data
  })
}
//资格审核-实验中心审核
export function qualificationcenterCheck(data) {
  return request({
    url: '/airbottle/qualificationApplyManage/centerExamine',
    method: 'post',
    data: data
  })
}
/* 用气管理 */
//资格管理-列表
export function useGasManageList(query) {
  return request({
    url: '/airbottle/useAgsApplyManage/listManage',
    method: 'get',
    params: query
  })
}
//资格审核-列表
export function useGasManageCheckList(query) {
  return request({
    url: '/airbottle/useAgsApplyManage/auditList',
    method: 'get',
    params: query
  })
}
//资格审核-详情
export function useGasManageCheckDetail(query) {
  return request({
    url: '/airbottle/useAgsApplyManage/getById',
    method: 'get',
    params: query
  })
}
//资格审核-实验室负责人审核
export function useGasManagelabCheck(data) {
  return request({
    url: '/airbottle/useAgsApplyManage/leadExamine',
    method: 'post',
    data: data
  })
}
//资格审核-实验中心审核
export function useGasManagecenterCheck(data) {
  return request({
    url: '/airbottle/useAgsApplyManage/centerExamine',
    method: 'post',
    data: data
  })
}
/* 信息记录------------- */
//申领记录-列表
export function applyRecordList(query) {
  return request({
    url: '/airbottle/informationRecord/taskList',
    method: 'get',
    params: query
  })
}
//入库记录-列表
export function enterRecordList(query) {
  return request({
    url: '/airbottle/informationRecord/storageList',
    method: 'get',
    params: query
  })
}
//入库记录-详情
export function enterRecordDetail(query) {
  return request({
    url: '/airbottle/storageManage/getInfoById',
    method: 'get',
    params: query
  })
}
//出库记录-列表
export function outRecordList(query) {
  return request({
    url: '/airbottle/informationRecord/storageOutlist',
    method: 'get',
    params: query
  })
}
//出库记录-详情
export function outRecordDetail(query) {
  return request({
    url: '/airbottle/storageOutManage/getInfoById',
    method: 'get',
    params: query
  })
}
//出入库信息统计
export function outStatistics(query) {
  return request({
    url: '/airbottle/use/record/calcRepertory',
    method: 'get',
    params: query
  })
}
//气瓶申请统计
export function gasApplyStatistics(query) {
  return request({
    url: '/airbottle/use/record/calcApply',
    method: 'get',
    params: query
  })
}
//用气量统计
export function useGasStatistics(query) {
  return request({
    url: '/airbottle/use/record/calcAmount',
    method: 'get',
    params: query
  })
}
//使用记录
export function useRecordList(query) {
  return request({
    url: '/airbottle/use/record/list',
    method: 'get',
    params: query
  })
}
//使用记录-详情
export function useRecordDetail(query) {
  return request({
    url: '/airbottle/use/record/bottle/'+query,
    method: 'get',
  })
}
//异常记录
export function abnormalRecordList(query) {
  return request({
    url: '/airbottle/bottle/error/list',
    method: 'get',
    params: query
  })
}
//异常记录-详情
export function abnormalRecordDetail(query) {
  return request({
    url: '/airbottle/bottle/error/'+query,
    method: 'get',
    params: query
  })
}
//报警记录
export function alarmRecordList(query) {
  return request({
    url: '/airbottle/alarm/record/list',
    method: 'get',
    params: query
  })
}

/* 信息统计 */
//气瓶库存统计
export function gasStorageStatistics(query) {
  return request({
    url: '/airbottle/storage/calc/storage',
    method: 'get',
  })
}
//楼栋库存统计
export function buildingStorageStatistics(query) {
  return request({
    url: '/airbottle/storage/calc/build',
    method: 'get',
    params: query
  })
}
//实验室库存排名统计
export function labStorageStatistics(query) {
  return request({
    url: '/airbottle/storage/calc/location',
    method: 'get',
    params: query
  })
}
//信息统计查询气瓶入库列表
export function storageInfoList(query) {
  return request({
    url: '/airbottle/storage/info/list',
    method: 'get',
    params: query
  })
}
//信息统计查询气瓶入库列表-详情
export function storageInfoDetail(query) {
  return request({
    url: '/airbottle/use/record/bottle/record/'+query,
    method: 'get',
  })
}
/* 供应商信息------------------- */
/* 规格管理 */
//规格管理-新增
export function specificationAdd(data) {
  return request({
    url: '/airbottle/specification',
    method: 'post',
    data: data
  })
}
//规格管理-修改
export function specificationAnew(data) {
  return request({
    url: '/airbottle/specification',
    method: 'put',
    data: data
  })
}
//规格管理-列表
export function specificationList(query) {
  return request({
    url: '/airbottle/specification/list',
    method: 'get',
    params: query
  })
}
//规格管理-删除
export function specificationDelete(query) {
  return request({
    url: '/airbottle/specification/'+query,
    method: 'delete',
  })
}
//气瓶类目-列表
export function gasCategoryList(query) {
  return request({
    url: '/system/dict/data/listNotPower?dictType=qp_specification_category',
    method: 'get',
    params: query
  })
}
//危险源类型-列表
export function dangerList(query) {
  return request({
    url: '/system/dict/data/listNotPower?dictType=lab_hazard_type',
    method: 'get',
    params: query
  })
}
//规格管理-详情
export function specificationInfo(query) {
  return request({
    url: '/airbottle/specification/'+query,
    method: 'get',
  })
}
/* 货物信息 */
//货物信息-新增
export function airbottleGoogsAdd(data) {
  return request({
    url: '/airbottle/googs',
    method: 'post',
    data: data
  })
}
//货物信息-修改
export function airbottleGoogsAnew(data) {
  return request({
    url: '/airbottle/googs',
    method: 'put',
    data: data
  })
}
//货物信息-列表
export function airbottleGoogsList(query) {
  return request({
    url: '/airbottle/googs/list',
    method: 'get',
    params: query
  })
}
//货物信息-删除
export function airbottleGoogsDelete(query) {
  return request({
    url: '/airbottle/googs/'+query,
    method: 'delete',
  })
}
//货物信息-详情
export function airbottleGoogsDetail(query) {
  return request({
    url: '/airbottle/googs/'+query,
    method: 'get',
  })
}
/* 资质证照 */
//资质证照-新增
export function certificationAdd(data) {
  return request({
    url: '/airbottle/qualification/certificate',
    method: 'post',
    data: data
  })
}
//资质证照-修改
export function certificationAnew(data) {
  return request({
    url: '/airbottle/qualification/certificate',
    method: 'put',
    data: data
  })
}
//资质证照-列表
export function certificationList(query) {
  return request({
    url: '/airbottle/qualification/certificate/query',
    method: 'get',
    params: query
  })
}
//资质证照-删除
export function certificationDelete(query) {
  return request({
    url: '/airbottle/qualification/certificate/'+query,
    method: 'delete',
  })
}
//资质证照-详情
export function certificationInfo(query) {
  return request({
    url: '/airbottle/qualification/certificate/'+query,
    method: 'get',
  })
}
//供应商类型-列表
export function supplierTypeList(query) {
  return request({
    url: '/system/dict/data/list?pageNum=1&pageSize = 20&dictType=supplier_type',
    method: 'get',
    params: query
  })
}
//RFID识别器
export function RFIDTypeList(query) {
  return request({
    url: '/system/dict/data/list?pageNum=1&pageSize=20&dictType=manufacturer_type',
    method: 'get',
    params: query
  })
}


/* 识别器管理 */
//识别器管理-新增
export function recognizerAdd(data) {
  return request({
    url: '/algorithm/hardwareRfid/save',
    method: 'post',
    data: data
  })
}

//识别器管理-修改
export function recognizerAnew(data) {
  return request({
    url: '/algorithm/hardwareRfid/update',
    method: 'put',
    data: data
  })
}
//识别器管理-列表
export function recognizerList(query) {
  return request({
    url: '/algorithm/hardwareRfid/query',
    method: 'get',
    params: query
  })
}

//识别器管理-检测类型
export function recognizerNettyFrid(query) {
  return request({
    url: '/algorithm/rfid/config',
    method: 'get',
    params: query
  })
}
//识别器管理-启用禁用
export function recognizerSwitch(data) {
  return request({
    url: '/algorithm/hardwareRfid/startOrStop/'+data,
    method: 'PUT',
  })
}
//识别器管理-删除
export function recognizerDelete(data) {
  return request({
    url: '/algorithm/hardwareRfid/delete/'+data,
    method: 'delete',
  })
}

//识别器管理-详情
export function recognizerInfo(query) {
  return request({
    url: '/laboratory/hardware/'+query,
    method: 'get',
  })
}
// RFID标签-新增
export function RFIDtagAdd(data) {
  return request({
    url: '/airbottle/tag',
    method: 'post',
    data: data
  })
}
// RFID标签-列表
export function RFIDtagList(query) {
  return request({
    url: '/airbottle/tag/list',
    method: 'get',
    params: query
  })
}
// RFID标签-删除
export function RFIDtagDelete(data) {
  return request({
    url: '/airbottle/tag/'+data,
    method: 'delete',
  })
}



// 查询异常设备列表
export function listAbnormal(query) {
  return request({
    url: '/laboratory/abnormal/list',
    method: 'get',
    params: query
  })
}
// 新增异常设备
export function addAbnormal(data) {
  return request({
    url: '/laboratory/abnormal',
    method: 'post',
    data: data
  })
}
//根据名称查询实验室
export function subjectList(query) {
  return request({
    url: '/laboratory/subject/list/listAdmin',
    method: 'get',
    params: query
  })
}
// 查询院系列表
export function listDepartments() {
  return request({
    url: '/system/dept/departments/list',
    method: 'get'
  })
}
//根据名称查询姓名
export function selectUserListByName(query) {
  return request({
    url: '/system/user/selectUserListByName',
    method: 'get',
    params: query
  })
}
// 新增实验中心人员
export function labCenterPersonAdd(data) {
  return request({
    url: '/airbottle/flowDetail',
    method: 'post',
    data: data
  })
}
// 新增实验中心人员-列表
export function labCenterPersonList(query) {
  return request({
    url: '/airbottle/flowDetail/list',
    method: 'get',
    params: query
  })
}
// 新增实验中心人员-删除
export function labCenterPersonDelete(data) {
  return request({
    url: '/airbottle/flowDetail/'+data,
    method: 'delete',
  })
}

