问题修改

This commit is contained in:
方亮 2025-10-17 16:52:22 +08:00
parent 46dfa6338d
commit ac26a0688a
3 changed files with 15 additions and 1 deletions

View File

@ -55,6 +55,7 @@ public class SjMaxDeviceServiceImpl implements SjMaxDeviceService{
double workerUtilization = 0;
if (totalShouldCount > 0) {
workerUtilization = (totalActualCount / totalShouldCount) * 100;
workerUtilization = (double) Math.round(workerUtilization * 10.0) / 10.0;
}
result.put("workerUtilization", workerUtilization);
double totalUsedDay = list.stream()
@ -66,6 +67,7 @@ public class SjMaxDeviceServiceImpl implements SjMaxDeviceService{
double deviceUtilization = 0;
if (totalShouldCount > 0) {
deviceUtilization = (totalUsedDay / totalEinDay) * 100;
deviceUtilization = (double) Math.round(deviceUtilization * 10.0) / 10.0;
}
result.put("deviceUtilization", deviceUtilization);
//效率分析

View File

@ -1,7 +1,11 @@
package com.securitycontrol.screen.service.impl;
import com.securitycontrol.common.core.constant.SecurityConstants;
import com.securitycontrol.common.core.domain.Result;
import com.securitycontrol.common.core.web.domain.AjaxResult;
import com.securitycontrol.screen.service.SjProjectSafetyService;
import com.securitycontrol.system.api.RemoteFileService;
import com.securitycontrol.system.api.domain.SysFile;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,6 +23,9 @@ public class SjProjectSafetyServiceImpl implements SjProjectSafetyService {
@Resource
private SjProjectSafetyMapper mapper;
@Resource
private RemoteFileService remoteFileService;
@Override
public List<SjProjectSafety> selectProSafetyLedger(SjProjectSafety o) {
@ -27,6 +34,11 @@ public class SjProjectSafetyServiceImpl implements SjProjectSafetyService {
@Override
public List<SjProjectSafety> selectProSafetyVideo(SjProjectSafety o) {
List<SjProjectSafety> sjProjectSafeties = mapper.selectProSafetyVideo(o);
sjProjectSafeties.forEach(data -> {
Result<SysFile> result= remoteFileService.getFileBast64(data.getImagePath(), SecurityConstants.INNER);
data.setImagePath(result.getData().getUrl());
});
return mapper.selectProSafetyVideo(o);
}

View File

@ -87,7 +87,7 @@
tp_count.total_people,
ROUND(
COALESCE(SUM(actual.actual_count), 0) * 100.0 /
((DATEDIFF(#{startTime} , #{endTime}) + 1) * tp_count.total_people),
((DATEDIFF(#{endTime} , #{startTime}) + 1) * tp_count.total_people),
2
) AS utilization_rate -- 百分比形式(如 86.70
FROM sj_work_team wt