1
This commit is contained in:
@@ -1566,8 +1566,9 @@ public class TencentDocController extends BaseController {
|
|||||||
log.info(logMsg);
|
log.info(logMsg);
|
||||||
|
|
||||||
// 更新订单的推送状态(重新查询订单,避免使用旧对象)
|
// 更新订单的推送状态(重新查询订单,避免使用旧对象)
|
||||||
|
JDOrder orderToUpdate = null;
|
||||||
try {
|
try {
|
||||||
JDOrder orderToUpdate = jdOrderService.selectJDOrderByThirdPartyOrderNo(expectedOrderNo);
|
orderToUpdate = jdOrderService.selectJDOrderByThirdPartyOrderNo(expectedOrderNo);
|
||||||
if (orderToUpdate != null) {
|
if (orderToUpdate != null) {
|
||||||
orderToUpdate.setTencentDocPushed(1);
|
orderToUpdate.setTencentDocPushed(1);
|
||||||
orderToUpdate.setTencentDocPushTime(new java.util.Date());
|
orderToUpdate.setTencentDocPushTime(new java.util.Date());
|
||||||
@@ -1597,6 +1598,10 @@ public class TencentDocController extends BaseController {
|
|||||||
if (phone != null) {
|
if (phone != null) {
|
||||||
successLog.put("phone", phone);
|
successLog.put("phone", phone);
|
||||||
}
|
}
|
||||||
|
// 添加型号信息
|
||||||
|
if (orderToUpdate != null && orderToUpdate.getModelNumber() != null) {
|
||||||
|
successLog.put("modelNumber", orderToUpdate.getModelNumber());
|
||||||
|
}
|
||||||
|
|
||||||
// 检查是否为物流链接更新(复用之前的变量)
|
// 检查是否为物流链接更新(复用之前的变量)
|
||||||
if (Boolean.TRUE.equals(isLinkUpdated)) {
|
if (Boolean.TRUE.equals(isLinkUpdated)) {
|
||||||
@@ -2766,9 +2771,6 @@ public class TencentDocController extends BaseController {
|
|||||||
content.append("【批量同步-腾讯文档同步成功】\n\n");
|
content.append("【批量同步-腾讯文档同步成功】\n\n");
|
||||||
}
|
}
|
||||||
content.append(String.format("✓ 成功填充: %d 条\n", filledCount));
|
content.append(String.format("✓ 成功填充: %d 条\n", filledCount));
|
||||||
if (skippedCount > 0) {
|
|
||||||
content.append(String.format("⊘ 跳过: %d 条\n", skippedCount));
|
|
||||||
}
|
|
||||||
if (errorCount > 0) {
|
if (errorCount > 0) {
|
||||||
content.append(String.format("✗ 错误: %d 条\n", errorCount));
|
content.append(String.format("✗ 错误: %d 条\n", errorCount));
|
||||||
}
|
}
|
||||||
@@ -2783,20 +2785,43 @@ public class TencentDocController extends BaseController {
|
|||||||
content.append("\n");
|
content.append("\n");
|
||||||
|
|
||||||
if (!successLogs.isEmpty()) {
|
if (!successLogs.isEmpty()) {
|
||||||
|
// 统计今天的型号
|
||||||
|
Map<String, Integer> modelCountMap = new java.util.HashMap<>();
|
||||||
|
for (Map<String, Object> log : successLogs) {
|
||||||
|
String modelNumber = (String) log.get("modelNumber");
|
||||||
|
if (modelNumber != null && !modelNumber.trim().isEmpty()) {
|
||||||
|
modelCountMap.put(modelNumber, modelCountMap.getOrDefault(modelNumber, 0) + 1);
|
||||||
|
} else {
|
||||||
|
modelCountMap.put("未知型号", modelCountMap.getOrDefault("未知型号", 0) + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示今天的型号统计
|
||||||
|
if (!modelCountMap.isEmpty()) {
|
||||||
|
content.append("【今天的型号统计】\n");
|
||||||
|
List<Map.Entry<String, Integer>> sortedModels = new java.util.ArrayList<>(modelCountMap.entrySet());
|
||||||
|
sortedModels.sort((a, b) -> b.getValue().compareTo(a.getValue())); // 按数量降序排序
|
||||||
|
for (Map.Entry<String, Integer> entry : sortedModels) {
|
||||||
|
content.append(String.format("型号: %s 数量: %d\n", entry.getKey(), entry.getValue()));
|
||||||
|
}
|
||||||
|
content.append("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示每一单具体的型号
|
||||||
content.append("【成功详情】\n");
|
content.append("【成功详情】\n");
|
||||||
// 最多显示20条详细记录,避免消息过长
|
// 最多显示20条详细记录,避免消息过长
|
||||||
int maxDisplay = Math.min(20, successLogs.size());
|
int maxDisplay = Math.min(20, successLogs.size());
|
||||||
for (int i = 0; i < maxDisplay; i++) {
|
for (int i = 0; i < maxDisplay; i++) {
|
||||||
Map<String, Object> log = successLogs.get(i);
|
Map<String, Object> log = successLogs.get(i);
|
||||||
String orderNo = (String) log.get("orderNo");
|
String orderNo = (String) log.get("orderNo");
|
||||||
Integer row = (Integer) log.get("row");
|
|
||||||
String logisticsLink = (String) log.get("logisticsLink");
|
String logisticsLink = (String) log.get("logisticsLink");
|
||||||
String phone = (String) log.get("phone");
|
String modelNumber = (String) log.get("modelNumber");
|
||||||
|
|
||||||
content.append(String.format("%d. 单号: %s\n", i + 1, orderNo));
|
content.append(String.format("%d. 单号: %s\n", i + 1, orderNo));
|
||||||
content.append(String.format(" 行号: %d\n", row));
|
if (modelNumber != null && !modelNumber.trim().isEmpty()) {
|
||||||
if (phone != null && !phone.isEmpty()) {
|
content.append(String.format(" 型号: %s\n", modelNumber));
|
||||||
content.append(String.format(" 电话: %s\n", phone));
|
} else {
|
||||||
|
content.append(" 型号: 未知\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查是否为物流链接更新
|
// 检查是否为物流链接更新
|
||||||
|
|||||||
@@ -121,6 +121,30 @@ public class JDOrder extends BaseEntity {
|
|||||||
@Excel(name = "后返到账日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "后返到账日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date rebateReceivedDate;
|
private Date rebateReceivedDate;
|
||||||
|
|
||||||
|
/** 点过价保(0否 1是) */
|
||||||
|
@Excel(name = "点过价保")
|
||||||
|
private Integer isPriceProtected;
|
||||||
|
|
||||||
|
/** 价保日期 */
|
||||||
|
@Excel(name = "价保日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date priceProtectedDate;
|
||||||
|
|
||||||
|
/** 开过专票(0否 1是) */
|
||||||
|
@Excel(name = "开过专票")
|
||||||
|
private Integer isInvoiceOpened;
|
||||||
|
|
||||||
|
/** 开票日期 */
|
||||||
|
@Excel(name = "开票日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date invoiceOpenedDate;
|
||||||
|
|
||||||
|
/** 晒过评价(0否 1是) */
|
||||||
|
@Excel(name = "晒过评价")
|
||||||
|
private Integer isReviewPosted;
|
||||||
|
|
||||||
|
/** 评价日期 */
|
||||||
|
@Excel(name = "评价日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reviewPostedDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,12 +29,19 @@
|
|||||||
<result property="refundReceivedDate" column="refund_received_date"/>
|
<result property="refundReceivedDate" column="refund_received_date"/>
|
||||||
<result property="isRebateReceived" column="is_rebate_received"/>
|
<result property="isRebateReceived" column="is_rebate_received"/>
|
||||||
<result property="rebateReceivedDate" column="rebate_received_date"/>
|
<result property="rebateReceivedDate" column="rebate_received_date"/>
|
||||||
|
<result property="isPriceProtected" column="is_price_protected"/>
|
||||||
|
<result property="priceProtectedDate" column="price_protected_date"/>
|
||||||
|
<result property="isInvoiceOpened" column="is_invoice_opened"/>
|
||||||
|
<result property="invoiceOpenedDate" column="invoice_opened_date"/>
|
||||||
|
<result property="isReviewPosted" column="is_review_posted"/>
|
||||||
|
<result property="reviewPostedDate" column="review_posted_date"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectJDOrderBase">
|
<sql id="selectJDOrderBase">
|
||||||
select id, remark, distribution_mark, model_number, link, payment_amount, rebate_amount,
|
select id, remark, distribution_mark, model_number, link, payment_amount, rebate_amount,
|
||||||
address, logistics_link, order_id, buyer, order_time, create_time, update_time, status, is_count_enabled, third_party_order_no, jingfen_actual_price,
|
address, logistics_link, order_id, buyer, order_time, create_time, update_time, status, is_count_enabled, third_party_order_no, jingfen_actual_price,
|
||||||
is_refunded, refund_date, is_refund_received, refund_received_date, is_rebate_received, rebate_received_date
|
is_refunded, refund_date, is_refund_received, refund_received_date, is_rebate_received, rebate_received_date,
|
||||||
|
is_price_protected, price_protected_date, is_invoice_opened, invoice_opened_date, is_review_posted, review_posted_date
|
||||||
from jd_order
|
from jd_order
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
@@ -62,6 +69,9 @@
|
|||||||
<if test="isRefunded != null"> and is_refunded = #{isRefunded}</if>
|
<if test="isRefunded != null"> and is_refunded = #{isRefunded}</if>
|
||||||
<if test="isRefundReceived != null"> and is_refund_received = #{isRefundReceived}</if>
|
<if test="isRefundReceived != null"> and is_refund_received = #{isRefundReceived}</if>
|
||||||
<if test="isRebateReceived != null"> and is_rebate_received = #{isRebateReceived}</if>
|
<if test="isRebateReceived != null"> and is_rebate_received = #{isRebateReceived}</if>
|
||||||
|
<if test="isPriceProtected != null"> and is_price_protected = #{isPriceProtected}</if>
|
||||||
|
<if test="isInvoiceOpened != null"> and is_invoice_opened = #{isInvoiceOpened}</if>
|
||||||
|
<if test="isReviewPosted != null"> and is_review_posted = #{isReviewPosted}</if>
|
||||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
and date(order_time) >= #{params.beginTime}
|
and date(order_time) >= #{params.beginTime}
|
||||||
</if>
|
</if>
|
||||||
@@ -96,6 +106,9 @@
|
|||||||
<if test="isRefunded != null"> and is_refunded = #{isRefunded}</if>
|
<if test="isRefunded != null"> and is_refunded = #{isRefunded}</if>
|
||||||
<if test="isRefundReceived != null"> and is_refund_received = #{isRefundReceived}</if>
|
<if test="isRefundReceived != null"> and is_refund_received = #{isRefundReceived}</if>
|
||||||
<if test="isRebateReceived != null"> and is_rebate_received = #{isRebateReceived}</if>
|
<if test="isRebateReceived != null"> and is_rebate_received = #{isRebateReceived}</if>
|
||||||
|
<if test="isPriceProtected != null"> and is_price_protected = #{isPriceProtected}</if>
|
||||||
|
<if test="isInvoiceOpened != null"> and is_invoice_opened = #{isInvoiceOpened}</if>
|
||||||
|
<if test="isReviewPosted != null"> and is_review_posted = #{isReviewPosted}</if>
|
||||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
and date(order_time) >= #{params.beginTime}
|
and date(order_time) >= #{params.beginTime}
|
||||||
</if>
|
</if>
|
||||||
@@ -126,13 +139,15 @@
|
|||||||
payment_amount, rebate_amount, address, logistics_link,
|
payment_amount, rebate_amount, address, logistics_link,
|
||||||
tencent_doc_pushed, tencent_doc_push_time,
|
tencent_doc_pushed, tencent_doc_push_time,
|
||||||
order_id, buyer, order_time, create_time, update_time, status, is_count_enabled, third_party_order_no, jingfen_actual_price,
|
order_id, buyer, order_time, create_time, update_time, status, is_count_enabled, third_party_order_no, jingfen_actual_price,
|
||||||
is_refunded, refund_date, is_refund_received, refund_received_date, is_rebate_received, rebate_received_date
|
is_refunded, refund_date, is_refund_received, refund_received_date, is_rebate_received, rebate_received_date,
|
||||||
|
is_price_protected, price_protected_date, is_invoice_opened, invoice_opened_date, is_review_posted, review_posted_date
|
||||||
) values (
|
) values (
|
||||||
#{remark}, #{distributionMark}, #{modelNumber}, #{link},
|
#{remark}, #{distributionMark}, #{modelNumber}, #{link},
|
||||||
#{paymentAmount}, #{rebateAmount}, #{address}, #{logisticsLink},
|
#{paymentAmount}, #{rebateAmount}, #{address}, #{logisticsLink},
|
||||||
0, null,
|
0, null,
|
||||||
#{orderId}, #{buyer}, #{orderTime}, now(), now(), #{status}, #{isCountEnabled}, #{thirdPartyOrderNo}, #{jingfenActualPrice},
|
#{orderId}, #{buyer}, #{orderTime}, now(), now(), #{status}, #{isCountEnabled}, #{thirdPartyOrderNo}, #{jingfenActualPrice},
|
||||||
#{isRefunded}, #{refundDate}, #{isRefundReceived}, #{refundReceivedDate}, #{isRebateReceived}, #{rebateReceivedDate}
|
#{isRefunded}, #{refundDate}, #{isRefundReceived}, #{refundReceivedDate}, #{isRebateReceived}, #{rebateReceivedDate},
|
||||||
|
#{isPriceProtected}, #{priceProtectedDate}, #{isInvoiceOpened}, #{invoiceOpenedDate}, #{isReviewPosted}, #{reviewPostedDate}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -162,6 +177,12 @@
|
|||||||
<if test="refundReceivedDate != null"> refund_received_date = #{refundReceivedDate},</if>
|
<if test="refundReceivedDate != null"> refund_received_date = #{refundReceivedDate},</if>
|
||||||
<if test="isRebateReceived != null"> is_rebate_received = #{isRebateReceived},</if>
|
<if test="isRebateReceived != null"> is_rebate_received = #{isRebateReceived},</if>
|
||||||
<if test="rebateReceivedDate != null"> rebate_received_date = #{rebateReceivedDate},</if>
|
<if test="rebateReceivedDate != null"> rebate_received_date = #{rebateReceivedDate},</if>
|
||||||
|
<if test="isPriceProtected != null"> is_price_protected = #{isPriceProtected},</if>
|
||||||
|
<if test="priceProtectedDate != null"> price_protected_date = #{priceProtectedDate},</if>
|
||||||
|
<if test="isInvoiceOpened != null"> is_invoice_opened = #{isInvoiceOpened},</if>
|
||||||
|
<if test="invoiceOpenedDate != null"> invoice_opened_date = #{invoiceOpenedDate},</if>
|
||||||
|
<if test="isReviewPosted != null"> is_review_posted = #{isReviewPosted},</if>
|
||||||
|
<if test="reviewPostedDate != null"> review_posted_date = #{reviewPostedDate},</if>
|
||||||
update_time = now()
|
update_time = now()
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
|||||||
15
sql/jd_order_new_status_fields.sql
Normal file
15
sql/jd_order_new_status_fields.sql
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
-- 为jd_order表添加新的状态字段:点过价保、开过专票、晒过评价
|
||||||
|
-- 执行日期:2025-01-26
|
||||||
|
|
||||||
|
ALTER TABLE jd_order
|
||||||
|
ADD COLUMN is_price_protected INT DEFAULT 0 COMMENT '点过价保(0否 1是)',
|
||||||
|
ADD COLUMN price_protected_date DATETIME NULL COMMENT '价保日期',
|
||||||
|
ADD COLUMN is_invoice_opened INT DEFAULT 0 COMMENT '开过专票(0否 1是)',
|
||||||
|
ADD COLUMN invoice_opened_date DATETIME NULL COMMENT '开票日期',
|
||||||
|
ADD COLUMN is_review_posted INT DEFAULT 0 COMMENT '晒过评价(0否 1是)',
|
||||||
|
ADD COLUMN review_posted_date DATETIME NULL COMMENT '评价日期';
|
||||||
|
|
||||||
|
-- 添加索引(可选,根据查询需求)
|
||||||
|
-- CREATE INDEX idx_is_price_protected ON jd_order(is_price_protected);
|
||||||
|
-- CREATE INDEX idx_is_invoice_opened ON jd_order(is_invoice_opened);
|
||||||
|
-- CREATE INDEX idx_is_review_posted ON jd_order(is_review_posted);
|
||||||
Reference in New Issue
Block a user