From dc5be7d38446f70e6ff86df311119c32b41fe7f8 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 28 十一月 2020 16:37:05 +0800
Subject: [PATCH] 大淘客搜索接口升级

---
 fanli/src/main/java/com/yeshi/fanli/job/order/OrderStatisticJob.java |   51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/job/order/OrderStatisticJob.java b/fanli/src/main/java/com/yeshi/fanli/job/order/OrderStatisticJob.java
index bce097e..3f7a233 100644
--- a/fanli/src/main/java/com/yeshi/fanli/job/order/OrderStatisticJob.java
+++ b/fanli/src/main/java/com/yeshi/fanli/job/order/OrderStatisticJob.java
@@ -1,5 +1,6 @@
 package com.yeshi.fanli.job.order;
 
+import java.util.Calendar;
 import java.util.Date;
 
 import javax.annotation.Resource;
@@ -10,7 +11,7 @@
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.yeshi.fanli.service.manger.order.OrderMoneyStatisticManager;
 import com.yeshi.fanli.util.StringUtil;
-import com.yeshi.fanli.util.TimeUtil;
+import org.yeshi.utils.TimeUtil;
 
 //璁㈠崟缁熻浠诲姟
 @Component
@@ -38,6 +39,18 @@
 		long startTime = System.currentTimeMillis();
 		if (!StringUtil.isNullOrEmpty(param)) {
 			startTime = TimeUtil.convertToTimeTemp(param, "yyyy-MM-dd");
+		} else {// 姣忓ぉ闆剁偣闇�瑕佸悓姝ヤ笂涓�澶╃殑鏁版嵁
+			Calendar calendar = Calendar.getInstance();
+			calendar.setTimeInMillis(startTime);
+			if (calendar.get(Calendar.HOUR_OF_DAY) == 0) {
+				Date start = new Date(TimeUtil.convertToTimeTemp(
+						TimeUtil.getGernalTime(startTime - 1000 * 60 * 60 * 24L, "yyyy-MM-dd"), "yyyy-MM-dd"));
+
+				Date end = new Date(
+						TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(startTime, "yyyy-MM-dd"), "yyyy-MM-dd"));
+
+				orderMoneyStatisticManager.syncFanliAndShareData(start, end);
+			}
 		}
 
 		Date start = new Date(
@@ -65,6 +78,18 @@
 		long startTime = System.currentTimeMillis();
 		if (!StringUtil.isNullOrEmpty(param)) {
 			startTime = TimeUtil.convertToTimeTemp(param, "yyyy-MM-dd");
+		} else {// 姣忓ぉ闆剁偣闇�瑕佸悓姝ヤ笂涓�澶╃殑鏁版嵁
+			Calendar calendar = Calendar.getInstance();
+			calendar.setTimeInMillis(startTime);
+			if (calendar.get(Calendar.HOUR_OF_DAY) == 0) {
+				Date start = new Date(TimeUtil.convertToTimeTemp(
+						TimeUtil.getGernalTime(startTime - 1000 * 60 * 60 * 24L, "yyyy-MM-dd"), "yyyy-MM-dd"));
+
+				Date end = new Date(
+						TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(startTime, "yyyy-MM-dd"), "yyyy-MM-dd"));
+
+				orderMoneyStatisticManager.syncTeamData(start, end);
+			}
 		}
 
 		Date start = new Date(
@@ -92,6 +117,18 @@
 		long startTime = System.currentTimeMillis();
 		if (!StringUtil.isNullOrEmpty(param)) {
 			startTime = TimeUtil.convertToTimeTemp(param, "yyyy-MM-dd");
+		} else {// 姣忓ぉ闆剁偣闇�瑕佸悓姝ヤ笂涓�澶╃殑鏁版嵁
+			Calendar calendar = Calendar.getInstance();
+			calendar.setTimeInMillis(startTime);
+			if (calendar.get(Calendar.HOUR_OF_DAY) == 0) {
+				Date start = new Date(TimeUtil.convertToTimeTemp(
+						TimeUtil.getGernalTime(startTime - 1000 * 60 * 60 * 24L, "yyyy-MM-dd"), "yyyy-MM-dd"));
+
+				Date end = new Date(
+						TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(startTime, "yyyy-MM-dd"), "yyyy-MM-dd"));
+
+				orderMoneyStatisticManager.syncOrderNum(start, end);
+			}
 		}
 
 		Date start = new Date(
@@ -119,6 +156,18 @@
 		long startTime = System.currentTimeMillis();
 		if (!StringUtil.isNullOrEmpty(param)) {
 			startTime = TimeUtil.convertToTimeTemp(param, "yyyy-MM-dd");
+		} else {// 姣忓ぉ闆剁偣闇�瑕佸悓姝ヤ笂涓�澶╃殑鏁版嵁
+			Calendar calendar = Calendar.getInstance();
+			calendar.setTimeInMillis(startTime);
+			if (calendar.get(Calendar.HOUR_OF_DAY) == 0) {
+				Date start = new Date(TimeUtil.convertToTimeTemp(
+						TimeUtil.getGernalTime(startTime - 1000 * 60 * 60 * 24L, "yyyy-MM-dd"), "yyyy-MM-dd"));
+
+				Date end = new Date(
+						TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(startTime, "yyyy-MM-dd"), "yyyy-MM-dd"));
+
+				orderMoneyStatisticManager.syncDividents(start, end);
+			}
 		}
 
 		Date start = new Date(

--
Gitblit v1.8.0