|
|
|
@@ -10,6 +10,7 @@ import com.iformall.domain.po.KwBoxCmdHistory; |
|
|
|
import com.iformall.enums.EnumBoxRegisterStatus; |
|
|
|
import com.iformall.service.kw.KwBoxCmdHistoryService; |
|
|
|
import com.iformall.service.kw.KwBoxService; |
|
|
|
|
|
|
|
import io.netty.util.internal.StringUtil; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@@ -19,6 +20,9 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.Instant; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@@ -135,6 +139,12 @@ public class KwBoxV1Controller extends BaseController { |
|
|
|
record.setId(kwBox.getId()); |
|
|
|
record.setLastOnlineTime(new Date()); |
|
|
|
kwBoxService.saveOrUpdate(record); |
|
|
|
|
|
|
|
Instant instant = deviceTime.toInstant(); |
|
|
|
ZoneId zone = ZoneId.systemDefault(); |
|
|
|
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone); |
|
|
|
if (localDateTime.getYear() == 1980) |
|
|
|
deviceTime = new Date(); |
|
|
|
|
|
|
|
List<Map<String,String>> metersData = (List<Map<String,String>>)paramMap.get("meters"); |
|
|
|
kwBoxService.saveMeterData(kwBox, metersData, deviceTime); |
|
|
|
|