保存设备上报数据
This commit is contained in:
parent
6aa1d542da
commit
5d8e9db6c1
@ -53,8 +53,14 @@
|
|||||||
<groupId>com.fastbee</groupId>
|
<groupId>com.fastbee</groupId>
|
||||||
<artifactId>fastbee-notify-core</artifactId>
|
<artifactId>fastbee-notify-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fastbee</groupId>
|
||||||
|
<artifactId>fastbee-rechargecard-service</artifactId>
|
||||||
|
<version>3.8.5</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -7,6 +7,8 @@ import com.fastbee.common.core.mq.DeviceReportBo;
|
|||||||
import com.fastbee.mq.redischannel.producer.IssueInstructionsProducer;
|
import com.fastbee.mq.redischannel.producer.IssueInstructionsProducer;
|
||||||
import com.fastbee.mq.service.impl.DeviceOtherMsgHandler;
|
import com.fastbee.mq.service.impl.DeviceOtherMsgHandler;
|
||||||
import com.fastbee.mqttclient.PubMqttClient;
|
import com.fastbee.mqttclient.PubMqttClient;
|
||||||
|
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
|
||||||
|
import com.fastbee.rechargecard.mapper.NgWaterPumpUsageRecordsMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
@ -29,6 +31,9 @@ public class DeviceOtherMsgConsumer {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IssueInstructionsProducer issueInstructionsProducer;
|
private IssueInstructionsProducer issueInstructionsProducer;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NgWaterPumpUsageRecordsMapper ngWaterPumpUsageRecordsMapper;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PubMqttClient pubMqttClient;
|
private PubMqttClient pubMqttClient;
|
||||||
@ -53,6 +58,14 @@ public class DeviceOtherMsgConsumer {
|
|||||||
//设备上报数据消息
|
//设备上报数据消息
|
||||||
if(topic.endsWith("hzlink/info/up")){
|
if(topic.endsWith("hzlink/info/up")){
|
||||||
deviceDataReportHandler(new String(data));
|
deviceDataReportHandler(new String(data));
|
||||||
|
//保存使用记录
|
||||||
|
NgWaterPumpUsageRecords pumpUsageRecords=new NgWaterPumpUsageRecords();
|
||||||
|
pumpUsageRecords.setDeviceNumber(serialNumber);
|
||||||
|
pumpUsageRecords.setMessageContent(new String(data));
|
||||||
|
int i = ngWaterPumpUsageRecordsMapper.insertNgWaterPumpUsageRecords(pumpUsageRecords);
|
||||||
|
if(i<1){
|
||||||
|
System.err.println("--------------------------保存使用记录失败!---------------------------");
|
||||||
|
}
|
||||||
//构建回复消息
|
//构建回复消息
|
||||||
Map<String,Object> reportMsg=new HashMap<>();
|
Map<String,Object> reportMsg=new HashMap<>();
|
||||||
reportMsg.put("code",0);
|
reportMsg.put("code",0);
|
||||||
|
@ -41,7 +41,7 @@ public class NgRechargeMachinesController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询充值机信息列表
|
* 查询充值机信息列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('rechargecard:machines:list')")
|
// @PreAuthorize("@ss.hasPermi('rechargecard:machines:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperation("查询充值机信息列表")
|
@ApiOperation("查询充值机信息列表")
|
||||||
public TableDataInfo list(NgRechargeMachines ngRechargeMachines)
|
public TableDataInfo list(NgRechargeMachines ngRechargeMachines)
|
||||||
@ -55,7 +55,7 @@ public class NgRechargeMachinesController extends BaseController
|
|||||||
* 导出充值机信息列表
|
* 导出充值机信息列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("导出充值机信息列表")
|
@ApiOperation("导出充值机信息列表")
|
||||||
@PreAuthorize("@ss.hasPermi('rechargecard:machines:export')")
|
// @PreAuthorize("@ss.hasPermi('rechargecard:machines:export')")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, NgRechargeMachines ngRechargeMachines)
|
public void export(HttpServletResponse response, NgRechargeMachines ngRechargeMachines)
|
||||||
{
|
{
|
||||||
@ -67,7 +67,7 @@ public class NgRechargeMachinesController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取充值机信息详细信息
|
* 获取充值机信息详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('rechargecard:machines:query')")
|
// @PreAuthorize("@ss.hasPermi('rechargecard:machines:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
@ApiOperation("获取充值机信息详细信息")
|
@ApiOperation("获取充值机信息详细信息")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
@ -78,7 +78,7 @@ public class NgRechargeMachinesController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增充值机信息
|
* 新增充值机信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('rechargecard:machines:add')")
|
// @PreAuthorize("@ss.hasPermi('rechargecard:machines:add')")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation("新增充值机信息")
|
@ApiOperation("新增充值机信息")
|
||||||
public AjaxResult add(@RequestBody NgRechargeMachines ngRechargeMachines)
|
public AjaxResult add(@RequestBody NgRechargeMachines ngRechargeMachines)
|
||||||
@ -89,7 +89,7 @@ public class NgRechargeMachinesController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改充值机信息
|
* 修改充值机信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('rechargecard:machines:edit')")
|
// @PreAuthorize("@ss.hasPermi('rechargecard:machines:edit')")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@ApiOperation("修改充值机信息")
|
@ApiOperation("修改充值机信息")
|
||||||
public AjaxResult edit(@RequestBody NgRechargeMachines ngRechargeMachines)
|
public AjaxResult edit(@RequestBody NgRechargeMachines ngRechargeMachines)
|
||||||
@ -100,7 +100,7 @@ public class NgRechargeMachinesController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除充值机信息
|
* 删除充值机信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('rechargecard:machines:remove')")
|
// @PreAuthorize("@ss.hasPermi('rechargecard:machines:remove')")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
@ApiOperation("删除充值机信息")
|
@ApiOperation("删除充值机信息")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.fastbee.rechargecard.mapper;
|
package com.fastbee.rechargecard.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
|
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@ -11,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
* @date 2024-12-19
|
* @date 2024-12-19
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface NgWaterPumpUsageRecordsMapper
|
public interface NgWaterPumpUsageRecordsMapper extends BaseMapper<NgWaterPumpUsageRecords>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询水泵设备使用记录
|
* 查询水泵设备使用记录
|
||||||
|
Loading…
x
Reference in New Issue
Block a user