diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/JumpController.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/JumpController.java index cf9846da7..33478e00e 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/JumpController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/JumpController.java @@ -117,12 +117,12 @@ public class JumpController extends BaseController { // String pileSn = StringUtils.substring(pileConnectorCode, 0, 14); String pileSn = YKCUtils.getPileSn(pileConnectorCode); logger.info("查询充电枪口详情, 截取桩号:{}, pileSn:{}", pileConnectorCode, pileSn); - try { - // 如果对接了类似华为平台的第三方平台,先修改一下枪口状态 - updateThirdPartyConnectorStatus(pileSn); - }catch (Exception e) { - logger.error("修改第三方平台枪口状态 error", e); - } + // try { + // // 如果对接了类似华为平台的第三方平台,先修改一下枪口状态 + // updateThirdPartyConnectorStatus(pileSn); + // }catch (Exception e) { + // logger.error("修改第三方平台枪口状态 error", e); + // } try { String memberId = null; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java index 67e44f8e6..f827db72a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java @@ -11,7 +11,10 @@ import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode; import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.enums.DelFlagEnum; import com.jsowell.common.enums.lianlian.LianLianPileStatusEnum; -import com.jsowell.common.enums.ykc.*; +import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum; +import com.jsowell.common.enums.ykc.PileConnectorStatusEnum; +import com.jsowell.common.enums.ykc.PileStatusEnum; +import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.exception.BusinessException; import com.jsowell.common.util.*; import com.jsowell.pile.domain.*; @@ -47,7 +50,6 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDateTime; import java.util.*; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** @@ -125,15 +127,17 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { @Override public PileBasicInfo selectPileBasicInfoBySN(String pileSn) { // 加缓存 - String redisKey = CacheConstants.SELECT_PILE_BASIC_INFO_BY_SN + pileSn; - PileBasicInfo pileBasicInfo = redisCache.getCacheObject(redisKey); - if (pileBasicInfo == null) { - // 查数据库 - pileBasicInfo = pileBasicInfoMapper.selectPileBasicInfoBySn(pileSn); - if (pileBasicInfo != null) { - redisCache.setCacheObject(redisKey, pileBasicInfo, 15, TimeUnit.MINUTES); - } - } + // String redisKey = CacheConstants.SELECT_PILE_BASIC_INFO_BY_SN + pileSn; + // PileBasicInfo pileBasicInfo = redisCache.getCacheObject(redisKey); + // if (pileBasicInfo == null) { + // // 查数据库 + // pileBasicInfo = pileBasicInfoMapper.selectPileBasicInfoBySn(pileSn); + // if (pileBasicInfo != null) { + // redisCache.setCacheObject(redisKey, pileBasicInfo, 15, TimeUnit.MINUTES); + // } + // } + + PileBasicInfo pileBasicInfo = pileBasicInfoMapper.selectPileBasicInfoBySn(pileSn); return pileBasicInfo; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java index 8542a6001..9d91d2fee 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBillingTemplateServiceImpl.java @@ -606,15 +606,17 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic @Override public List queryStationBillingTemplateListForUniApp(String stationId) { // 加缓存 - String redisKey = CacheConstants.QUERY_STATION_BILLING_TEMPLATE_LIST + stationId; - List voList = redisCache.getCacheList(redisKey); - if (CollectionUtils.isEmpty(voList)) { - voList = pileBillingTemplateMapper.queryStationBillingTemplateList(stationId); - if (CollectionUtils.isNotEmpty(voList)) { - redisCache.setCacheList(redisKey, voList); - redisCache.expire(redisKey, 15, TimeUnit.MINUTES); - } - } + // String redisKey = CacheConstants.QUERY_STATION_BILLING_TEMPLATE_LIST + stationId; + // List voList = redisCache.getCacheList(redisKey); + // if (CollectionUtils.isEmpty(voList)) { + // voList = pileBillingTemplateMapper.queryStationBillingTemplateList(stationId); + // if (CollectionUtils.isNotEmpty(voList)) { + // redisCache.setCacheList(redisKey, voList); + // redisCache.expire(redisKey, 15, TimeUnit.MINUTES); + // } + // } + + List voList = pileBillingTemplateMapper.queryStationBillingTemplateList(stationId); return voList; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java index 3477e1fd6..122ca5de6 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileConnectorInfoServiceImpl.java @@ -48,7 +48,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** @@ -120,18 +119,22 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService { @Override public List selectPileConnectorInfoList(String pileSn) { // 取缓存 - String redisKey = CacheConstants.SELECT_PILE_CONNECTOR_INFO_LIST + pileSn; - List result = redisCache.getCacheObject(redisKey); - if (CollectionUtils.isEmpty(result)) { - // 缓存为空,查数据库 - PileConnectorInfo pileConnectorInfo = new PileConnectorInfo(); - pileConnectorInfo.setPileSn(pileSn); - result = selectPileConnectorInfoList(pileConnectorInfo); - if (CollectionUtils.isNotEmpty(result)) { - // 查询数据库不为空,存redis 2分钟 - redisCache.setCacheObject(redisKey, result, 5, TimeUnit.MINUTES); - } - } + // String redisKey = CacheConstants.SELECT_PILE_CONNECTOR_INFO_LIST + pileSn; + // List result = redisCache.getCacheObject(redisKey); + // if (CollectionUtils.isEmpty(result)) { + // // 缓存为空,查数据库 + // PileConnectorInfo pileConnectorInfo = new PileConnectorInfo(); + // pileConnectorInfo.setPileSn(pileSn); + // result = selectPileConnectorInfoList(pileConnectorInfo); + // if (CollectionUtils.isNotEmpty(result)) { + // // 查询数据库不为空,存redis 2分钟 + // redisCache.setCacheObject(redisKey, result, 5, TimeUnit.MINUTES); + // } + // } + + PileConnectorInfo pileConnectorInfo = new PileConnectorInfo(); + pileConnectorInfo.setPileSn(pileSn); + List result = selectPileConnectorInfoList(pileConnectorInfo); return result; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileModelInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileModelInfoServiceImpl.java index 5f0f84c70..675c7fd0f 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileModelInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileModelInfoServiceImpl.java @@ -13,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; -import java.util.Objects; /** * 充电桩型号信息Service业务层处理 @@ -122,14 +121,16 @@ public class PileModelInfoServiceImpl implements PileModelInfoService { @Override public PileModelInfoVO getPileModelInfoByModelId(Long modelId) { - String redisKey = CacheConstants.GET_PILE_MODEL_INFO_BY_MODEL_ID + modelId; - PileModelInfoVO modelInfoVO = redisCache.getCacheObject(redisKey); - if (Objects.isNull(modelInfoVO)) { - modelInfoVO = pileModelInfoMapper.getPileModelInfoByModelId(modelId); - if (Objects.nonNull(modelInfoVO)) { - redisCache.setCacheObject(redisKey, modelInfoVO, CacheConstants.cache_expire_time_1d); - } - } + // String redisKey = CacheConstants.GET_PILE_MODEL_INFO_BY_MODEL_ID + modelId; + // PileModelInfoVO modelInfoVO = redisCache.getCacheObject(redisKey); + // if (Objects.isNull(modelInfoVO)) { + // modelInfoVO = pileModelInfoMapper.getPileModelInfoByModelId(modelId); + // if (Objects.nonNull(modelInfoVO)) { + // redisCache.setCacheObject(redisKey, modelInfoVO, CacheConstants.cache_expire_time_1d); + // } + // } + + PileModelInfoVO modelInfoVO = pileModelInfoMapper.getPileModelInfoByModelId(modelId); return modelInfoVO; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index 5ba9a9f6e..716bc7ad6 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -20,7 +20,9 @@ import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.domain.PileStationInfo; import com.jsowell.pile.domain.SettleOrderReport; import com.jsowell.pile.domain.ThirdpartyParkingConfig; -import com.jsowell.pile.dto.*; +import com.jsowell.pile.dto.FastCreateStationDTO; +import com.jsowell.pile.dto.QueryStationDTO; +import com.jsowell.pile.dto.QueryStationInfoDTO; import com.jsowell.pile.dto.amap.GetStationInfoDTO; import com.jsowell.pile.dto.business.StationBusinessAnalyzeInfoDTO; import com.jsowell.pile.dto.business.StationStatisticsInfoDTO; @@ -51,7 +53,6 @@ import java.text.DecimalFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.*; -import java.util.concurrent.TimeUnit; import java.util.function.Function; import java.util.stream.Collectors; @@ -107,13 +108,14 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { @Override public PileStationInfo selectPileStationInfoById(Long id) { // 加缓存 - String redisKey = CacheConstants.SELECT_PILE_STATION_INFO_BY_ID + id; - PileStationInfo pileStationInfo = redisCache.getCacheObject(redisKey); - if (pileStationInfo == null) { - // 查数据库 - pileStationInfo = pileStationInfoMapper.selectPileStationInfoById(id); - redisCache.setCacheObject(redisKey, pileStationInfo, 15, TimeUnit.MINUTES); - } + // String redisKey = CacheConstants.SELECT_PILE_STATION_INFO_BY_ID + id; + // PileStationInfo pileStationInfo = redisCache.getCacheObject(redisKey); + // if (pileStationInfo == null) { + // // 查数据库 + // pileStationInfo = pileStationInfoMapper.selectPileStationInfoById(id); + // redisCache.setCacheObject(redisKey, pileStationInfo, 15, TimeUnit.MINUTES); + // } + PileStationInfo pileStationInfo = pileStationInfoMapper.selectPileStationInfoById(id); return pileStationInfo; }