浏览代码

资料修改

Aslee 4 年之前
父节点
当前提交
dc9c133122

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

@@ -1,6 +1,9 @@
 package com.caimei365.user.controller;
 package com.caimei365.user.controller;
 
 
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.ClubUpdateDto;
+import com.caimei365.user.model.dto.ClubUpgradeDto;
+import com.caimei365.user.model.po.ClubPo;
 import com.caimei365.user.service.ClubService;
 import com.caimei365.user.service.ClubService;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -41,35 +44,35 @@ public class ClubApi {
      * 修改机构资料
      * 修改机构资料
      *
      *
      * spi旧接口:/operation/modifiedData
      * spi旧接口:/operation/modifiedData
-     *
-     *
-						userID:this.userID,
-						clubID:this.clubID,					//会所ID
-						name:this.clubName,
-						linkMan1:this.clubContact,
-						sname:this.abbreviation,
-						provinceID:this.addressData.provinceID,
-						cityID:this.addressData.cityID,
-						townID:this.addressData.townID,
-						address:this.addressData.addressDetail,
-						socialCreditCode:this.socialCreditCode,
-						businessLicenseImage:this.uploadBusinessImage,
-						headpic:this.uploadMentuzImage,
-						firstClubType:this.isOrganizationType, //机构类型分类 医美:0和生美:1
-						secondClubType:this.secondClubType,		//机构类型二级分类 诊所:1,门诊:2,医院:3
-						department:this.department,				//科室
-						medicalPracticeLicenseImg:this.uploadMedicalImage,//资质图片
-						isAgreed:this.isAgreed,				//是否勾选协议
-						mainpro:this.mainpro,
-						fax:this.clubFax,
-						contractPhone:this.clubTelePhone,
-						info : this.companyPprofile,
-     *
-     *
+	 *
+	 * @param club ClubUpdateDto:{
+	 *                      clubId                 机构ID
+	 *                      userId                 用户ID
+	 *                      name                   机构名称
+	 *                      sName                  机构简称(sname)
+	 *                      contractEmail          邮箱(contractEmail1)
+	 *                      contractPhone          固定电话
+	 *                      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)
+	 *                      fax                    传真
+	 *                      profile                公司简介
+	 *                  }
+	 * @return ClubUpdateDto
      */
      */
     @GetMapping("/info/update")
     @GetMapping("/info/update")
-    public ResponseJson<Map<String, Object>> updateClubUserInfo() {
-        return null;
+    public ResponseJson<ClubUpdateDto> updateClubUserInfo(ClubUpdateDto club) {
+		return clubService.updateClubUserInfo(club);
     }
     }
 
 
 
 

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

@@ -112,10 +112,10 @@ public class RegisterApi {
      *                        townId                所在县区Id(townID)
      *                        townId                所在县区Id(townID)
      *                        address               地址
      *                        address               地址
      *                        socialCreditCode      统一社会信用代码
      *                        socialCreditCode      统一社会信用代码
-     *                        businessLicenseImage  营业执照
+     *                        businessLicense       营业执照(businessLicenseImage)
      *                        firstShopType         医疗=1和非医疗=2
      *                        firstShopType         医疗=1和非医疗=2
      *                        secondShopType        医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
      *                        secondShopType        医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
-     *                        mainPro               主打项目(mainpro)
+     *                        mainProduct           主打项目(mainpro)
      *                    }
      *                    }
      * @param passWordConfirm 用户确认密码
      * @param passWordConfirm 用户确认密码
      * @param smsCode         短信验证码(旧:activationCode)
      * @param smsCode         短信验证码(旧:activationCode)

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

