From 116143f2237156ff892d6951d6943285fa304f0e Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 08 Dec 2021 17:33:23 +0800
Subject: [PATCH] 考试成绩查询,导出修改,实操成绩导入去除准考证号,保安员导入新增身份证住址校验

---
 src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 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 b88d5f3..f68f678 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
@@ -62,6 +62,7 @@
 import org.springblade.modules.system.wrapper.UserWrapper;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import sun.java2d.pipe.SpanShapeRenderer;
 
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
@@ -834,6 +835,10 @@
 			if (null==user.getCardid() || user.getCardid().equals("")){
 				throw new ServiceException("导入失败!身份证号码不能为空!");
 			}
+			//身份证住址校验
+			if (null==user.getRegistered() || user.getRegistered().equals("")){
+				throw new ServiceException("导入失败!身份证住址不能为空!");
+			}
 			if (null!=user.getCardid() && !user.getCardid().equals("")){
 				//去除所有空格
 				String cardid = user.getCardid().replaceAll(" ", "");
@@ -901,6 +906,7 @@
 					if (userCount > 0 && Func.isEmpty(user.getId())) {
 						throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
 					}
+					user.setCreateTime(new Date());
 					//新增
 					this.save(user);
 
@@ -920,7 +926,7 @@
 						"id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
 						"role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
 						"politicaloutlook,healstats,height,address,registered," +
-						"securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
+						"securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,create_time) " +
 						"values(" + "'" + user.getId() + "'" +
 						"," + "'" + user.getTenantId() + "'" +
 						"," + "'" + user.getAccount() + "'" +
@@ -949,7 +955,8 @@
 						"," + "'" + user.getExaminationType() + "'" +
 						"," + "'" + user.getStatus() + "'" +
 						"," + "'" + user.getIsDeleted() + "'" +
-						"," + "'" + user.getDispatch() + "'" + ");"+
+						"," + "'" + user.getDispatch() + "'" +
+						"," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" + ");"+
 					"insert into sys_experience(id,name,post,entryTime," +
 						"cardId,companyname,securityId) " +
 						"values(" + "'" + experience.getId() + "'" + "," +
@@ -990,11 +997,13 @@
 							user2.setRegistered("");
 						}
 						//更新用户数据
+						user2.setUpdateTime(new Date());
 						this.updateById(user2);
 						String s1 =
 							"update blade_user set hold = " + "'" + user2.getHold() + "'"
 								+ ",securitynumber = " + "'" + user2.getSecuritynumber() + "'"
 								+ ",dept_id = " + "'" + user2.getDeptId() + "'"
+								+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
 								+ ",registered = " + "'" + user2.getRegistered() + "'"
 								+ " " + "where id = " + "'" + user2.getId() + "'";
 						FtpUtil.sqlFileUpload(s1);
@@ -1023,12 +1032,14 @@
 					}else {
 						user2.setRegistered("");
 					}
+					user2.setUpdateTime(new Date());
 					//更新用户数据
 					this.updateById(user2);
 					String s1 =
 						"update blade_user set hold = " + "'" + user2.getHold() + "'"
 							+ ",securitynumber = " + "'" + user2.getSecuritynumber() + "'"
 							+ ",registered = " + "'" + user2.getRegistered() + "'"
+							+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
 							+ " " + "where id = " + "'" + user2.getId() + "'";
 					FtpUtil.sqlFileUpload(s1);
 				}
@@ -1059,7 +1070,7 @@
 
 	@Override
 	public void importSecurityYy(List<SecurityYyExcel> data, Boolean isCovered, String deptId) {
-//将不能导入的保安员账号存起来
+		//将不能导入的保安员账号存起来
 		List<String> errorList = new ArrayList<>();
 		//将需要新增的保安员信息存入集合
 		List<String> ageErrorList = new ArrayList<>();
@@ -1084,9 +1095,13 @@
 				throw new ServiceException("导入失败!公司名:["+user.getDeptId()+"]不存在!");
 			}
 
-			//身份证校验
+			//身份证号码校验
 			if (null==user.getCardid() || user.getCardid().equals("")){
 				throw new ServiceException("导入失败!身份证号码不能为空!");
+			}
+			//身份证住址校验
+			if (null==user.getRegistered() || user.getRegistered().equals("")){
+				throw new ServiceException("导入失败!身份证住址不能为空!");
 			}
 			if (null!=user.getCardid() && !user.getCardid().equals("")){
 				//去除所有空格
@@ -1154,6 +1169,7 @@
 				if (userCount > 0 && Func.isEmpty(user.getId())) {
 					throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
 				}
+				user.setCreateTime(new Date());
 				//新增
 				this.save(user);
 
@@ -1172,7 +1188,7 @@
 					"id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
 					"role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
 					"politicaloutlook,healstats,height,address,registered," +
-					"securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,guncode) " +
+					"securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch,create_time,guncode) " +
 					"values(" + "'" + user.getId() + "'" +
 					"," + "'" + user.getTenantId() + "'" +
 					"," + "'" + user.getAccount() + "'" +
@@ -1201,8 +1217,9 @@
 					"," + "'" + user.getExaminationType() + "'" +
 					"," + "'" + user.getStatus() + "'" +
 					"," + "'" + user.getIsDeleted() + "'" +
-					"," + "'" + user.getIsDeleted() + "'" +
-					"," + "'" + user.getGuncode() + "'" + ");"+
+					"," + "'" + user.getDispatch() + "'" +
+					"," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getCreateTime()) + "'" +
+				"," + "'" + user.getGuncode() + "'" + ");"+
 				"insert into sys_experience(id,name,post,entryTime," +
 					"cardId,companyname,securityId) " +
 					"values(" + "'" + experience.getId() + "'" + "," +
@@ -1246,12 +1263,14 @@
 						}else {
 							user2.setRegistered("");
 						}
+						user2.setUpdateTime(new Date());
 						//更新用户数据
 						this.updateById(user2);
 						String s1 =
 							"update blade_user set hold = " + "'" + user2.getHold() + "'"
 								+ ",securitynumber = " + "'" + user2.getSecuritynumber() + "'"
 								+ ",dept_id = " + "'" + user2.getDeptId() + "'"
+								+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
 								+ ",registered = " + "'" + user2.getRegistered() + "'"
 								+ " " + "where id = " + "'" + user2.getId() + "'";
 						FtpUtil.sqlFileUpload(s1);
@@ -1280,12 +1299,14 @@
 					}else {
 						user2.setRegistered("");
 					}
+					user2.setUpdateTime(new Date());
 					//更新用户数据
 					this.updateById(user2);
 					String s1 =
 						"update blade_user set hold = " + "'" + user2.getHold() + "'"
 							+ ",securitynumber = " + "'" + user2.getSecuritynumber() + "'"
 							+ ",registered = " + "'" + user2.getRegistered() + "'"
+							+ ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user2.getUpdateTime()) + "'"
 							+ " " + "where id = " + "'" + user2.getId() + "'";
 					FtpUtil.sqlFileUpload(s1);
 				}

--
Gitblit v1.9.3