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:
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.api.uniapp.customer;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.google.common.collect.ImmutableBiMap;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
@@ -10,6 +11,7 @@ import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.spring.SpringUtils;
|
||||
import com.jsowell.pile.domain.MemberStationRelation;
|
||||
import com.jsowell.pile.dto.QueryConnectorListDTO;
|
||||
import com.jsowell.pile.dto.QueryStationDTO;
|
||||
import com.jsowell.pile.dto.RemoteGroundLockDTO;
|
||||
@@ -60,6 +62,9 @@ public class PileController extends BaseController {
|
||||
@Autowired
|
||||
private IThirdpartySnRelationService snRelationService;
|
||||
|
||||
@Autowired
|
||||
private MemberStationRelationService memberStationRelationService;
|
||||
|
||||
@Autowired
|
||||
private CommonService commonService;
|
||||
|
||||
@@ -84,8 +89,6 @@ 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);
|
||||
@@ -100,6 +103,32 @@ public class PileController extends BaseController {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询站点收藏状态接口
|
||||
* @param stationId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getCollectedStatus/{stationId}")
|
||||
public RestApiResponse<?> getCollectedStatus(HttpServletRequest request, @PathVariable("stationId") String stationId) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
// 获取memberId
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
MemberStationRelation relation = new MemberStationRelation();
|
||||
relation.setMemberId(memberId);
|
||||
relation.setStationId(Long.parseLong(stationId));
|
||||
List<MemberStationRelation> list = memberStationRelationService.selectMemberStationRelationList(relation);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
response = new RestApiResponse<>(ImmutableBiMap.of("collectedFlag", false));
|
||||
}else {
|
||||
response = new RestApiResponse<>(ImmutableBiMap.of("collectedFlag", true));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("查询站点收藏状态接口 error", e);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过站点id查询计费模板列表
|
||||
* http://localhost:8080/uniapp/pile/queryBillingPrice/{stationId}
|
||||
|
||||
Reference in New Issue
Block a user