| | |
| | | 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; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final IInformationService iInformationService; |
| | | private final IDeptService deptService; |
| | | private final JurisdictionService jurisdictionService; |
| | | private final AccreditationRecordsService accreditationRecordsService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | // List<String> errorList = new ArrayList<>(); |
| | | // //导入状态,默认为true ,如果有一个出现问题则为 false |
| | | // AtomicBoolean status = new AtomicBoolean(true); |
| | | // AtomicInteger count = new AtomicInteger(); |
| | | // data.forEach(userExcel -> { |
| | | // //判断当前用户是否已在本单位,如果是的更新数据 |
| | | // User user1 = new User(); |
| | |
| | | // 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()); |
| | | // } |
| | |
| | | // String errorAccount = StringUtils.join(errorList, "\\\n"); |
| | | // throw new ServiceException("用户:["+errorAccount+"]导入失败!已在其他单位存在!"); |
| | | // } |
| | | // if (status.get()){ |
| | | // String errorAccount = StringUtils.join(errorList, "\\\n"); |
| | | // throw new ServiceException("成功导入用户:"+count.get()); |
| | | // } |
| | | // } |
| | | |
| | | |