/*
 *    Copyright (c) 2018-2025, cyweb All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 */

import request from '/@/utils/request';

/**
 * 获取列表
 * @param query
 */
export const fetchList = (query?: any) => {
	return request({
		url: '/professional/teacherbase/page',
		method: 'get',
		params: query,
	});
};

/**
 * 新增
 * @param obj
 */
export const addObj = (obj: any) => {
	return request({
		url: '/professional/teacherbase/add',
		method: 'post',
		data: obj,
	});
};

/**
 * 获取详情
 * @param id
 */
export const getObj = (id: string | number) => {
	return request({
		url: `/professional/teacherbase/getById`,
		method: 'get',
		params: {
			id: id
		}
	});
};

/**
 * 删除
 * @param id
 */
export const delObj = (id: string | number) => {
	return request({
		url: `/professional/teacherbase/deleteById`,
		method: 'post',
		data: {
			id: id
		}
	});
};

/**
 * 更新
 * @param obj
 */
export const putObj = (obj: any) => {
	return request({
		url: '/professional/teacherbase/edit',
		method: 'post',
		data: obj,
	});
};

/**
 * 添加信息
 * @param obj
 */
export const addInformation = (obj: any) => {
	return request({
		url: '/professional/teacherbase/addInformation',
		method: 'post',
		data: obj,
	});
};

/**
 * 获取部门教师
 * @param obj
 */
export const getDeptTeacher = (obj: string | number) => {
	return request({
		url: `/professional/teacherbase/getDeptTeacher/${obj}`,
		method: 'get',
	});
};

/**
 * 获取所有信息列表
 */
export const getAllInfoAboutList = () => {
	return request({
		url: '/professional/teacherbase/getAllInfoAboutList',
		method: 'get',
	});
};

/**
 * 更新其他信息
 * @param obj
 */
export const updateOtherInfo = (obj: any) => {
	return request({
		url: '/professional/teacherbase/updateOtherInfo',
		method: 'post',
		data: obj,
	});
};

/**
 * 导出无图片用户
 */
export const exportNoImgUser = () => {
	return request({
		url: '/professional/teacherbase/exportNoImgUser',
		method: 'get',
	});
};

/**
 * 根据编号查询教师基础信息
 * @param obj
 */
export const queryTeacherBaseByNo = (obj: string | number) => {
	return request({
		url: `/professional/teacherbase/queryTeacherBaseByNo/${obj}`,
		method: 'get',
	});
};

/**
 * 查询教师信息（EMS）
 * @param obj
 */
export const queryTeacherInfoForEms = (obj: string | number) => {
	return request({
		url: `/professional/teacherbase/queryTeacherInfoForEms/${obj}`,
		method: 'get',
	});
};

// /**
//  * 根据编号查询教师基础信息（资产）
//  * @param obj
//  */
// export const queryTeacherBaseByNoByAssets = (obj: string | number) => {
// 	return request({
// 		url: `/professional/teacherbase/queryTeacherBaseByNoByAssets/${obj}`,
// 		method: 'get',
// 	});
// };

/**
 * 获取教师信息（EMS搜索）
 * @param query
 */
export const getTeacherInfoForEmsSearch = (query?: any) => {
	return request({
		url: '/professional/teacherbase/getTeacherInfoForEmsSearch',
		method: 'get',
		params: query,
	});
};

/**
 * 获取缺失的教师信息
 * @param query
 */
export const getMissTeacherInfo = (query?: any) => {
	return request({
		url: '/professional/teacherbase/getMissTeacherInfo',
		method: 'get',
		params: query,
	});
};

/**
 * 重置密码
 * @param data
 */
export const resetPassWord = (data: any) => {
	return request({
		url: '/professional/teacherbase/resetPassWord',
		method: 'post',
		data: data,
	});
};

/**
 * 获取我的教师编号
 */
export const getMyTeacherNo = () => {
	return request({
		url: '/professional/teacherbase/getMyTeacherNo',
		method: 'get',
	});
};

/**
 * 修改进出状态
 * @param data
 */
export const updateInout = (data: any) => {
	return request({
		url: '/professional/teacherbase/updateInout',
		method: 'post',
		data: data,
	});
};

/**
 * 导出教师信息
 * @param data
 */
export const exportTeacherInfo = (data: any) => {
	return request({
		url: '/professional/teacherbase/exportTeacherInfo',
		method: 'post',
		data: data,
	});
};

/**
 * 获取教师基础列表
 * @param query
 */
export const getTeacherBaseList = (query?: any) => {
	return request({
		url: '/professional/teacherbase/TeacherBaseList',
		method: 'get',
		params: query,
	});
};

/**
 * 带权限的教师列表
 * @param query
 */
export const teacherListWithPermission = (query?: any) => {
	return request({
		url: '/professional/teacherbase/teacherListWithPermission',
		method: 'get',
		params: query,
	});
};

/**
 * 按权限获取教师列表
 * @param query
 */
export const teacherListByPermission = (query?: any) => {
	return request({
		url: '/professional/teacherbase/teacherListByPermission',
		method: 'get',
		params: query,
	});
};

/**
 * 获取教师信息（通用）
 * @param query
 */
export const getTeacherInfoCommon = (query?: any) => {
	return request({
		url: '/professional/teacherbase/getTeacherInfoCommon',
		method: 'get',
		params: query,
	});
};

/**
 * 查询所有教师
 */
export const queryAllTeacher = () => {
	return request({
		url: '/professional/teacherbase/queryAllTeacher',
		method: 'get',
	});
};

/**
 * 根据招聘查询所有教师
 */
export const queryAllTeacherByRecruit = () => {
	return request({
		url: '/professional/teacherbase/queryAllTeacherByRecruit',
		method: 'get',
	});
};

/**
 * 查询教师岗位信息
 * @param data
 */
export const queryTeacherStationInfo = (data: any) => {
	return request({
		url: '/professional/teacherbase/queryTeacherStationInfo',
		method: 'post',
		data: data,
	});
};

/**
 * 查询我的部门代码
 * @param data
 */
export const queryMyDeptCode = (data: any) => {
	return request({
		url: '/professional/teacherbase/queryMyDeptCode',
		method: 'post',
		data: data,
	});
};

/**
 * 搜索
 * @param data
 */
export const search = (data: string | number) => {
	return request({
		url: `/professional/teacherbase/search/${data}`,
		method: 'get',
	});
};


