乳山代码复原
This commit is contained in:
parent
2a74b17853
commit
9c8fbde869
@ -135,9 +135,9 @@ public class GovEnvironmentDevController {
|
||||
*/
|
||||
@OperLog(operModul = "扬尘管理", operType = "统计", operDesc = "统计扬尘设备数据")
|
||||
@ApiOperation(value = " 统计扬尘设备数据", notes = "统计扬尘设备数据", httpMethod = "GET")
|
||||
@GetMapping(value = "/statistics/{type}")
|
||||
public Result<EnvironmentDevStatDto> statistics(@PathVariable("type") Integer type) {
|
||||
return Result.success(environmentDevService.statistics(type));
|
||||
@GetMapping(value = "/statistics")
|
||||
public Result<EnvironmentDevStatDto> statistics() {
|
||||
return Result.success(environmentDevService.statistics());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -38,5 +38,5 @@ public interface IEnvironmentDevService extends IService<EnvironmentDev> {
|
||||
|
||||
boolean updateInfo(EnvironmentDev environmentDev);
|
||||
|
||||
EnvironmentDevStatDto statistics(Integer type);
|
||||
EnvironmentDevStatDto statistics();
|
||||
}
|
||||
|
||||
@ -13,16 +13,17 @@ import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.redis.lock.RedisRepository;
|
||||
import com.zhgd.xmgl.handler.exception.CustomException;
|
||||
import com.zhgd.xmgl.modules.basicdata.constant.CacheConstants;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.*;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.EngineeringDeviceDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.ProjectDeviceDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Engineering;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Project;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IProjectService;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevDto;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevStatDto;
|
||||
import com.zhgd.xmgl.modules.wisdom.entity.DustNoiseData;
|
||||
import com.zhgd.xmgl.modules.wisdom.dto.EnvironmentDevDto;
|
||||
import com.zhgd.xmgl.modules.wisdom.entity.EnvironmentAlarm;
|
||||
import com.zhgd.xmgl.modules.wisdom.entity.EnvironmentDev;
|
||||
import com.zhgd.xmgl.modules.wisdom.mapper.EnvironmentDevMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.*;
|
||||
import com.zhgd.xmgl.modules.wisdom.service.IDustNoiseDataService;
|
||||
import com.zhgd.xmgl.modules.wisdom.service.IEnvironmentAlarmService;
|
||||
import com.zhgd.xmgl.modules.wisdom.service.IEnvironmentDevService;
|
||||
@ -150,21 +151,21 @@ public class EnvironmentDevServiceImpl extends ServiceImpl<EnvironmentDevMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnvironmentDevStatDto statistics(Integer type) {
|
||||
public EnvironmentDevStatDto statistics() {
|
||||
EnvironmentDevStatDto environmentDev = new EnvironmentDevStatDto();
|
||||
if (type == 1) {
|
||||
/* if (type == 1) {
|
||||
int installNum = this.count(Wrappers.<EnvironmentDev>lambdaQuery().isNotNull(EnvironmentDev::getProjectSn));
|
||||
Integer projectNum = projectService.list(Wrappers.<Project>lambdaQuery().eq(Project::getState, 1)).size();
|
||||
environmentDev.setInstallNum(installNum);
|
||||
environmentDev.setUseRate(projectNum == 0 ? 0 : NumberUtil.round(installNum * 100F / projectNum, 2).floatValue());
|
||||
environmentDev.setTotalAlarm(environmentAlarmService.count(Wrappers.<EnvironmentAlarm>lambdaQuery().isNotNull(EnvironmentAlarm::getProjectSn)));
|
||||
} else {
|
||||
} else {*/
|
||||
int installNum = this.statByEngineering();
|
||||
Integer engineeringNum = engineeringService.list(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getExamineState, 3)).size();
|
||||
environmentDev.setInstallNum(installNum);
|
||||
environmentDev.setUseRate(engineeringNum == 0 ? 0 : NumberUtil.round(installNum * 100F / engineeringNum, 2).floatValue());
|
||||
environmentDev.setTotalAlarm(environmentAlarmService.count(Wrappers.<EnvironmentAlarm>lambdaQuery().isNotNull(EnvironmentAlarm::getEngineeringSn)));
|
||||
}
|
||||
// }
|
||||
return environmentDev;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user