浏览代码

后台功能更新

luobo 3 年之前
父节点
当前提交
1c7d1b5539

+ 31 - 9
smart-admin/src/main/java/com/huijy/web/controller/api/ApiIndexController.java

@@ -43,6 +43,8 @@ public class ApiIndexController extends ApiAbstractController {
     private IMarkerService markerService;
     @Autowired
     private IEarlyWarningService earlyWarningService;
+    @Autowired
+    private IMemberHelpService memberHelpService;
 
     @PostMapping("/pushLatLng")
     @ApiOperation("上传会员坐标")
@@ -76,15 +78,10 @@ public class ApiIndexController extends ApiAbstractController {
             @ApiImplicitParam(name = "lng", value = "坐标的lng",dataType = "String",paramType = "body"),
             @ApiImplicitParam(name = "phone", value = "求助电话",dataType = "String", paramType = "body")
     })
-    public AjaxResult pushHelp(@ApiIgnore Member member, @RequestBody Map params) {
-        String lat = (String) params.get("lat");
-        String lng = (String) params.get("lng");
-        String phone = (String) params.get("phone");
-        MemberHelp help = new MemberHelp();
-        help.setLat(lat);
-        help.setLng(lng);
-        help.setPhone(phone);
+    public AjaxResult pushHelp(@ApiIgnore Member member, @RequestBody MemberHelp help) {
+
         help.setMemberId(member.getMemberId());
+        memberHelpService.insertMemberHelp(help);
         return AjaxResult.success();
     }
 
@@ -147,18 +144,43 @@ public class ApiIndexController extends ApiAbstractController {
             @ApiImplicitParam(name = "businessHours", value = "营业时间", paramType = "body"),
             @ApiImplicitParam(name = "briefContent", value = "简介", paramType = "body"),
             @ApiImplicitParam(name = "lat", value = "坐标的lat", paramType = "body"),
-            @ApiImplicitParam(name = "lng", value = "坐标的lng", paramType = "body")
+            @ApiImplicitParam(name = "lng", value = "坐标的lng", paramType = "body"),
+            @ApiImplicitParam(name = "shopType", value = "商铺类型 1、商铺 2、酒店",defaultValue = "1",paramType = "body"),
     })
     public AjaxResult storeApply(@ApiIgnore Member member, @RequestBody Shop shop) {
         if (shop == null){
             AjaxResult.error("提交数据为空");
         }
+        shop.setMemberId(member.getMemberId());
         shop.setAuditFlag("0");
         shop.setEnableFlag("0");
         shopService.insertShop(shop);
         return AjaxResult.success();
     }
 
+    //门店开通申请
+    @GetMapping("/getShopList")
+    @ApiOperation("获取商铺列表")
+    public AjaxResult getShopList(@ApiIgnore Member member) {
+        List list = shopService.getListByMemberId(member.getMemberId());
+        Map<String, Object> resultObj = new HashMap<String, Object>();
+        resultObj.put("list", list);
+        return AjaxResult.success(resultObj);
+    }
+
+    @GetMapping("/getShopInfo/{shopId}")
+    @ApiOperation("获取商铺列表")
+    public AjaxResult getShopInfo(@ApiIgnore Member member, @PathVariable Long shopId) {
+        if (shopId == null){
+            AjaxResult.error("提交数据为空");
+        }
+        Shop shop = shopService.selectShopByShopId(shopId);
+        Map<String, Object> resultObj = new HashMap<String, Object>();
+        resultObj.put("shopInfo", shop);
+        return AjaxResult.success(resultObj);
+    }
+
+
     //更新门店坐标
     @PostMapping("/updateLatLng")
     @ApiOperation("更新门店坐标")

+ 6 - 0
smart-admin/src/main/java/com/huijy/web/controller/management/ShopController.java

@@ -1,5 +1,6 @@
 package com.huijy.web.controller.management;
 
+import java.util.Date;
 import java.util.List;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -87,6 +88,11 @@ public class ShopController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody Shop shop)
     {
+        if (shop.getAuditFlag().equalsIgnoreCase("1") ){
+            shop.setAuditAt(getUserId());
+            shop.setAuditTime(new Date());
+        }
+
         return toAjax(shopService.updateShop(shop));
     }
 

+ 14 - 0
smart-system/src/main/java/com/huijy/management/domain/Member.java

