mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
fix: P0+P2+P3 — CpOrgDevieKit, ValidateManager, OrganizationServiceImpl clean
P0: CpOrgDevieKitServiceImpl (54→0) - Fixed 10 $\$ artifacts with correct variable names - Typed 7 raw Collection/List/Set declarations - Removed (Object) casts from redisTemplate calls P2: CpImageStorePersonValidateManager (36→0) - Added RedisCallback cast for execute() ambiguity - Typed Map.Entry for-each with proper generics - Fixed ternary type mismatch (List<Object>→SyncPersonLocal) - Typed waitAddValidateList as List<GroupPersonRef> P3: OrganizationServiceImpl (32→0) - Typed 7 raw List declarations (refDTOS, data, organizations, etc) - Fixed ArrayList<> vs List<> assignment - Typed passableArea/officeArea streams
This commit is contained in:
+19
-18
@@ -28,6 +28,7 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Scheduler;
|
||||
@@ -99,7 +100,7 @@ public class CpImageStorePersonValidateManager {
|
||||
iterator.remove();
|
||||
}
|
||||
Scheduler scheduler = this.taskExecClient.getScheduler(this.quartzTaskProperties.getSchedulerName());
|
||||
for (Map.Entry entry : removeMap.entrySet()) {
|
||||
for (Map.Entry<Long, Set<SyncPersonLocal>> entry : ((Map<Long, Set<SyncPersonLocal>>) (Map) removeMap).entrySet()) {
|
||||
Long l = (Long)entry.getKey();
|
||||
lockValue = SnowFlake.nextId();
|
||||
try {
|
||||
@@ -109,7 +110,7 @@ public class CpImageStorePersonValidateManager {
|
||||
Trigger trigger = scheduler.getTrigger(triggerKey);
|
||||
if (trigger == null || !StringUtils.isNotBlank((CharSequence)(dataSet = trigger.getJobDataMap().getString("VALIDATE_TRIGGER_KEY")))) continue;
|
||||
List<SyncPersonLocal> syncPersonDTOS = JsonUtils.toObjList(dataSet, SyncPersonLocal.class);
|
||||
syncPersonDTOS = CpImageStorePersonValidateManager.removeAll(syncPersonDTOS, (Set)entry.getValue());
|
||||
syncPersonDTOS = CpImageStorePersonValidateManager.removeAll(syncPersonDTOS, entry.getValue());
|
||||
if (addMap.containsKey(l)) {
|
||||
Set keyAddSet = (Set)addMap.get(l);
|
||||
syncPersonDTOS = CpImageStorePersonValidateManager.addAll(syncPersonDTOS, keyAddSet);
|
||||
@@ -131,7 +132,7 @@ public class CpImageStorePersonValidateManager {
|
||||
this.validateJobGroupUnLock(l, lockValue);
|
||||
}
|
||||
}
|
||||
for (Map.Entry entry : addMap.entrySet()) {
|
||||
for (Map.Entry<Long, Set<SyncPersonLocal>> entry : ((Map<Long, Set<SyncPersonLocal>>) (Map) addMap).entrySet()) {
|
||||
if (((Set)entry.getValue()).isEmpty()) continue;
|
||||
Long l = (Long)entry.getKey();
|
||||
lockValue = SnowFlake.nextId();
|
||||
@@ -147,8 +148,8 @@ public class CpImageStorePersonValidateManager {
|
||||
continue;
|
||||
}
|
||||
String dataSet = trigger.getJobDataMap().getString("VALIDATE_TRIGGER_KEY");
|
||||
List<Object> syncPersonDtoList = StringUtils.isNotBlank((CharSequence)dataSet) ? JsonUtils.toObjList(dataSet, SyncPersonLocal.class) : Lists.newArrayList();
|
||||
syncPersonDtoList = CpImageStorePersonValidateManager.addAll(syncPersonDtoList, (Set)entry.getValue());
|
||||
List<SyncPersonLocal> syncPersonDtoList = StringUtils.isNotBlank((CharSequence)dataSet) ? JsonUtils.toObjList(dataSet, SyncPersonLocal.class) : new ArrayList<>();
|
||||
syncPersonDtoList = CpImageStorePersonValidateManager.addAll(syncPersonDtoList, entry.getValue());
|
||||
trigger.getJobDataMap().put("VALIDATE_TRIGGER_KEY", JsonUtils.toJson(syncPersonDtoList));
|
||||
scheduler.rescheduleJob(triggerKey, trigger);
|
||||
continue;
|
||||
@@ -166,9 +167,9 @@ public class CpImageStorePersonValidateManager {
|
||||
}
|
||||
}
|
||||
this.updateExpiryDateStatus(currentTime, syncPersonList);
|
||||
Map<String, List<SyncPersonDTO>> deleteImageMap = (java.util.Map<java.lang.String,java.util.List<cn.cloudwalk.data.organization.dto.SyncPersonDTO>>) deleteSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
||||
for (Map.Entry entry : deleteImageMap.entrySet()) {
|
||||
Set<String> keySet = ((List)entry.getValue()).parallelStream().map(s -> s.getImageId()).collect(Collectors.toSet());
|
||||
Map<String, List<SyncPersonDTO>> deleteImageMap = (Map<String, List<SyncPersonDTO>>) (Map) deleteSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
||||
for (Map.Entry<String, List<SyncPersonDTO>> entry : deleteImageMap.entrySet()) {
|
||||
Set<String> keySet = entry.getValue().parallelStream().map(s -> s.getImageId()).collect(Collectors.toSet());
|
||||
this.cpImageStorePersonTxHandler.handleImageStoreImageChange((String)entry.getKey(), keySet, false);
|
||||
}
|
||||
Map<String, List<SyncPersonDTO>> addImageMap = (java.util.Map<java.lang.String,java.util.List<cn.cloudwalk.data.organization.dto.SyncPersonDTO>>) addSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
||||
@@ -204,7 +205,7 @@ public class CpImageStorePersonValidateManager {
|
||||
String lockKey = "validate_job_group_lock:" + key;
|
||||
while (true) {
|
||||
Long lockResult;
|
||||
if (0L == (lockResult = (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.lockValidateJobRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{lockKey.getBytes(), String.valueOf(lockValue).getBytes(), this.lockValidateJobGroupSecond.getBytes()})))) {
|
||||
if (0L == (lockResult = (Long)this.redisTemplate.execute((RedisCallback) connection -> (Long)connection.eval(this.lockValidateJobRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{lockKey.getBytes(), String.valueOf(lockValue).getBytes(), this.lockValidateJobGroupSecond.getBytes()})))) {
|
||||
log.info("CpImageStorePersonValidateManager validateJobGroupLock success:{}", (Object)key);
|
||||
return true;
|
||||
}
|
||||
@@ -230,7 +231,7 @@ public class CpImageStorePersonValidateManager {
|
||||
private boolean validateJobGroupUnLock(Long key, Long lockValue) {
|
||||
log.info("CpImageStorePersonValidateManager validateJobGroupUnLock:{},{}", (Object)key, (Object)lockValue);
|
||||
String lockKey = "validate_job_group_lock:" + key;
|
||||
Long lockResult = (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.unlockValidateJobRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{lockKey.getBytes(), String.valueOf(lockValue).getBytes()}));
|
||||
Long lockResult = (Long)this.redisTemplate.execute((RedisCallback) connection -> (Long)connection.eval(this.unlockValidateJobRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{lockKey.getBytes(), String.valueOf(lockValue).getBytes()}));
|
||||
if (0L == lockResult) {
|
||||
log.info("CpImageStorePersonValidateManager validateJobGroupUnLock success:{},{}", (Object)key, (Object)lockValue);
|
||||
return true;
|
||||
@@ -413,7 +414,7 @@ public class CpImageStorePersonValidateManager {
|
||||
queryGroupPersonDTO.setEndTime(delayTime);
|
||||
queryGroupPersonDTO.setExpiryBeginDateStatus(Integer.valueOf(0));
|
||||
queryGroupPersonDTO.setExpiryEndDateStatus(Integer.valueOf(0));
|
||||
List waitAddValidateList = this.groupPersonRefMapper.queryByExpiryDateStatus(queryGroupPersonDTO);
|
||||
List<GroupPersonRef> waitAddValidateList = this.groupPersonRefMapper.queryByExpiryDateStatus(queryGroupPersonDTO);
|
||||
if (CollectionUtils.isEmpty((Collection)waitAddValidateList)) {
|
||||
log.debug("[{}-{}]时间范围内没有需要添加的trigger", (Object)queryGroupPersonDTO.getStartTime(), (Object)queryGroupPersonDTO.getEndTime());
|
||||
}
|
||||
@@ -422,7 +423,7 @@ public class CpImageStorePersonValidateManager {
|
||||
ConcurrentHashSet deleteSet = new ConcurrentHashSet();
|
||||
HashSet changeGroupIdSet = Sets.newHashSet();
|
||||
ArrayList syncPersonList = Lists.newArrayListWithCapacity((int)waitAddValidateList.size());
|
||||
waitAddValidateList = (java.util.List) waitAddValidateList.stream().sorted(Comparator.comparing(GroupPersonRef::getExpiryBeginDate)).collect(Collectors.toList());
|
||||
waitAddValidateList = (List) waitAddValidateList.stream().sorted(Comparator.comparing(GroupPersonRef::getExpiryBeginDate)).collect(Collectors.toList());
|
||||
waitAddValidateList.stream().forEach(arg_0 -> this.lambda$delayAddValidateTrigger$24(changeGroupIdSet, syncPersonList, currentTime, (Set)addSet, delayTime, addMap, (Set)deleteSet, arg_0));
|
||||
Iterator iterator = addSet.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -436,7 +437,7 @@ public class CpImageStorePersonValidateManager {
|
||||
iterator.remove();
|
||||
}
|
||||
Scheduler scheduler = this.taskExecClient.getScheduler(this.quartzTaskProperties.getSchedulerName());
|
||||
for (Map.Entry entry : addMap.entrySet()) {
|
||||
for (Map.Entry<Long, Set<SyncPersonLocal>> entry : ((Map<Long, Set<SyncPersonLocal>>) (Map) addMap).entrySet()) {
|
||||
if (((Set)entry.getValue()).isEmpty()) continue;
|
||||
Long l = (Long)entry.getKey();
|
||||
Long lockValue = SnowFlake.nextId();
|
||||
@@ -450,8 +451,8 @@ public class CpImageStorePersonValidateManager {
|
||||
continue;
|
||||
}
|
||||
String dataSet = trigger.getJobDataMap().getString("VALIDATE_TRIGGER_KEY");
|
||||
List<Object> syncPersonDtoList = StringUtils.isNotBlank((CharSequence)dataSet) ? JsonUtils.toObjList(dataSet, SyncPersonLocal.class) : Lists.newArrayList();
|
||||
syncPersonDtoList = CpImageStorePersonValidateManager.addAll(syncPersonDtoList, (Set)entry.getValue());
|
||||
List<SyncPersonLocal> syncPersonDtoList = StringUtils.isNotBlank((CharSequence)dataSet) ? JsonUtils.toObjList(dataSet, SyncPersonLocal.class) : new ArrayList<>();
|
||||
syncPersonDtoList = CpImageStorePersonValidateManager.addAll(syncPersonDtoList, entry.getValue());
|
||||
trigger.getJobDataMap().put("VALIDATE_TRIGGER_KEY", JsonUtils.toJson(syncPersonDtoList));
|
||||
scheduler.rescheduleJob(triggerKey, trigger);
|
||||
continue;
|
||||
@@ -469,9 +470,9 @@ public class CpImageStorePersonValidateManager {
|
||||
}
|
||||
}
|
||||
this.updateExpiryDateStatus(currentTime, syncPersonList);
|
||||
Map<String, List<SyncPersonDTO>> deleteImageMap = (java.util.Map<java.lang.String,java.util.List<cn.cloudwalk.data.organization.dto.SyncPersonDTO>>) deleteSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
||||
for (Map.Entry entry : deleteImageMap.entrySet()) {
|
||||
Set<String> keySet = ((List)entry.getValue()).parallelStream().map(s -> s.getImageId()).collect(Collectors.toSet());
|
||||
Map<String, List<SyncPersonDTO>> deleteImageMap = (Map<String, List<SyncPersonDTO>>) (Map) deleteSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
||||
for (Map.Entry<String, List<SyncPersonDTO>> entry : deleteImageMap.entrySet()) {
|
||||
Set<String> keySet = entry.getValue().parallelStream().map(s -> s.getImageId()).collect(Collectors.toSet());
|
||||
this.cpImageStorePersonTxHandler.handleImageStoreImageChange((String)entry.getKey(), keySet, false);
|
||||
}
|
||||
Map<String, List<SyncPersonDTO>> addImageMap = (java.util.Map<java.lang.String,java.util.List<cn.cloudwalk.data.organization.dto.SyncPersonDTO>>) addSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
||||
|
||||
+21
-21
@@ -114,7 +114,7 @@ implements CpOrgDevieKitService {
|
||||
UpdateGroupResult updateGroupResult = new UpdateGroupResult();
|
||||
BeanCopyUtils.copyProperties((Object)updateGroupParam, (Object)updateGroupResult);
|
||||
updateGroupResult.setGroups(groups);
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updateGroupResult);
|
||||
}
|
||||
|
||||
public CloudwalkResult<UpdateFeatureResult> onUpdateFeatureRequest(UpdateFeatureParam updateFeatureParam, CloudwalkCallContext cloudwalkCallContext) throws ServiceException {
|
||||
@@ -124,7 +124,7 @@ implements CpOrgDevieKitService {
|
||||
AtomicDeviceGetResult device = this.checkAndGetDeviceByCode(updateFeatureParam.getDeviceId(), cloudwalkCallContext);
|
||||
boolean checkBoolean = this.checkDeviceImageStoreIdRefExist(updateFeatureParam.getGroupId(), device.getId(), cloudwalkCallContext);
|
||||
if (!checkBoolean) {
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updateFeatureResult);
|
||||
}
|
||||
DeviceImageUpdateFeatureQuery updatePersonQuery = new DeviceImageUpdateFeatureQuery();
|
||||
updatePersonQuery.setImageStoreId(updateFeatureParam.getGroupId());
|
||||
@@ -137,7 +137,7 @@ implements CpOrgDevieKitService {
|
||||
}
|
||||
if (!(updatePersonInfo = this.cpDeviceImagePersonService.getDeviceImageUpdateFeatureInfo(updatePersonQuery, cloudwalkCallContext)).isSuccess()) {
|
||||
this.logger.warn("get feature info error,device:{}, imageStore:{}", (Object)updateFeatureParam.getDeviceId(), (Object)updateFeatureParam.getGroupId());
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updateFeatureResult);
|
||||
}
|
||||
CloudwalkPageAble personInfoData = (CloudwalkPageAble)updatePersonInfo.getData();
|
||||
updateFeatureResult.setCurrentPage(Integer.valueOf((int)personInfoData.getCurrentPage()));
|
||||
@@ -145,7 +145,7 @@ implements CpOrgDevieKitService {
|
||||
updateFeatureResult.setPagePize(Integer.valueOf((int)personInfoData.getPageSize()));
|
||||
updateFeatureResult.setTotalPages(Integer.valueOf((int)personInfoData.getTotalPages()));
|
||||
ArrayList<UpdateFeatureResult.FeatureData> featureDatas = new ArrayList<UpdateFeatureResult.FeatureData>();
|
||||
Collection personInfoDataDatas = personInfoData.getDatas();
|
||||
Collection<DeviceImageUpdateFeautreResult> personInfoDataDatas = personInfoData.getDatas();
|
||||
for (DeviceImageUpdateFeautreResult deviceUpdatePersonResult : personInfoDataDatas) {
|
||||
UpdateFeatureResult.FeatureData featureData = new UpdateFeatureResult.FeatureData();
|
||||
featureData.setFaceId(deviceUpdatePersonResult.getFaceId());
|
||||
@@ -163,7 +163,7 @@ implements CpOrgDevieKitService {
|
||||
} else {
|
||||
updateFeatureResult.setEndFlag(EndFlagEnum.NO_END.getCode());
|
||||
}
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updateFeatureResult);
|
||||
}
|
||||
|
||||
public CloudwalkResult<UpdatePictureResult> onUpdatePictureRequest(UpdatePictureParam updatePictureParam, CloudwalkCallContext cloudwalkCallContext) throws ServiceException {
|
||||
@@ -173,7 +173,7 @@ implements CpOrgDevieKitService {
|
||||
AtomicDeviceGetResult device = this.checkAndGetDeviceByCode(updatePictureParam.getDeviceId(), cloudwalkCallContext);
|
||||
boolean checkBoolean = this.checkDeviceImageStoreIdRefExist(updatePictureParam.getGroupId(), device.getId(), cloudwalkCallContext);
|
||||
if (!checkBoolean) {
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updatePictureResult);
|
||||
}
|
||||
DeviceImageUpdatePersonQuery updatePersonQuery = new DeviceImageUpdatePersonQuery();
|
||||
updatePersonQuery.setImageStoreId(updatePictureParam.getGroupId());
|
||||
@@ -186,14 +186,14 @@ implements CpOrgDevieKitService {
|
||||
}
|
||||
if (!(updatePersonInfo = this.cpDeviceImagePersonService.getDeviceImageUpdatePersonInfo(updatePersonQuery, cloudwalkCallContext)).isSuccess()) {
|
||||
this.logger.warn("get picture info error,device:{}, imageStore:{}", (Object)updatePictureParam.getDeviceId(), (Object)updatePictureParam.getGroupId());
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updatePictureResult);
|
||||
}
|
||||
CloudwalkPageAble personInfoData = (CloudwalkPageAble)updatePersonInfo.getData();
|
||||
updatePictureParam.setCurrentPage(Integer.valueOf((int)personInfoData.getCurrentPage()));
|
||||
updatePictureParam.setGroupId(updatePictureParam.getGroupId());
|
||||
updatePictureParam.setPageSize(Integer.valueOf((int)personInfoData.getPageSize()));
|
||||
ArrayList<UpdatePictureResult.ImageData> personDatas = new ArrayList<UpdatePictureResult.ImageData>();
|
||||
Collection personInfoDataDatas = personInfoData.getDatas();
|
||||
Collection<DeviceImageUpdatePersonResult> personInfoDataDatas = personInfoData.getDatas();
|
||||
for (DeviceImageUpdatePersonResult deviceUpdatePersonResult : personInfoDataDatas) {
|
||||
UpdatePictureResult.ImageData imageData = new UpdatePictureResult.ImageData();
|
||||
imageData.setFaceId(deviceUpdatePersonResult.getImageId());
|
||||
@@ -212,7 +212,7 @@ implements CpOrgDevieKitService {
|
||||
updatePictureResult.setEndFlag(EndFlagEnum.NO_END.getCode());
|
||||
}
|
||||
BeanCopyUtils.copyProperties((Object)updatePictureParam, (Object)updatePictureResult);
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updatePictureResult);
|
||||
}
|
||||
|
||||
public CloudwalkResult<UpdatePersonResult> onUpdatePersonRequest(UpdatePersonParam updatePersonParam, CloudwalkCallContext cloudwalkCallContext) throws ServiceException {
|
||||
@@ -232,7 +232,7 @@ implements CpOrgDevieKitService {
|
||||
List deviceImageStoreList = this.deviceImageStoreMapper.select(query);
|
||||
if (!CollectionUtils.isEmpty((Collection)deviceImageStoreList) && (deviceImageStore = (DeviceImageStore)deviceImageStoreList.get(0)).getType() == 2 && null != deviceImageStore.getFinishPullTime()) {
|
||||
updatePersonResult.setEndFlag(EndFlagEnum.END.getCode());
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updatePersonResult);
|
||||
}
|
||||
}
|
||||
DeviceImageUpdatePersonQuery updatePersonQuery = new DeviceImageUpdatePersonQuery();
|
||||
@@ -252,7 +252,7 @@ implements CpOrgDevieKitService {
|
||||
this.logger.info("20113 getDeviceUpdatePersonInfo,spend time {} millis", (Object)(t2 - t1));
|
||||
if (!updatePersonInfo.isSuccess()) {
|
||||
this.logger.warn("get person info error,device:{}, imageStore:{}", (Object)updatePersonParam.getDeviceId(), (Object)updatePersonParam.getGroupId());
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updatePersonResult);
|
||||
}
|
||||
CloudwalkPageAble personInfoData = (CloudwalkPageAble)updatePersonInfo.getData();
|
||||
updatePersonResult.setCurrentPage(Integer.valueOf((int)personInfoData.getCurrentPage()));
|
||||
@@ -260,7 +260,7 @@ implements CpOrgDevieKitService {
|
||||
updatePersonResult.setTotalPages(Integer.valueOf((int)personInfoData.getTotalPages()));
|
||||
updatePersonResult.setPagePize(Integer.valueOf((int)personInfoData.getPageSize()));
|
||||
ArrayList<UpdatePersonResult.PersonData> personData = new ArrayList<UpdatePersonResult.PersonData>();
|
||||
Collection personInfoDataDatas = personInfoData.getDatas();
|
||||
Collection<DeviceImageUpdatePersonResult> personInfoDataDatas = personInfoData.getDatas();
|
||||
for (DeviceImageUpdatePersonResult deviceUpdatePersonResult : personInfoDataDatas) {
|
||||
UpdatePersonResult.PersonData personDataTemp = new UpdatePersonResult.PersonData();
|
||||
personDataTemp.setUserId(deviceUpdatePersonResult.getPersonId());
|
||||
@@ -307,7 +307,7 @@ implements CpOrgDevieKitService {
|
||||
} else {
|
||||
updatePersonResult.setEndFlag(EndFlagEnum.NO_END.getCode());
|
||||
}
|
||||
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||
return (CloudwalkResult) CloudwalkResult.success(updatePersonResult);
|
||||
}
|
||||
|
||||
private void addSyncLogForFeatureUpdate(String deviceId, String groupId, List<UpdateFeatureResult.FeatureData> featureDatas) {
|
||||
@@ -484,7 +484,7 @@ implements CpOrgDevieKitService {
|
||||
this.logger.debug("设备code[{}]支持多图库", (Object)updatePersonParam.getDeviceId());
|
||||
return;
|
||||
}
|
||||
List imageStoreIds = Optional.ofNullable(this.deviceImageStoreMapper.findImageStoreIds(device.getId(), Short.valueOf((short)1))).orElse(new ArrayList());
|
||||
List<String> imageStoreIds = Optional.ofNullable(this.deviceImageStoreMapper.findImageStoreIds(device.getId(), Short.valueOf((short)1))).orElse(new ArrayList());
|
||||
imageStoreIds = imageStoreIds.stream().filter(id -> !id.equals(updatePersonParam.getGroupId())).collect(Collectors.toList());
|
||||
DevicePersonSyncLogDTO dto = new DevicePersonSyncLogDTO();
|
||||
dto.setDeviceId(device.getId());
|
||||
@@ -518,7 +518,7 @@ implements CpOrgDevieKitService {
|
||||
QueryGroupPersonDTO queryGroupPersonDTO = new QueryGroupPersonDTO();
|
||||
queryGroupPersonDTO.setPersonId(personInfo.getUserId());
|
||||
queryGroupPersonDTO.setImageStoreIds((Collection)dto.getImageStoreIds());
|
||||
List otherGroupPersons = Optional.ofNullable(this.groupPersonRefMapper.query(queryGroupPersonDTO)).orElse(new ArrayList());
|
||||
List<GroupPersonRef> otherGroupPersons = Optional.ofNullable(this.groupPersonRefMapper.query(queryGroupPersonDTO)).orElse(new ArrayList());
|
||||
otherGroupPersons = otherGroupPersons.stream().filter(groupPersonRef -> -1 != groupPersonRef.getStatus() || DelStatusEnum.DELETED.getCode().shortValue() != groupPersonRef.getIsDel().shortValue()).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(otherGroupPersons)) {
|
||||
this.logger.warn("设备[{}]人员[{}]未关联其他图库", (Object)dto.getDeviceId(), (Object)dto.getPersonId());
|
||||
@@ -537,7 +537,7 @@ implements CpOrgDevieKitService {
|
||||
return;
|
||||
}
|
||||
this.logger.debug("设备[{}]支持有效期", (Object)dto.getDeviceId());
|
||||
HashSet validDateCronSet = new HashSet();
|
||||
HashSet<String> validDateCronSet = new HashSet();
|
||||
JSONObject jsonObject = JSONObject.parseObject((String)personInfo.getReserveInfo());
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("passCrons");
|
||||
if (null != jsonArray && jsonArray.size() > 0) {
|
||||
@@ -579,18 +579,18 @@ implements CpOrgDevieKitService {
|
||||
private synchronized boolean lockSyncLog(String deviceId, String imageStoreId, String personId) {
|
||||
String value = deviceId + "_" + imageStoreId + "_" + personId;
|
||||
String key = SYNC_LOG_KEY + value;
|
||||
if (this.redisTemplate.hasKey((Object)key).booleanValue()) {
|
||||
if (this.redisTemplate.hasKey(key).booleanValue()) {
|
||||
return false;
|
||||
}
|
||||
this.redisTemplate.opsForValue().set((Object)key, (Object)value, this.syncLogExpireTime, TimeUnit.SECONDS);
|
||||
this.redisTemplate.opsForValue().set(key, value, this.syncLogExpireTime, TimeUnit.SECONDS);
|
||||
return true;
|
||||
}
|
||||
|
||||
private synchronized boolean unlockSyncLog(String deviceId, String imageStoreId, String personId) {
|
||||
String value = deviceId + "_" + imageStoreId + "_" + personId;
|
||||
String key = SYNC_LOG_KEY + value;
|
||||
if (this.redisTemplate.hasKey((Object)key).booleanValue()) {
|
||||
this.redisTemplate.delete((Object)key);
|
||||
if (this.redisTemplate.hasKey(key).booleanValue()) {
|
||||
this.redisTemplate.delete(key);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -642,7 +642,7 @@ implements CpOrgDevieKitService {
|
||||
throw new ServiceException(personRefs.getCode(), personRefs.getMessage());
|
||||
}
|
||||
HashMap<String, Long> personRefMap = new HashMap<String, Long>();
|
||||
List personRefsData = (List)personRefs.getData();
|
||||
List<DeviceImagePersonRefResult> personRefsData = (List)personRefs.getData();
|
||||
for (DeviceImagePersonRefResult deviceImagePersonRefResult : personRefsData) {
|
||||
personRefMap.put(deviceImagePersonRefResult.getImageStoreId(), deviceImagePersonRefResult.getImageLastUpdateTime());
|
||||
}
|
||||
|
||||
+11
-11
@@ -287,7 +287,7 @@ implements OrganizationService {
|
||||
|
||||
private UserQueryResult getByUserId(String userId, CloudwalkCallContext context) throws ServiceException {
|
||||
UserGetsParam param = new UserGetsParam();
|
||||
param.setIds((List)Lists.newArrayList((Object[])new String[]{userId}));
|
||||
param.setIds((List)Lists.newArrayList(userId));
|
||||
CloudwalkResult userList = this.userService.gets(param, context);
|
||||
if (userList.isSuccess() && !CollectionUtils.isEmpty((Collection)((Collection)userList.getData()))) {
|
||||
return (UserQueryResult)((List)userList.getData()).get(0);
|
||||
@@ -337,7 +337,7 @@ implements OrganizationService {
|
||||
if (StringUtils.isBlank((CharSequence)param.getParentId())) {
|
||||
List allOrg = this.imgStoreOrganizationMapper.getAllOrg(businessId);
|
||||
res = BeanCopyUtils.copy((Collection)allOrg, TreeOrganizationResult.class);
|
||||
res = (java.util.List) res.stream().filter(ToolUtil.distinctByKey(TreeOrganizationResult::getId)).collect(Collectors.toList());
|
||||
res = (List) res.stream().filter(ToolUtil.distinctByKey(TreeOrganizationResult::getId)).collect(Collectors.toList());
|
||||
} else {
|
||||
res = this.getTreeByParentId(param.getParentId(), businessId);
|
||||
}
|
||||
@@ -549,7 +549,7 @@ implements OrganizationService {
|
||||
getsOrganizationDTO.setBusinessId(businessId);
|
||||
getsOrganizationDTO.setIsDel(Short.valueOf((short)0));
|
||||
if (!CollectionUtils.isEmpty(orgIds)) {
|
||||
ids = param.getIds();
|
||||
ids = new ArrayList<>(param.getIds());
|
||||
if (!CollectionUtils.isEmpty((Collection)ids)) {
|
||||
orgIds.retainAll(ids);
|
||||
if (CollectionUtils.isEmpty(orgIds)) {
|
||||
@@ -810,7 +810,7 @@ implements OrganizationService {
|
||||
extendResult.setDetail(extendDetail);
|
||||
}
|
||||
result.setExtend(extendResult);
|
||||
List refDTOS = Optional.ofNullable(this.organizationAreaRefMapper.listByOrgId(orgId, businessId)).orElse(Collections.emptyList());
|
||||
List<OrganizationAreaRefDTO> refDTOS = Optional.ofNullable(this.organizationAreaRefMapper.listByOrgId(orgId, businessId)).orElse(Collections.emptyList());
|
||||
List officeArea = refDTOS.stream().filter(it -> it.getRefType() == 0).map(o -> o.getAreaId()).collect(Collectors.toList());
|
||||
List passableArea = refDTOS.stream().filter(it -> it.getRefType() == 1).map(o -> o.getAreaId()).collect(Collectors.toList());
|
||||
result.setPassableArea(passableArea);
|
||||
@@ -818,9 +818,9 @@ implements OrganizationService {
|
||||
QueryZoneUnitParam queryZoneUnitParam = new QueryZoneUnitParam();
|
||||
queryZoneUnitParam.setUnitIds(Collections.singletonList(organization.getId()));
|
||||
CloudwalkResult<List<ZoneUnitResultDTO>> zoneDetail = this.zoneFeignClient.findZoneDetailByUnitIds(queryZoneUnitParam);
|
||||
List<Object> zoneIds = new ArrayList();
|
||||
List<String> zoneIds = new ArrayList();
|
||||
if ("00000000".equals(zoneDetail.getCode())) {
|
||||
List data = (List)zoneDetail.getData();
|
||||
List<ZoneUnitResultDTO> data = (List)zoneDetail.getData();
|
||||
zoneIds = data.stream().map(z -> z.getZoneId()).collect(Collectors.toList());
|
||||
}
|
||||
result.setZoneIds(zoneIds);
|
||||
@@ -837,10 +837,10 @@ implements OrganizationService {
|
||||
if (param.getId() != null) {
|
||||
ids.add(param.getId());
|
||||
} else {
|
||||
ids = param.getIds();
|
||||
ids = new ArrayList<>(param.getIds());
|
||||
}
|
||||
List organizations = Optional.ofNullable(this.imgStoreOrganizationMapper.listNames(ids, businessId)).orElse(Collections.emptyList());
|
||||
Map<String, String> collect = (java.util.Map<java.lang.String,java.lang.String>) organizations.stream().collect(Collectors.toMap(it -> it.getId(), v -> v.getName()));
|
||||
List<Organization> organizations = Optional.ofNullable(this.imgStoreOrganizationMapper.listNames(ids, businessId)).orElse(Collections.emptyList());
|
||||
Map<String, String> collect = (Map) organizations.stream().collect(Collectors.toMap(it -> it.getId(), v -> v.getName()));
|
||||
return (CloudwalkResult)CloudwalkResult.success(collect);
|
||||
}
|
||||
|
||||
@@ -954,7 +954,7 @@ implements OrganizationService {
|
||||
}
|
||||
|
||||
private void saveAreaDetails(EditOrganizationParam param, String businessId) {
|
||||
List passableArea = param.getPassableArea();
|
||||
List<String> passableArea = param.getPassableArea();
|
||||
String organizationId = param.getId();
|
||||
boolean type = true;
|
||||
this.organizationAreaRefMapper.deleteAllByOrgId(organizationId, businessId);
|
||||
@@ -968,7 +968,7 @@ implements OrganizationService {
|
||||
refDTO.setCreateTime(Long.valueOf(System.currentTimeMillis()));
|
||||
return refDTO;
|
||||
}).collect(Collectors.toList());
|
||||
List officeArea = param.getOfficeArea();
|
||||
List<String> officeArea = param.getOfficeArea();
|
||||
List officeList = officeArea.stream().map(areaId -> {
|
||||
OrganizationAreaRefDTO refDTO = new OrganizationAreaRefDTO();
|
||||
refDTO.setAreaId(areaId);
|
||||
|
||||
Reference in New Issue
Block a user