zoujiajian 3 лет назад
Родитель
Сommit
dfe339e164

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/model/views/PersonDistributeBrokenLineView.java

@@ -14,7 +14,7 @@ import lombok.Setter;
 @Getter
 @Setter
 @SearchBean(tables = "distribute_waiting_send_points dw left join order_don od on od.id = dw.order_id"
-		, where = ":userId: and od.is_distribute is true"
+		, where = ":userId: and od.is_distribute is true and dw.send_status not in ('not_exist','close')"
 		, groupBy = "od.goods_id,date_format(od.created_time,'%Y-%m-%d')")
 public class PersonDistributeBrokenLineView {
 	@DbField("od.goods_id")

+ 2 - 2
netflix-dao/src/main/java/com/cyksj/model/views/PlatOrderDonBrokenLineView.java

@@ -16,7 +16,7 @@ import java.math.BigDecimal;
 @Getter
 @Setter
 @SearchBean(tables = "order_don od",
-		where = ":status:"
+		where = "od.status not in ('noPayment','close','refund')"
 		, groupBy = "od.goods_id,date_format(od.created_time,'%Y-%m-%d')")
 public class PlatOrderDonBrokenLineView {
 	@DbField("od.goods_id")
@@ -31,7 +31,7 @@ public class PlatOrderDonBrokenLineView {
 	/**
 	 * 当前日期订单数
 	 */
-	@DbField("cast(od.money/100 as decimal(10,2)")
+	@DbField("cast(sum(od.money)/100 as decimal(10,2))")
 	private BigDecimal money;
 
 	/**

+ 9 - 7
netflix-web/src/main/java/com/cyksj/web/controller/manage/statistics/StatisticsDataController.java

@@ -41,7 +41,6 @@ import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -385,14 +384,17 @@ public class StatisticsDataController {
 	 * 获取每日平台订单折线数据
 	 */
 	@GetMapping("/get/plat/brokenLine")
-	public Result<Map<Long, List<PlatOrderDonBrokenLineView>>> getPlatBrokenLine(Date firstDate) {
-		if (firstDate == null) {
-			firstDate = DateUtil.beginOfWeek(DateTime.now());
+	public Result<Map<Long, List<PlatOrderDonBrokenLineView>>> getPlatBrokenLine(Long firstDate, Long lastDate) {
+		String first = null;
+		String end = null;
+		if (firstDate != null) {
+			first = DateUtil.format(DateTime.of(firstDate), "yyyy-MM-dd");
+		}
+		if (lastDate != null) {
+			end = DateUtil.format(DateTime.of(lastDate), "yyyy-MM-dd");
 		}
-		String date = DateUtil.format(firstDate, "yyyy-MM-dd");
 		List<PlatOrderDonBrokenLineView> views = beanSearcher.searchAll(PlatOrderDonBrokenLineView.class, MapUtils.builder()
-				.field(PersonDistributeBrokenLineView::getDate, date).op(Operator.GreaterEqual)
-				.put("status", String.format("od.status not in %s", Constant.noOrderAllStatus))
+				.field(PersonDistributeBrokenLineView::getDate, first, end).op(Operator.Between)
 				.orderBy(PersonDistributeBrokenLineView::getDate).asc()
 				.build());
 		Map<Long, List<PlatOrderDonBrokenLineView>> goodsMap = views.stream().collect(Collectors.groupingBy(PlatOrderDonBrokenLineView::getGoodsId));

+ 9 - 6
netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

@@ -33,7 +33,6 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
@@ -145,14 +144,18 @@ public class DistributePopularizeController {
 	 * 个人推广用户每日订单情况折线图
 	 */
 	@GetMapping("/get/order/brokenLine")
-	public Result<Map<Long, List<PersonDistributeBrokenLineView>>> getPersonDistributeBrokenLineView(Date firstDate) {
+	public Result<Map<Long, List<PersonDistributeBrokenLineView>>> getPersonDistributeBrokenLineView(Long firstDate, Long lastDate) {
 		Long userId = StpUserUtil.getLoginIdAsLong();
-		if (firstDate == null) {
-			firstDate = DateUtil.beginOfWeek(DateTime.now());
+		String first = null;
+		String end = null;
+		if (firstDate != null) {
+			first = DateUtil.format(DateTime.of(firstDate), "yyyy-MM-dd");
+		}
+		if (lastDate != null) {
+			end = DateUtil.format(DateTime.of(lastDate), "yyyy-MM-dd");
 		}
-		String date = DateUtil.format(firstDate, "yyyy-MM-dd");
 		List<PersonDistributeBrokenLineView> views = beanSearcher.searchAll(PersonDistributeBrokenLineView.class, MapUtils.builder()
-				.field(PersonDistributeBrokenLineView::getDate, date).op(Operator.GreaterEqual)
+				.field(PersonDistributeBrokenLineView::getDate, first, end).op(Operator.Between)
 				.put("userId", String.format("dw.shared_id = %s", userId))
 				.orderBy(PersonDistributeBrokenLineView::getDate).asc()
 				.build());