@@ -1,6 +1,7 @@
 package com.caimei365.user.controller;
 package com.caimei365.user.controller;
 
 
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.ShopUpdateDto;
 import com.caimei365.user.service.ShopService;
 import com.caimei365.user.service.ShopService;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -31,7 +32,7 @@ public class ShopApi {
      */
      */
     @GetMapping("/info")
     @GetMapping("/info")
     public ResponseJson<Map<String, Object>> getShopUserInfo(Integer userId) {
     public ResponseJson<Map<String, Object>> getShopUserInfo(Integer userId) {
-        return null;
+        return shopService.getShopUserInfo(userId);
     }
     }
 
 
     /**
     /**
@@ -39,12 +40,49 @@ public class ShopApi {
      *
      *
      * spi旧接口:/supplier/modifiedData
      * spi旧接口:/supplier/modifiedData
      *
      *
+     * @param shop ShopUpdateDto{
+     *                        shopId                    供应商Id
+     *                        userId                    用户Id
+     *                        name                      组织名称
+     *                        sName                     供应商公司简称(sname)
+     *                        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                  年营业额
+     *                        medicalPraticeLicenseImg  医疗执业许可证(medicalPraticeLicenseImg1)
+     *                        shopDesc                  公司介绍(info)
+     *                        businessScope             经营范围
+     *                        logo                      公司LOGO
+     *                    }
+     * @param operationLicence          生产经营证书
+     * @param hygienicLicense           卫生许可证
+     * @param taxLicense                税务登记证
+     * @param honorCertification        荣誉证书
+     * @param productCertification      产品证书
+     * @return ClubUpdateDto
      */
      */
     @GetMapping("/info/update")
     @GetMapping("/info/update")
-    public ResponseJson<Map<String, Object>> updateShopUserInfo() {
-        return null;
+    public ResponseJson<Map<String, Object>> updateShopUserInfo(ShopUpdateDto shop,
+                                                                String operationLicence,
+                                                                String hygienicLicense,
+                                                                String taxLicense,
+                                                                String honorCertification,
+                                                                String productCertification) {
+        return shopService.updateShopUserInfo(shop, operationLicence, hygienicLicense, taxLicense, honorCertification, productCertification);
     }
     }
 
 
-
-
 }
 }

+ 8 - 0
src/main/java/com/caimei365/user/mapper/BaseMapper.java

@@ -3,6 +3,7 @@ package com.caimei365.user.mapper;
 import com.caimei365.user.model.vo.CityVo;
 import com.caimei365.user.model.vo.CityVo;
 import com.caimei365.user.model.vo.ProvinceVo;
 import com.caimei365.user.model.vo.ProvinceVo;
 import com.caimei365.user.model.vo.TownVo;
 import com.caimei365.user.model.vo.TownVo;
+import com.caimei365.user.model.vo.UserVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -59,4 +60,11 @@ public interface BaseMapper {
      * @return
      * @return
      */
      */
     TownVo getTown(Integer townId);
     TownVo getTown(Integer townId);
+
+    /**
+     * 根据用户Id获取用户信息
+     * @param userId    用户Id
+     * @return
+     */
+    UserVo getUserByUserId(Integer userId);
 }
 }

+ 6 - 0
src/main/java/com/caimei365/user/mapper/ClubMapper.java

@@ -1,6 +1,8 @@
 package com.caimei365.user.mapper;
 package com.caimei365.user.mapper;
 
 
+import com.caimei365.user.model.dto.ClubUpdateDto;
 import com.caimei365.user.model.po.ClubPo;
 import com.caimei365.user.model.po.ClubPo;
+import com.caimei365.user.model.po.UserPo;
 import com.caimei365.user.model.vo.ClubVo;
 import com.caimei365.user.model.vo.ClubVo;
 import com.caimei365.user.model.vo.UserVo;
 import com.caimei365.user.model.vo.UserVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
@@ -26,4 +28,8 @@ public interface ClubMapper {
      * @return
      * @return
      */
      */
     ClubVo getClubById(Integer clubId);
     ClubVo getClubById(Integer clubId);
+
+    void updateUserByUpdateInfo(UserPo user);
+
+    void updateClubByUpdateInfo(ClubUpdateDto club);
 }
 }

+ 33 - 0
src/main/java/com/caimei365/user/mapper/ShopMapper.java

@@ -0,0 +1,33 @@
+package com.caimei365.user.mapper;
+
+import com.caimei365.user.model.dto.ClubUpdateDto;
+import com.caimei365.user.model.po.UserPo;
+import com.caimei365.user.model.vo.ClubVo;
+import com.caimei365.user.model.vo.ShopVo;
+import com.caimei365.user.model.vo.UserVo;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/3/16
+ */
+@Mapper
+public interface ShopMapper {
+    /**
+     * 根据Id查询供应商
+     * @param shopId
+     * @return
+     */
+    ShopVo getShopById(Integer shopId);
+
+    void updateUserByUpdateInfo(UserPo user);
+
+    void updateClubByUpdateInfo(ClubUpdateDto club);
+
+
+    List<String> getShopCert(Integer shopId, Integer shopCertTypeId);
+}

