|
|
@ -43,7 +43,6 @@ import com.epmet.feign.GovOrgFeignClient; |
|
|
|
import com.epmet.service.GridVisitedService; |
|
|
|
import com.epmet.service.RegisterRelationService; |
|
|
|
import com.epmet.util.ModuleConstant; |
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
@ -52,7 +51,6 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* 注册关系表 用于统计客户网格的注册居民数 |
|
|
@ -62,12 +60,6 @@ import java.util.concurrent.*; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelationDao, RegisterRelationEntity> implements RegisterRelationService { |
|
|
|
private static ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
|
|
|
.setNameFormat("registerRelationService-pool-%d").build(); |
|
|
|
private static final ExecutorService threadPool = new ThreadPoolExecutor(1, 1, |
|
|
|
0L, TimeUnit.MILLISECONDS, |
|
|
|
new ArrayBlockingQueue(1), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); |
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(RegisterRelationServiceImpl.class); |
|
|
|
|
|
|
|
|
|
|
@ -178,16 +170,6 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio |
|
|
|
wrapper.eq(UserCustomerConstant.USER_ID,enterGridFormDTO.getUserId()); |
|
|
|
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); |
|
|
|
|
|
|
|
//3.获取权限
|
|
|
|
Future<Boolean> futureUserRole = threadPool.submit(() -> { |
|
|
|
setUserRoleList(enterGridFormDTO, resultObj); |
|
|
|
setGridName(resultObj, gridId); |
|
|
|
return true; |
|
|
|
}); |
|
|
|
|
|
|
|
//4.去网格表中查询网格对应的名称
|
|
|
|
//Future<Boolean> futureGridName = threadPool.submit(() -> setGridName(resultObj, gridId));
|
|
|
|
|
|
|
|
//1.查找用户注册关系表,如果没有表示当前用户为陌生人(拉取用户微信表信息),如果有表示当前用户已经进行居民认证
|
|
|
|
if(null == registerRecords || registerRecords.size() <= 0){ |
|
|
|
//当前用户尚未注册过居民信息
|
|
|
@ -270,15 +252,13 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio |
|
|
|
|
|
|
|
VisitedFormDTO visitedFormDTO = setShowNameAndBuildVistedRecord(enterGridFormDTO, resultObj, strangerInfo); |
|
|
|
|
|
|
|
|
|
|
|
//3.获取权限
|
|
|
|
setUserRoleList(enterGridFormDTO, resultObj); |
|
|
|
//4.去网格表中查询网格对应的名称
|
|
|
|
setGridName(resultObj, gridId); |
|
|
|
if(!gridVisitedService.saveVisitedRecord(visitedFormDTO).success()){ |
|
|
|
log.warn(ModuleConstant.SAVE_VISITED_RECORD_FAILURE); |
|
|
|
} |
|
|
|
try { |
|
|
|
futureUserRole.get(); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("thread get result exception",e); |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|