Commit 8f0e87e2 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent 34185658
......@@ -2,10 +2,6 @@ package com.devplatform.admin.config;
import com.devplatform.admin.modules.sys.oauth2.Oauth2Filter;
import com.devplatform.admin.modules.sys.oauth2.Oauth2Realm;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.servlet.Filter;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.session.mgt.SessionManager;
import org.apache.shiro.spring.LifecycleBeanPostProcessor;
......@@ -17,6 +13,11 @@ import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreato
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.Filter;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Shiro配置
*
......@@ -81,7 +82,7 @@ public class ShiroConfig {
filterMap.put("/push/websocket", "anon");
filterMap.put("/endpoint", "anon");
filterMap.put("/weChat/**", "anon");
filterMap.put("/alramsSend/sendAlramsInfo", "anon");
filterMap.put("/equipment/sendParamsInfo", "anon");
filterMap.put("/liStation/queryById", "anon");
filterMap.put("/sysStationTakeover/anyRouter", "anon");
filterMap.put("/**", "oauth2");
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.devplatform.admin.common.scheduling.SimpleJob;
import com.devplatform.admin.common.utils.AbstractController;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.config.WebSocket;
import com.devplatform.admin.modules.eq.bean.TimedTask;
import com.devplatform.admin.modules.eq.service.EquipmentService;
import com.devplatform.admin.modules.eq.service.TimedTaskService;
......@@ -48,6 +49,8 @@ public class EquipmentController extends AbstractController {
private SysSystemRunningTimeService sysSystemRunningTimeService;
@Autowired
private TimedTaskService timedTaskService;
@Autowired
private WebSocket webSocket;
/**
* 获取每个设备最新的参数值
......@@ -60,6 +63,18 @@ public class EquipmentController extends AbstractController {
return R.ok().put("bean", list);
}
/**
* 发送每个设备最新的参数值
* @return
*/
@ApiOperation(value="发送每个设备最新的参数值", notes="发送每个设备最新的参数值")
@PostMapping("/sendParamsInfo")
public R sendParamsInfo() {
Map<String,Object> list = equipmentService.getList();
// webSocket.sendAllMessage(JSONObject.toJSONString(list));
return R.ok();
}
/**
* 切换人工/节能模式
* @return
......
......@@ -47,11 +47,17 @@
(select resource_type,count(1) as cNum from
sys_fault_alarm
where 1=1
<if test="params.startTime != null and params.startTime != ''">
and create_date &gt;= #{params.startTime}
<if test="params.type == 1">
and TO_DAYS(start_time) = TO_DAYS(NOW())
</if>
<if test="params.endTime != null and params.endTime != ''">
and create_date &lt;= #{params.endTime}
<if test="params.type == 2">
and YEARWEEK(date_format(start_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
</if>
<if test="params.type == 3">
and DATE_FORMAT(start_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="params.type == 4">
and DATE_FORMAT(start_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
</if>
group by resource_type) t
left join sys_dictionary sd on sd.id = t.resource_type
......@@ -63,11 +69,17 @@
(select resource_id,count(1) as cNum from
sys_fault_alarm
where 1=1
<if test="params.startTime != null and params.startTime != ''">
and create_date &gt;= #{params.startTime}
<if test="params.type == 1">
and TO_DAYS(start_time) = TO_DAYS(NOW())
</if>
<if test="params.type == 2">
and YEARWEEK(date_format(start_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
</if>
<if test="params.type == 3">
and DATE_FORMAT(start_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</if>
<if test="params.endTime != null and params.endTime != ''">
and create_date &lt;= #{params.endTime}
<if test="params.type == 4">
and DATE_FORMAT(start_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' )
</if>
group by resource_id) t
left join li_resource lr on lr.id = t.resource_id
......
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