1、科目辅助余额优化,先查询再删除。
This commit is contained in:
parent
92b2ec8a3f
commit
62af0557d1
|
@ -119,25 +119,17 @@ public class SubjectAssBalancePlugin extends PluginBaseEntity {
|
|||
String subjCodes = "'54010501','54010601','54010701','220202','54010502','54010602','54010702'";
|
||||
try {
|
||||
logger.info("调用:" + getPluginName() + "-插件");
|
||||
long a = System.currentTimeMillis();
|
||||
this.delete();
|
||||
long b = System.currentTimeMillis();
|
||||
System.out.println("清理耗时:" + (b - a));
|
||||
|
||||
MdmGmSubjectBalanceEntity mdmGmSubjectBalanceEntity = new MdmGmSubjectBalanceEntity();
|
||||
mdmGmSubjectBalanceEntity.setPkCorp("1001");
|
||||
mdmGmSubjectBalanceEntity.setSubjcodes(subjCodes);
|
||||
List<MdmGmSubjectBalanceEntity> mdmGmSubjectBalanceEntities = mdmGmSubjectBalanceDao.queryBalanceBySubjectCodesAndPkCorp(mdmGmSubjectBalanceEntity);
|
||||
long c = System.currentTimeMillis();
|
||||
System.out.println("查询耗时:" + (c - b));
|
||||
if (mdmGmSubjectBalanceEntities != null && mdmGmSubjectBalanceEntities.size() != 0) {
|
||||
this.delete();
|
||||
List<List<MdmGmSubjectBalanceEntity>> batches = Lists.partition(mdmGmSubjectBalanceEntities, 500);
|
||||
for (List<MdmGmSubjectBalanceEntity> batch : batches) {
|
||||
mdmGmSubjectBalanceDao.saveList(batch);
|
||||
}
|
||||
long d = System.currentTimeMillis();
|
||||
System.out.println("插入耗时:" + (d - c));
|
||||
System.out.println("总耗时:" + (d - a));
|
||||
|
||||
|
||||
//成功
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
|
@ -152,6 +144,7 @@ public class SubjectAssBalancePlugin extends PluginBaseEntity {
|
|||
integrationTaskLivingDetailsEntity.setNewSystemNumber(null);
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
Loading…
Reference in New Issue