|
@@ -107,7 +107,7 @@ public class DeviceDataServiceImpl implements DeviceDataService {
|
|
|
updateQuery.addCriteria(Criteria.where("deviceId").is(meterData.getDeviceId()));
|
|
|
updateQuery.addCriteria(Criteria.where("data.readDate").is(DateUtil.getDate(new Date())));
|
|
|
Update update = new Update();
|
|
|
- update.set("data.$.readTime",meterData.getReceiveDate());
|
|
|
+ update.set("data.$.readTime",meterData.getReceiveDate().getTime());
|
|
|
update.set("data.$.readData",meterData.getReadData());
|
|
|
update.set("data.$.readStatus",ReadStatusEnum.READ.getCode());
|
|
|
update.set("data.$.valveStatus",meterData.getValveStatus());
|
|
@@ -257,7 +257,7 @@ public class DeviceDataServiceImpl implements DeviceDataService {
|
|
|
Map<String, Object> measureMap = measureDataDto.getMeasureMap();
|
|
|
|
|
|
Product product = productService.findProductByCache(device.getProductId());
|
|
|
- log.info("product = {}",JSON.toJSON(product));
|
|
|
+ //log.info("product = {}",JSON.toJSON(product));
|
|
|
Device update = new Device();
|
|
|
update.setId(device.getId());
|
|
|
update.setDeviceStatus(DeviceStatusEnum.NORMAL.getCode());
|
|
@@ -265,7 +265,7 @@ public class DeviceDataServiceImpl implements DeviceDataService {
|
|
|
update.setValveStatus(convertValveStatus(measureMap,product));
|
|
|
update.setLastReceiveTime(DateUtil.asLocalDateTime(measureDataDto.getReceiveDate()));
|
|
|
update.setUpdateDate(LocalDateTime.now());
|
|
|
- log.info("update = {}",JSON.toJSON(update));
|
|
|
+ //log.info("update = {}",JSON.toJSON(update));
|
|
|
deviceMapper.updateByDeviceData(update);
|
|
|
|
|
|
MeterData meterData = new MeterData();
|
|
@@ -287,7 +287,7 @@ public class DeviceDataServiceImpl implements DeviceDataService {
|
|
|
**/
|
|
|
private String convertReadData(Map<String, Object> measureMap,Product product){
|
|
|
String readData = MapUtil.getStr(measureMap,product.getReadingMeasuringCode());
|
|
|
- log.info("convertReadData readData={},code={}",readData,product.getReadingMeasuringCode());
|
|
|
+ //log.info("convertReadData readData={},code={}",readData,product.getReadingMeasuringCode());
|
|
|
return readData;
|
|
|
}
|
|
|
|
|
@@ -300,7 +300,7 @@ public class DeviceDataServiceImpl implements DeviceDataService {
|
|
|
**/
|
|
|
private Integer convertValveStatus(Map<String, Object> measureMap,Product product){
|
|
|
String valve = MapUtil.getStr(measureMap,product.getValveMeasuringCode());
|
|
|
- log.info("convertValveStatus valve={},code={}",valve,product.getValveMeasuringCode());
|
|
|
+ //log.info("convertValveStatus valve={},code={}",valve,product.getValveMeasuringCode());
|
|
|
if (valve != null) {
|
|
|
if(StringUtils.equals("0",valve)) return ValveStatusEnum.ON.getCode();
|
|
|
if(StringUtils.equals("1",valve)) return ValveStatusEnum.OFF.getCode();
|