|  |  | 
 |  |  |     private SystemDictDataBiz systemDictDataBiz; | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = {BusinessException.class,Exception.class}) | 
 |  |  |     public Integer create(IdentityInfo identityInfo) { | 
 |  |  |         if(Objects.isNull(identityInfo) | 
 |  |  |         || Objects.isNull(identityInfo.getType()) | 
 |  |  | 
 |  |  |             throw new BusinessException(ResponseStatus.BAD_REQUEST); | 
 |  |  |         } | 
 |  |  |         //查询用户是否已存在当前身份 | 
 |  |  |         if(identityInfoMapper.selectCount(new QueryWrapper<IdentityInfo>().lambda().eq(IdentityInfo::getMemberId,identityInfo.getMemberId()) | 
 |  |  |         if(identityInfoMapper.selectCount(new QueryWrapper<IdentityInfo>().lambda().eq(IdentityInfo::getDeleted,Constants.ZERO).eq(IdentityInfo::getMemberId,identityInfo.getMemberId()) | 
 |  |  |                 .eq(IdentityInfo::getType,identityInfo.getType()))>Constants.ZERO){ | 
 |  |  |             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已存在该身份请刷新查看!"); | 
 |  |  |         }; | 
 |  |  |         identityInfo.setDeleted(Constants.ZERO); | 
 |  |  |         identityInfo.setCreateTime(new Date()); | 
 |  |  |         identityInfo.setAuditStatus(Constants.ZERO); | 
 |  |  |         identityInfo.setUpdateTime(identityInfo.getCreateTime()); | 
 |  |  |         identityInfo.setAuditStatus(Constants.ONE); | 
 |  |  |         identityInfoMapper.insert(identityInfo); | 
 |  |  |  | 
 |  |  |         memberMapper.update(new UpdateWrapper<Member>().lambda() | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity,Constants.ONE) | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity,Constants.ONE) | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity,Constants.ONE) | 
 |  |  |                 .eq(Member::getId,identityInfo.getMemberId())); | 
 |  |  |  | 
 |  |  |         return identityInfo.getId(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = {BusinessException.class,Exception.class}) | 
 |  |  |     public void updateById(IdentityInfo identityInfo) { | 
 |  |  |         if(Objects.isNull(identityInfo) | 
 |  |  |                 || Objects.isNull(identityInfo.getId()) | 
 |  |  | 
 |  |  |             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前状态无法进行该操作"); | 
 |  |  |         } | 
 |  |  |         identityInfo.setUpdateTime(new Date()); | 
 |  |  |         identityInfo.setAuditStatus(Constants.ONE); | 
 |  |  |         identityInfoMapper.updateById(identityInfo); | 
 |  |  |         memberMapper.update(new UpdateWrapper<Member>().lambda() | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity,Constants.ONE) | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity,Constants.ONE) | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity,Constants.ONE) | 
 |  |  |                 .eq(Member::getId,identityInfo.getMemberId())); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional(rollbackFor = {BusinessException.class,Exception.class}) | 
 |  |  |     public void updateLocation(IdentityInfo identityInfo) { | 
 |  |  |         if(Objects.isNull(identityInfo) | 
 |  |  |                 || Objects.isNull(identityInfo.getId()) | 
 |  |  | 
 |  |  |             queryWrapper.le(IdentityInfo::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime())); | 
 |  |  |         } | 
 |  |  |         if (pageWrap.getModel().getRemark() != null) { | 
 |  |  |             queryWrapper.eq(IdentityInfo::getRemark, pageWrap.getModel().getRemark()); | 
 |  |  |             queryWrapper.like(IdentityInfo::getRemark, pageWrap.getModel().getRemark()); | 
 |  |  |         } | 
 |  |  |         if (pageWrap.getModel().getType() != null) { | 
 |  |  |             queryWrapper.eq(IdentityInfo::getType, pageWrap.getModel().getType()); | 
 |  |  | 
 |  |  |             queryWrapper.eq(IdentityInfo::getAuthType, pageWrap.getModel().getAuthType()); | 
 |  |  |         } | 
 |  |  |         if (pageWrap.getModel().getLinkName() != null) { | 
 |  |  |             queryWrapper.eq(IdentityInfo::getLinkName, pageWrap.getModel().getLinkName()); | 
 |  |  |             queryWrapper.like(IdentityInfo::getLinkName, pageWrap.getModel().getLinkName()); | 
 |  |  |         } | 
 |  |  |         if (pageWrap.getModel().getTelephone() != null) { | 
 |  |  |             queryWrapper.eq(IdentityInfo::getTelephone, pageWrap.getModel().getTelephone()); | 
 |  |  |             queryWrapper.like(IdentityInfo::getTelephone, pageWrap.getModel().getTelephone()); | 
 |  |  |         } | 
 |  |  |         if (pageWrap.getModel().getLocation() != null) { | 
 |  |  |             queryWrapper.eq(IdentityInfo::getLocation, pageWrap.getModel().getLocation()); | 
 |  |  |             queryWrapper.like(IdentityInfo::getLocation, pageWrap.getModel().getLocation()); | 
 |  |  |         } | 
 |  |  |         if (pageWrap.getModel().getCompanyName() != null) { | 
 |  |  |             queryWrapper.eq(IdentityInfo::getCompanyName, pageWrap.getModel().getCompanyName()); | 
 |  |  |             queryWrapper.like(IdentityInfo::getCompanyName, pageWrap.getModel().getCompanyName()); | 
 |  |  |         } | 
 |  |  |         if (pageWrap.getModel().getLat() != null) { | 
 |  |  |             queryWrapper.eq(IdentityInfo::getLat, pageWrap.getModel().getLat()); | 
 |  |  | 
 |  |  |             queryWrapper.le(IdentityInfo::getAuditTime, Utils.Date.getEnd(pageWrap.getModel().getAuditTime())); | 
 |  |  |         } | 
 |  |  |         if (pageWrap.getModel().getAuditRemark() != null) { | 
 |  |  |             queryWrapper.eq(IdentityInfo::getAuditRemark, pageWrap.getModel().getAuditRemark()); | 
 |  |  |             queryWrapper.like(IdentityInfo::getAuditRemark, pageWrap.getModel().getAuditRemark()); | 
 |  |  |         } | 
 |  |  |         for(PageWrap.SortData sortData: pageWrap.getSorts()) { | 
 |  |  |             if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { | 
 |  |  |                 queryWrapper.orderByDesc(sortData.getProperty()); | 
 |  |  |             } else { | 
 |  |  |                 queryWrapper.orderByAsc(sortData.getProperty()); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         queryWrapper.orderByAsc(IdentityInfo::getAuditStatus ); | 
 |  |  |         queryWrapper.orderByDesc(IdentityInfo::getCreateTime ); | 
 |  |  |         PageData<IdentityInfo> result = PageData.from(identityInfoMapper.selectJoinPage(page,IdentityInfo.class, queryWrapper)); | 
 |  |  |         if(result!=null && result.getRecords()!=null){ | 
 |  |  |             String path  = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode() | 
 |  |  | 
 |  |  |     @Transactional(rollbackFor = {BusinessException.class,Exception.class}) | 
 |  |  |     public void audit(AuditDTO auditDTO){ | 
 |  |  |         if(Objects.isNull(auditDTO) | 
 |  |  |         || Objects.isNull(auditDTO.getId()) | 
 |  |  |         || Objects.isNull(auditDTO.getAuditStatus())){ | 
 |  |  |             || Objects.isNull(auditDTO.getId()) | 
 |  |  |             || Objects.isNull(auditDTO.getAuditStatus()) | 
 |  |  |             ||  auditDTO.getAuditStatus()<2 | 
 |  |  |             ||  auditDTO.getAuditStatus()>3){ | 
 |  |  |             throw new BusinessException(ResponseStatus.BAD_REQUEST); | 
 |  |  |         } | 
 |  |  |         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
 |  |  |         IdentityInfo identityInfo = identityInfoMapper.selectById(auditDTO.getId()); | 
 |  |  |         if(Objects.nonNull(identityInfo)){ | 
 |  |  |         if(Objects.isNull(identityInfo)){ | 
 |  |  |             throw new BusinessException(ResponseStatus.DATA_EMPTY); | 
 |  |  |         } | 
 |  |  |         if(!Constants.equalsInteger(identityInfo.getAuditStatus(),Constants.ONE)){ | 
 |  |  |             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已审批,请勿重复操作"); | 
 |  |  |         } | 
 |  |  |         Date date = new Date(); | 
 |  |  |         identityInfoMapper.update(new UpdateWrapper<IdentityInfo>().lambda() | 
 |  |  |                 .set(IdentityInfo::getAuditStatus,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) | 
 |  |  |                 .set(IdentityInfo::getAuditStatus, auditDTO.getAuditStatus() ) | 
 |  |  |                 .set(StringUtils.isNotBlank(auditDTO.getAuditRemark()),IdentityInfo::getAuditRemark,auditDTO.getAuditRemark()) | 
 |  |  |                 .set(IdentityInfo::getAuditTime,"now()") | 
 |  |  |                 .set(IdentityInfo::getAuditTime,date) | 
 |  |  |                 .set(IdentityInfo::getUpdateUser,user.getId()) | 
 |  |  |                 .set(IdentityInfo::getUpdateTime,"now()") | 
 |  |  |                 .set(IdentityInfo::getUpdateTime,date) | 
 |  |  |                 .eq(IdentityInfo::getId,identityInfo.getId()) | 
 |  |  |         ); | 
 |  |  |  | 
 |  |  |         memberMapper.update(new UpdateWrapper<Member>().lambda() | 
 |  |  |                 .set(Member::getUpdateUser,user.getId()) | 
 |  |  |                 .set(Member::getUpdateTime,"now()") | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) | 
 |  |  |                 .set(Member::getUpdateTime,date) | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity, auditDTO.getAuditStatus() ) | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity , auditDTO.getAuditStatus() ) | 
 |  |  |                 .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity , auditDTO.getAuditStatus() ) | 
 |  |  |                 .eq(Member::getId,identityInfo.getMemberId()) | 
 |  |  |         ); | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } |