商机模块代码优化
parent
206899bfc0
commit
fb54c5fc89
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.crm.service.business;
|
||||
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessProductDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商机产品关联表 Service 接口
|
||||
*
|
||||
* @author lzxhqs
|
||||
*/
|
||||
public interface CrmBusinessProductService {
|
||||
|
||||
/**
|
||||
* 批量新增商机产品关联数据
|
||||
* @param list 商机产品集合
|
||||
*/
|
||||
void insertBatch(List<CrmBusinessProductDO> list);
|
||||
|
||||
/**
|
||||
* 根据商机id获取商机产品关联数据集合
|
||||
* @param businessId 商机id
|
||||
*/
|
||||
List<CrmBusinessProductDO> selectListByBusinessId(Long businessId);
|
||||
|
||||
/**
|
||||
* 批量更新商机产品表
|
||||
* @param list 商机产品数据集合
|
||||
*/
|
||||
void updateBatch(List<CrmBusinessProductDO> list);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param list 需要删除的商机产品集合
|
||||
*/
|
||||
void deleteBatch(List<CrmBusinessProductDO> list);
|
||||
|
||||
/**
|
||||
*根据商机id删除商机产品关联数据
|
||||
* @param businessId 商机id
|
||||
*/
|
||||
void deleteByBusinessId(Long businessId);
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.crm.service.business;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessProductDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.mysql.business.CrmBusinessProductMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商机产品关联表 Service 实现类
|
||||
*
|
||||
* @author lzxhqs
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CrmBusinessProductServiceImpl implements CrmBusinessProductService {
|
||||
@Resource
|
||||
private CrmBusinessProductMapper businessProductMapper;
|
||||
|
||||
@Override
|
||||
public void insertBatch(List<CrmBusinessProductDO> list) {
|
||||
businessProductMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CrmBusinessProductDO> selectListByBusinessId(Long businessId) {
|
||||
return businessProductMapper.selectList(CrmBusinessProductDO::getBusinessId,businessId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBatch(List<CrmBusinessProductDO> list) {
|
||||
businessProductMapper.updateBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBatch(List<CrmBusinessProductDO> list) {
|
||||
businessProductMapper.deleteBatchIds(CollectionUtils.convertList(list,CrmBusinessProductDO::getId));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByBusinessId(Long businessId) {
|
||||
businessProductMapper.deleteByBusinessId(businessId);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue