| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.ExportSpecialUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.ComMngUserTagDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.utlis.IdCard; |
| | | import com.panzhihua.common.utlis.SensitiveUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_user.dao.ComMngUserTagDAO; |
| | | import com.panzhihua.service_user.dao.SysUserInputDAO; |
| | | import com.panzhihua.service_user.model.dos.ComMngFamilyInfoDO; |
| | |
| | | if(count==0){ |
| | | SysUserInputDO sysUserInputDO=new SysUserInputDO(); |
| | | String doorNumber = eexcelUserDTO.getDoorNumber(); |
| | | List<ComMngStructHouseVO> collect = comMngStructHouseVOS1.stream().filter(comMngStructHouseVO -> comMngStructHouseVO.getHouseName().equals(doorNumber)).collect(Collectors.toList()); |
| | | if (ObjectUtils.isEmpty(collect)) { |
| | | throw new ServiceException("门牌号后台不存在或格式错误,错误门牌号为"+doorNumber); |
| | | }else{ |
| | | sysUserInputDO.setHouseCode(collect.get(0).getHouseCode()); |
| | | } |
| | | //暂时注释门牌号匹配设置房屋编号功能 |
| | | // List<ComMngStructHouseVO> collect = comMngStructHouseVOS1.stream().filter(comMngStructHouseVO -> comMngStructHouseVO.getHouseName().equals(doorNumber)).collect(Collectors.toList()); |
| | | // if (ObjectUtils.isEmpty(collect)) { |
| | | // throw new ServiceException("门牌号后台不存在或格式错误,错误门牌号为"+doorNumber); |
| | | // }else{ |
| | | // sysUserInputDO.setHouseCode(collect.get(0).getHouseCode()); |
| | | // } |
| | | sysUserInputDO.setAreaId(comMngStructAreaVO.getId()); |
| | | sysUserInputDO.setCommunityId(comMngStructAreaVO.getCommunityId()); |
| | | sysUserInputDO.setCompany(eexcelUserDTO.getCompany()); |
| | |
| | | iPage.getRecords().forEach(record->{ |
| | | record.setPhone(SensitiveUtil.desensitizedPhoneNumber(record.getPhone())); |
| | | record.setIdCard(SensitiveUtil.desensitizedIdNumber(record.getIdCard())); |
| | | if(!StringUtils.isEmpty(record.getTags()) && record.getTags().endsWith(",")){ |
| | | record.setTags(record.getTags().substring(0,record.getTags().length()-1)); |
| | | } |
| | | }); |
| | | return R.ok(iPage); |
| | | } |
| | |
| | | SysUserInputDO userInputDO=new SysUserInputDO(); |
| | | userInputDO.setId(inputUserTagsDTO.getId()); |
| | | userInputDO.setTags(inputUserTagsDTO.getTags()); |
| | | List<SysUserInputDO> all = sysUserInputDAO.selectList(new QueryWrapper<SysUserInputDO>().lambda().eq(SysUserInputDO::getIdCard,userInputDO.getIdCard())); |
| | | List<SysUserInputDO> all = sysUserInputDAO.selectList(new QueryWrapper<SysUserInputDO>().lambda().eq(SysUserInputDO::getId,userInputDO.getId())); |
| | | all.forEach(d->{ |
| | | d.setTags(inputUserTagsDTO.getTags()); |
| | | if(!StringUtils.isEmpty(d.getTags())){ |
| | | d.setTags(d.getTags()+","+inputUserTagsDTO.getTags()); |
| | | }else{ |
| | | d.setTags(inputUserTagsDTO.getTags()); |
| | | } |
| | | sysUserInputDAO.updateById(userInputDO); |
| | | |
| | | }); |
| | | return R.ok(); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R deleteSpecialInputUserTags(Long id) { |
| | | ComMngUserTagDO comMngUserTagDO = comMngUserTagDAO.selectById(id); |
| | | if(null==comMngUserTagDO){ |
| | | return R.fail("标签不存在"); |
| | | } |
| | | if(comMngUserTagDO.getSysFlag()==1){ |
| | | return R.fail("系统预置标签不可删除"); |
| | | } |
| | | int delete = comMngUserTagDAO.deleteById(id); |
| | | if(delete>0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail("删除失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteSpecialInputUser(Long id) { |
| | | SysUserInputDO sysUserInputDO = sysUserInputDAO.selectById(id); |
| | | if(null==sysUserInputDO){ |
| | |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public R specialUserExport(ExportSpecialUserDTO exportSpecialUserDTO) { |
| | | List<EexcelUserDTO> eexcelUserDTOS=sysUserInputDAO.specialUserExport(exportSpecialUserDTO); |
| | | return R.ok(eexcelUserDTOS); |
| | | } |
| | | } |