package com.xunhong.erp.turbo.biz.app.service;

import com.xunhong.erp.turbo.api.biz.api.OrderShipServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderShipCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderShipDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderShipGenerateDocumentCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderShipUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderShipListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderShipPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderShipShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderShipVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.OrderShipCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.OrderShipDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.OrderShipGenerateDocumentCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.OrderShipUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.OrderShipListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.OrderShipPageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.OrderShipShowQryExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shenyifei
 */
@Slf4j
@Service
@DubboService(interfaceClass = OrderShipServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class OrderShipServiceImpl implements OrderShipServiceI {

	private final OrderShipCreateCmdExe orderShipCreateCmdExe;
	private final OrderShipUpdateCmdExe orderShipUpdateCmdExe;
	private final OrderShipPageQryExe orderShipPageQryExe;
	private final OrderShipListQryExe orderShipListQryExe;
	private final OrderShipShowQryExe orderShipShowQryExe;
	private final OrderShipDestroyCmdExe orderShipDestroyCmdExe;
	private final OrderShipGenerateDocumentCmdExe orderShipGenerateDocumentCmdExe;

	@Override
	public OrderShipVO create(OrderShipCreateCmd orderShipCreateCmd) {
		return orderShipCreateCmdExe.execute(orderShipCreateCmd);
	}

	@Override
	public PageDTO<OrderShipVO> page(OrderShipPageQry orderShipPageQry) {
		return PageDTO.of(orderShipPageQryExe.execute(orderShipPageQry));
	}

	@Override
	public List<OrderShipVO> list(OrderShipListQry orderShipListQry) {
		return orderShipListQryExe.execute(orderShipListQry);
	}

	@Override
	public OrderShipVO update(OrderShipUpdateCmd orderShipUpdateCmd) {
		return orderShipUpdateCmdExe.execute(orderShipUpdateCmd);
	}

	@Override
	public OrderShipVO show(OrderShipShowQry orderShipShowQry) {
		return orderShipShowQryExe.execute(orderShipShowQry);
	}

	@Override
	public void destroy(OrderShipDestroyCmd orderShipDestroyCmd) {
		orderShipDestroyCmdExe.execute(orderShipDestroyCmd);
	}

	@Override
	public void generateDocument(OrderShipGenerateDocumentCmd orderShipGenerateDocumentCmd) {
		orderShipGenerateDocumentCmdExe.execute(orderShipGenerateDocumentCmd);
	}
}

