Commit fe01f037cb9a1589e31d9e206d572cc64901713a
1 parent
af89a6340d
Exists in
master
and in
6 other branches
为更新权限单独开线程处理
Showing 1 changed file with 17 additions and 1 deletions
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/OrganizationServiceImpl.java
View file @
fe01f03
| ... | ... | @@ -25,6 +25,7 @@ |
| 25 | 25 | import org.springframework.stereotype.Service; |
| 26 | 26 | |
| 27 | 27 | import java.util.*; |
| 28 | +import java.util.concurrent.*; | |
| 28 | 29 | |
| 29 | 30 | @Service("organizationServiceImpl1") |
| 30 | 31 | public class OrganizationServiceImpl extends DataAccessLayerService implements OrganizationService { |
| ... | ... | @@ -136,7 +137,22 @@ |
| 136 | 137 | public void updateOrganization(Organization obj) { |
| 137 | 138 | masterOrganizationMapper.updateOrganization(obj); |
| 138 | 139 | iSyncDataDao.addSyncData("MysqlUpdate", obj, obj.getId().toString()); |
| 139 | - rebuildDataPermissions(null); | |
| 140 | + | |
| 141 | + | |
| 142 | + ExecutorService executor = new ThreadPoolExecutor(1, 1, 0, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), new RejectedExecutionHandler(){ | |
| 143 | + @Override | |
| 144 | + public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { | |
| 145 | + System.out.println("请稍后尝试"); | |
| 146 | + } | |
| 147 | + }); | |
| 148 | + executor.submit(new Runnable() { | |
| 149 | + @Override | |
| 150 | + public void run() { | |
| 151 | + rebuildDataPermissions(null); | |
| 152 | + } | |
| 153 | + }); | |
| 154 | + | |
| 155 | + //rebuildDataPermissions(null); | |
| 140 | 156 | } |
| 141 | 157 | |
| 142 | 158 | @Override |