Commit 659963c1 authored by 赵啸非's avatar 赵啸非

重新调整统计线程实现

parent 8bd7f370
...@@ -31,7 +31,7 @@ public interface PhQueueStatService extends ICRUDService<PhQueueStatEntity, Long ...@@ -31,7 +31,7 @@ public interface PhQueueStatService extends ICRUDService<PhQueueStatEntity, Long
List<PhQueueStatEntity> getBillInfos(PhQueueStatQuery query, PageInfo pageInfo, Context context); List<PhQueueStatEntity> getBillInfos(PhQueueStatQuery query, PageInfo pageInfo, Context context);
void saveUpdatePhStatList(List<PhQueueStatEntity> saveAndUpdatelist); void saveUpdatePhStatList(SitePdu site,List<PhQueueStatEntity> saveAndUpdatelist);
void updateSitePhStatLog(DateTime attendStart, Long compare, StopWatch stopWatch, SitePdu site, Context context); void updateSitePhStatLog(DateTime attendStart, Long compare, StopWatch stopWatch, SitePdu site, Context context);
......
...@@ -378,20 +378,20 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -378,20 +378,20 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
return phQueueStatEntity; return phQueueStatEntity;
} }
@Override
public void saveUpdatePhStatList(List<PhQueueStatEntity> saveAndUpdatelist) { public void saveUpdatePhStatList(SitePdu site,List<PhQueueStatEntity> saveAndUpdatelist) {
if (!ObjectUtils.isEmpty(saveAndUpdatelist)) { if (!ObjectUtils.isEmpty(saveAndUpdatelist)) {
Map<Boolean, List<PhQueueStatEntity>> saveUpdateCollect = saveAndUpdatelist.parallelStream().collect(Collectors.partitioningBy(i -> i.newEntity())); Map<Boolean, List<PhQueueStatEntity>> saveUpdateCollect = saveAndUpdatelist.parallelStream().collect(Collectors.partitioningBy(i -> i.newEntity()));
log.info("新增站点评价统计数据,数量:{}", saveUpdateCollect.get(true).size()); log.info("新增站点:{} 评价统计数据,数量:{}",site.getSiteName(), saveUpdateCollect.get(true).size());
if (!ObjectUtils.isEmpty(saveUpdateCollect.get(true))) { if (!ObjectUtils.isEmpty(saveUpdateCollect.get(true))) {
//新增列表 //新增列表
this.save(saveUpdateCollect.get(true)); this.save(saveUpdateCollect.get(true));
} }
log.info("更新站点评价统计数据,数量:{}", saveUpdateCollect.get(true).size()); log.info("更新站点:{} 评价统计数据,数量:{}",site.getSiteName(), saveUpdateCollect.get(false).size());
if (!ObjectUtils.isEmpty(saveUpdateCollect.get(false))) { if (!ObjectUtils.isEmpty(saveUpdateCollect.get(false))) {
//更新列表 //更新列表
this.update(saveUpdateCollect.get(true)); this.update(saveUpdateCollect.get(false));
} }
} }
...@@ -439,7 +439,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD ...@@ -439,7 +439,7 @@ public class PhQueueStatServiceImpl extends AbstractCRUDServiceImpl<PhQueueStatD
List<List<PhQueueStatEntity>> partition = Lists.partition(saveOrUpdateList, 1000); List<List<PhQueueStatEntity>> partition = Lists.partition(saveOrUpdateList, 1000);
for (List<PhQueueStatEntity> phQueueStatEntities : partition) { for (List<PhQueueStatEntity> phQueueStatEntities : partition) {
this.saveUpdatePhStatList(phQueueStatEntities); this.saveUpdatePhStatList(site,phQueueStatEntities);
} }
stopWatch.stop(); stopWatch.stop();
......
...@@ -35,7 +35,7 @@ public interface PjEvaluateStatService extends ICRUDService<PjEvaluateStatEntity ...@@ -35,7 +35,7 @@ public interface PjEvaluateStatService extends ICRUDService<PjEvaluateStatEntity
List<PjEvaluateStatEntity> getBillInfos(PjEvaluateStatQuery query, PageInfo pageInfo, Context context); List<PjEvaluateStatEntity> getBillInfos(PjEvaluateStatQuery query, PageInfo pageInfo, Context context);
void saveUpdatePjEvaluateStatList(List<PjEvaluateStatEntity> saveAndUpdatelist); void saveUpdatePjEvaluateStatList(SitePdu site,List<PjEvaluateStatEntity> saveAndUpdatelist);
void updateSitePjStatLog(DateTime attendStart, Long compare, StopWatch stopWatch, SitePdu site, Context context); void updateSitePjStatLog(DateTime attendStart, Long compare, StopWatch stopWatch, SitePdu site, Context context);
} }
\ No newline at end of file
...@@ -375,19 +375,19 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat ...@@ -375,19 +375,19 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat
} }
@Override @Override
public void saveUpdatePjEvaluateStatList(List<PjEvaluateStatEntity> saveAndUpdatelist) { public void saveUpdatePjEvaluateStatList(SitePdu site,List<PjEvaluateStatEntity> saveAndUpdatelist) {
if (!ObjectUtils.isEmpty(saveAndUpdatelist)) { if (!ObjectUtils.isEmpty(saveAndUpdatelist)) {
Map<Boolean, List<PjEvaluateStatEntity>> saveUpdateCollect = saveAndUpdatelist.parallelStream().collect(Collectors.partitioningBy(i -> i.newEntity())); Map<Boolean, List<PjEvaluateStatEntity>> saveUpdateCollect = saveAndUpdatelist.parallelStream().collect(Collectors.partitioningBy(i -> i.newEntity()));
log.info("新增站点评价统计数据,数量:{}", saveUpdateCollect.get(true).size()); log.info("新增站点:{} 评价统计数据,数量:{}",site.getSiteName(), saveUpdateCollect.get(true).size());
if (!ObjectUtils.isEmpty(saveUpdateCollect.get(true))) { if (!ObjectUtils.isEmpty(saveUpdateCollect.get(true))) {
//新增列表 //新增列表
this.save(saveUpdateCollect.get(true)); this.save(saveUpdateCollect.get(true));
} }
log.info("更新站点评价统计数据,数量:{}", saveUpdateCollect.get(false).size()); log.info("更新站点:{} 评价统计数据,数量:{}",site.getSiteName(), saveUpdateCollect.get(false).size());
if (!ObjectUtils.isEmpty(saveUpdateCollect.get(false))) { if (!ObjectUtils.isEmpty(saveUpdateCollect.get(false))) {
//更新列表 //更新列表
this.update(saveUpdateCollect.get(true)); this.update(saveUpdateCollect.get(false));
} }
} }
...@@ -434,7 +434,7 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat ...@@ -434,7 +434,7 @@ public class PjEvaluateStatServiceImpl extends AbstractCRUDServiceImpl<PjEvaluat
List<List<PjEvaluateStatEntity>> partition = Lists.partition(saveAndUpdatelist, 1000); List<List<PjEvaluateStatEntity>> partition = Lists.partition(saveAndUpdatelist, 1000);
for (List<PjEvaluateStatEntity> pjEvaluateStatEntities : partition) { for (List<PjEvaluateStatEntity> pjEvaluateStatEntities : partition) {
this.saveUpdatePjEvaluateStatList(pjEvaluateStatEntities); this.saveUpdatePjEvaluateStatList(site,pjEvaluateStatEntities);
} }
......
...@@ -51,8 +51,6 @@ public class StatServiceImpl extends AbstractCRUDServiceImpl<StatDao, StatEntity ...@@ -51,8 +51,6 @@ public class StatServiceImpl extends AbstractCRUDServiceImpl<StatDao, StatEntity
private PjEvaluateStatService pjEvaluateStatService; private PjEvaluateStatService pjEvaluateStatService;
@Autowired @Autowired
private PhQueueStatService phQueueStatService; private PhQueueStatService phQueueStatService;
@Autowired
private AccessStatLogService accessStatLogService;
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment