| | |
| | | |
| | | import com.rabbitmq.client.*; |
| | | import com.rabbitmq.client.Channel; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import io.swagger.models.auth.In; |
| | | import jdk.nashorn.internal.runtime.regexp.joni.Regex; |
| | | import net.sf.json.JSONString; |
| | | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.collections.MapUtils; |
| | | import org.apache.commons.net.ftp.FTPClient; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import org.xml.sax.InputSource; |
| | | |
| | | import static com.moral.common.util.ResourceUtil.getValue; |
| | | import static com.moral.common.util.WebUtils.getParametersStartingWith; |
| | | import static java.util.Calendar.*; |
| | |
| | | mon = "" + month; |
| | | } |
| | | String table = "history_minutely_" + year + mon; |
| | | List list = deviceService.byMonitorIdGetDeviceAndWind(monitorPointId,table); |
| | | List list = deviceService.byMonitorIdGetDeviceAndWind(monitorPointId, table); |
| | | return list; |
| | | } |
| | | |
| | |
| | | mon = "" + month; |
| | | } |
| | | String table = "history_minutely_" + year + mon; |
| | | List list = deviceService.byMonitorIdGetDeviceAndWindSpecial(monitorPointId,table); |
| | | List list = deviceService.byMonitorIdGetDeviceAndWindSpecial(monitorPointId, table); |
| | | return list; |
| | | } |
| | | |
| | |
| | | for (Map<String, Object> dataMap : dataList) { |
| | | JSONObject dataJson = JSONObject.parseObject(dataMap.get("json").toString()); |
| | | if (dataMap.get("time").toString().equals(day + " 00:00:00.0")) { |
| | | oneSensorMap.put(dataMap.get("time").toString().substring(0, 10), dataJson.getJSONArray(key).get(2)); |
| | | oneSensorMap.put(dataMap.get("time").toString().substring(0, 10), dataJson.getJSONArray(key).get(0)); |
| | | break; |
| | | } else { |
| | | continue; |
| | |
| | | for (Map sameDayHourlyMap : sameDayHourlyList) { |
| | | List<Double> arr = new ArrayList<>(); |
| | | JSONObject hourlyJson = JSONObject.parseObject(sameDayHourlyMap.get("json").toString()); |
| | | arr.add(Double.parseDouble(hourlyJson.getJSONArray(key).get(2).toString())); |
| | | arr.add(Double.parseDouble(hourlyJson.getJSONArray(key).get(0).toString())); |
| | | Double sum = 0.0; |
| | | for (int i = 0; i < arr.size(); i++) { |
| | | sum += arr.get(i); |
| | |
| | | for (Map<String, Object> hourlyMap : hourlyList) { |
| | | JSONObject dataJson = JSONObject.parseObject(hourlyMap.get("json").toString()); |
| | | if (hourlyMap.get("time").toString().equals(hour + ".0")) { |
| | | oneSensorMap.put(hourlyMap.get("time").toString().substring(0, 19), dataJson.getJSONArray(key).get(2)); |
| | | break; |
| | | if (dataJson.getJSONArray(key) != null) { |
| | | oneSensorMap.put(hourlyMap.get("time").toString().substring(0, 19), dataJson.getJSONArray(key).get(0)); |
| | | break; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |