Commit 714ef287 by jianan

出账检核-增加币种22

parent 17350865
......@@ -1012,7 +1012,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
// 5. 组装返回结果
ApiExpectedFortunePageResponseVO response = new ApiExpectedFortunePageResponseVO();
response.setStatisticsVO(statisticsVO);
response.setPage(iExpectedFortuneService.getVOPage(iPage)); // 恢复分页数据
response.setPage(iExpectedFortuneService.getVOPage(iPage)); // 调整数据顺序
log.info("查询应付款管理列表完成, 耗时: {}ms, 页码: {}, 页大小: {}, 总记录数: {}",
System.currentTimeMillis() - startTime,
......
......@@ -132,9 +132,9 @@ public class ApiExpectedFortunePageResponse {
private String fortuneType;
/**
* 转介人介绍费占比
* 持有比例
*/
@Schema(description = "转介人介绍费占比")
@Schema(description = "持有比例")
private String brokerRatio;
......@@ -232,6 +232,12 @@ public class ApiExpectedFortunePageResponse {
private String remark;
/**
* 创建人
*/
@Schema(description = "创建人")
private String creatorName;
/**
* 创建时间
*/
@Schema(description = "创建时间")
......
......@@ -17,6 +17,7 @@ import com.yd.csf.service.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yd.csf.service.vo.ExpectedFortuneStatisticsVO;
import com.yd.csf.service.vo.PayableReportVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -36,6 +37,7 @@ import java.util.stream.Collectors;
* @since 2025-11-17
*/
@Service
@Slf4j
public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMapper, ExpectedFortune> implements IExpectedFortuneService {
@Resource
......@@ -90,6 +92,9 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
return expectedFortuneVOPage;
}
// 调整数据顺序
processData(expectedFortuneList);
// 1. 转介人职级信息
List<String> brokerBizIds = expectedFortuneList.stream().map(ApiExpectedFortunePageResponse::getBrokerBizId).collect(Collectors.toList());
Map<String, UserGradeDto> userGradeMap = iAgentAccumulatedFycService.queryUserGradeMap(brokerBizIds);
......@@ -117,11 +122,63 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
// }
}
// expectedFortuneVOPage.setRecords(voList);
expectedFortuneVOPage.setRecords(expectedFortuneList);
return expectedFortuneVOPage;
}
/**
* 调整数据顺序 预计在前,实际在后,按预计发佣月排序
*
* @param expectedFortuneList 预计发佣列表
*/
private void processData(List<ApiExpectedFortunePageResponse> expectedFortuneList) {
if (CollUtil.isEmpty(expectedFortuneList)) {
return;
}
log.info("顺序调整前: {}", expectedFortuneList.size());
// 1. 分组
Map<Integer, List<ApiExpectedFortunePageResponse>> groupMap = expectedFortuneList.stream()
.collect(Collectors.groupingBy(ApiExpectedFortunePageResponse::getType));
// 2. 获取预计发佣(type=1)和实际发佣(type=2)列表
List<ApiExpectedFortunePageResponse> expectedList = groupMap.getOrDefault(1, new ArrayList<>());
List<ApiExpectedFortunePageResponse> actualList = groupMap.getOrDefault(2, new ArrayList<>());
// 3. 将 actualList 转换为 Map
Map<String, List<ApiExpectedFortunePageResponse>> actualMap = actualList.stream()
.collect(Collectors.groupingBy(ApiExpectedFortunePageResponse::getPayableNo));
// 4. 调整数据顺序
List<ApiExpectedFortunePageResponse> sortedList = new ArrayList<>();
Set<String> matchedActualPayableNos = new HashSet<>();
for (ApiExpectedFortunePageResponse expected : expectedList) {
sortedList.add(expected);
// 查找对应的实际发佣
List<ApiExpectedFortunePageResponse> matchedList = actualMap.get(expected.getPayableNo());
if (CollUtil.isNotEmpty(matchedList)) {
sortedList.addAll(matchedList);
matchedActualPayableNos.add(expected.getPayableNo());
}
}
// 5. 添加未匹配的实际发佣记录
for (ApiExpectedFortunePageResponse actual : actualList) {
if (!matchedActualPayableNos.contains(actual.getPayableNo())) {
sortedList.add(actual);
}
}
// 6. 将排序后的结果写回原列表
expectedFortuneList.clear();
expectedFortuneList.addAll(sortedList);
log.info("顺序调整后: {}", sortedList.size());
}
@Override
public List<ApiExpectedFortunePageResponse> toVOList(List<ExpectedFortune> expectedFortuneList) {
if (CollUtil.isEmpty(expectedFortuneList)) {
......
......@@ -260,7 +260,7 @@
NULL as rule_item_biz_id,
f.remark,
f.create_time,
NULL as creator_name,
f.reconciliation_operator as creator_name,
f.update_time,
2 as type
FROM fortune f
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment