feat(wms): 新增合同挂接钢卷统计功能
- 在IWmsCoilContractRelService接口中添加queryContractCoilStatistics方法 - 在WmsCoilContractRelController控制器中添加统计查询和导出接口 - 在WmsCoilContractRelMapper中添加selectContractCoilStatistics查询方法 - 实现合同挂接钢卷统计的SQL查询逻辑,支持多条件筛选 - 创建ContractCoilStatisticsBo查询对象和ContractCoilStatisticsVo视图对象 - 开发前端统计页面,包含搜索筛选、统计卡片、图表展示和数据表格 - 集成ECharts实现合同状态分布饼图和销售员挂接钢卷柱状图 - 实现统计数据的Excel导出功能 - 添加响应式设计适配移动端显示
This commit is contained in:
@@ -154,4 +154,49 @@
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 合同挂接钢卷统计:LEFT JOIN 合同 + 关联表 + 钢卷,按合同分组统计 -->
|
||||
<select id="selectContractCoilStatistics" resultType="com.klp.domain.vo.ContractCoilStatisticsVo">
|
||||
SELECT
|
||||
co.order_id AS orderId,
|
||||
co.order_code AS orderCode,
|
||||
co.contract_code AS contractCode,
|
||||
co.contract_name AS contractName,
|
||||
co.customer,
|
||||
co.supplier,
|
||||
co.salesman,
|
||||
co.status,
|
||||
co.order_amount AS orderAmount,
|
||||
co.sign_time AS signTime,
|
||||
co.delivery_date AS deliveryDate,
|
||||
COUNT(rel.coil_id) AS coilCount,
|
||||
IFNULL(SUM(mc.net_weight), 0) AS totalNetWeight,
|
||||
IFNULL(SUM(mc.gross_weight), 0) AS totalGrossWeight
|
||||
FROM crm_order co
|
||||
LEFT JOIN wms_coil_contract_rel rel ON co.order_id = rel.contract_id AND rel.del_flag = 0
|
||||
LEFT JOIN wms_material_coil mc ON rel.coil_id = mc.coil_id AND mc.del_flag = 0
|
||||
WHERE co.del_flag = 0
|
||||
<if test="bo.contractCode != null and bo.contractCode != ''">
|
||||
AND co.contract_code LIKE CONCAT('%', #{bo.contractCode}, '%')
|
||||
</if>
|
||||
<if test="bo.contractName != null and bo.contractName != ''">
|
||||
AND co.contract_name LIKE CONCAT('%', #{bo.contractName}, '%')
|
||||
</if>
|
||||
<if test="bo.customer != null and bo.customer != ''">
|
||||
AND co.customer LIKE CONCAT('%', #{bo.customer}, '%')
|
||||
</if>
|
||||
<if test="bo.salesman != null and bo.salesman != ''">
|
||||
AND co.salesman LIKE CONCAT('%', #{bo.salesman}, '%')
|
||||
</if>
|
||||
<if test="bo.status != null">
|
||||
AND co.status = #{bo.status}
|
||||
</if>
|
||||
<if test="bo.orderCode != null and bo.orderCode != ''">
|
||||
AND co.order_code LIKE CONCAT('%', #{bo.orderCode}, '%')
|
||||
</if>
|
||||
GROUP BY co.order_id, co.order_code, co.contract_code, co.contract_name,
|
||||
co.customer, co.supplier, co.salesman, co.status,
|
||||
co.order_amount, co.sign_time, co.delivery_date
|
||||
ORDER BY coilCount DESC, co.order_id ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user