package com.palmnest.service.washcar.service;

import com.palmnest.application.bean.AppResultDto;
import com.palmnest.application.bean.Page;
import com.palmnest.application.dto.input.CustomerInputDto;
import com.palmnest.model.washcar.Customer;

import java.io.InputStream;

/**
 * 用户service类
 *
 * @author longmeizhen
 */
@SuppressWarnings("rawtypes")
public interface CustomerService {

	/**
	 * 导入用户信息
	 *
	 * @param ins
	 * @return
	 * @throws Exception
	 */
	public AppResultDto importUserInfo(InputStream ins, String userId) throws Exception;

	/**
	 * 保存用户信息
	 *
	 * @param customerInputDto
	 * @param userId           操作用户(creator or modifier)
	 * @return
	 * @throws Exception
	 */
	public String saveCustomer(CustomerInputDto customerInputDto, String userId) throws Exception;

	/**
	 * 删除用户信息
	 *
	 * @param custId
	 * @param userId 操作用户(creator or modifier)
	 * @return
	 * @throws Exception
	 */
	public String deleteCustomer(Long custId, String userId) throws Exception;

	/**
	 * 获取用户列表
	 *
	 * @param mobile电话
	 * @param userName用户名
	 * @param carNumber车牌号
	 * @return
	 * @throws Exception
	 */

	public Page getCustList(String orgIds, String mobile, String userName, String carNumber, String searchStr, int pageNo, int pageSize) throws Exception;

	/**
	 * 查找用户
	 *
	 * @param id
	 * @return
	 */
	public CustomerInputDto findById(Long id);

	/**
	 * 根据电话号码查找用户
	 *
	 * @param mobile
	 * @return
	 * @throws Exception
	 */
	public Customer getCustByMobile(String orgId, String mobile) throws Exception;

	/**
	 * 判断所填写的code和该号码获取到的是否同一个
	 *
	 * @param mobile
	 * @param code
	 * @return
	 * @throws Exception
	 */
	public int isExistence(String mobile, String code) throws Exception;

	/**
	 * 根据openId查找用户
	 *
	 * @param mobile
	 * @return
	 * @throws Exception
	 */
	public Customer getCustByOpenId(String orgId, String openId) throws Exception;

	/**
	 * 退出登录
	 *
	 * @param openId
	 * @return
	 */
	public String exitLogin(String orgId, String openId);

	/**
	 * 修改用户
	 *
	 * @param cust
	 */
	public void updateCustomer(Customer cust);

}
