Commit cf24dba1c5e0f7bbf7ceedf7a04fa23bc3ca6aa1
1 parent
3493061b
生成排班改多线程
Showing
1 changed file
with
8 additions
and
3 deletions
src/main/java/com/bsth/service/ddexam/impl/DdexamServiceImpl.java
| @@ -336,9 +336,14 @@ public class DdexamServiceImpl implements DdexamService { | @@ -336,9 +336,14 @@ public class DdexamServiceImpl implements DdexamService { | ||
| 336 | for (int i = 0 ; i < userList.size() ; i++ ){ //已rs人数为准 | 336 | for (int i = 0 ; i < userList.size() ; i++ ){ //已rs人数为准 |
| 337 | SysUser user = userList.get(i); | 337 | SysUser user = userList.get(i); |
| 338 | if (realControAuthorityRepository.findByUserId(user.getId()) != null) { | 338 | if (realControAuthorityRepository.findByUserId(user.getId()) != null) { |
| 339 | - useryType(user,type); | ||
| 340 | - System.out.println("分配班次..."); | ||
| 341 | - sysUserRepository.changeKsStatus(user.getId()); ////状态 表示今日账户已用 | 339 | + new Thread() { |
| 340 | + public synchronized void run() { | ||
| 341 | + useryType(user,type); | ||
| 342 | + System.out.println("分配班次..."); | ||
| 343 | + sysUserRepository.changeKsStatus(user.getId()); ////状态 表示今日账户已用 | ||
| 344 | + | ||
| 345 | + } | ||
| 346 | + }.start(); | ||
| 342 | } | 347 | } |
| 343 | } | 348 | } |
| 344 | return true; | 349 | return true; |