xufenglei
2017-12-11 59d80f82ef195f03b714fa0e9aec5d21d119c335
src/main/java/com/moral/controller/ReportController.java
@@ -19,6 +19,7 @@
import org.springframework.web.bind.annotation.RestController;
import com.moral.common.exception.BusinessException;
import com.moral.common.util.ValidateUtil;
import com.moral.service.DeviceService;
import com.moral.service.HistoryService;
@@ -41,9 +42,9 @@
         Object mac = parameters.get("mac");
         Object time = parameters.get("time");
         Object type = parameters.get("type");
         if (isEmpty(mac) || isEmpty(time) || isEmpty(type)) {
            result.put("msg", "参数不能为空!");
         } else {
         ValidateUtil.notNull(mac, "param.is.null");
         ValidateUtil.notNull(time, "param.is.null");
         ValidateUtil.notNull(type, "param.is.null");
            List<Map<String, Object>> sensors = deviceService.getSensorsByDevice(mac.toString());
            List<Map<String, Object>> sensorsAverage = historyService.getSensorsAverageByDevice4Report(parameters,sensors);
            if (isEmpty(sensorsAverage)) {
@@ -60,7 +61,6 @@
               OutputStream outputStream = exportData(response, time + "_" + mac + "_" + type, sensorsAverage, exportColumn);
               outputStream.flush();
               outputStream.close();
            }
         }
      } catch (BusinessException be) {
         be.printStackTrace();