+ 104 - 0
src/main/java/com/caimei365/user/model/dto/ClubUpdateDto.java

@@ -0,0 +1,104 @@
+package com.caimei365.user.model.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/3/11
+ */
+@Data
+public class ClubUpdateDto implements Serializable {
+    /**
+     * 机构ID
+     */
+    private Integer clubId;
+    /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 机构名称
+     */
+    private String name;
+    /**
+     * 机构简称
+     */
+    private String sName;
+    /**
+     * 联系邮箱
+     */
+    private String contractEmail;
+    /**
+     * 固定电话
+     */
+    private String contractPhone;
+    /**
+     * 联系人
+     */
+    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;
+    /**
+     * 传真
+     */
+    private String fax;
+    /**
+     * 公司简介(info)
+     */
+    private String profile;
+    /**
+     * 最后更新时间
+     */
+    private String lastModifyTime;
+
+}

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

@@ -70,7 +70,7 @@ public class ShopRegisterDto implements Serializable {
      */
      */
     private String firstShopType;
     private String firstShopType;
     /**
     /**
-     * 医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 一级分类非医疗没有二级分类
+     * 医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
      */
      */
     private String secondShopType;
     private String secondShopType;
     /**
     /**

+ 119 - 0
src/main/java/com/caimei365/user/model/dto/ShopUpdateDto.java

@@ -0,0 +1,119 @@
+package com.caimei365.user.model.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/3/12
+ */
+@Data
+public class ShopUpdateDto implements Serializable {
+    /**
+     * 供应商ID
+     */
+    private Integer shopId;
+    /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 组织名称
+     */
+    private String name;
+    /**
+     * 供应商公司简称(sname)
+     */
+    private String sName;
+    /**
+     * 邮箱
+     */
+    private String email;
+    /**
+     * 固定电话
+     */
+    private String contractPhone;
+    /**
+     * 联系人
+     */
+    private String linkMan;
+    /**
+     * 省(provinceID)
+     */
+    private Integer provinceId;
+    /**
+     * 市(cityID)
+     */
+    private Integer cityId;
+    /**
+     * 地址ID(townID)
+     */
+    private Integer townId;
+    /**
+     * 地址
+     */
+    private String address;
+    /**
+     * 统一社会信用代码(营业执照编号)
+     */
+    private String socialCreditCode;
+    /**
+     * 营业执照(businessLicenseImage)
+     */
+    private String businessLicense;
+    /**
+     * 医疗=1和非医疗=2
+     */
+    private String firstShopType;
+    /**
+     * 医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
+     */
+    private String secondShopType;
+    /**
+     * 主打项目(mainpro)
+     */
+    private String mainProduct;
+    /**
+     * 主打商品说明(productDesc)
+     */
+    private String mainProductDesc;
+    /**
+     * 法人代表
+     */
+    private String legalPerson;
+    /**
+     * 注册资本
+     */
+    private Double registeredCapital;
+    /**
+     * 传真号(fax)
+     */
+    private String faxNumber;
+    /**
+     * 公司性质(nature)
+     */
+    private String companyNature;
+    /**
+     * 年营业额
+     */
+    private Double turnover;
+    /**
+     * 医疗执业许可证(medicalPraticeLicenseImg1)
+     */
+    private String medicalPraticeLicenseImg;
+    /**
+     * 公司介绍(info)
+     */
+    private String shopDesc;
+    /**
+     * 经营范围
+     */
+    private String businessScope;
+    /**
+     * 公司LOGO
+     */
+    private String logo;
+}

+ 48 - 0
src/main/java/com/caimei365/user/model/vo/ShopVo.java

@@ -0,0 +1,48 @@
+package com.caimei365.user.model.vo;
+
+import com.caimei365.user.model.po.ClubPo;
+import com.caimei365.user.model.po.ShopPo;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Aslee
+ * @date : 2021/3/16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ShopVo extends ShopPo {
+    /**
+     * 省市区地址
+     */
+    private String provincialAddress;
+
+    /**
+     * 荣誉证书
+     */
+    private List<String> honorCertification;
+
+    /**
+     * 生产经营证书
+     */
+    private String operationLicence;
+
+    /**
+     * 产品证书
+     */
+    private List<String> productCertification;
+
+    /**
+     * 卫生许可证
+     */
+    private String hygienicLicense;
+
+    /**
+     * 税务登记证
+     */
+    private String taxLicense;
+}

+ 1 - 0
src/main/java/com/caimei365/user/model/vo/UserVo.java

@@ -29,6 +29,7 @@ public class UserVo extends UserPo {
      * 审核备注
      * 审核备注
      */
      */
     private String auditNote;
     private String auditNote;
+
     /**
     /**
      * 审核不通过原因列表
      * 审核不通过原因列表
      */
      */

+ 32 - 0
src/main/java/com/caimei365/user/service/ClubService.java

@@ -1,6 +1,8 @@
 package com.caimei365.user.service;
 package com.caimei365.user.service;
 
 
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.ClubUpdateDto;
+import com.caimei365.user.model.po.ClubPo;
 
 
 import java.util.Map;
 import java.util.Map;
 
 
@@ -18,4 +20,34 @@ public interface ClubService {
      * @return Map(userPo,clubPo)
      * @return Map(userPo,clubPo)
      */
      */
     ResponseJson<Map<String, Object>> getClubUserInfo(Integer userId);
     ResponseJson<Map<String, Object>> getClubUserInfo(Integer userId);
+
+    /**
+     * 修改机构资料
+     *
+     * @param club ClubUpgradeDto:{
+     *                      clubId                 机构ID
+     *                      userId                 用户ID
+     *                      name                   机构名称
+     *                      sName                  机构简称(sname)
+     *                      contractEmail          邮箱(contractEmail1)
+     *                      contractPhone          固定电话
+     *                      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)
+     *                      fax                    传真
+     *                      profile                公司简介
+     *                  }
+     * @return ClubUpdateDto
+     */
+    ResponseJson<ClubUpdateDto> updateClubUserInfo(ClubUpdateDto club);
 }
 }

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

@@ -82,10 +82,10 @@ public interface RegisterService {
      *                        townId                所在县区Id(townID)
      *                        townId                所在县区Id(townID)
      *                        address               地址
      *                        address               地址
      *                        socialCreditCode      统一社会信用代码
      *                        socialCreditCode      统一社会信用代码
-     *                        businessLicenseImage  营业执照
+     *                        businessLicense       营业执照(businessLicenseImage)
      *                        firstShopType         医疗=1和非医疗=2
      *                        firstShopType         医疗=1和非医疗=2
      *                        secondShopType        医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
      *                        secondShopType        医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
-     *                        mainPro               主打项目(mainpro)
+     *                        mainProduct           主打项目(mainpro)
      *                    }
      *                    }
      * @param passWordConfirm 用户确认密码
      * @param passWordConfirm 用户确认密码
      * @param smsCode         短信验证码(旧:activationCode)
      * @param smsCode         短信验证码(旧:activationCode)

