Преглед изворни кода

Merge remote-tracking branch 'remotes/origin/developer' into developerB

# Conflicts:
#	src/main/java/com/caimei365/user/mapper/RegisterMapper.java
#	src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java
#	src/main/resources/mapper/RegisterMapper.xml
plf пре 4 година
родитељ
комит
0b3a754858
31 измењених фајлова са 1296 додато и 185 уклоњено
  1. 40 10
      src/main/java/com/caimei365/user/components/WeChatService.java
  2. 1 1
      src/main/java/com/caimei365/user/config/TokenFilter.java
  3. 1 1
      src/main/java/com/caimei365/user/controller/ClubApi.java
  4. 60 0
      src/main/java/com/caimei365/user/controller/HeHeApi.java
  5. 64 26
      src/main/java/com/caimei365/user/controller/RegisterApi.java
  6. 54 3
      src/main/java/com/caimei365/user/controller/SellerApi.java
  7. 47 43
      src/main/java/com/caimei365/user/controller/ShopApi.java
  8. 53 0
      src/main/java/com/caimei365/user/mapper/HeHeMapper.java
  9. 21 0
      src/main/java/com/caimei365/user/mapper/RegisterMapper.java
  10. 30 0
      src/main/java/com/caimei365/user/mapper/SellerMapper.java
  11. 115 0
      src/main/java/com/caimei365/user/model/dto/ClubTemporaryDto.java
  12. 52 0
      src/main/java/com/caimei365/user/model/dto/HeHeUserDto.java
  13. 19 0
      src/main/java/com/caimei365/user/model/dto/OnlineDto.java
  14. 6 0
      src/main/java/com/caimei365/user/model/dto/ShopRegisterDto.java
  15. 2 3
      src/main/java/com/caimei365/user/model/dto/ShopUpdateDto.java
  16. 56 0
      src/main/java/com/caimei365/user/model/po/CmHeHeUserPo.java
  17. 4 0
      src/main/java/com/caimei365/user/model/po/ShopPo.java
  18. 96 0
      src/main/java/com/caimei365/user/model/vo/ClubTemporaryVo.java
  19. 49 0
      src/main/java/com/caimei365/user/model/vo/HeHeUserVo.java
  20. 39 0
      src/main/java/com/caimei365/user/service/HeHeService.java
  21. 20 24
      src/main/java/com/caimei365/user/service/RegisterService.java
  22. 33 3
      src/main/java/com/caimei365/user/service/SellerService.java
  23. 113 0
      src/main/java/com/caimei365/user/service/impl/HeHeServiceImpl.java
  24. 1 1
      src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java
  25. 100 63
      src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java
  26. 32 1
      src/main/java/com/caimei365/user/service/impl/SellerServiceImpl.java
  27. 3 3
      src/main/java/com/caimei365/user/utils/AliyunSmsUtil.java
  28. 1 1
      src/main/resources/bootstrap.yml
  29. 71 0
      src/main/resources/mapper/HeHeMapper.xml
  30. 51 2
      src/main/resources/mapper/RegisterMapper.xml
  31. 62 0
      src/main/resources/mapper/SellerMapper.xml

+ 40 - 10
src/main/java/com/caimei365/user/components/WeChatService.java

