This commit is contained in:
2023-06-28 16:18:27 +08:00
9 changed files with 57 additions and 16 deletions

View File

@@ -533,7 +533,7 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
// 通过iccid查pile_sim_info
PileSimInfo simInfo = pileSimInfoService.getBasicInfoByIccId(iccid);
if (simInfo == null) {
SimCardVO simCardVO = simCardService.searchByLoop(iccid);
SimCardVO simCardVO = simCardService.searchByLoop(Lists.newArrayList(iccid)).get(0);
// pile_sim_info 新增数据
if (simCardVO != null) {
simInfo = PileSimInfo.builder()

View File

@@ -7,7 +7,9 @@ import com.jsowell.pile.domain.PileSimInfo;
import com.jsowell.pile.dto.QuerySimInfoDTO;
import com.jsowell.pile.mapper.PileSimInfoMapper;
import com.jsowell.pile.service.IPileSimInfoService;
import com.jsowell.pile.service.SimCardService;
import com.jsowell.pile.vo.web.SimCardInfoVO;
import com.jsowell.pile.vo.web.SimCardVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,6 +18,8 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 充电桩SIM卡信息Service业务层处理
@@ -29,6 +33,9 @@ public class PileSimInfoServiceImpl implements IPileSimInfoService {
@Autowired
private PileSimInfoMapper pileSimInfoMapper;
@Autowired
private SimCardService simCardService;
/**
* 查询充电桩SIM卡信息
*
@@ -67,6 +74,21 @@ public class PileSimInfoServiceImpl implements IPileSimInfoService {
}
dto.setExpiredTime(expiredTime);
List<SimCardInfoVO> simInfoList = pileSimInfoMapper.getSimInfoList(dto);
if (expiredTime == null) {
// 为空说明后管查询列表页没有选择筛选条件
List<String> iccids = simInfoList.stream()
.map(SimCardInfoVO::getIccId)
.collect(Collectors.toList());
// 查出最新的卡信息
List<SimCardVO> simCardList = simCardService.searchByLoop(iccids);
if (CollectionUtils.isNotEmpty(simCardList)) {
// 批量修改存库
pileSimInfoMapper.updateSimCardInfoBatch(simCardList);
simInfoList = pileSimInfoMapper.getSimInfoList(dto);
}
}
if (CollectionUtils.isEmpty(simInfoList)) {
return new ArrayList<>();
}