| | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import cn.hutool.core.util.PhoneUtil; |
| | | import com.doumee.core.annotation.excel.ExcelImporter; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.admin.request.LaborEmpowerDTO; |
| | | import com.doumee.dao.admin.request.LaborMemberDTO; |
| | | import com.doumee.dao.admin.response.MemberInfoDTO; |
| | | import com.doumee.dao.business.MemberMapper; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | | if (PhoneUtil.isPhone(member.getPhone())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"电话号码格式有误"); |
| | | } |
| | | if (IdcardUtil.isValidCard(member.getIdcardNo())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"身份证号格式有误"); |
| | | } |
| | |
| | | //获取出生日期 |
| | | String birthByIdCard = IdcardUtil.getBirthByIdCard(member.getIdcardNo()); |
| | | //脱敏操作 |
| | | String hide = IdcardUtil.hide(member.getIdcardNo(), 6, 14); |
| | | String hide = IdcardUtil.hide(member.getIdcardNo(), 5, 14); |
| | | //转换日期 |
| | | DateTime yyyyMMdd = DateUtil.parse(birthByIdCard, "yyyyMMdd"); |
| | | |
| | |
| | | @Override |
| | | public void updateById(Member member) { |
| | | memberMapper.updateById(member); |
| | | } |
| | | |
| | | @Override |
| | | public void updateStatusById(Member member) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | Member update = new Member(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(loginUserInfo.getId()); |
| | | update.setStatus(member.getStatus()); |
| | | memberMapper.updateById(update); |
| | | } |
| | | |
| | | @Override |
| | |
| | | QueryWrapper<Member> wrapper = new QueryWrapper<>(member); |
| | | return memberMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void importMemberBatch(LaborEmpowerDTO laborEmpowerDTO) { |
| | | try { |
| | | ExcelImporter ie = new ExcelImporter(laborEmpowerDTO.getFile(),0,0); |
| | | |
| | | List<LaborEmpowerDTO.LaborMemberEmpower> dataList = ie.getDataList(LaborEmpowerDTO.LaborMemberEmpower.class,null); |
| | | |
| | | if (CollectionUtils.isEmpty(dataList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"文件无数据记录"); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | // |
| | | |
| | | } |
| | | } |