+ 15 - 0
src/main/java/com/caimei365/user/service/ShopService.java

@@ -1,6 +1,11 @@
 package com.caimei365.user.service;
 package com.caimei365.user.service;
 
 
 
 
+import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.ShopUpdateDto;
+
+import java.util.Map;
+
 /**
 /**
  * Description
  * Description
  *
  *
@@ -8,4 +13,14 @@ package com.caimei365.user.service;
  * @date : 2021/3/9
  * @date : 2021/3/9
  */
  */
 public interface ShopService {
 public interface ShopService {
+    /**
+     * 根据用户Id查询供应商资料
+     *
+     * @param userId 用户Id
+     *
+     * @return Map(userPo,clubPo)
+     */
+    ResponseJson<Map<String, Object>> getShopUserInfo(Integer userId);
+
+    ResponseJson<Map<String, Object>> updateShopUserInfo(ShopUpdateDto shop, String operationLicence, String hygienicLicense, String taxLicense, String honorCertification, String productCertification);
 }
 }

+ 63 - 5
src/main/java/com/caimei365/user/service/impl/ClubServiceImpl.java

@@ -3,6 +3,9 @@ package com.caimei365.user.service.impl;
 import com.caimei365.user.mapper.BaseMapper;
 import com.caimei365.user.mapper.BaseMapper;
 import com.caimei365.user.mapper.ClubMapper;
 import com.caimei365.user.mapper.ClubMapper;
 import com.caimei365.user.model.ResponseJson;
 import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.ClubUpdateDto;
