Browse Source

用户表--资质等级支持设置为null

wangxx 3 weeks ago
parent
commit
50c3c1e558

+ 1 - 4
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerLedgerCertificateInfoServiceImpl.java

@@ -647,10 +647,7 @@ public class LedgerLedgerCertificateInfoServiceImpl implements ILedgerCertificat
647 647
      */
648 648
     private void updateUserQualification(Long userId, String qualificationLevel) {
649 649
         try {
650
-            SysUser user = new SysUser();
651
-            user.setUserId(userId);
652
-            user.setQualificationLevel(qualificationLevel);
653
-            sysUserService.updateUserProfile(user);
650
+            sysUserService.updateUserQualificationLevel(userId, qualificationLevel);
654 651
         } catch (Exception e) {
655 652
             log.error("更新用户资质等级失败, userId={}, level={}", userId, qualificationLevel, e);
656 653
         }

+ 9 - 0
airport-system/src/main/java/com/sundot/airport/system/mapper/SysUserMapper.java

@@ -86,6 +86,15 @@ public interface SysUserMapper {
86 86
     public int updateUser(SysUser user);
87 87
 
88 88
     /**
89
+     * 更新用户资质等级(支持设置为null)
90
+     *
91
+     * @param userId             用户ID
92
+     * @param qualificationLevel 资质等级,可为null
93
+     * @return 结果
94
+     */
95
+    int updateUserQualificationLevel(@Param("userId") Long userId, @Param("qualificationLevel") String qualificationLevel);
96
+
97
+    /**
89 98
      * 修改用户头像
90 99
      *
91 100
      * @param userId 用户ID

+ 9 - 0
airport-system/src/main/java/com/sundot/airport/system/service/ISysUserService.java

@@ -170,6 +170,15 @@ public interface ISysUserService {
170 170
     public int updateUserProfile(SysUser user);
171 171
 
172 172
     /**
173
+     * 更新用户资质等级(支持设置为null)
174
+     *
175
+     * @param userId             用户ID
176
+     * @param qualificationLevel 资质等级,可为null
177
+     * @return 结果
178
+     */
179
+    int updateUserQualificationLevel(Long userId, String qualificationLevel);
180
+
181
+    /**
173 182
      * 修改用户头像
174 183
      *
175 184
      * @param userId 用户ID

+ 8 - 0
airport-system/src/main/java/com/sundot/airport/system/service/impl/SysUserServiceImpl.java

@@ -434,6 +434,14 @@ public class SysUserServiceImpl implements ISysUserService {
434 434
     }
435 435
 
436 436
     /**
437
+     * 更新用户资质等级(支持设置为null)
438
+     */
439
+    @Override
440
+    public int updateUserQualificationLevel(Long userId, String qualificationLevel) {
441
+        return userMapper.updateUserQualificationLevel(userId, qualificationLevel);
442
+    }
443
+
444
+    /**
437 445
      * 修改用户头像
438 446
      *
439 447
      * @param userId 用户ID

+ 7 - 0
airport-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -846,6 +846,13 @@
846 846
         where user_id = #{userId}
847 847
     </update>
848 848
 
849
+    <update id="updateUserQualificationLevel">
850
+        update sys_user
851
+        set qualification_level = #{qualificationLevel},
852
+            update_time = sysdate()
853
+        where user_id = #{userId}
854
+    </update>
855
+
849 856
     <update id="updateUserAvatar" parameterType="SysUser">
850 857
         update sys_user
851 858
         set avatar = #{avatar}