Commit 1c0c274e authored by 何金镒's avatar 何金镒

场景相关 2

parent d7dcfb2d
...@@ -57,7 +57,7 @@ public class DeviceTools { ...@@ -57,7 +57,7 @@ public class DeviceTools {
public String triggerScene(@ToolParam(description = "主机号")String ccuName, public String triggerScene(@ToolParam(description = "主机号")String ccuName,
@ToolParam(description = "场景ID")String devId, @ToolParam(description = "场景ID")String devId,
@ToolParam(description = "场景类型,type等于scene")String type){ @ToolParam(description = "场景类型,type等于scene")String type){
log.info("mcp调用--->根据主机号和场景ID控制关闭设备....ccuName:{},devId:{},type:{}",ccuName,devId,type); log.info("mcp调用--->根据主机号和场景ID触发场景....ccuName:{},devId:{},type:{}",ccuName,devId,type);
return konkeIotServer.optScene(CcuUtils.getCcuName(ccuName), devId); return konkeIotServer.optScene(CcuUtils.getCcuName(ccuName), devId);
} }
......
...@@ -22,7 +22,7 @@ public class DeviceController { ...@@ -22,7 +22,7 @@ public class DeviceController {
@GetMapping("/findSycDeviceByCcu") @GetMapping("/findSycDeviceByCcu")
public JSONArray findSycDeviceByCcu(@RequestParam(name = "ccuName") String ccuName){ public JSONArray findSycDeviceByCcu(@RequestParam(name = "ccuName") String ccuName){
log.info("findSycDeviceByCcu..根据主机号查询设备..ccuName:{}",ccuName); log.info("findSycDeviceByCcu..根据主机号查询设备..ccuName:{}",ccuName);
return sycDeviceService.findByCcu(ccuName); return sycDeviceService.findByCcu(ccuName,null);
} }
@GetMapping("/synchronousDevice") @GetMapping("/synchronousDevice")
......
...@@ -31,10 +31,13 @@ public class SycDeviceService { ...@@ -31,10 +31,13 @@ public class SycDeviceService {
@Autowired @Autowired
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
public JSONArray findByCcu(String ccuName){ public JSONArray findByCcu(String ccuName,Integer type){
log.info("findByCcu..根据主机号查询设备..ccuName:{}",ccuName); log.info("findByCcu..根据主机号查询设备..ccuName:{}",ccuName);
QueryWrapper<SynDevice> wrapper = new QueryWrapper<>(); QueryWrapper<SynDevice> wrapper = new QueryWrapper<>();
wrapper.eq("ccuId", ccuName); wrapper.eq("ccuId", ccuName);
if(type!=null){
wrapper.eq("type", type);
}
List<SynDevice> list = synDeviceService.list(wrapper); List<SynDevice> list = synDeviceService.list(wrapper);
JSONArray jsonArray = null; JSONArray jsonArray = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment