From ab3024e6f8a3bc765bee326bf90afc07391ae449 Mon Sep 17 00:00:00 2001
From: 钟日健 <5689795+arsn@user.noreply.gitee.com>
Date: Thu, 24 Feb 2022 11:28:19 +0800
Subject: [PATCH] 新增保安公司密码未修改查询

---
 src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java |  131 ++++++++++++++++++++++++++-----------------
 1 files changed, 79 insertions(+), 52 deletions(-)

diff --git a/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java b/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
index a703122..a90be42 100644
--- a/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
+++ b/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -23,7 +23,6 @@
 import com.google.zxing.WriterException;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.ibatis.annotations.Param;
 import org.springblade.common.cache.SysCache;
 import org.springblade.common.constant.AgeUtil;
 import org.springblade.common.constant.CommonConstant;
@@ -63,7 +62,6 @@
 import org.springblade.modules.system.wrapper.UserWrapper;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -190,11 +188,11 @@
 			List<UserVO> userVOS = baseMapper.selectUserPagesByAge(page, user);
 			//机构名称拼接
 			userVOS.forEach(userVO -> {
-				if (null != userVO.getCardid() && userVO.getCardid() != "") {
-					userVO.setAge(AgeUtil.idCardToAge(userVO.getCardid()));
-				} else {
-					userVO.setAge(null);
-				}
+//				if (null != userVO.getCardid() && userVO.getCardid() != "") {
+//					userVO.setAge(AgeUtil.idCardToAge(userVO.getCardid()));
+//				} else {
+//					userVO.setAge(null);
+//				}
 				if (null!=userVO.getDeptId()) {
 					List<String> list = baseMapper.getDeptName(userVO.getDeptId());
 					if (list.size() > 1) {
@@ -220,11 +218,11 @@
 			List<UserVO> userVOS = baseMapper.selectUserPages(page, user);
 			//机构名称拼接
 			userVOS.forEach(userVO -> {
-				if (null != userVO.getCardid() && userVO.getCardid() != "") {
-					userVO.setAge(AgeUtil.idCardToAge(userVO.getCardid()));
-				} else {
-					userVO.setAge(null);
-				}
+//				if (null != userVO.getCardid() && userVO.getCardid() != "") {
+//					userVO.setAge(AgeUtil.idCardToAge(userVO.getCardid()));
+//				} else {
+//					userVO.setAge(null);
+//				}
 				if (null!=userVO.getDeptId()) {
 					List<String> list = baseMapper.getDeptName(userVO.getDeptId());
 					if (list.size() > 1) {
@@ -1477,8 +1475,8 @@
 	 * @return
 	 */
 	@Override
-	public UserVO getUserInfoBySecurityNumber(String securityNumber) {
-		UserVO userVO = baseMapper.getUserInfoBySecurityNumber(securityNumber);
+	public UserVO getUserInfoBySecurityNumber(String securityNumber,String cardid) {
+		UserVO userVO = baseMapper.getUserInfoBySecurityNumber(securityNumber,cardid);
 		//查询派遣信息
 		if (null!=userVO) {
 			DispatcherVO dispatcherVO = baseMapper.getUserDispatcherInfo(userVO.getId());
@@ -1589,49 +1587,53 @@
 	 */
 	@Override
 	public void importQrCode(List<QrCodeExcel> data, Boolean isCovered, String deptId) {
-//		String url = "http://223.82.109.183:2080/securityInfo.html";
-//		data.forEach(qrCodeExcel -> {
-//			if (null!=qrCodeExcel.getSecuritynumber()) {
-//				String encoded = null;
-//				try {
-//					//中文字符串编码
-//					encoded = URLEncoder.encode(qrCodeExcel.getSecuritynumber(),"UTF-8");
-//				} catch (UnsupportedEncodingException e) {
-//					e.printStackTrace();
-//				}
-//				//url 拼接
-//				String content = url + "?securityNumber=" + encoded;
-//				byte[] qrCodeImage = new byte[0];
-//				try {
-//					//生成二维码字节流
-//					qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350);
-//				} catch (WriterException e) {
-//					e.printStackTrace();
-//				} catch (IOException e) {
-//					e.printStackTrace();
-//				}
-//				String path = "D:\\QrCode\\";
-//				FileOutputStream fileOutputStream = null;
-//				try {
-//					fileOutputStream = new FileOutputStream(path+qrCodeExcel.getSecuritynumber()+".png");
-//				} catch (FileNotFoundException e) {
-//					e.printStackTrace();
-//				}
-//				try {
-//					//图片下载到本地
-//					fileOutputStream.write(qrCodeImage,0,qrCodeImage.length);
-//					fileOutputStream.flush();
-//					fileOutputStream.close();
-//				} catch (IOException e) {
-//					e.printStackTrace();
-//				}
-//			}
-//		});
+		String url = "http://223.82.109.183:2080/securityInfo.html";
+		//二维码生成
+		data.forEach(qrCodeExcel -> {
+			if (null!=qrCodeExcel.getSecuritynumber()) {
+				String encoded = null;
+				try {
+					//中文字符串编码
+					encoded = URLEncoder.encode(qrCodeExcel.getSecuritynumber(),"UTF-8");
+				} catch (UnsupportedEncodingException e) {
+					e.printStackTrace();
+				}
+				//url 拼接
+				String content = url + "?securityNumber=" + encoded;
+				byte[] qrCodeImage = new byte[0];
+				try {
+					//生成二维码字节流
+					qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350);
+				} catch (WriterException e) {
+					e.printStackTrace();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+				String path = "D:\\QrCode\\";
+				FileOutputStream fileOutputStream = null;
+				try {
+					fileOutputStream = new FileOutputStream(path+qrCodeExcel.getSecuritynumber()+".png");
+				} catch (FileNotFoundException e) {
+					e.printStackTrace();
+				}
+				try {
+					//图片下载到本地
+					fileOutputStream.write(qrCodeImage,0,qrCodeImage.length);
+					fileOutputStream.flush();
+					fileOutputStream.close();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+			}
+		});
 		//头像生成
 		data.forEach(qrCodeExcel -> {
 			if (null!=qrCodeExcel.getSecuritynumber()) {
 				//查询用户头像url
 				User user = new User();
+				user.setRealName(qrCodeExcel.getRealName());
+				user.setStatus(1);
+				user.setIsDeleted(0);
 				user.setSecuritynumber(qrCodeExcel.getSecuritynumber());
 				User user1 = this.getOne(Condition.getQueryWrapper(user));
 				//url 拼接
@@ -1741,4 +1743,29 @@
 		//返回
 		return list;
 	}
+
+	/**
+	 * 查询登录密码还是 123456 的单位信息
+	 * @return
+	 */
+	@Override
+	public Object getNotUpdatePwdInfo() {
+		//查询角色为保安公司管理员的用户信息
+		User user = new User();
+		user.setRoleId("1414575196264300546");
+		user.setStatus(1);
+		user.setIsDeleted(0);
+		List<User> list = this.list(Condition.getQueryWrapper(user));
+		List<User> list1 = new ArrayList<>();
+		//遍历
+		if (list.size()>0){
+			byte[] bytes = DigestUtil.decodeHex(list.get(0).getPassword());
+			try {
+				System.out.println("解密的密码 = " + new String(bytes));
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+		return list;
+	}
 }

--
Gitblit v1.9.3