mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
根据汇付会员id查询配置分账的站点列表
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.StationSplitConfig;
|
||||
import com.jsowell.pile.vo.web.SplitConfigVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -26,4 +27,11 @@ public interface StationSplitConfigMapper {
|
||||
int deleteByMerchantIdAndStationId(@Param("merchantId") String merchantId, @Param("stationId") String stationId, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
|
||||
|
||||
int deleteByStationId(@Param("stationId") String stationId, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
|
||||
|
||||
/**
|
||||
* 根据汇付会员id查询配置列表
|
||||
* @param adapayMemberId
|
||||
* @return
|
||||
*/
|
||||
List<SplitConfigVO> queryStationList(String adapayMemberId);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.jsowell.pile.vo.web.SplitConfigVO;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 站点分成配置service
|
||||
@@ -50,5 +51,10 @@ public interface StationSplitConfigService {
|
||||
*/
|
||||
List<ShareMemberVO> queryShareMembersByStationId(String stationId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据站点id查询站点分账配置信息
|
||||
* @param adapayMemberId
|
||||
* @return
|
||||
*/
|
||||
Map<String,List<SplitConfigVO>> queryStationList(String adapayMemberId);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,11 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -286,4 +289,29 @@ public class StationSplitConfigServiceImpl implements StationSplitConfigService{
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据汇付会员id查询配置分账的站点列表
|
||||
*
|
||||
* @param adapayMemberId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String,List<SplitConfigVO>> queryStationList(String adapayMemberId) {
|
||||
List<SplitConfigVO> stationList = stationSplitConfigMapper.queryStationList(adapayMemberId);
|
||||
if (stationList == null || stationList.isEmpty()){
|
||||
throw new BusinessException("", "未查询到该汇付会员的分账配置信息");
|
||||
}
|
||||
//按照站点id进行去重,再将id按照降序排序,因为站点id为String类型,所以需要先转换为int类型
|
||||
stationList = stationList.stream()
|
||||
.filter(vo -> vo.getStationId() != null && vo.getStationId().matches("^\\d+"))
|
||||
.distinct()
|
||||
.sorted((o1, o2) -> Integer.parseInt(o1.getStationId()) - Integer.parseInt(o2.getStationId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Map<String,List<SplitConfigVO>> stationMap = new HashMap<>();
|
||||
stationMap.put("stationList", stationList);
|
||||
return stationMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,4 +39,15 @@ public class SplitConfigVO {
|
||||
*/
|
||||
private String feeFlag;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 站点名称
|
||||
*/
|
||||
private String stationName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user