Browse Source

App总览接口

wangbo 4 years ago
parent
commit
f6103d0b0e

+ 30 - 0
sms_water/src/main/java/com/huaxu/controller/AppPageReportController.java

@@ -1,10 +1,22 @@
 package com.huaxu.controller;
 
 
+import com.huaxu.dto.generalView.DeviceWaterSupply;
+import com.huaxu.model.AjaxMessage;
+import com.huaxu.model.ResultStatus;
+import com.huaxu.service.AppPageReportService;
+import com.huaxu.service.HomePageReportService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * @description
  * @auto wangbo
@@ -15,5 +27,23 @@ import org.springframework.web.bind.annotation.RestController;
 @Api(tags = "App总览报表")
 public class AppPageReportController {
 
+    @Autowired
+    private AppPageReportService appPageReportService;
+
+    @RequestMapping(value = "getDeviceWaterIntake",method = RequestMethod.GET)
+    @ApiOperation(value = "App总览——取水图表(本月)")
+    public AjaxMessage<List<DeviceWaterSupply>> getDeviceWaterIntake(
+            @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId){
+        return new AjaxMessage<>(ResultStatus.OK,appPageReportService.deviceWaterReportForSameMonth(companyOrgId,"水源",4));
+    }
+
+    @RequestMapping(value = "getDeviceWaterMaking",method = RequestMethod.GET)
+    @ApiOperation(value = "App总览——制水图表(本月)")
+    public AjaxMessage<List<DeviceWaterSupply>> getDeviceWaterMaking(
+            @ApiParam(value = "公司id,总公司传空值") @RequestParam(required = false) Integer companyOrgId
+    ){
+        return new AjaxMessage<>(ResultStatus.OK,appPageReportService.deviceWaterReportForSameMonth(companyOrgId,"水厂",3));
+    }
+
 
 }

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

@@ -49,9 +49,7 @@ public class AppPageReportServiceImpl implements AppPageReportService {
     @Override
     public List<DeviceWaterSupply> deviceWaterReportForSameMonth(Integer companyOrgId, String sceneType, Integer parmType) {
         LoginUser loginUser = UserUtil.getCurrentUser();
-        String tenantId = loginUser.getTenantId();
         LocalDate localDate = LocalDate.now();
-
         List<DeviceWaterSupply> deviceWaterSupplies = new ArrayList<DeviceWaterSupply>();
 
         BigDecimal AmountCountMonth = MonitorDataReportService.getAmountCount(companyOrgId,null, sceneType, parmType,2 );