package thyyxxk.webserver.service.lc.purchasePlan;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import thyyxxk.webserver.dao.his.lc.purchasePlan.LcPurchasePlanDetailDao;
import thyyxxk.webserver.entity.lc.purchasePlan.LcPurchasePlanDetail;

import java.util.ArrayList;
import java.util.List;

@Slf4j
@Service
public class LcPurchasePlanDetailService {

    @Autowired
    private LcPurchasePlanDetailDao detailDao;

    public Boolean deleteLcPurchasePlanDetailList(List<LcPurchasePlanDetail> lcPurchasePlanDetailList) {
        List<String> ids = new ArrayList<>();
        for (LcPurchasePlanDetail lcPurchasePlanDetail : lcPurchasePlanDetailList) {
            ids.add(lcPurchasePlanDetail.getId());
        }
        int deleteByIds = detailDao.deleteByIds(ids);
        return deleteByIds > 0;
    }
}
