From 7293f04d18fb2e882e152f962c3aa1d8fcb1f93e Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 17 Nov 2021 15:46:35 +0800
Subject: [PATCH] 证书打印信息导出修改

---
 src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 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 0d955ae..c62718f 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
@@ -39,6 +39,8 @@
 import org.springblade.core.tool.support.Kv;
 import org.springblade.core.tool.utils.*;
 import org.springblade.modules.FTP.FtpUtil;
+import org.springblade.modules.accreditation.entity.AccreditationRecords;
+import org.springblade.modules.accreditation.service.AccreditationRecordsService;
 import org.springblade.modules.auth.enums.UserEnum;
 import org.springblade.modules.dispatcher.vo.DispatcherVO;
 import org.springblade.modules.information.entity.Information;
@@ -66,6 +68,7 @@
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
 /**
@@ -85,6 +88,7 @@
 	private final IInformationService iInformationService;
 	private final IDeptService deptService;
 	private final JurisdictionService jurisdictionService;
+	private final AccreditationRecordsService accreditationRecordsService;
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
@@ -1169,6 +1173,7 @@
 //		List<String> errorList = new ArrayList<>();
 //		//导入状态,默认为true ,如果有一个出现问题则为 false
 //		AtomicBoolean status = new AtomicBoolean(true);
+//		AtomicInteger count = new AtomicInteger();
 //		data.forEach(userExcel -> {
 //			//判断当前用户是否已在本单位,如果是的更新数据
 //			User user1 = new User();
@@ -1179,9 +1184,18 @@
 //			if (null!=user2){
 //				if (null!=userExcel.getRegistered() && userExcel.getRegistered()!=""){
 //					user2.setRegistered(userExcel.getRegistered());
-//					user2.setUserType(7);
+////					user2.setUserType(7);
 //				}
 //				this.updateById(user2);
+//				count.getAndIncrement();
+//
+////				AccreditationRecords accreditationRecords = new AccreditationRecords();
+////				accreditationRecords.setType(2);
+////				accreditationRecords.setAuditStatus(2);
+////				accreditationRecords.setUserId(user2.getId());
+////				accreditationRecords.setStatus(1);
+////				accreditationRecords.setCreateTime(new Date());
+////				accreditationRecordsService.save(accreditationRecords);
 //			}else {
 //				errorList.add(userExcel.getCardid());
 //			}
@@ -1191,6 +1205,10 @@
 //			String errorAccount = StringUtils.join(errorList, "\\\n");
 //			throw new ServiceException("用户:["+errorAccount+"]导入失败!已在其他单位存在!");
 //		}
+//		if (status.get()){
+//			String errorAccount = StringUtils.join(errorList, "\\\n");
+//			throw new ServiceException("成功导入用户:"+count.get());
+//		}
 //	}
 
 

--
Gitblit v1.9.3