package com.ruoyi.sales.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.sales.pojo.SalesLedgerProductProcess; import com.ruoyi.sales.pojo.SalesLedgerProductProcessBind; import com.ruoyi.sales.mapper.SalesLedgerProductProcessBindMapper; import com.ruoyi.sales.service.ISalesLedgerProductProcessBindService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import java.util.List; /** *

* 销售产品额外加工数量 服务实现类 *

* * @author deslrey * @since 2026-03-25 */ @Service public class SalesLedgerProductProcessBindServiceImpl extends ServiceImpl implements ISalesLedgerProductProcessBindService { @Override public void updateProductProcessBind(List list, Long salesLedgerProductId) { if (salesLedgerProductId == null) { throw new ServiceException("新增/修改失败,销售台账产品异常"); } baseMapper.delete(new LambdaQueryWrapper().in(SalesLedgerProductProcessBind::getSalesLedgerProductId, salesLedgerProductId)); if (list != null && !list.isEmpty()) { list.forEach(s -> { SalesLedgerProductProcessBind salesLedgerProductProcessBind = new SalesLedgerProductProcessBind(); salesLedgerProductProcessBind.setSalesLedgerProductId(salesLedgerProductId); salesLedgerProductProcessBind.setSalesLedgerProductProcessId(s.getId()); salesLedgerProductProcessBind.setQuantity(s.getQuantity()); baseMapper.insert(salesLedgerProductProcessBind); }); } } }