feat(crm): 添加合同号字段并优化发货单联查
- 在CrmOrder实体类中新增contractCode字段用于存储合同号 - 在CrmOrderBo业务对象中添加contractCode字段支持 - 在CrmOrderMapper中增加按合同号查询的方法 - 更新CrmOrderMapper.xml映射文件以支持合同号字段映射 - 实现CrmOrderServiceImpl中合同号条件查询功能 - 在CrmOrderVo视图对象中添加合同号字段并支持Excel导出 - 为WmsDeliveryWaybill添加关联订单ID字段建立与CRM订单关联 - 在WMS模块中实现发货单与CRM订单的关联查询功能 - 重构WmsDeliveryWaybillServiceImpl中的查询方法以支持多表关联查询 - 完善WMS发货单查询界面以支持按关联订单筛选功能
This commit is contained in:
@@ -79,6 +79,12 @@ public class CrmOrder extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 删除标识 0正常 2删除
|
||||
*/
|
||||
|
||||
@@ -90,5 +90,10 @@ public class CrmOrderBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -108,6 +108,12 @@ public class CrmOrderVo extends BaseEntity {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@ExcelProperty(value = "合同号")
|
||||
private String contractCode;
|
||||
|
||||
|
||||
// @ExcelProperty(value = "客户编号")
|
||||
private String customerCode;
|
||||
|
||||
@@ -16,4 +16,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface CrmOrderMapper extends BaseMapperPlus<CrmOrderMapper, CrmOrder, CrmOrderVo> {
|
||||
|
||||
Page<CrmOrderVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<CrmOrder> lqw);
|
||||
|
||||
CrmOrderVo selectVoById(@Param("orderId") String orderId);
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
qw.eq(bo.getOrderStatus() != null, "co.order_status", bo.getOrderStatus());
|
||||
qw.eq(bo.getFinanceStatus() != null, "co.finance_status", bo.getFinanceStatus());
|
||||
qw.eq(bo.getUnpaidAmount() != null, "co.unpaid_amount", bo.getUnpaidAmount());
|
||||
qw.like(StringUtils.isNotBlank(bo.getContractCode()), "co.contract_code", bo.getContractCode());
|
||||
//逻辑删除
|
||||
qw.eq("co.del_flag", 0);
|
||||
//根据orderType排序预订单是0 正是订单是1 0排在前面 1排在后面 升序
|
||||
@@ -126,6 +127,7 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
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());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContractCode()), CrmOrder::getContractCode, bo.getContractCode());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="financeStatus" column="finance_status"/>
|
||||
<result property="unpaidAmount" column="unpaid_amount"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="contractCode" column="contract_code"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@@ -41,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
co.finance_status AS financeStatus,
|
||||
co.unpaid_amount AS unpaidAmount,
|
||||
co.remark,
|
||||
co.contract_code AS contractCode,
|
||||
co.create_by AS createBy,
|
||||
co.create_time AS createTime,
|
||||
co.update_by AS updateBy,
|
||||
@@ -56,4 +58,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectVoById" resultType="com.klp.crm.domain.vo.CrmOrderVo">
|
||||
SELECT
|
||||
co.order_id AS orderId,
|
||||
co.order_code AS orderCode,
|
||||
co.order_type AS orderType,
|
||||
co.customer_id AS customerId,
|
||||
co.order_amount AS orderAmount,
|
||||
co.salesman,
|
||||
co.delivery_date AS deliveryDate,
|
||||
co.pre_order_status AS preOrderStatus,
|
||||
co.audit_user AS auditUser,
|
||||
co.audit_time AS auditTime,
|
||||
co.order_status AS orderStatus,
|
||||
co.finance_status AS financeStatus,
|
||||
co.unpaid_amount AS unpaidAmount,
|
||||
co.remark,
|
||||
co.contract_code AS contractCode,
|
||||
co.create_by AS createBy,
|
||||
co.create_time AS createTime,
|
||||
co.update_by AS updateBy,
|
||||
co.update_time AS updateTime,
|
||||
cu.customer_code AS customerCode,
|
||||
cu.contact_person AS contactPerson,
|
||||
cu.contact_way AS contactWay,
|
||||
cu.company_name AS companyName,
|
||||
cu.address AS address
|
||||
FROM crm_order co
|
||||
LEFT JOIN crm_customer cu ON co.customer_id = cu.customer_id
|
||||
WHERE co.order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -38,6 +38,12 @@ public class WmsDeliveryWaybill extends BaseEntity {
|
||||
* 关联发货计划ID
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 关联订单ID(关联crm_order.order_id)
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 车牌(支持新能源车牌)
|
||||
*/
|
||||
|
||||
@@ -41,6 +41,11 @@ public class WmsDeliveryWaybillBo extends BaseEntity {
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 关联订单ID(关联crm_order.order_id)
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 车牌(支持新能源车牌)
|
||||
*/
|
||||
|
||||
@@ -47,6 +47,21 @@ public class WmsDeliveryWaybillVo extends BaseEntity {
|
||||
@ExcelProperty(value = "关联发货计划ID")
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 关联订单ID(关联crm_order.order_id)
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 车牌(支持新能源车牌)
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.domain.WmsDeliveryWaybill;
|
||||
import com.klp.domain.vo.WmsDeliveryWaybillVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发货单主Mapper接口
|
||||
@@ -12,4 +17,7 @@ import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
*/
|
||||
public interface WmsDeliveryWaybillMapper extends BaseMapperPlus<WmsDeliveryWaybillMapper, WmsDeliveryWaybill, WmsDeliveryWaybillVo> {
|
||||
|
||||
Page<WmsDeliveryWaybillVo> selectVoPagePlus(Page<Object> build,@Param("ew") QueryWrapper<WmsDeliveryWaybill> lqw);
|
||||
|
||||
List<WmsDeliveryWaybillVo> selectVoListPlus(@Param("ew") QueryWrapper<WmsDeliveryWaybill> lqw);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
@@ -49,8 +50,8 @@ public class WmsDeliveryWaybillServiceImpl implements IWmsDeliveryWaybillService
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsDeliveryWaybillVo> queryPageList(WmsDeliveryWaybillBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsDeliveryWaybillVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
QueryWrapper<WmsDeliveryWaybill> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<WmsDeliveryWaybillVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -59,8 +60,29 @@ public class WmsDeliveryWaybillServiceImpl implements IWmsDeliveryWaybillService
|
||||
*/
|
||||
@Override
|
||||
public List<WmsDeliveryWaybillVo> queryList(WmsDeliveryWaybillBo bo) {
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<WmsDeliveryWaybill> lqw = buildQueryWrapperPlus(bo);
|
||||
return baseMapper.selectVoListPlus(lqw);
|
||||
}
|
||||
|
||||
private com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<WmsDeliveryWaybill> buildQueryWrapperPlus(WmsDeliveryWaybillBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper<WmsDeliveryWaybill> qw = Wrappers.query();
|
||||
qw.eq(StringUtils.isNotBlank(bo.getWaybillNo()), "wd.waybill_no", bo.getWaybillNo());
|
||||
qw.like(StringUtils.isNotBlank(bo.getWaybillName()), "wd.waybill_name", bo.getWaybillName());
|
||||
qw.eq(bo.getPlanId() != null, "wd.plan_id", bo.getPlanId());
|
||||
qw.eq(bo.getOrderId() != null, "wd.order_id", bo.getOrderId());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getLicensePlate()), "wd.license_plate", bo.getLicensePlate());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getConsigneeUnit()), "wd.consignee_unit", bo.getConsigneeUnit());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getSenderUnit()), "wd.sender_unit", bo.getSenderUnit());
|
||||
qw.eq(bo.getDeliveryTime() != null, "wd.delivery_time", bo.getDeliveryTime());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getWeighbridge()), "wd.weighbridge", bo.getWeighbridge());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getSalesPerson()), "wd.sales_person", bo.getSalesPerson());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getPrincipal()), "wd.principal", bo.getPrincipal());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getPrincipalPhone()), "wd.principal_phone", bo.getPrincipalPhone());
|
||||
qw.eq(bo.getStatus() != null, "wd.status", bo.getStatus());
|
||||
// 逻辑删除
|
||||
qw.eq("wd.del_flag", 0);
|
||||
return qw;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WmsDeliveryWaybill> buildQueryWrapper(WmsDeliveryWaybillBo bo) {
|
||||
@@ -78,6 +100,7 @@ public class WmsDeliveryWaybillServiceImpl implements IWmsDeliveryWaybillService
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPrincipal()), WmsDeliveryWaybill::getPrincipal, bo.getPrincipal());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPrincipalPhone()), WmsDeliveryWaybill::getPrincipalPhone, bo.getPrincipalPhone());
|
||||
lqw.eq(bo.getStatus() != null, WmsDeliveryWaybill::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getOrderId() != null, WmsDeliveryWaybill::getOrderId, bo.getOrderId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<result property="waybillNo" column="waybill_no"/>
|
||||
<result property="waybillName" column="waybill_name"/>
|
||||
<result property="planId" column="plan_id"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="licensePlate" column="license_plate"/>
|
||||
<result property="consigneeUnit" column="consignee_unit"/>
|
||||
<result property="senderUnit" column="sender_unit"/>
|
||||
@@ -26,5 +27,87 @@
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.klp.domain.vo.WmsDeliveryWaybillVo" id="WmsDeliveryWaybillVoResult">
|
||||
<result property="waybillId" column="waybill_id"/>
|
||||
<result property="waybillNo" column="waybill_no"/>
|
||||
<result property="waybillName" column="waybill_name"/>
|
||||
<result property="planId" column="plan_id"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="orderCode" column="order_code"/>
|
||||
<result property="contractCode" column="contract_code"/>
|
||||
<result property="licensePlate" column="license_plate"/>
|
||||
<result property="consigneeUnit" column="consignee_unit"/>
|
||||
<result property="senderUnit" column="sender_unit"/>
|
||||
<result property="deliveryTime" column="delivery_time"/>
|
||||
<result property="weighbridge" column="weighbridge"/>
|
||||
<result property="salesPerson" column="sales_person"/>
|
||||
<result property="principal" column="principal"/>
|
||||
<result property="principalPhone" column="principal_phone"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectVoPagePlus" resultMap="WmsDeliveryWaybillVoResult">
|
||||
SELECT
|
||||
wd.waybill_id AS waybill_id,
|
||||
wd.waybill_no AS waybill_no,
|
||||
wd.waybill_name AS waybill_name,
|
||||
wd.plan_id AS plan_id,
|
||||
wd.order_id AS order_id,
|
||||
co.order_code AS order_code,
|
||||
co.contract_code AS contract_code,
|
||||
wd.license_plate AS license_plate,
|
||||
wd.consignee_unit AS consignee_unit,
|
||||
wd.sender_unit AS sender_unit,
|
||||
wd.delivery_time AS delivery_time,
|
||||
wd.weighbridge AS weighbridge,
|
||||
wd.sales_person AS sales_person,
|
||||
wd.principal AS principal,
|
||||
wd.principal_phone AS principal_phone,
|
||||
wd.status AS status,
|
||||
wd.remark AS remark,
|
||||
wd.del_flag AS del_flag,
|
||||
wd.create_time AS create_time,
|
||||
wd.create_by AS create_by,
|
||||
wd.update_time AS update_time,
|
||||
wd.update_by AS update_by
|
||||
FROM wms_delivery_waybill wd
|
||||
LEFT JOIN crm_order co ON wd.order_id = co.order_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectVoListPlus" resultMap="WmsDeliveryWaybillVoResult">
|
||||
SELECT
|
||||
wd.waybill_id AS waybill_id,
|
||||
wd.waybill_no AS waybill_no,
|
||||
wd.waybill_name AS waybill_name,
|
||||
wd.plan_id AS plan_id,
|
||||
wd.order_id AS order_id,
|
||||
co.order_code AS order_code,
|
||||
co.contract_code AS contract_code,
|
||||
wd.license_plate AS license_plate,
|
||||
wd.consignee_unit AS consignee_unit,
|
||||
wd.sender_unit AS sender_unit,
|
||||
wd.delivery_time AS delivery_time,
|
||||
wd.weighbridge AS weighbridge,
|
||||
wd.sales_person AS sales_person,
|
||||
wd.principal AS principal,
|
||||
wd.principal_phone AS principal_phone,
|
||||
wd.status AS status,
|
||||
wd.remark AS remark,
|
||||
wd.del_flag AS del_flag,
|
||||
wd.create_time AS create_time,
|
||||
wd.create_by AS create_by,
|
||||
wd.update_time AS update_time,
|
||||
wd.update_by AS update_by
|
||||
FROM wms_delivery_waybill wd
|
||||
LEFT JOIN crm_order co ON wd.order_id = co.order_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user