mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
feat: add comprehensive logging to ImgPersonServiceImpl external calls and error paths
detail(): - [DETAIL] entry log with personId+businessId - [DETAIL] person not found warning - [DETAIL] zoneFeignClient/vehicleFeignClient failure warnings - [DETAIL] query error with personId context page(): - [PAGE] query result count - [PAGE] organizationService.getOrg failure warning - [PAGE] query error with context listByPage(): - [LIST-PAGE] listByImageId failure warning - [LIST-PAGE] no orgFloor → acrossDay debug add()/addExt(): - [ADD] error logs with personId context
This commit is contained in:
+24
-7
@@ -202,13 +202,13 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask(imageId));
|
imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask(imageId));
|
||||||
}
|
}
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
this.logger.error("人员信息新增失败,原因:{}", (Throwable) e);
|
this.logger.error("[ADD] personId={} failed: {}", personId, e.toString());
|
||||||
throw e;
|
throw e;
|
||||||
} catch (ImageStoreException e) {
|
} catch (ImageStoreException e) {
|
||||||
this.logger.error("人员信息新增失败,原因:{}", (Throwable) e);
|
this.logger.error("[ADD] personId={} imageStore failed: {}", personId, e.toString());
|
||||||
throw new ServiceException(e.getCode(), e.getMessage());
|
throw new ServiceException(e.getCode(), e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.logger.error("人员信息新增失败,原因:{}", e);
|
this.logger.error("[ADD] personId={} unexpected error", personId, e);
|
||||||
String errorMessage =
|
String errorMessage =
|
||||||
this.messageSource.getMessage("53014008", null, LocaleContextHolder.getLocale());
|
this.messageSource.getMessage("53014008", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014008", errorMessage);
|
throw new ServiceException("53014008", errorMessage);
|
||||||
@@ -255,7 +255,7 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.logger.error("人员信息新增失败,原因:{}", e);
|
this.logger.error("[ADD] personId={} unexpected error", personId, e);
|
||||||
String errorMessage =
|
String errorMessage =
|
||||||
this.messageSource.getMessage("53014008", null, LocaleContextHolder.getLocale());
|
this.messageSource.getMessage("53014008", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014008", errorMessage);
|
throw new ServiceException("53014008", errorMessage);
|
||||||
@@ -280,6 +280,7 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
PageHelper.orderBy("LAST_UPDATE_TIME DESC, ID DESC");
|
PageHelper.orderBy("LAST_UPDATE_TIME DESC, ID DESC");
|
||||||
Page<ImgStorePerson> gets = (Page<ImgStorePerson>) this.imgStorePersonMapper.gets(dto);
|
Page<ImgStorePerson> gets = (Page<ImgStorePerson>) this.imgStorePersonMapper.gets(dto);
|
||||||
List<ImgStorePerson> result = gets.getResult();
|
List<ImgStorePerson> result = gets.getResult();
|
||||||
|
this.logger.debug("[PAGE] query returned {} persons businessId={}", result.size(), businessId);
|
||||||
List<ImgStorePersonGetResult> imgStorePersonResults =
|
List<ImgStorePersonGetResult> imgStorePersonResults =
|
||||||
getImgStorePersonResults(result, context.getCompany().getCompanyId());
|
getImgStorePersonResults(result, context.getCompany().getCompanyId());
|
||||||
Set<String> orgSet = getOrgSet(imgStorePersonResults);
|
Set<String> orgSet = getOrgSet(imgStorePersonResults);
|
||||||
@@ -300,6 +301,9 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
orgId, orgMap.getOrDefault(orgId, new ArrayList<String>())));
|
orgId, orgMap.getOrDefault(orgId, new ArrayList<String>())));
|
||||||
item.setOrganizationComplete(orgCompleteMap);
|
item.setOrganizationComplete(orgCompleteMap);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.logger.warn("[PAGE] organizationService.getOrg failed code={}",
|
||||||
|
orgResult.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<String> userIdList =
|
List<String> userIdList =
|
||||||
@@ -345,6 +349,9 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
this.elevatorFeignClient.listByImageId(acsPassRuleImageForm);
|
this.elevatorFeignClient.listByImageId(acsPassRuleImageForm);
|
||||||
if (Objects.equals(images.getCode(), "00000000")) {
|
if (Objects.equals(images.getCode(), "00000000")) {
|
||||||
imgStorePersonResult.setFloorInfoList((List) images.getData());
|
imgStorePersonResult.setFloorInfoList((List) images.getData());
|
||||||
|
} else {
|
||||||
|
this.logger.warn("[LIST-PAGE] personId={} listByImageId failed code={}",
|
||||||
|
imgStorePersonResult.getId(), images.getCode());
|
||||||
}
|
}
|
||||||
imgStorePersonResult.setDefaultChooseFloor(imgStorePersonResult.getDefaultFloor());
|
imgStorePersonResult.setDefaultChooseFloor(imgStorePersonResult.getDefaultFloor());
|
||||||
if (!CollectionUtils.isEmpty(imgStorePersonResult.getOrganizationIds())) {
|
if (!CollectionUtils.isEmpty(imgStorePersonResult.getOrganizationIds())) {
|
||||||
@@ -352,6 +359,8 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
this.orgFloorMapper.listByOrgIds(imgStorePersonResult.getOrganizationIds());
|
this.orgFloorMapper.listByOrgIds(imgStorePersonResult.getOrganizationIds());
|
||||||
if (CollectionUtils.isEmpty(orgFloorList)) {
|
if (CollectionUtils.isEmpty(orgFloorList)) {
|
||||||
imgStorePersonResult.setIsAcrossDay(Integer.valueOf(1));
|
imgStorePersonResult.setIsAcrossDay(Integer.valueOf(1));
|
||||||
|
this.logger.debug("[LIST-PAGE] personId={} no orgFloor → acrossDay=true",
|
||||||
|
imgStorePersonResult.getId());
|
||||||
} else {
|
} else {
|
||||||
imgStorePersonResult.setIsAcrossDay(Integer.valueOf(0));
|
imgStorePersonResult.setIsAcrossDay(Integer.valueOf(0));
|
||||||
if (imgStorePersonResult.getOrganizationIds().contains(this.xhwId)) {
|
if (imgStorePersonResult.getOrganizationIds().contains(this.xhwId)) {
|
||||||
@@ -391,7 +400,7 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
pageAble = new CloudwalkPageAble(imgStorePersonResults, page, gets.getTotal());
|
pageAble = new CloudwalkPageAble(imgStorePersonResults, page, gets.getTotal());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.logger.error("分页查询人员信息失败,原因:", e);
|
this.logger.error("[PAGE] query failed", e);
|
||||||
String errorMessage =
|
String errorMessage =
|
||||||
this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale());
|
this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014011", errorMessage);
|
throw new ServiceException("53014011", errorMessage);
|
||||||
@@ -600,6 +609,7 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
try {
|
try {
|
||||||
ImgStorePerson personList = this.imgStorePersonMapper.selectByPrimaryKey(param.getId());
|
ImgStorePerson personList = this.imgStorePersonMapper.selectByPrimaryKey(param.getId());
|
||||||
if (null != personList) {
|
if (null != personList) {
|
||||||
|
this.logger.debug("[DETAIL] personId={} found businessId={}", param.getId(), businessId);
|
||||||
if (StringUtils.isNotBlank(personList.getDefaultFloor())) {
|
if (StringUtils.isNotBlank(personList.getDefaultFloor())) {
|
||||||
List<String> ids = Arrays.asList(new String[] {personList.getDefaultFloor()});
|
List<String> ids = Arrays.asList(new String[] {personList.getDefaultFloor()});
|
||||||
QueryZoneForm queryZoneForm = new QueryZoneForm();
|
QueryZoneForm queryZoneForm = new QueryZoneForm();
|
||||||
@@ -607,7 +617,6 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
queryZoneForm.setIds(ids);
|
queryZoneForm.setIds(ids);
|
||||||
CloudwalkResult<List<ZoneResult>> zoneDetail =
|
CloudwalkResult<List<ZoneResult>> zoneDetail =
|
||||||
this.zoneFeignClient.findZonelist(queryZoneForm);
|
this.zoneFeignClient.findZonelist(queryZoneForm);
|
||||||
this.logger.debug("当前楼层信息{}", JSON.toJSONString(zoneDetail));
|
|
||||||
if (Objects.equals(zoneDetail.getCode(), "00000000")) {
|
if (Objects.equals(zoneDetail.getCode(), "00000000")) {
|
||||||
String zoneName = "";
|
String zoneName = "";
|
||||||
List<ZoneResult> data = (List<ZoneResult>) zoneDetail.getData();
|
List<ZoneResult> data = (List<ZoneResult>) zoneDetail.getData();
|
||||||
@@ -615,6 +624,9 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
zoneName = ((ZoneResult) data.get(i)).getName();
|
zoneName = ((ZoneResult) data.get(i)).getName();
|
||||||
}
|
}
|
||||||
personList.setFloorName(zoneName);
|
personList.setFloorName(zoneName);
|
||||||
|
} else {
|
||||||
|
this.logger.warn("[DETAIL] personId={} zoneFeignClient.findZonelist failed code={}",
|
||||||
|
param.getId(), zoneDetail.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AddVehiclePersonForm form = new AddVehiclePersonForm();
|
AddVehiclePersonForm form = new AddVehiclePersonForm();
|
||||||
@@ -622,6 +634,9 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
CloudwalkResult<List<String>> vehcleResult = this.vehicleFeignClient.getVehicleIds(form);
|
CloudwalkResult<List<String>> vehcleResult = this.vehicleFeignClient.getVehicleIds(form);
|
||||||
if (Objects.equals(vehcleResult.getCode(), "00000000")) {
|
if (Objects.equals(vehcleResult.getCode(), "00000000")) {
|
||||||
personList.setVehicleList((List) vehcleResult.getData());
|
personList.setVehicleList((List) vehcleResult.getData());
|
||||||
|
} else {
|
||||||
|
this.logger.debug("[DETAIL] personId={} vehicleFeignClient.getVehicleIds failed code={}",
|
||||||
|
param.getId(), vehcleResult.getCode());
|
||||||
}
|
}
|
||||||
List<ImgStorePersonGetResult> imgStorePersonResults =
|
List<ImgStorePersonGetResult> imgStorePersonResults =
|
||||||
getImgStorePersonResults(Arrays.asList(personList), businessId);
|
getImgStorePersonResults(Arrays.asList(personList), businessId);
|
||||||
@@ -683,9 +698,11 @@ public class ImgPersonServiceImpl extends AbstractImagStoreService
|
|||||||
.collect(Collectors.toMap(UserQueryResult::getId, UserQueryResult::getName));
|
.collect(Collectors.toMap(UserQueryResult::getId, UserQueryResult::getName));
|
||||||
result.setCreateUserName(userNameMap.get(result.getCreateUserId()));
|
result.setCreateUserName(userNameMap.get(result.getCreateUserId()));
|
||||||
result.setLastUpdateUserName(userNameMap.get(result.getLastUpdateUserId()));
|
result.setLastUpdateUserName(userNameMap.get(result.getLastUpdateUserId()));
|
||||||
|
} else {
|
||||||
|
this.logger.warn("[DETAIL] personId={} not found in DB", param.getId());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.logger.error("查询人员详情失败,原因:", e);
|
this.logger.error("[DETAIL] personId={} query failed", param.getId(), e);
|
||||||
String errorMessage =
|
String errorMessage =
|
||||||
this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale());
|
this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014011", errorMessage);
|
throw new ServiceException("53014011", errorMessage);
|
||||||
|
|||||||
Reference in New Issue
Block a user