Sfoglia il codice sorgente

供应商/机构添加

Aslee 3 anni fa
parent
commit
343104c2ec

+ 53 - 0
src/main/java/com/caimei/controller/AddressApi.java

@@ -0,0 +1,53 @@
+package com.caimei.controller;
+
+
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.AddressSelectVo;
+import com.caimei.service.AddressService;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+
+/**
+ * 收货地址Api
+ *
+ * @author : Charles
+ * @date : 2021/7/2
+ */
+@Api(tags = "收货地址API")
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/order/address")
+public class AddressApi {
+
+    private final AddressService addressService;
+
+    /**
+     * 收货地址下拉选项列表
+     */
+    @ApiOperation("收货地址下拉选项列表(旧:/club/province(city)(town))")
+    @ApiImplicitParams({
+            @ApiImplicitParam(required = false, name = "type", value = "选项类型:0省(默认),1市,2区"),
+            @ApiImplicitParam(required = false, name = "parentId", value = "父级地址Id")
+    })
+    @GetMapping("/select")
+    public ResponseJson<List<AddressSelectVo>> getSelectAddress(Integer type, Integer parentId) {
+        if (null == type) {
+            type = 0;
+        } else {
+            if (null == parentId) {
+                return ResponseJson.error("父级地址Id不能为空!", null);
+            }
+        }
+        return addressService.getSelectAddress(type, parentId);
+    }
+
+}

+ 37 - 1
src/main/java/com/caimei/controller/AuthApi.java

@@ -2,8 +2,11 @@ package com.caimei.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;
+import com.caimei.model.po.CmBrandAuthPo;
+import com.caimei.model.vo.AuthFormVo;
 import com.caimei.model.vo.AuthVo;
 import com.caimei.model.vo.BrandVo;
+import com.caimei.model.vo.ShopFormVo;
 import com.caimei.service.AuthService;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
@@ -77,6 +80,16 @@ public class AuthApi {
         return authService.deleteAuth(authId);
     }
 
+    /**
+     * 授权机构回显数据
+     */
+    @ApiOperation("授权机构回显数据")
+    @ApiImplicitParam(name = "authId", required = true, value = "机构用户id")
+    @GetMapping("/form/data")
+    public ResponseJson<AuthFormVo> getAuthFormData(Integer authId) {
+        return authService.getAuthFormData(authId);
+    }
+
     /**
      * 添加/编辑授权
      */
@@ -87,9 +100,32 @@ public class AuthApi {
         JSONObject paramsMap = JSONObject.parseObject(params);
         Integer authId = paramsMap.getInteger("authId");
         Integer authUserId = paramsMap.getInteger("authUserId");
+        Integer provinceId = paramsMap.getInteger("provinceId");
+        Integer cityId = paramsMap.getInteger("cityId");
+        Integer townId = paramsMap.getInteger("townId");
+        String address = paramsMap.getString("address");
+        String lonAndLat = paramsMap.getString("lonAndLat");
+        String mobile = paramsMap.getString("mobile");
+        String logo = paramsMap.getString("logo");
+        List<String> bannerList = (List<String>) paramsMap.get("bannerList");
         String authParty = paramsMap.getString("authParty");
         Integer createBy = paramsMap.getInteger("createBy");
-        return authService.saveAuth(authId, authUserId, authParty, createBy);
+        /*
+            组装授权数据
+         */
+        CmBrandAuthPo auth = new CmBrandAuthPo();
+        auth.setId(authId);
+        auth.setAuthUserId(authUserId);
+        auth.setAuthParty(authParty);
+        auth.setProvinceId(provinceId);
+        auth.setCityId(cityId);
+        auth.setTownId(townId);
+        auth.setAddress(address);
+        auth.setLonAndLat(lonAndLat);
+        auth.setMobile(mobile);
+        auth.setLogo(logo);
+        auth.setCreateBy(createBy);
+        return authService.saveAuth(auth, bannerList, false);
     }
 
 

+ 2 - 1
src/main/java/com/caimei/controller/ShopApi.java

@@ -123,6 +123,7 @@ public class ShopApi {
             return ResponseJson.error("参数异常,请输入供应商状态");
         }
         String qrCodeImage = (String) paramsMap.get("qrCodeImage");
