| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private SupplierManageMapper supplierMapper; |
| | | @Autowired |
| | | private PurchaseLedgerMapper purchaseLedgerMapper; |
| | | |
| | | /** |
| | | * 供应商新增 |
| | |
| | | */ |
| | | @Override |
| | | public int delSupplier(List<Integer> ids) { |
| | | List<PurchaseLedger> purchaseLedgers = purchaseLedgerMapper.selectList(new QueryWrapper<PurchaseLedger>().lambda().in(PurchaseLedger::getSupplierId, ids)); |
| | | if (purchaseLedgers.size() > 0) { |
| | | throw new RuntimeException("供应商已存在采购合同"); |
| | | } |
| | | LambdaQueryWrapper<SupplierManage> delWrapper = new LambdaQueryWrapper<>(); |
| | | delWrapper.in(SupplierManage::getId, ids); |
| | | |
| | | return supplierMapper.delete(delWrapper); |
| | | } |
| | | |