| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | |
| | | result.put("mac", mac); |
| | | result.put("version", version); |
| | | |
| | | Date time = DateUtils.getDate((String) data.remove("DataTime"), DateUtils.yyyyMMddHHmmss_EN); |
| | | // String time1 = data.get("time").toString(); |
| | | String time2 = data.remove("time").toString(); |
| | | long l = Long.parseLong(time2); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:00"); |
| | | String format1 = dateFormat.format(l); |
| | | Date time = DateUtils.getDate(format1, DateUtils.yyyy_MM_dd_HH_mm_ss_EN); |
| | | // Date time = DateUtils.getDate((String) data.remove("DataTime"), DateUtils.yyyyMMddHHmmss_EN); |
| | | result.put("time", DateUtils.getDateOfMin(time, -1)); |
| | | result.put("value", JSONObject.toJSONString(data)); |
| | | String timeUnits = DateUtils.dateToDateString(DateUtils.getDateOfMin(time, -1), DateUtils.yyyyMM_EN); |