+import com.caimei365.user.model.po.ClubPo;
+import com.caimei365.user.model.po.UserPo;
 import com.caimei365.user.model.vo.*;
 import com.caimei365.user.model.vo.*;
 import com.caimei365.user.service.ClubService;
 import com.caimei365.user.service.ClubService;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
@@ -10,10 +13,8 @@ import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 
 /**
 /**
  * Description
  * Description
@@ -42,7 +43,7 @@ public class ClubServiceImpl implements ClubService {
             return ResponseJson.error("参数异常", null);
             return ResponseJson.error("参数异常", null);
         }
         }
         // 用户信息
         // 用户信息
-        UserVo user = clubMapper.getUserByUserId(userId);
+        UserVo user = baseMapper.getUserByUserId(userId);
         if (user == null) {
         if (user == null) {
             return ResponseJson.error("用户信息不存在", null);
             return ResponseJson.error("用户信息不存在", null);
         }
         }
@@ -76,4 +77,61 @@ public class ClubServiceImpl implements ClubService {
         map.put("club", club);
         map.put("club", club);
         return ResponseJson.success(map);
         return ResponseJson.success(map);
     }
     }
+
+    /**
+     * 修改机构资料
+     *
+     * @param club ClubUpgradeDto:{
+     *                      clubId                 机构ID
+     *                      userId                 用户ID
+     *                      name                   机构名称
+     *                      sName                  机构简称(sname)
+     *                      contractEmail          邮箱(contractEmail1)
+     *                      contractPhone          固定电话
+     *                      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)
+     *                      fax                    传真
+     *                      profile                公司简介
+     *                  }
+     * @return ClubUpdateDto
+     */
+    @Override
+    public ResponseJson<ClubUpdateDto> updateClubUserInfo(ClubUpdateDto club) {
+        //设置日期时间格式
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        if (club.getClubId() == null) {
+            return ResponseJson.error("参数异常", null);
+        }
+        UserPo user = new UserPo();
+        Integer userIdByEmail = baseMapper.getUserIdByEmail(club.getContractEmail());
+        if (null != userIdByEmail && userIdByEmail > 0 ) {
+            return ResponseJson.error("该邮箱已被使用", null);
+        }
+        // 邮箱
+        user.setEmail(club.getContractEmail());
+        // 用户Id
+        user.setUserId(club.getUserId());
+        // 用户名
+        user.setUserName(club.getLinkMan());
+        // 组织名称
+        user.setName(club.getName());
+        // 更新机构用户信息
+        clubMapper.updateUserByUpdateInfo(user);
+        // 最后修改时间
+        club.setLastModifyTime(dateFormat.format(new Date()));
+        // 更新机构信息
+        clubMapper.updateClubByUpdateInfo(club);
+        return ResponseJson.success("修改机构资料成功", club);
+    }
 }
 }

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

@@ -347,10 +347,10 @@ public class RegisterServiceImpl implements RegisterService {
      *                        townId                所在县区Id(townID)
      *                        townId                所在县区Id(townID)
      *                        address               地址
      *                        address               地址
      *                        socialCreditCode      统一社会信用代码
      *                        socialCreditCode      统一社会信用代码
-     *                        businessLicenseImage  营业执照
+     *                        businessLicense       营业执照(businessLicenseImage)
      *                        firstShopType         医疗=1和非医疗=2
      *                        firstShopType         医疗=1和非医疗=2
      *                        secondShopType        医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
      *                        secondShopType        医疗的二级分类 一类器械=1、二类器械 =2、三类器械=3、其他=4 /// 1和非医疗没有二级分类
-     *                        mainPro               主打项目(mainpro)
+     *                        mainProduct           主打项目(mainpro)
      *                    }
      *                    }
      * @param passWordConfirm 用户确认密码
      * @param passWordConfirm 用户确认密码
      * @param smsCode         短信验证码(旧:activationCode)
      * @param smsCode         短信验证码(旧:activationCode)

+ 140 - 2
src/main/java/com/caimei365/user/service/impl/ShopServiceImpl.java

@@ -2,12 +2,22 @@ package com.caimei365.user.service.impl;
 
 
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.mapper.BaseMapper;
 import com.caimei365.user.mapper.BaseMapper;
