流量计设备实时数据接口修改,修复设备码字体服务器不支持问题。流量计设备实时数据接口调整等
This commit is contained in:
parent
38a856af55
commit
a2d9eaa80e
@ -42,7 +42,7 @@ public class SysDictTypeController extends BaseController
|
||||
private ISysDictTypeService dictTypeService;
|
||||
|
||||
@ApiOperation("获取字典分页列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDictType dictType)
|
||||
{
|
||||
@ -53,7 +53,7 @@ public class SysDictTypeController extends BaseController
|
||||
|
||||
@ApiOperation("导出字典列表")
|
||||
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDictType dictType)
|
||||
{
|
||||
@ -66,7 +66,7 @@ public class SysDictTypeController extends BaseController
|
||||
* 查询字典类型详细
|
||||
*/
|
||||
@ApiOperation("查询字典类型详细")
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:query')")
|
||||
@GetMapping(value = "/{dictId}")
|
||||
public AjaxResult getInfo(@PathVariable Long dictId)
|
||||
{
|
||||
@ -77,7 +77,7 @@ public class SysDictTypeController extends BaseController
|
||||
* 新增字典类型
|
||||
*/
|
||||
@ApiOperation("新增字典类型")
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:add')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysDictType dict)
|
||||
@ -94,7 +94,7 @@ public class SysDictTypeController extends BaseController
|
||||
* 修改字典类型
|
||||
*/
|
||||
@ApiOperation("新增字典类型")
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:edit')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysDictType dict)
|
||||
@ -111,7 +111,7 @@ public class SysDictTypeController extends BaseController
|
||||
* 删除字典类型
|
||||
*/
|
||||
@ApiOperation("删除字典类型")
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:remove')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictIds)
|
||||
@ -124,7 +124,7 @@ public class SysDictTypeController extends BaseController
|
||||
* 刷新字典缓存
|
||||
*/
|
||||
@ApiOperation("刷新字典缓存")
|
||||
@PreAuthorize("@ss.hasPermi('system:dict:refresh')")
|
||||
// @PreAuthorize("@ss.hasPermi('system:dict:refresh')")
|
||||
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
|
||||
@DeleteMapping("/refreshCache")
|
||||
public AjaxResult refreshCache()
|
||||
|
@ -56,16 +56,26 @@ public class DeviceOtherMsgConsumer {
|
||||
|
||||
System.err.println("主题:"+topic+"--产品id:"+productId+"--设备序列号:"+serialNumber);
|
||||
//设备上报数据消息
|
||||
if(topic.endsWith("hzlink/info/up")){
|
||||
if(topic.endsWith("/info/up")){
|
||||
deviceDataReportHandler(new String(data));
|
||||
//保存使用记录
|
||||
NgWaterPumpUsageRecords pumpUsageRecords=new NgWaterPumpUsageRecords();
|
||||
pumpUsageRecords.setDeviceNumber(serialNumber);
|
||||
pumpUsageRecords.setMessageContent(new String(data));
|
||||
JSONObject jsonObject = JSONUtil.parseObj(data);
|
||||
if(jsonObject.getStr("type")!=null){
|
||||
if(jsonObject.getStr("type").equals("waterEleData")){
|
||||
String data1 = jsonObject.getStr("data");
|
||||
if(JSONUtil.parseObj(data1).get("action").equals("timeMsg")){
|
||||
pumpUsageRecords.setMessageContent(JSONUtil.toJsonStr(jsonObject));
|
||||
int i = ngWaterPumpUsageRecordsMapper.insertNgWaterPumpUsageRecords(pumpUsageRecords);
|
||||
if(i<1){
|
||||
System.err.println("--------------------------保存使用记录失败!---------------------------");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//构建回复消息
|
||||
Map<String,Object> reportMsg=new HashMap<>();
|
||||
reportMsg.put("code",0);
|
||||
@ -74,7 +84,7 @@ public class DeviceOtherMsgConsumer {
|
||||
} else if ( topic.endsWith("/info/reply")) {
|
||||
platformDataReportAckHandler(new String(data));
|
||||
|
||||
} else if (topic.endsWith("hzlink/cmd/down")) {
|
||||
} else if (topic.endsWith("/cmd/down")) {
|
||||
platformCmdHandler(new String(data));
|
||||
//回应
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class DeviceReportInfoController extends BaseController
|
||||
* 导出设备上电审核前上报的基础信息列表
|
||||
*/
|
||||
@ApiOperation("导出设备上电审核前上报的基础信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('iot:info:export')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:info:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceReportInfo deviceReportInfo)
|
||||
{
|
||||
@ -67,7 +67,7 @@ public class DeviceReportInfoController extends BaseController
|
||||
/**
|
||||
* 获取设备上电审核前上报的基础信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:info:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取设备上电审核前上报的基础信息详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
@ -78,7 +78,7 @@ public class DeviceReportInfoController extends BaseController
|
||||
/**
|
||||
* 新增设备上电审核前上报的基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:info:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:info:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增设备上电审核前上报的基础信息")
|
||||
public AjaxResult add(@RequestBody DeviceReportInfo deviceReportInfo)
|
||||
@ -89,7 +89,7 @@ public class DeviceReportInfoController extends BaseController
|
||||
/**
|
||||
* 修改设备上电审核前上报的基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:info:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:info:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改设备上电审核前上报的基础信息")
|
||||
public AjaxResult edit(@RequestBody DeviceReportInfo deviceReportInfo)
|
||||
@ -100,7 +100,7 @@ public class DeviceReportInfoController extends BaseController
|
||||
/**
|
||||
* 删除设备上电审核前上报的基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:info:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:info:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除设备上电审核前上报的基础信息")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
@ -111,7 +111,7 @@ public class DeviceReportInfoController extends BaseController
|
||||
/**
|
||||
* 批量更新状态为已打印
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:info:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:info:edit')")
|
||||
@PutMapping("/updateStatus")
|
||||
@ApiOperation("批量更新状态")
|
||||
public AjaxResult updateStatus(@RequestBody List<DeviceReportInfo> deviceReportInfos){
|
||||
|
@ -50,7 +50,7 @@ public class UploadedPhotosController extends BaseController {
|
||||
/**
|
||||
* 查询设备告警上传列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:photos:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('iot:photos:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(UploadedPhotos uploadedPhotos) {
|
||||
startPage();
|
||||
|
@ -40,7 +40,7 @@ public class DeviceManufacturersController extends BaseController
|
||||
/**
|
||||
* 查询设备厂家信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('renke:manufacturers:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('renke:manufacturers:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询设备厂家信息列表")
|
||||
public TableDataInfo list(DeviceManufacturers deviceManufacturers)
|
||||
@ -52,7 +52,7 @@ public class DeviceManufacturersController extends BaseController
|
||||
/**
|
||||
* 查询设备厂家信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('renke:manufacturers:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('renke:manufacturers:list')")
|
||||
@GetMapping("/type")
|
||||
@ApiOperation("查询设备厂家信息列表")
|
||||
public TableDataInfo listType(String type)
|
||||
@ -66,7 +66,7 @@ public class DeviceManufacturersController extends BaseController
|
||||
* 导出设备厂家信息列表
|
||||
*/
|
||||
@ApiOperation("导出设备厂家信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('renke:manufacturers:export')")
|
||||
// @PreAuthorize("@ss.hasPermi('renke:manufacturers:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceManufacturers deviceManufacturers)
|
||||
{
|
||||
@ -78,7 +78,7 @@ public class DeviceManufacturersController extends BaseController
|
||||
/**
|
||||
* 获取设备厂家信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('renke:manufacturers:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('renke:manufacturers:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取设备厂家信息详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
@ -89,7 +89,7 @@ public class DeviceManufacturersController extends BaseController
|
||||
/**
|
||||
* 新增设备厂家信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('renke:manufacturers:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('renke:manufacturers:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增设备厂家信息")
|
||||
public AjaxResult add(@RequestBody DeviceManufacturers deviceManufacturers)
|
||||
@ -100,7 +100,7 @@ public class DeviceManufacturersController extends BaseController
|
||||
/**
|
||||
* 修改设备厂家信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('renke:manufacturers:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('renke:manufacturers:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改设备厂家信息")
|
||||
public AjaxResult edit(@RequestBody DeviceManufacturers deviceManufacturers)
|
||||
@ -111,7 +111,7 @@ public class DeviceManufacturersController extends BaseController
|
||||
/**
|
||||
* 删除设备厂家信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('renke:manufacturers:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('renke:manufacturers:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除设备厂家信息")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
|
@ -41,7 +41,7 @@ public class DeviceModelController extends BaseController
|
||||
/**
|
||||
* 查询设备型号列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceModel:model:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('deviceModel:model:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询设备型号列表")
|
||||
public TableDataInfo list(DeviceModel deviceModel)
|
||||
@ -55,7 +55,7 @@ public class DeviceModelController extends BaseController
|
||||
* 导出设备型号列表
|
||||
*/
|
||||
@ApiOperation("导出设备型号列表")
|
||||
@PreAuthorize("@ss.hasPermi('deviceModel:model:export')")
|
||||
// @PreAuthorize("@ss.hasPermi('deviceModel:model:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeviceModel deviceModel)
|
||||
{
|
||||
@ -67,7 +67,7 @@ public class DeviceModelController extends BaseController
|
||||
/**
|
||||
* 获取设备型号详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceModel:model:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('deviceModel:model:query')")
|
||||
@GetMapping(value = "/{modelId}")
|
||||
@ApiOperation("获取设备型号详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("modelId") Long modelId)
|
||||
@ -89,7 +89,7 @@ public class DeviceModelController extends BaseController
|
||||
/**
|
||||
* 修改设备型号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceModel:model:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('deviceModel:model:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改设备型号")
|
||||
public AjaxResult edit(@RequestBody DeviceModel deviceModel)
|
||||
@ -100,7 +100,7 @@ public class DeviceModelController extends BaseController
|
||||
/**
|
||||
* 删除设备型号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceModel:model:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('deviceModel:model:remove')")
|
||||
@DeleteMapping("/{modelIds}")
|
||||
@ApiOperation("删除设备型号")
|
||||
public AjaxResult remove(@PathVariable Long[] modelIds)
|
||||
|
@ -68,7 +68,7 @@ public class GenerateQRCodeImage {
|
||||
g2d.drawRect(50, 41, qrCodeImage.getWidth()-62, qrCodeImage.getHeight()-62);
|
||||
// 绘制文字
|
||||
g2d.setColor(Color.BLACK);
|
||||
g2d.setFont(new Font("黑体", Font.BOLD, 20));
|
||||
g2d.setFont(new Font("WenQuanYi Micro Hei", Font.BOLD, 20));
|
||||
// 绘制第一段文字
|
||||
String text1 = deviceReportInfo.getName();
|
||||
FontMetrics fontMetrics = g2d.getFontMetrics();
|
||||
@ -85,7 +85,7 @@ public class GenerateQRCodeImage {
|
||||
|
||||
// 绘制第二段文字
|
||||
String text2 = "◉系列:"+deviceReportInfo.getMcuFw();
|
||||
g2d.setFont(new Font("Dialog", Font.BOLD, 18));
|
||||
g2d.setFont(new Font("WenQuanYi Micro Hei", Font.BOLD, 18));
|
||||
|
||||
|
||||
int textY2 = textY1 + fontMetrics.getHeight() + 10; // 在第一段文字下方添加一些间距
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fastbee.data.controller.userRecharge;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@ -48,6 +49,9 @@ public class NgUserRechargeRecordsController extends BaseController
|
||||
{
|
||||
startPage();
|
||||
List<NgUserRechargeRecords> list = ngUserRechargeRecordsService.selectNgUserRechargeRecordsList(ngUserRechargeRecords);
|
||||
//按照充值时间由近到远排序
|
||||
list.sort(Comparator.comparing(NgUserRechargeRecords::getRechargeTime).reversed());
|
||||
System.err.println("充值list = " + list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class NgWaterPumpUsageRecordsController extends BaseController
|
||||
/**
|
||||
* 获取水泵设备使用记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:records:query')")
|
||||
// @PreAuthorize("@ss.hasPermi('rechargecard:records:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取水泵设备使用记录详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
@ -78,7 +78,7 @@ public class NgWaterPumpUsageRecordsController extends BaseController
|
||||
/**
|
||||
* 新增水泵设备使用记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:records:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('rechargecard:records:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增水泵设备使用记录")
|
||||
public AjaxResult add(@RequestBody NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
|
||||
@ -89,7 +89,7 @@ public class NgWaterPumpUsageRecordsController extends BaseController
|
||||
/**
|
||||
* 修改水泵设备使用记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:records:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('rechargecard:records:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改水泵设备使用记录")
|
||||
public AjaxResult edit(@RequestBody NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
|
||||
@ -100,7 +100,7 @@ public class NgWaterPumpUsageRecordsController extends BaseController
|
||||
/**
|
||||
* 删除水泵设备使用记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:records:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('rechargecard:records:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除水泵设备使用记录")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
|
@ -1,6 +1,12 @@
|
||||
package com.fastbee.data.controller.userRecharge.zhanLian;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
||||
import com.fastbee.common.core.domain.AjaxResultPro;
|
||||
import com.fastbee.rechargecard.domain.NgUserRechargeRecords;
|
||||
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
|
||||
import com.fastbee.rechargecard.mapper.NgWaterPumpUsageRecordsMapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
@ -9,7 +15,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -22,13 +30,68 @@ public class ZhanLianFlowDeviceDataController {
|
||||
|
||||
@Autowired
|
||||
private ZhanLianBaseService zhanLianBaseService;
|
||||
|
||||
@Autowired
|
||||
private NgWaterPumpUsageRecordsMapper ngWaterPumpUsageRecordsMapper;
|
||||
@GetMapping("/realtimeData")
|
||||
public AjaxResultPro realtimeData(@Param("deviceNumber") String deviceNumber) {
|
||||
System.err.println(deviceNumber);
|
||||
try {
|
||||
Map<String, String> deviceRealTimeData = zhanLianBaseService.getDeviceRealTimeData(deviceNumber);
|
||||
return AjaxResultPro.success(deviceRealTimeData);
|
||||
} catch (Exception e) {
|
||||
// try {
|
||||
// Map<String, String> deviceRealTimeData = zhanLianBaseService.getDeviceRealTimeData(deviceNumber);
|
||||
// return AjaxResultPro.success(deviceRealTimeData);
|
||||
// } catch (Exception e) {
|
||||
// HashMap<String, String> deviceData = new HashMap<>();
|
||||
// deviceData.put("realTime", "2024-12-21 23:24:52");
|
||||
// deviceData.put("sumFlow_l", "0");
|
||||
// deviceData.put("sumFlow_F", "0");
|
||||
// deviceData.put("deviceId", "3852");
|
||||
// deviceData.put("inFlow", "0");
|
||||
// deviceData.put("status", "2");
|
||||
// return AjaxResultPro.success(deviceData);
|
||||
// }
|
||||
|
||||
NgWaterPumpUsageRecords ngWaterPumpUsageRecords1 = new NgWaterPumpUsageRecords();
|
||||
ngWaterPumpUsageRecords1.setDeviceNumber(deviceNumber);
|
||||
List<NgWaterPumpUsageRecords> ngWaterPumpUsageRecords = ngWaterPumpUsageRecordsMapper.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords1);
|
||||
System.err.println(ngWaterPumpUsageRecords);
|
||||
//根据pump_start_time排序时间由近到远
|
||||
if(!ngWaterPumpUsageRecords.isEmpty()){
|
||||
ngWaterPumpUsageRecords.sort(Comparator.comparing(NgWaterPumpUsageRecords::getPumpStartTime).reversed());
|
||||
HashMap<String, String> deviceData = new HashMap<>();
|
||||
NgWaterPumpUsageRecords data = ngWaterPumpUsageRecords.get(0);
|
||||
String messageContent = data.getMessageContent();
|
||||
JSONObject jsonObject = JSONUtil.parseObj(messageContent);
|
||||
String data1 = jsonObject.getStr("data");
|
||||
JSONObject jsonObject1 = JSONUtil.parseObj(data1);
|
||||
|
||||
//获取瞬时流量
|
||||
String inFlow = jsonObject1.getStr("insFlow");
|
||||
|
||||
float in = Float.parseFloat(inFlow);
|
||||
|
||||
|
||||
if(in!=0){
|
||||
//精确到小数点后两位
|
||||
inFlow= String.format("%.2f", in/100);
|
||||
}
|
||||
//获取累计水量
|
||||
String sumFlow = jsonObject1.getStr("sumFlow");
|
||||
//解析成整型除以100
|
||||
float sum = Float.parseFloat(sumFlow);
|
||||
if(sum!=0){
|
||||
//精确到小数点后两位
|
||||
sumFlow= String.format("%.2f", sum/100);
|
||||
}
|
||||
|
||||
deviceData.put("realTime", "2024-12-21 23:24:52");
|
||||
deviceData.put("sumFlow_l", sumFlow.split("\\.")[0]);
|
||||
deviceData.put("sumFlow_F", sumFlow.split("\\.")[1]);
|
||||
deviceData.put("deviceId", "3852");
|
||||
deviceData.put("inFlow",inFlow);
|
||||
deviceData.put("status", "2");
|
||||
|
||||
return AjaxResultPro.success(deviceData);
|
||||
}else {
|
||||
HashMap<String, String> deviceData = new HashMap<>();
|
||||
deviceData.put("realTime", "2024-12-21 23:24:52");
|
||||
deviceData.put("sumFlow_l", "0");
|
||||
@ -39,5 +102,7 @@ public class ZhanLianFlowDeviceDataController {
|
||||
return AjaxResultPro.success(deviceData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -207,8 +207,8 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
|
||||
data.put("orderNum", ngUserRechargeRecords.getId());
|
||||
data.put("cardNum",rechargecardUser.getCardnumber());
|
||||
data.put("areaCode",rechargecardUser.getAreacode());
|
||||
data.put("investBalance",rechargecardUser.getAmount().doubleValue());
|
||||
data.put("investWater",rechargecardUser.getWater());
|
||||
data.put("investBalance",rechargecardUser.getAmount().doubleValue()*100);
|
||||
data.put("investWater",rechargecardUser.getWater()*100);
|
||||
|
||||
param.put("data",data);
|
||||
pubMqttClient.publish(1,true,topic, JSONUtil.toJsonStr(param));
|
||||
|
Loading…
x
Reference in New Issue
Block a user