|
|
@ -730,6 +730,52 @@ public class ServiceApplicationsService { |
|
|
return ResponseDTO.ok(); |
|
|
return ResponseDTO.ok(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 根据用户权限屏蔽成本数据 |
|
|
|
|
|
* @param statisticsList 统计数据列表 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void maskCostDataForUser(List<LawyerStatisticsVO> statisticsList) { |
|
|
|
|
|
if (statisticsList == null || statisticsList.isEmpty()) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RequestEmployee requestUser = AdminRequestUtil.getRequestUser(); |
|
|
|
|
|
if (requestUser == null) { |
|
|
|
|
|
// 用户未登录,屏蔽所有成本数据
|
|
|
|
|
|
statisticsList.forEach(this::clearCostData); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 检查用户的costVisibleFlag权限
|
|
|
|
|
|
Boolean costVisibleFlag = requestUser.getCostVisibleFlag(); |
|
|
|
|
|
if (costVisibleFlag == null || !costVisibleFlag) { |
|
|
|
|
|
// 用户没有成本查看权限,清空成本数据
|
|
|
|
|
|
statisticsList.forEach(this::clearCostData); |
|
|
|
|
|
} |
|
|
|
|
|
// 如果有权限,则保持原数据不变
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 清空成本相关数据 |
|
|
|
|
|
* @param statisticsVO 统计VO对象 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void clearCostData(LawyerStatisticsVO statisticsVO) { |
|
|
|
|
|
if (statisticsVO != null) { |
|
|
|
|
|
statisticsVO.setQuarterlyServiceCost(BigDecimal.ZERO); |
|
|
|
|
|
statisticsVO.setAnnualServiceCost(BigDecimal.ZERO); |
|
|
|
|
|
|
|
|
|
|
|
// 如果有律师服务列表,也需要清空其中的成本数据
|
|
|
|
|
|
if (statisticsVO.getLawyerServiceVOList() != null) { |
|
|
|
|
|
statisticsVO.getLawyerServiceVOList().forEach(lawyerService -> { |
|
|
|
|
|
if (lawyerService != null) { |
|
|
|
|
|
lawyerService.setQuarterlyServiceCost(BigDecimal.ZERO); |
|
|
|
|
|
lawyerService.setAnnualServiceCost(BigDecimal.ZERO); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 律所统计 |
|
|
* 律所统计 |
|
|
* @param queryForms |
|
|
* @param queryForms |
|
|
@ -800,6 +846,8 @@ public class ServiceApplicationsService { |
|
|
lawyerStatisticsVO.setLawyerServiceVOList(lawyerServiceVOList); |
|
|
lawyerStatisticsVO.setLawyerServiceVOList(lawyerServiceVOList); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
//屏蔽成本数据
|
|
|
|
|
|
maskCostDataForUser(lawyerStatisticsWithParamYear); |
|
|
return lawyerStatisticsWithParamYear; |
|
|
return lawyerStatisticsWithParamYear; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -849,9 +897,81 @@ public class ServiceApplicationsService { |
|
|
LawyerStatisticsQueryForm queryForm1 = SmartBeanUtil.copy(queryForm, LawyerStatisticsQueryForm.class); |
|
|
LawyerStatisticsQueryForm queryForm1 = SmartBeanUtil.copy(queryForm, LawyerStatisticsQueryForm.class); |
|
|
monthStatisticsDepartment(queryForm1, null, lawyerStatisticsWithParamYear); |
|
|
monthStatisticsDepartment(queryForm1, null, lawyerStatisticsWithParamYear); |
|
|
} |
|
|
} |
|
|
|
|
|
//屏蔽成本数据(导出专用)
|
|
|
|
|
|
maskCostDataForLawyerExport(lawyerStatisticsWithParamYear); |
|
|
//写入数据到文件
|
|
|
//写入数据到文件
|
|
|
exportExcel(response, "律所统计信息.xlsx", "律所统计信息", ServiceDepartmentImportForm.class, lawyerStatisticsWithParamYear); |
|
|
exportExcel(response, "律所统计信息.xlsx", "律所统计信息", ServiceDepartmentImportForm.class, lawyerStatisticsWithParamYear); |
|
|
} |
|
|
} |
|
|
|
|
|
/** 导出专用的成本数据屏蔽方法(ServiceDepartmentImportForm) |
|
|
|
|
|
* @param statisticsList 统计数据列表 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void maskCostDataForLawyerExport(List<ServiceDepartmentImportForm> statisticsList) { |
|
|
|
|
|
if (statisticsList == null || statisticsList.isEmpty()) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RequestEmployee requestUser = AdminRequestUtil.getRequestUser(); |
|
|
|
|
|
if (requestUser == null) { |
|
|
|
|
|
// 用户未登录,屏蔽所有成本数据
|
|
|
|
|
|
statisticsList.forEach(this::clearCostForLawyer); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 检查用户的costVisibleFlag权限
|
|
|
|
|
|
Boolean costVisibleFlag = requestUser.getCostVisibleFlag(); |
|
|
|
|
|
if (costVisibleFlag == null || !costVisibleFlag) { |
|
|
|
|
|
// 用户没有成本查看权限,清空成本数据
|
|
|
|
|
|
statisticsList.forEach(this::clearCostForLawyer); |
|
|
|
|
|
} |
|
|
|
|
|
// 如果有权限,则保持原数据不变
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 清空律师统计数据的成本相关数据 |
|
|
|
|
|
* @param statisticsVO 律师统计对象 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void clearCostForLawyer(ServiceDepartmentImportForm statisticsVO) { |
|
|
|
|
|
if (statisticsVO != null) { |
|
|
|
|
|
statisticsVO.setQuarterlyServiceCost(BigDecimal.ZERO); |
|
|
|
|
|
statisticsVO.setAnnualServiceCost(BigDecimal.ZERO); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 导出专用的成本数据屏蔽方法(针对ServiceLawyerImportForm) |
|
|
|
|
|
* @param statisticsList 统计数据列表 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void maskCostDataForExport(List<ServiceLawyerImportForm> statisticsList) { |
|
|
|
|
|
if (statisticsList == null || statisticsList.isEmpty()) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RequestEmployee requestUser = AdminRequestUtil.getRequestUser(); |
|
|
|
|
|
if (requestUser == null) { |
|
|
|
|
|
// 用户未登录,屏蔽所有成本数据
|
|
|
|
|
|
statisticsList.forEach(this::clearCostDataForLawyer); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 检查用户的costVisibleFlag权限
|
|
|
|
|
|
Boolean costVisibleFlag = requestUser.getCostVisibleFlag(); |
|
|
|
|
|
if (costVisibleFlag == null || !costVisibleFlag) { |
|
|
|
|
|
// 用户没有成本查看权限,清空成本数据
|
|
|
|
|
|
statisticsList.forEach(this::clearCostDataForLawyer); |
|
|
|
|
|
} |
|
|
|
|
|
// 如果有权限,则保持原数据不变
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 清空律师统计数据的成本相关数据 |
|
|
|
|
|
* @param statisticsVO 律师统计对象 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void clearCostDataForLawyer(ServiceLawyerImportForm statisticsVO) { |
|
|
|
|
|
if (statisticsVO != null) { |
|
|
|
|
|
statisticsVO.setQuarterlyServiceCost(BigDecimal.ZERO); |
|
|
|
|
|
statisticsVO.setAnnualServiceCost(BigDecimal.ZERO); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
@Transactional |
|
|
public ResponseDTO<String> batchReview(@Valid ServiceApplicationsUpdateForm updateForm) { |
|
|
public ResponseDTO<String> batchReview(@Valid ServiceApplicationsUpdateForm updateForm) { |
|
|
@ -1196,6 +1316,8 @@ public class ServiceApplicationsService { |
|
|
} |
|
|
} |
|
|
monthStatistics(queryForm, lawyerStatisticsVOPageResult.getList(),null); |
|
|
monthStatistics(queryForm, lawyerStatisticsVOPageResult.getList(),null); |
|
|
} |
|
|
} |
|
|
|
|
|
// 根据用户权限控制成本数据显示
|
|
|
|
|
|
maskCostDataForUser(lawyerStatisticsVOPageResult.getList()); |
|
|
return lawyerStatisticsVOPageResult; |
|
|
return lawyerStatisticsVOPageResult; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1235,6 +1357,8 @@ public class ServiceApplicationsService { |
|
|
LawyerStatisticsQueryForm queryForm1 = SmartBeanUtil.copy(queryForm, LawyerStatisticsQueryForm.class); |
|
|
LawyerStatisticsQueryForm queryForm1 = SmartBeanUtil.copy(queryForm, LawyerStatisticsQueryForm.class); |
|
|
monthStatistics(queryForm1, null, lawyerStatisticsWithParamYear); |
|
|
monthStatistics(queryForm1, null, lawyerStatisticsWithParamYear); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
maskCostDataForExport(lawyerStatisticsWithParamYear); |
|
|
//写入数据到文件
|
|
|
//写入数据到文件
|
|
|
exportExcel(response, "律师统计信息.xlsx", "律师统计信息", ServiceLawyerImportForm.class, lawyerStatisticsWithParamYear); |
|
|
exportExcel(response, "律师统计信息.xlsx", "律师统计信息", ServiceLawyerImportForm.class, lawyerStatisticsWithParamYear); |
|
|
} |
|
|
} |
|
|
|