|
|
|
@ -9,8 +9,10 @@ import com.psdc.entity.vo.DeviceStatusVo; |
|
|
|
|
import com.psdc.service.IPsdcControlLogService; |
|
|
|
|
import com.psdc.service.IPsdcDeviceService; |
|
|
|
|
import com.psdc.service.IPsdcSceneService; |
|
|
|
|
import com.psdc.service.impl.PsdcStrategyLogService; |
|
|
|
|
import com.psdc.utils.SecurityUtils; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
@ -35,6 +37,9 @@ public class ManualController extends BaseController { |
|
|
|
|
@Resource |
|
|
|
|
private IPsdcSceneService psdcSceneService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private PsdcStrategyLogService psdcStrategyLogService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询设备状态列表 |
|
|
|
|
* @return ajax |
|
|
|
@ -134,8 +139,22 @@ public class ManualController extends BaseController { |
|
|
|
|
@PreAuthorize("@ss.hasPermi('control:manual:temperature')") |
|
|
|
|
@PostMapping("/senceControl") |
|
|
|
|
public AjaxResult senceControl(@RequestBody List<JSONObject> jsonObjectList){ |
|
|
|
|
psdcDeviceService.sceneControl(jsonObjectList); |
|
|
|
|
return AjaxResult.success("策略正在执行中,请耐心等待,感谢配合!"); |
|
|
|
|
Integer status = psdcStrategyLogService.selMyThisLog(jsonObjectList.get(0).getInteger("sceneCode")).getRuntimeStatus(); |
|
|
|
|
|
|
|
|
|
AjaxResult ajaxResult ; |
|
|
|
|
if ("1".equals(String.valueOf(status))){ |
|
|
|
|
Long code = psdcDeviceService.sceneControl(jsonObjectList); |
|
|
|
|
String s = psdcStrategyLogService.selMyNewLog(code).getStrategyRunRes(); |
|
|
|
|
|
|
|
|
|
if (null != s){ |
|
|
|
|
ajaxResult = new AjaxResult(200, "查询成功", s.split(",")); |
|
|
|
|
} else { |
|
|
|
|
ajaxResult = new AjaxResult(200, "策略正在执行中,请耐心等待,谢谢配合!"); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
ajaxResult = new AjaxResult(200, "当前还有策略正在执行中,请耐心等待,谢谢配合!"); |
|
|
|
|
} |
|
|
|
|
return ajaxResult; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|