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'";
|
String subjCodes = "'54010501','54010601','54010701','220202','54010502','54010602','54010702'";
|
||||||
try {
|
try {
|
||||||
logger.info("调用:" + getPluginName() + "-插件");
|
logger.info("调用:" + getPluginName() + "-插件");
|
||||||
long a = System.currentTimeMillis();
|
|
||||||
this.delete();
|
|
||||||
long b = System.currentTimeMillis();
|
|
||||||
System.out.println("清理耗时:" + (b - a));
|
|
||||||
|
|
||||||
MdmGmSubjectBalanceEntity mdmGmSubjectBalanceEntity = new MdmGmSubjectBalanceEntity();
|
MdmGmSubjectBalanceEntity mdmGmSubjectBalanceEntity = new MdmGmSubjectBalanceEntity();
|
||||||
mdmGmSubjectBalanceEntity.setPkCorp("1001");
|
mdmGmSubjectBalanceEntity.setPkCorp("1001");
|
||||||
mdmGmSubjectBalanceEntity.setSubjcodes(subjCodes);
|
mdmGmSubjectBalanceEntity.setSubjcodes(subjCodes);
|
||||||
List<MdmGmSubjectBalanceEntity> mdmGmSubjectBalanceEntities = mdmGmSubjectBalanceDao.queryBalanceBySubjectCodesAndPkCorp(mdmGmSubjectBalanceEntity);
|
List<MdmGmSubjectBalanceEntity> mdmGmSubjectBalanceEntities = mdmGmSubjectBalanceDao.queryBalanceBySubjectCodesAndPkCorp(mdmGmSubjectBalanceEntity);
|
||||||
long c = System.currentTimeMillis();
|
if (mdmGmSubjectBalanceEntities != null && mdmGmSubjectBalanceEntities.size() != 0) {
|
||||||
System.out.println("查询耗时:" + (c - b));
|
this.delete();
|
||||||
List<List<MdmGmSubjectBalanceEntity>> batches = Lists.partition(mdmGmSubjectBalanceEntities, 500);
|
List<List<MdmGmSubjectBalanceEntity>> batches = Lists.partition(mdmGmSubjectBalanceEntities, 500);
|
||||||
for (List<MdmGmSubjectBalanceEntity> batch : batches) {
|
for (List<MdmGmSubjectBalanceEntity> batch : batches) {
|
||||||
mdmGmSubjectBalanceDao.saveList(batch);
|
mdmGmSubjectBalanceDao.saveList(batch);
|
||||||
}
|
}
|
||||||
long d = System.currentTimeMillis();
|
|
||||||
System.out.println("插入耗时:" + (d - c));
|
|
||||||
System.out.println("总耗时:" + (d - a));
|
|
||||||
|
|
||||||
|
|
||||||
//成功
|
//成功
|
||||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||||
|
@ -152,6 +144,7 @@ public class SubjectAssBalancePlugin extends PluginBaseEntity {
|
||||||
integrationTaskLivingDetailsEntity.setNewSystemNumber(null);
|
integrationTaskLivingDetailsEntity.setNewSystemNumber(null);
|
||||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in New Issue