diff --git a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/SiChuanController.java b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/SiChuanController.java index 67c30c941..0eff319d2 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/SiChuanController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/SiChuanController.java @@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.util.List; import java.util.Map; /** @@ -22,7 +23,7 @@ import java.util.Map; @Anonymous @RequestMapping("/sichuan") public class SiChuanController extends ThirdPartyBaseController { - private final String platformName = ""; + private final String platformName = "四川省监管平台"; private final String platformType = ThirdPlatformTypeEnum.SI_CHUAN_PLATFORM.getTypeCode(); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileBillingTemplate.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileBillingTemplate.java index 3b038dc9f..673cfe3da 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileBillingTemplate.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileBillingTemplate.java @@ -98,75 +98,17 @@ public class PileBillingTemplate extends BaseEntity { */ private String memberFlag; + /** + * 对外展示VIP价格标识(0-不展示; 1-展示) + */ + private String displayFlag; + /** * 发布时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date publishTime; - // public String getPublicFlag() { - // return publicFlag; - // } - // - // public void setPublicFlag(String publicFlag) { - // this.publicFlag = publicFlag; - // } - // - // public void setId(Long id) { - // this.id = id; - // } - // - // public Long getId() { - // return id; - // } - // - // public void setTemplateCode(String templateCode) { - // this.templateCode = templateCode; - // } - // - // public String getTemplateCode() { - // return templateCode; - // } - // - // public void setName(String name) { - // this.name = name; - // } - // - // public String getName() { - // return name; - // } - // - // public void setType(String type) { - // this.type = type; - // } - // - // public String getType() { - // return type; - // } - // - // public void setStationId(Long stationId) { - // this.stationId = stationId; - // } - // - // public Long getStationId() { - // return stationId; - // } - // - // public void setDelFlag(String delFlag) { - // this.delFlag = delFlag; - // } - // - // public String getDelFlag() { - // return delFlag; - // } - // - // public List getPileBillingDetailList() { - // return pileBillingDetailList; - // } - // - // public void setPileBillingDetailList(List pileBillingDetailList) { - // this.pileBillingDetailList = pileBillingDetailList; - // } @Override public String toString() { diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/CreateOrUpdateBillingTemplateDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/CreateOrUpdateBillingTemplateDTO.java index e2a3ad50f..2c61f36f6 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/CreateOrUpdateBillingTemplateDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/CreateOrUpdateBillingTemplateDTO.java @@ -95,4 +95,9 @@ public class CreateOrUpdateBillingTemplateDTO { // 集团编号 private String groupCode; + + /** + * 对外展示VIP价格标识(0-不展示; 1-展示) + */ + private String displayFlag; } 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 aac2e143e..06e2b0a36 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 @@ -241,6 +241,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic billingTemplate.setFreeTime(dto.getFreeTime()); billingTemplate.setOccupyFee(dto.getOccupyFee()); billingTemplate.setMaxOccupyFee(dto.getMaxOccupyFee()); + billingTemplate.setDisplayFlag(dto.getDisplayFlag()); // 查询站点信息 PileStationInfo stationInfo = pileStationInfoService.selectPileStationInfoById(billingTemplate.getStationId()); @@ -315,6 +316,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic result.setFreeTime(pileBillingTemplate.getFreeTime()); result.setOccupyFee(pileBillingTemplate.getOccupyFee()); result.setMaxOccupyFee(pileBillingTemplate.getMaxOccupyFee()); + result.setDisplayFlag(pileBillingTemplate.getDisplayFlag()); // 查计费模板详情 // List detailList = pileBillingTemplateMapper.queryBillingDetailByTemplateIds(new Long[]{id}); @@ -410,6 +412,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic // 将桩的费率存入stationVO BigDecimal electricityPrice = detailVO.getElectricityPrice(); BigDecimal servicePrice = detailVO.getServicePrice(); + result.setDisplayFlag(preferentialBillingTemplate.getDisplayFlag()); result.setVipElectricityPrice(electricityPrice.toString()); result.setVipServicePrice(servicePrice.toString()); result.setVipTotalPrice(electricityPrice.add(servicePrice).toString()); @@ -796,6 +799,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic // 优惠计费模板价格 BillingDetailVO preferentialBillingDetailVO = preferentialBillingDetailVOMap.get(type); if (Objects.nonNull(preferentialBillingDetailVO)) { + vo.setDisplayFlag(preferentialBillingTemplate != null ? preferentialBillingTemplate.getDisplayFlag() : "0"); // vip电费 vo.setVipElectricityPrice(preferentialBillingDetailVO.getElectricityPrice().toString()); // vip服务费 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 242cf3af2..6c2b1e563 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 @@ -36,7 +36,6 @@ import com.jsowell.pile.vo.uniapp.business.StationBusinessAnalyzeInfoVO; import com.jsowell.pile.vo.uniapp.business.StationOrderQuantityInfoVO; import com.jsowell.pile.vo.uniapp.business.StationStatisticsInfosVO; import com.jsowell.pile.vo.uniapp.customer.CurrentTimePriceDetails; -import com.jsowell.pile.vo.web.PileDetailVO; import com.jsowell.pile.vo.web.PileStationVO; import com.jsowell.system.service.SysDeptService; import com.jsowell.system.service.SysUserService; @@ -598,6 +597,7 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { stationVO.setFreeTime(currentTimePriceDetails.getFreeTime()); stationVO.setOccupyFee(currentTimePriceDetails.getOccupyFee()); // vip价 + stationVO.setDisplayFlag(currentTimePriceDetails.getDisplayFlag()); stationVO.setVipElectricityPrice(currentTimePriceDetails.getVipElectricityPrice()); stationVO.setVipServicePrice(currentTimePriceDetails.getVipServicePrice()); stationVO.setVipTotalPrice(currentTimePriceDetails.getVipTotalPrice()); @@ -1451,4 +1451,4 @@ public class PileStationInfoServiceImpl implements PileStationInfoService { } return uniAppQueryStationInfoListV2(dto); } -} \ No newline at end of file +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/dto/ConnectorInfoDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/dto/ConnectorInfoDTO.java new file mode 100644 index 000000000..aac4c3f50 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/dto/ConnectorInfoDTO.java @@ -0,0 +1,170 @@ +package com.jsowell.pile.thirdparty.dto; + +import com.alibaba.fastjson2.annotation.JSONField; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +/** + * 充电设备接口信息 + */ +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Data +public class ConnectorInfoDTO { + /** + * 充电设备接口编码 Y + * 充电设备接口编码,同一对接平台内唯一 + */ + @JSONField(name = "ConnectorID") + private String connectorID; + + /** + * 设备接口分类 + * 1:车辆充电设备接口 + * 2:换电站内的电池箱 充电设备接口 + */ + @JSONField(name = "EquipmentClassification") + private Integer equipmentClassification; + + /** + * 充电设备接口名称 N + */ + @JSONField(name = "ConnectorName") + private String connectorName; + + /** + * 充电设备接口类型 Y + * 1:家用插座(模式2) + * 2:交流接口插座(模式3,连接方式B ) + * 3:交流接口插头(带枪线,模式3,连接方式C) + * 4:直流接口枪头(带枪线,模式4) + */ + @JSONField(name = "ConnectorType") + private Integer connectorType; + + /** + * 枪口状态 + */ + @JSONField(name = "Status") + private Integer status; + + /** + * 额定电压上限(单位:V) Y + */ + @JSONField(name = "VoltageUpperLimits") + private BigDecimal voltageUpperLimits; + + /** + * 额定电压下限(单位:V) Y + */ + @JSONField(name = "VoltageLowerLimits") + private BigDecimal voltageLowerLimits; + + /** + *恒功率电压上限 + */ + @JSONField(name = "ConstantVoltageUpperLimits") + private Integer constantVoltageUpperLimits; + + /** + *恒功率电压下限 + */ + @JSONField(name = "ConstantVoltageLowerLimits") + private Integer constantVoltageLowerLimits; + + /** + * 额定电流(单位:A) Y + */ + @JSONField(name = "Current") + private BigDecimal current; + + /** + *恒功率电流上限 + */ + @JSONField(name = "ConstantCurrentUpperLimits") + private Integer ConstantCurrentUpperLimits; + + /** + * 额 定 电 流 上限 + */ + @JSONField(name = "CurrentUpperLimits") + private Integer currentUpperLimits; + + /** + * 额 定 电 流 下限 + */ + @JSONField(name = "CurrentLowerLimits") + private Integer currentLowerLimits; + + /** + *恒功率电流下限 + */ + @JSONField(name = "ConstantCurrentLowerLimits") + private Integer ConstantCurrentLowerLimits; + + /** + * 额定功率(单位:kW) Y + */ + @JSONField(name = "Power") + private BigDecimal power; + + /** + * 接口功率类型 + */ + @JSONField(name = "PowerType") + private Integer powerType; + + /** + * 车位号 N + * 停车场车位编号 + */ + @JSONField(name = "ParkNo") + private String parkNo; + + + /** + * 运营状态 + * 0-未知 + * 1-建设中 + * 5-关闭下线 + * 6-维护中 + * 50-正常使用 + */ + @JSONField(name = "OperateStatus") + private Integer operateStatus; + + /** + * 运营状态 + * 0-未知 + * 1-建设中 + * 5-关闭下线 + * 6-维护中 + * 50-正常使用 + */ + @JSONField(name = "OpreateStatus") + private Integer opreateStatus; + + /** + * 国家标准 + */ + @JSONField(name = "NationalStandard") + private Integer nationalStandard; + + /** + * 辅助电源 + */ + @JSONField(name = "AuxPower") + private Integer auxPower; + + /** + * 运营时间 + */ + @JSONField(name = "OpreateHours") + private String opreateHours; + +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/dto/EquipmentInfoDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/dto/EquipmentInfoDTO.java new file mode 100644 index 000000000..596c351ec --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/dto/EquipmentInfoDTO.java @@ -0,0 +1,217 @@ +package com.jsowell.pile.thirdparty; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.jsowell.pile.thirdparty.dto.ConnectorInfoDTO; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 充电设备信息 + */ +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Data +public class EquipmentInfoDTO { + /** + * 设备编码 Y + * 设备唯一编码,对同一对接平台,保证唯一 + */ + @JSONField(name = "EquipmentID") + private String equipmentID; + + /** + * 设备唯一编码 + *设备生产商组织机构代 码 9 位+设备出厂唯一 编码 + */ + @JSONField(name = "EquipmentUniqueNumber") + private String equipmentUniqueNumber; + + /** + * 设备生产商组织机构代码 Y + */ + @JSONField(name = "ManufacturerID") + private String manufacturerID; + + /** + * 设备生产商名称 + */ + @JSONField(name = "ManufacturerName") + private String manufacturerName; + + /** + * 设备型号 N + * 由设备生厂商定义的设备型号 + */ + @JSONField(name = "EquipmentModel") + private String equipmentModel; + + /** + * 设备名称 N + */ + @JSONField(name = "EquipmentName") + private String equipmentName; + + /** + * 设备生产日期 N + * YYYY-MM-DD + */ + @JSONField(name = "ProductionDate") + private String productionDate; + + /** + * 建设时间 Y + * YYYY-MM-DD + */ + @JSONField(name = "ConstructionTime") + private String constructionTime; + + /** + * 设备类型(1-直流设备;2-交流设备;3-交直流一体设备) Y + */ + @JSONField(name = "EquipmentType") + private Integer equipmentType; + + /** + * 设备分类 + * 1:车辆充电设备 2:换电站内的电池箱 充电设备 + */ + @JSONField(name = "EquipmentClassification") + private Integer equipmentClassification; + + /** + * 设备状态 Y + * 0:未知 + * 1:建设中 + * 5:关闭下线 + * 6:维护中 + * 50:正常使用 + */ + @JSONField(name = "EquipmentStatus") + private Integer equipmentStatus; + + /** + * 充电设备用途 + * 1:公用; + * 2:专用; + * 3:个人分时共享; + * 4:限制类公用; + * 9:其他 + */ + @JSONField(name = "EquipmentApplication") + private String equipmentApplication; + + /** + * 额定功率(单位:kW) Y + */ + @JSONField(name = "EquipmentPower") + private BigDecimal equipmentPower; + + /** + * 新国标(0-否;1-是) Y + * 是否新国标 + */ + @JSONField(name = "NewNationalStandard") + private Integer newNationalStandard; + + /** + * 充电设备接口列表 Y + * 该充电设备所有的充电设备接口的信息对象集合 + */ + @JSONField(name = "ConnectorInfos") + private List connectorInfos; + + /** + * 充电设备经度 N + * GCJ-02坐标系 + */ + @JSONField(name = "EquipmentLng") + private BigDecimal equipmentLng; + + /** + * 充电设备纬度 N + * GCJ-02坐标系 + */ + @JSONField(name = "EquipmentLat") + private BigDecimal equipmentLat; + + /** + * 是否支持VIN码识别(0-否;1-是) Y + */ + @JSONField(name = "VinFlag") + private Integer vinFlag; + + /** + * 设备总功率 + */ + @JSONField(name = "Power") + private BigDecimal power; + + /** + * 设备开通时间 + */ + @JSONField(name = "OpenDate") + private String openDate; + + /** + * 设备投资金额 + */ + @JSONField(name = "EquipmentInvestment") + private BigDecimal equipmentInvestment; + + /** + * 设备出厂序号 + */ + @JSONField(name = "ProductSN") + private String productSN; + + /** + * 是否支持自动识别VIN码 + */ + @JSONField(name = "SVIN") + private Integer svin; + + /** + * 是否支持有序充电 + */ + @JSONField(name = "SautoPower") + private Integer sautoPower; + + /** + * 额定电压上限 + */ + @JSONField(name = "VoltageUpperLimits") + private BigDecimal voltageUpperLimits; + + /** + * 额定电压下限 + */ + @JSONField(name = "VoltageLowerLimits") + private BigDecimal voltageLowerLimits; + + /** + * 额定电流 + */ + @JSONField(name = "Current") + private BigDecimal current; + + + /** + * 站点额定功率 + */ + private BigDecimal stationRatedPower; + + + /** + *报装户号 + * 如整个站按一个户号立户的,则站内所以设备的户号为同一个,如果是桩立户,则为桩实际立户户号。20 字符。 + */ + @JSONField(name = "ConsNo") + private String ConsNo; + +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/StationInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/StationInfoVO.java index 6a5d2fb99..53051531b 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/StationInfoVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/StationInfoVO.java @@ -63,6 +63,11 @@ public class StationInfoVO { */ private String totalPrice; + /** + * 对外展示VIP价格标识(0-不展示; 1-展示) + */ + private String displayFlag; + /** * vip电费 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/BillingPriceVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/BillingPriceVO.java index 1bd4b2578..e64c90e6e 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/BillingPriceVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/BillingPriceVO.java @@ -42,6 +42,11 @@ public class BillingPriceVO { */ private String totalPrice; + /** + * 对外展示VIP价格标识(0-不展示; 1-展示) + */ + private String displayFlag; + /** * vip电费 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/CurrentTimePriceDetails.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/CurrentTimePriceDetails.java index d27bdb386..823a83a02 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/CurrentTimePriceDetails.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/uniapp/customer/CurrentTimePriceDetails.java @@ -42,6 +42,11 @@ public class CurrentTimePriceDetails { */ private String totalPrice; + /** + * 对外展示VIP价格标识(0-不展示; 1-展示) + */ + private String displayFlag; + /** * vip电费 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/BillingTemplateVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/BillingTemplateVO.java index a0fcf627b..75b6ae1bd 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/BillingTemplateVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/BillingTemplateVO.java @@ -40,6 +40,11 @@ public class BillingTemplateVO { */ private String memberFlag; + /** + * 对外展示VIP价格标识(0-不展示; 1-展示) + */ + private String displayFlag; + // 计费模板备注 private String remark; diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml index 81adcb09e..244a9807c 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileBillingTemplateMapper.xml @@ -16,7 +16,8 @@ - + + @@ -27,7 +28,7 @@ id, template_code, name, status, template_remark, template_desc, type, station_id, free_time, occupy_fee, max_occupy_fee, public_flag, - member_flag, create_time, update_by, update_time, del_flag + member_flag, display_flag, create_by, create_time, update_by, update_time, del_flag @@ -92,6 +93,7 @@ a.occupy_fee, a.max_occupy_fee, a.template_remark, + a.display_flag as display_flag, a.type, a.station_id, a.create_by, @@ -253,6 +255,9 @@ station_id = #{stationId}, + + display_flag = #{displayFlag}, + free_time = #{freeTime}, @@ -506,6 +511,7 @@ t2.id as templateId, t2.template_code AS templateCode, t2.`name` AS templateName, + t2.display_flag AS displayFlag, t3.electricity_price AS sharpElectricityPrice, t3.service_price AS sharpServicePrice, t3.apply_time AS sharpApplyDate, @@ -627,6 +633,7 @@ t2.id as templateId, t2.template_code AS templateCode, t2.`name` AS templateName, + t2.display_flag as displayFlag, t3.electricity_price AS sharpElectricityPrice, t3.service_price AS sharpServicePrice, t3.apply_time AS sharpApplyDate, diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/dto/SupStationInfoDTO.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/dto/SupStationInfoDTO.java new file mode 100644 index 000000000..d11cda7cd --- /dev/null +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/dto/SupStationInfoDTO.java @@ -0,0 +1,26 @@ +package com.jsowell.thirdparty.platform.dto; + +import com.alibaba.fastjson2.annotation.JSONField; +import com.jsowell.pile.thirdparty.EquipmentInfoDTO; +import com.jsowell.thirdparty.platform.domain.SupStationInfo; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.List; + + +/** + * 内蒙古平台站点信息 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@SuperBuilder +public class SupStationInfoDTO extends SupStationInfo { + + @JSONField(name = "EquipmentInfos") + private List equipmentInfosDTO; + +} diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/SiChuanPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/SiChuanPlatformServiceImpl.java index 1855f3534..f96c257b5 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/SiChuanPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/SiChuanPlatformServiceImpl.java @@ -1,5 +1,6 @@ package com.jsowell.thirdparty.platform.service.impl; +import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.github.pagehelper.PageHelper; @@ -8,39 +9,33 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.jsowell.common.constant.Constants; import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; -import com.jsowell.common.enums.thirdparty.BusinessInformationExchangeEnum; +import com.jsowell.common.enums.lianlian.LianLianPileStatusEnum; import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; -import com.jsowell.common.enums.ykc.BillingTimeTypeEnum; -import com.jsowell.common.enums.ykc.OrderStatusEnum; -import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum; -import com.jsowell.common.enums.ykc.ReturnCodeEnum; +import com.jsowell.common.enums.ykc.*; import com.jsowell.common.exception.BusinessException; import com.jsowell.common.util.*; import com.jsowell.pile.domain.*; -import com.jsowell.pile.domain.ykcCommond.StartChargingCommand; import com.jsowell.pile.dto.*; -import com.jsowell.pile.mapper.OrderMonitorDataMapper; +import com.jsowell.pile.mapper.PileBasicInfoMapper; import com.jsowell.pile.service.*; -import com.jsowell.pile.thirdparty.CommonParamsDTO; -import com.jsowell.pile.thirdparty.ConnectorInfo; -import com.jsowell.pile.thirdparty.EquipmentInfo; +import com.jsowell.pile.thirdparty.*; +import com.jsowell.pile.thirdparty.EquipmentInfoDTO; +import com.jsowell.pile.thirdparty.dto.ConnectorInfoDTO; import com.jsowell.pile.util.MerchantUtils; import com.jsowell.pile.vo.SupStationStatsVO; import com.jsowell.pile.vo.ThirdPartySecretInfoVO; import com.jsowell.pile.vo.base.ConnectorInfoVO; import com.jsowell.pile.vo.base.MerchantInfoVO; -import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; import com.jsowell.pile.vo.uniapp.customer.BillingPriceVO; import com.jsowell.pile.vo.web.PileConnectorInfoVO; import com.jsowell.pile.vo.web.PileMerchantInfoVO; -import com.jsowell.pile.vo.web.PileModelInfoVO; import com.jsowell.pile.vo.web.PileStationVO; -import com.jsowell.pile.vo.zdl.EquipBusinessPolicyVO; import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo; import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo; import com.jsowell.thirdparty.lianlian.vo.*; import com.jsowell.thirdparty.platform.domain.*; +import com.jsowell.thirdparty.platform.dto.SupStationInfoDTO; import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory; import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService; import com.jsowell.thirdparty.platform.util.Cryptos; @@ -51,19 +46,11 @@ import com.yi.business.geo.GeoCodeInfo; import com.yi.business.geo.TermRelationTreeCoordinate; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.bouncycastle.crypto.CryptoException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.math.RoundingMode; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; -import java.security.spec.InvalidKeySpecException; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.format.DateTimeFormatter; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -94,11 +81,10 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService { @Autowired private PileBillingTemplateService pileBillingTemplateService; - @Autowired - private YKCPushCommandService ykcPushCommandService; @Autowired - private PileRemoteService pileRemoteService; + private PileBasicInfoMapper pileBasicInfoMapper; + @Autowired private ThirdPartyStationRelationService thirdPartyStationRelationService; @@ -228,13 +214,12 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService { // 未查到数据 return null; } - // ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId()); ThirdPartySecretInfoVO thirdPartySecretInfoVO = getSiChuanSecretInfo(); PageInfo pageInfo = new PageInfo<>(stationInfos); - List resultList = new ArrayList<>(); + List resultList = new ArrayList<>(); for (ThirdPartyStationInfoVO pileStationInfo : pageInfo.getList()) { - SupStationInfo stationInfo = new SupStationInfo(); + SupStationInfoDTO stationInfo = new SupStationInfoDTO(); stationInfo.setStationID(String.valueOf(pileStationInfo.getId())); stationInfo.setOperatorID(Constants.OPERATORID_JIANG_SU); // 组织机构代码 String organizationCode = pileStationInfo.getOrganizationCode(); @@ -275,10 +260,13 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService { stationInfo.setCapacity(pileStationInfo.getCapacity().setScale(4, RoundingMode.HALF_UP)); } // 获取充电桩设备列表 - List pileList = getPileList(pileStationInfo,pileStationInfo.getStationStatus()); + List pileList = getPileList(String.valueOf(pileStationInfo.getId())); + if (CollectionUtils.isNotEmpty(pileList)) { + stationInfo.setEquipmentInfosDTO(pileList); // 充电设备信息列表 + } // 站点额定总功率 BigDecimal stationRatedPower = pileList.stream() - .map(EquipmentInfo::getEquipmentPower) + .map(EquipmentInfoDTO::getEquipmentPower) .reduce(BigDecimal.ZERO, BigDecimal::add); stationInfo.setRatedPower(stationRatedPower.setScale(4, RoundingMode.HALF_UP)); @@ -294,9 +282,6 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService { if (StringUtils.isNotBlank(pileStationInfo.getPictures())) { stationInfo.setPictures(Lists.newArrayList(pileStationInfo.getPictures().split(","))); } - if (CollectionUtils.isNotEmpty(pileList)) { - stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表 - } StringBuilder electricityFee = new StringBuilder(); StringBuilder serviceFee = new StringBuilder(); // 查询计费模板 @@ -339,6 +324,7 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService { map.put("PageCount", pageInfo.getPages()); map.put("PageNo", pageInfo.getPageNum()); map.put("StationInfos", resultList); + log.info("queryStationsInfo result : " + JSON.toJSONString(map)); return ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO); } @@ -366,7 +352,7 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService { // 组装中电联平台所需要的数据格式 - SupStationInfo info = SupStationInfo.builder() + SupStationInfoDTO info = SupStationInfoDTO.builder() .stationID(stationId) .operatorID(Constants.OPERATORID_JIANG_SU) .stationName(pileStationInfo.getStationName()) @@ -401,11 +387,11 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService { } //获取充电桩设备列表 - List pileList = getPileList(pileStationInfo,pileStationInfo.getStationStatus()); + List pileList = getPileList(String.valueOf(pileStationInfo.getId())); // 站点额定总功率 BigDecimal stationRatedPower = pileList.stream() - .map(EquipmentInfo::getEquipmentPower) + .map(EquipmentInfoDTO::getEquipmentPower) .reduce(BigDecimal.ZERO, BigDecimal::add); info.setRatedPower(stationRatedPower.setScale(4, RoundingMode.HALF_UP)); info.setPeriodFee(Constants.one); @@ -461,7 +447,7 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService { } if (CollectionUtils.isNotEmpty(pileList)) { - info.setEquipmentInfos(pileList); // 充电设备信息列表 + info.setEquipmentInfosDTO(pileList); // 充电设备信息列表 } stationInfos.add(info); @@ -1125,79 +1111,98 @@ public class SiChuanPlatformServiceImpl implements ThirdPartyPlatformService { - /** - * 获取桩列表信息 - * - * @param pileStationInfo - * @param stationStatus - * @return - */ - private List getPileList(PileStationInfo pileStationInfo , String stationStatus) { - List resultList = new ArrayList<>(); + public List getPileList(String stationId) { + List resultList = new ArrayList<>(); // 通过站点id查询桩基本信息 - List list = pileBasicInfoService.getPileListByStationId(String.valueOf(pileStationInfo.getId())); - // 封装成中电联平台对象 - for (PileBasicInfo pileBasicInfo : list) { - EquipmentInfo equipmentInfo = new EquipmentInfo(); - String pileSn = pileBasicInfo.getSn(); + List list = getPileDetailInfoList(stationId); + // 封装成联联平台对象 + for (PileDetailInfoVO pileDetailInfoVO : list) { + com.jsowell.pile.thirdparty.EquipmentInfoDTO equipmentInfo = new EquipmentInfoDTO(); + String pileSn = pileDetailInfoVO.getPileSn(); equipmentInfo.setEquipmentID(pileSn); - equipmentInfo.setEquipmentClassification(Constants.one); - PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn); - equipmentInfo.setEquipmentType(Integer.parseInt(modelInfo.getSpeedType())); - equipmentInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(4, RoundingMode.HALF_UP)); + equipmentInfo.setEquipmentClassification(1); - List connectorList = getConnectorList(pileBasicInfo,stationStatus); + if (StringUtils.isBlank(pileDetailInfoVO.getSpeedType())) { + continue; + } + equipmentInfo.setEquipmentType(Integer.valueOf(pileDetailInfoVO.getSpeedType())); + equipmentInfo.setEquipmentPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + + String pileStatus = pileDetailInfoVO.getPileStatus(); + 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.setPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(4, RoundingMode.HALF_UP)); + + // 枪口列表 + List connectorList = getConnectorListForLianLian(pileDetailInfoVO); equipmentInfo.setConnectorInfos(connectorList); resultList.add(equipmentInfo); } + return resultList; } - /** - * 获取枪口列表 - * - * @param pileBasicInfo - * @param stationStatus - * @return - */ - private List getConnectorList(PileBasicInfo pileBasicInfo , String stationStatus) { - List resultList = new ArrayList<>(); + 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; + } - List list = pileConnectorInfoService.selectPileConnectorInfoList(pileBasicInfo.getSn()); + + public List getConnectorListForLianLian(PileDetailInfoVO pileDetailInfoVO) { + List resultList = new ArrayList<>(); + + List list = pileConnectorInfoService.selectPileConnectorInfoList(pileDetailInfoVO.getPileSn()); for (PileConnectorInfo pileConnectorInfo : list) { - ConnectorInfo connectorInfo = new ConnectorInfo(); + ConnectorInfoDTO connectorInfo = new ConnectorInfoDTO(); connectorInfo.setConnectorID(pileConnectorInfo.getPileConnectorCode()); - connectorInfo.setEquipmentClassification(Constants.one); - String pileSn = pileConnectorInfo.getPileSn(); - PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn); - int connectorType = StringUtils.equals("1", modelInfo.getSpeedType()) ? 4 : 3; - + connectorInfo.setEquipmentClassification(1); + 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(modelInfo.getRatedVoltage())); - connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage())); - connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent())); - connectorInfo.setNationalStandard(2); - // if (!StringUtils.equals(modelInfo.getConnectorNum(), "1")) { - // // 如果不是单枪,则枪口功率需要除以枪口数量 - // String ratedPowerStr = modelInfo.getRatedPower(); - // BigDecimal ratedPower = new BigDecimal(ratedPowerStr); - // connectorInfo.setPower(ratedPower.divide(new BigDecimal(modelInfo.getConnectorNum()), 1, BigDecimal.ROUND_HALF_UP)); - // }else { - // } - connectorInfo.setAuxPower(3); - connectorInfo.setOpreateStatus(Integer.valueOf(stationStatus)); - connectorInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP)); + + connectorInfo.setVoltageUpperLimits(new BigDecimal(pileDetailInfoVO.getRatedVoltage()).setScale(4, RoundingMode.HALF_UP)); + connectorInfo.setVoltageLowerLimits(new BigDecimal(pileDetailInfoVO.getRatedVoltage()).setScale(4, RoundingMode.HALF_UP)); + connectorInfo.setCurrent(new BigDecimal(pileDetailInfoVO.getRatedCurrent()).setScale(4, RoundingMode.HALF_UP)); + connectorInfo.setPower(new BigDecimal(pileDetailInfoVO.getRatedPower()).setScale(4, RoundingMode.HALF_UP)); + connectorInfo.setNationalStandard(StringUtils.equals("1", pileDetailInfoVO.getSpeedType()) ? 12 : 11); + connectorInfo.setAuxPower(3); // 3-兼容12V和24V + connectorInfo.setOperateStatus(50); // 50-正常使用 + +/* 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; }