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

import com.xunhong.erp.turbo.api.biz.api.OrderSupplierServiceI;
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierBatchInvoiceUploadCmd;
import com.xunhong.erp.turbo.api.biz.dto.cmd.OrderSupplierUpdateCmd;
import com.xunhong.erp.turbo.api.biz.dto.qry.OrderSupplierPageQry;
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderSupplierVO;
import com.xunhong.erp.turbo.base.dto.PageDTO;
import com.xunhong.erp.turbo.biz.app.executor.cmd.OrderSupplierBatchInvoiceUploadCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.cmd.OrderSupplierUpdateCmdExe;
import com.xunhong.erp.turbo.biz.app.executor.query.OrderSupplierPageQryExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

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

    private final OrderSupplierUpdateCmdExe orderSupplierUpdateCmdExe;
    private final OrderSupplierBatchInvoiceUploadCmdExe orderSupplierBatchInvoiceUploadCmdExe;
    private final OrderSupplierPageQryExe orderSupplierPageQryExe;


    @Override
    public PageDTO<OrderSupplierVO> page(OrderSupplierPageQry orderSupplierPageQry) {
        return PageDTO.of(orderSupplierPageQryExe.execute(orderSupplierPageQry));
    }


    @Override
    public OrderSupplierVO update(OrderSupplierUpdateCmd orderSupplierUpdateCmd) {
        return orderSupplierUpdateCmdExe.execute(orderSupplierUpdateCmd);
    }

    @Override
    public void batchUploadInvoice(OrderSupplierBatchInvoiceUploadCmd batchInvoiceUploadCmd) {
		orderSupplierBatchInvoiceUploadCmdExe.execute(batchInvoiceUploadCmd);
	}
}