-import com.caimei365.user.mapper.RegisterMapper;
+import com.caimei365.user.mapper.ShopMapper;
+import com.caimei365.user.model.ResponseJson;
+import com.caimei365.user.model.dto.ShopUpdateDto;
+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.ShopService;
 import com.caimei365.user.service.ShopService;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * Description
  * Description
@@ -24,6 +34,134 @@ public class ShopServiceImpl implements ShopService {
     @Resource
     @Resource
     private BaseMapper baseMapper;
     private BaseMapper baseMapper;
     @Resource
     @Resource
-    private RegisterMapper registerMapper;
+    private ShopMapper shopMapper;
 
 
+
+    /**
+     * 根据用户Id查询供应商资料
+     *
+     * @param userId 用户Id
+     *
+     * @return Map(userPo,clubPo)
+     */
+    @Override
+    public ResponseJson<Map<String, Object>> getShopUserInfo(Integer userId) {
+        if (null == userId) {
+            return ResponseJson.error("参数异常", null);
+        }
+        // 用户信息
+        UserVo user = baseMapper.getUserByUserId(userId);
+        if (user == null) {
+            return ResponseJson.error("用户信息不存在", null);
+        }
+        if (!StringUtils.isBlank(user.getAuditNote()) && "2".equals(user.getAuditStatus())) {
+            ArrayList<String> list = new ArrayList<>();
+            if (user.getAuditNote().contains(",")) {
+                String[] auditNoteArray = user.getAuditNote().split(",");
+                for (String note : auditNoteArray) {
+                    if (!StringUtils.isBlank(note)) {
+                        list.add(note);
+                    }
+                }
+            } else {
+                list.add(user.getAuditStatus());
+            }
+            user.setAuditNoteList(list);
+        }
+        // 供应商信息
+        ShopVo shop = shopMapper.getShopById(user.getClubId());
+        if (shop == null) {
+            return ResponseJson.error("供应商信息不存在", null);
+        }
+        if (null != shop.getTownId()) {
+            TownVo town = baseMapper.getTown(shop.getTownId());
+            CityVo city = baseMapper.getCity(town.getCityId());
+            ProvinceVo province = baseMapper.getProvince(city.getProvinceId());
+            shop.setProvincialAddress(province.getName() + "" + city.getName() + "" + town.getName());
+        }
+        // 荣誉证书
+        List<String> honorCertification = shopMapper.getShopCert(user.getShopId(), 1);
+        shop.setHonorCertification(honorCertification);
+        // 生产经营证书
+        List<String> operationLicence = shopMapper.getShopCert(user.getShopId(), 2);
+        if (null != operationLicence && operationLicence.size() > 0) {
+            shop.setOperationLicence(operationLicence.get(0));
+        }
+        // 产品证书
+        List<String> productCertification = shopMapper.getShopCert(user.getShopId(), 3);
+        shop.setProductCertification(productCertification);
+        // 卫生许可证
+        List<String> hygienicLicense = shopMapper.getShopCert(user.getShopId(), 5);
+        if (null != hygienicLicense && hygienicLicense.size() > 0) {
+            shop.setHygienicLicense(hygienicLicense.get(0));
+        }
+        // 税务登记证
+        List<String> taxLicense = shopMapper.getShopCert(user.getShopId(), 6);
+        if (null != taxLicense && taxLicense.size() > 0) {
+            shop.setTaxLicense(taxLicense.get(0));
+        }
+        HashMap<String, Object> map = new HashMap(2);
+        map.put("user", user);
+        map.put("shop", shop);
+        return ResponseJson.success(map);
+    }
+
+
+    @Override
+    public ResponseJson<Map<String, Object>> updateShopUserInfo(ShopUpdateDto shopUpdateDto, String operationLicence, String hygienicLicense, String taxLicense, String honorCertification, String productCertification) {
+        ShopPo shop = new ShopPo();
+        UserPo user = new UserPo();
+        if (StringUtils.isNotBlank(shopUpdateDto.getEmail())) {
+            Integer userIdByEmail = baseMapper.getUserIdByEmail(shopUpdateDto.getEmail());
+            if (null != userIdByEmail && !userIdByEmail.equals(shopUpdateDto.getUserId())) {
+                return ResponseJson.error("该邮箱已被使用");
+            }
+            shop.setContractEmail1(shopUpdateDto.getEmail());
+            shop.setContractEmail2(shopUpdateDto.getEmail());
+        }
+        user.setUserName(shopUpdateDto.getSName());
+        /*loginDao.updateUser(user);
+        supplierDao.updateShop(shop);
+        if (StringUtils.isNotBlank(shopUpdateDto.getSocialCreditCode())) {
+            supplierDao.deleteShopCert(shopUpdateDto.getShopID());
+            ShopCertVo shopCert = new ShopCertVo();
+            shopCert.setShopID(shopUpdateDto.getShopID());
+            shopCert.setShopCertTypeID(2);
+            shopCert.setImage(shopUpdateDto.getProductionLicence());
+            shopCert.setName("生产经营证书");
+            supplierDao.insertShopCert(shopCert);
+            shopCert.setShopCertTypeID(5);
+            shopCert.setImage(shopUpdateDto.getHygienicLicense());
+            shopCert.setName("卫生许可证");
+            supplierDao.insertShopCert(shopCert);
+            shopCert.setShopCertTypeID(6);
+            shopCert.setImage(shopUpdateDto.getTaxLicense());
+            shopCert.setName("税务登记证");
+            supplierDao.insertShopCert(shopCert);
+            if (StringUtils.isNotBlank(shopUpdateDto.getCertificateHonor())) {
+                String[] images = shopUpdateDto.getCertificateHonor().split(",");
+                for (String image : images) {
+                    if (StringUtils.isNotBlank(image)) {
+                        shopCert.setShopCertTypeID(1);
+                        shopCert.setImage(image);
+                        shopCert.setName("荣誉证书");
+                        supplierDao.insertShopCert(shopCert);
+                    }
+                }
+            }
+            if (StringUtils.isNotBlank(shopUpdateDto.getProductCertification())) {
+                String[] images = shopUpdateDto.getProductCertification().split(",");
+                for (String image : images) {
+                    if (StringUtils.isNotBlank(image)) {
+                        shopCert.setShopCertTypeID(3);
+                        shopCert.setImage(image);
+                        shopCert.setName("产品证书");
+                        supplierDao.insertShopCert(shopCert);
+                    }
+                }
+            }
+        }
+        return model.success();*/
+        return null;
+    }
 }
 }

