feat(crm): 初始化客户与订单模块基础代码
- 新增客户信息实体类及对应业务对象、控制器、服务实现 - 新增正式订单主表与明细表相关实体类和业务逻辑 - 新增订单操作追溯表结构定义 - 配置MyBatis映射文件及基础CRUD接口 - 实现客户与订单的分页查询、导出、新增、修改、删除功能 - 添加Excel导入导出支持及相关VO转换配置
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.klp.crm.service;
|
||||
|
||||
import com.klp.crm.domain.CrmCustomer;
|
||||
import com.klp.crm.domain.vo.CrmCustomerVo;
|
||||
import com.klp.crm.domain.bo.CrmCustomerBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户信息Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
public interface ICrmCustomerService {
|
||||
|
||||
/**
|
||||
* 查询客户信息
|
||||
*/
|
||||
CrmCustomerVo queryById(String customerId);
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*/
|
||||
TableDataInfo<CrmCustomerVo> queryPageList(CrmCustomerBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*/
|
||||
List<CrmCustomerVo> queryList(CrmCustomerBo bo);
|
||||
|
||||
/**
|
||||
* 新增客户信息
|
||||
*/
|
||||
Boolean insertByBo(CrmCustomerBo bo);
|
||||
|
||||
/**
|
||||
* 修改客户信息
|
||||
*/
|
||||
Boolean updateByBo(CrmCustomerBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除客户信息信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.klp.crm.service;
|
||||
|
||||
import com.klp.crm.domain.CrmOrderItem;
|
||||
import com.klp.crm.domain.vo.CrmOrderItemVo;
|
||||
import com.klp.crm.domain.bo.CrmOrderItemBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 正式订单明细Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
public interface ICrmOrderItemService {
|
||||
|
||||
/**
|
||||
* 查询正式订单明细
|
||||
*/
|
||||
CrmOrderItemVo queryById(String itemId);
|
||||
|
||||
/**
|
||||
* 查询正式订单明细列表
|
||||
*/
|
||||
TableDataInfo<CrmOrderItemVo> queryPageList(CrmOrderItemBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询正式订单明细列表
|
||||
*/
|
||||
List<CrmOrderItemVo> queryList(CrmOrderItemBo bo);
|
||||
|
||||
/**
|
||||
* 新增正式订单明细
|
||||
*/
|
||||
Boolean insertByBo(CrmOrderItemBo bo);
|
||||
|
||||
/**
|
||||
* 修改正式订单明细
|
||||
*/
|
||||
Boolean updateByBo(CrmOrderItemBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除正式订单明细信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.klp.crm.service;
|
||||
|
||||
import com.klp.crm.domain.CrmOrderOperationTrace;
|
||||
import com.klp.crm.domain.vo.CrmOrderOperationTraceVo;
|
||||
import com.klp.crm.domain.bo.CrmOrderOperationTraceBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单操作追溯Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
public interface ICrmOrderOperationTraceService {
|
||||
|
||||
/**
|
||||
* 查询订单操作追溯
|
||||
*/
|
||||
CrmOrderOperationTraceVo queryById(String traceId);
|
||||
|
||||
/**
|
||||
* 查询订单操作追溯列表
|
||||
*/
|
||||
TableDataInfo<CrmOrderOperationTraceVo> queryPageList(CrmOrderOperationTraceBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询订单操作追溯列表
|
||||
*/
|
||||
List<CrmOrderOperationTraceVo> queryList(CrmOrderOperationTraceBo bo);
|
||||
|
||||
/**
|
||||
* 新增订单操作追溯
|
||||
*/
|
||||
Boolean insertByBo(CrmOrderOperationTraceBo bo);
|
||||
|
||||
/**
|
||||
* 修改订单操作追溯
|
||||
*/
|
||||
Boolean updateByBo(CrmOrderOperationTraceBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除订单操作追溯信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.klp.crm.service;
|
||||
|
||||
import com.klp.crm.domain.CrmOrder;
|
||||
import com.klp.crm.domain.vo.CrmOrderVo;
|
||||
import com.klp.crm.domain.bo.CrmOrderBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 正式订单主Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
public interface ICrmOrderService {
|
||||
|
||||
/**
|
||||
* 查询正式订单主
|
||||
*/
|
||||
CrmOrderVo queryById(String orderId);
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
*/
|
||||
TableDataInfo<CrmOrderVo> queryPageList(CrmOrderBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
*/
|
||||
List<CrmOrderVo> queryList(CrmOrderBo bo);
|
||||
|
||||
/**
|
||||
* 新增正式订单主
|
||||
*/
|
||||
Boolean insertByBo(CrmOrderBo bo);
|
||||
|
||||
/**
|
||||
* 修改正式订单主
|
||||
*/
|
||||
Boolean updateByBo(CrmOrderBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除正式订单主信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.klp.crm.service;
|
||||
|
||||
import com.klp.crm.domain.CrmSalesContract;
|
||||
import com.klp.crm.domain.vo.CrmSalesContractVo;
|
||||
import com.klp.crm.domain.bo.CrmSalesContractBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 销售合同Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
public interface ICrmSalesContractService {
|
||||
|
||||
/**
|
||||
* 查询销售合同
|
||||
*/
|
||||
CrmSalesContractVo queryById(String contractId);
|
||||
|
||||
/**
|
||||
* 查询销售合同列表
|
||||
*/
|
||||
TableDataInfo<CrmSalesContractVo> queryPageList(CrmSalesContractBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询销售合同列表
|
||||
*/
|
||||
List<CrmSalesContractVo> queryList(CrmSalesContractBo bo);
|
||||
|
||||
/**
|
||||
* 新增销售合同
|
||||
*/
|
||||
Boolean insertByBo(CrmSalesContractBo bo);
|
||||
|
||||
/**
|
||||
* 修改销售合同
|
||||
*/
|
||||
Boolean updateByBo(CrmSalesContractBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除销售合同信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.klp.crm.service;
|
||||
|
||||
import com.klp.crm.domain.CrmSalesObjection;
|
||||
import com.klp.crm.domain.vo.CrmSalesObjectionVo;
|
||||
import com.klp.crm.domain.bo.CrmSalesObjectionBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 销售异议管理Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
public interface ICrmSalesObjectionService {
|
||||
|
||||
/**
|
||||
* 查询销售异议管理
|
||||
*/
|
||||
CrmSalesObjectionVo queryById(String objectionId);
|
||||
|
||||
/**
|
||||
* 查询销售异议管理列表
|
||||
*/
|
||||
TableDataInfo<CrmSalesObjectionVo> queryPageList(CrmSalesObjectionBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询销售异议管理列表
|
||||
*/
|
||||
List<CrmSalesObjectionVo> queryList(CrmSalesObjectionBo bo);
|
||||
|
||||
/**
|
||||
* 新增销售异议管理
|
||||
*/
|
||||
Boolean insertByBo(CrmSalesObjectionBo bo);
|
||||
|
||||
/**
|
||||
* 修改销售异议管理
|
||||
*/
|
||||
Boolean updateByBo(CrmSalesObjectionBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除销售异议管理信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.klp.crm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.crm.domain.bo.CrmCustomerBo;
|
||||
import com.klp.crm.domain.vo.CrmCustomerVo;
|
||||
import com.klp.crm.domain.CrmCustomer;
|
||||
import com.klp.crm.mapper.CrmCustomerMapper;
|
||||
import com.klp.crm.service.ICrmCustomerService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 客户信息Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmCustomerServiceImpl implements ICrmCustomerService {
|
||||
|
||||
private final CrmCustomerMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询客户信息
|
||||
*/
|
||||
@Override
|
||||
public CrmCustomerVo queryById(String customerId){
|
||||
return baseMapper.selectVoById(customerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmCustomerVo> queryPageList(CrmCustomerBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CrmCustomer> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmCustomerVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmCustomerVo> queryList(CrmCustomerBo bo) {
|
||||
LambdaQueryWrapper<CrmCustomer> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CrmCustomer> buildQueryWrapper(CrmCustomerBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmCustomer> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerCode()), CrmCustomer::getCustomerCode, bo.getCustomerCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), CrmCustomer::getCompanyName, bo.getCompanyName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactPerson()), CrmCustomer::getContactPerson, bo.getContactPerson());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactWay()), CrmCustomer::getContactWay, bo.getContactWay());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIndustry()), CrmCustomer::getIndustry, bo.getIndustry());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerLevel()), CrmCustomer::getCustomerLevel, bo.getCustomerLevel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAddress()), CrmCustomer::getAddress, bo.getAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBankInfo()), CrmCustomer::getBankInfo, bo.getBankInfo());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmCustomerBo bo) {
|
||||
CrmCustomer add = BeanUtil.toBean(bo, CrmCustomer.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setCustomerId(add.getCustomerId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmCustomerBo bo) {
|
||||
CrmCustomer update = BeanUtil.toBean(bo, CrmCustomer.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmCustomer entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户信息
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.klp.crm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.crm.domain.bo.CrmOrderItemBo;
|
||||
import com.klp.crm.domain.vo.CrmOrderItemVo;
|
||||
import com.klp.crm.domain.CrmOrderItem;
|
||||
import com.klp.crm.mapper.CrmOrderItemMapper;
|
||||
import com.klp.crm.service.ICrmOrderItemService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 正式订单明细Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
|
||||
private final CrmOrderItemMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询正式订单明细
|
||||
*/
|
||||
@Override
|
||||
public CrmOrderItemVo queryById(String itemId){
|
||||
return baseMapper.selectVoById(itemId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询正式订单明细列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmOrderItemVo> queryPageList(CrmOrderItemBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CrmOrderItem> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmOrderItemVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询正式订单明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmOrderItemVo> queryList(CrmOrderItemBo bo) {
|
||||
LambdaQueryWrapper<CrmOrderItem> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CrmOrderItem> buildQueryWrapper(CrmOrderItemBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmOrderItem> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderId()), CrmOrderItem::getOrderId, bo.getOrderId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductType()), CrmOrderItem::getProductType, bo.getProductType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecRequire()), CrmOrderItem::getSpecRequire, bo.getSpecRequire());
|
||||
lqw.eq(bo.getProductNum() != null, CrmOrderItem::getProductNum, bo.getProductNum());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecialRequire()), CrmOrderItem::getSpecialRequire, bo.getSpecialRequire());
|
||||
lqw.eq(bo.getItemAmount() != null, CrmOrderItem::getItemAmount, bo.getItemAmount());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增正式订单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmOrderItemBo bo) {
|
||||
CrmOrderItem add = BeanUtil.toBean(bo, CrmOrderItem.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setItemId(add.getItemId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改正式订单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmOrderItemBo bo) {
|
||||
CrmOrderItem update = BeanUtil.toBean(bo, CrmOrderItem.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmOrderItem entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除正式订单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.klp.crm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.crm.domain.bo.CrmOrderOperationTraceBo;
|
||||
import com.klp.crm.domain.vo.CrmOrderOperationTraceVo;
|
||||
import com.klp.crm.domain.CrmOrderOperationTrace;
|
||||
import com.klp.crm.mapper.CrmOrderOperationTraceMapper;
|
||||
import com.klp.crm.service.ICrmOrderOperationTraceService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 订单操作追溯Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmOrderOperationTraceServiceImpl implements ICrmOrderOperationTraceService {
|
||||
|
||||
private final CrmOrderOperationTraceMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询订单操作追溯
|
||||
*/
|
||||
@Override
|
||||
public CrmOrderOperationTraceVo queryById(String traceId){
|
||||
return baseMapper.selectVoById(traceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单操作追溯列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmOrderOperationTraceVo> queryPageList(CrmOrderOperationTraceBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CrmOrderOperationTrace> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmOrderOperationTraceVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单操作追溯列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmOrderOperationTraceVo> queryList(CrmOrderOperationTraceBo bo) {
|
||||
LambdaQueryWrapper<CrmOrderOperationTrace> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CrmOrderOperationTrace> buildQueryWrapper(CrmOrderOperationTraceBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmOrderOperationTrace> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderId()), CrmOrderOperationTrace::getOrderId, bo.getOrderId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOperationType()), CrmOrderOperationTrace::getOperationType, bo.getOperationType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOldStatus()), CrmOrderOperationTrace::getOldStatus, bo.getOldStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNewStatus()), CrmOrderOperationTrace::getNewStatus, bo.getNewStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOperationContent()), CrmOrderOperationTrace::getOperationContent, bo.getOperationContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOperator()), CrmOrderOperationTrace::getOperator, bo.getOperator());
|
||||
lqw.eq(bo.getOperationTime() != null, CrmOrderOperationTrace::getOperationTime, bo.getOperationTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单操作追溯
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmOrderOperationTraceBo bo) {
|
||||
CrmOrderOperationTrace add = BeanUtil.toBean(bo, CrmOrderOperationTrace.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setTraceId(add.getTraceId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单操作追溯
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmOrderOperationTraceBo bo) {
|
||||
CrmOrderOperationTrace update = BeanUtil.toBean(bo, CrmOrderOperationTrace.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmOrderOperationTrace entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单操作追溯
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.klp.crm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.crm.domain.bo.CrmOrderBo;
|
||||
import com.klp.crm.domain.vo.CrmOrderVo;
|
||||
import com.klp.crm.domain.CrmOrder;
|
||||
import com.klp.crm.mapper.CrmOrderMapper;
|
||||
import com.klp.crm.service.ICrmOrderService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 正式订单主Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
|
||||
private final CrmOrderMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询正式订单主
|
||||
*/
|
||||
@Override
|
||||
public CrmOrderVo queryById(String orderId){
|
||||
return baseMapper.selectVoById(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmOrderVo> queryPageList(CrmOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CrmOrder> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmOrderVo> queryList(CrmOrderBo bo) {
|
||||
LambdaQueryWrapper<CrmOrder> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CrmOrder> buildQueryWrapper(CrmOrderBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmOrder> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderCode()), CrmOrder::getOrderCode, bo.getOrderCode());
|
||||
lqw.eq(bo.getOrderType() != null, CrmOrder::getOrderType, bo.getOrderType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerId()), CrmOrder::getCustomerId, bo.getCustomerId());
|
||||
lqw.eq(bo.getOrderAmount() != null, CrmOrder::getOrderAmount, bo.getOrderAmount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSalesman()), CrmOrder::getSalesman, bo.getSalesman());
|
||||
lqw.eq(bo.getDeliveryDate() != null, CrmOrder::getDeliveryDate, bo.getDeliveryDate());
|
||||
lqw.eq(bo.getPreOrderStatus() != null, CrmOrder::getPreOrderStatus, bo.getPreOrderStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAuditUser()), CrmOrder::getAuditUser, bo.getAuditUser());
|
||||
lqw.eq(bo.getAuditTime() != null, CrmOrder::getAuditTime, bo.getAuditTime());
|
||||
lqw.eq(bo.getOrderStatus() != null, CrmOrder::getOrderStatus, bo.getOrderStatus());
|
||||
lqw.eq(bo.getFinanceStatus() != null, CrmOrder::getFinanceStatus, bo.getFinanceStatus());
|
||||
lqw.eq(bo.getUnpaidAmount() != null, CrmOrder::getUnpaidAmount, bo.getUnpaidAmount());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增正式订单主
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmOrderBo bo) {
|
||||
CrmOrder add = BeanUtil.toBean(bo, CrmOrder.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setOrderId(add.getOrderId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改正式订单主
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmOrderBo bo) {
|
||||
CrmOrder update = BeanUtil.toBean(bo, CrmOrder.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmOrder entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除正式订单主
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.klp.crm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.crm.domain.bo.CrmSalesContractBo;
|
||||
import com.klp.crm.domain.vo.CrmSalesContractVo;
|
||||
import com.klp.crm.domain.CrmSalesContract;
|
||||
import com.klp.crm.mapper.CrmSalesContractMapper;
|
||||
import com.klp.crm.service.ICrmSalesContractService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 销售合同Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmSalesContractServiceImpl implements ICrmSalesContractService {
|
||||
|
||||
private final CrmSalesContractMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询销售合同
|
||||
*/
|
||||
@Override
|
||||
public CrmSalesContractVo queryById(String contractId){
|
||||
return baseMapper.selectVoById(contractId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询销售合同列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmSalesContractVo> queryPageList(CrmSalesContractBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CrmSalesContract> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmSalesContractVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询销售合同列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmSalesContractVo> queryList(CrmSalesContractBo bo) {
|
||||
LambdaQueryWrapper<CrmSalesContract> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CrmSalesContract> buildQueryWrapper(CrmSalesContractBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmSalesContract> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractCode()), CrmSalesContract::getContractCode, bo.getContractCode());
|
||||
lqw.eq(bo.getContractType() != null, CrmSalesContract::getContractType, bo.getContractType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerId()), CrmSalesContract::getCustomerId, bo.getCustomerId());
|
||||
lqw.eq(bo.getTotalAmount() != null, CrmSalesContract::getTotalAmount, bo.getTotalAmount());
|
||||
lqw.eq(bo.getDeliveryDate() != null, CrmSalesContract::getDeliveryDate, bo.getDeliveryDate());
|
||||
lqw.eq(bo.getContractStatus() != null, CrmSalesContract::getContractStatus, bo.getContractStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCreateUser()), CrmSalesContract::getCreateUser, bo.getCreateUser());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReviewUser()), CrmSalesContract::getReviewUser, bo.getReviewUser());
|
||||
lqw.eq(bo.getReviewTime() != null, CrmSalesContract::getReviewTime, bo.getReviewTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAuditUser()), CrmSalesContract::getAuditUser, bo.getAuditUser());
|
||||
lqw.eq(bo.getAuditTime() != null, CrmSalesContract::getAuditTime, bo.getAuditTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIssueUser()), CrmSalesContract::getIssueUser, bo.getIssueUser());
|
||||
lqw.eq(bo.getIssueTime() != null, CrmSalesContract::getIssueTime, bo.getIssueTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增销售合同
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmSalesContractBo bo) {
|
||||
CrmSalesContract add = BeanUtil.toBean(bo, CrmSalesContract.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setContractId(add.getContractId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改销售合同
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmSalesContractBo bo) {
|
||||
CrmSalesContract update = BeanUtil.toBean(bo, CrmSalesContract.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmSalesContract entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除销售合同
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.klp.crm.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.crm.domain.bo.CrmSalesObjectionBo;
|
||||
import com.klp.crm.domain.vo.CrmSalesObjectionVo;
|
||||
import com.klp.crm.domain.CrmSalesObjection;
|
||||
import com.klp.crm.mapper.CrmSalesObjectionMapper;
|
||||
import com.klp.crm.service.ICrmSalesObjectionService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 销售异议管理Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-12-15
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CrmSalesObjectionServiceImpl implements ICrmSalesObjectionService {
|
||||
|
||||
private final CrmSalesObjectionMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询销售异议管理
|
||||
*/
|
||||
@Override
|
||||
public CrmSalesObjectionVo queryById(String objectionId){
|
||||
return baseMapper.selectVoById(objectionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询销售异议管理列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CrmSalesObjectionVo> queryPageList(CrmSalesObjectionBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CrmSalesObjection> lqw = buildQueryWrapper(bo);
|
||||
Page<CrmSalesObjectionVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询销售异议管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<CrmSalesObjectionVo> queryList(CrmSalesObjectionBo bo) {
|
||||
LambdaQueryWrapper<CrmSalesObjection> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CrmSalesObjection> buildQueryWrapper(CrmSalesObjectionBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CrmSalesObjection> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getObjectionCode()), CrmSalesObjection::getObjectionCode, bo.getObjectionCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderId()), CrmSalesObjection::getOrderId, bo.getOrderId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomerId()), CrmSalesObjection::getCustomerId, bo.getCustomerId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getObjectionType()), CrmSalesObjection::getObjectionType, bo.getObjectionType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getObjectionContent()), CrmSalesObjection::getObjectionContent, bo.getObjectionContent());
|
||||
lqw.eq(bo.getObjectionStatus() != null, CrmSalesObjection::getObjectionStatus, bo.getObjectionStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getHandleContent()), CrmSalesObjection::getHandleContent, bo.getHandleContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getHandleUser()), CrmSalesObjection::getHandleUser, bo.getHandleUser());
|
||||
lqw.eq(bo.getHandleTime() != null, CrmSalesObjection::getHandleTime, bo.getHandleTime());
|
||||
lqw.eq(bo.getCloseTime() != null, CrmSalesObjection::getCloseTime, bo.getCloseTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增销售异议管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CrmSalesObjectionBo bo) {
|
||||
CrmSalesObjection add = BeanUtil.toBean(bo, CrmSalesObjection.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setObjectionId(add.getObjectionId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改销售异议管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmSalesObjectionBo bo) {
|
||||
CrmSalesObjection update = BeanUtil.toBean(bo, CrmSalesObjection.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CrmSalesObjection entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除销售异议管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user