lzq 2026-03-06 14:16:42 +08:00
parent 1fea77bab2
commit b9154f900d
2 changed files with 13 additions and 9 deletions

View File

@ -120,7 +120,7 @@ public class DeviceInfoController {
} }
/** /**
* 1 * 1,
*/ */
@PostMapping("/report1") @PostMapping("/report1")
public Map<String, Object> report1(@RequestBody JSONObject data) { public Map<String, Object> report1(@RequestBody JSONObject data) {
@ -128,7 +128,7 @@ public class DeviceInfoController {
} }
/** /**
* 2 * 2
*/ */
@PostMapping("/report2") @PostMapping("/report2")
public Map<String, Object> report2(@RequestBody JSONObject data) { public Map<String, Object> report2(@RequestBody JSONObject data) {

View File

@ -202,10 +202,20 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
* @param pageParam * @param pageParam
* @return PageResult&lt;DeviceInfoEntity&gt; * @return PageResult&lt;DeviceInfoEntity&gt;
*/ */
public PageResult<DeviceInfoEntity> paging(PageParam pageParam, DeviceInfoEntity deviceInfoEntity) { public PageResult<DeviceInfoEntity> paging(PageParam pageParam, DeviceInfoEntity deviceInfoEntity) {
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<DeviceInfoEntity>query(deviceInfoEntity))); return PageResult.of(this.page(pageParam.toPage(), Wrappers.<DeviceInfoEntity>query(deviceInfoEntity)));
} }
private void open(String sn, String cid) {
log.info("开门: {} {}", sn, cid);
Mqtt.publish(cid + "/1/barrier", MapUtil.builder()
.put("deviceNo", sn)
.build());
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, Object> report1(JSONObject data) { public Map<String, Object> report1(JSONObject data) {
MapBuilder<String, Object> resBuilder = MapUtil.<String, Object>builder() MapBuilder<String, Object> resBuilder = MapUtil.<String, Object>builder()
@ -336,13 +346,6 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
.build(); .build();
} }
private void open(String sn, String cid) {
log.info("开门: {} {}", sn, cid);
Mqtt.publish(cid + "/1/barrier", MapUtil.builder()
.put("deviceNo", sn)
.build());
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, Object> report2(JSONObject data) { public Map<String, Object> report2(JSONObject data) {
MapBuilder<String, Object> resBuilder = MapUtil.<String, Object>builder() MapBuilder<String, Object> resBuilder = MapUtil.<String, Object>builder()
@ -513,6 +516,7 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
.build(); .build();
} }
private void playVoice(String sn, String cid, String content, Object... params) { private void playVoice(String sn, String cid, String content, Object... params) {
String format = StrUtil.format(content, params); String format = StrUtil.format(content, params);
log.info("播语音: {} {} {}", sn, cid, format); log.info("播语音: {} {} {}", sn, cid, format);