update order remind content
This commit is contained in:
@@ -1,44 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.imyeyu.api.modules.gao.mapper.GaoOrderReminderMapper">
|
||||
<select id="selectOrderReceiveCustomers" resultType="com.imyeyu.api.modules.gao.vo.GaoOrderReminderCustomer">
|
||||
<sql id="orderReminderSelect">
|
||||
SELECT
|
||||
o.`store_id` AS `storeId`,
|
||||
o.`customer_id` AS `customerId`,
|
||||
c.`name` AS `customerName`
|
||||
FROM `gao_sales_order` o
|
||||
c.`name` AS `customerName`,
|
||||
o.`id` AS `orderId`,
|
||||
o.`order_no` AS `orderNo`,
|
||||
o.`status` AS `orderStatus`,
|
||||
o.`payment_status` AS `paymentStatus`,
|
||||
o.`sale_amount` AS `saleAmount`,
|
||||
o.`pending_paid_amount` AS `pendingPaidAmount`,
|
||||
o.`paid_amount` AS `paidAmount`,
|
||||
GREATEST(o.`sale_amount` - o.`paid_amount`, 0) AS `unpaidAmount`,
|
||||
COALESCE(fr.`pending_receive_count`, 0) AS `pendingReceiveCount`,
|
||||
COALESCE(fr.`pending_receive_amount`, 0) AS `pendingReceiveAmount`,
|
||||
COALESCE(ff.`pending_fulfillment_count`, 0) AS `pendingFulfillmentCount`,
|
||||
COALESCE(ff.`pending_fulfillment_item_count`, 0) AS `pendingFulfillmentItemCount`
|
||||
</sql>
|
||||
|
||||
<sql id="orderReminderJoins">
|
||||
INNER JOIN `gao_customer` c ON c.`id` = o.`customer_id` AND c.`deleted_at` IS NULL
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
f.`store_id`,
|
||||
f.`biz_id`,
|
||||
COUNT(1) AS `pending_receive_count`,
|
||||
COALESCE(SUM(f.`amount`), 0) AS `pending_receive_amount`
|
||||
FROM `gao_fund_record` f
|
||||
WHERE f.`deleted_at` IS NULL
|
||||
AND f.`biz_type` = 'SALES_ORDER'
|
||||
AND f.`operation_type` = 'RECEIVE'
|
||||
AND f.`status` = 'PENDING'
|
||||
GROUP BY f.`store_id`, f.`biz_id`
|
||||
) fr ON fr.`store_id` = o.`store_id` AND fr.`biz_id` = o.`id`
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
f.`store_id`,
|
||||
f.`sales_order_id`,
|
||||
COUNT(DISTINCT f.`id`) AS `pending_fulfillment_count`,
|
||||
COUNT(fi.`id`) AS `pending_fulfillment_item_count`
|
||||
FROM `gao_order_fulfillment` f
|
||||
LEFT JOIN `gao_order_fulfillment_item` fi ON fi.`fulfillment_id` = f.`id`
|
||||
WHERE f.`status` = 'PENDING'
|
||||
GROUP BY f.`store_id`, f.`sales_order_id`
|
||||
) ff ON ff.`store_id` = o.`store_id` AND ff.`sales_order_id` = o.`id`
|
||||
</sql>
|
||||
|
||||
<select id="selectOrderReceiveCustomers" resultType="com.imyeyu.api.modules.gao.vo.GaoOrderReminderCustomer">
|
||||
<include refid="orderReminderSelect"/>
|
||||
FROM `gao_sales_order` o
|
||||
<include refid="orderReminderJoins"/>
|
||||
WHERE o.`deleted_at` IS NULL
|
||||
AND o.`status` IN ('ACTIVE', 'FULFILLED')
|
||||
AND o.`payment_status` IN ('UNPAID', 'PARTIALLY_PAID')
|
||||
GROUP BY o.`store_id`, o.`customer_id`, c.`name`
|
||||
ORDER BY o.`store_id`, c.`name`, o.`customer_id`
|
||||
ORDER BY o.`store_id`, c.`name`, o.`customer_id`, o.`purchased_at`, o.`order_no`
|
||||
</select>
|
||||
|
||||
<select id="selectReceiveVerifyCustomers" resultType="com.imyeyu.api.modules.gao.vo.GaoOrderReminderCustomer">
|
||||
SELECT
|
||||
f.`store_id` AS `storeId`,
|
||||
f.`customer_id` AS `customerId`,
|
||||
c.`name` AS `customerName`
|
||||
FROM `gao_fund_record` f
|
||||
INNER JOIN `gao_customer` c ON c.`id` = f.`customer_id` AND c.`deleted_at` IS NULL
|
||||
WHERE f.`deleted_at` IS NULL
|
||||
AND f.`biz_type` = 'SALES_ORDER'
|
||||
AND f.`operation_type` = 'RECEIVE'
|
||||
AND f.`status` = 'PENDING'
|
||||
GROUP BY f.`store_id`, f.`customer_id`, c.`name`
|
||||
ORDER BY f.`store_id`, c.`name`, f.`customer_id`
|
||||
<include refid="orderReminderSelect"/>
|
||||
FROM `gao_sales_order` o
|
||||
<include refid="orderReminderJoins"/>
|
||||
INNER JOIN (
|
||||
SELECT DISTINCT f.`store_id`, f.`biz_id`
|
||||
FROM `gao_fund_record` f
|
||||
WHERE f.`deleted_at` IS NULL
|
||||
AND f.`biz_type` = 'SALES_ORDER'
|
||||
AND f.`operation_type` = 'RECEIVE'
|
||||
AND f.`status` = 'PENDING'
|
||||
) pendingReceive ON pendingReceive.`store_id` = o.`store_id` AND pendingReceive.`biz_id` = o.`id`
|
||||
WHERE o.`deleted_at` IS NULL
|
||||
ORDER BY o.`store_id`, c.`name`, o.`customer_id`, o.`purchased_at`, o.`order_no`
|
||||
</select>
|
||||
|
||||
<select id="selectFulfillmentVerifyCustomers" resultType="com.imyeyu.api.modules.gao.vo.GaoOrderReminderCustomer">
|
||||
SELECT
|
||||
f.`store_id` AS `storeId`,
|
||||
f.`customer_id` AS `customerId`,
|
||||
c.`name` AS `customerName`
|
||||
FROM `gao_order_fulfillment` f
|
||||
INNER JOIN `gao_customer` c ON c.`id` = f.`customer_id` AND c.`deleted_at` IS NULL
|
||||
WHERE f.`status` = 'PENDING'
|
||||
GROUP BY f.`store_id`, f.`customer_id`, c.`name`
|
||||
ORDER BY f.`store_id`, c.`name`, f.`customer_id`
|
||||
<include refid="orderReminderSelect"/>
|
||||
FROM `gao_sales_order` o
|
||||
<include refid="orderReminderJoins"/>
|
||||
INNER JOIN (
|
||||
SELECT DISTINCT f.`store_id`, f.`sales_order_id`
|
||||
FROM `gao_order_fulfillment` f
|
||||
WHERE f.`status` = 'PENDING'
|
||||
) pendingFulfillment ON pendingFulfillment.`store_id` = o.`store_id`
|
||||
AND pendingFulfillment.`sales_order_id` = o.`id`
|
||||
WHERE o.`deleted_at` IS NULL
|
||||
ORDER BY o.`store_id`, c.`name`, o.`customer_id`, o.`purchased_at`, o.`order_no`
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="gao-order-reminder">
|
||||
<h2>订单状态提醒</h2>
|
||||
<p>以下订单存在待处理事项,请及时处理。</p>
|
||||
<#list customerList as customer>
|
||||
<h3>客户:${customer.name?html}</h3>
|
||||
<#list customer.orderList as order>
|
||||
<p><strong>订单号:${order.orderNo?html}</strong></p>
|
||||
<ul>
|
||||
<li><strong>订单状态:</strong>${order.orderStatus?html}</li>
|
||||
<li><strong>付款状态:</strong>${order.paymentStatus?html}</li>
|
||||
<li><strong>金额情况:</strong>${order.amountSummary?html}</li>
|
||||
<li><strong>履约情况:</strong>${order.fulfillmentSummary?html}</li>
|
||||
</ul>
|
||||
<p>
|
||||
<a
|
||||
href="/management/sales-orders/${order.orderId?html}"
|
||||
style="display: inline-block; padding: 6px 12px; color: #FFFFFF; background-color: #1677FF; text-decoration: none; border-radius: 4px;"
|
||||
>查看订单详情</a>
|
||||
</p>
|
||||
</#list>
|
||||
</#list>
|
||||
</div>
|
||||
Reference in New Issue
Block a user