package com.palmnest.service.dinner.manager;

import com.palmnest.application.bean.Page;
import com.palmnest.application.dto.ConsumerDto;
import com.palmnest.model.dinner.Consumer;
import com.palmnest.model.estateserve.AppUser;
import com.palmnest.service.GenericManager;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

/**
 * 订餐用户manager类
 *
 * @author longmeizhen
 */
public interface ConsumerManager extends GenericManager<Consumer, Long> {
	/**
	 * 根据openId获取用户
	 *
	 * @param orgId
	 * @param openId
	 * @return
	 */
	Consumer getConsumerByOpenId(String orgId, String openId);

	/**
	 * 根据用户名密码查找相应的用户
	 * @param orgId
	 * @param loginName
	 * @param password
	 * @return
	 */
//	Consumer getConsumerByLoginName(String orgId,String loginName,String password);

	/**
	 * 根据手机号项目查找有没有相应的用户
	 *
	 * @param orgId
	 * @param mobile
	 * @return
	 */
	Consumer getConsumerByMobile(String orgId, String mobile);

	/**
	 * 导入
	 *
	 * @param ins
	 * @param orgId
	 * @param virId
	 * @return
	 */
	Map<String, Object> importConsumer(InputStream ins, String orgId, String virId);
	/**
	 * 根据登录名获取用户信息
	 * @param orgId
	 * @param loginName
	 * @return
	 */
//	List<Consumer> getUserByLoginName(String orgId,String loginName);

	/**
	 * 保存导入的用户信息
	 *
	 * @param list
	 * @param userLi
	 * @param tb
	 * @throws Exception
	 */
	public String saveImportUser(List<AppUser> list, String userId) throws Exception;

	/**
	 * 判断该用户还能否提交订单
	 *
	 * @param cons
	 * @return
	 */
	int isConsPower(Consumer cons, int type);

	/**
	 * @param loginName登录名
	 * @param userName姓名
	 * @param roleType类型1管理员2普通用户
	 * @return
	 */
	Page findList(Map<String, Object> paramets, int pageSize, int pageNo);

	Page findEmployeeList(Map<String, Object> paramets, int pageSize, int pageNo);

	/**
	 * 获取所有有效的代订类型的账号以及管理员账号
	 *
	 * @param orgId
	 * @return
	 */
	Map<String, List<ConsumerDto>> getConsByOrgId(String orgId, String time);

	List<Map<String, Object>> findListForReport(Map<String, Object> paramets);

	Map<String, Object> importUserAddress(InputStream ins, String orgId);
}
