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

import com.xunhong.erp.turbo.api.biz.api.ShipOrderServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.ShipOrderCreateCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.ShipOrderDestroyCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.ShipOrderGenerateDocumentCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.ShipOrderUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.ShipOrderListQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.ShipOrderPageQry;
import com.xunhong.erp.turbo.api.biz.dto.qry.ShipOrderShowQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.ShipOrderVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.ShipOrderCreateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.ShipOrderDestroyCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.ShipOrderGenerateDocumentCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.ShipOrderUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.ShipOrderListQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.ShipOrderPageQryExe;
import com.xunhong.erp.turbo.biz.app.executor.query.ShipOrderShowQryExe;
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 = ShipOrderServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class ShipOrderServiceImpl implements ShipOrderServiceI {

	private final ShipOrderCreateCmdExe shipOrderCreateCmdExe;
	private final ShipOrderUpdateCmdExe shipOrderUpdateCmdExe;
	private final ShipOrderPageQryExe shipOrderPageQryExe;
	private final ShipOrderListQryExe shipOrderListQryExe;
	private final ShipOrderShowQryExe shipOrderShowQryExe;
	private final ShipOrderDestroyCmdExe shipOrderDestroyCmdExe;
	private final ShipOrderGenerateDocumentCmdExe shipOrderGenerateDocumentCmdExe;

	@Override
	public ShipOrderVO create(ShipOrderCreateCmd shipOrderCreateCmd) {
		return shipOrderCreateCmdExe.execute(shipOrderCreateCmd);
	}

	@Override
	public PageDTO<ShipOrderVO> page(ShipOrderPageQry shipOrderPageQry) {
		return PageDTO.of(shipOrderPageQryExe.execute(shipOrderPageQry));
	}

	@Override
	public List<ShipOrderVO> list(ShipOrderListQry shipOrderListQry) {
		return shipOrderListQryExe.execute(shipOrderListQry);
	}

	@Override
	public ShipOrderVO update(ShipOrderUpdateCmd shipOrderUpdateCmd) {
		return shipOrderUpdateCmdExe.execute(shipOrderUpdateCmd);
	}

	@Override
	public ShipOrderVO show(ShipOrderShowQry shipOrderShowQry) {
		return shipOrderShowQryExe.execute(shipOrderShowQry);
	}

	@Override
	public void destroy(ShipOrderDestroyCmd shipOrderDestroyCmd) {
		shipOrderDestroyCmdExe.execute(shipOrderDestroyCmd);
	}

	@Override
	public void generateDocument(ShipOrderGenerateDocumentCmd shipOrderGenerateDocumentCmd) {
		shipOrderGenerateDocumentCmdExe.execute(shipOrderGenerateDocumentCmd);
	}
}