@@ -44,25 +44,35 @@ public class WeChatService {
     private String crmAppId;
     @Value("${wx.crm-app-secret}")
     private String crmAppSecret;
+    @Value("${wx.hehe-app-id}")
+    private String heHeAppId;
+    @Value("${wx.hehe-app-secret}")
+    private String heHeAppSecret;
 
     public void setRedirectUri(String redirectUri) {
         redirectUri = redirectUri;
     }
+
     public void setAppId(String appId) {
         appId = appId;
     }
+
     public void setAppSecret(String appSecret) {
         appSecret = appSecret;
     }
+
     public void setMiniAppId(String miniAppId) {
         miniAppId = miniAppId;
     }
+
     public void setMiniAppSecret(String miniAppSecret) {
         miniAppSecret = miniAppSecret;
     }
+
     public void setCrmAppId(String crmAppId) {
         crmAppId = crmAppId;
     }
+
     public void setCrmAppSecret(String crmAppSecret) {
         crmAppSecret = crmAppSecret;
     }
@@ -70,21 +80,27 @@ public class WeChatService {
     public String getRedirectUri() {
         return redirectUri;
     }
+
     public String getAppId() {
         return appId;
     }
+
     public String getAppSecret() {
         return appSecret;
     }
+
     public String getMiniAppId() {
         return miniAppId;
     }
+
     public String getMiniAppSecret() {
         return miniAppSecret;
     }
+
     public String getCrmAppId() {
         return crmAppId;
     }
+
     public String getCrmAppSecret() {
         return crmAppSecret;
     }
@@ -99,6 +115,7 @@ public class WeChatService {
         // BouncyCastle是一个开源的加解密解决方案
         Security.addProvider(new BouncyCastleProvider());
     }
+
     /**
      * AES解密
      *
@@ -136,11 +153,12 @@ public class WeChatService {
     /**
      * 小程序微信授权登录,获取openid
      *
-     * @param code              微信凭证
-     * @param headers           HttpHeaders
+     * @param code    微信凭证
+     * @param headers HttpHeaders
+     * @param mode    1:采美小程序,2:呵呵商城小程序+
      * @return HashMap
      */
-    public ResponseJson<Map<String, Object>> getInfoMapByApplets(String code, HttpHeaders headers) {
+    public ResponseJson<Map<String, Object>> getInfoMapByApplets(String code, HttpHeaders headers, Integer mode) {
         log.info("Start get SessionKey");
         Map<String, Object> returnMap = new HashMap<>(4);
         // 获取当前微信小程序的环境
@@ -149,11 +167,19 @@ public class WeChatService {
         returnMap.put("referer", referer);
         String requestUrl = "https://api.weixin.qq.com/sns/jscode2session";
         Map<String, String> requestUrlParam = new HashMap<String, String>(4);
-        // 小程序appId
-        requestUrlParam.put("appid", miniAppId);
-        log.info("appId: ---" + miniAppId);
-        // 小程序appSecret
-        requestUrlParam.put("secret", miniAppSecret);
+        if (mode == 1) {
+            // 小程序appId
+            requestUrlParam.put("appid", miniAppId);
+            log.info("采美小程序appId: ---" + miniAppId);
+            // 小程序appSecret
+            requestUrlParam.put("secret", miniAppSecret);
+        } else {
+            // 呵呵商城小程序appId
+            requestUrlParam.put("appid", heHeAppId);
+            log.info("呵呵商城appId: ---" + heHeAppId);
+            // 呵呵商城小程序appSecret
+            requestUrlParam.put("secret", heHeAppSecret);
+        }
         // 小程序端返回的code
         requestUrlParam.put("js_code", code);
         // 默认参数
@@ -172,7 +198,7 @@ public class WeChatService {
         String sessionKey = jsonObject.getString(Keys.SESSION_KEY);
         String errCode = jsonObject.getString("errcode");
         String errMsg = jsonObject.getString("errmsg");
-        log.info("openId----->" + openId +", unionId------>" + unionId);
+        log.info("openId----->" + openId + ", unionId------>" + unionId);
         returnMap.put(Keys.OPEN_ID, openId);
         returnMap.put(Keys.UNION_ID, unionId);
         returnMap.put(Keys.SESSION_KEY, sessionKey);
@@ -185,6 +211,7 @@ public class WeChatService {
 
     /**
      * 微信公众号授权链接(www)
+     *
      * @param redirectUri 用于微信授权的中间页面
      * @param mode        授权方式:1静默授权,其他手动同意授权
      * @return newRedirectUri
@@ -204,6 +231,7 @@ public class WeChatService {
 
     /**
      * 网页授权登录,通过code获取openid
+     *
      * @param code   微信code
      * @param source 来源
      * @return
@@ -231,13 +259,14 @@ public class WeChatService {
 
     /**
      * 微信公众号获取access_token
+     *
      * @return access_token
      */
     public String getAccessToken() throws Exception {
         String link = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
         link = link.replace("APPID", crmAppId);
         link = link.replace("APPSECRET", crmAppSecret);
-        String result  = RequestUtil.sendGet(link);
+        String result = RequestUtil.sendGet(link);
         log.info("微信公众号获取access_token>>>" + result);
         Map<String, Object> map = JSONObject.parseObject(result, Map.class);
         return (String) map.get("access_token");
@@ -245,6 +274,7 @@ public class WeChatService {
 
     /**
      * 微信公众号获取用户信息
+     *
      * @return
      */
     public Map<String, Object> getUserInfo(String accessToken, String openId) throws Exception {

+ 1 - 1
src/main/java/com/caimei365/user/config/JWTFilter.java → src/main/java/com/caimei365/user/config/TokenFilter.java

@@ -38,7 +38,7 @@ import java.util.Arrays;
  */
 @Slf4j
 @Component
-public class JWTFilter implements WebFilter {
+public class TokenFilter implements WebFilter {
 
     private static final String AUTH = "X-Token";
     /**

+ 1 - 1
src/main/java/com/caimei365/user/controller/ClubApi.java

@@ -87,7 +87,7 @@ public class ClubApi {
      *
      * @return Map(userPo,clubPo)
      */
-    @ApiOperation("机构个人中心(小程序)")
+    @ApiOperation("机构个人中心(小程序-未调试)")
     @ApiImplicitParam(required = true, name = "userId", value = "用户Id")
     @GetMapping("/home")
     public ResponseJson<Map<String, Object>> getClubHomeData(Integer userId) {

+ 60 - 0
src/main/java/com/caimei365/user/controller/HeHeApi.java

@@ -0,0 +1,60 @@
+package com.caimei365.user.controller;
+
+import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.HeHeUserDto;
+import com.caimei365.user.model.vo.HeHeUserVo;
+import com.caimei365.user.service.HeHeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.http.HttpHeaders;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 呵呵商城用户API
+ *
+ * @author : plf
+ * @date : 2021/4/21
+ */
+@Api(tags = "呵呵商城用户API")
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/user/he")
+public class HeHeApi {
+
+    private final HeHeService heHeService;
+
+    @ApiOperation("微信授权登录")
+    @GetMapping("/authorization")
+    public ResponseJson<HeHeUserVo> authorization(String code, @RequestHeader HttpHeaders headers) {
+        if (StringUtils.isBlank(code)) {
+            return ResponseJson.error("微信code异常", null);
+        }
+        return heHeService.authorization(code, headers);
+    }
+
+    @ApiOperation("手机号验证码登录")
+    @PostMapping("/mobile/login")
+    public ResponseJson<HeHeUserVo> mobileLogin(HeHeUserDto heHeUserDto) {
+        if (StringUtils.isBlank(heHeUserDto.getMobile())) {
+            return ResponseJson.error("请输入手机号", null);
+        }
+        if (StringUtils.isBlank(heHeUserDto.getVerificationCode())) {
+            return ResponseJson.error("请输入短信验证码", null);
+        }
+        if (StringUtils.isBlank(heHeUserDto.getOpenId()) || StringUtils.isBlank(heHeUserDto.getNickName()) || StringUtils.isBlank(heHeUserDto.getHeadImgUrl())) {
+            return ResponseJson.error("微信信息异常", null);
+        }
+        return heHeService.mobileLogin(heHeUserDto);
+    }
+
+    @ApiOperation("发送手机号验证码")
+    @GetMapping("/send")
+    public ResponseJson<String> sendVerificationCode(String mobile) {
+        if (StringUtils.isBlank(mobile)) {
+            return ResponseJson.error("请输入手机号", null);
+        }
+        return heHeService.sendVerificationCode(mobile);
+    }
+}

+ 64 - 26
src/main/java/com/caimei365/user/controller/RegisterApi.java

@@ -3,11 +3,13 @@ package com.caimei365.user.controller;
 import com.caimei365.user.idempotent.Idempotent;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.*;
+import com.caimei365.user.model.vo.ClubTemporaryVo;
 import com.caimei365.user.service.RegisterService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.http.HttpHeaders;
 import org.springframework.web.bind.annotation.*;
 
@@ -103,40 +105,25 @@ public class RegisterApi {
     }
 
     /**
-     * 协销拉机构上线
+     * 协销拉机构上线(用户点击注册)
      * <p>
      * spi旧接口:/seller/club/register
      *
-     * @param onlineDto ClubOnlineDto:{
-     *                  source                  注册来源: 0网站 1小程序
-     *                  userId                  协销用户ID(userID)
-     *                  name                    机构名称
-     *                  shortName                   机构简称(shortName)
-     *                  bindMobile              企业绑定手机号
-     *                  contractEmail           邮箱(email)
-     *                  linkMan                 联系人(linkMan1)
-     *                  provinceId             省Id
-     *                  cityId                 市Id
-     *                  townId                 县区Id
-     *                  address                地址
-     *                  shopPhoto              门头照(headpic)
-     *                  businessLicense        营业执照(businessLicenseImage)
-     *                  socialCreditCode       统一社会信用代码(socialCreditCode)
-     *                  firstClubType          一级分类:医美=1和生美=2
-     *                  secondClubType         医美的二级分类:诊所=1、门诊=2、医院=3。  生美没有二级分类
-     *                  department             医美分类下的门诊和医院则需要填写科室
-     *                  medicalPracticeLicense 医美分类必须上传医疗执业许可证(medicalPracticeLicenseImg)
-     *                  mainProduct            主打项目(mainpro)
-     *                  isAgreed  是否同意勾选同意协议,1是,其他否
-     *                  }
-     * @param headers   HttpHeaders
+     * @param online  暂存数据id
+     * @param headers HttpHeaders
      */
     @ApiOperation("协销拉机构上线(机构注册)")
+    @ApiImplicitParam(required = true, name = "id", value = "暂存机构数据id")
     @PostMapping("/club/online")
-    public ResponseJson<Integer> clubOnline(ClubOnlineDto onlineDto, @RequestHeader HttpHeaders headers) {
-        return registerService.clubOnline(onlineDto, headers);
+    public ResponseJson<Integer> clubOnline(OnlineDto online, @RequestHeader HttpHeaders headers) {
+        Integer id = online.getId();
+        if (id == null) {
+            return ResponseJson.error("参数异常", null);
+        }
+        return registerService.clubOnline(id, headers);
     }
 
+
     /**
      * 供应商注册
      * <p>
@@ -208,6 +195,57 @@ public class RegisterApi {
     public ResponseJson updateGuideFlag(Integer userId) {
         return registerService.updateGuideFlag(userId);
     }
+
+    /**
+     * @param onlineDto ClubOnlineDto:{
+     *                  source                  注册来源: 0网站 1小程序
+     *                  userId                  协销用户ID(userID)
+     *                  name                    机构名称
+     *                  shortName                   机构简称(shortName)
+     *                  bindMobile              企业绑定手机号
+     *                  contractEmail           邮箱(email)
+     *                  linkMan                 联系人(linkMan1)
+     *                  provinceId             省Id
+     *                  cityId                 市Id
+     *                  townId                 县区Id
+     *                  address                地址
+     *                  shopPhoto              门头照(headpic)
+     *                  businessLicense        营业执照(businessLicenseImage)
+     *                  socialCreditCode       统一社会信用代码(socialCreditCode)
+     *                  firstClubType          一级分类:医美=1和生美=2
+     *                  secondClubType         医美的二级分类:诊所=1、门诊=2、医院=3。  生美没有二级分类
+     *                  department             医美分类下的门诊和医院则需要填写科室
+     *                  medicalPracticeLicense 医美分类必须上传医疗执业许可证(medicalPracticeLicenseImg)
+     *                  mainProduct            主打项目(mainpro)
+     *                  isAgreed  是否同意勾选同意协议,1是,其他否
+     *                  }
+     */
+    @ApiOperation("协销拉机构上线(资料填写)")
+    @PostMapping("/club/temporary")
+    public ResponseJson<Integer> clubTemporary(ClubOnlineDto onlineDto) {
+        if (null == onlineDto.getUserId()) {
+            return ResponseJson.error("参数异常:用户Id不能为空!", null);
+        }
+        if (StringUtils.isBlank(onlineDto.getBindMobile())) {
+            return ResponseJson.error("参数异常:企业绑定手机号不能为空!", null);
+        }
+        if (StringUtils.isBlank(onlineDto.getLinkMan())) {
+            return ResponseJson.error("参数异常:联系人不能为空!", null);
+        }
+        if (null == onlineDto.getIsAgreed() || 1 != onlineDto.getIsAgreed()) {
+            return ResponseJson.error("请勾选同意协议", null);
+        }
+        return registerService.clubTemporary(onlineDto);
+    }
+
+    @ApiOperation("协销拉机构上线(查询暂时数据)")
+    @GetMapping("/temporary/data")
+    public ResponseJson<ClubTemporaryVo> temporaryData(Integer id) {
+        if (id == null) {
+            return ResponseJson.error("参数异常", null);
+        }
+        return registerService.temporaryData(id);
+    }
 }
 
 

+ 54 - 3
src/main/java/com/caimei365/user/controller/SellerApi.java

@@ -1,10 +1,18 @@
 package com.caimei365.user.controller;
 
+import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.ClubTemporaryDto;
+import com.caimei365.user.model.dto.OnlineDto;
+import com.caimei365.user.model.vo.ClubTemporaryVo;
 import com.caimei365.user.service.SellerService;
+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.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * Description
@@ -12,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
  * @author : Charles
  * @date : 2021/3/24
  */
-@Api(tags="协销用户API")
+@Api(tags = "协销用户API")
 @RestController
 @RequiredArgsConstructor
 @RequestMapping("/user/seller")
@@ -20,5 +28,48 @@ public class SellerApi {
 
     private final SellerService sellerService;
 
+    /**
+     * 待注册机构列表
+     */
+    @ApiOperation("待注册机构列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "userId", required = true, value = "协销userId"),
+            @ApiImplicitParam(name = "searchName", required = false, value = "搜索名称"),
+            @ApiImplicitParam(name = "pageNum", required = true, value = "第几页"),
+            @ApiImplicitParam(name = "pageSize", required = true, value = "一页多少条")
+    })
 
+    @GetMapping("/temporary/club")
+    public ResponseJson<PageInfo<ClubTemporaryVo>> temporaryClub(Integer userId, String searchName,
+                                                                 @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                 @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
+        if (userId == null) {
+            return ResponseJson.error("参数异常", null);
+        }
+        return sellerService.temporaryClub(userId, searchName, pageNum, pageSize);
+    }
+
+    /**
+     * 修改待注册机构资料
+     */
+    @ApiOperation("修改待注册机构资料")
+    @PostMapping("/modify/temporary/club")
+    public ResponseJson<String> modifyTemporaryClub(ClubTemporaryDto temporaryDto) {
+        if (temporaryDto.getId() == null || StringUtils.isBlank(temporaryDto.getBindMobile())) {
+            return ResponseJson.error("参数异常", null);
+        }
+        return sellerService.modifyTemporaryClub(temporaryDto);
+    }
+
+    /**
+     * 删除待注册机构资料
+     */
+    @ApiOperation("删除待注册机构资料")
+    @PostMapping("/delete/temporary/club")
+    public ResponseJson<String> deleteTemporaryClub(OnlineDto onlineDto) {
+        if (onlineDto.getId() == null) {
+            return ResponseJson.error("参数异常", null);
+        }
+        return sellerService.deleteTemporaryClub(onlineDto.getId());
+    }
 }

+ 47 - 43
src/main/java/com/caimei365/user/controller/ShopApi.java

@@ -3,9 +3,14 @@ package com.caimei365.user.controller;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.ShopUpdateDto;
 import com.caimei365.user.service.ShopService;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.Map;
 
@@ -15,7 +20,7 @@ import java.util.Map;
  * @author : Charles
  * @date : 2021/3/9
  */
-@Api(tags="供应商用户API")
+@Api(tags = "供应商用户API")
 @RestController
 @RequiredArgsConstructor
 @RequestMapping("/user/shop")
@@ -25,12 +30,11 @@ public class ShopApi {
 
     /**
      * 根据用户Id查询供应商资料
-     *
+     * <p>
      * spi旧接口:/supplier/shopInfo
      *
      * @param userId 用户Id
-     *
-     * @return Map(userPo,clubPo)
+     * @return Map(userPo, clubPo)
      */
     @ApiOperation("查询供应商资料")
     @ApiImplicitParam(required = true, name = "userId", value = "用户Id")
@@ -41,52 +45,52 @@ public class ShopApi {
 
     /**
      * 修改供应商资料
-     *
+     * <p>
      * spi旧接口:/supplier/modifiedData
      *
      * @param shopUpdateDto ShopUpdateDto{
-     *                        shopId                    供应商Id
-     *                        userId                    用户Id
-     *                        name                      组织名称
-     *                        shortName                     供应商公司简称(shortName)
-     *                        email                     邮箱
-     *                        contractPhone             固定电话
-     *                        linkMan                   联系人
-     *                        provinceId                省(provinceID)
-     *                        cityId                    市(cityID)
-     *                        townId                    所在县区Id(townID)
-     *                        address                   地址
-     *                        socialCreditCode          统一社会信用代码(营业执照编号)
-     *                        businessLicense           营业执照(businessLicenseImage)
-     *                        firstShopType             医疗=1和非医疗=2
-     *                        secondShopType            医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
-     *                        mainProduct               主打项目(mainpro)
-     *                        mainProductDesc           主打商品说明(productDesc)
-     *                        legalPerson               法人代表
-     *                        registeredCapital         注册资本
-     *                        faxNumber                 传真号(fax)
-     *                        companyNature             传真号(nature)
-     *                        turnover                  年营业额
-     *                        medicalPracticeLicense    医疗执业许可证(medicalPracticeLicenseImg1)
-     *                        shopDesc                  公司介绍(info)
-     *                        businessScope             经营范围
-     *                        logo                      公司LOGO
-     *                        operationLicence          生产经营证书(productionLicence)
-     *                        hygienicLicense           卫生许可证
-     *                        taxLicense                税务登记证
-     *                        honorCertification        荣誉证书(certificateHonor)
-     *                        productCertification      产品证书
-     *                    }
+     *                      shopId                    供应商Id
+     *                      userId                    用户Id
+     *                      name                      组织名称
+     *                      shortName                     供应商公司简称(shortName)
+     *                      email                     邮箱
+     *                      contractPhone             固定电话
+     *                      linkMan                   联系人
+     *                      provinceId                省(provinceID)
+     *                      cityId                    市(cityID)
+     *                      townId                    所在县区Id(townID)
+     *                      address                   地址
+     *                      socialCreditCode          统一社会信用代码(营业执照编号)
+     *                      businessLicense           营业执照(businessLicenseImage)
+     *                      firstShopType             医疗=1和非医疗=2
+     *                      secondShopType            医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
+     *                      mainProduct               主打项目(mainpro)
+     *                      mainProductDesc           主打商品说明(productDesc)
+     *                      legalPerson               法人代表
+     *                      registeredCapital         注册资本
+     *                      faxNumber                 传真号(fax)
+     *                      companyNature             传真号(nature)
+     *                      turnover                  年营业额
+     *                      medicalPracticeLicense    医疗执业许可证(medicalPracticeLicenseImg1)
+     *                      shopDesc                  公司介绍(info)
+     *                      businessScope             经营范围
+     *                      logo                      公司LOGO
+     *                      operationLicence          生产经营证书(productionLicence)
+     *                      hygienicLicense           卫生许可证
+     *                      taxLicense                税务登记证
+     *                      honorCertification        荣誉证书(certificateHonor)
+     *                      productCertification      产品证书
+     *                      }
      * @return ClubUpdateDto
      */
     @ApiOperation("更新供应商资料")
     @PostMapping("/info/update")
     public ResponseJson updateShopUserInfo(ShopUpdateDto shopUpdateDto) {
         String operationLicence = shopUpdateDto.getOperationLicence();
-        String hygienicLicense = shopUpdateDto.getOperationLicence();
-        String taxLicense = shopUpdateDto.getOperationLicence();
-        String honorCertification = shopUpdateDto.getOperationLicence();
-        String productCertification = shopUpdateDto.getOperationLicence();
+        String hygienicLicense = shopUpdateDto.getHygienicLicense();
+        String taxLicense = shopUpdateDto.getTaxLicense();
+        String honorCertification = shopUpdateDto.getHonorCertification();
+        String productCertification = shopUpdateDto.getProductCertification();
         return shopService.updateShopUserInfo(shopUpdateDto, operationLicence, hygienicLicense, taxLicense, honorCertification, productCertification);
     }
 

+ 53 - 0
src/main/java/com/caimei365/user/mapper/HeHeMapper.java

@@ -0,0 +1,53 @@
+package com.caimei365.user.mapper;
+
+import com.caimei365.user.model.po.CmHeHeUserPo;
+import com.caimei365.user.model.po.UserPo;
+import com.caimei365.user.model.vo.HeHeUserVo;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * Description
+ *
+ * @author : plf
+ * @date : 2021/4/21
+ */
+@Mapper
+public interface HeHeMapper {
+
+    /**
+     * 查询呵呵用户信息
+     *
+     * @param openId
+     * @return
+     */
+    HeHeUserVo findHeHeUserByOpenId(String openId);
+
+    /**
+     * 根据手机号查询用户信息
+     *
+     * @param mobile
+     * @return
+     */
+    HeHeUserVo findHeHeUserByMobile(String mobile);
+
+    /**
+     * 更新呵呵用户信息
+     *
+     * @param heHeUser
+     */
+    void updateHeHeUser(HeHeUserVo heHeUser);
+
+    /**
+     * 保存呵呵普通用户信息
+     *
+     * @param heUserPo
+     */
+    void insertHeHeUser(CmHeHeUserPo heUserPo);
+
+    /**
+     * 保存普通用户user信息
+     *
+     * @param user
+     */
+    void insertUser(UserPo user);
+}

+ 21 - 0
src/main/java/com/caimei365/user/mapper/RegisterMapper.java

@@ -1,6 +1,12 @@
 package com.caimei365.user.mapper;
 
+import com.caimei365.user.model.dto.ClubOnlineDto;
 import com.caimei365.user.model.dto.ShopApplyDto;
+import com.caimei365.user.model.po.ClubPo;
+import com.caimei365.user.model.po.OperationPo;
+import com.caimei365.user.model.po.ShopPo;
+import com.caimei365.user.model.po.UserPo;
+import com.caimei365.user.model.vo.ClubTemporaryVo;
 import com.caimei365.user.model.po.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -112,6 +118,21 @@ public interface RegisterMapper {
      */
     void updateGuideFlagByUserId(Integer userId);
 
+    /**
+     * 保存机构临时数据
+     *
+     * @param onlineDto
+     */
+    void insertClubTemporary(ClubOnlineDto onlineDto);
+
+    /**
+     * 中间表数据
+     *
+     * @param id
+     * @return
+     */
+    ClubTemporaryVo getTemporary(Integer id);
+
     /**
      * 保存采美豆记录
      *

+ 30 - 0
src/main/java/com/caimei365/user/mapper/SellerMapper.java

@@ -1,7 +1,12 @@
 package com.caimei365.user.mapper;
 
+import com.caimei365.user.model.dto.ClubTemporaryDto;
+import com.caimei365.user.model.vo.ClubTemporaryVo;
 import com.caimei365.user.model.vo.UserLoginVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * Description
@@ -13,6 +18,7 @@ import org.apache.ibatis.annotations.Mapper;
 public interface SellerMapper {
     /**
      * 根据手机号获取协销
+     *
      * @param mobile 手机号
      * @return UserLoginVo
      */
@@ -20,9 +26,33 @@ public interface SellerMapper {
 
     /**
      * 更新协销
+     *
      * @param userId
      * @param openId
      * @param unionId
      */
     void updateServiceProviderByUserId(Integer userId, String openId, String unionId);
+
+    /**
+     * 查询待注册机构数据
+     *
+     * @param userId
+     * @param searchName
+     * @return
+     */
+    List<ClubTemporaryVo> findClubTemporary(@Param("userId") Integer userId, @Param("searchName") String searchName);
+
+    /**
+     * 修改待注册机构数据
+     *
+     * @param temporaryDto
+     */
+    void updateClubTemporary(ClubTemporaryDto temporaryDto);
+
+    /**
+     * 删除待注册机构数据
+     *
+     * @param id
+     */
+    void deleteTemporaryClub(Integer id);
 }

+ 115 - 0
src/main/java/com/caimei365/user/model/dto/ClubTemporaryDto.java

@@ -0,0 +1,115 @@
+package com.caimei365.user.model.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : plf
+ * @date : 2021/5/31
+ */
+@Data
+public class ClubTemporaryDto implements Serializable {
+    @NotNull
+    @ApiModelProperty("暂存数据id")
+    private Integer id;
+    /**
+     * 机构名称
+     */
+    @ApiModelProperty("机构名称")
+    private String name;
+    /**
+     * 机构简称
+     */
+    @ApiModelProperty("机构简称")
+    private String shortName;
+    /**
+     * 企业绑定手机号
+     */
+    @ApiModelProperty("企业绑定手机号")
+    private String bindMobile;
+    /**
+     * 联系邮箱
+     */
+    @ApiModelProperty("联系邮箱")
+    private String contractEmail;
+    /**
+     * 联系人
+     */
+    @ApiModelProperty("联系人")
+    private String linkMan;
+    /**
+     * 省
+     */
+    @ApiModelProperty("省")
+    private Integer provinceId;
+    /**
+     * 市
+     */
+    @ApiModelProperty("市")
+    private Integer cityId;
+    /**
+     * 地址Id
+     */
+    @ApiModelProperty("地址Id")
+    private Integer townId;
+    /**
+     * 地址
+     */
+    @ApiModelProperty("地址")
+    private String address;
+    /**
+     * 门头照
+     */
+    @ApiModelProperty("门头照")
+    private String shopPhoto;
+    /**
+     * 营业执照(businessLicenseImage)
+     */
+    @ApiModelProperty("营业执照(businessLicenseImage)")
+    private String businessLicense;
+    /**
+     * 统一社会信用代码
+     */
+    @ApiModelProperty("统一社会信用代码")
+    private String socialCreditCode;
+    /**
+     * 一级分类为医美=1和生美=2
+     */
+    @ApiModelProperty("一级分类为医美=1和生美=2")
+    private Integer firstClubType;
+    /**
+     * 医美的二级分类为诊所=1、门诊=2、医院=3。  生美没有二级分类
+     */
+    @ApiModelProperty("医美的二级分类为诊所=1、门诊=2、医院=3。  生美没有二级分类")
+    private Integer secondClubType;
+    /**
+     * 若为医美分类下的门诊和医院则需要填写科室。
+     */
+    @ApiModelProperty("若为医美分类下的门诊和医院则需要填写科室")
+    private String department;
+    /**
+     * 医美分类必须上传医疗执业许可证(medicalPracticeLicenseImg)
+     */
+    @ApiModelProperty("医美分类必须上传医疗执业许可证(medicalPracticeLicenseImg)")
+    private String medicalPracticeLicense;
+    /**
+     * 主打项目(mainpro)
+     */
+    @ApiModelProperty("主打项目(mainpro)")
+    private String mainProduct;
+    /**
+     * 是否同意勾选同意协议,1是,其他否
+     */
+    @ApiModelProperty("是否同意勾选同意协议,1是,其他否")
+    private Integer isAgreed;
+    /**
+     * 省市区地址
+     */
+    @ApiModelProperty("省市区地址")
+    private String provincialAddress;
+}

+ 52 - 0
src/main/java/com/caimei365/user/model/dto/HeHeUserDto.java

@@ -0,0 +1,52 @@
+package com.caimei365.user.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * Description
+ *
+ * @author : plf
+ * @date : 2021/4/22
+ */
+@ApiModel("呵呵小程序登录")
+@Data
+public class HeHeUserDto {
+    /**
+     * 手机号
+     */
+    @NotNull
+    @ApiModelProperty("手机号")
+    private String mobile;
+
+    /**
+     * 验证码
+     */
+    @NotNull
+    @ApiModelProperty("验证码")
+    private String verificationCode;
+
+    /**
+     * 微信昵称
+     */
+    @NotNull
+    @ApiModelProperty("微信昵称")
+    private String nickName;
+
+    /**
+     * 微信头像
+     */
+    @NotNull
+    @ApiModelProperty("微信头像")
+    private String headImgUrl;
+
+    /**
+     * 微信openid
+     */
+    @NotNull
+    @ApiModelProperty("微信openid")
+    private String openId;
+}

+ 19 - 0
src/main/java/com/caimei365/user/model/dto/OnlineDto.java

@@ -0,0 +1,19 @@
+package com.caimei365.user.model.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : plf
+ * @date : 2021/5/21
+ */
+@Data
+public class OnlineDto implements Serializable {
+    /**
+     * 暂存机构数据id
+     */
+    private Integer id;
+}

+ 6 - 0
src/main/java/com/caimei365/user/model/dto/ShopRegisterDto.java

@@ -151,4 +151,10 @@ public class ShopRegisterDto implements Serializable {
      */
     @ApiModelProperty("微信小程序")
     private String wxApplets;
+
+    /**
+     * 如选择为医疗>>三类器械  则必须要上传资质
+     */
+    @ApiModelProperty("如选择为医疗>>三类器械  则必须要上传资质")
+    private String medicalPracticeLicense;
 }

+ 2 - 3
src/main/java/com/caimei365/user/model/dto/ShopUpdateDto.java

@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
-import java.util.List;
 
 /**
  * Description
@@ -150,7 +149,7 @@ public class ShopUpdateDto implements Serializable {
      * 荣誉证书
      */
     @ApiModelProperty("荣誉证书")
-    private List<String> honorCertification;
+    private String honorCertification;
 
     /**
      * 生产经营证书
@@ -162,7 +161,7 @@ public class ShopUpdateDto implements Serializable {
      * 产品证书
      */
     @ApiModelProperty("产品证书")
-    private List<String> productCertification;
+    private String productCertification;
 
     /**
      * 卫生许可证

+ 56 - 0
src/main/java/com/caimei365/user/model/po/CmHeHeUserPo.java

@@ -0,0 +1,56 @@
+package com.caimei365.user.model.po;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * cm_hehe_user
+ * @author 
+ */
+@Data
+public class CmHeHeUserPo implements Serializable {
+    private Integer id;
+
+    /**
+     * 对应user表用户id
+     */
+    private Integer userId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 用户身份:1普通用户,2分销者
+     */
+    private String userIdentity;
+
+    /**
+     * 微信昵称
+     */
+    private String nickName;
+
+    /**
+     * 微信头像
+     */
+    private String headImgUrl;
+
+    /**
+     * 微信openid
+     */
+    private String openId;
+
+    /**
+     * 添加时间
+     */
+    private Date addTime;
+
+    private static final long serialVersionUID = 1L;
+}

+ 4 - 0
src/main/java/com/caimei365/user/model/po/ShopPo.java

@@ -111,4 +111,8 @@ public class ShopPo implements Serializable {
      * 是否可用,1可用
      */
     private String validFlag;
+    /**
+     * 如选择为医疗>>三类器械  则必须要上传资质
+     */
+    private String medicalPracticeLicenseImg1;
 }

+ 96 - 0
src/main/java/com/caimei365/user/model/vo/ClubTemporaryVo.java

@@ -0,0 +1,96 @@
+package com.caimei365.user.model.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : plf
+ * @date : 2021/5/20
+ */
+@Data
+public class ClubTemporaryVo implements Serializable {
+    private Integer id;
+    /**
+     * 协销用户Id
+     */
+    private Integer userId;
+    /**
+     * 机构名称
+     */
+    private String name;
+    /**
+     * 机构简称
+     */
+    private String shortName;
+    /**
+     * 企业绑定手机号
+     */
+    private String bindMobile;
+    /**
+     * 联系邮箱
+     */
+    private String contractEmail;
+    /**
+     * 联系人
+     */
+    private String linkMan;
+    /**
+     * 省
+     */
+    private Integer provinceId;
+    /**
+     * 市
+     */
+    private Integer cityId;
+    /**
+     * 地址Id
+     */
+    private Integer townId;
+    /**
+     * 地址
+     */
+    private String address;
+    /**
+     * 门头照
+     */
+    private String shopPhoto;
+    /**
+     * 营业执照(businessLicenseImage)
+     */
+    private String businessLicense;
+    /**
+     * 统一社会信用代码
+     */
+    private String socialCreditCode;
+    /**
+     * 一级分类为医美=1和生美=2
+     */
+    private Integer firstClubType;
+    /**
+     * 医美的二级分类为诊所=1、门诊=2、医院=3。  生美没有二级分类
+     */
+    private Integer secondClubType;
+    /**
+     * 若为医美分类下的门诊和医院则需要填写科室。
+     */
+    private String department;
+    /**
+     * 医美分类必须上传医疗执业许可证(medicalPracticeLicenseImg)
+     */
+    private String medicalPracticeLicense;
+    /**
+     * 主打项目(mainpro)
+     */
+    private String mainProduct;
+    /**
+     * 是否同意勾选同意协议,1是,其他否
+     */
+    private Integer isAgreed;
+    /**
+     * 省市区地址
+     */
+    private String provincialAddress;
+}

+ 49 - 0
src/main/java/com/caimei365/user/model/vo/HeHeUserVo.java

@@ -0,0 +1,49 @@
+package com.caimei365.user.model.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : plf
+ * @date : 2021/4/21
+ */
+@Data
+public class HeHeUserVo implements Serializable {
+    /**
+     * 呵呵商城用户id
+     */
+    private Integer userId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 用户身份:1普通用户,2分销者
+     */
+    private Integer userIdentity;
+
+    /**
+     * 微信昵称
+     */
+    private String nickName;
+
+    /**
+     * 微信头像
+     */
+    private String headImgUrl;
+
+    /**
+     * 微信openid
+     */
+    private String openId;
+}

+ 39 - 0
src/main/java/com/caimei365/user/service/HeHeService.java

@@ -0,0 +1,39 @@
+package com.caimei365.user.service;
+
+import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.HeHeUserDto;
+import com.caimei365.user.model.vo.HeHeUserVo;
+import org.springframework.http.HttpHeaders;
+
+/**
+ * Description
+ *
+ * @author : plf
+ * @date : 2021/4/21
+ */
+public interface HeHeService {
+    /**
+     * 微信授权登录
+     *
+     * @param code    微信code
+     * @param headers 请求头
+     * @return
+     */
+    ResponseJson<HeHeUserVo> authorization(String code, HttpHeaders headers);
+
+    /**
+     * 手机号验证码登录
+     *
+     * @param heHeUserDto
+     * @return
+     */
+    ResponseJson<HeHeUserVo> mobileLogin(HeHeUserDto heHeUserDto);
+
+    /**
+     * 发送手机验证码
+     *
+     * @param mobile
+     * @return
+     */
+    ResponseJson<String> sendVerificationCode(String mobile);
+}

+ 20 - 24
src/main/java/com/caimei365/user/service/RegisterService.java

@@ -2,6 +2,7 @@ package com.caimei365.user.service;
 
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.*;
+import com.caimei365.user.model.vo.ClubTemporaryVo;
 import org.springframework.http.HttpHeaders;
 
 /**
@@ -74,32 +75,11 @@ public interface RegisterService {
     /**
      * 协销拉机构上线
      *
-     * @param onlineDto ClubOnlineDto:{
-     *                  source                  注册来源: 0网站 1小程序
-     *                  userId                  协销用户ID(userID)
-     *                  name                    机构名称
-     *                  shortName                   机构简称(shortName)
-     *                  bindMobile              企业绑定手机号
-     *                  contractEmail           邮箱(email)
-     *                  linkMan                 联系人(linkMan1)
-     *                  provinceId             省Id
-     *                  cityId                 市Id
-     *                  townId                 县区Id
-     *                  address                地址
-     *                  shopPhoto              门头照(headpic)
-     *                  businessLicense        营业执照(businessLicenseImage)
-     *                  socialCreditCode       统一社会信用代码(socialCreditCode)
-     *                  firstClubType          一级分类:医美=1和生美=2
-     *                  secondClubType         医美的二级分类:诊所=1、门诊=2、医院=3。  生美没有二级分类
-     *                  department             医美分类下的门诊和医院则需要填写科室
-     *                  medicalPracticeLicense 医美分类必须上传医疗执业许可证(medicalPracticeLicenseImg)
-     *                  mainProduct            主打项目(mainpro)
-     *                  isAgreed  是否同意勾选同意协议,1是,其他否
-     *                  }
-     * @param headers   HttpHeaders
+     * @param id      暂存机构数据id
+     * @param headers HttpHeaders
      * @return ClubPo
      */
-    ResponseJson<Integer> clubOnline(ClubOnlineDto onlineDto, HttpHeaders headers);
+    ResponseJson<Integer> clubOnline(Integer id, HttpHeaders headers);
 
     /**
      * 小程序端分步供应商注册
@@ -146,4 +126,20 @@ public interface RegisterService {
      * @param userId
      */
     ResponseJson updateGuideFlag(Integer userId);
+
+    /**
+     * 暂时存储机构资料
+     *
+     * @param onlineDto
+     * @return
+     */
+    ResponseJson<Integer> clubTemporary(ClubOnlineDto onlineDto);
+
+    /**
+     * 查询暂时存储数据
+     *
+     * @param id
+     * @return
+     */
+    ResponseJson<ClubTemporaryVo> temporaryData(Integer id);
 }

+ 33 - 3
src/main/java/com/caimei365/user/service/SellerService.java

@@ -1,7 +1,10 @@
 package com.caimei365.user.service;
 
 import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.ClubTemporaryDto;
+import com.caimei365.user.model.vo.ClubTemporaryVo;
 import com.caimei365.user.model.vo.UserLoginVo;
+import com.github.pagehelper.PageInfo;
 
 /**
  * Description
@@ -13,10 +16,37 @@ public interface SellerService {
     /**
      * 协销登录(手机号,密码)
      *
-     * @param mobile    手机号
-     * @param password  密码
-     * @param unionId   微信unionId
+     * @param mobile   手机号
+     * @param password 密码
+     * @param unionId  微信unionId
      * @return UserLoginVo
      */
     ResponseJson<UserLoginVo> passwordLogin(String mobile, String password, String unionId);
+
+    /**
+     * 待注册机构列表
+     *
+     * @param userId     协销用户id
+     * @param searchName 搜索名称
+     * @param pageNum    第几页
+     * @param pageSize   一页多少条
+     * @return ClubTemporaryVo
+     */
+    ResponseJson<PageInfo<ClubTemporaryVo>> temporaryClub(Integer userId, String searchName, Integer pageNum, Integer pageSize);
+
+    /**
+     * 修改待注册机构资料
+     *
+     * @param temporaryDto
+     * @return
+     */
+    ResponseJson<String> modifyTemporaryClub(ClubTemporaryDto temporaryDto);
+
+    /**
+     * 删除待注册机构资料
+     *
+     * @param id 暂存数据id
+     * @return
+     */
+    ResponseJson<String> deleteTemporaryClub(Integer id);
 }

+ 113 - 0
src/main/java/com/caimei365/user/service/impl/HeHeServiceImpl.java

@@ -0,0 +1,113 @@
+package com.caimei365.user.service.impl;
+
+import com.caimei365.user.components.RedisService;
+import com.caimei365.user.components.WeChatService;
+import com.caimei365.user.mapper.HeHeMapper;
+import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.HeHeUserDto;
+import com.caimei365.user.model.po.CmHeHeUserPo;
+import com.caimei365.user.model.po.UserPo;
+import com.caimei365.user.model.vo.HeHeUserVo;
+import com.caimei365.user.service.HeHeService;
+import com.caimei365.user.utils.AliyunSmsUtil;
+import com.caimei365.user.utils.CodeUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.http.HttpHeaders;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : plf
+ * @date : 2021/4/21
+ */
+@Slf4j
+@Service
+public class HeHeServiceImpl implements HeHeService {
+    @Resource
+    private HeHeMapper heHeMapper;
+    @Resource
+    private WeChatService weChatService;
+    @Resource
+    private RedisService redisService;
+
+    @Override
+    public ResponseJson<HeHeUserVo> authorization(String code, HttpHeaders headers) {
+        // 小程序微信授权获取登录信息
+        ResponseJson<Map<String, Object>> appletsInfo = weChatService.getInfoMapByApplets(code, headers, 2);
+        if (appletsInfo.getCode() == -1) {
+            return ResponseJson.error(appletsInfo.getMsg(), null);
+        }
+        Map<String, Object> infoData = appletsInfo.getData();
+        String openId = (String) infoData.get(WeChatService.Keys.OPEN_ID);
+        HeHeUserVo heHeUser = heHeMapper.findHeHeUserByOpenId(openId);
+        if (heHeUser == null) {
+            heHeUser = new HeHeUserVo();
+            heHeUser.setOpenId(openId);
+            return ResponseJson.error(heHeUser);
+        }
+        return ResponseJson.success(heHeUser);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public ResponseJson<HeHeUserVo> mobileLogin(HeHeUserDto heHeUserDto) {
+        Date date = new Date();
+        String currentTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
+        String redisSmsCode = (String) redisService.get("heCode:" + heHeUserDto.getMobile());
+        if (null != redisSmsCode && !"null".equals(redisSmsCode)) {
+            if (redisSmsCode.equals(heHeUserDto.getVerificationCode())) {
+                HeHeUserVo heHeUser = heHeMapper.findHeHeUserByMobile(heHeUserDto.getMobile());
+                if (heHeUser != null) {
+                    heHeUser.setOpenId(heHeUserDto.getOpenId());
+                    heHeUser.setHeadImgUrl(heHeUserDto.getHeadImgUrl());
+                    heHeUser.setNickName(heHeUserDto.getNickName());
+                    heHeMapper.updateHeHeUser(heHeUser);
+                } else {
+                    UserPo user = new UserPo();
+                    user.setBindMobile("H" + heHeUserDto.getMobile());
+                    user.setUserName(heHeUserDto.getNickName());
+                    user.setName(heHeUserDto.getNickName());
+                    user.setPassword("HeHe");
+                    //6:呵呵商城用户
+                    user.setUserPermission(6);
+                    user.setUserIdentity(6);
+                    user.setRegisterUserTypeId(6);
+                    user.setRegisterTime(currentTime);
+                    user.setValidFlag(1);
+                    heHeMapper.insertUser(user);
+
+                    CmHeHeUserPo heUserPo = new CmHeHeUserPo();
+                    BeanUtils.copyProperties(heHeUserDto, heUserPo);
+                    heUserPo.setUserId(user.getUserId());
+                    heUserPo.setUserIdentity("1");
+                    heUserPo.setAddTime(date);
+                    heHeMapper.insertHeHeUser(heUserPo);
+                    heHeUser = heHeMapper.findHeHeUserByMobile(heHeUserDto.getMobile());
+                }
+                return ResponseJson.success(heHeUser);
+            }
+        }
+        return ResponseJson.error("验证码错误", null);
+    }
+
+    @Override
+    public ResponseJson<String> sendVerificationCode(String mobile) {
+        String randomCode = CodeUtil.generateCodeInt(6);
+        boolean smsFlag = AliyunSmsUtil.sendSms(mobile, 7, "{code:" + randomCode + "}");
+        if (!smsFlag) {
+            // 短信发送失败重试一次
+            AliyunSmsUtil.sendSms(mobile, 7, "{code:" + randomCode + "}");
+        }
+        log.info("呵呵商城注册验证码:" + randomCode);
+        redisService.set("heCode:" + mobile, randomCode, 300L);
+        return ResponseJson.success("发送成功");
+    }
+}

+ 1 - 1
src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java

@@ -112,7 +112,7 @@ public class LoginServiceImpl implements LoginService {
             return ResponseJson.error("没有获取到微信授权code", null);
         }
         // 小程序微信授权获取登录信息
-        ResponseJson<Map<String, Object>> appletsInfo = weChatService.getInfoMapByApplets(code, headers);
+        ResponseJson<Map<String, Object>> appletsInfo = weChatService.getInfoMapByApplets(code, headers, 1);
         if (appletsInfo.getCode() == -1) {
             return ResponseJson.error(appletsInfo.getMsg(), null);
         }

+ 100 - 63
src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java

@@ -6,10 +6,16 @@ import com.caimei365.user.components.WeChatService;
 import com.caimei365.user.mapper.BaseMapper;
 import com.caimei365.user.mapper.LoginMapper;
 import com.caimei365.user.mapper.RegisterMapper;
+import com.caimei365.user.mapper.SellerMapper;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.dto.*;
 import com.caimei365.user.model.po.*;
 import com.caimei365.user.model.vo.ServiceProviderVo;
+import com.caimei365.user.model.po.ClubPo;
+import com.caimei365.user.model.po.OperationPo;
+import com.caimei365.user.model.po.ShopPo;
+import com.caimei365.user.model.po.UserPo;
+import com.caimei365.user.model.vo.*;
 import com.caimei365.user.service.RegisterService;
 import com.caimei365.user.utils.AliyunSmsUtil;
 import com.caimei365.user.utils.CodeUtil;
@@ -46,6 +52,8 @@ public class RegisterServiceImpl implements RegisterService {
     private LoginMapper loginMapper;
     @Resource
     private RegisterMapper registerMapper;
+    @Resource
+    private SellerMapper sellerMapper;
 
     /**
      * 检查账号可以注册
@@ -166,7 +174,7 @@ public class RegisterServiceImpl implements RegisterService {
             保存数据库 user
          */
         int insertFlag = registerMapper.insertClubUser(user);
-        log.info("插入数据库User表,获得userId:"+user.getUserId());
+        log.info("插入数据库User表,获得userId:" + user.getUserId());
         if (insertFlag < 1) {
             throw new RuntimeException("插入数据库异常user:" + user.toString());
         }
@@ -200,10 +208,10 @@ public class RegisterServiceImpl implements RegisterService {
         user.setClubId(club.getClubId());
         registerMapper.updateUserClubId(user.getUserId(), club.getClubId());
         // 注册成功短信
-        boolean smsFlag = AliyunSmsUtil.sendSms(clubRegisterDto.getBindMobile(), 10, "{name:"+ clubRegisterDto.getBindMobile() +"}");
+        boolean smsFlag = AliyunSmsUtil.sendSms(clubRegisterDto.getBindMobile(), 10, "{name:" + clubRegisterDto.getBindMobile() + "}");
         if (!smsFlag) {
             // 短信发送失败重试一次
-            AliyunSmsUtil.sendSms(clubRegisterDto.getBindMobile(), 10, "{name:"+ clubRegisterDto.getBindMobile() +"}");
+            AliyunSmsUtil.sendSms(clubRegisterDto.getBindMobile(), 10, "{name:" + clubRegisterDto.getBindMobile() + "}");
         }
         /*
             绑定微信,成为机构运营人员
@@ -246,7 +254,7 @@ public class RegisterServiceImpl implements RegisterService {
                 保存数据库 operation
              */
             int insertOperationFlag = registerMapper.insertOperation(operation);
-            log.info("插入数据库cm_mall_operation_user表,获得id:"+operation.getId());
+            log.info("插入数据库cm_mall_operation_user表,获得id:" + operation.getId());
             if (insertOperationFlag < 1) {
                 log.info(operation.getUserId() + " 插入数据库异常operation:" + operation.toString());
             }
@@ -254,7 +262,7 @@ public class RegisterServiceImpl implements RegisterService {
         }
         log.info("注册普通机构成功,手机号>>>" + clubRegisterDto.getBindMobile());
         if (!smsFlag) {
-            log.info("短信发送失败,手机号:"+clubRegisterDto.getBindMobile());
+            log.info("短信发送失败,手机号:" + clubRegisterDto.getBindMobile());
         }
         //新用户自主注册送50采美豆
         UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
@@ -387,7 +395,7 @@ public class RegisterServiceImpl implements RegisterService {
         club.setSocialCreditCode(upgradeDto.getSocialCreditCode());
         // 分类: 1医美, 2生美
         club.setFirstClubType(upgradeDto.getFirstClubType());
-        if (upgradeDto.getFirstClubType() == 1){
+        if (upgradeDto.getFirstClubType() == 1) {
             // 医美二级分类: 1诊所、2门诊、3医院
             club.setSecondClubType(upgradeDto.getSecondClubType());
             // 门诊和医院则需要填写科室
@@ -412,56 +420,38 @@ public class RegisterServiceImpl implements RegisterService {
     /**
      * 协销拉机构上线
      *
-     * @param onlineDto ClubOnlineDto:{
-     *                  source                  注册来源: 0网站 1小程序
-     *                  userId                  协销用户ID(userID)
-     *                  name                    机构名称
-     *                  shortName                   机构简称(shortName)
-     *                  bindMobile              企业绑定手机号
-     *                  contractEmail           邮箱(email)
-     *                  linkMan                 联系人(linkMan1)
-     *                  provinceId             省Id
-     *                  cityId                 市Id
-     *                  townId                 县区Id
-     *                  address                地址
-     *                  shopPhoto              门头照(headpic)
-     *                  businessLicense        营业执照(businessLicenseImage)
-     *                  socialCreditCode       统一社会信用代码(socialCreditCode)
-     *                  firstClubType          一级分类:医美=1和生美=2
-     *                  secondClubType         医美的二级分类:诊所=1、门诊=2、医院=3。  生美没有二级分类
-     *                  department             医美分类下的门诊和医院则需要填写科室
-     *                  medicalPracticeLicense 医美分类必须上传医疗执业许可证(medicalPracticeLicenseImg)
-     *                  mainProduct            主打项目(mainpro)
-     *                  isAgreed  是否同意勾选同意协议,1是,其他否
-     *                  }
-     * @param headers   HttpHeaders
+     * @param id 暂存机构数据id
      * @return ClubPo
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public ResponseJson<Integer> clubOnline(ClubOnlineDto onlineDto, HttpHeaders headers) {
-        Integer isAgreed = onlineDto.getIsAgreed();
+    public ResponseJson<Integer> clubOnline(Integer id, HttpHeaders headers) {
+        ClubTemporaryVo clubTemporary = registerMapper.getTemporary(id);
+        if (clubTemporary == null) {
+            return ResponseJson.error("机构数据异常", null);
+        }
+        Integer isAgreed = clubTemporary.getIsAgreed();
         // 打印IP
         String ip = headers.getFirst("X-CLIENT-IP");
         log.info("协销拉机构上线 X-CLIENT-IP : " + ip);
         // 手机号
-        String mobile = onlineDto.getBindMobile();
+        String mobile = clubTemporary.getBindMobile();
         // 参数校验
-        if (null == onlineDto.getUserId()) {
+        if (null == clubTemporary.getUserId()) {
             return ResponseJson.error("参数异常:用户Id不能为空!", null);
         }
         if (StringUtils.isBlank(mobile)) {
             return ResponseJson.error("参数异常:企业绑定手机号不能为空!", null);
         }
-        if (StringUtils.isBlank(onlineDto.getLinkMan())) {
+        if (StringUtils.isBlank(clubTemporary.getLinkMan())) {
             return ResponseJson.error("参数异常:联系人不能为空!", null);
         }
         if (null == isAgreed || 1 != isAgreed) {
             return ResponseJson.error("请勾选同意协议", null);
         }
         // 是否填写升级资料
-        String businessLicense = onlineDto.getBusinessLicense();
-        String email = onlineDto.getContractEmail();
+        String businessLicense = clubTemporary.getBusinessLicense();
+        String email = clubTemporary.getContractEmail();
         if (StringUtils.isNotBlank(businessLicense)) {
             // 邮箱验证
             String emailCheck = commonService.emailValidate(email);
@@ -469,13 +459,13 @@ public class RegisterServiceImpl implements RegisterService {
                 return ResponseJson.error(emailCheck, null);
             }
             // 机构名称检查
-            String nameCheck = ValidateUtil.validateClubName(onlineDto.getName());
+            String nameCheck = ValidateUtil.validateClubName(clubTemporary.getName());
             if (nameCheck != null) {
                 return ResponseJson.error(nameCheck, null);
             }
-            if (onlineDto.getFirstClubType() == 1) {
+            if (clubTemporary.getFirstClubType() == 1) {
                 // 医美分类
-                if (onlineDto.getSecondClubType() == null || StringUtils.isBlank(onlineDto.getMedicalPracticeLicense())) {
+                if (clubTemporary.getSecondClubType() == null || StringUtils.isBlank(clubTemporary.getMedicalPracticeLicense())) {
                     return ResponseJson.error("医美分类下参数异常,医美的二级分类为空或医疗执业许可证为空", null);
                 }
             }
@@ -486,7 +476,7 @@ public class RegisterServiceImpl implements RegisterService {
             return ResponseJson.error(result, null);
         }
         // 获取协销信息
-        Integer userId = onlineDto.getUserId();
+        Integer userId = clubTemporary.getUserId();
         ServiceProviderVo serviceProvider = loginMapper.getServiceProviderByUserId(userId);
         // 设置日期时间格式
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -506,9 +496,9 @@ public class RegisterServiceImpl implements RegisterService {
         // 用户类型,供应商1,会员机构3,普通机构4
         user.setRegisterUserTypeId(4);
         // 组织名称
-        user.setName(onlineDto.getLinkMan());
+        user.setName(clubTemporary.getLinkMan());
         // 用户名
-        user.setUserName(onlineDto.getLinkMan());
+        user.setUserName(clubTemporary.getLinkMan());
         // 绑定手机号
         user.setBindMobile(mobile);
         // 用户身份: 1协销 2会员机构 3供应商 4普通机构
@@ -534,7 +524,7 @@ public class RegisterServiceImpl implements RegisterService {
             // 状态:待审查资料
             user.setClubStatus(1);
             // 组织名称
-            user.setName(onlineDto.getName());
+            user.setName(clubTemporary.getName());
             // 邮箱
             user.setEmail(email);
             // 是否已经引导过(机构升级:0否,1是)
@@ -557,7 +547,7 @@ public class RegisterServiceImpl implements RegisterService {
         // 联系手机
         club.setContractMobile(mobile);
         // 联系人
-        club.setLinkMan(onlineDto.getLinkMan());
+        club.setLinkMan(clubTemporary.getLinkMan());
         // 用户Id
         club.setUserId(user.getUserId());
         // 设置协销ID
@@ -569,45 +559,45 @@ public class RegisterServiceImpl implements RegisterService {
         // 会员机构,填写升级资料
         if (StringUtils.isNotBlank(businessLicense)) {
             // 机构名称
-            club.setName(onlineDto.getName());
+            club.setName(clubTemporary.getName());
             // 机构简称
-            club.setShortName(onlineDto.getShortName());
+            club.setShortName(clubTemporary.getShortName());
             // 邮箱
             club.setContractEmail(email);
             // 待审查资料
             club.setStatus(1);
             // 地址
-            club.setProvinceId(onlineDto.getProvinceId());
-            club.setCityId(onlineDto.getCityId());
-            club.setTownId(onlineDto.getTownId());
-            club.setAddress(onlineDto.getAddress());
+            club.setProvinceId(clubTemporary.getProvinceId());
+            club.setCityId(clubTemporary.getCityId());
+            club.setTownId(clubTemporary.getTownId());
+            club.setAddress(clubTemporary.getAddress());
             // 门头照
-            club.setShopPhoto(onlineDto.getShopPhoto());
+            club.setShopPhoto(clubTemporary.getShopPhoto());
             // 营业执照
             club.setBusinessLicense(businessLicense);
             // 统一社会信用代码
-            club.setSocialCreditCode(onlineDto.getSocialCreditCode());
+            club.setSocialCreditCode(clubTemporary.getSocialCreditCode());
             // 分类: 1医美, 2生美
-            club.setFirstClubType(onlineDto.getFirstClubType());
-            if (onlineDto.getFirstClubType() == 1) {
+            club.setFirstClubType(clubTemporary.getFirstClubType());
+            if (clubTemporary.getFirstClubType() == 1) {
                 // 医美二级分类: 1诊所、2门诊、3医院
-                club.setSecondClubType(onlineDto.getSecondClubType());
+                club.setSecondClubType(clubTemporary.getSecondClubType());
                 // 门诊和医院则需要填写科室
-                club.setDepartment(onlineDto.getDepartment());
+                club.setDepartment(clubTemporary.getDepartment());
                 // 医美分类必须上传医疗执业许可证
-                club.setMedicalPracticeLicense(onlineDto.getMedicalPracticeLicense());
+                club.setMedicalPracticeLicense(clubTemporary.getMedicalPracticeLicense());
             }
             // 主打项目(mainpro)
-            club.setMainProduct(onlineDto.getMainProduct());
+            club.setMainProduct(clubTemporary.getMainProduct());
             /*
                 保存数据库(会员机构) club
              */
             insertClubFlag = registerMapper.insertUpgradeClub(club);
         } else {
             // 机构名称
-            club.setName(onlineDto.getLinkMan());
+            club.setName(clubTemporary.getLinkMan());
             // 机构简称
-            club.setShortName(onlineDto.getLinkMan());
+            club.setShortName(clubTemporary.getLinkMan());
             // 状态设置上线
             club.setStatus(90);
             /*
@@ -636,16 +626,17 @@ public class RegisterServiceImpl implements RegisterService {
             logTxt = String.format(logTxt, "普通机构", mobile, initPassword);
         }
         // 发送短信
-        boolean smsFlag = AliyunSmsUtil.sendSms(mobile, 6, "{name:"+ mobile +",content:"+ randomCode +"}");
+        boolean smsFlag = AliyunSmsUtil.sendSms(mobile, 6, "{name:" + mobile + ",content:" + randomCode + "}");
         if (!smsFlag) {
             // 短信发送失败重试一次
-            AliyunSmsUtil.sendSms(mobile, 6, "{name:"+ mobile +",content:"+ randomCode +"}");
+            AliyunSmsUtil.sendSms(mobile, 6, "{name:" + mobile + ",content:" + randomCode + "}");
         }
         // 打印短信内容
         log.info(logTxt);
         if (!smsFlag) {
-            log.info("短信发送失败,手机号:"+mobile);
+            log.info("短信发送失败,手机号:" + mobile);
         }
+        sellerMapper.deleteTemporaryClub(id);
         // 返回状态
         return ResponseJson.success(user.getUserId());
     }
@@ -813,6 +804,8 @@ public class RegisterServiceImpl implements RegisterService {
         shop.setValidFlag("1");
         // 供应商:90:已上线,91:已下线,92:审核不通过,3:待审核
         shop.setStatus(3);
+        //如选择为医疗>>三类器械  则必须要上传资质
+        shop.setMedicalPracticeLicenseImg1(shopRegisterDto.getMedicalPracticeLicense());
         /*
             保存数据库 shop
          */
@@ -882,5 +875,49 @@ public class RegisterServiceImpl implements RegisterService {
         return ResponseJson.success();
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public ResponseJson<Integer> clubTemporary(ClubOnlineDto onlineDto) {
+        if (StringUtils.isNotBlank(onlineDto.getBusinessLicense())) {
+            // 邮箱验证
+            String emailCheck = commonService.emailValidate(onlineDto.getContractEmail());
+            if (emailCheck != null) {
+                return ResponseJson.error(emailCheck, null);
+            }
+            // 机构名称检查
+            String nameCheck = ValidateUtil.validateClubName(onlineDto.getName());
+            if (nameCheck != null) {
+                return ResponseJson.error(nameCheck, null);
+            }
+            if (onlineDto.getFirstClubType() == 1) {
+                // 医美分类
+                if (onlineDto.getSecondClubType() == null || StringUtils.isBlank(onlineDto.getMedicalPracticeLicense())) {
+                    return ResponseJson.error("医美分类下参数异常,医美的二级分类为空或医疗执业许可证为空", null);
+                }
+            }
+        }
+        // 手机号验证
+        String result = commonService.mobileAndCodeValidate(onlineDto.getBindMobile(), null);
+        if (result != null) {
+            return ResponseJson.error(result, null);
+        }
+        registerMapper.insertClubTemporary(onlineDto);
+        return ResponseJson.success(onlineDto.getUserId());
+    }
+
+    @Override
+    public ResponseJson<ClubTemporaryVo> temporaryData(Integer id) {
+        ClubTemporaryVo clubTemporary = registerMapper.getTemporary(id);
+        if (clubTemporary == null) {
+            return ResponseJson.error("用户资料不存在", null);
+        }
+        if (null != clubTemporary.getTownId()) {
+            TownVo town = baseMapper.getTown(clubTemporary.getTownId());
+            CityVo city = baseMapper.getCity(town.getCityId());
+            ProvinceVo province = baseMapper.getProvince(city.getProvinceId());
+            clubTemporary.setProvincialAddress(province.getName() + "" + city.getName() + "" + town.getName());
+        }
+        return ResponseJson.success(clubTemporary);
+    }
 }
 

+ 32 - 1
src/main/java/com/caimei365/user/service/impl/SellerServiceImpl.java

@@ -4,15 +4,20 @@ import com.caimei365.user.components.RedisService;
 import com.caimei365.user.components.WeChatService;
 import com.caimei365.user.mapper.SellerMapper;
 import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.ClubTemporaryDto;
+import com.caimei365.user.model.vo.ClubTemporaryVo;
 import com.caimei365.user.model.vo.UserLoginVo;
 import com.caimei365.user.service.SellerService;
 import com.caimei365.user.utils.JwtUtil;
 import com.caimei365.user.utils.Md5Util;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -51,7 +56,7 @@ public class SellerServiceImpl implements SellerService {
         }
         UserLoginVo seller = sellerMapper.getLoginSellerByMobile(mobile);
         if (null == seller || !Md5Util.md5(password).equals(seller.getPassword())) {
-            return ResponseJson.error("密码和账户名不匹配" ,null);
+            return ResponseJson.error("密码和账户名不匹配", null);
         }
         // 生成token
         String token = JwtUtil.createToken(seller.getUserId());
@@ -65,4 +70,30 @@ public class SellerServiceImpl implements SellerService {
         return ResponseJson.success(seller);
     }
 
+    /**
+     * 待注册机构列表
+     *
+     * @param userId 协销用户id
+     * @return ClubTemporaryVo
+     */
+    @Override
+    public ResponseJson<PageInfo<ClubTemporaryVo>> temporaryClub(Integer userId, String searchName, Integer pageNum, Integer pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<ClubTemporaryVo> clubTemporaryList = sellerMapper.findClubTemporary(userId, searchName);
+        PageInfo<ClubTemporaryVo> pageInfo = new PageInfo<>(clubTemporaryList);
+        return ResponseJson.success(pageInfo);
+    }
+
+    @Override
+    public ResponseJson<String> modifyTemporaryClub(ClubTemporaryDto temporaryDto) {
+        sellerMapper.updateClubTemporary(temporaryDto);
+        return ResponseJson.success("");
+    }
+
+    @Override
+    public ResponseJson<String> deleteTemporaryClub(Integer id) {
+        sellerMapper.deleteTemporaryClub(id);
+        return ResponseJson.success("");
+    }
+
 }

+ 3 - 3
src/main/java/com/caimei365/user/utils/AliyunSmsUtil.java

@@ -55,9 +55,9 @@ public class AliyunSmsUtil {
             // 模版内容: 欢迎成为采美机构用户,您的登录账号为:${name},初始密码为:cm${content},您可使用该账号密码登录采美365网和“采美采购商城”小程序。
             templateCode = "SMS_215122672";
         } else if (type == 7) {
-            // 模版内容: 您的短信验证码为:${code}。
-            templateCode = "SMS_215344905";
-            signName = "呵呵商城";
+            // 模版内容: 您"呵呵商城"小程序的验证码为:${code},验证码 5 分钟内有效
+            templateCode = "SMS_215334982";
+            signName = "采美365";
         } else if (type == 8) {
             // 模版内容: 欢迎注册采美365网,您的短信验证码为:${code},该验证码 5 分钟内有效,请勿泄漏于他人。
             templateCode = "SMS_205435882";

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -10,5 +10,5 @@ spring:
       profile: @activatedProperties@    # 启用配置后缀名称
       label: master                     # 分支名称
       # uri: http://47.119.112.46:18001       # 配置中心地址(开发中)
-      uri: http://120.79.162.1:18001          # 配置中心地址(正式环境)
+      uri: http://localhost:18001          # 配置中心地址(正式环境)
       name: user                        # 配置文件名称

+ 71 - 0
src/main/resources/mapper/HeHeMapper.xml

@@ -0,0 +1,71 @@
+<?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.caimei365.user.mapper.HeHeMapper">
+
+    <select id="findHeHeUserByOpenId" resultType="com.caimei365.user.model.vo.HeHeUserVo">
+        SELECT
+          userId,
+          NAME,
+          mobile,
+          userIdentity,
+          nickName,
+          headImgUrl,
+          openId
+        FROM
+          cm_hehe_user
+        WHERE
+          openId = #{openId}
+    </select>
+
+    <select id="findHeHeUserByMobile" resultType="com.caimei365.user.model.vo.HeHeUserVo">
+        SELECT
+          userId,
+          NAME,
+          mobile,
+          userIdentity,
+          nickName,
+          headImgUrl,
+          openId
+        FROM
+          cm_hehe_user
+        WHERE
+          mobile = #{mobile}
+    </select>
+
+    <update id="updateHeHeUser">
+        UPDATE
+          `cm_hehe_user`
+        SET
+          `nickName` = #{nickName},
+          `headImgUrl` = #{headImgUrl},
+          `openId` = #{openId}
+        WHERE
+          `userId` = #{userId}
+    </update>
+
+    <insert id="insertHeHeUser">
+        insert into cm_hehe_user (userId, `name`, mobile,
+          userIdentity, nickName, headImgUrl,
+          openId, addTime)
+        values (#{userId}, #{name}, #{mobile},
+          #{userIdentity}, #{nickName}, #{headImgUrl},
+          #{openId}, #{addTime})
+    </insert>
+
+    <insert id="insertUser" parameterType="com.caimei365.user.model.po.UserPo" keyColumn="userID" keyProperty="userId" useGeneratedKeys="true">
+        INSERT INTO USER (
+		  bindMobile, userPermission, userIdentity,
+		  userName, password, name, registerTime,
+		  validFlag, registerUserTypeID
+		)
+		VALUES
+		  (
+			#{bindMobile}, #{userPermission}, #{userIdentity},
+			#{userName}, #{password}, #{name}, #{registerTime},
+			#{validFlag}, #{registerUserTypeId}
+		  )
+    </insert>
+
+</mapper>

+ 51 - 2
src/main/resources/mapper/RegisterMapper.xml

@@ -22,8 +22,8 @@
         values(#{organizeId},#{registerTime},#{registerIp},#{source},#{registerUserTypeId},#{name},#{userName},#{bindMobile},#{email},#{userIdentity},#{userPermission},#{manufacturerStatus},#{password},#{agreeFlag},#{validFlag})
     </insert>
     <insert id="insertShop" parameterType="com.caimei365.user.model.po.ShopPo" keyProperty="shopId" useGeneratedKeys="true">
-        insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail1`, `provinceID`, `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`, `secondShopType`, `mainpro`, `productDesc`, `info`, `website`, `wxOfficialAccount`, `wxApplets`, `addTime`, `validFlag`, `status`)
-        values(#{userId},#{name},#{shortName},#{linkMan},#{contractMobile},#{contractEmail},#{provinceId},#{cityId},#{townId},#{address},#{socialCreditCode},#{businessLicense},#{firstShopType},#{secondShopType},#{mainProduct},#{mainProductDesc},#{shopDesc},#{website},#{wxOfficialAccount},#{wxApplets},#{addTime},#{validFlag},#{status})
+        insert into shop(`userID`, `name`, `sname`, `linkMan`, `contractMobile`, `contractEmail1`, `provinceID`, `cityID`, `townID`, `address`, `socialCreditCode`, `businessLicenseImage`, `firstShopType`, `secondShopType`, `mainpro`, `productDesc`, `info`, `website`, `wxOfficialAccount`, `wxApplets`, `addTime`, `validFlag`, `status`,medicalPracticeLicenseImg1)
+        values(#{userId},#{name},#{shortName},#{linkMan},#{contractMobile},#{contractEmail},#{provinceId},#{cityId},#{townId},#{address},#{socialCreditCode},#{businessLicense},#{firstShopType},#{secondShopType},#{mainProduct},#{mainProductDesc},#{shopDesc},#{website},#{wxOfficialAccount},#{wxApplets},#{addTime},#{validFlag},#{status},#{medicalPracticeLicenseImg1})
     </insert>
     <update id="updateUserClubId">
         update user set clubID = #{clubId} where userID = #{userId}
@@ -115,6 +115,55 @@
         update user set guideFlag=1 where userID=#{userId}
     </update>
 
+    <insert id="insertClubTemporary" useGeneratedKeys="true" keyProperty="userId" keyColumn="id" parameterType="com.caimei365.user.model.dto.ClubOnlineDto">
+        INSERT INTO `club_temporary` (
+          `userId`, `name`, `shortName`, `bindMobile`,
+          `contractEmail`, `linkMan`, `provinceId`,
+          `cityId`, `townId`, `address`, `shopPhoto`,
+          `businessLicense`, `socialCreditCode`,
+          `firstClubType`, `secondClubType`,
+          `department`, `medicalPracticeLicense`,
+          `mainProduct`, `isAgreed`
+        )
+        VALUES
+          (
+            #{userId}, #{name}, #{shortName}, #{bindMobile},
+            #{contractEmail}, #{linkMan}, #{provinceId},
+            #{cityId}, #{townId}, #{address}, #{shopPhoto},
+            #{businessLicense}, #{socialCreditCode},
+            #{firstClubType}, #{secondClubType},
+            #{department}, #{medicalPracticeLicense},
+            #{mainProduct}, #{isAgreed}
+          )
+    </insert>
+
+    <select id="getTemporary" resultType="com.caimei365.user.model.vo.ClubTemporaryVo">
+        SELECT
+          `userId`,
+          `name`,
+          `shortName`,
+          `bindMobile`,
+          `contractEmail`,
+          `linkMan`,
+          `provinceId`,
+          `cityId`,
+          `townId`,
+          `address`,
+          `shopPhoto`,
+          `businessLicense`,
+          `socialCreditCode`,
+          `firstClubType`,
+          `secondClubType`,
+          `department`,
+          `medicalPracticeLicense`,
+          `mainProduct`,
+          `isAgreed`
+        FROM
+          `club_temporary`
+        WHERE
+          id = #{id}
+    </select>
+
     <insert id="insertBeansHistory">
         INSERT INTO `user_beans_history` (
           `userId`, `type`, `beansType`, `orderId`,

+ 62 - 0
src/main/resources/mapper/SellerMapper.xml

@@ -25,4 +25,66 @@
         set openid = #{openId}, unionId = #{unionId}
         where userID = #{userId}
     </update>
+
+    <select id="findClubTemporary" resultType="com.caimei365.user.model.vo.ClubTemporaryVo">
+        SELECT
+          `id`,
+          `userId`,
+          `name`,
+          `shortName`,
+          `bindMobile`,
+          `contractEmail`,
+          `linkMan`,
+          `provinceId`,
+          `cityId`,
+          `townId`,
+          `address`,
+          `shopPhoto`,
+          `businessLicense`,
+          `socialCreditCode`,
+          `firstClubType`,
+          `secondClubType`,
+          `department`,
+          `medicalPracticeLicense`,
+          `mainProduct`,
+          `isAgreed`
+        FROM
+          club_temporary
+        WHERE
+          userId = #{userId}
+          <if test="searchName != null and searchName != ''">
+              AND (name LIKE CONCAT('%',#{searchName},'%') OR linkMan LIKE CONCAT('%',#{searchName},'%'))
+          </if>
+        ORDER BY
+          id DESC
+    </select>
+
+    <update id="updateClubTemporary">
+        UPDATE
+          `club_temporary`
+        SET
+          `name` = #{name},
+          `shortName` = #{shortName},
+          `bindMobile` = #{bindMobile},
+          `contractEmail` = #{contractEmail},
+          `linkMan` = #{linkMan},
+          `provinceId` = #{provinceId},
+          `cityId` = #{cityId},
+          `townId` = #{townId},
+          `address` = #{address},
+          `shopPhoto` = #{shopPhoto},
+          `businessLicense` = #{businessLicense},
+          `socialCreditCode` = #{socialCreditCode},
+          `firstClubType` = #{firstClubType},
+          `secondClubType` = #{secondClubType},
+          `department` = #{department},
+          `medicalPracticeLicense` = #{medicalPracticeLicense},
+          `mainProduct` = #{mainProduct},
+          `isAgreed` = #{isAgreed}
+        WHERE `id` = #{id}
+    </update>
+
+    <delete id="deleteTemporaryClub">
+        DELETE FROM `club_temporary` WHERE `id` = #{id}
+    </delete>
 </mapper>