+        Integer wxAccountType = (Integer) paramsMap.get("wxAccountType");
         String appId = (String) paramsMap.get("appId");
         String appSecret = (String) paramsMap.get("appSecret");
         Integer createBy = paramsMap.getInteger("createBy");
@@ -156,7 +157,7 @@ public class ShopApi {
             shopInfo.setStatementFileId(statementFileId);
             shopInfoList.add(shopInfo);
         }
-        return shopService.saveShop(authUserId, shopType, shopName, mobile, linkMan, shopStatus, qrCodeImage, appId, appSecret, createBy, shopInfoList);
+        return shopService.saveShop(authUserId, shopType, shopName, mobile, linkMan, shopStatus, qrCodeImage, wxAccountType, appId, appSecret, createBy, shopInfoList);
     }
 
     /**

+ 31 - 0
src/main/java/com/caimei/mapper/AddressMapper.java

@@ -0,0 +1,31 @@
+package com.caimei.mapper;
+
+import com.caimei.model.vo.AddressSelectVo;
+import com.caimei.module.base.entity.vo.AddressVo;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2022/1/6
+ */
+@Mapper
+public interface AddressMapper {
+    /**
+     * 获取所有省份列表
+     */
+    List<AddressSelectVo> getAllProvinceList();
+    /**
+     * 获取当前省份下的所有城市列表
+     * @param provinceId 省份Id
+     */
+    List<AddressSelectVo> getCityListByProvinceId(Integer provinceId);
+    /**
+     * 获取当前城市下的所有地区列表
+     * @param cityId
+     */
+    List<AddressSelectVo> getTownListByCityId(Integer cityId);
+}

+ 6 - 0
src/main/java/com/caimei/mapper/AuthMapper.java

@@ -38,4 +38,10 @@ public interface AuthMapper {
     Integer getAuthIdByAuthParty(@Param("authParty") String authParty, @Param("authUserId") Integer authUserId);
 
     List<CmBrandAuthPo> getAuthPartyList(Integer authUserId);
+
+    void deleteBanner(Integer authId);
+
+    void insertBanner(@Param("authId") Integer authId, @Param("banner") String banner);
+
+    List<String> getBannerList(Integer authId);
 }

+ 36 - 5
src/main/java/com/caimei/model/po/CmBrandAuthPo.java

@@ -5,6 +5,7 @@ import java.util.Date;
 import java.util.List;
 
 import com.caimei.model.vo.ProductFormVo;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 /**
@@ -25,6 +26,41 @@ public class CmBrandAuthPo {
      */
     private String authParty;
 
+    /**
+     * 省id
+     */
+    private Integer provinceId;
+
+    /**
+     * 市id
+     */
+    private Integer cityId;
+
+    /**
+     * 区id
+     */
+    private Integer townId;
+
+    /**
+     * 详细地址
+     */
+    private String address;
+
+    /**
+     * 经纬度
+     */
+    private String lonAndLat;
+
+    /**
+     * 联系方式
+     */
+    private String mobile;
+
+    /**
+     * 机构logo
+     */
+    private String logo;
+
     /**
      * 上线状态:0已下线,1已上线,2待上线
      */
