|
@@ -3,6 +3,7 @@ package cn.com.usky.iot.controller;
|
|
|
import javax.annotation.PostConstruct;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import cn.com.usky.iot.auth.TokenAuthBO;
|
|
|
import cn.com.usky.iot.auth.TokenAuthService;
|
|
@@ -26,13 +27,16 @@ public class FrontpageController {
|
|
|
@Resource
|
|
|
private YtiotFrontpageQueryService ytiotFrontpageQueryService;
|
|
|
private static FrontpageController frontpageController;
|
|
|
+
|
|
|
@PostConstruct
|
|
|
public void init() {
|
|
|
frontpageController = this;
|
|
|
frontpageController.ytiotFrontpageQueryService = this.ytiotFrontpageQueryService;
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private TokenAuthService tokenAuthService;
|
|
|
+
|
|
|
@RequestMapping(value = "/getFrontpageQuery", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
public ModelAndView getFrontpageQuery(@RequestParam(value = "queryJson", required = false) String queryJson) {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
@@ -50,7 +54,8 @@ public class FrontpageController {
|
|
|
@RequestMapping(value = "/getCurrentObjectListByCompanyId", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
public ModelAndView getCurrentObjectListByCompanyId(
|
|
|
@RequestParam(value = "queryJson", required = false) String queryJson,
|
|
|
- HttpServletRequest request
|
|
|
+ HttpServletRequest request,
|
|
|
+ HttpServletResponse response
|
|
|
) {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
@@ -60,18 +65,19 @@ public class FrontpageController {
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("check", false);
|
|
|
json.put("errMsg", "权限错误,请重新登录");
|
|
|
- mav.addObject("ret_str", json.toJSONString());
|
|
|
+ mav.addObject("index", json.toJSONString());
|
|
|
+ return mav;
|
|
|
}
|
|
|
mav.setViewName("return");
|
|
|
//通过获取用户信息
|
|
|
YtiotTAdmin o = (YtiotTAdmin) tokenAuthBO.getData().get(Constants.USER_INFO);
|
|
|
-
|
|
|
JSONObject jsonObject = JSONObject.parseObject(queryJson);
|
|
|
jsonObject.put("V_LOGINNAME", o.getVLoginname());
|
|
|
jsonObject.put("V_PASSWORD", o.getVPassword());
|
|
|
try {
|
|
|
String ret = frontpageController.ytiotFrontpageQueryService.getCurrentObjectListByCompanyId(jsonObject.toString());
|
|
|
mav.addObject("ret_str", ret);
|
|
|
+ return mav;
|
|
|
} catch (Exception e) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e.printStackTrace();
|