Commit c16b18e250993ea86940a113aa09ab1b0c60cad3
1 parent
c6366d1b5a
Exists in
master
and in
6 other branches
update
Showing 1 changed file with 15 additions and 33 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
c16b18e
| ... | ... | @@ -4330,7 +4330,7 @@ |
| 4330 | 4330 | { |
| 4331 | 4331 | System.out.println(org.getId()+org.getName()); |
| 4332 | 4332 | int page = 1; |
| 4333 | - int limit = 2000; | |
| 4333 | + int limit = 500; | |
| 4334 | 4334 | while (true) |
| 4335 | 4335 | { |
| 4336 | 4336 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
| 4337 | 4337 | |
| 4338 | 4338 | |
| 4339 | 4339 | |
| ... | ... | @@ -4341,41 +4341,23 @@ |
| 4341 | 4341 | List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery); |
| 4342 | 4342 | page++; |
| 4343 | 4343 | if (CollectionUtils.isNotEmpty(antExRecordModelList)) { |
| 4344 | - int batchSize = 500; | |
| 4345 | - int end = 0; | |
| 4346 | - for (int i = 0; i < antExRecordModelList.size(); i += batchSize) { | |
| 4347 | - end = (end + batchSize); | |
| 4348 | - if (end > antExRecordModelList.size()) { | |
| 4349 | - end = antExRecordModelList.size(); | |
| 4350 | - } | |
| 4351 | - System.out.println("start:" + i + ",end:" + end); | |
| 4352 | - final List<AntExRecordModel> tempList = antExRecordModelList.subList(i, end); | |
| 4353 | - | |
| 4354 | - commonThreadPool.execute(new Runnable() { | |
| 4355 | - @Override | |
| 4356 | - public void run() { | |
| 4357 | - if (CollectionUtils.isNotEmpty(tempList)) { | |
| 4358 | - for (AntExRecordModel antExRecordModel : tempList) { | |
| 4359 | - if (StringUtils.isNotEmpty(antExRecordModel.getParentId())) { | |
| 4360 | - Patients pats = patientsService.findOnePatientById(antExRecordModel.getParentId()); | |
| 4361 | - if (pats != null) | |
| 4362 | - { | |
| 4363 | - if (pats.getType() != null && pats.getType() == 3) | |
| 4364 | - { | |
| 4365 | - AntExRecordModel dbmodel = new AntExRecordModel(); | |
| 4366 | - dbmodel.setDueStatus(1); | |
| 4367 | - dbmodel.setId(antExRecordModel.getId()); | |
| 4368 | - recordService.updateOne(dbmodel, antExRecordModel.getId()); | |
| 4369 | - System.out.println(antExRecordModel.getId()); | |
| 4370 | - } | |
| 4371 | - } | |
| 4372 | - } | |
| 4373 | - } | |
| 4344 | + for (AntExRecordModel antExRecordModel : antExRecordModelList) { | |
| 4345 | + if (StringUtils.isNotEmpty(antExRecordModel.getParentId())) { | |
| 4346 | + Patients pats = patientsService.findOnePatientById(antExRecordModel.getParentId()); | |
| 4347 | + if (pats != null) | |
| 4348 | + { | |
| 4349 | + if (pats.getType() != null && pats.getType() == 3) | |
| 4350 | + { | |
| 4351 | + AntExRecordModel dbmodel = new AntExRecordModel(); | |
| 4352 | + dbmodel.setDueStatus(1); | |
| 4353 | + dbmodel.setId(antExRecordModel.getId()); | |
| 4354 | + recordService.updateOne(dbmodel, antExRecordModel.getId()); | |
| 4355 | + System.out.println(antExRecordModel.getId()); | |
| 4374 | 4356 | } |
| 4375 | - | |
| 4376 | 4357 | } |
| 4377 | - }); | |
| 4358 | + } | |
| 4378 | 4359 | } |
| 4360 | + | |
| 4379 | 4361 | } |
| 4380 | 4362 | else |
| 4381 | 4363 | { |