zoujiajian 2 سال پیش
والد
کامیت
0ae5bbe9b1

+ 76 - 0
netflix-dao/src/main/java/com/cyksj/model/views/YhShopDetailView.java

@@ -0,0 +1,76 @@
+package com.cyksj.model.views;
+
+import com.cyksj.model.entity.YhShopApplyRecord;
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 项目名: yhlxj
+ * 文件名: YhShopDetailView
+ * 创建者: JavaZou
+ * 创建时间:2023/9/28 14:39
+ */
+@Getter
+@Setter
+@SearchBean(tables = "yh_shop_apply_record ys left join user u on u.id = ys.user_id")
+public class YhShopDetailView {
+
+	@DbField("ys.user_id")
+	private Long userId;
+
+
+	@DbField("u.nickname")
+	private String nickname;
+
+	/**
+	 * 店铺名称
+	 */
+	@DbField("ys.name")
+	private String name;
+
+	/**
+	 * 自定义id
+	 */
+	@DbField("ys.custom_id")
+	private String customId;
+
+	/**
+	 * 是否审核通过
+	 */
+	@DbField("ys.verify_status")
+	private YhShopApplyRecord.Status verifyStatus;
+
+	/**
+	 * 审核失败原因
+	 */
+	@DbField("ys.reason")
+	private String reason;
+
+	/**
+	 * 店铺开放状态
+	 */
+	@DbField("ys.status")
+	private Boolean status;
+
+	/**
+	 * 联系方式
+	 */
+	@DbField("ys.contact")
+	private String contact;
+
+	/**
+	 * 备注
+	 */
+	@DbField("ys.remark")
+	private String remark;
+
+	@DbField("ys.created_time")
+	private Date createdTime;
+
+	@DbField("ys.update_time")
+	private Date updateTime;
+}

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

@@ -6,6 +6,7 @@ import com.ejlchina.searcher.bean.SearchBean;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -15,8 +16,8 @@ import java.util.List;
 @Data
 @SearchBean(tables = "yh_shop_goods_sku ysgs left join goods_don g on g.id = ysgs.goods_id" +
         " left join goods_don_sku sku on sku.id = ysgs.sku_id",
-        where = "g.status = true and g.deleted = true and sku.status is true"
-        , groupBy = "g.id,g.title,g.category,ysgs.status,ysgs.user_id")
+        where = "ysgs.deleted is true and g.status = true and g.deleted = true and sku.status is true"
+        , groupBy = "g.id,g.title,g.category,ysgs.status,ysgs.user_id,ysgs.created_time,ysgs.update_time")
 public class YhShopGoodsView {
     @DbField("g.id")
     private Long goodsId;
@@ -36,6 +37,12 @@ public class YhShopGoodsView {
     @DbField("group_concat(sku.spec_val,cast((ysgs.price/100) as decimal(10,2)),'元')")
     private String skuDetail;
 
+    @DbField("ysgs.created_time")
+    private Date createdTime;
+
+    @DbField("ysgs.update_time")
+    private Date updateTime;
+
     @DbIgnore
     private List<YhShopGoodsSkuView> list;
 

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

@@ -86,7 +86,7 @@ public class YhShopGoodsController {
 	public Result<SearchResult<YhShopAvailableGoodsView>> getAvailableGoods(){
 		long userId = StpYhShopManageUser.getLoginIdAsLong();
 		SearchResult<YhShopAvailableGoodsView> search = beanSearcher.search(YhShopAvailableGoodsView.class, MapUtils.builder()
-				.put("condition", String.format("and (select count(*) from yh_shop_goods_sku where user_id = %s and goods_id = yr.goods_id) = 0", userId))
+				.put("condition", String.format("and (select count(*) from yh_shop_goods_sku where user_id = %s and goods_id = yr.goods_id and deleted is true) = 0", userId))
 				.build());
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}

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

@@ -55,11 +55,12 @@ public class YhShopUserController {
 	 * 店铺 信息详情
 	 */
 	@GetMapping("/get/shop/detail/data")
-	public Result<YhShop> getShopDetail() {
+	public Result<YhShopDetailView> getShopDetail() {
 		long yhShopUserId = StpYhShopManageUser.getLoginIdAsLong();
-		YhShop yhShop = yhShopMapper.selectOne(Wrappers.lambdaQuery(YhShop.class)
-				.eq(YhShop::getUserId, yhShopUserId).last("limit 1"));
-		return GatewayResponse.SUCCESS.newBuilder().toResult(yhShop);
+		YhShopDetailView detailView = beanSearcher.searchFirst(YhShopDetailView.class, MapUtils.flatBuilder(request.getParameterMap())
+				.field(YhShopDetailView::getUserId, yhShopUserId)
+				.build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(detailView);
 	}
 
 	/**