@@ -35,11 +71,6 @@ public class CmBrandAuthPo {
      */
     private Integer auditStatus;
 
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-
     /**
      * 创建人Id
      */

+ 5 - 0
src/main/java/com/caimei/model/po/UserPo.java

@@ -50,6 +50,11 @@ public class UserPo {
      */
     private String qrCodeImage;
 
+    /**
+     * 微信公众号类型:1订阅号,2服务号
+     */
+    private Integer wxAccountType;
+
     /**
      * 公众号appId
      */

+ 30 - 0
src/main/java/com/caimei/model/vo/AddressSelectVo.java

@@ -0,0 +1,30 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 选择地址下拉框列表 数据
+ *
+ * @author : Charles
+ * @date : 2021/7/2
+ */
+@Data
+public class AddressSelectVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("ID")
+    private Integer id;
+
+    @ApiModelProperty("名称")
+    private String name;
+
+    @ApiModelProperty("父级ID")
+    private Integer parentId;
+
+    @ApiModelProperty("子级列表")
+    private List<AddressSelectVo> children;
+}

+ 44 - 0
src/main/java/com/caimei/model/vo/AuthFormVo.java

@@ -0,0 +1,44 @@
+package com.caimei.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/5/11
+ */
+@Data
+public class AuthFormVo implements Serializable {
+    @ApiModelProperty("授权机构id")
+    private Integer authId;
+
+    @ApiModelProperty("省id")
+    private Integer provinceId;
+
+    @ApiModelProperty("市id")
+    private Integer cityId;
+
+    @ApiModelProperty("区id")
+    private Integer townId;
+
+    @ApiModelProperty("详细地址")
+    private String address;
+
+    @ApiModelProperty("经纬度")
+    private String lonAndLat;
+
+    @ApiModelProperty("联系方式")
+    private String mobile;
+
+    @ApiModelProperty("机构logo")
+    private String logo;
+
+    @ApiModelProperty("轮播图")
+    private List<String> bannerList;
+
+}

+ 25 - 0
src/main/java/com/caimei/service/AddressService.java

@@ -0,0 +1,25 @@
+package com.caimei.service;
+
+
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.AddressSelectVo;
+import com.caimei.module.base.entity.vo.AddressVo;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2022/1/6
+ */
+public interface AddressService {
+
+    /**
+     * 收货地址下拉选项列表
+     * @param type     选项类型:0省(默认),1市,2区
+     * @param parentId 父级地址Id
+     */
+    ResponseJson<List<AddressSelectVo>> getSelectAddress(Integer type, Integer parentId);
+}

+ 14 - 6
src/main/java/com/caimei/service/AuthService.java

@@ -1,11 +1,14 @@
 package com.caimei.service;
 
 import com.caimei.model.ResponseJson;
+import com.caimei.model.po.CmBrandAuthPo;
+import com.caimei.model.vo.AuthFormVo;
 import com.caimei.model.vo.AuthVo;
 import com.github.pagehelper.PageInfo;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
  * Description
@@ -49,13 +52,11 @@ public interface AuthService {
     /**
      * 添加/编辑授权
      *
-     * @param authId            授权id
-     * @param authUserId        供应商用户id
-     * @param authParty         授权机构
-     * @param createBy          创建人id
-     * @return  ResponseJson
+     * @param auth       授权机构
+     * @param bannerList 轮播图列表
+     * @return ResponseJson
      */
-    ResponseJson saveAuth(Integer authId, Integer authUserId, String authParty, Integer createBy);
+    ResponseJson saveAuth(CmBrandAuthPo auth, List<String> bannerList, boolean importFlag);
 
     /**
      * 审核品牌授权
@@ -84,4 +85,11 @@ public interface AuthService {
      * @return
      */
     ResponseJson exportDataByExcel(Integer authUserId, HttpServletResponse response);
+
+    /**
+     * 授权机构回显数据
+     * @param authId    机构id
+     * @return
+     */
+    ResponseJson<AuthFormVo> getAuthFormData(Integer authId);
 }

+ 2 - 1
src/main/java/com/caimei/service/ShopService.java

@@ -77,11 +77,12 @@ public interface ShopService {
      *                    createBy           创建人用户id
      *                    }
      * @param qrCodeImage
+     * @param wxAccountType
      * @param appId
      * @param appSecret
      * @param shopInfoList
      */
-    ResponseJson saveShop(Integer authUserId, Integer shopType, String shopName, String mobile, String linkMan, Integer shopStatus, String qrCodeImage, String appId, String appSecret, Integer createBy, List<ShopInfoDto> shopInfoList);
+    ResponseJson saveShop(Integer authUserId, Integer shopType, String shopName, String mobile, String linkMan, Integer shopStatus, String qrCodeImage, Integer wxAccountType, String appId, String appSecret, Integer createBy, List<ShopInfoDto> shopInfoList);
 
     /**
      * 获取供应商回显数据

+ 51 - 0
src/main/java/com/caimei/service/impl/AddressServiceImpl.java

@@ -0,0 +1,51 @@
+package com.caimei.service.impl;
+
+import com.caimei.mapper.AddressMapper;
+import com.caimei.model.ResponseJson;
+import com.caimei.model.vo.AddressSelectVo;
+import com.caimei.service.AddressService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2022/1/6
+ */
+@Slf4j
+@Service
+public class AddressServiceImpl implements AddressService {
+    @Resource
+    private AddressMapper addressMapper;
+
+    /**
+     * 收货地址下拉选项列表
+     *
+     * @param type     选项类型:0省(默认),1市,2区
+     * @param parentId 父级地址Id
+     */
+    @Override
+    public ResponseJson<List<AddressSelectVo>> getSelectAddress(Integer type, Integer parentId) {
+        if (0 == type) {
+            // 获取所有省份列表
+            List<AddressSelectVo> provinceList = addressMapper.getAllProvinceList();
+            return ResponseJson.success(provinceList);
+        } else if (1 == type) {
+            // 获取当前省份下的所有城市列表
+            List<AddressSelectVo> cityList = addressMapper.getCityListByProvinceId(parentId);
+            return ResponseJson.success(cityList);
+        } else if (2 == type) {
+            // 获取当前城市下的所有地区列表
+            List<AddressSelectVo> townList = addressMapper.getTownListByCityId(parentId);
+            return ResponseJson.success(townList);
+        }
+        return ResponseJson.error("地址选项类型错误!", null);
+    }
+
+}

+ 46 - 21
src/main/java/com/caimei/service/impl/AuthServiceImpl.java

@@ -8,6 +8,7 @@ import com.caimei.model.dto.ProductSaveDto;
 import com.caimei.model.po.AuthImportPo;
 import com.caimei.model.po.CmBrandAuthPo;
 import com.caimei.model.po.ProductParamPo;
+import com.caimei.model.vo.AuthFormVo;
 import com.caimei.model.vo.AuthVo;
 import com.caimei.model.vo.ProductFormVo;
 import com.caimei.service.AuthProductService;
@@ -20,8 +21,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.*;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -140,7 +141,24 @@ public class AuthServiceImpl implements AuthService {
     }
 
     @Override
-    public ResponseJson saveAuth(Integer authId, Integer authUserId, String authParty, Integer createBy) {
+    public ResponseJson<AuthFormVo> getAuthFormData(Integer authId) {
+        if (null == authId) {
+            return ResponseJson.error("参数异常,机构id不能为空", null);
+        }
+        CmBrandAuthPo auth = authMapper.getAuthById(authId);
+        AuthFormVo authFormVo = new AuthFormVo();
+        authFormVo.setAuthId(auth.getId());
+        BeanUtils.copyProperties(auth, authFormVo);
+        List<String> bannerList = authMapper.getBannerList(authId);
+        authFormVo.setBannerList(bannerList);
+        return ResponseJson.success(authFormVo);
+    }
+
+    @Override
+    public ResponseJson saveAuth(CmBrandAuthPo auth, List<String> bannerList, boolean importFlag) {
+        Integer authId = auth.getId();
+        Integer authUserId = auth.getAuthUserId();
+        String authParty = auth.getAuthParty();
         if (null == authUserId) {
             return ResponseJson.error("参数异常,请输入供应商用户id");
         }
@@ -151,32 +169,35 @@ public class AuthServiceImpl implements AuthService {
         if (null != authIdByAuthParty && !authIdByAuthParty.equals(authId)) {
             return ResponseJson.error("参数异常,该授权机构已存在,请重新输入", null);
         }
-        if (null == createBy) {
+        if (null == auth.getCreateBy()) {
             return ResponseJson.error("参数异常,请输入创建人id");
         }
-        /*
-            组装授权数据
-         */
-        CmBrandAuthPo auth = new CmBrandAuthPo();
-        auth.setAuthUserId(authUserId);
-        auth.setAuthParty(authParty);
+        if (!importFlag) {
+            if (null == auth.getProvinceId() || null == auth.getCityId() || null == auth.getTownId() || StringUtils.isEmpty(auth.getAddress()) || StringUtils.isEmpty(auth.getLonAndLat())) {
+                return ResponseJson.error("参数异常,地址信息异常");
+            }
+            if (StringUtils.isEmpty(auth.getLogo())) {
+                return ResponseJson.error("参数异常,请上传机构logo");
+            }
+            if (null == bannerList || bannerList.size() <= 0) {
+                return ResponseJson.error("参数异常,请上传轮播图");
+            }
+        }
         // 保存品牌授权信息,上线状态默认为“待上线”,审核状态为“待审核”
         auth.setStatus(2);
         auth.setAuditStatus(2);
-        if (null == authId) {
-            auth.setCreateBy(createBy);
-            auth.setCreateTime(new Date());
-        } else {
-            auth.setId(authId);
-        }
         /*
             保存授权
          */
-            if (null == authId) {
-                authMapper.insertAuth(auth);
-            } else {
-                authMapper.updateAuthByAuthId(auth);
-            }
+        if (null == authId) {
+            authMapper.insertAuth(auth);
+        } else {
+            authMapper.updateAuthByAuthId(auth);
+            // 删除原有的轮播图
+            authMapper.deleteBanner(auth.getId());
+        }
+        // 保存轮播图
+        bannerList.forEach(banner-> authMapper.insertBanner(auth.getId(), banner));
         return ResponseJson.success("保存品牌授权成功", auth);
     }
 
@@ -479,7 +500,11 @@ public class AuthServiceImpl implements AuthService {
             Integer authId = authMapper.getAuthIdByAuthParty(authParty, authUserId);
             // 保存授权机构
             if (null == authId) {
-                ResponseJson responseJson = saveAuth(null, authUserId, authParty, createBy);
+                CmBrandAuthPo auth = new CmBrandAuthPo();
+                auth.setAuthUserId(authUserId);
+                auth.setAuthParty(authParty);
+                auth.setCreateBy(createBy);
+                ResponseJson responseJson = saveAuth(auth, null, true);
                 CmBrandAuthPo authPo = (CmBrandAuthPo) responseJson.getData();
                 authId = authPo.getId();
             }

+ 3 - 1
src/main/java/com/caimei/service/impl/ShopServiceImpl.java

@@ -187,7 +187,7 @@ public class ShopServiceImpl implements ShopService {
     }
 
     @Override
-    public ResponseJson saveShop(Integer authUserId, Integer shopType, String shopName, String mobile, String linkMan, Integer shopStatus, String qrCodeImage, String appId, String appSecret, Integer createBy, List<ShopInfoDto> shopInfoList) {
+    public ResponseJson saveShop(Integer authUserId, Integer shopType, String shopName, String mobile, String linkMan, Integer shopStatus, String qrCodeImage, Integer wxAccountType, String appId, String appSecret, Integer createBy, List<ShopInfoDto> shopInfoList) {
         // 是否为添加操作
         boolean insertFlag = null == authUserId;
         Integer userIdByMobile = shopMapper.getUserIdByMobile(mobile);
@@ -234,6 +234,8 @@ public class ShopServiceImpl implements ShopService {
         shop.setStatus(shopStatus);
         // 公众号二维码图片
         shop.setQrCodeImage(qrCodeImage);
+        // 公众号类型
+        shop.setWxAccountType(wxAccountType);
         // 公众号appId
         shop.setAppId(appId);
         // 公众号appSecret

+ 16 - 0
src/main/resources/mapper/AddressMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.mapper.AddressMapper">
+    <select id="getAllProvinceList" resultType="com.caimei.model.vo.AddressSelectVo">
+        SELECT provinceID AS id, name
+        FROM province WHERE validFlag = '1'
+    </select>
+    <select id="getCityListByProvinceId" resultType="com.caimei.model.vo.AddressSelectVo">
+        SELECT provinceID AS parentId, cityID AS id, name
+        FROM city WHERE provinceID = #{provinceId} AND validFlag = '1'
+    </select>
+    <select id="getTownListByCityId" resultType="com.caimei.model.vo.AddressSelectVo">
+        SELECT cityID AS parentId, townID AS id, name
+        FROM town WHERE cityID = #{cityId} AND validFlag = '1'
+    </select>
+</mapper>

+ 33 - 4
src/main/resources/mapper/AuthMapper.xml

@@ -2,8 +2,14 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.mapper.AuthMapper">
     <insert id="insertAuth" keyColumn="id" keyProperty="id" useGeneratedKeys="true" parameterType="com.caimei.model.po.CmBrandAuthPo">
-        insert into cm_brand_auth (authUserId, authParty, status, createTime, createBy, auditStatus)
-        values (#{authUserId}, #{authParty}, #{status}, #{createTime}, #{createBy}, #{auditStatus})
+        insert into cm_brand_auth (authUserId, authParty, provinceId, cityId, townId, address, lonAndLat,
+                                   mobile, logo, status, createTime, createBy, auditStatus)
+        values (#{authUserId}, #{authParty}, #{provinceId}, #{cityId}, #{townId}, #{address}, #{lonAndLat},
+                #{mobile}, #{logo}, #{status}, NOW(), #{createBy}, #{auditStatus})
+    </insert>
+    <insert id="insertBanner">
+        insert into cm_brand_auth_banner (authId, banner)
+        VALUES (#{authId}, #{banner})
     </insert>
     <update id="updateAuthStatusByAuthId">
         update cm_brand_auth
@@ -13,9 +19,16 @@
     <update id="updateAuthByAuthId">
         update cm_brand_auth
         set authParty   = #{authParty},
+            provinceId  = #{provinceId},
+            cityId      = #{cityId},
+            townId      = #{townId},
+            address     = #{address},
+            lonAndLat   = #{lonAndLat},
+            mobile      = #{mobile},
+            logo        = #{logo},
             status      = #{status},
             auditStatus = #{auditStatus}
-        where id = #{id};
+        where id = #{id}
     </update>
     <update id="updateAuthAuditStatus">
         update cm_brand_auth
@@ -29,6 +42,9 @@
     <delete id="deleteAuthByAuthId">
         delete from cm_brand_auth where id = #{authId}
     </delete>
+    <delete id="deleteBanner">
+        delete from cm_brand_auth_banner where authId = #{authId}
+    </delete>
     <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
         select id as authId, authParty, a.status, a.auditStatus, a.createTime, cu.name as createBy,
                au.name as auditBy,a.auditTime,a.invalidReason,
@@ -67,7 +83,17 @@
         where id = #{authId}
     </select>
     <select id="getAuthById" resultType="com.caimei.model.po.CmBrandAuthPo">
-        select authUserId, status
+        select id,
+               authParty,
+               authUserId,
+               provinceId,
+               cityId,
+               townId,
+               address,
+               lonAndLat,
+               mobile,
+               logo,
+               status
         from cm_brand_auth
         where id = #{authId}
     </select>
@@ -83,4 +109,7 @@
         where authUserId = #{authUserId}
         order by createTime desc
     </select>
+    <select id="getBannerList" resultType="java.lang.String">
+        select from cm_brand_auth_banner where authId = #{authId}
+    </select>
 </mapper>

+ 9 - 8
src/main/resources/mapper/ShopMapper.xml

@@ -6,9 +6,9 @@
         values (#{authUserId}, #{brandId}, #{name}, #{ossName}, #{md5Hex}, #{uploadTime})
     </insert>
     <insert id="insertShop"  keyColumn="authUserId" keyProperty="authUserId" useGeneratedKeys="true" parameterType="com.caimei.model.po.UserPo">
-        insert into cm_brand_auth_user (`name`, `mobile`, `password`, `linkMan`, `userIdentity`, `shopType`, `qrCodeImage`, `appId`, `appSecret`, `createTime`,
+        insert into cm_brand_auth_user (`name`, `mobile`, `password`, `linkMan`, `userIdentity`, `shopType`, `qrCodeImage`, `wxAccountType`, `appId`, `appSecret`, `createTime`,
                                         `createBy`,`status`)
-        values (#{name}, #{mobile}, #{password}, #{linkMan}, #{userIdentity}, #{shopType}, #{qrCodeImage}, #{appId}, #{appSecret}, #{createTime}, #{createBy}, #{status});
+        values (#{name}, #{mobile}, #{password}, #{linkMan}, #{userIdentity}, #{shopType}, #{qrCodeImage}, #{wxAccountType}, #{appId}, #{appSecret}, #{createTime}, #{createBy}, #{status});
     </insert>
     <insert id="insertShopInfo">
         insert into cm_brand_auth_shop_info
@@ -60,12 +60,13 @@
     </update>
     <update id="updateShopByUserId">
         update cm_brand_auth_user
-        set `mobile`      = #{mobile},
-            `linkMan`     = #{linkMan},
-            `status`      = #{status},
-            `qrCodeImage` = #{qrCodeImage},
-            `appId`       = #{appId},
-            `appSecret`   = #{appSecret}
+        set `mobile`        = #{mobile},
+            `linkMan`       = #{linkMan},
+            `status`        = #{status},
+            `qrCodeImage`   = #{qrCodeImage},
+            `wxAccountType` = #{wxAccountType},
+            `appId`         = #{appId},
+            `appSecret`     = #{appSecret}
         where authUserId = #{authUserId}
     </update>
     <update id="updateShopInfo">