87 lines
2.4 KiB
Plaintext
87 lines
2.4 KiB
Plaintext
|
|
package com.jysoft.trrafficVis.controller;
|
||
|
|
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.stereotype.Controller;
|
||
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||
|
|
|
||
|
|
import com.jysoft.trrafficVis.dto.TrrafficVisUserDto;
|
||
|
|
import com.jysoft.trrafficVis.service.trrafficVisService;
|
||
|
|
import com.jysoft.trrafficVis.vo.TrrafficVisUserVo;
|
||
|
|
import com.nationalelectirc.Constant.Constant;
|
||
|
|
import com.nationalelectirc.utils.RestResult;
|
||
|
|
import com.nationalelectric.greenH5.GreenBaseController;
|
||
|
|
import com.nationalelectric.greenH5.po.GreenUserInfo;
|
||
|
|
/**
|
||
|
|
* @author 10488
|
||
|
|
* 通行可视化
|
||
|
|
*/
|
||
|
|
@Controller
|
||
|
|
@RequestMapping("/trrafficVis")
|
||
|
|
public class TrrafficVisController extends GreenBaseController{
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private trrafficVisService service;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param vo
|
||
|
|
* @return
|
||
|
|
* 新增通行可视化人员数据
|
||
|
|
*/
|
||
|
|
@ResponseBody
|
||
|
|
@RequestMapping(value = "/addUserData", method = { RequestMethod.POST })
|
||
|
|
public RestResult addUserData(TrrafficVisUserVo vo) {
|
||
|
|
try {
|
||
|
|
GreenUserInfo info = getUserInfo(vo.getUserId());
|
||
|
|
if (info == null) {
|
||
|
|
return new RestResult(Constant.FAILED, "非法用户");
|
||
|
|
}
|
||
|
|
} catch (Exception e) {
|
||
|
|
return new RestResult(Constant.FAILED, "非法用户");
|
||
|
|
}
|
||
|
|
return service.addUserData(vo);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param vo
|
||
|
|
* @return
|
||
|
|
* 获取通行可视化人员数据-登录人
|
||
|
|
*/
|
||
|
|
@ResponseBody
|
||
|
|
@RequestMapping(value = "/getUserLists", method = { RequestMethod.POST })
|
||
|
|
public RestResult getUserLists(TrrafficVisUserDto dto) {
|
||
|
|
try {
|
||
|
|
GreenUserInfo info = getUserInfo(dto.getUserId());
|
||
|
|
if (info == null) {
|
||
|
|
return new RestResult(Constant.FAILED, "非法用户");
|
||
|
|
}
|
||
|
|
} catch (Exception e) {
|
||
|
|
return new RestResult(Constant.FAILED, "非法用户");
|
||
|
|
}
|
||
|
|
return service.getUserLists(dto);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param entity
|
||
|
|
* @return
|
||
|
|
* 获取通行可视化人员详情数据
|
||
|
|
*/
|
||
|
|
@ResponseBody
|
||
|
|
@RequestMapping(value = "/getUserInfo", method = { RequestMethod.POST })
|
||
|
|
public RestResult getUserInfo(TrrafficVisUserDto dto) {
|
||
|
|
try {
|
||
|
|
GreenUserInfo info = getUserInfo(dto.getUserId());
|
||
|
|
if (info == null) {
|
||
|
|
return new RestResult(Constant.FAILED, "非法用户");
|
||
|
|
}
|
||
|
|
} catch (Exception e) {
|
||
|
|
return new RestResult(Constant.FAILED, "非法用户");
|
||
|
|
}
|
||
|
|
return service.getUserInfo(dto);
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|