| | |
| | | import com.doumee.core.wx.WXConstant; |
| | | import com.doumee.dao.admin.request.LaborEmpowerDTO; |
| | | import com.doumee.dao.admin.request.LaborMemberDTO; |
| | | import com.doumee.dao.admin.request.MemberImport; |
| | | import com.doumee.dao.admin.request.MemberQuery; |
| | | import com.doumee.dao.admin.response.StagingDataVO; |
| | | import com.doumee.dao.business.*; |
| | |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Date; |
| | | import java.util.*; |
| | |
| | | return stagingHeadVO; |
| | | } |
| | | |
| | | @Override |
| | | public String importBatch(MultipartFile file, LoginUserInfo loginUserInfo){ |
| | | |
| | | List<Member> list = memberJoinMapper.selectJoinList(Member.class,new MPJLambdaWrapper<Member>() |
| | | .selectAll(Member.class) |
| | | .leftJoin(Company.class,Company::getId,Member::getCompanyId) |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | ); |
| | | ExcelImporter ie = null; |
| | | List<MemberImport> dataList =null; |
| | | try { |
| | | ie = new ExcelImporter(file,0,0); |
| | | dataList = ie.getDataList(MemberImport.class,null); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(dataList == null || dataList.size() ==0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,录入数据为空!"); |
| | | } |
| | | List<String> idCardList = dataList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList()); |
| | | Set<String> set = new HashSet<>(idCardList); |
| | | if(idCardList.size() != set.size()){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,录入数据存在身份证号相同数据!"); |
| | | } |
| | | |
| | | return "导入成功"; |
| | | } |
| | | |
| | | |
| | | |
| | | } |