新增设备查询订单状态报文处理

This commit is contained in:
蒾酒
2025-01-05 23:31:53 +08:00
parent 81793c325f
commit 77216fb4c1
2 changed files with 99 additions and 110 deletions

View File

@ -165,28 +165,28 @@ public class UserRechargeCardsServiceImpl implements IUserRechargeCardsService
throw new ServiceException("充值机编码为空!!!");
}
//构建主题
String topic ="hzlink/147/"+ngUserRechargeRecords.getSerialNumber()+"/cmd/down";
// String topic ="hzlink/147/"+ngUserRechargeRecords.getSerialNumber()+"/cmd/down";
//构建消息
Map<String,Object> param = new HashMap<>();
// Map<String,Object> param = new HashMap<>();
//远程阀控
param.put("cmd",1000);
Map<String,Object> data = new HashMap<>();
data.put("orderNum", ngUserRechargeRecords.getId());//订单号
data.put("cardNum",Integer.parseInt(cardNumber));//卡号
data.put("areaCode",Integer.parseInt(areaCode));//区域号
data.put("investBalance",balance.doubleValue()*100);//充值的金额
data.put("investWater",100*100);//充值的水量
param.put("data",data);
try{
pubMqttClient.publish(1,true,topic, JSONUtil.toJsonStr(param));
}catch (Exception e)
{
throw new ServiceException("消息发布失败");
}
ngUserRechargeRecords.setStatus(2);//状态更改为已下发
userRechargeRecordsMapper.updateNgUserRechargeRecords(ngUserRechargeRecords);
// param.put("cmd",1000);
// Map<String,Object> data = new HashMap<>();
// data.put("orderNum", ngUserRechargeRecords.getId());//订单号
// data.put("cardNum",Integer.parseInt(cardNumber));//卡号
// data.put("areaCode",Integer.parseInt(areaCode));//区域号
// data.put("investBalance",balance.doubleValue()*100);//充值的金额
// data.put("investWater",100*100);//充值的水量
//
// param.put("data",data);
// try{
// pubMqttClient.publish(1,true,topic, JSONUtil.toJsonStr(param));
//
// }catch (Exception e)
// {
// throw new ServiceException("消息发布失败");
// }
// ngUserRechargeRecords.setStatus(2);//状态更改为已下发
// userRechargeRecordsMapper.updateNgUserRechargeRecords(ngUserRechargeRecords);
// int i = userRechargeCardsMapper.updateUserRechargeCards(info);
return 1;
}