package com.billion.main.bs.service.impl;
|
|
import cn.hutool.core.collection.CollUtil;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.billion.common.exception.ServiceException;
|
import com.billion.common.utils.DateUtils;
|
import com.billion.main.bs.domain.BsBomInfo;
|
import com.billion.main.bs.mapper.BsBomInfoMapper;
|
import com.billion.main.bs.service.IBsBomInfoService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
/**
|
* 基础BOMService业务层处理
|
*
|
* @author HDY
|
* @date 2024-11-25
|
*/
|
@Service
|
public class BsBomInfoServiceImpl extends ServiceImpl<BsBomInfoMapper, BsBomInfo> implements IBsBomInfoService
|
{
|
@Autowired
|
private BsBomInfoMapper bsBomInfoMapper;
|
|
/**
|
* 查询基础BOM
|
*
|
* @param id 基础BOM主键
|
* @return 基础BOM
|
*/
|
@Override
|
public BsBomInfo selectBsBomInfoById(Long id)
|
{
|
return bsBomInfoMapper.selectBsBomInfoById(id);
|
}
|
|
/**
|
* 查询基础BOM列表
|
*
|
* @param bsBomInfo 基础BOM
|
* @return 基础BOM
|
*/
|
@Override
|
public List<BsBomInfo> selectBsBomInfoList(BsBomInfo bsBomInfo)
|
{
|
return bsBomInfoMapper.selectBsBomInfoList(bsBomInfo);
|
}
|
|
/**
|
* 新增基础BOM
|
*
|
* @param bsBomInfo 基础BOM
|
* @return 结果
|
*/
|
@Override
|
public void insertBsBomInfo(BsBomInfo bsBomInfo)
|
{
|
List<BsBomInfo> checkList = this.list(new LambdaQueryWrapper<BsBomInfo>().eq(BsBomInfo::getBomCode, bsBomInfo.getBomCode()));
|
if (CollUtil.isNotEmpty(checkList)){
|
throw new ServiceException("已存在工单编号为"+bsBomInfo.getBomCode()+"的数据");
|
}
|
this.save(bsBomInfo);
|
}
|
|
/**
|
* 修改基础BOM
|
*
|
* @param bsBomInfo 基础BOM
|
* @return 结果
|
*/
|
@Override
|
public int updateBsBomInfo(BsBomInfo bsBomInfo)
|
{
|
bsBomInfo.setUpdateTime(DateUtils.getNowDate());
|
return bsBomInfoMapper.updateBsBomInfo(bsBomInfo);
|
}
|
|
/**
|
* 批量删除基础BOM
|
*
|
* @param ids 需要删除的基础BOM主键
|
* @return 结果
|
*/
|
@Override
|
public int deleteBsBomInfoByIds(Long[] ids)
|
{
|
return bsBomInfoMapper.deleteBsBomInfoByIds(ids);
|
}
|
|
/**
|
* 删除基础BOM信息
|
*
|
* @param id 基础BOM主键
|
* @return 结果
|
*/
|
@Override
|
public int deleteBsBomInfoById(Long id)
|
{
|
return bsBomInfoMapper.deleteBsBomInfoById(id);
|
}
|
|
@Override
|
public void insertBatch(List<BsBomInfo> confList) {
|
|
}
|
}
|