From f2032d8331cd8939bb8dd4ef372033a2dcdbc850 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Thu, 17 Feb 2022 16:10:55 +0800
Subject: [PATCH] +添加法人变更,以及跨区域备案字段更改

---
 src/main/java/org/springblade/modules/system/controller/UserController.java |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 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..801cf3e 100644
--- a/src/main/java/org/springblade/modules/system/controller/UserController.java
+++ b/src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -661,6 +661,8 @@
 			AccreditationRecords accreditationRecords1 = collect.get(0);
 			//修改为已制证状态
 			accreditationRecords1.setStatus(2);
+			//记录打印时间
+			accreditationRecords1.setPaperTime(new Date());
 			//更新
 			accreditationRecordsService.updateById(accreditationRecords1);
 			//同步
@@ -1419,4 +1421,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