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 5ec76e89b..d591d5910 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 @@ -12,11 +12,7 @@ import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.enums.DelFlagEnum; import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum; import com.jsowell.common.enums.ykc.PileConnectorStatusEnum; -import com.jsowell.common.util.BytesUtil; -import com.jsowell.common.util.DateUtils; -import com.jsowell.common.util.PageUtils; -import com.jsowell.common.util.SecurityUtils; -import com.jsowell.common.util.StringUtils; +import com.jsowell.common.util.*; import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.domain.PileConnectorInfo; import com.jsowell.pile.domain.PileModelInfo; @@ -26,13 +22,7 @@ import com.jsowell.pile.dto.QueryPileDTO; import com.jsowell.pile.dto.ReplaceMerchantStationDTO; import com.jsowell.pile.mapper.PileBasicInfoMapper; import com.jsowell.pile.mapper.PileMerchantInfoMapper; -import com.jsowell.pile.service.IPileBasicInfoService; -import com.jsowell.pile.service.IPileConnectorInfoService; -import com.jsowell.pile.service.IPileMerchantInfoService; -import com.jsowell.pile.service.IPileModelInfoService; -import com.jsowell.pile.service.IPileSimInfoService; -import com.jsowell.pile.service.IPileStationInfoService; -import com.jsowell.pile.service.SimCardService; +import com.jsowell.pile.service.*; import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.base.PileInfoVO; import com.jsowell.pile.vo.uniapp.GroundLockInfoVO; @@ -43,7 +33,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.cglib.beans.BulkBean; import org.springframework.stereotype.Service; import org.springframework.util.StopWatch; @@ -714,15 +703,16 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService { @Override public List getGroundLockInfo(String stationId) { List resultList = new ArrayList<>(); - GroundLockInfoVO vo = null; - GroundLockInfoVO.LockInfo lockInfo = null; - List lockInfoList = new ArrayList<>(); + GroundLockInfoVO vo; + List lockInfoList; // 根据站点id查出该站点下所有桩(区分单双枪) List connectorInfoVOList = pileConnectorInfoService.selectConnectorListByStationId(Long.parseLong(stationId)); // 根据pileSn分组 Map> collect = connectorInfoVOList.stream().collect(Collectors.groupingBy(PileConnectorInfoVO::getPileSn)); + for (Map.Entry> entry : collect.entrySet()) { vo = new GroundLockInfoVO(); + lockInfoList = new ArrayList<>(); String pileSn = entry.getKey(); List list = entry.getValue(); for (PileConnectorInfoVO pileConnectorInfoVO : list) { @@ -740,12 +730,11 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService { // 升锁状态 parkingLockStatus = "升锁"; } - lockInfo = GroundLockInfoVO.LockInfo.builder() + lockInfoList.add(GroundLockInfoVO.LockInfo.builder() .connectorCode(pileConnectorInfoVO.getPileConnectorCode()) .lockStatus(parkingLockStatus) .parkingStatus(data.getParkingStatus()) - .build(); - lockInfoList.add(lockInfo); + .build()); } vo.setPileSn(pileSn); vo.setLockInfos(lockInfoList);