+ 3 - 0
src/main/resources/mapper/BaseMapper.xml

@@ -31,4 +31,7 @@
         select townID as townId, cityID as cityId, name, zip, telZip, validFlag
         select townID as townId, cityID as cityId, name, zip, telZip, validFlag
         from town where townID = #{townID}
         from town where townID = #{townID}
     </select>
     </select>
+    <select id="getUserByUserId" resultType="com.caimei365.user.model.vo.UserVo">
+        select * from user where userID = #{userId}
+    </select>
 </mapper>
 </mapper>

+ 32 - 0
src/main/resources/mapper/ClubMapper.xml

@@ -2,4 +2,36 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.user.mapper.ClubMapper">
 <mapper namespace="com.caimei365.user.mapper.ClubMapper">
 
 
+    <update id="updateUserByUpdateInfo">
+        update user set email = #{email},userName = #{userName},name = #{name}
+        where userID = #{userId}
+    </update>
+    <update id="updateClubByUpdateInfo">
+        update club set userID = #{userId}, name = #{name}, sname = #{sName}, 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>
+        lastModify = #{lastModifyTime}
+        where clubID = #{clubId}
+    </update>
 </mapper>
 </mapper>

+ 43 - 0
src/main/resources/mapper/ShopMapper.xml

@@ -0,0 +1,43 @@
+<?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.ShopMapper">
+
+    <update id="updateUserByUpdateInfo">
+        update user set email = #{email},userName = #{userName},name = #{name}
+        where userID = #{userId}
+    </update>
+    <update id="updateClubByUpdateInfo">
+        update club set userID = #{userId}, name = #{name}, sname = #{sName}, 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>
+        lastModify = #{lastModifyTime}
+        where clubID = #{clubId}
+    </update>
+    <select id="getShopCert" resultType="java.lang.String">
+        SELECT image FROM shopcert WHERE shopID = #{shopId} AND shopCertTypeID = #{shopCertTypeId}
+    </select>
+    <select id="getShopById" resultType="com.caimei365.user.model.vo.ShopVo">
+        select * from shop where shopID = #{shopId}
+    </select>
+</mapper>