|
@@ -9,6 +9,7 @@ import org.dromara.common.excel.core.ExcelResult;
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
import org.dromara.dataManagement.domain.Supplier;
|
|
import org.dromara.dataManagement.domain.Supplier;
|
|
|
|
+import org.dromara.dataManagement.domain.WorkShop;
|
|
import org.dromara.dataManagement.domain.bo.SupplierBo;
|
|
import org.dromara.dataManagement.domain.bo.SupplierBo;
|
|
import org.dromara.dataManagement.domain.vo.SupplierExcelVo;
|
|
import org.dromara.dataManagement.domain.vo.SupplierExcelVo;
|
|
import org.dromara.dataManagement.domain.vo.SupplierVo;
|
|
import org.dromara.dataManagement.domain.vo.SupplierVo;
|
|
@@ -16,7 +17,6 @@ import org.dromara.dataManagement.mapper.SupplierMapper;
|
|
import org.dromara.dataManagement.service.SupplierService;
|
|
import org.dromara.dataManagement.service.SupplierService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@@ -44,15 +44,14 @@ public class SupplierServiceImpl implements SupplierService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 批量删除供应商信息
|
|
|
|
- * @param supplyertypeId
|
|
|
|
|
|
+ * 新增供应商信息
|
|
|
|
+ * @param supplierBo
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public int deleteRecycleFactoryByIds(List<Integer> supplyertypeId) {
|
|
|
|
- QueryWrapper<Supplier> qw = new QueryWrapper<>();
|
|
|
|
- qw.in("supplyertype_id",supplyertypeId);
|
|
|
|
- return supplierMapper.delete(qw);
|
|
|
|
|
|
+ public int insertSupplier(SupplierBo supplierBo) {
|
|
|
|
+ Supplier supplier = MapstructUtils.convert(supplierBo, Supplier.class);
|
|
|
|
+ return supplierMapper.insert(supplier);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -61,7 +60,35 @@ public class SupplierServiceImpl implements SupplierService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void insertImportExcel(ExcelResult<SupplierExcelVo> result) {
|
|
public void insertImportExcel(ExcelResult<SupplierExcelVo> result) {
|
|
|
|
+ for (SupplierExcelVo supplierExcelVo : result.getList()){
|
|
|
|
+ Supplier supplier = MapstructUtils.convert(supplierExcelVo, Supplier.class);
|
|
|
|
+ supplierMapper.insert(supplier);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 修改供应商信息
|
|
|
|
+ * @param supplierBo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int updateSupplier(SupplierBo supplierBo) {
|
|
|
|
+ Supplier supplier = MapstructUtils.convert(supplierBo,Supplier.class);
|
|
|
|
+ QueryWrapper<Supplier> qw = new QueryWrapper<>();
|
|
|
|
+ qw.eq("supplyertype_id",supplierBo.getSupplyertypeId());
|
|
|
|
+ return supplierMapper.updateById(supplier);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 批量删除供应商信息
|
|
|
|
+ * @param supplyertypeId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int deleteRecycleFactoryByIds(List<Integer> supplyertypeId) {
|
|
|
|
+ QueryWrapper<Supplier> qw = new QueryWrapper<>();
|
|
|
|
+ qw.in("supplyertype_id",supplyertypeId);
|
|
|
|
+ return supplierMapper.delete(qw);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|