@@ -93,6 +93,11 @@ public class Member extends BaseEntity
     /** 最后坐标lng */
     @Excel(name = "最后坐标lng")
     private String lastLng;
+    /**
+     * 是否有店铺
+     */
+    @Excel(name = "是否有店铺")
+    private Integer isShop;
 
     public void setMemberId(Long memberId)
     {
@@ -266,6 +271,14 @@ public class Member extends BaseEntity
         return lastLng;
     }
 
+    public Integer getIsShop() {
+        return isShop;
+    }
+
+    public void setIsShop(Integer isShop) {
+        this.isShop = isShop;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -288,6 +301,7 @@ public class Member extends BaseEntity
             .append("language", getLanguage())
             .append("lastLat", getLastLat())
             .append("lastLng", getLastLng())
+            .append("isShop", getIsShop())
             .toString();
     }
 }

+ 26 - 0
smart-system/src/main/java/com/huijy/management/domain/Shop.java

@@ -77,6 +77,14 @@ public class Shop extends BaseEntity
 
     /** 审核时间 */
     private Date auditTime;
+    /**
+     * 老板会员id
+     */
+    private Long memberId;
+    /**
+     * 商铺类型 1、商铺 2、酒店
+     */
+    private String shopType;
 
     public void setShopId(Long shopId)
     {
@@ -223,6 +231,22 @@ public class Shop extends BaseEntity
         return auditTime;
     }
 
+    public Long getMemberId() {
+        return memberId;
+    }
+
+    public void setMemberId(Long memberId) {
+        this.memberId = memberId;
+    }
+
+    public String getShopType() {
+        return shopType;
+    }
+
+    public void setShopType(String shopType) {
+        this.shopType = shopType;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@@ -243,6 +267,8 @@ public class Shop extends BaseEntity
             .append("auditAt", getAuditAt())
             .append("auditTime", getAuditTime())
             .append("createTime", getCreateTime())
+            .append("memberId", getMemberId())
+            .append("shopType", getShopType())
             .toString();
     }
 }

+ 11 - 8
smart-system/src/main/java/com/huijy/management/mapper/ShopMapper.java

@@ -2,18 +2,19 @@ package com.huijy.management.mapper;
 
 import java.util.List;
 import com.huijy.management.domain.Shop;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 商铺管理Mapper接口
- * 
+ *
  * @author luobo
  * @date 2021-09-12
  */
-public interface ShopMapper 
+public interface ShopMapper
 {
     /**
      * 查询商铺管理
-     * 
+     *
      * @param shopId 商铺管理主键
      * @return 商铺管理
      */
@@ -21,7 +22,7 @@ public interface ShopMapper
 
     /**
      * 查询商铺管理列表
-     * 
+     *
      * @param shop 商铺管理
      * @return 商铺管理集合
      */
@@ -29,7 +30,7 @@ public interface ShopMapper
 
     /**
      * 新增商铺管理
-     * 
+     *
      * @param shop 商铺管理
      * @return 结果
      */
@@ -37,7 +38,7 @@ public interface ShopMapper
 
     /**
      * 修改商铺管理
-     * 
+     *
      * @param shop 商铺管理
      * @return 结果
      */
@@ -45,7 +46,7 @@ public interface ShopMapper
 
     /**
      * 删除商铺管理
-     * 
+     *
      * @param shopId 商铺管理主键
      * @return 结果
      */
@@ -53,9 +54,11 @@ public interface ShopMapper
 
     /**
      * 批量删除商铺管理
-     * 
+     *
      * @param shopIds 需要删除的数据主键集合
      * @return 结果
      */
     public int deleteShopByShopIds(Long[] shopIds);
+
+    List<Shop> selectListByMemberId(@Param("memberId") Long memberId);
 }

+ 15 - 8
smart-system/src/main/java/com/huijy/management/service/IShopService.java

@@ -5,15 +5,15 @@ import com.huijy.management.domain.Shop;
 
 /**
  * 商铺管理Service接口
- * 
+ *
  * @author luobo
  * @date 2021-09-12
  */
