Explorar el Código

fix cps平台数据汇总

zoujiajian hace 1 año
padre
commit
9df28a0788

+ 4 - 4
netflix-dao/src/main/java/com/cyksj/model/views/UserDistributeOrdersStatisticsView.java

@@ -16,7 +16,7 @@ import java.math.BigDecimal;
 @Getter
 @Setter
 @SearchBean(tables = "(select * from distribute_waiting_send_points where :sharedId: :time:) dw left join order_don od on od.id = dw.order_id and dw.is_vip = false and od.status not in ('close','noPayment')" +
-		" left join vip_order_don vod on vod.id = dw.oder_id and dw.is_vip = true and vod.status not in ('close','noPayment')" +
+		" left join vip_order_don vod on vod.id = dw.order_id and dw.is_vip = true and vod.status not in ('close','noPayment')" +
 		" left join goods_don g on g.id = ifnull(od.goods_id,vod.goods_id)",
 		groupBy = "ifnull(od.goods_id,vod.goods_id),g.title")
 public class UserDistributeOrdersStatisticsView {
@@ -24,18 +24,18 @@ public class UserDistributeOrdersStatisticsView {
 	@DbField("g.title")
 	private String title;
 
-	@DbField("cast(sum(if(od.id is null,vod.money,if(od.is_dp and od.ori_money != 0,od.ori_money,od.money))/100 as decimal(10,2)))")
+	@DbField("cast(sum(if(od.id is null,vod.money,if(od.is_dp and od.ori_money != 0,od.ori_money,od.money))/100) as decimal(10,2))")
 	private BigDecimal distributeOrderMoney;
 
 	@DbField("count(dw.order_id)")
 	private Integer orders;
 
-	@DbField("TRUNCATE(sum(if(dp.send_status != 'close',dp.points,0))/1000,2)")
+	@DbField("TRUNCATE(sum(if(dw.send_status != 'close',dw.points,0))/1000,2)")
 	private BigDecimal takeMoney;
 
 	@DbField("count(if(ifnull(od.status,vod.status) = 'refund',1,NULL))")
 	private Integer refundOrders;
 
-	@DbField("cast(sum(if(od.id is null,vod.refund_money,ifnull(if(od.is_dp and od.ori_money != 0 and od.refund_money > od.ori_money,od.ori_money,od.refund_money),0))/100 as decimal(10,2)))")
+	@DbField("cast(sum(if(od.id is null,vod.refund_money,ifnull(if(od.is_dp and od.ori_money != 0 and od.refund_money > od.ori_money,od.ori_money,od.refund_money),0)))/100 as decimal(10,2))")
 	private BigDecimal refundMoney;
 }

+ 3 - 3
netflix-web/src/main/java/com/cyksj/web/controller/cps/CpsDistribtueDataController.java

@@ -131,14 +131,14 @@ public class CpsDistribtueDataController {
 		long cpsUserId = StpCpsManageUser.getLoginIdAsLong();
 		String first = null;
 		String end = null;
-		String timeSql = null;
+		String timeSql = StrUtil.EMPTY;
 		if (firstDate != null) {
 			first = DateUtil.format(DateTime.of(firstDate), "yyyy-MM-dd HH:mm:ss");
-			timeSql += String.format(" and dw.created_time >= '%s'", first);
+			timeSql += String.format(" and created_time >= '%s'", first);
 		}
 		if (lastDate != null) {
 			end = DateUtil.format(DateTime.of(lastDate), "yyyy-MM-dd HH:mm:ss");
-			timeSql += String.format(" and dw.created_time < '%s'", end);
+			timeSql += String.format(" and created_time < '%s'", end);
 		}
 		MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
 		builder.put("sharedId", String.format("shared_id = %s", cpsUserId));