|
|
@@ -67,7 +67,7 @@ public class LawFirmReconciliationServiceImpl implements LawFirmReconciliationSe
|
|
|
? ((Number) statistics.get("total_amount")).longValue() : 0L;
|
|
|
|
|
|
// 获取平台佣金比例
|
|
|
- Float commissionRatio = lawFirm.getPlatformCommissionRatio();
|
|
|
+ Float commissionRatio = lawFirm.getPlatformCommissionRatio().floatValue();
|
|
|
if (commissionRatio == null) {
|
|
|
commissionRatio = 5.0f; // 默认5%
|
|
|
}
|
|
|
@@ -115,63 +115,69 @@ public class LawFirmReconciliationServiceImpl implements LawFirmReconciliationSe
|
|
|
return R.data(vo, "查询成功");
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public R<IPage<LawyerReconciliationDetailVO>> getLawyerReconciliationDetails(
|
|
|
- Integer firmId,
|
|
|
- String lawyerName,
|
|
|
- Date startDate,
|
|
|
- Date endDate,
|
|
|
- Integer pageNum,
|
|
|
- Integer pageSize) {
|
|
|
- log.info("LawFirmReconciliationServiceImpl.getLawyerReconciliationDetails?firmId={},lawyerName={},startDate={},endDate={},pageNum={},pageSize={}",
|
|
|
- firmId, lawyerName, startDate, endDate, pageNum, pageSize);
|
|
|
|
|
|
- if (firmId == null) {
|
|
|
- return R.fail("律所ID不能为空");
|
|
|
- }
|
|
|
|
|
|
- // 获取律所信息以获取平台佣金比例
|
|
|
- LawFirm lawFirm = lawFirmService.getById(firmId);
|
|
|
- Float commissionRatio = lawFirm != null && lawFirm.getPlatformCommissionRatio() != null
|
|
|
- ? lawFirm.getPlatformCommissionRatio() : 5.0f; // 默认5%
|
|
|
+@Override
|
|
|
+public R<IPage<LawyerReconciliationDetailVO>> getLawyerReconciliationDetails(
|
|
|
+ Integer firmId,
|
|
|
+ String lawyerName,
|
|
|
+ Date startDate,
|
|
|
+ Date endDate,
|
|
|
+ Integer pageNum,
|
|
|
+ Integer pageSize) {
|
|
|
+ log.info("LawFirmReconciliationServiceImpl.getLawyerReconciliationDetails?firmId={},lawyerName={},startDate={},endDate={},pageNum={},pageSize={}",
|
|
|
+ firmId, lawyerName, startDate, endDate, pageNum, pageSize);
|
|
|
|
|
|
- // 查询律师明细
|
|
|
- List<LawyerReconciliationDetailVO> lawyerDetails = lawFirmMapper.getLawyerReconciliationDetails(
|
|
|
- firmId, lawyerName, startDate, endDate);
|
|
|
+ if (firmId == null) {
|
|
|
+ return R.fail("律所ID不能为空");
|
|
|
+ }
|
|
|
|
|
|
- // 转换金额单位并计算平台服务费
|
|
|
- for (LawyerReconciliationDetailVO detail : lawyerDetails) {
|
|
|
- detail.setOrderAmountYuan(convertFenToYuan(detail.getOrderAmount()));
|
|
|
- // 计算平台服务费
|
|
|
- Long platformFee = Math.round(detail.getOrderAmount() * commissionRatio / 100.0);
|
|
|
- detail.setPlatformServiceFee(platformFee);
|
|
|
- detail.setPlatformServiceFeeYuan(convertFenToYuan(platformFee));
|
|
|
- }
|
|
|
+ // 获取律所信息以获取平台佣金比例
|
|
|
+ LawFirm lawFirm = lawFirmService.getById(firmId);
|
|
|
|
|
|
- // 手动分页
|
|
|
- Page<LawyerReconciliationDetailVO> page = new Page<>();
|
|
|
- if (pageNum != null && pageSize != null && pageNum > 0 && pageSize > 0) {
|
|
|
- page.setCurrent(pageNum);
|
|
|
- page.setSize(pageSize);
|
|
|
- page.setTotal(lawyerDetails.size());
|
|
|
+ // 修复:正确处理lawFirm为null的情况
|
|
|
+ Float commissionRatio = 5.0f; // 默认5%
|
|
|
+ if (lawFirm != null && lawFirm.getPlatformCommissionRatio() != null) {
|
|
|
+ commissionRatio = lawFirm.getPlatformCommissionRatio().floatValue();
|
|
|
+ }
|
|
|
|
|
|
- int start = (pageNum - 1) * pageSize;
|
|
|
- int end = Math.min(start + pageSize, lawyerDetails.size());
|
|
|
- if (start < lawyerDetails.size()) {
|
|
|
- page.setRecords(lawyerDetails.subList(start, end));
|
|
|
- } else {
|
|
|
- page.setRecords(Collections.emptyList());
|
|
|
- }
|
|
|
+ // 查询律师明细
|
|
|
+ List<LawyerReconciliationDetailVO> lawyerDetails = lawFirmMapper.getLawyerReconciliationDetails(
|
|
|
+ firmId, lawyerName, startDate, endDate);
|
|
|
+
|
|
|
+ // 转换金额单位并计算平台服务费
|
|
|
+ for (LawyerReconciliationDetailVO detail : lawyerDetails) {
|
|
|
+ detail.setOrderAmountYuan(convertFenToYuan(detail.getOrderAmount()));
|
|
|
+ // 计算平台服务费
|
|
|
+ Long platformFee = Math.round(detail.getOrderAmount() * commissionRatio / 100.0);
|
|
|
+ detail.setPlatformServiceFee(platformFee);
|
|
|
+ detail.setPlatformServiceFeeYuan(convertFenToYuan(platformFee));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 手动分页
|
|
|
+ Page<LawyerReconciliationDetailVO> page = new Page<>();
|
|
|
+ if (pageNum != null && pageSize != null && pageNum > 0 && pageSize > 0) {
|
|
|
+ page.setCurrent(pageNum);
|
|
|
+ page.setSize(pageSize);
|
|
|
+ page.setTotal(lawyerDetails.size());
|
|
|
+
|
|
|
+ int start = (pageNum - 1) * pageSize;
|
|
|
+ int end = Math.min(start + pageSize, lawyerDetails.size());
|
|
|
+ if (start < lawyerDetails.size()) {
|
|
|
+ page.setRecords(lawyerDetails.subList(start, end));
|
|
|
} else {
|
|
|
- page.setCurrent(1);
|
|
|
- page.setSize(lawyerDetails.size());
|
|
|
- page.setTotal(lawyerDetails.size());
|
|
|
- page.setRecords(lawyerDetails);
|
|
|
+ page.setRecords(Collections.emptyList());
|
|
|
}
|
|
|
-
|
|
|
- return R.data(page, "查询成功");
|
|
|
+ } else {
|
|
|
+ page.setCurrent(1);
|
|
|
+ page.setSize(lawyerDetails.size());
|
|
|
+ page.setTotal(lawyerDetails.size());
|
|
|
+ page.setRecords(lawyerDetails);
|
|
|
}
|
|
|
|
|
|
+ return R.data(page, "查询成功");
|
|
|
+}
|
|
|
+
|
|
|
@Override
|
|
|
public R<IPage<LawyerConsultationOrderVO>> getOrderList(
|
|
|
Integer firmId,
|