mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 小程序首页查询站点列表接口新增收藏标识字段
This commit is contained in:
@@ -84,6 +84,8 @@ public class PileController extends BaseController {
|
||||
List<String> deptIds = pileMerchantInfoService.getDeptIdsByAppId(appId);
|
||||
queryStationDTO.setMerchantDeptIds(deptIds);
|
||||
}
|
||||
// 获取memberId
|
||||
queryStationDTO.setMemberId(getMemberIdByAuthorization(request));
|
||||
logger.debug("uniApp查询充电站信息appId:{}, dto:{}", appId, JSON.toJSONString(queryStationDTO));
|
||||
PageResponse pageResponse = pileStationInfoService.uniAppQueryStationInfoList(queryStationDTO);
|
||||
response = new RestApiResponse<>(pageResponse);
|
||||
|
||||
@@ -526,6 +526,9 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
|
||||
// 根据前台参数分页
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<PileStationVO> list = pileStationInfoMapper.queryStationInfos(dto);
|
||||
// 查询该站点是否是该会员收藏的站点
|
||||
List<String> collectedStationIds = memberStationRelationService.getStationIdListByMemberId(dto.getMemberId());
|
||||
|
||||
PageInfo<PileStationVO> pageInfo = new PageInfo<>(list);
|
||||
|
||||
List<StationInfoVO> stationVOList = Lists.newArrayList();
|
||||
@@ -588,6 +591,13 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
|
||||
stationVO.setVipTotalPrice(currentTimePriceDetails.getVipTotalPrice());
|
||||
}
|
||||
stationVOList.add(stationVO);
|
||||
|
||||
if (collectedStationIds.contains(stationVO.getStationId())) {
|
||||
// 如果收藏的列表中有该站点的id,则返回 true
|
||||
stationVO.setCollectedFlag(Boolean.TRUE);
|
||||
}else {
|
||||
stationVO.setCollectedFlag(Boolean.FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
if (distance != 0.00) {
|
||||
|
||||
@@ -128,6 +128,11 @@ public class StationInfoVO {
|
||||
*/
|
||||
private String stationLat;
|
||||
|
||||
/**
|
||||
* 是否已收藏该站点
|
||||
*/
|
||||
private boolean collectedFlag;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
Reference in New Issue
Block a user