|
@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.huaxu.common.StringUtils;
|
|
|
+import com.huaxu.dao.DeviceSceneMapper;
|
|
|
import com.huaxu.dto.*;
|
|
|
+import com.huaxu.dto.scene.SceneIdDto;
|
|
|
import com.huaxu.entity.DayReportEntity;
|
|
|
import com.huaxu.util.UserUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -31,6 +33,9 @@ public abstract class AbstractReportService<M extends BaseMapper<T>, T> extends
|
|
|
@Autowired
|
|
|
protected DeviceParmService deviceParmService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ protected DeviceSceneMapper deviceSceneMapper;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 报表数据处理
|
|
@@ -152,15 +157,11 @@ public abstract class AbstractReportService<M extends BaseMapper<T>, T> extends
|
|
|
reportDto.setMonth(queryDto.getMonth());
|
|
|
reportDto.setDay(queryDto.getDay());
|
|
|
if (isPipe){
|
|
|
- /*Integer[] parmType = null;
|
|
|
- if (queryDto.getType() == 1) {
|
|
|
- parmType = new Integer[]{13};
|
|
|
- } else if (queryDto.getType() == 2){
|
|
|
- parmType = new Integer[]{14};
|
|
|
- } else if (queryDto.getType() == 3){
|
|
|
- parmType = new Integer[]{7, 9, 11};
|
|
|
+ String name = queryDto.getType() == 1 ? "压力" : ((queryDto.getType() == 2) ? "流量" : "水质");
|
|
|
+ SceneIdDto sceneIdDto = deviceSceneMapper.findSceneId("管网",name, queryDto.getIds()[0]);
|
|
|
+ if (sceneIdDto != null){
|
|
|
+ reportDto.setSceneId(sceneIdDto.getSceneId());
|
|
|
}
|
|
|
- reportDto.setParmType(Arrays.asList(parmType));*/
|
|
|
reportDto.setDeviceIds(devices);
|
|
|
} else {
|
|
|
reportDto.setDeviceIds(devices);
|
|
@@ -182,16 +183,12 @@ public abstract class AbstractReportService<M extends BaseMapper<T>, T> extends
|
|
|
dto.setDeviceIds(devices);
|
|
|
// 管网和其他有点不一样
|
|
|
if (isPipe){
|
|
|
- /* Integer[] parmType = null;
|
|
|
- if (queryDto.getType() == 1) {
|
|
|
- parmType = new Integer[]{13};
|
|
|
- } else if (queryDto.getType() == 2){
|
|
|
- parmType = new Integer[]{14};
|
|
|
- } else if (queryDto.getType() == 3){
|
|
|
- parmType = new Integer[]{7, 9, 11};
|
|
|
- }
|
|
|
- dto.setTypeIds(Arrays.asList(parmType));*/
|
|
|
dto.setType(queryDto.getType());
|
|
|
+ String name = queryDto.getType() == 1 ? "压力" : ((queryDto.getType() == 2) ? "流量" : "水质");
|
|
|
+ SceneIdDto sceneIdDto = deviceSceneMapper.findSceneId("管网",name, queryDto.getIds()[0]);
|
|
|
+ if (sceneIdDto != null){
|
|
|
+ dto.setSceneId(sceneIdDto.getSceneId());
|
|
|
+ }
|
|
|
} else {
|
|
|
// 管网不需要场景
|
|
|
dto.setParentSceneIds(queryDto.getIds());
|