|
@@ -104,9 +104,11 @@ public class DatadetailController {
|
|
|
|
|
|
List<WorkflowExtra> workflowExtras = extraService.list(
|
|
|
new MPJLambdaWrapper<WorkflowExtra>()
|
|
|
+ .select(WorkflowExtra::getId)
|
|
|
.select(WorkflowExtra.class, x -> VoToColumnUtil.fieldsToColumns(WorkflowExtra.class).contains(x.getProperty()))
|
|
|
.leftJoin(WorkflowSchema.class, WorkflowSchema::getId, WorkflowExtra::getSchemaId)
|
|
|
.leftJoin(DictionaryDetail.class, DictionaryDetail::getId, WorkflowSchema::getCategory)
|
|
|
+ .orderByDesc("t.end_time")
|
|
|
);
|
|
|
|
|
|
|
|
@@ -170,28 +172,17 @@ public class DatadetailController {
|
|
|
result.setDistributionList(distributionList);
|
|
|
List<DurationVo> durationList = new ArrayList<>();
|
|
|
|
|
|
- List<Duration> timeDifferences = new ArrayList<>();
|
|
|
+ List<Long> secondList = new ArrayList<>();
|
|
|
completeCountList.stream().filter(el -> el.getEndTime() != null && el.getStartTime() != null).forEach(el -> {
|
|
|
- Duration diff = Duration.between(el.getEndTime(), el.getStartTime());
|
|
|
- timeDifferences.add(diff);
|
|
|
+ Duration diff = Duration.between(el.getStartTime(), el.getEndTime());
|
|
|
+ secondList.add(diff.getSeconds());
|
|
|
});
|
|
|
|
|
|
- int zeroHour = 0;
|
|
|
- int oneHour = 0;
|
|
|
- int fourHour = 0;
|
|
|
- int eightHour = 0;
|
|
|
- for (Duration timeDifference : timeDifferences) {
|
|
|
- long seconds = timeDifference.getSeconds();
|
|
|
- if(seconds < 3600){
|
|
|
- zeroHour ++;
|
|
|
- }else if(seconds < 14400){
|
|
|
- oneHour ++;
|
|
|
- }else if(seconds < 28800){
|
|
|
- fourHour ++;
|
|
|
- }else{
|
|
|
- eightHour ++;
|
|
|
- }
|
|
|
- }
|
|
|
+ long zeroHour = secondList.stream().filter(x -> x < 3600L).count();
|
|
|
+ long oneHour = secondList.stream().filter(x -> x < 14400L && x >= 3600L).count();
|
|
|
+ long fourHour = secondList.stream().filter(x -> x < 28800L && x >= 14400L).count();
|
|
|
+ long eightHour = secondList.stream().filter(x -> x >= 28800L).count();
|
|
|
+
|
|
|
DurationVo zeroVo = new DurationVo();
|
|
|
zeroVo.setDuration("0-1h");
|
|
|
zeroVo.setCount(zeroHour);
|