package com.huigou.topsun.sap.produceSupplierReview.application.impl;

import com.huigou.topsun.sap.produceSupplierReview.application.NewSupplierReviewItemApplication;
import com.huigou.topsun.sap.produceSupplierReview.domain.NewSupplierReviewItem;
import com.huigou.topsun.sap.produceSupplierReview.repository.NewSupplierReviewItemRepository;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: xin.lu
 * @Date: 2024/06/05/15:47
 * @Description:
 */
@Service("newSupplierReviewItemApplication")
public class NewSupplierReviewItemApplicationImpl extends BaseApplication implements NewSupplierReviewItemApplication {
    @Autowired
    private NewSupplierReviewItemRepository supplierReviewItemRepository;
    @Override
    public void saveNewSupplierReviewItems(String newSupplierReviewId, List<NewSupplierReviewItem> newSupplierReviewItems) {
        for (NewSupplierReviewItem newSupplierReviewItem : newSupplierReviewItems) {
            newSupplierReviewItem.setNewSupplierReviewId(newSupplierReviewId);
        }
        supplierReviewItemRepository.save(newSupplierReviewItems);
    }
}
