Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 years ago
parent
commit
09daa9f4fc

+ 3
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/system/UserMapper.java View File

@@ -258,4 +258,7 @@ public interface UserMapper extends TkMapper<TUser> {
258 258
 
259 259
     //批量更新用户信息
260 260
     void batchUpdateUser(@Param("users") List<TUser> users);
261
+
262
+    //更新学生信息
263
+    void updateStudent(@Param("user") TUser user);
261 264
 }

+ 5
- 2
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/ClassStudentService.java View File

@@ -218,6 +218,7 @@ public class ClassStudentService {
218 218
                             throw new Exception("准考证号长度不符合要求");
219 219
                         }
220 220
                     }
221
+                    if (examno.equals("")) examno = null;
221 222
                     stu.setExamno(examno);
222 223
                     Integer userid = user.getUserid();
223 224
                     stu.setUserid(userid);
@@ -310,6 +311,7 @@ public class ClassStudentService {
310 311
         user.setLoginpwd(N_Utils.getMD5Pwd("123456"));
311 312
         user.setUsersex(model.getUsersex());
312 313
         user.setStudentno(model.getStudentno());
314
+        if (examno.equals("")) examno = null;
313 315
         user.setExamno(examno);
314 316
         user.setCreateid(model.getCreateid());
315 317
         user.setSchoolid(schoolid);
@@ -396,7 +398,7 @@ public class ClassStudentService {
396 398
         }
397 399
         String examno = model.getExamno();
398 400
         if (N_Utils.isNotEmpty(examno)) {
399
-            TSchool school = schoolMapper.getSchoolInfoById(u.getSchoolid());
401
+            TSchool school = schoolMapper.getSchoolInfoByUserid(model.getStudentid());
400 402
             Integer limitenolen = school.getLimitenolen();
401 403
             if (!N_Utils.isEmptyInteger(limitenolen) && !limitenolen.equals(examno.length())) {
402 404
                 return new ResultVo(1, "准考证号长度不符合要求");
@@ -408,6 +410,7 @@ public class ClassStudentService {
408 410
         user.setUsersex(model.getUsersex());
409 411
         user.setUsername(model.getStudentname());
410 412
         user.setStudentno(model.getStudentno());
413
+        if (examno.equals("")) examno = null;
411 414
         user.setExamno(examno);
412 415
         user.setLoginname(model.getStudentno());
413 416
         user.setUserphone(model.getUserphone());
@@ -429,7 +432,7 @@ public class ClassStudentService {
429 432
             user.setUsertime(null);
430 433
         }
431 434
         user.setCreatetime(N_Utils.getSecondTimestamp());
432
-        userMapper.updateByPrimaryKeySelective(user);
435
+        userMapper.updateStudent(user);
433 436
         return new ResultVo(0, "修改成功");
434 437
     }
435 438
 

+ 2
- 2
suser/src/main/resources/mapper/gradeclass/SchoolMapper.xml View File

@@ -17,11 +17,11 @@
17 17
 
18 18
     <!--更加用户id获取当前学校id和年份-->
19 19
     <select id="getSchoolInfoByUserid" resultType="com.xhkjedu.suser.model.gradeclass.TSchool">
20
-        select s.schoolid,s.year from t_user u left join t_school s on u.schoolid=s.schoolid
20
+        select s.schoolid,s.year,limitenolen from t_user u left join t_school s on u.schoolid=s.schoolid
21 21
         where u.userid=#{userid}
22 22
     </select>
23 23
     <!--获取学校基本信息-->
24 24
     <select id="getSchoolInfoById" resultType="com.xhkjedu.suser.model.gradeclass.TSchool">
25
-        select usernum,limitenolen from t_school where schoolid=#{schoolid}
25
+        select usernum,limitenolen,schoolname from t_school where schoolid=#{schoolid}
26 26
     </select>
27 27
 </mapper>

+ 8
- 0
suser/src/main/resources/mapper/system/UserMapper.xml View File

@@ -298,4 +298,12 @@
298 298
             where userid=#{u.userid}
299 299
         </foreach>
300 300
     </update>
301
+    <!--更新学生信息-->
302
+    <update id="updateStudent">
303
+        update t_user set username=#{user.username},loginname=#{user.loginname},studentno=#{user.studentno},examno=#{user.examno}
304
+        ,usertime =#{user.usertime},createtime=#{user.createtime},usersex=#{user.usersex}
305
+        <if test="user.userphone!=null and user.userphone!=''">,userphone =#{user.userphone}</if>
306
+        <if test="user.bindphoned!=null">,bindphoned =#{user.bindphoned}</if>
307
+        where userid=#{user.userid}
308
+    </update>
301 309
 </mapper>

Loading…
Cancel
Save