瀏覽代碼

新增-app查看商铺

linbl 1 年之前
父節點
當前提交
ef23420b3e

+ 46 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_shop/TbShopAppController.java

@@ -0,0 +1,46 @@
+package com.pj.tb_shop;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.pj.api.dto.HtShopDTO;
+import com.pj.api.dto.ShopDto;
+import com.pj.project4sp.SP;
+import com.pj.tb_shop.vo.ShopVo;
+import com.pj.utils.sg.AjaxJson;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.List;
+
+
+/**
+ * Controller: tb_shop -- 商铺(App接口)
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/app/TbShop/")
+public class TbShopAppController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbShopService tbShopService;
+
+
+	/** 查 - 根据id */
+	@RequestMapping("getDetailById")
+	public AjaxJson getDetailById(Long id){
+		TbShop t = tbShopService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getAppList")
+	public AjaxJson getAppList() {
+		List<ShopVo> list = tbShopService.getAppList();
+		return AjaxJson.getPageData(Long.valueOf(list.size()), list);
+	}
+
+
+}

+ 17 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_shop/TbShopService.java

@@ -20,6 +20,7 @@ import com.pj.project4sp.SP;
 import com.pj.tb_enterprise.TbEnterprise;
 import com.pj.tb_enterprise.TbEnterpriseMapper;
 import com.pj.tb_enterprise.TbEnterpriseService;
+import com.pj.tb_shop.vo.ShopVo;
 import com.pj.tb_trade_area.TbTradeArea;
 import com.pj.tb_trade_area.TbTradeAreaService;
 import com.pj.utils.so.SoMap;
@@ -103,6 +104,22 @@ public class TbShopService extends ServiceImpl<TbShopMapper, TbShop> implements
         return tbShopMapper.getList(so);
     }
 
+    /**
+     * app查集合
+     */
+    List<ShopVo> getAppList() {
+        SoMap so = new SoMap();
+        so.set("deleteStatus", 1);
+        List<TbShop> list = tbShopMapper.getList(so);
+
+        List<ShopVo> shopVoList = new ArrayList<>();
+        list.forEach(tbShop -> {
+            ShopVo shopVo = new ShopVo();
+            BeanUtils.copyProperties(tbShop,shopVo);
+            shopVoList.add(shopVo);
+        });
+        return shopVoList;
+    }
 
     /**
      * 导入

+ 45 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_shop/vo/ShopVo.java

@@ -0,0 +1,45 @@
+package com.pj.tb_shop.vo;
+
+import lombok.Data;
+
+/**
+ * Model: tb_shop -- 铺位
+ * @author lbl
+ */
+@Data
+public class ShopVo {
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键
+	 */
+	private String id;
+
+	/**
+	 * 互市区名称
+	 */
+	private String tradeAreaName;
+
+	/**
+	 * 区域(A区=A区,B区=B区,C区=C区)
+	 */
+	private String area;
+
+	/**
+	 * 商铺名称
+	 */
+	private String shopName;
+
+	/**
+	 * 商铺编码
+	 */
+	private String shopNo;
+
+	/**
+	 * 铺主姓名
+	 */
+	private String ownerName;
+
+
+}