mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
Merge branch 'dev-zza' into dev
This commit is contained in:
@@ -23,7 +23,7 @@ public class MemberStationRelation extends BaseEntity {
|
||||
* 会员id
|
||||
*/
|
||||
@Excel(name = "会员id")
|
||||
private Long memberId;
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
@@ -39,11 +39,11 @@ public class MemberStationRelation extends BaseEntity {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setMemberId(Long memberId) {
|
||||
public void setMemberId(String memberId) {
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
public Long getMemberId() {
|
||||
public String getMemberId() {
|
||||
return memberId;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 个人收藏站点DTO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2025/3/20 13:38:38
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class CollectedStationDTO {
|
||||
private String memberId;
|
||||
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
* true - 收藏
|
||||
* false - 取消收藏
|
||||
*/
|
||||
private boolean operatorType;
|
||||
}
|
||||
@@ -125,6 +125,8 @@ public class QueryStationDTO extends BaseEntity {
|
||||
|
||||
private List<String> stationIds;
|
||||
|
||||
private String memberId;
|
||||
|
||||
@Data
|
||||
public static class OtherOptions {
|
||||
/**
|
||||
|
||||
@@ -67,4 +67,11 @@ public interface MemberStationRelationMapper {
|
||||
* @return
|
||||
*/
|
||||
List<String> getStationIdListByMemberId(String memberId);
|
||||
|
||||
/**
|
||||
* 用户取消收藏站点
|
||||
* @param memberStationRelation
|
||||
* @return
|
||||
*/
|
||||
int deleteMemberStationRelation(MemberStationRelation memberStationRelation);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,10 @@ package com.jsowell.pile.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.pile.domain.MemberStationRelation;
|
||||
import com.jsowell.pile.dto.CollectedStationDTO;
|
||||
import com.jsowell.pile.dto.QueryStationDTO;
|
||||
|
||||
/**
|
||||
* 会员与收藏的站点关系Service接口
|
||||
@@ -61,8 +64,15 @@ public interface MemberStationRelationService {
|
||||
|
||||
/**
|
||||
* 通过memberId查询站点idList
|
||||
* @param memberId
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public List<String> getStationIdListByMemberId(String memberId);
|
||||
public PageResponse getCollectedStationIdList(QueryStationDTO dto);
|
||||
|
||||
/**
|
||||
* 修改收藏站点状态
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int updateCollectedStation(CollectedStationDTO dto);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,13 @@ package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.dto.CollectedStationDTO;
|
||||
import com.jsowell.pile.dto.QueryStationDTO;
|
||||
import com.jsowell.pile.service.MemberStationRelationService;
|
||||
import com.jsowell.pile.service.PileStationInfoService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jsowell.pile.mapper.MemberStationRelationMapper;
|
||||
@@ -20,6 +25,9 @@ public class MemberStationRelationServiceImpl implements MemberStationRelationSe
|
||||
@Autowired
|
||||
private MemberStationRelationMapper memberStationRelationMapper;
|
||||
|
||||
@Autowired
|
||||
private PileStationInfoService pileStationInfoService;
|
||||
|
||||
/**
|
||||
* 查询会员与收藏的站点关系
|
||||
*
|
||||
@@ -88,8 +96,49 @@ public class MemberStationRelationServiceImpl implements MemberStationRelationSe
|
||||
return memberStationRelationMapper.deleteMemberStationRelationById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户收藏的站点信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<String> getStationIdListByMemberId(String memberId) {
|
||||
return memberStationRelationMapper.getStationIdListByMemberId(memberId);
|
||||
public PageResponse getCollectedStationIdList(QueryStationDTO dto) {
|
||||
// 先查出来站点idList
|
||||
List<String> stationIdList = memberStationRelationMapper.getStationIdListByMemberId(dto.getMemberId());
|
||||
if (CollectionUtils.isEmpty(stationIdList)) {
|
||||
return new PageResponse();
|
||||
}
|
||||
// 根据站点idList批量查站点信息
|
||||
dto.setStationIds(stationIdList);
|
||||
PageResponse pageResponse = pileStationInfoService.uniAppQueryStationInfoList(dto);
|
||||
|
||||
return pageResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 某用户取消收藏站点
|
||||
* @param memberStationRelation
|
||||
* @return
|
||||
*/
|
||||
public int deleteMemberStationRelation(MemberStationRelation memberStationRelation) {
|
||||
return memberStationRelationMapper.deleteMemberStationRelation(memberStationRelation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCollectedStation(CollectedStationDTO dto) {
|
||||
int result = 0;
|
||||
// 判断操作类型
|
||||
boolean operatorType = dto.isOperatorType();
|
||||
MemberStationRelation relation = new MemberStationRelation();
|
||||
relation.setStationId(Long.parseLong(dto.getStationId()));
|
||||
relation.setMemberId(dto.getMemberId());
|
||||
if (operatorType) {
|
||||
// 添加收藏
|
||||
result = insertMemberStationRelation(relation);
|
||||
}else {
|
||||
// 取消收藏
|
||||
result = deleteMemberStationRelation(relation);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,6 +632,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
|
||||
Optional<BillingTemplateVO> max = list.stream()
|
||||
.filter(x -> StringUtils.equals(x.getDeviceType(), Constants.ONE)) // 过滤出汽车桩的计费模板
|
||||
.filter(x -> StringUtils.isNotBlank(x.getPublishTime()))
|
||||
.filter(x -> StringUtils.equals(Constants.ZERO, x.getMemberFlag())) // 过滤出非会员价格
|
||||
.max(Comparator.comparing(BillingTemplateVO::getPublishTime));
|
||||
return max.orElse(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user