-public interface IShopService 
+public interface IShopService
 {
     /**
      * 查询商铺管理
-     * 
+     *
      * @param shopId 商铺管理主键
      * @return 商铺管理
      */
@@ -21,7 +21,7 @@ public interface IShopService
 
     /**
      * 查询商铺管理列表
-     * 
+     *
      * @param shop 商铺管理
      * @return 商铺管理集合
      */
@@ -29,7 +29,7 @@ public interface IShopService
 
     /**
      * 新增商铺管理
-     * 
+     *
      * @param shop 商铺管理
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface IShopService
 
     /**
      * 修改商铺管理
-     * 
+     *
      * @param shop 商铺管理
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface IShopService
 
     /**
      * 批量删除商铺管理
-     * 
+     *
      * @param shopIds 需要删除的商铺管理主键集合
      * @return 结果
      */
@@ -53,9 +53,16 @@ public interface IShopService
 
     /**
      * 删除商铺管理信息
-     * 
+     *
      * @param shopId 商铺管理主键
      * @return 结果
      */
     public int deleteShopByShopId(Long shopId);
+
+    /**
+     * 根据会员id获取会员店铺列表
+     * @param memberId
+     * @return
+     */
+    List<Shop> getListByMemberId(Long memberId);
 }

+ 6 - 0
smart-system/src/main/java/com/huijy/management/service/impl/ShopServiceImpl.java

@@ -68,6 +68,7 @@ public class ShopServiceImpl implements IShopService
     @Override
     public int updateShop(Shop shop)
     {
+
         return shopMapper.updateShop(shop);
     }
 
@@ -94,4 +95,9 @@ public class ShopServiceImpl implements IShopService
     {
         return shopMapper.deleteShopByShopId(shopId);
     }
+
+    @Override
+    public List<Shop> getListByMemberId(Long memberId) {
+        return shopMapper.selectListByMemberId(memberId);
+    }
 }

+ 4 - 1
smart-system/src/main/resources/mapper/management/MemberMapper.xml

@@ -24,10 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="language"    column="language"    />
         <result property="lastLat"    column="last_lat"    />
         <result property="lastLng"    column="last_lng"    />
+        <result property="isShop"    column="is_shop"    />
     </resultMap>
 
     <sql id="selectMemberVo">
-        select member_id, name, mobile, email, register_time, last_login_time, last_login_ip, login_num, unionid, openid, nick_name, avatar_url, gender, province, city, country, language, last_lat, last_lng from t_member
+        select member_id, name, mobile, email, register_time, last_login_time, last_login_ip, login_num, unionid, openid, nick_name, avatar_url, gender, province, city, country, language, last_lat, last_lng,
+        (select count(*) from t_shop  where t_shop.member_id = t_member.member_id) is_shop
+        from t_member
     </sql>
 
     <select id="selectMemberList" parameterType="Member" resultMap="MemberResult">

+ 22 - 7
smart-system/src/main/resources/mapper/management/ShopMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.huijy.management.mapper.ShopMapper">
-    
+
     <resultMap type="Shop" id="ShopResult">
         <result property="shopId"    column="shop_id"    />
         <result property="name"    column="name"    />
@@ -22,15 +22,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="auditAt"    column="audit_at"    />
         <result property="auditTime"    column="audit_time"    />
         <result property="createTime"    column="create_time"    />
+        <result property="memberId"    column="member_id"    />
+        <result property="shopType"    column="shop_type"    />
     </resultMap>
 
     <sql id="selectShopVo">
-        select shop_id, name, addres, lat, lng, boss_name, boss_phone, show_pictures, label_text, business_hours, brief_content, content, enable_flag, audit_flag, audit_at, audit_time, create_time from t_shop
+        select shop_id, name, addres, lat, lng, boss_name, boss_phone, show_pictures, label_text, business_hours, brief_content, content, enable_flag, audit_flag, audit_at, audit_time, create_time,
+        member_id,shop_type from t_shop
     </sql>
 
     <select id="selectShopList" parameterType="Shop" resultMap="ShopResult">
         <include refid="selectShopVo"/>
