소스 검색

修改资料bugfix

Aslee 4 년 전
부모
커밋
5b6215cdf4

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

@@ -4,6 +4,7 @@ import com.caimei365.user.model.dto.ClubUpdateDto;
 import com.caimei365.user.model.po.UserPo;
 import com.caimei365.user.model.vo.ClubVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * Description

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

@@ -96,9 +96,4 @@ public class ClubUpdateDto implements Serializable {
      * 公司简介(info)
      */
     private String profile;
-    /**
-     * 最后更新时间
-     */
-    private String lastModifyTime;
-
 }

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

@@ -108,14 +108,13 @@ public class ClubServiceImpl implements ClubService {
      */
     @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 ) {
+        if (null != userIdByEmail && !userIdByEmail.equals(club.getUserId()) ) {
             return ResponseJson.error("该邮箱已被使用", null);
         }
         // 邮箱
@@ -128,8 +127,6 @@ public class ClubServiceImpl implements ClubService {
         user.setName(club.getName());
         // 更新机构用户信息
         clubMapper.updateClubUserByUpdateInfo(user);
-        // 最后修改时间
-        club.setLastModifyTime(dateFormat.format(new Date()));
         // 更新机构信息
         clubMapper.updateClubByUpdateInfo(club);
         return ResponseJson.success("修改机构资料成功", club);

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

@@ -69,7 +69,7 @@ public class ShopServiceImpl implements ShopService {
             user.setAuditNoteList(list);
         }
         // 供应商信息
-        ShopVo shop = shopMapper.getShopById(user.getClubId());
+        ShopVo shop = shopMapper.getShopById(user.getShopId());
         if (shop == null) {
             return ResponseJson.error("供应商信息不存在", null);
         }

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

@@ -31,7 +31,7 @@
         <if test="profile != null">
             info = #{profile},
         </if>
-        lastModify = #{lastModifyTime}
+        lastModify = NOW()
         where clubID = #{clubId}
     </update>
     <select id="getClubById" resultType="com.caimei365.user.model.vo.ClubVo">