| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class SalesLedgerProductProcessBindServiceImpl extends ServiceImpl<SalesLedgerProductProcessBindMapper, SalesLedgerProductProcessBind> implements ISalesLedgerProductProcessBindService { |
| | | |
| | | @Override |
| | | public void updateProductProcessBind(List<SalesLedgerProductProcess> list, Long salesLedgerProductId) { |
| | | if (list == null || list.isEmpty()) { |
| | | return; |
| | | } |
| | | // 先清空再插入 |
| | | baseMapper.delete(new LambdaQueryWrapper<SalesLedgerProductProcessBind>().in(SalesLedgerProductProcessBind::getSalesLedgerProductId, salesLedgerProductId)); |
| | | list.forEach(s -> { |
| | | SalesLedgerProductProcessBind salesLedgerProductProcessBind = new SalesLedgerProductProcessBind(); |
| | | salesLedgerProductProcessBind.setSalesLedgerProductId(salesLedgerProductId); |
| | | salesLedgerProductProcessBind.setSalesLedgerProductProcessId(s.getId()); |
| | | salesLedgerProductProcessBind.setQuantity(s.getQuantity()); |
| | | baseMapper.insert(salesLedgerProductProcessBind); |
| | | }); |
| | | } |
| | | } |