-        <where>  
+        <where>
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
             <if test="bossName != null  and bossName != ''"> and boss_name like concat('%', #{bossName}, '%')</if>
             <if test="bossPhone != null  and bossPhone != ''"> and boss_phone = #{bossPhone}</if>
@@ -38,12 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditFlag != null  and auditFlag != ''"> and audit_flag = #{auditFlag}</if>
         </where>
     </select>
-    
+
     <select id="selectShopByShopId" parameterType="Long" resultMap="ShopResult">
         <include refid="selectShopVo"/>
         where shop_id = #{shopId}
     </select>
-        
+
     <insert id="insertShop" parameterType="Shop" useGeneratedKeys="true" keyProperty="shopId">
         insert into t_shop
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -63,6 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditAt != null">audit_at,</if>
             <if test="auditTime != null">audit_time,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="memberId != null">member_id,</if>
+            <if test="shopType != null">shop_type,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="name != null">#{name},</if>
@@ -81,6 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditAt != null">#{auditAt},</if>
             <if test="auditTime != null">#{auditTime},</if>
             <if test="createTime != null">#{createTime},</if>
+            <if test="memberId != null">#{memberId},</if>
+            <if test="shopType != null">#{shopType},</if>
          </trim>
     </insert>
 
@@ -103,6 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditAt != null">audit_at = #{auditAt},</if>
             <if test="auditTime != null">audit_time = #{auditTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="memberId != null">member_id = #{memberId},</if>
+            <if test="shopType != null">shop_type = #{shopType},</if>
         </trim>
         where shop_id = #{shopId}
     </update>
@@ -112,9 +121,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteShopByShopIds" parameterType="String">
-        delete from t_shop where shop_id in 
+        delete from t_shop where shop_id in
         <foreach item="shopId" collection="array" open="(" separator="," close=")">
             #{shopId}
         </foreach>
     </delete>
-</mapper>
+
+    <select id="selectListByMemberId" parameterType="Long" resultMap="ShopResult">
+        <include refid="selectShopVo"/>
+        where member_id = #{memberId}
+
+    </select>
+</mapper>

+ 13 - 12
smart-ui/src/views/management/shop/index.vue

@@ -55,7 +55,7 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button
           type="primary"
           plain
@@ -64,7 +64,7 @@
           @click="handleAdd"
           v-hasPermi="['management:shop:add']"
         >新增</el-button>
-      </el-col>
+      </el-col> -->
       <el-col :span="1.5">
         <el-button
           type="success"
@@ -103,20 +103,20 @@
 
     <el-table v-loading="loading" :data="shopList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="商铺id" align="center" prop="shopId" />
+      <!-- <el-table-column label="商铺id" align="center" prop="shopId" /> -->
       <el-table-column label="商铺名称" align="center" prop="name" />
       <el-table-column label="地址" align="center" prop="addres" />
-      <el-table-column label="坐标lat" align="center" prop="lat" />
-      <el-table-column label="坐标lng" align="center" prop="lng" />
+      <!-- <el-table-column label="坐标lat" align="center" prop="lat" /> -->
+      <!-- <el-table-column label="坐标lng" align="center" prop="lng" /> -->
       <el-table-column label="老板名称" align="center" prop="bossName" />
       <el-table-column label="老板电话" align="center" prop="bossPhone" />
       <el-table-column label="标签" align="center" prop="labelText" />
       <el-table-column label="营业时间" align="center" prop="businessHours" />
-      <el-table-column label="简介" align="center" prop="briefContent" />
-      <el-table-column label="详情" align="center" prop="content" />
+      <!-- <el-table-column label="简介" align="center" prop="briefContent" /> -->
+      <!-- <el-table-column label="详情" align="center" prop="content" /> -->
       <el-table-column label="状态" align="center" prop="enableFlag" :formatter="enableFlagFormat" />
       <el-table-column label="审核状态" align="center" prop="auditFlag" :formatter="auditFlagFormat" />
-      <el-table-column label="审核人" align="center" prop="auditAt" />
+      <!-- <el-table-column label="审核人" align="center" prop="auditAt" /> -->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -199,16 +199,17 @@
             >{{dict.dictLabel}}</el-radio>
           </el-radio-group>
         </el-form-item>
-        <el-form-item label="审核人" prop="auditAt">
+        <!-- <el-form-item label="审核人" prop="auditAt">
           <el-input v-model="form.auditAt" placeholder="请输入审核人" />
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="审核时间" prop="auditTime">
-          <el-date-picker clearable size="small"
+            <el-input v-model="form.auditTime" disabled placeholder="请输入审核时间" />
+          <!-- <el-date-picker clearable size="small"
             v-model="form.auditTime"
             type="date"
             value-format="yyyy-MM-dd"
             placeholder="选择审核时间">
-          </el-date-picker>
+          </el-date-picker> -->
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">