From f90846edc946473af8a5de799061833815ad2e0c Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Thu, 06 Jan 2022 11:13:53 +0800
Subject: [PATCH] 根据deptId 查询公司信息(找总公司)新增接口
---
src/main/java/org/springblade/modules/system/controller/UserController.java | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/src/main/java/org/springblade/modules/system/controller/UserController.java b/src/main/java/org/springblade/modules/system/controller/UserController.java
index 1d6b810..0beac1d 100644
--- a/src/main/java/org/springblade/modules/system/controller/UserController.java
+++ b/src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -1419,4 +1419,44 @@
// ExcelUtil.export(response, "保安员导入数据模板", "保安员数据表", list, UserExcel.class);
}
+
+ /**
+ * 保安员账号校验
+ * @param user
+ * @return
+ */
+ @GetMapping("/checkAccount")
+ public void checkAccount(User user) {
+ //根据身份证号查询用户
+ User user1 = new User();
+ user1.setAccount(user.getCardid());
+ user1.setIsDeleted(0);
+ user1.setStatus(1);
+ User user2 = userService.getOne(Condition.getQueryWrapper(user1));
+ if (null!=user2){
+ //判断是单位否一致
+ if (null!=user.getDeptId() && !user.getDeptId().equals("")) {
+ if (!user2.getDeptId().equals(user.getDeptId())) {
+ throw new ServiceException(StringUtil.format("当前用户 [{}] 已在其他单位录入!", user.getCardid()));
+ } else {
+ throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getCardid()));
+ }
+ }else {
+ //没有传 deptId 的情况
+ throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getCardid()));
+ }
+ }
+ }
+
+ /**
+ * 年龄分布查询
+ * @param user
+ * @return
+ */
+ @PostMapping("/getAgeStatistics")
+ public R getAgeStatistics(UserVO user){
+ return R.data(userService.getAgeStatistics(user));
+ }
+
+
}
--
Gitblit v1.9.3