解决温湿度计抄表操作时间不正确问题(增加8小时)
This commit is contained in:
parent
d91ac19910
commit
9bc06163d5
|
|
@ -55,6 +55,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
@Lazy
|
||||
@Autowired
|
||||
private HumidDeviceServiceImpl syncImpl;
|
||||
|
||||
public IPage<HumidDevice> findPage(Page<HumidDevice> page, HumidDevice humidDevice) {
|
||||
return baseMapper.findPage(page, humidDevice);
|
||||
}
|
||||
|
|
@ -98,6 +99,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
/**
|
||||
* 更新设备配置参数
|
||||
*
|
||||
* @param humidDevice
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -109,6 +111,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
/**
|
||||
* 获取接口请求参数
|
||||
*
|
||||
* @param page
|
||||
* @param limit
|
||||
* @param humidDevice
|
||||
|
|
@ -126,6 +129,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
/**
|
||||
* 调用接口更新设备配置参数
|
||||
*
|
||||
* @param map
|
||||
* @param humidDevice
|
||||
* @return
|
||||
|
|
@ -199,6 +203,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
/**
|
||||
* 更新设备实时数据(抄表)
|
||||
*
|
||||
* @param humidDevice
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -207,8 +212,10 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
Map<String, Object> params = getRealTimeParmas(0, 50, humidDevice);
|
||||
return updateDeviceRealTimeData(params, humidDevice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实时数据接口请求参数
|
||||
*
|
||||
* @param page
|
||||
* @param limit
|
||||
* @param humidDevice
|
||||
|
|
@ -228,6 +235,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
/**
|
||||
* 调用接口更新设备实时数据(抄表)
|
||||
*
|
||||
* @param map
|
||||
* @param humidDevice
|
||||
* @return
|
||||
|
|
@ -255,6 +263,11 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
String reportingTime = json.getStr("date");
|
||||
dh.setStatus(status);
|
||||
Date reportingDate = DateUtil.parse(reportingTime, "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
//需要增加8小时
|
||||
reportingDate = DateUtil.offsetHour(reportingDate, 8);
|
||||
reportingTime = DateUtil.format(reportingDate, "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
Calendar ca = Calendar.getInstance();
|
||||
ca.add(Calendar.MINUTE, -5);
|
||||
Date currentDate = ca.getTime();
|
||||
|
|
@ -305,6 +318,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
/**
|
||||
* 同步到业务系统
|
||||
*
|
||||
* @param humidDevice
|
||||
*/
|
||||
private void syncStatusMq(HumidDevice humidDevice) {
|
||||
|
|
@ -373,6 +387,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
/**
|
||||
* 更新温湿度值
|
||||
*
|
||||
* @param humidDevice
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -430,6 +445,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
/**
|
||||
* 调用接口获取设备配置参数
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -716,6 +732,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
|
||||
/**
|
||||
* 以设备维度同步温湿度到业务
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -985,6 +1002,7 @@ public class HumidDeviceServiceImpl extends ServiceImpl<HumidDeviceMapper, Humid
|
|||
baseMapper.updateById(humidDevice);
|
||||
syncImpl.syncWeixiu(humidDevice.getDepartServerUrl(), humidDevice);
|
||||
}
|
||||
|
||||
@DS("#dataSourceCode")
|
||||
public void syncWeixiu(String dataSourceCode, HumidDevice humidDevice) {
|
||||
baseMapper.updateById(humidDevice);
|
||||
|
|
|
|||
Loading…
Reference in New Issue