Parcourir la source

非卡用户可以修改省份,毕业年份,考生类别

mingfu il y a 4 semaines
Parent
commit
c80348884b

+ 7 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java

@@ -1,6 +1,8 @@
 package com.ruoyi.web.controller.system;
 
 import java.util.Map;
+
+import com.ruoyi.enums.UserTypeEnum;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -68,6 +70,11 @@ public class SysProfileController extends BaseController
         currentUser.setEmail(user.getEmail());
         currentUser.setPhonenumber(user.getPhonenumber());
         currentUser.setSex(user.getSex());
+        if(!UserTypeEnum.isCard(user.getUserType())) {
+            currentUser.setLocation(user.getLocation());
+            currentUser.setExamType(user.getExamType());
+            currentUser.setEndYear(user.getEndYear());
+        }
         if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
         {
             return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");

+ 1 - 1
ie-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -244,7 +244,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="location != null and location != ''">location = #{location},</if>
 			<if test="examType != null">exam_type = #{examType},</if>
 			<if test="regStatus != null">reg_status = #{regStatus},</if>
-			<if test="endYear != null and endYear != ''">end_year = #{endYear},</if>
+			<if test="endYear != null">end_year = #{endYear},</if>
 			<if test="inviteCode != null and inviteCode != ''">invite_code = #{inviteCode},</if>
 			<if test="scores != null and scores != ''">scores = #{scores, typeHandler=com.ruoyi.system.handlers.SubjectScoreTypeHandler},</if>
 			<if test="selectSubject != null and selectSubject != ''">select_subject = #{selectSubject},</if>