|
@@ -0,0 +1,115 @@
|
|
|
|
+package com.rongwei.controller;
|
|
|
|
+
|
|
|
|
+import com.rongwei.bscommon.sys.service.QhseVisitorManagementService;
|
|
|
|
+import com.rongwei.bscommon.sys.service.SysPagePartService;
|
|
|
|
+import com.rongwei.bsentity.domain.QhseVisitorManagementDo;
|
|
|
|
+import com.rongwei.bsentity.domain.SysPagePartDo;
|
|
|
|
+import com.rongwei.bsentity.vo.QhseVisitorManagementVo;
|
|
|
|
+import com.rongwei.rwcommon.base.R;
|
|
|
|
+import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
|
+import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 访客管理(QhseVisitorManagement)表控制层
|
|
|
|
+ *
|
|
|
|
+ * @author makejava
|
|
|
|
+ * @since 2025-08-12 15:30:00
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("qhse-visitor-management")
|
|
|
|
+public class QhseVisitorManagementController {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ QhseVisitorManagementService qhseVisitorManagementService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ SysPagePartService sysPagePartService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping("/getPageInfo/{id}")
|
|
|
|
+ public R getUserById(@PathVariable String id) {
|
|
|
|
+ logger.info("/getPageInfo 入参 id: {}", id);
|
|
|
|
+ SysPagePartDo sysPagePartDo = sysPagePartService.getById(id);
|
|
|
|
+ return R.ok(sysPagePartDo);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 通用主从表insert执行
|
|
|
|
+ *
|
|
|
|
+ * @param masterSlaveInsert
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/generalMsInsert")
|
|
|
|
+ public R generalMsInsert(@RequestBody MasterSlaveInsertVo masterSlaveInsert) {
|
|
|
|
+ try {
|
|
|
|
+ qhseVisitorManagementService.generalMsInsert(masterSlaveInsert);
|
|
|
|
+ return R.ok();
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error(StringUtils.spliceErrorMsg(e), e.fillInStackTrace());
|
|
|
|
+
|
|
|
|
+ return R.error(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @PostMapping("/getUserByCodes")
|
|
|
|
+ public R getUserByCodes(@RequestBody List<String> codes) {
|
|
|
|
+ logger.info("/getUserByCodes 入参 codes: {}", codes.toString());
|
|
|
|
+ try {
|
|
|
|
+ List<Map<String, String>> userByCodes = qhseVisitorManagementService.getUserByCodes(codes);
|
|
|
|
+ return R.ok(userByCodes);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error(StringUtils.spliceErrorMsg(e), e.fillInStackTrace());
|
|
|
|
+ return R.error(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *根据手机号获取当天的访客申请纪录
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getRecordByPhone/{phone}")
|
|
|
|
+ public R getRecordByPhone(@PathVariable String phone) {
|
|
|
|
+ logger.info("/getRecordByPhone 入参 phone: {}", phone);
|
|
|
|
+ try {
|
|
|
|
+ // 业务逻辑
|
|
|
|
+ List<QhseVisitorManagementVo> list = qhseVisitorManagementService.getRecordByPhone(phone);
|
|
|
|
+ return R.ok(list);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("查询失败: {}", e.getMessage(), e);
|
|
|
|
+ return R.error(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据身份证号获取 黑名单信息
|
|
|
|
+ * @param idNumber
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getBlackListByIdNum/{idNumber}") // 路径参数
|
|
|
|
+ public R getBlackListByIdNum(@PathVariable String idNumber) {
|
|
|
|
+ logger.info("/getBlackListByIdNum 入参 idNumber: {}", idNumber);
|
|
|
|
+ try {
|
|
|
|
+ int count = qhseVisitorManagementService.getBlackListByIdNum(idNumber);
|
|
|
|
+ return R.ok(count);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("查询失败: {}", e.getMessage(), e);
|
|
|
|
+ return R.error(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|