From 5869e8d5f3cd1f6b17854600ae0bbba99d7abea4 Mon Sep 17 00:00:00 2001 From: Lemon Date: Fri, 20 Dec 2024 09:11:48 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20=E8=B4=B5=E5=B7=9E=E7=9C=81?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0Service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/OrderPileOccupyController.java | 7 +- .../jsowell/pile/dto/OrderPileOccupyDTO.java | 7 +- .../pile/mapper/PileBasicInfoMapper.java | 8 ++ .../pile/service/PileBasicInfoService.java | 7 +- .../impl/PileBasicInfoServiceImpl.java | 113 +++++++++++++----- .../pile/thirdparty/PileDetailInfoVO.java | 33 +++++ .../mapper/pile/OrderPileOccupyMapper.xml | 1 + .../mapper/pile/PileBasicInfoMapper.xml | 18 +++ .../impl/GuiZhouPlatformServiceImpl.java | 5 +- jsowell-ui/src/views/pile/occupy/index.vue | 9 ++ 10 files changed, 170 insertions(+), 38 deletions(-) create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/PileDetailInfoVO.java diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/OrderPileOccupyController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/OrderPileOccupyController.java index 437ea31b8..17ac1d700 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/OrderPileOccupyController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/OrderPileOccupyController.java @@ -54,9 +54,10 @@ public class OrderPileOccupyController extends BaseController { @PreAuthorize("@ss.hasPermi('pile:occupy:export')") @Log(title = "占桩订单", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, OrderPileOccupy orderPileOccupy) { - List list = orderPileOccupyService.selectOrderPileOccupyList(orderPileOccupy); - ExcelUtil util = new ExcelUtil(OrderPileOccupy.class); + public void export(HttpServletResponse response, OrderPileOccupyDTO dto) { + // List list = orderPileOccupyService.selectOrderPileOccupyList(orderPileOccupy); + List list = orderPileOccupyService.getOrderPileOccupyListWithAuth(dto); + ExcelUtil util = new ExcelUtil<>(OccupyOrderVO.class); util.exportExcel(response, list, "占桩订单数据"); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/OrderPileOccupyDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/OrderPileOccupyDTO.java index 34d09e1ac..8e8a2307a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/OrderPileOccupyDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/OrderPileOccupyDTO.java @@ -11,7 +11,7 @@ import java.util.Date; import java.util.List; /** - * TODO + * 占桩订单DTO * * @author Lemon * @Date 2024/7/15 13:37:04 @@ -47,6 +47,11 @@ public class OrderPileOccupyDTO extends BaseEntity { */ private String stationId; + /** + * 站点名称 + */ + private String stationName; + /** * 车牌号码 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java index 34cef148b..e258931a6 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileBasicInfoMapper.java @@ -4,6 +4,7 @@ import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.dto.IndexQueryDTO; import com.jsowell.pile.dto.QueryPileDTO; import com.jsowell.pile.dto.ReplaceMerchantStationDTO; +import com.jsowell.pile.thirdparty.PileDetailInfoVO; import com.jsowell.pile.vo.base.PileInfoVO; import com.jsowell.pile.vo.uniapp.customer.PersonalPileInfoVO; import com.jsowell.pile.vo.uniapp.customer.PileConnectorDetailVO; @@ -169,4 +170,11 @@ public interface PileBasicInfoMapper { * @return */ PileBasicInfo getMaxNumPileInfo(); + + /** + * 获取桩信息详情列表 + * @param stationId + * @return + */ + List getPileDetailInfoList(String stationId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java index c88eaf772..15395db93 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileBasicInfoService.java @@ -6,10 +6,7 @@ import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; import com.jsowell.pile.domain.PileBasicInfo; import com.jsowell.pile.domain.ebike.deviceupload.EBikeMessageCmd20; import com.jsowell.pile.dto.*; -import com.jsowell.pile.thirdparty.ConnectorInfo; -import com.jsowell.pile.thirdparty.EquipmentInfo; -import com.jsowell.pile.thirdparty.ZDLConnectorInfo; -import com.jsowell.pile.thirdparty.ZDLEquipmentInfo; +import com.jsowell.pile.thirdparty.*; import com.jsowell.pile.vo.base.PileInfoVO; import com.jsowell.pile.vo.uniapp.customer.GroundLockInfoVO; import com.jsowell.pile.vo.uniapp.customer.PersonalPileInfoVO; @@ -252,4 +249,6 @@ public interface PileBasicInfoService { * @param message */ void registrationEBikePile(EBikeMessageCmd20 message); + + List getPileDetailInfoList(String stationId); } 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 438e8f2a6..08309130d 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 @@ -24,13 +24,11 @@ import com.jsowell.pile.mapper.PileBasicInfoMapper; import com.jsowell.pile.service.*; import com.jsowell.pile.service.programlogic.AbstractProgramLogic; import com.jsowell.pile.service.programlogic.ProgramLogicFactory; -import com.jsowell.pile.thirdparty.ConnectorInfo; -import com.jsowell.pile.thirdparty.EquipmentInfo; -import com.jsowell.pile.thirdparty.ZDLConnectorInfo; -import com.jsowell.pile.thirdparty.ZDLEquipmentInfo; +import com.jsowell.pile.thirdparty.*; import com.jsowell.pile.transaction.dto.PileTransactionDTO; import com.jsowell.pile.transaction.service.TransactionService; import com.jsowell.pile.util.UserUtils; +import com.jsowell.pile.vo.base.ConnectorInfoVO; import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.base.PileInfoVO; import com.jsowell.pile.vo.uniapp.customer.GroundLockInfoVO; @@ -1226,48 +1224,49 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { public List getPileListForLianLian(String stationId) { List resultList = new ArrayList<>(); // 通过站点id查询桩基本信息 - List list = this.getPileListByStationId(stationId); + // List list = this.getPileListByStationId(stationId); + List list = getPileDetailInfoList(stationId); // 封装成联联平台对象 - for (PileBasicInfo pileBasicInfo : list) { + for (PileDetailInfoVO pileDetailInfoVO : list) { EquipmentInfo equipmentInfo = new EquipmentInfo(); - String pileSn = pileBasicInfo.getSn(); + String pileSn = pileDetailInfoVO.getPileSn(); equipmentInfo.setEquipmentID(pileSn); equipmentInfo.setEquipmentClassification(1); equipmentInfo.setManufacturerID(Constants.OPERATORID_LIANLIAN); equipmentInfo.setManufacturerName(Constants.MANUFACTURER_NAME); - equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime())); - equipmentInfo.setProductionDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime())); + equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileDetailInfoVO.getCreateTime())); + equipmentInfo.setProductionDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileDetailInfoVO.getCreateTime())); - PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn); - if (StringUtils.isBlank(modelInfo.getSpeedType())) { + // PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn); + if (StringUtils.isBlank(pileDetailInfoVO.getSpeedType())) { continue; } - equipmentInfo.setEquipmentType(Integer.valueOf(modelInfo.getSpeedType())); - equipmentInfo.setEquipmentModel(modelInfo.getModelName()); + equipmentInfo.setEquipmentType(Integer.valueOf(pileDetailInfoVO.getSpeedType())); + equipmentInfo.setEquipmentModel(pileDetailInfoVO.getModelName()); // Map pileStatus = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileBasicInfo.getSn())); - Map pileStatusMap = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileSn)); - String pileStatus = pileStatusMap.get(pileSn); - if (StringUtils.equals(PileStatusEnum.ON_LINE.getValue(), pileStatus)) { - // 1-在线 - pileStatus = LianLianPileStatusEnum.NORMAL.getCode(); - } else if (StringUtils.equals(PileStatusEnum.OFF_LINE.getValue(), pileStatus)) { - // 2-离线 - pileStatus = LianLianPileStatusEnum.CLOSE_OFFLINE.getCode(); - } else if (StringUtils.equals(PileStatusEnum.FAULT.getValue(), pileStatus)) { - // 3-故障 - pileStatus = LianLianPileStatusEnum.UNDER_MAINTENANCE.getCode(); - } - equipmentInfo.setEquipmentStatus(Integer.valueOf(pileStatus)); - equipmentInfo.setEquipmentPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + // Map pileStatusMap = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileSn)); + // String pileStatus = pileStatusMap.get(pileSn); + // if (StringUtils.equals(PileStatusEnum.ON_LINE.getValue(), pileStatus)) { + // // 1-在线 + // pileStatus = LianLianPileStatusEnum.NORMAL.getCode(); + // } else if (StringUtils.equals(PileStatusEnum.OFF_LINE.getValue(), pileStatus)) { + // // 2-离线 + // pileStatus = LianLianPileStatusEnum.CLOSE_OFFLINE.getCode(); + // } else if (StringUtils.equals(PileStatusEnum.FAULT.getValue(), pileStatus)) { + // // 3-故障 + // pileStatus = LianLianPileStatusEnum.UNDER_MAINTENANCE.getCode(); + // } + equipmentInfo.setEquipmentStatus(Integer.valueOf(pileDetailInfoVO.getPileStatus())); + equipmentInfo.setEquipmentPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); equipmentInfo.setNewNationalStandard(1); equipmentInfo.setVinFlag(1); equipmentInfo.setEquipmentName(pileSn); - equipmentInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + equipmentInfo.setPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); // 枪口列表 - List connectorList = getConnectorListForLianLian(pileSn); + List connectorList = getConnectorListForLianLian(pileDetailInfoVO); equipmentInfo.setConnectorInfos(connectorList); resultList.add(equipmentInfo); @@ -1276,6 +1275,25 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { return resultList; } + @Override + public List getPileDetailInfoList(String stationId) { + List pileDetailInfoList = pileBasicInfoMapper.getPileDetailInfoList(stationId); + if (CollectionUtils.isEmpty(pileDetailInfoList)) { + return new ArrayList<>(); + } + List pileSnList = pileDetailInfoList.stream() + .map(PileDetailInfoVO::getPileSn) + .collect(Collectors.toList()); + Map pileStatusV2 = pileConnectorInfoService.getPileStatus(pileSnList); + pileDetailInfoList.forEach(pileDetailInfoVO -> { + String pileSn = pileDetailInfoVO.getPileSn(); + if (pileStatusV2.containsKey(pileSn)) { + pileDetailInfoVO.setPileStatus(pileStatusV2.get(pileSn)); + } + }); + return pileDetailInfoList; + } + /** * 获取枪口列表 * @@ -1357,6 +1375,43 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { return resultList; } + + public List getConnectorListForLianLian(PileDetailInfoVO pileDetailInfoVO) { + List resultList = new ArrayList<>(); + + List list = pileConnectorInfoService.selectPileConnectorInfoList(pileDetailInfoVO.getPileSn()); + for (PileConnectorInfo pileConnectorInfo : list) { + ConnectorInfo connectorInfo = new ConnectorInfo(); + connectorInfo.setConnectorID(pileConnectorInfo.getPileConnectorCode()); + int connectorType = StringUtils.equals("1", pileDetailInfoVO.getSpeedType()) ? 4 : 3; + connectorInfo.setConnectorType(connectorType); + // 车位号 + if (StringUtils.isNotBlank(pileConnectorInfo.getParkNo())) { + connectorInfo.setParkNo(pileConnectorInfo.getParkNo()); + } + connectorInfo.setVoltageUpperLimits(Integer.valueOf(pileDetailInfoVO.getRatedVoltage())); + connectorInfo.setEquipmentClassification(1); + connectorInfo.setVoltageLowerLimits(Integer.valueOf(pileDetailInfoVO.getRatedVoltage())); + connectorInfo.setCurrent(Integer.valueOf(pileDetailInfoVO.getRatedCurrent())); + connectorInfo.setConnectorName(pileConnectorInfo.getPileConnectorCode()); + connectorInfo.setOperateStatus(50); // 50-正常使用 + connectorInfo.setOpreateStatus(50); // 50-正常使用 + connectorInfo.setNationalStandard(2); // 2-2015 + connectorInfo.setAuxPower(3); // 3-兼容12V和24V + + if (!StringUtils.equals(pileDetailInfoVO.getConnectorNum(), "1")) { + // 如果不是单枪,则枪口功率需要除以枪口数量 + String ratedPowerStr = pileDetailInfoVO.getRatedPower(); + BigDecimal ratedPower = new BigDecimal(ratedPowerStr); + connectorInfo.setPower(ratedPower.divide(new BigDecimal(pileDetailInfoVO.getConnectorNum()), 1, BigDecimal.ROUND_HALF_UP)); + }else { + connectorInfo.setPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + } + resultList.add(connectorInfo); + } + return resultList; + } + @Override public List getPileListForZDL(String stationId) { List resultList = new ArrayList<>(); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/PileDetailInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/PileDetailInfoVO.java new file mode 100644 index 000000000..bf9b0f840 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/PileDetailInfoVO.java @@ -0,0 +1,33 @@ +package com.jsowell.pile.thirdparty; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 第三方平台桩信息VO + * + * @author Lemon + * @Date 2024/12/19 14:41:52 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class PileDetailInfoVO { + + private String pileSn; + + private Date createTime; + + private String speedType; + private String modelName; + private String ratedPower; + private String ratedVoltage; + private String ratedCurrent; + private String connectorNum; + private String pileStatus; +} diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml index a73b8aa74..ec607a87a 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderPileOccupyMapper.xml @@ -1015,6 +1015,7 @@ and t1.occupy_code = #{dto.occupyCode} and t1.member_id = #{dto.memberId} and t1.station_id = #{dto.stationId} + and t2.station_name = #{dto.stationName} and t1.plate_number = #{dto.plateNumber} and t1.status = #{dto.status} and t1.pay_status = #{dto.payStatus} diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml index 0f06b0786..357de38fc 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileBasicInfoMapper.xml @@ -456,4 +456,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t1.del_flag = '0' and t1.sn = #{pileSn,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuiZhouPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuiZhouPlatformServiceImpl.java index e47250562..c5548c36c 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuiZhouPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/GuiZhouPlatformServiceImpl.java @@ -222,9 +222,10 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { public Map queryStationsInfo(QueryStationInfoDTO dto) { int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo(); int pageSize = dto.getPageSize() == null ? 50 : dto.getPageSize(); + dto.setThirdPlatformType(thirdPlatformType); PageUtils.startPage(pageNo, pageSize); - List stationInfos = pileStationInfoService.getStationInfosByThirdParty(dto); + List stationInfos = pileStationInfoService.selectStationInfosByThirdParty(dto); if (CollectionUtils.isEmpty(stationInfos)) { // 未查到数据 return null; @@ -291,6 +292,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { String areaCodeCountryside = "123456789101"; info.setAreaCodeCountryside(areaCodeCountryside); } + info.setAreaCodeCountryside("123456789101"); resultList.add(info); } @@ -299,6 +301,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService { map.put("PageCount", pageInfo.getPages()); map.put("ItemSize", pageInfo.getTotal()); map.put("StationInfos", resultList); + logger.info("贵州省平台查询站点信息 resultData:{}", JSON.toJSONString(map)); Map resultMap = ThirdPartyPlatformUtils.generateResultMapV2(map, thirdPartySecretInfoVO.getOurDataSecret(), thirdPartySecretInfoVO.getOurDataSecretIv(), thirdPartySecretInfoVO.getTheirSigSecret()); return resultMap; diff --git a/jsowell-ui/src/views/pile/occupy/index.vue b/jsowell-ui/src/views/pile/occupy/index.vue index 8dea5df0e..f43b6f038 100644 --- a/jsowell-ui/src/views/pile/occupy/index.vue +++ b/jsowell-ui/src/views/pile/occupy/index.vue @@ -14,6 +14,14 @@ :value="item.value"/> + + + @@ -228,6 +236,7 @@ export default { status: null, memberId: null, stationId: null, + stationName: null, orderCode: null, transactionCode: null, startTime: null,