Browse Source

机构升级bugfix

chao 4 years ago
parent
commit
94d74a08f2

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

@@ -160,12 +160,6 @@ public class RegisterApi {
      * @return ShopPo
      */
     @ApiOperation("供应商注册")
-    @ApiImplicitParams({
-        @ApiImplicitParam(required = true, name = "passWordConfirm", value = "用户确认密码"),
-        @ApiImplicitParam(required = true, name = "smsCode", value = "短信验证码"),
-        @ApiImplicitParam(required = true, name = "isAgreed", value = "是否同意勾选同意协议,1是,其他否"),
-        @ApiImplicitParam(required = true, name = "whichStep", value = "注册步数: PC(0),小程序(1,2,3)")
-    })
     @Idempotent(prefix="idempotent_shop", keys={"#shopRegisterDto"}, expire=5)
     @PostMapping("/shop/applets")
     public ResponseJson<ShopPo> shopRegister(ShopRegisterDto shopRegisterDto, @RequestHeader HttpHeaders headers) {
@@ -176,6 +170,12 @@ public class RegisterApi {
         return registerService.shopRegister(shopRegisterDto, passWordConfirm, smsCode, isAgreed, whichStep, headers);
     }
 
+    @ApiOperation("更新供应商申请信息")
+    @PostMapping("/apply/update")
+    public ResponseJson<ShopPo> updateShopApplyInfo(ShopRegisterDto shopRegisterDto, @RequestHeader HttpHeaders headers){
+        return registerService.updateShopApply(shopRegisterDto, headers);
+    }
+
 }
 
 

+ 7 - 0
src/main/java/com/caimei365/user/service/RegisterService.java

@@ -129,4 +129,11 @@ public interface RegisterService {
      */
     ResponseJson<ShopPo> shopRegister(ShopRegisterDto shopRegisterDto, String passWordConfirm, String smsCode, Integer isAgreed, Integer whichStep, HttpHeaders headers);
 
+    /**
+     *
+     * @param shopRegisterDto   ShopRegisterDto
+     * @param headers           HttpHeaders
+     * @return ShopPo
+     */
+    ResponseJson<ShopPo> updateShopApply(ShopRegisterDto shopRegisterDto, HttpHeaders headers);
 }

+ 36 - 4
src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java

@@ -24,7 +24,6 @@ import org.apache.commons.lang.StringUtils;
 import org.springframework.http.HttpHeaders;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
@@ -261,12 +260,17 @@ public class RegisterServiceImpl implements RegisterService {
             return ResponseJson.error("参数异常");
         }
         if (upgradeDto.getFirstClubType() == 1){
-            if (upgradeDto.getSecondClubType() == null || StringUtils.isBlank(upgradeDto.getDepartment()) || StringUtils.isBlank(upgradeDto.getMedicalPracticeLicense())) {
-                return ResponseJson.error("医美分类下参数异常");
+            if (upgradeDto.getSecondClubType() == null || StringUtils.isBlank(upgradeDto.getMedicalPracticeLicense())) {
+                return ResponseJson.error("医美分类下参数异常,医美的二级分类或医疗执业许可证");
+            }
+            if (upgradeDto.getSecondClubType() == 2 || upgradeDto.getSecondClubType() == 3) {
+                if (StringUtils.isBlank(upgradeDto.getDepartment())){
+                    return ResponseJson.error("医美分类下,门诊和医院则需要填写科室");
+                }
             }
         }
         Integer userIdByEmail = baseMapper.getUserIdByEmail(upgradeDto.getContractEmail());
-        if (null != userIdByEmail && userIdByEmail > 0 ) {
+        if (null != userIdByEmail && userIdByEmail > 0 && !userIdByEmail.equals(upgradeDto.getUserId())) {
             return ResponseJson.error("该邮箱已被使用");
         }
         // 更新用户数据 user
@@ -715,6 +719,34 @@ public class RegisterServiceImpl implements RegisterService {
         return ResponseJson.success(shop);
     }
 
+    /**
+     * @param shopRegisterDto ShopRegisterDto
+     * @param headers         HttpHeaders
+     * @return ShopPo
+     */
+    @Override
+    public ResponseJson<ShopPo> updateShopApply(ShopRegisterDto shopRegisterDto, HttpHeaders headers) {
+        /*if (null == shopRegisterDto || null == ShopRegisterDto.getUserId() || null == shop.getShopID()) {
+            return ResponseJson.error("参数异常", null);
+        }
+        if (!"1".equals(isAgreed)) {
+            return ResponseJson.error("请勾选同意协议", null);
+        }*/
+
+
+
+
+
+
+
+
+
+
+
+
+        return null;
+    }
+
     /**
      * 校验手机号与验证码
      * @param mobile 手机号

+ 1 - 1
src/main/resources/mapper/ClubMapper.xml

@@ -35,7 +35,7 @@
         where clubID = #{clubId}
     </update>
     <select id="getClubById" resultType="com.caimei365.user.model.vo.ClubVo">
-        select clubID as clubId, userID as userId, name, sname as shortName, contractMobile, contractEmail1,
+        select clubID as clubId, userID as userId, name, sname as shortName, contractMobile, contractEmail1 as contractEmail,
                contractPhone, linkMan, provinceID as proviceId, cityID as cityId, townID as townId,
                address, headpic as shopPhoto, businessLicenseImage as businessLicense, socialCreditCode,
                firstClubType, secondClubType, department, medicalPracticeLicenseImg as medicalPracticeLicense,

+ 5 - 5
src/main/resources/mapper/LoginMapper.xml

@@ -99,16 +99,16 @@
                o.mobile as mobile,
                o.clubID as clubId,
                o.shopID as shopId,
-               o.unionId as unionId,
                 <if test="source=='www'">
-                    o.pcOpenid as openId
+                    o.pcOpenid as openId,
                 </if>
                 <if test="source=='crm'">
-                    o.crmOpenid as openId
+                    o.crmOpenid as openId,
                 </if>
                 <if test="source=='mini'">
-                    o.openid as openId
+                    o.openid as openId,
                 </if>
+                o.unionId as unionId
         from
           cm_mall_operation_user o
         where
@@ -155,7 +155,7 @@
                 shopId = #{shopId},
                 clubId = null,
             </if>
-            userType = #{userType},
+            userType = #{userType}
         where id = #{id}
     </update>
     <update id="updateOperationByUnbind">

+ 25 - 24
src/main/resources/mapper/RegisterMapper.xml

@@ -33,36 +33,37 @@
     </update>
     <update id="updateClubUserByUpgrade">
         update user set registerIP = #{registerIp},
-                        email = #{contractEmail},
+                        email = #{email},
                         name = #{name},
                         clubStatus = #{clubStatus}
         where userID = #{userId}
     </update>
     <update id="updateClubByUpgrade">
         update club set userID = #{userId}, name = #{name}, sname = #{shortName}, contractEmail1 = #{contractEmail},
-                        <if test="contractPhone != null">
-                            contractPhone = #{contractPhone},
-                        </if>
-                        <if test="linkMan != null">
-                            linkMan = #{linkMan},
-                        </if>
-                        provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
-                        <if test="shopPhoto != null  and shopPhoto != 'null'  and shopPhoto != ''">
-                            headpic = #{shopPhoto},
-                        </if>
-                        businessLicenseImage = #{businessLicense}, socialCreditCode = #{socialCreditCode}, firstClubType = #{firstClubType},
-                        <if test="firstClubType == 1">
-                            secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg = #{medicalPracticeLicense},
-                        </if>
-                        <if test="mainProduct != null">
-                            mainpro = #{mainProduct},
-                        </if>
-                        <if test="fax != null">
-                            fax = #{fax},
-                        </if>
-                        <if test="profile != null">
-                            info = #{profile},
-                        </if>
+            <if test="contractPhone != null">
+                contractPhone = #{contractPhone},
+            </if>
+            <if test="linkMan != null">
+                linkMan = #{linkMan},
+            </if>
+            provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId}, address = #{address},
+            <if test="shopPhoto != null  and shopPhoto != 'null'  and shopPhoto != ''">
+                headpic = #{shopPhoto},
+            </if>
+            businessLicenseImage = #{businessLicense}, socialCreditCode = #{socialCreditCode}, firstClubType = #{firstClubType},
+            <if test="firstClubType == 1">
+                secondClubType = #{secondClubType}, department = #{department}, medicalPracticeLicenseImg = #{medicalPracticeLicense},
+            </if>
+            <if test="mainProduct != null">
+                mainpro = #{mainProduct},
+            </if>
+            <if test="fax != null">
+                fax = #{fax},
+            </if>
+            <if test="profile != null">
+                info = #{profile},
+            </if>
+            status = #{status}
         where clubID = #{clubId}
     </update>
 </mapper>

+ 2 - 14
src/main/resources/mapper/ShopMapper.xml

@@ -11,25 +11,12 @@
     </insert>
     <update id="updateShopUserByUpdateInfo">
         update user
-        <set>
-            <if test="name != null">
-                name = #{name},
-            </if>
-            <if test="userName != null">
-                userName = #{userName},
-            </if>
-            <if test="email != null">
-                email = #{email},
-            </if>
-        </set>
+        set name = #{name}, userName = #{userName}, email = #{email}
         where userID = #{userId}
     </update>
     <update id="updateShopByUpdateInfo">
         update shop
         <set>
-            <if test="name != null">
-                name = #{name},
-            </if>
             <if test="shortName != null">
                 sname = #{shortName},
             </if>
@@ -99,6 +86,7 @@
             <if test="logo != null">
                 logo = #{logo},
             </if>
+            name = #{name}
         </set>
         where shopID = #{shopId}
     </update>