hz-zhhq-app-service/greenH5modul/.svn/pristine/a9/a95ac9208b3a94a1fd9217db5cf...

332 lines
8.6 KiB
Plaintext

package com.jysoft.card.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
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.alibaba.fastjson.JSONObject;
import com.jysoft.card.service.CardService;
import com.jysoft.card.service.GreenCard;
import com.jysoft.property.entity.GreenPropertyEntity;
import com.jysoft.visitor.service.VisitorService;
import com.jysoft.visitor.util.ArtemisPost;
import com.nationalelectirc.Constant.Constant;
import com.nationalelectirc.utils.RestResult;
import com.nationalelectirc.utils.Utils;
import com.nationalelectric.greenH5.GreenBaseController;
import com.nationalelectric.greenH5.po.GreenUserInfo;
import com.nationalelectric.greenH5.po.GreenVisitor;
import com.nationalelectric.greenH5.po.VisitorEventNotify;
import com.sgcc.uap.persistence.IHibernateDao;
/**
* @author bonus
* @date 2023-06-13
* @描述:访客管理
*
*/
@Controller
@RequestMapping("/greenCard")
public class CardController extends GreenBaseController {
@Autowired
private CardService service;
/**
* 添加门禁卡
*
* @param entity
* 数据
* @return 响应数据
*/
@ResponseBody
@RequestMapping(value = "/addCard", method = { RequestMethod.POST })
public RestResult addCard(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.addCard(entity);
}
/**
* 通过id获取邀约记录
*
* @param entity
* 数据
* @return 响应数据
*/
@ResponseBody
@RequestMapping(value = "/getCard", method = { RequestMethod.POST })
public RestResult getCard(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.getCard(entity);
}
/**
* 修改信息状态
*
* @param entity
* 数据
* @return 响应数据
*/
@ResponseBody
@RequestMapping(value = "/updateCard", method = { RequestMethod.POST })
public RestResult updateCard(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.updateCard(entity);
}
/**
* 获取个人接收的访客记录
*
* @param entity
* 数据
* @return 响应数据
*/
@ResponseBody
@RequestMapping(value = "/getCardByUserId", method = { RequestMethod.POST })
public RestResult getCardByUserId(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.getCardByUserId(entity);
}
/**
* 获取个人发出的访客记录
*
* @param entity
* 数据
* @return 响应数据
*/
@ResponseBody
@RequestMapping(value = "/getIssueCardByUserId", method = { RequestMethod.POST })
public RestResult getIssueCardByUserId(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.getIssueCardByUserId(entity);
}
/**
* 获取服务类型
*
* @param entity
* 数据
* @return 响应数据
*/
@ResponseBody
@RequestMapping(value = "/getCardType", method = { RequestMethod.POST })
public RestResult getCardType(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.getCardType(entity);
}
/**
* 查询出行报备部门拥有审核权限人员
*
* @param map
* @return
*/
@RequestMapping(value = "/getDeptExamineAuth", method = RequestMethod.POST)
@Transactional(rollbackFor = Exception.class)
@ResponseBody
public RestResult getDeptExamineAuth(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.getDeptExamineAuth(entity);
}
/**
* @MethodName: getAccessControlList
* @Description: 门禁卡办理-出入区域
* @author cwchen
* @param entity
* @return RestResult
* @date 2024-05-13 04:40:52
*/
@RequestMapping(value = "/getAccessControlList", method = { RequestMethod.POST })
@ResponseBody
public RestResult getAccessControlList(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.getAccessControlList(entity);
}
/**
* @MethodName: updateCardStatusById
* @Description: 申请人更新领卡状态
* @author cwchen
* @param entity
* @return RestResult
* @date 2024-05-15 09:37:02
*/
@RequestMapping(value = "/updateCardStatusById", method = { RequestMethod.POST })
@ResponseBody
public RestResult updateCardStatusById(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.updateCardStatusById(entity);
}
/**
* @MethodName: getAllCardList
* @Description: 查询卡挂失-列表
* @author cwchen
* @param entity
* @return RestResult
* @date 2024-05-15 10:59:32
*/
@RequestMapping(value = "/getAllCardList", method = { RequestMethod.POST })
@ResponseBody
public RestResult getAllCardList(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.getAllCardList(entity);
}
/**
* 已挂失卡的列表
* @param entity
* @return
*/
@RequestMapping(value = "/getReissueCardList", method = { RequestMethod.POST })
@ResponseBody
public RestResult getReissueCardList(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.getReissueCardList(entity);
}
/**
* 添加我的卡
* @param entity
* @return
*/
@RequestMapping(value = "/addMyCard", method = { RequestMethod.POST })
@ResponseBody
public RestResult addMyCard(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.addMyCard(entity);
}
/**
* @MethodName: reissueCard
* @Description: 补办卡
* @author cwchen
* @param entity
* @return RestResult
* @date 2024-05-15 04:25:19
*/
@RequestMapping(value = "/reissueCard", method = { RequestMethod.POST })
@ResponseBody
public RestResult reissueCard(GreenCard entity) {
try {
GreenUserInfo info = getUserInfo(entity.getUserId());
if (info == null) {
return new RestResult(Constant.FAILED, "非法用户");
}
} catch (Exception e) {
return new RestResult(Constant.FAILED, "非法用户");
}
return service.reissueCard(entity);
}
}