Explorar o código

Merge remote-tracking branch 'origin/master'

hym %!s(int64=4) %!d(string=hai) anos
pai
achega
66a5775f72

+ 1 - 1
sms_water/src/main/java/com/huaxu/controller/MonitorDataReportController.java

@@ -169,7 +169,7 @@ public class MonitorDataReportController {
     @RequestMapping(value = "waterSupplyCharts",method = RequestMethod.GET)
     @ApiOperation(value = "概览首页——对比曲线图")
     public AjaxMessage<List<WaterSupplyChart>> waterSupplyCharts(){
-        return new AjaxMessage<>(ResultStatus.OK,monitorDataReportService.waterSupplyCharts());
+        return new AjaxMessage<>(ResultStatus.OK,monitorDataReportService.waterSupplyCharts("水厂"));
     }
 
 }

+ 6 - 1
sms_water/src/main/java/com/huaxu/controller/SecSupplyController.java

@@ -4,6 +4,7 @@ import com.huaxu.dto.AmountDayThirtyDto;
 import com.huaxu.dto.AmountTotalDto;
 import com.huaxu.dto.WaterPieDto;
 import com.huaxu.dto.generalView.SceneWaterPressure;
+import com.huaxu.dto.generalView.WaterSupplyChart;
 import com.huaxu.entity.MonthReportEntity;
 import com.huaxu.entity.SceneEntity;
 import com.huaxu.model.AjaxMessage;
@@ -82,5 +83,9 @@ public class SecSupplyController {
         return new AjaxMessage<>(ResultStatus.OK,monitorDataReportService.sceneWaterPressure("泵站"));
     }
 
-
+    @RequestMapping(value = "waterSupplyCharts",method = RequestMethod.GET)
+    @ApiOperation(value = "二供概览首页——供水电耗药耗对比曲线图")
+    public AjaxMessage<List<WaterSupplyChart>> waterSupplyCharts(){
+        return new AjaxMessage<>(ResultStatus.OK,monitorDataReportService.waterSupplyCharts("泵站"));
+    }
 }

+ 1 - 1
sms_water/src/main/java/com/huaxu/dao/MonitorDataReportMapper.java

@@ -103,5 +103,5 @@ public interface MonitorDataReportMapper {
 
     SceneNormalRate getQualificationForScene(@Param("tenantId")String tenantId, @Param("parmType")Integer parmType );
 
-    List<WaterSupplyData> getWaterSupplyData(@Param("tenantId")String tenantId);
+    List<WaterSupplyData> getWaterSupplyData(@Param("tenantId")String tenantId,@Param("sceneTypeName")String sceneTypeName);
 }

+ 1 - 1
sms_water/src/main/java/com/huaxu/service/MonitorDataReportService.java

@@ -55,7 +55,7 @@ public interface MonitorDataReportService {
     List<SceneWaterAmount> sceneWaterAmounts();
 
     //对比曲线图
-    List<WaterSupplyChart> waterSupplyCharts();
+    List<WaterSupplyChart> waterSupplyCharts(String sceneTypeName);
 
 
 

+ 2 - 2
sms_water/src/main/java/com/huaxu/service/impl/MonitorDataReportServiceImpl.java

@@ -842,12 +842,12 @@ public class MonitorDataReportServiceImpl implements MonitorDataReportService {
 
     //水厂制水、药耗、电耗对比曲线
     @Override
-    public List<WaterSupplyChart> waterSupplyCharts() {
+    public List<WaterSupplyChart> waterSupplyCharts(String sceneTypeName) {
 
         LoginUser loginUser = UserUtil.getCurrentUser();
         String tenantId = loginUser.getTenantId();
 
-        List<WaterSupplyData> waterSupplyDatas = monitorDataReportMapper.getWaterSupplyData(tenantId);
+        List<WaterSupplyData> waterSupplyDatas = monitorDataReportMapper.getWaterSupplyData(tenantId,sceneTypeName);
         List<WaterSupplyChart> waterSupplyCharts = new ArrayList<>();
         waterSupplyDatas.stream()
                 .collect(Collectors.groupingBy(item -> item.getYear() + "-" + item.getMonth() + "-" + item.getDay()))

+ 1 - 1
sms_water/src/main/resources/mapper/MonitorDataReportMapper.xml

@@ -1009,7 +1009,7 @@
         left join sms_device_parm dp on s.id=dp.SCENE_ID
         left join sms_device_attribute da on dp.ATTRIBUTE_ID =da.ID
         left join sms_month_report r on r.DEVICE_ID =dp.DEVICE_ID and r.ATTRIBUTE_ID = dp.ATTRIBUTE_ID
-        where  dp.`STATUS`=1 and st.SCENE_TYPE_NAME = '水厂'
+        where  dp.`STATUS`=1 and st.SCENE_TYPE_NAME = #{sceneTypeName}
             and r.COLLECT_DATE >= DATE_SUB(CURDATE(),INTERVAL 7 day)
             and dp.PARM_TYPE in (3,5,6)   and dp.TENANT_ID=#{tenantId}
         group by r.year,r.month,r.day,dp.PARM_TYPE,da.UNIT