金币代理流水查询更改
This commit is contained in:
parent
57d4f20af8
commit
afc1b6a168
@ -29,6 +29,8 @@ public interface FreightBalanceRunningWaterClientApi {
|
|||||||
@GetMapping("/flowByUserId")
|
@GetMapping("/flowByUserId")
|
||||||
ResultResponse<List<FreightBalanceRunningWaterDTO>> flowByUserId(
|
ResultResponse<List<FreightBalanceRunningWaterDTO>> flowByUserId(
|
||||||
@RequestParam("userId") Long userId,
|
@RequestParam("userId") Long userId,
|
||||||
|
@RequestParam(value = "type", required = false) Integer type,
|
||||||
|
@RequestParam(value = "searchId", required = false) Long searchId,
|
||||||
@RequestParam(value = "lastId",required = false) Long lastId
|
@RequestParam(value = "lastId",required = false) Long lastId
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public interface FreightBalanceRunningWaterService extends BaseService<FreightBa
|
|||||||
* @param lastId 最后一条记录id
|
* @param lastId 最后一条记录id
|
||||||
* @return ignore
|
* @return ignore
|
||||||
*/
|
*/
|
||||||
List<FreightBalanceRunningWater> flowByUserId(Long userId, Long lastId);
|
List<FreightBalanceRunningWater> flowByUserId(Long userId, Long acceptUserId, Integer type, Long lastId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -37,13 +37,18 @@ public class FreightBalanceRunningWaterServiceImpl extends
|
|||||||
FreightBalanceRunningWaterService {
|
FreightBalanceRunningWaterService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FreightBalanceRunningWater> flowByUserId(Long userId, Long lastId) {
|
public List<FreightBalanceRunningWater> flowByUserId(Long userId, Long acceptUserId, Integer type, Long lastId) {
|
||||||
return query()
|
return query()
|
||||||
.and(wrapper -> wrapper
|
.and(Objects.isNull(acceptUserId), wrapper -> wrapper
|
||||||
.eq(FreightBalanceRunningWater::getUserId, userId)
|
.eq(FreightBalanceRunningWater::getUserId, userId)
|
||||||
.or()
|
.or()
|
||||||
.eq(FreightBalanceRunningWater::getAcceptUserId, userId)
|
.eq(FreightBalanceRunningWater::getAcceptUserId, userId)
|
||||||
)
|
)
|
||||||
|
.and(Objects.nonNull(acceptUserId), e -> e
|
||||||
|
.eq(FreightBalanceRunningWater::getUserId, userId)
|
||||||
|
.or()
|
||||||
|
.eq(FreightBalanceRunningWater::getAcceptUserId, acceptUserId))
|
||||||
|
.and(Objects.nonNull(type), e -> e.eq(FreightBalanceRunningWater::getType, type))
|
||||||
.lt(Objects.nonNull(lastId), FreightBalanceRunningWater::getId, lastId)
|
.lt(Objects.nonNull(lastId), FreightBalanceRunningWater::getId, lastId)
|
||||||
.orderByDesc(FreightBalanceRunningWater::getId)
|
.orderByDesc(FreightBalanceRunningWater::getId)
|
||||||
.last(PageConstant.DEFAULT_LIMIT)
|
.last(PageConstant.DEFAULT_LIMIT)
|
||||||
|
|||||||
@ -28,10 +28,10 @@ public class FreightBalanceRunningWaterClientEndpoint implements
|
|||||||
private final FreightBalanceRunningWaterClientService freightBalanceRunningWaterClientService;
|
private final FreightBalanceRunningWaterClientService freightBalanceRunningWaterClientService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultResponse<List<FreightBalanceRunningWaterDTO>> flowByUserId(Long userId,
|
public ResultResponse<List<FreightBalanceRunningWaterDTO>> flowByUserId(Long userId, Integer type, Long searchId,
|
||||||
Long lastId) {
|
Long lastId) {
|
||||||
return ResultResponse.success(
|
return ResultResponse.success(
|
||||||
freightBalanceRunningWaterClientService.flowByUserId(userId, lastId)
|
freightBalanceRunningWaterClientService.flowByUserId(userId, searchId, type, lastId)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public interface FreightBalanceRunningWaterClientService {
|
|||||||
* @param lastId 最后一条记录id
|
* @param lastId 最后一条记录id
|
||||||
* @return ignore
|
* @return ignore
|
||||||
*/
|
*/
|
||||||
List<FreightBalanceRunningWaterDTO> flowByUserId(Long userId, Long lastId);
|
List<FreightBalanceRunningWaterDTO> flowByUserId(Long userId, Long searchId, Integer type, Long lastId);
|
||||||
|
|
||||||
List<FreightBalanceRunningWaterDTO> listByIds(Set<Long> ids);
|
List<FreightBalanceRunningWaterDTO> listByIds(Set<Long> ids);
|
||||||
|
|
||||||
|
|||||||
@ -34,8 +34,10 @@ public class FreightBalanceRunningWaterClientServiceImpl implements
|
|||||||
private final UserProfileClient userProfileClient;
|
private final UserProfileClient userProfileClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FreightBalanceRunningWaterDTO> flowByUserId(Long userId, Long lastId) {
|
public List<FreightBalanceRunningWaterDTO> flowByUserId(Long userId, Long searchId, Integer type, Long lastId) {
|
||||||
List<FreightBalanceRunningWater> runningWaters = freightBalanceRunningWaterService.flowByUserId(userId, lastId);
|
Long acceptUserId = getByUserId(searchId);
|
||||||
|
|
||||||
|
List<FreightBalanceRunningWater> runningWaters = freightBalanceRunningWaterService.flowByUserId(userId, acceptUserId, type, lastId);
|
||||||
List<FreightBalanceRunningWaterDTO> runningWaterDTO = freightBalanceRunningWaterInnerConvertor.toListFreightBalanceRunningWaterDTO(runningWaters);
|
List<FreightBalanceRunningWaterDTO> runningWaterDTO = freightBalanceRunningWaterInnerConvertor.toListFreightBalanceRunningWaterDTO(runningWaters);
|
||||||
|
|
||||||
Set<Long> acceptUserIdList = runningWaterDTO.stream().map(FreightBalanceRunningWaterDTO::getAcceptUserId).collect(Collectors.toSet());
|
Set<Long> acceptUserIdList = runningWaterDTO.stream().map(FreightBalanceRunningWaterDTO::getAcceptUserId).collect(Collectors.toSet());
|
||||||
@ -50,7 +52,19 @@ public class FreightBalanceRunningWaterClientServiceImpl implements
|
|||||||
return runningWaterDTO;
|
return runningWaterDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FreightBalanceRunningWaterDTO> listByIds(Set<Long> ids) {
|
private Long getByUserId(Long searchId) {
|
||||||
|
if (searchId == null || searchId <= 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<UserProfileDTO> body = userProfileClient.getByAccount(String.valueOf(searchId)).getBody();
|
||||||
|
if (body != null) {
|
||||||
|
return body.get(0).getId();
|
||||||
|
}
|
||||||
|
return userProfileClient.getByUserId(searchId).getBody().getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<FreightBalanceRunningWaterDTO> listByIds(Set<Long> ids) {
|
||||||
if (ids.isEmpty()) {
|
if (ids.isEmpty()) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user