zoujiajian 2 år sedan
förälder
incheckning
b749a1c432

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

@@ -17,7 +17,7 @@ import java.util.Date;
  */
 @Getter
 @Setter
-@SearchBean(tables = "(select o.id,o.user_id,o.goods_id,o.sku_id,o.money,o.refund_money,o.coupon_money,o.created_time from order_don o inner join (select user_id from yh_shop_user_distribute_shared where :shopUserId:) us on us.user_id = o.user_id where o.yhs_id != 0 and o.status not in ('close','noPayment') :time:) od" +
+@SearchBean(tables = "(select o.id,o.user_id,o.goods_id,o.sku_id,o.money,o.refund_money,o.coupon_money,o.created_time from order_don o where :yhs_id: and o.status not in ('close','noPayment') :time:) od" +
 		" left join goods_don g on g.id = od.goods_id" +
 		" inner join yh_shop_distribute_waiting_send_points dp on dp.order_id = od.id")
 public class YhShopUserDistributeOrdersDetailView {

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

@@ -15,7 +15,7 @@ import java.math.BigDecimal;
  */
 @Getter
 @Setter
-@SearchBean(tables = "(select o.id,o.user_id,o.goods_id,o.money,o.refund_money,o.status from order_don o inner join (select user_id from yh_shop_user_distribute_shared where :shopUserId:) us on us.user_id = o.user_id where o.yhs_id != 0 and o.status not in ('close','noPayment') :time:) od left join goods_don g on g.id = od.goods_id" +
+@SearchBean(tables = "(select o.id,o.user_id,o.goods_id,o.money,o.refund_money,o.status from order_don o where :yhs_id: and o.status not in ('close','noPayment') :time:) od left join goods_don g on g.id = od.goods_id" +
 		" inner join yh_shop_distribute_waiting_send_points dp on dp.order_id = od.id",
 		groupBy = "od.goods_id,g.title")
 public class YhShopUserDistributeOrdersStatisticsView {

+ 3 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/CmsYhShopGoodsController.java

@@ -268,7 +268,9 @@ public class CmsYhShopGoodsController {
      */
     @GetMapping("/get/register/detail/{shopUserId}")
     public Result<SearchResult<YhShopRegisterDetail>> getRegisterDetail(@PathVariable Long shopUserId) {
-        SearchResult<YhShopRegisterDetail> search = beanSearcher.search(YhShopRegisterDetail.class, MapUtils.flatBuilder(request.getParameterMap()).build());
+        SearchResult<YhShopRegisterDetail> search = beanSearcher.search(YhShopRegisterDetail.class, MapUtils.flatBuilder(request.getParameterMap())
+                .field(YhShopRegisterDetail::getShopUserId, shopUserId)
+                .build());
         search.getDataList().forEach(data -> {
             List<RegisterDistributeOrdersDetailView> ordersDetailViewList = beanSearcher.searchAll(RegisterDistributeOrdersDetailView.class, MapUtils.builder().field(RegisterDistributeOrdersDetailView::getUserId, data.getUserId()).op(Operator.Equal).build());
             data.setOrderNums(ordersDetailViewList.size());

+ 6 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/YhShopUserController.java

@@ -181,6 +181,8 @@ public class YhShopUserController {
 	@GetMapping("/get/distribute/orders/statisticsData")
 	public Result<SearchResult<YhShopUserDistributeOrdersStatisticsView>> getUserDistributeOrdersStatisticsView(Long firstDate, Long lastDate) {
 		long yhShopUserId = StpYhShopManageUser.getLoginIdAsLong();
+		YhShop yhShop = yhShopMapper.selectOne(Wrappers.lambdaQuery(YhShop.class)
+				.eq(YhShop::getUserId, yhShopUserId).last("limit 1"));
 		String first = null;
 		String end = null;
 		String timeSql = StrUtil.EMPTY;
@@ -193,7 +195,7 @@ public class YhShopUserController {
 			timeSql += String.format(" and o.created_time < '%s'", end);
 		}
 		MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
-		builder.put("shopUserId", String.format("shop_user_id = %s", yhShopUserId));
+		builder.put("yhs_id", String.format("yhs_id = %s", yhShop.getId()));
 		if (StrUtil.isNotEmpty(timeSql)) {
 			builder.put("time", timeSql);
 		}
@@ -207,6 +209,8 @@ public class YhShopUserController {
 	@GetMapping("/get/distribute/orders/detail/data")
 	public Result<SearchResult<YhShopUserDistributeOrdersDetailView>> getUserDistributeOrdersDetailView(Long firstDate, Long lastDate) {
 		long yhShopUserId = StpYhShopManageUser.getLoginIdAsLong();
+		YhShop yhShop = yhShopMapper.selectOne(Wrappers.lambdaQuery(YhShop.class)
+				.eq(YhShop::getUserId, yhShopUserId).last("limit 1"));
 		String first = null;
 		String end = null;
 		String timeSql = StrUtil.EMPTY;
@@ -219,7 +223,7 @@ public class YhShopUserController {
 			timeSql += String.format(" and o.created_time < '%s'", end);
 		}
 		MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
-		builder.put("shopUserId", String.format("shop_user_id = %s", yhShopUserId));
+		builder.put("yhs_id", String.format("yhs_id = %s", yhShop.getId()));
 		if (StrUtil.isNotEmpty(timeSql)) {
 			builder.put("time", timeSql);
 		}