智慧保安后台管理-外网项目备份
Administrator
2021-11-17 7293f04d18fb2e882e152f962c3aa1d8fcb1f93e
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());
//      }
//   }