package com.palmnest.service.washcar.service;

import com.palmnest.application.bean.Page;
import com.palmnest.application.dto.input.SlipInputDto;
import com.palmnest.application.dto.input.WashCarOrderDto;
import com.palmnest.application.dto.input.WashOrderInputDto;
import com.palmnest.application.dto.output.WashCarServiceDto;
import com.palmnest.application.dto.output.WashOrderOutputDto;
import com.palmnest.model.washcar.WashCarOrder;

import java.util.List;
import java.util.Map;

public interface WashCarOrderService {
	/**
	 * 查找订单列表的数据
	 *
	 * @param dto
	 * @param pageNo
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public Page findSearch(WashCarOrderDto dto, int pageNo, int pageSize) throws Exception;

	/**
	 * 获取订单详情
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public WashOrderOutputDto getOrderInfo(Long id) throws Exception;

	/**
	 * 删除订单
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Integer deleteOrder(Long id) throws Exception;

	/**
	 * 下单
	 *
	 * @param washOrderInputDto
	 * @param userId
	 * @param type
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> saveWashCarOrder(WashOrderInputDto washOrderInputDto, String userId, Integer type) throws Exception;

	/**
	 * 获取派单人员
	 *
	 * @param syscode
	 * @return
	 * @throws Exception
	 */
	public List<WashCarServiceDto> getWashCarService(String orgId, String syscode) throws Exception;

	/**
	 * 派单
	 *
	 * @param id
	 * @param washSerId
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public String dispatch(int type, Long id, String washSerId, String userId) throws Exception;

	/**
	 * 获取当天的剩余名额
	 *
	 * @param userId 洗车的用户
	 * @param status 单据状态   status格式('1','2')
	 * @param type   1代表in 2代表not in
	 * @return
	 * @throws Exception
	 */
	public List<WashCarOrder> getWashListByDas(String userId, String status, int type) throws Exception;

	public int getWashCountByDas(String projectId) throws Exception;

	/**
	 * 自动派单
	 *
	 * @param id     订单id
	 * @param userId 创建人
	 * @return
	 * @throws Exception
	 */
	public String automaticDispatch(String orgId, Long id, String userId) throws Exception;

	/**
	 * 取消订单
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public String cancelWashOrder(Long id, String userId, String type) throws Exception;

	/**
	 * 转单
	 *
	 * @param dto
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public String transferBill(SlipInputDto dto, String userId) throws Exception;

	/**
	 * 修改订单状态
	 *
	 * @param id
	 * @param type
	 * @return
	 */
	public String updateWashOrder(Long id, Integer type, String userId, String keySpace, String parkSpace) throws Exception;

	/**
	 * 判断是否存在
	 *
	 * @param id
	 * @return
	 */
	public boolean exists(Long id);

	/**
	 * 根据id查找
	 *
	 * @param id
	 * @return
	 */
	public WashCarOrder findById(Long id);
}
