后管sim卡页面添加字段

This commit is contained in:
Lemon
2023-06-01 10:39:48 +08:00
parent 6ccfd5f7cf
commit bc32bd8238
6 changed files with 133 additions and 9 deletions

View File

@@ -2,15 +2,19 @@ package com.jsowell.pile.service.impl;
import com.alibaba.fastjson2.JSON;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
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.vo.web.SimCardInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@@ -53,7 +57,28 @@ public class PileSimInfoServiceImpl implements IPileSimInfoService {
*/
@Override
public List<SimCardInfoVO> getSimInfoList(QuerySimInfoDTO dto) {
return pileSimInfoMapper.getSimInfoList(dto);
String expiredTime = dto.getExpiredTime();
if (StringUtils.equals("1", expiredTime)) {
// 小于7天
expiredTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addDays(new Date(), 7));
}else if (StringUtils.equals("2", expiredTime)) {
// 小于30天
expiredTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.addDays(new Date(), 30));
}
dto.setExpiredTime(expiredTime);
List<SimCardInfoVO> simInfoList = pileSimInfoMapper.getSimInfoList(dto);
if (CollectionUtils.isEmpty(simInfoList)) {
return new ArrayList<>();
}
for (SimCardInfoVO simCardInfoVO : simInfoList) {
String expireTime = simCardInfoVO.getExpireTime();
if (StringUtils.isBlank(expireTime)) {
continue;
}
String poorDays = DateUtils.getPoorDays(DateUtils.parseDate(expireTime), new Date());
simCardInfoVO.setRemainingDays(poorDays);
}
return simInfoList;
}
/**