mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-20 14:08:32 +08:00
add 新增sim卡充值记录实体类
This commit is contained in:
@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jsowell.common.enums.sim.SimCardStatusCorrespondEnum;
|
||||
import com.jsowell.common.enums.sim.SimSupplierEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
@@ -27,6 +28,7 @@ import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -193,6 +195,43 @@ public class SimCardService {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将iccid按照卡商分组
|
||||
* @param iccIds
|
||||
* @return
|
||||
*/
|
||||
public Map<String, List<String>> goupingBySimSupplier(List<String> iccIds) {
|
||||
Map<String, List<String>> map = Maps.newHashMap();
|
||||
|
||||
if (CollectionUtils.isEmpty(iccIds)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
// 将集合中为空和0的过滤
|
||||
iccIds = iccIds.stream()
|
||||
.filter(StringUtils::isNotEmpty)
|
||||
.filter(x -> !StringUtils.equals(x, "0"))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<String> xunzhongList = new ArrayList<>();
|
||||
List<String> wulianList = new ArrayList<>();
|
||||
for (String iccId : iccIds) {
|
||||
// 查出此卡属于哪家公司(拿到code)
|
||||
SimCardVO simCardVO = searchByLoop(Lists.newArrayList(iccId)).get(0);
|
||||
String simSupplierCode = simCardVO.getSimCardFactory();
|
||||
|
||||
// 根据 code 分组
|
||||
if (StringUtils.equals(simSupplierCode, SimSupplierEnum.XUN_ZHONG.getCode())) {
|
||||
xunzhongList.add(iccId);
|
||||
}
|
||||
if (StringUtils.equals(simSupplierCode, SimSupplierEnum.WU_LIAN_INTERNET.getCode())) {
|
||||
wulianList.add(iccId);
|
||||
}
|
||||
}
|
||||
map.put("xunzhong", xunzhongList);
|
||||
map.put("wulian", wulianList);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据不同的公司执行不同的续费方法
|
||||
|
||||
Reference in New Issue
Block a user