|
|
|
|
@ -9,12 +9,10 @@ import org.dromara.common.core.utils.MapstructUtils;
|
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
import org.dromara.oa.crm.domain.CrmCustomerContact;
|
|
|
|
|
import org.dromara.oa.crm.domain.CrmCustomerInfo;
|
|
|
|
|
import org.dromara.oa.crm.domain.CrmQuoteInfo;
|
|
|
|
|
import org.dromara.oa.crm.domain.CrmQuoteMaterial;
|
|
|
|
|
import org.dromara.oa.crm.domain.*;
|
|
|
|
|
import org.dromara.oa.crm.domain.bo.CrmQuoteInfoBo;
|
|
|
|
|
import org.dromara.oa.crm.domain.bo.CrmQuoteMaterialBo;
|
|
|
|
|
import org.dromara.oa.crm.domain.bo.CrmSupplierInfoBo;
|
|
|
|
|
import org.dromara.oa.crm.domain.vo.CrmCustomerContactVo;
|
|
|
|
|
import org.dromara.oa.crm.domain.vo.CrmQuoteInfoVo;
|
|
|
|
|
import org.dromara.oa.crm.domain.vo.CrmQuoteMaterialVo;
|
|
|
|
|
@ -103,10 +101,14 @@ public class CrmQuoteInfoServiceImpl implements ICrmQuoteInfoService {
|
|
|
|
|
.selectAs("CustomerContact", CrmCustomerContact::getContactName, CrmQuoteInfo::getCustomerContactRealName)
|
|
|
|
|
.leftJoin(CrmCustomerContact.class, "CustomerContact", CrmCustomerContact::getContactId, CrmQuoteInfo::getCustomerContactId)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
// 供货方联系人(CrmCustomerContact,别名:SupplierContact)
|
|
|
|
|
.selectAs("SupplierContact", CrmCustomerContact::getContactName, CrmQuoteInfo::getSupplierContactRealName)
|
|
|
|
|
.leftJoin(CrmCustomerContact.class, "SupplierContact", CrmCustomerContact::getContactId, CrmQuoteInfo::getSupplierContactId)
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
//供应商
|
|
|
|
|
.select(CrmSupplierInfo::getSupplierName)
|
|
|
|
|
.leftJoin(CrmSupplierInfo.class, CrmSupplierInfo::getSupplierId, CrmQuoteInfo::getSupplierContactId)
|
|
|
|
|
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getQuoteCode()), CrmQuoteInfo::getQuoteCode, bo.getQuoteCode())
|
|
|
|
|
.like(StringUtils.isNotBlank(bo.getQuoteName()), CrmQuoteInfo::getQuoteName, bo.getQuoteName())
|
|
|
|
|
@ -284,11 +286,14 @@ public class CrmQuoteInfoServiceImpl implements ICrmQuoteInfoService {
|
|
|
|
|
MPJLambdaWrapper<CrmQuoteInfo> lqw = JoinWrappers.lambda(CrmQuoteInfo.class)
|
|
|
|
|
.selectAll(CrmQuoteInfo.class)
|
|
|
|
|
// 别名连接与派生字段选择
|
|
|
|
|
.leftJoin(CrmCustomerContact.class, "CustomerContact", CrmCustomerContact::getContactId, CrmQuoteInfo::getCustomerContactId)
|
|
|
|
|
.leftJoin(CrmCustomerContact.class, "SupplierContact", CrmCustomerContact::getContactId, CrmQuoteInfo::getSupplierContactId)
|
|
|
|
|
.leftJoin(CrmCustomerInfo.class, "Customer", CrmCustomerInfo::getCustomerId, CrmCustomerContact::getCustomerId)
|
|
|
|
|
.selectAs("CustomerContact", CrmCustomerContact::getContactName, CrmQuoteInfo::getCustomerContactRealName)
|
|
|
|
|
.selectAs("SupplierContact", CrmCustomerContact::getContactName, CrmQuoteInfo::getSupplierContactRealName)
|
|
|
|
|
.leftJoin(CrmCustomerContact.class, "CustomerContact", CrmCustomerContact::getContactId, CrmQuoteInfo::getCustomerContactId)
|
|
|
|
|
// .leftJoin(CrmCustomerContact.class, "SupplierContact", CrmCustomerContact::getContactId, CrmQuoteInfo::getSupplierContactId)
|
|
|
|
|
.leftJoin(CrmCustomerInfo.class, "Customer", CrmCustomerInfo::getCustomerId, CrmCustomerContact::getCustomerId)
|
|
|
|
|
//供应商信息
|
|
|
|
|
.select(CrmSupplierInfo::getSupplierName)
|
|
|
|
|
.leftJoin(CrmSupplierInfo.class, CrmSupplierInfo::getSupplierId, CrmQuoteInfo::getSupplierContactId)
|
|
|
|
|
// .selectAs("SupplierContact", CrmCustomerContact::getContactName, CrmQuoteInfo::getSupplierContactRealName)
|
|
|
|
|
.eq(CrmQuoteInfo::getQuoteName, base.getQuoteName())
|
|
|
|
|
// 使用客户方联系人别名的 customer_id 过滤同一客户
|
|
|
|
|
.eq(customerId != null, CrmCustomerContact::getCustomerId, customerId)
|
|
|
|
|
|