|
|
|
@ -20,7 +20,6 @@ package com.elink.esua.epdc.service.impl; |
|
|
|
import cn.afterturn.easypoi.excel.ExcelImportUtil; |
|
|
|
import cn.afterturn.easypoi.excel.entity.ImportParams; |
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
@ -32,7 +31,6 @@ import com.elink.esua.epdc.commons.tools.enums.UserSexEnum; |
|
|
|
import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; |
|
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.redis.UserDetailRedis; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.*; |
|
|
|
import com.elink.esua.epdc.config.StreamUtils; |
|
|
|
import com.elink.esua.epdc.constant.AuthenticatedConsant; |
|
|
|
@ -100,8 +98,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserInvitationRecordService userInvitationRecordService; |
|
|
|
@Autowired |
|
|
|
private UserDetailRedis userDetailRedis; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AdminFeignClient adminFeignClient; |
|
|
|
@Autowired |
|
|
|
@ -109,15 +106,10 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<UserDTO> page(Map<String, Object> params) { |
|
|
|
String state = MapUtil.getStr(params, "state"); |
|
|
|
String partyFlag = MapUtil.getStr(params, "partyFlag"); |
|
|
|
// 上边两个值都为0,表示查询未认证居民列表
|
|
|
|
if (YesOrNoEnum.NO.value().equals(state) && YesOrNoEnum.NO.value().equals(partyFlag)) { |
|
|
|
String[] paramKeys = new String[]{"streetId", "communityId", "gridId", "realName", "identityNo", "startTime", "endTime", "nickname", "mobile"}; |
|
|
|
if (AppUserUtils.isDefaultQuery(params, paramKeys)) { |
|
|
|
List<UserDTO> userDtoList = Lists.newArrayList(); |
|
|
|
return new PageData<>(userDtoList, NumConstant.ZERO); |
|
|
|
} |
|
|
|
String[] paramKeys = new String[]{"streetId", "communityId", "gridId", "realName", "identityNo", "startTime", "endTime", "nickname", "mobile"}; |
|
|
|
if (AppUserUtils.isDefaultQuery(params, paramKeys)) { |
|
|
|
List<UserDTO> userDtoList = Lists.newArrayList(); |
|
|
|
return new PageData<>(userDtoList, NumConstant.ZERO); |
|
|
|
} |
|
|
|
this.verifyParams(params); |
|
|
|
// 查询当前用户所具有的的数据权限
|
|
|
|
@ -133,23 +125,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem |
|
|
|
} |
|
|
|
|
|
|
|
private Map<String, Object> verifyParams(Map<String, Object> params) { |
|
|
|
String param = (String) params.get("realName"); |
|
|
|
if (StringUtils.isNotBlank(param)) { |
|
|
|
params.put("realName", param.trim()); |
|
|
|
} |
|
|
|
param = (String) params.get("nickname"); |
|
|
|
if (StringUtils.isNotBlank(param)) { |
|
|
|
params.put("nickname", param.trim()); |
|
|
|
} |
|
|
|
param = (String) params.get(FieldConstant.MOBILE_HUMP); |
|
|
|
if (StringUtils.isNotBlank(param)) { |
|
|
|
params.put(FieldConstant.MOBILE_HUMP, param.trim()); |
|
|
|
} |
|
|
|
param = (String) params.get("identityNo"); |
|
|
|
if (StringUtils.isNotBlank(param)) { |
|
|
|
params.put("identityNo", param.trim()); |
|
|
|
} |
|
|
|
return params; |
|
|
|
|
|
|
|
String[] paramKeys = new String[]{"realName", "identityNo", "nickname", FieldConstant.MOBILE_HUMP}; |
|
|
|
|
|
|
|
return AppUserUtils.trimParamValue(params, paramKeys); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@ -157,7 +137,8 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem |
|
|
|
UserEntity entity = baseDao.selectById(id); |
|
|
|
UserDTO resultDTO = ConvertUtils.sourceToTarget(entity, UserDTO.class); |
|
|
|
resultDTO.setTotalSubmitNum(userAuthenticateHistoryDao.countAuthenticateHistory(id, null)); |
|
|
|
resultDTO.setTotalFailNum(userAuthenticateHistoryDao.countAuthenticateHistory(id, NumConstant.ZERO_STR));//0 未通过1通过
|
|
|
|
//0 未通过1通过
|
|
|
|
resultDTO.setTotalFailNum(userAuthenticateHistoryDao.countAuthenticateHistory(id, NumConstant.ZERO_STR)); |
|
|
|
resultDTO.setTotalPassSubmitNum(userAuthenticateHistoryDao.countAuthenticateHistory(id, NumConstant.ONE_STR)); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|