package com.hzs.sale.deliver.provider;

import com.hzs.common.core.domain.R;
import com.hzs.common.domain.sale.ext.SaDeliverExt;
import com.hzs.sale.deliver.ISaDeliverServiceApi;
import com.hzs.sale.deliver.service.ISaDeliverService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Description: 发货单相关dubbo服务
 * @Author: jiang chao
 * @Time: 2023/12/19 14:28
 * @Classname: SaDeliverServiceProvider
 * @PackageName: com.hzs.sale.deliver.provider
 */
@Slf4j
@DubboService
public class SaDeliverServiceProvider implements ISaDeliverServiceApi {

    @Autowired
    private ISaDeliverService iSaDeliverService;

    @Override
    public R<List<SaDeliverExt>> queryDeliverList(List<Long> idList, Integer pkCountry) {
        try {
            return R.ok(iSaDeliverService.queryDeliverAndItemsList(idList, pkCountry));
        } catch (Exception e) {
            log.error("查询发货单及明细数据异常：{}", e.getMessage(), e);
            return R.fail(e.getMessage());
        }
    }

}
