QhseVisitorManagementController.java 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. package com.rongwei.controller;
  2. import com.rongwei.bscommon.system.dao.SysPagePartDao;
  3. import com.rongwei.bscommon.system.service.QhseVisitorManagementService;
  4. import com.rongwei.bscommon.system.service.SysPagePartService;
  5. import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
  6. import com.rongwei.bsentity.domain.SysPagePartDo;
  7. import com.rongwei.bsentity.dto.QhseVisitorManagementDto;
  8. import com.rongwei.bsentity.vo.QhseVisitorManagementVo;
  9. import com.rongwei.rwcommon.base.R;
  10. import com.rongwei.rwcommon.utils.StringUtils;
  11. import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
  12. import org.slf4j.Logger;
  13. import org.slf4j.LoggerFactory;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.*;
  16. import javax.servlet.http.HttpServletResponse;
  17. import java.util.List;
  18. import java.util.Map;
  19. /**
  20. * 访客管理(QhseVisitorManagement)表控制层
  21. *
  22. * @author makejava
  23. * @since 2025-08-12 15:30:00
  24. */
  25. @RestController
  26. @RequestMapping("/visitor/management")
  27. public class QhseVisitorManagementController {
  28. private final Logger logger = LoggerFactory.getLogger(getClass());
  29. @Autowired
  30. QhseVisitorManagementService qhseVisitorManagementService;
  31. @Autowired
  32. SysPagePartService sysPagePartService;
  33. @GetMapping("/getPageInfo/{id}")
  34. public R getUserById(@PathVariable String id) {
  35. logger.info("/getPageInfo 入参 id: {}", id);
  36. SysPagePartDo sysPagePartDo = sysPagePartService.getDataById(id);
  37. return R.ok(sysPagePartDo);
  38. }
  39. @PostMapping("/saveData")
  40. public R saveData(@RequestBody QhseVisitorManagementDto qhseVisitorManagementDto) {
  41. logger.info("/saveData 入参 qhseVisitorManagementDto: {}", qhseVisitorManagementDto);
  42. try {
  43. return qhseVisitorManagementService.saveData(qhseVisitorManagementDto);
  44. } catch (Exception e) {
  45. logger.error(StringUtils.spliceErrorMsg(e), e.fillInStackTrace());
  46. return R.error(e.getMessage());
  47. }
  48. }
  49. /**
  50. *根据手机号获取当天的访客申请纪录
  51. * @param
  52. * @return
  53. */
  54. @GetMapping("/getRecordByPhone/{phone}")
  55. public R getRecordByPhone(@PathVariable String phone) {
  56. logger.info("/getRecordByPhone 入参 phone: {}", phone);
  57. try {
  58. // 业务逻辑
  59. List<QhseVisitorManagementVo> list = qhseVisitorManagementService.getRecordByPhone(phone);
  60. return R.ok(list);
  61. } catch (Exception e) {
  62. logger.error("查询失败: {}", e.getMessage(), e);
  63. return R.error(e.getMessage());
  64. }
  65. }
  66. /**
  67. * 根据身份证号获取 黑名单信息
  68. * @param idNumber
  69. * @return
  70. */
  71. @GetMapping("/getBlackListByIdNum/{idNumber}") // 路径参数
  72. public R getBlackListByIdNum(@PathVariable String idNumber) {
  73. logger.info("/getBlackListByIdNum 入参 idNumber: {}", idNumber);
  74. try {
  75. int count = qhseVisitorManagementService.getBlackListByIdNum(idNumber);
  76. return R.ok(count);
  77. } catch (Exception e) {
  78. logger.error("查询失败: {}", e.getMessage(), e);
  79. return R.error(e.getMessage());
  80. }
  81. }
  82. /**
  83. * 安全责任书确认签名
  84. * @param response
  85. */
  86. @GetMapping("/previewForAttachmentWithSignature")
  87. public void previewForAttachmentWithSignature( @RequestParam("signature") String signature,
  88. @RequestParam("url") String url,
  89. HttpServletResponse response) {
  90. logger.info("增加签名接口入参为:signature:{},url:{}", signature,url);
  91. qhseVisitorManagementService.previewForAttachmentWithSignature(signature,url, response);
  92. }
  93. }