feat:商户交易记录导出增加部门名称

This commit is contained in:
dzc committed 2025-06-23 16:50:46 +08:00
1 parent 2468be98eb
commit 65e43b0821
3 files changed
+18

No files matched your search

@@ -25,6 +25,12 @@ public class HardOrderCsVo implements BaseMchInterface, BaseHardInterface {
@Schema(description = "商户名")
private String merchantName;
@Schema(description = "商户部门名")
private String merchantDeptName;
@Schema(description = "商户部门id")
private Long merchantDeptId;
@Schema(description = "商户logo")
private String logoPic;
@@ -51,6 +51,7 @@ import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@Validated
@@ -200,6 +201,17 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
WalletDataUtil.convertMchList(totalList, CollectionUtils.convertMap(mchList, MchManageVo::getId));
}
}
// 商户部门
List<Long> mchDeptIds = totalList.stream().map(HardOrderCsVo::getMerchantDeptId).distinct().toList();
if (ObjectUtil.isNotEmpty(mchDeptIds)) {
Map<Long, SysDept> deptMap = remoteDeptService.getDeptByDeptIds(mchDeptIds).getData();
if (ObjectUtil.isNotEmpty(deptMap)) {
for (HardOrderCsVo v : totalList) {
if (ObjectUtil.isEmpty(v.getMerchantDeptId())) continue;
v.setMerchantDeptName(deptMap.get(v.getMerchantDeptId()).getName());
}
}
}
}
return totalList;
}