package com.fuzamei.service.serviceImpl;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fuzamei.entity.DeliverOrder;
import com.fuzamei.entity.Orders;
import com.fuzamei.entity.Param;
import com.fuzamei.entity.SendOrder;
import com.fuzamei.mapperInterface.CargoDeliverMapper;
import com.fuzamei.service.CargoDeliverService;
import com.fuzamei.util.PageDTO;

@Service
public class CargoDeliverServiceImpl implements CargoDeliverService {

	@Autowired
	private CargoDeliverMapper cargoDeliverMapper;

	@Override
	public PageDTO queryOrdersByCarrier(Param param) {
		PageDTO pageDto=new PageDTO();
		List<DeliverOrder> orderList = cargoDeliverMapper.queryOrdersByCarrier(param);
		int count = cargoDeliverMapper.findQueryCountByCarrier(param);
		pageDto.setRows(orderList);
		pageDto.setTotal(count);
		return pageDto;
	}

	@Override
	public Map<String, Object> orderTracking(Param param) {
		Orders order = param.getOrder();
		return OrdersIssueServiceImpl.dispatchOrderInfo(order);
	}
}
