mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-28 23:15:11 +08:00
根据汇付会员id查询配置分账的站点列表
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user