wallet 流水新增account
This commit is contained in:
parent
c84396629c
commit
a19efc4511
@ -32,6 +32,11 @@ public class FreightBalanceRunningWaterDTO extends DTO {
|
|||||||
@JsonSerialize(using = ToStringSerializer.class)
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号
|
||||||
|
*/
|
||||||
|
private String account;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 来源系统.
|
* 来源系统.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,10 +1,17 @@
|
|||||||
package com.red.circle.wallet.inner.service.freight.impl;
|
package com.red.circle.wallet.inner.service.freight.impl;
|
||||||
|
|
||||||
|
import com.red.circle.other.inner.endpoint.user.user.UserProfileClient;
|
||||||
|
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
|
||||||
|
import com.red.circle.wallet.infra.database.rds.entity.freight.FreightBalanceRunningWater;
|
||||||
import com.red.circle.wallet.infra.database.rds.service.freight.FreightBalanceRunningWaterService;
|
import com.red.circle.wallet.infra.database.rds.service.freight.FreightBalanceRunningWaterService;
|
||||||
import com.red.circle.wallet.inner.convertor.FreightBalanceRunningWaterInnerConvertor;
|
import com.red.circle.wallet.inner.convertor.FreightBalanceRunningWaterInnerConvertor;
|
||||||
import com.red.circle.wallet.inner.model.dto.FreightBalanceRunningWaterDTO;
|
import com.red.circle.wallet.inner.model.dto.FreightBalanceRunningWaterDTO;
|
||||||
import com.red.circle.wallet.inner.service.freight.FreightBalanceRunningWaterClientService;
|
import com.red.circle.wallet.inner.service.freight.FreightBalanceRunningWaterClientService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -20,12 +27,23 @@ public class FreightBalanceRunningWaterClientServiceImpl implements
|
|||||||
|
|
||||||
private final FreightBalanceRunningWaterService freightBalanceRunningWaterService;
|
private final FreightBalanceRunningWaterService freightBalanceRunningWaterService;
|
||||||
private final FreightBalanceRunningWaterInnerConvertor freightBalanceRunningWaterInnerConvertor;
|
private final FreightBalanceRunningWaterInnerConvertor freightBalanceRunningWaterInnerConvertor;
|
||||||
|
private final UserProfileClient userProfileClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FreightBalanceRunningWaterDTO> flowByUserId(Long userId, Long lastId) {
|
public List<FreightBalanceRunningWaterDTO> flowByUserId(Long userId, Long lastId) {
|
||||||
return freightBalanceRunningWaterInnerConvertor.toListFreightBalanceRunningWaterDTO(
|
List<FreightBalanceRunningWater> runningWaters = freightBalanceRunningWaterService.flowByUserId(userId, lastId);
|
||||||
freightBalanceRunningWaterService.flowByUserId(userId, lastId)
|
List<FreightBalanceRunningWaterDTO> runningWaterDTO = freightBalanceRunningWaterInnerConvertor.toListFreightBalanceRunningWaterDTO(runningWaters);
|
||||||
);
|
|
||||||
|
Set<Long> acceptUserIdList = runningWaterDTO.stream().map(FreightBalanceRunningWaterDTO::getAcceptUserId).collect(Collectors.toSet());
|
||||||
|
Map<Long, UserProfileDTO> userProfileDTOMap = userProfileClient.mapByUserIds(acceptUserIdList).getBody();
|
||||||
|
|
||||||
|
runningWaterDTO.forEach(dto -> {
|
||||||
|
UserProfileDTO profileDTO = userProfileDTOMap.get(dto.getAcceptUserId());
|
||||||
|
if (profileDTO != null) {
|
||||||
|
dto.setAccount(profileDTO.getAccount());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return runningWaterDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user