Procházet zdrojové kódy

教师基本信息中班级添加年份

tags/正式3.2.0
王宁 před 2 roky
rodič
revize
96fd43248f

+ 111
- 90
suser/src/main/java/com/xhkjedu/suser/controller/system/UserController.java Zobrazit soubor

@@ -4,10 +4,10 @@ import com.alibaba.fastjson.JSON;
4 4
 import com.xhkjedu.suser.model.system.TUser;
5 5
 import com.xhkjedu.suser.service.system.UserService;
6 6
 import com.xhkjedu.suser.utils.UserUtil;
7
-import com.xhkjedu.utils.N_Utils;
8
-import com.xhkjedu.vo.ResultVo;
9 7
 import com.xhkjedu.suser.vo.assess.AssessParams;
10 8
 import com.xhkjedu.suser.vo.system.TeacherVo;
9
+import com.xhkjedu.utils.N_Utils;
10
+import com.xhkjedu.vo.ResultVo;
11 11
 import org.springframework.beans.factory.annotation.Autowired;
12 12
 import org.springframework.beans.factory.annotation.Value;
13 13
 import org.springframework.util.LinkedMultiValueMap;
@@ -37,159 +37,170 @@ public class UserController {
37 37
     private String ssourl;
38 38
 
39 39
     /**
40
-     *功能描述 登录接口--非学生
40
+     * 功能描述 登录接口--非学生
41
+     *
42
+     * @param * @param user
43
+     * @return com.xhkjedu.vo.ResultVo
41 44
      * @author WN
42 45
      * @date 2020/6/1
43
-     * @param  * @param user
44
-     * @return com.xhkjedu.vo.ResultVo
45 46
      */
46 47
     @PostMapping("/login")
47
-    public ResultVo login(@RequestBody TUser user,HttpServletRequest request){
48
+    public ResultVo login(@RequestBody TUser user, HttpServletRequest request) {
48 49
 //        if (N_Utils.isEmpty(user.getUltype())) return new ResultVo(1,"请更新新版本");
49
-        N_Utils.validation(new Object[]{user.getLoginname(),"登录名",2,user.getLoginpwd(),"登录密码",2});
50
+        N_Utils.validation(new Object[]{user.getLoginname(), "登录名", 2, user.getLoginpwd(), "登录密码", 2});
50 51
         if (user.getLoginname().length() > 18) return new ResultVo(1, "账号长度超过18个字符");
51 52
         Integer usertype = user.getUsertype();
52 53
         if (usertype != null && usertype == 2) {//学生登录
53 54
             return userService.loginStudent(user, request);
54 55
         } else {//教师、管理员登录
55
-            return userService.getUserByLoginnameAndPwd(user,request);
56
+            return userService.getUserByLoginnameAndPwd(user, request);
56 57
         }
57 58
     }
58 59
 
59 60
     //教师登录
60 61
     @PostMapping("/login_teacher")
61
-    public ResultVo loginTeacher(@RequestBody TUser user,HttpServletRequest request){
62
+    public ResultVo loginTeacher(@RequestBody TUser user, HttpServletRequest request) {
62 63
 //        if (N_Utils.isEmpty(user.getUltype())) return new ResultVo(1,"请更新新版本");
63
-        N_Utils.validation(new Object[]{user.getLoginname(),"登录名",2,user.getLoginpwd(),"登录密码",2});
64
+        N_Utils.validation(new Object[]{user.getLoginname(), "登录名", 2, user.getLoginpwd(), "登录密码", 2});
64 65
         if (user.getLoginname().length() > 18) return new ResultVo(1, "账号长度超过18个字符");
65
-        return userService.loginTeacher(user,request);
66
+        return userService.loginTeacher(user, request);
66 67
     }
67 68
 
68 69
     /**
69
-     *功能描述  登录--学生登录
70
+     * 功能描述  登录--学生登录
71
+     *
72
+     * @param * @param user
73
+     * @return com.xhkjedu.vo.ResultVo
70 74
      * @author WN
71 75
      * @date 2020/6/1
72
-     * @param  * @param user
73
-     * @return com.xhkjedu.vo.ResultVo
74 76
      */
75 77
     @PostMapping("/loginstu")
76
-    public ResultVo loginStudent(@RequestBody TUser user,HttpServletRequest request){
77
-        N_Utils.validation(new Object[]{user.getLoginname(),"登录名",2,user.getLoginpwd(),"登录密码",2});
78
+    public ResultVo loginStudent(@RequestBody TUser user, HttpServletRequest request) {
79
+        N_Utils.validation(new Object[]{user.getLoginname(), "登录名", 2, user.getLoginpwd(), "登录密码", 2});
78 80
         if (user.getLoginname().length() > 18) return new ResultVo(1, "账号长度超过18个字符");
79
-        return userService.loginStudent(user,request);
81
+        return userService.loginStudent(user, request);
80 82
     }
81 83
 
82 84
     /**
83 85
      * 添加用户信息
86
+     *
87
+     * @return com.xhkjedu.vo.ResultVo
84 88
      * @Param [user]
85 89
      * @Author ywx
86 90
      * @Date 2020/6/2 9:44
87
-     * @return com.xhkjedu.vo.ResultVo
88 91
      **/
89 92
     @PostMapping("/add")
90
-    public ResultVo add(@RequestBody TUser user){
93
+    public ResultVo add(@RequestBody TUser user) {
91 94
         return userService.save(user);
92 95
     }
93 96
 
94 97
     /**
95 98
      * 修改用户信息
99
+     *
100
+     * @return com.xhkjedu.vo.ResultVo
96 101
      * @Param [user]
97 102
      * @Author ywx
98 103
      * @Date 2020/6/2 9:51
99
-     * @return com.xhkjedu.vo.ResultVo
100 104
      **/
101 105
     @PostMapping("/update")
102
-    public ResultVo update(@RequestBody TUser user){
103
-        N_Utils.validation(new Object[]{user.getUserid(),"用户id",1});
106
+    public ResultVo update(@RequestBody TUser user) {
107
+        N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1});
104 108
         return userService.update(user);
105 109
     }
106 110
 
107 111
     /**
108 112
      * 删除用户
113
+     *
114
+     * @return com.xhkjedu.vo.ResultVo
109 115
      * @Param [user]
110 116
      * @Author ywx
111 117
      * @Date 2020/6/2 9:59
112
-     * @return com.xhkjedu.vo.ResultVo
113 118
      **/
114 119
     @PostMapping("/delete")
115
-    public ResultVo delete(@RequestBody TUser user){
116
-        N_Utils.validation(new Object[]{user.getUserid(),"用户id",1,user.getDeleteid(),"删除人id",1});
120
+    public ResultVo delete(@RequestBody TUser user) {
121
+        N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1, user.getDeleteid(), "删除人id", 1});
117 122
         return userService.deleteById(user);
118 123
     }
119 124
 
120 125
     /**
121 126
      * 获取用户列表
127
+     *
128
+     * @return com.xhkjedu.vo.ResultVo
122 129
      * @Param [user]
123 130
      * @Author ywx
124 131
      * @Date 2020/6/2 10:06
125
-     * @return com.xhkjedu.vo.ResultVo
126 132
      **/
127 133
     @PostMapping("/list")
128
-    public ResultVo list(@RequestBody TUser user){
129
-        N_Utils.validation(new Object[]{user.getPage(),"显示页码",1,user.getPageSize(),"显示条数",1,user.getSchoolid(),"学校id",1});
134
+    public ResultVo list(@RequestBody TUser user) {
135
+        N_Utils.validation(new Object[]{user.getPage(), "显示页码", 1, user.getPageSize(), "显示条数", 1, user.getSchoolid(), "学校id", 1});
130 136
         return userService.findAll(user);
131 137
     }
132 138
 
133 139
     /**
134 140
      * 获取用户详情
141
+     *
142
+     * @return com.xhkjedu.vo.ResultVo
135 143
      * @Param [user]
136 144
      * @Author ywx
137 145
      * @Date 2020/6/2 10:23
138
-     * @return com.xhkjedu.vo.ResultVo
139 146
      **/
140 147
     @PostMapping("/detail")
141
-    public ResultVo detail(@RequestBody TUser user){
148
+    public ResultVo detail(@RequestBody TUser user) {
142 149
         Integer userid = user.getUserid();
143
-        N_Utils.validation(new Object[]{userid,"用户id",1});
150
+        N_Utils.validation(new Object[]{userid, "用户id", 1});
144 151
         return userService.findById(userid);
145 152
     }
146 153
 
147 154
     /**
148 155
      * 修改用户密码
156
+     *
157
+     * @return com.xhkjedu.vo.ResultVo
149 158
      * @Param [user]
150 159
      * @Author ywx
151 160
      * @Date 2020/6/2 10:30
152
-     * @return com.xhkjedu.vo.ResultVo
153 161
      **/
154 162
     @PostMapping("/update_pwd")
155
-    public ResultVo updatePwd(@RequestBody TUser user){
156
-        N_Utils.validation(new Object[]{user.getUserid(),"用户id",1,user.getOldpwd(),"原密码",2,user.getLoginpwd(),"新密码",2});
163
+    public ResultVo updatePwd(@RequestBody TUser user) {
164
+        N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1, user.getOldpwd(), "原密码", 2, user.getLoginpwd(), "新密码", 2});
157 165
         return userService.updatePwd(user);
158 166
     }
159 167
 
160 168
     /**
161 169
      * 修改用户头像
170
+     *
171
+     * @return com.xhkjedu.vo.ResultVo
162 172
      * @Param [user]
163 173
      * @Author ywx
164 174
      * @Date 2020/6/2 10:37
165
-     * @return com.xhkjedu.vo.ResultVo
166 175
      **/
167 176
     @PostMapping("/update_headpic")
168
-    public ResultVo updateHeadPic(@RequestBody TUser user){
169
-        N_Utils.validation(new Object[]{user.getUserid(),"用户id",1});
177
+    public ResultVo updateHeadPic(@RequestBody TUser user) {
178
+        N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1});
170 179
         return userService.updateHeadPic(user);
171 180
     }
172 181
 
173 182
     /**
174 183
      * 检查登录账号是否存在
184
+     *
185
+     * @return com.xhkjedu.vo.ResultVo
175 186
      * @Param [user]
176 187
      * @Author ywx
177 188
      * @Date 2020/6/2 10:43
178
-     * @return com.xhkjedu.vo.ResultVo
179 189
      **/
180 190
     @PostMapping("/check_loginname")
181
-    public ResultVo checkLoginName(@RequestBody TUser user){
191
+    public ResultVo checkLoginName(@RequestBody TUser user) {
182 192
         String loginname = user.getLoginname();
183
-        N_Utils.validation(new Object[]{loginname,"登录名",2});
193
+        N_Utils.validation(new Object[]{loginname, "登录名", 2});
184 194
         return userService.checkLoginName(loginname);
185 195
     }
186 196
 
187 197
     /**
188 198
      * 导入教师
199
+     *
200
+     * @return com.xhkjedu.vo.ResultVo
189 201
      * @Param [file, user]
190 202
      * @Author ywx
191 203
      * @Date 2020/6/5 8:42
192
-     * @return com.xhkjedu.vo.ResultVo
193 204
      **/
194 205
     @PostMapping("/import_teacher")
195 206
     public ResultVo importTeacher(MultipartFile file, TUser user) {
@@ -197,152 +208,161 @@ public class UserController {
197 208
     }
198 209
 
199 210
     /**
200
-     *功能描述  设置操作密码
211
+     * 功能描述  设置操作密码
212
+     *
213
+     * @param * @param user
214
+     * @return com.xhkjedu.vo.ResultVo
201 215
      * @author WN
202 216
      * @date 2020/6/17
203
-     * @param  * @param user
204
-     * @return com.xhkjedu.vo.ResultVo
205 217
      */
206 218
     @PostMapping("/update_opepass")
207
-    public ResultVo updateOpepass(@RequestBody TUser user){
219
+    public ResultVo updateOpepass(@RequestBody TUser user) {
208 220
         N_Utils.validation(new Object[]{
209
-                user.getUserid(),"用户id",1,
210
-                user.getOpepassword(),"操作密码",2
221
+                user.getUserid(), "用户id", 1,
222
+                user.getOpepassword(), "操作密码", 2
211 223
         });
212 224
         userService.updateOpepasswordByUserId(user);
213
-        return new ResultVo(0,"设置操作密码成功");
225
+        return new ResultVo(0, "设置操作密码成功");
214 226
     }
215 227
 
216 228
     /**
217
-     *功能描述  验证操作密码是否正确
229
+     * 功能描述  验证操作密码是否正确
230
+     *
231
+     * @param * @param user
232
+     * @return com.xhkjedu.vo.ResultVo
218 233
      * @author WN
219 234
      * @date 2020/6/17
220
-     * @param  * @param user
221
-     * @return com.xhkjedu.vo.ResultVo
222 235
      */
223 236
     @PostMapping("/validate_opepass")
224
-    public ResultVo validateOpepass(@RequestBody TUser user){
237
+    public ResultVo validateOpepass(@RequestBody TUser user) {
225 238
         N_Utils.validation(new Object[]{
226
-                user.getUserid(),"用户id",1,
227
-                user.getOpepassword(),"操作密码",2
239
+                user.getUserid(), "用户id", 1,
240
+                user.getOpepassword(), "操作密码", 2
228 241
         });
229 242
         Integer result = userService.getUserIdByOpepassword(user);
230
-        if(result==1){
231
-            return new ResultVo(0,"操作密码验证成功");
232
-        }else{
233
-            return new ResultVo(1,"操作密码输入有误");
243
+        if (result == 1) {
244
+            return new ResultVo(0, "操作密码验证成功");
245
+        } else {
246
+            return new ResultVo(1, "操作密码输入有误");
234 247
         }
235 248
 
236 249
     }
237 250
 
238 251
     /**
239 252
      * 教师基本信息
253
+     *
254
+     * @return com.xhkjedu.vo.ResultVo
240 255
      * @Param [user]
241 256
      * @Author ywx
242 257
      * @Date 2020/6/29 16:23
243
-     * @return com.xhkjedu.vo.ResultVo
244 258
      **/
245 259
     @PostMapping("/teacher_info")
246
-    public ResultVo teacherInfo(@RequestBody TUser user){
260
+    public ResultVo teacherInfo(@RequestBody TUser user) {
247 261
         Integer userid = user.getUserid();
248
-        N_Utils.validation(new Object[]{userid,"用户id",1});
249
-        TeacherVo teacherVo = userService.getTeacherInfo(userid, user.getClasstype());
250
-        return new ResultVo(0,"获取教师基本信息成功",teacherVo);
262
+        N_Utils.validation(new Object[]{userid, "用户id", 1, user.getSchoolid(), "学校id", 1});
263
+        TeacherVo teacherVo = userService.getTeacherInfo(user.getSchoolid(), userid, user.getClasstype());
264
+        return new ResultVo(0, "获取教师基本信息成功", teacherVo);
251 265
     }
252 266
 
253 267
     /**
254 268
      * 重置密码
269
+     *
270
+     * @return com.xhkjedu.vo.ResultVo
255 271
      * @Param [user]
256 272
      * @Author ywx
257 273
      * @Date 2020/7/30 14:25
258
-     * @return com.xhkjedu.vo.ResultVo
259 274
      **/
260 275
     @PostMapping("/reset_pwd")
261
-    public ResultVo resetPwd(@RequestBody TUser user){
262
-        N_Utils.validation(new Object[]{user.getUserid(),"用户id",1,user.getLoginpwd(),"密码",2});
276
+    public ResultVo resetPwd(@RequestBody TUser user) {
277
+        N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1, user.getLoginpwd(), "密码", 2});
263 278
         return userService.resetPwd(user);
264 279
     }
265 280
 
266 281
     /**
267 282
      * 生成修改码
283
+     *
284
+     * @return com.xhkjedu.vo.ResultVo
268 285
      * @Param [user]
269 286
      * @Author ywx
270 287
      * @Date 2020/10/13 15:08
271
-     * @return com.xhkjedu.vo.ResultVo
272 288
      **/
273 289
     @PostMapping("/update_code")
274 290
     public ResultVo updateCode(@RequestBody TUser user) {
275 291
         String userphone = user.getUserphone();
276
-        N_Utils.validation(new Object[]{userphone,"手机号",2});
292
+        N_Utils.validation(new Object[]{userphone, "手机号", 2});
277 293
         return userService.updateCode(userphone);
278 294
     }
279 295
 
280 296
     /**
281 297
      * 通过短信修改密码
298
+     *
299
+     * @return com.xhkjedu.vo.ResultVo
282 300
      * @Param [user]
283 301
      * @Author ywx
284 302
      * @Date 2020/10/13 15:12
285
-     * @return com.xhkjedu.vo.ResultVo
286 303
      **/
287 304
     @PostMapping("/update_pwd_byCode")
288 305
     public ResultVo updatePwdByCode(@RequestBody TUser user) {
289 306
         String userphone = user.getUserphone();
290 307
         String loginpwd = user.getLoginpwd();
291 308
         Integer msgcode = user.getMsgcode();
292
-        N_Utils.validation(new Object[]{userphone,"手机号",2,loginpwd,"密码",2,msgcode,"验证码",1});
309
+        N_Utils.validation(new Object[]{userphone, "手机号", 2, loginpwd, "密码", 2, msgcode, "验证码", 1});
293 310
         return userService.updatePwdByCode(user);
294 311
     }
295 312
 
296 313
     /**
297 314
      * 生成登录确认码
315
+     *
316
+     * @return com.xhkjedu.vo.ResultVo
298 317
      * @Param [user]
299 318
      * @Author ywx
300 319
      * @Date 2020/10/13 15:18
301
-     * @return com.xhkjedu.vo.ResultVo
302 320
      **/
303 321
     @PostMapping("/login_code")
304 322
     public ResultVo loginCode(@RequestBody TUser user) {
305 323
         String userphone = user.getUserphone();
306
-        N_Utils.validation(new Object[]{userphone,"手机号",2});
324
+        N_Utils.validation(new Object[]{userphone, "手机号", 2});
307 325
         return userService.loginCode(userphone);
308 326
     }
309 327
 
310 328
     /**
311 329
      * 验证码登录
330
+     *
331
+     * @return com.xhkjedu.vo.ResultVo
312 332
      * @Param [user]
313 333
      * @Author ywx
314 334
      * @Date 2020/10/13 15:35
315
-     * @return com.xhkjedu.vo.ResultVo
316 335
      **/
317 336
     @PostMapping("/login_byCode")
318
-    public ResultVo loginByCode(@RequestBody TUser user,HttpServletRequest request) {
319
-        if (N_Utils.isEmpty(user.getUltype())) return new ResultVo(1,"请更新新版本");
337
+    public ResultVo loginByCode(@RequestBody TUser user, HttpServletRequest request) {
338
+        if (N_Utils.isEmpty(user.getUltype())) return new ResultVo(1, "请更新新版本");
320 339
         String userphone = user.getUserphone();
321 340
         Integer msgcode = user.getMsgcode();
322
-        N_Utils.validation(new Object[]{userphone,"手机号",2,msgcode,"验证码",1});
341
+        N_Utils.validation(new Object[]{userphone, "手机号", 2, msgcode, "验证码", 1});
323 342
         return userService.loginByCode(user, request);
324 343
     }
325 344
 
326 345
     /**
327 346
      * 批量修改用户密码
347
+     *
348
+     * @return com.xhkjedu.vo.ResultVo
328 349
      * @Param [user]
329 350
      * @Author ywx
330 351
      * @Date 2020/10/30 16:04
331
-     * @return com.xhkjedu.vo.ResultVo
332 352
      **/
333 353
     @PostMapping("/batch_update_pwd")
334
-    public ResultVo batchUpdatePwd(@RequestBody TUser user){
335
-        N_Utils.validation(new Object[]{user.getSchoolid(),"学校id",1,user.getLoginpwd(),"新密码",2});
336
-        if (N_Utils.isListEmpty(user.getUsertypes())) return new ResultVo(1,"用户类型集合不能为空");
354
+    public ResultVo batchUpdatePwd(@RequestBody TUser user) {
355
+        N_Utils.validation(new Object[]{user.getSchoolid(), "学校id", 1, user.getLoginpwd(), "新密码", 2});
356
+        if (N_Utils.isListEmpty(user.getUsertypes())) return new ResultVo(1, "用户类型集合不能为空");
337 357
         return userService.batchUpdatePwd(user);
338 358
     }
339 359
 
340 360
     //校验登录状态成功
341 361
     @PostMapping("/check_login")
342
-    public ResultVo checkLogin(@RequestBody TUser user){
362
+    public ResultVo checkLogin(@RequestBody TUser user) {
343 363
         Integer userid = user.getUserid();
344 364
         String loginpwd = user.getLoginpwd();
345
-        N_Utils.validation(new Object[]{userid,"用户id",1,loginpwd,"登录密码",2});
365
+        N_Utils.validation(new Object[]{userid, "用户id", 1, loginpwd, "登录密码", 2});
346 366
         return userService.checkLogin(userid, loginpwd);
347 367
     }
348 368
 
@@ -357,30 +377,31 @@ public class UserController {
357 377
 
358 378
     /**
359 379
      * 用户名登录
380
+     *
381
+     * @return com.xhkjedu.vo.ResultVo
360 382
      * @Param [user, request]
361 383
      * @Author ywx
362 384
      * @Date 2021/11/18 9:52
363
-     * @return com.xhkjedu.vo.ResultVo
364 385
      **/
365 386
     @PostMapping("/login_byName")
366
-    public ResultVo loginByName(@RequestBody TUser user,HttpServletRequest request) {
387
+    public ResultVo loginByName(@RequestBody TUser user, HttpServletRequest request) {
367 388
         String loginname = user.getLoginname();
368
-        N_Utils.validation(new Object[]{loginname,"token",2});
389
+        N_Utils.validation(new Object[]{loginname, "token", 2});
369 390
         MultiValueMap<String, String> param = new LinkedMultiValueMap<>();
370
-        param.add("token",loginname);
391
+        param.add("token", loginname);
371 392
         String str = UserUtil.sendFormData(ssourl, param);
372 393
         ResultVo result = JSON.parseObject(str, ResultVo.class);
373 394
         if (result.getCode() != 0) return result;
374
-        Map map = JSON.parseObject(result.getObj().toString(),Map.class);
395
+        Map map = JSON.parseObject(result.getObj().toString(), Map.class);
375 396
         user.setLoginname(map.get("loginname").toString());
376 397
         return userService.loginByName(user, request);
377 398
     }
378 399
 
379 400
     @PostMapping("/get_headtime")
380
-    public ResultVo getHeadTime(@RequestBody TUser user){
401
+    public ResultVo getHeadTime(@RequestBody TUser user) {
381 402
         Integer userid = user.getUserid();
382
-        N_Utils.validation(new Object[]{userid,"用户id",1});
403
+        N_Utils.validation(new Object[]{userid, "用户id", 1});
383 404
         Integer headtime = userService.getHeadTime(userid);
384
-        return new ResultVo(0,"获取头像是否可以修改成功",headtime);
405
+        return new ResultVo(0, "获取头像是否可以修改成功", headtime);
385 406
     }
386 407
 }

+ 44
- 28
suser/src/main/java/com/xhkjedu/suser/mapper/system/UserMapper.java Zobrazit soubor

@@ -21,148 +21,164 @@ import java.util.Map;
21 21
 public interface UserMapper extends TkMapper<TUser> {
22 22
 
23 23
     /**
24
-     *功能描述  根据帐号密码获取用户
24
+     * 功能描述  根据帐号密码获取用户
25
+     *
26
+     * @param * @param loginname
27
+     * @return com.xhkjedu.model.system.TUser
25 28
      * @author WN
26 29
      * @date 2020/5/29
27
-     * @param  * @param loginname
28
-     * @return com.xhkjedu.model.system.TUser
29 30
      */
30 31
     UserVo getUserByLoginname(String loginname);
31 32
 
32 33
     /**
33 34
      * 删除用户
35
+     *
36
+     * @return java.lang.Integer
34 37
      * @Param [user]
35 38
      * @Author ywx
36 39
      * @Date 2020/6/2 9:59
37
-     * @return java.lang.Integer
38 40
      **/
39 41
     Integer deleteById(@Param("user") TUser user);
40 42
 
41 43
     /**
42 44
      * 获取用户列表
45
+     *
46
+     * @return java.util.List<com.xhkjedu.suser.vo.system.UserVo>
43 47
      * @Param [user]
44 48
      * @Author ywx
45 49
      * @Date 2020/6/2 10:07
46
-     * @return java.util.List<com.xhkjedu.suser.vo.system.UserVo>
47 50
      **/
48 51
     List<UserVo> findAll(@Param("user") TUser user);
49 52
 
50 53
     /**
51 54
      * 获取用户详情
55
+     *
56
+     * @return com.xhkjedu.suser.vo.system.UserVo
52 57
      * @Param [userid]
53 58
      * @Author ywx
54 59
      * @Date 2020/6/2 10:23
55
-     * @return com.xhkjedu.suser.vo.system.UserVo
56 60
      **/
57 61
     UserVo findById(@Param("userid") Integer userid);
58 62
 
59 63
     /**
60 64
      * 修改用户密码
65
+     *
66
+     * @return java.lang.Integer
61 67
      * @Param [user]
62 68
      * @Author ywx
63 69
      * @Date 2020/6/2 10:30
64
-     * @return java.lang.Integer
65 70
      **/
66 71
     Integer updatePwd(@Param("user") TUser user);
67 72
 
68 73
     /**
69 74
      * 修改用户头像
75
+     *
76
+     * @return java.lang.Integer
70 77
      * @Param [user]
71 78
      * @Author ywx
72 79
      * @Date 2020/6/2 10:36
73
-     * @return java.lang.Integer
74 80
      **/
75 81
     Integer updateHeadPic(@Param("user") TUser user);
76 82
 
77 83
     /**
78 84
      * 检查登录账号是否存在
85
+     *
86
+     * @return java.lang.Integer
79 87
      * @Param [loginname]
80 88
      * @Author ywx
81 89
      * @Date 2020/6/2 10:44
82
-     * @return java.lang.Integer
83 90
      **/
84 91
     Integer checkLoginName(@Param("loginname") String loginname);
85 92
 
86 93
     /**
87 94
      * 根据登录账号获取用户详情
95
+     *
96
+     * @return com.xhkjedu.model.system.TUser
88 97
      * @Param [loginname]
89 98
      * @Author ywx
90 99
      * @Date 2020/6/3 9:33
91
-     * @return com.xhkjedu.model.system.TUser
92 100
      **/
93 101
     TUser getObjByLoginName(@Param("loginname") String loginname);
94 102
 
95 103
     /**
96 104
      * 修改用户状态
105
+     *
106
+     * @return void
97 107
      * @Param [userid, userstate]
98 108
      * @Author ywx
99 109
      * @Date 2020/6/4 9:08
100
-     * @return void
101 110
      **/
102
-    void updateState(@Param("userid") Integer userid,@Param("userstate") int userstate);
111
+    void updateState(@Param("userid") Integer userid, @Param("userstate") int userstate);
103 112
 
104 113
     /**
105
-     *功能描述 设置操作密码
106
-     * @author WN
107
-     * @date 2020/6/17
108
-     * @param  * @param userid
114
+     * 功能描述 设置操作密码
115
+     *
116
+     * @param *           @param userid
109 117
      * @param opepassword
110 118
      * @return void
119
+     * @author WN
120
+     * @date 2020/6/17
111 121
      */
112
-    void updateOpepasswordByUserId(@Param("userid") Integer userid,@Param("opepassword") String opepassword);
122
+    void updateOpepasswordByUserId(@Param("userid") Integer userid, @Param("opepassword") String opepassword);
113 123
 
114 124
     /**
115
-     *功能描述 验证用户操作密码是否正确
116
-     * @author WN
117
-     * @date 2020/6/17
118
-     * @param  * @param userid
125
+     * 功能描述 验证用户操作密码是否正确
126
+     *
127
+     * @param *           @param userid
119 128
      * @param opepassword
120 129
      * @return java.lang.Integer
130
+     * @author WN
131
+     * @date 2020/6/17
121 132
      */
122
-    Integer getUserIdByOpepassword(@Param("userid") Integer userid,@Param("opepassword") String opepassword);
133
+    Integer getUserIdByOpepassword(@Param("userid") Integer userid, @Param("opepassword") String opepassword);
123 134
 
124 135
     /**
125 136
      * 教师基本信息
137
+     *
138
+     * @return com.xhkjedu.suser.vo.system.TeacherVo
126 139
      * @Param [userid]
127 140
      * @Author ywx
128 141
      * @Date 2020/6/29 16:24
129
-     * @return com.xhkjedu.suser.vo.system.TeacherVo
130 142
      **/
131
-    TeacherVo getTeacherInfo(Integer userid, Integer classtype);
143
+    TeacherVo getTeacherInfo(Integer userid, Integer classtype, Integer year);
132 144
 
133 145
     /**
134 146
      * 更新学生硬件绑定信息
147
+     *
148
+     * @return void
135 149
      * @Param [user]
136 150
      * @Author ywx
137 151
      * @Date 2020/9/18 11:38
138
-     * @return void
139 152
      **/
140 153
     void updateBindMac(@Param("user") UserVo user);
141 154
 
142 155
     /**
143 156
      * 根据登录账号和硬件地址获取用户信息
157
+     *
158
+     * @return com.xhkjedu.suser.vo.system.UserVo
144 159
      * @Param [loginname, mac]
145 160
      * @Author ywx
146 161
      * @Date 2020/9/21 16:17
147
-     * @return com.xhkjedu.suser.vo.system.UserVo
148 162
      **/
149 163
     UserVo getUserByLoginnameMac(String loginname, String mac);
150 164
 
151 165
     /**
152 166
      * 通过短信修改密码
167
+     *
168
+     * @return void
153 169
      * @Param [user]
154 170
      * @Author ywx
155 171
      * @Date 2020/10/13 15:17
156
-     * @return void
157 172
      **/
158 173
     void updatePwdByCode(@Param("user") TUser user);
159 174
 
160 175
     /**
161 176
      * 批量修改用户密码
177
+     *
178
+     * @return void
162 179
      * @Param [user]
163 180
      * @Author ywx
164 181
      * @Date 2020/10/30 16:04
165
-     * @return void
166 182
      **/
167 183
     void batchUpdatePwd(@Param("user") TUser user);
168 184
 

+ 9
- 8
suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java Zobrazit soubor

@@ -459,16 +459,16 @@ public class UserService extends JedisUtil {
459 459
         Integer createid = tUser.getCreateid();
460 460
         N_Utils.validation(new Object[]{schoolid, "学校id", 1, createid, "创建人id", 1});
461 461
         try {
462
-            Map<Integer, Map<String,Integer>> gclasses = new HashMap<>();//年级下班级集合
462
+            Map<Integer, Map<String, Integer>> gclasses = new HashMap<>();//年级下班级集合
463 463
             List<Map> classes = classMapper.listClass(schoolid, 1);
464
-            Map<Integer, List<Map>> grades = classes.stream().collect(Collectors.groupingBy(c->(Integer) c.get("gradeid")));
464
+            Map<Integer, List<Map>> grades = classes.stream().collect(Collectors.groupingBy(c -> (Integer) c.get("gradeid")));
465 465
             for (Map.Entry<Integer, List<Map>> g : grades.entrySet()) {
466
-                Map<String,Integer> cmap = new HashMap<>();
466
+                Map<String, Integer> cmap = new HashMap<>();
467 467
                 List<Map> list = g.getValue();
468 468
                 for (Map m : list) {
469
-                    cmap.put(m.get("classname").toString(),(Integer) m.get("classid"));
469
+                    cmap.put(m.get("classname").toString(), (Integer) m.get("classid"));
470 470
                 }
471
-                gclasses.put(g.getKey(),cmap);
471
+                gclasses.put(g.getKey(), cmap);
472 472
             }
473 473
 
474 474
             Map<String, Object> map = PoiUtils.readExcelTeacher(file, gclasses);
@@ -500,7 +500,7 @@ public class UserService extends JedisUtil {
500 500
                 //处理用户班级
501 501
                 //先删除任教班级
502 502
                 Integer year = schoolMapper.getYearById(schoolid);
503
-                classTeacherMapper.deleteByUserid(userid,year);
503
+                classTeacherMapper.deleteByUserid(userid, year);
504 504
 
505 505
                 Integer grageid = user.getGrageid();
506 506
                 if (N_Utils.isEmptyInteger(grageid)) continue;//年级为空处理下一条数据
@@ -575,8 +575,9 @@ public class UserService extends JedisUtil {
575 575
      * @Author ywx
576 576
      * @Date 2020/6/29 16:23
577 577
      **/
578
-    public TeacherVo getTeacherInfo(Integer userid, Integer classtype) {
579
-        return userMapper.getTeacherInfo(userid, classtype);
578
+    public TeacherVo getTeacherInfo(Integer schoolid, Integer userid, Integer classtype) {
579
+        Integer year = schoolMapper.getYearById(schoolid);
580
+        return userMapper.getTeacherInfo(userid, classtype, year);
580 581
     }
581 582
 
582 583
     /**

+ 3
- 3
suser/src/main/resources/mapper/system/UserMapper.xml Zobrazit soubor

@@ -90,7 +90,7 @@
90 90
         <result property="headpic" column="headpic"></result>
91 91
         <result property="subjectname" column="subjectname"></result>
92 92
         <collection property="classlist" ofType="com.xhkjedu.suser.vo.gradeclass.ClassVo"
93
-                    javaType="java.util.List" select="listTeacherClass" column="{userid=userid,classtype=classtype}">
93
+                    javaType="java.util.List" select="listTeacherClass" column="{userid=userid,classtype=classtype,year=year}">
94 94
         </collection>
95 95
     </resultMap>
96 96
 
@@ -103,7 +103,7 @@
103 103
     <select id="listTeacherClass" resultMap="teacherClass">
104 104
         select c.classid,c.classname,c.gradeid from t_class c
105 105
         left join t_class_teacher ct on c.classid=ct.classid
106
-        where ct.teacherid=#{userid} and c.classstate=1
106
+        where ct.teacherid=#{userid} and c.classstate=1 and c.year=#{year}
107 107
         <if test="classtype!=null and classtype!=0">
108 108
             <if test="classtype!=11">and c.classtype=#{classtype}</if>
109 109
             <if test="classtype==11">and c.classtype in(1,2)</if>
@@ -117,7 +117,7 @@
117 117
     <!--教师基本信息-->
118 118
     <select id="getTeacherInfo" resultMap="teacherInfoMap">
119 119
         select u.userid,u.username,u.headpic,group_concat(distinct s.subjectname order by s.subjectorder)subjectname
120
-        ,#{classtype} classtype,u.usertime
120
+        ,#{classtype} classtype,u.usertime,#{year} year
121 121
         from t_user u
122 122
         left join t_teacher_powersb ts on u.userid = ts.teacherid
123 123
         left join t_subject_book sb on ts.lsbid=sb.lsbid

Načítá se…
Zrušit
Uložit