mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
UPDATE
This commit is contained in:
@@ -68,6 +68,12 @@ public class SupStationPowerInfo {
|
||||
@JSONField(name = "EquipmentPowerInfos")
|
||||
private List<EquipmentPowerInfo> equipmentPowerInfos;
|
||||
|
||||
/**
|
||||
* 充电设备功率信息列表
|
||||
*/
|
||||
@JSONField(name = "SupEquipmentPowerInfos")
|
||||
private List<EquipmentPowerInfo> supEquipmentPowerInfos;
|
||||
|
||||
@Data
|
||||
public static class EquipmentPowerInfo{
|
||||
/**
|
||||
@@ -104,6 +110,11 @@ public class SupStationPowerInfo {
|
||||
@JSONField(name = "ConnectorPowerInfos")
|
||||
private List<ConnectorPowerInfo> connectorPowerInfos;
|
||||
|
||||
/**
|
||||
* 充电设备接口实时功率列表
|
||||
*/
|
||||
@JSONField(name = "SupConnectorPowerInfos")
|
||||
private List<ConnectorPowerInfo> supConnectorPowerInfos;
|
||||
|
||||
@Data
|
||||
public static class ConnectorPowerInfo{
|
||||
|
||||
@@ -26,6 +26,15 @@ public class ChargeOrderInfo {
|
||||
@JSONField(name = "OperatorID")
|
||||
private String operatorID;
|
||||
|
||||
/**
|
||||
* 设备分类
|
||||
* 1:车辆充电设备
|
||||
* 2:换电站内的电池箱充电设备
|
||||
*/
|
||||
@JSONField(name = "EquipmentClassification")
|
||||
private Integer equipmentClassification;
|
||||
|
||||
|
||||
/**
|
||||
* 设备所属方
|
||||
* IDEquipmentOwnerID
|
||||
@@ -233,6 +242,17 @@ public class ChargeOrderInfo {
|
||||
@JSONField(name = "TotalSeviceMoney")
|
||||
private BigDecimal totalSeviceMoney;
|
||||
|
||||
/**
|
||||
* 总服务费
|
||||
* TotalSeviceMoney
|
||||
* 本单总服务费,单位:元,小数点后4位
|
||||
* 是
|
||||
* 浮点数
|
||||
* ≤8字符,小数点后4位
|
||||
*/
|
||||
@JSONField(name = "TotalServiceMoney")
|
||||
private BigDecimal totalServiceMoney;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
* TotalMoney
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.lianlian.StationPaymentEnum;
|
||||
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.exception.BusinessException;
|
||||
@@ -30,10 +31,10 @@ 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.ThirdPartyStationInfoVO;
|
||||
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
||||
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.thirdparty.lianlian.domain.ConnectorChargeStatusInfo;
|
||||
import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo;
|
||||
import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo;
|
||||
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
|
||||
@@ -41,7 +42,6 @@ import com.jsowell.thirdparty.platform.domain.*;
|
||||
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
|
||||
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
|
||||
import com.jsowell.thirdparty.platform.util.Cryptos;
|
||||
import com.jsowell.thirdparty.platform.util.GBSignUtils;
|
||||
import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
|
||||
import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils;
|
||||
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
||||
@@ -55,6 +55,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
@@ -78,14 +79,10 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
@Autowired
|
||||
private PileMerchantInfoService pileMerchantInfoService;
|
||||
@Autowired
|
||||
private ThirdPartyPlatformConfigService thirdPartyPlatformConfigService;
|
||||
@Autowired
|
||||
private PileConnectorInfoService pileConnectorInfoService;
|
||||
@Autowired
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
@Autowired
|
||||
private PileModelInfoService pileModelInfoService;
|
||||
@Autowired
|
||||
private PileBillingTemplateService pileBillingTemplateService;
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
@@ -222,7 +219,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
String stationId = String.valueOf(pileStationInfo.getId());
|
||||
stationInfo.setStationID(stationId);
|
||||
// MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
|
||||
stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码
|
||||
stationInfo.setOperatorID(Constants.OPERATORID_JIANG_SU); // 组织机构代码
|
||||
stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId()));
|
||||
stationInfo.setStationName(pileStationInfo.getStationName());
|
||||
stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()));
|
||||
@@ -243,7 +240,17 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// stationInfo.setServiceFee(); // 服务费 xx元/度
|
||||
stationInfo.setParkFree(Integer.valueOf(pileStationInfo.getParkFree()));
|
||||
stationInfo.setPayment(pileStationInfo.getPayment());
|
||||
stationInfo.setStationClassification(1);
|
||||
stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()));
|
||||
stationInfo.setStationStatus(Integer.valueOf(pileStationInfo.getStationStatus()));
|
||||
stationInfo.setParkNums(Integer.valueOf(pileStationInfo.getParkNums()));
|
||||
stationInfo.setRoundTheClock(Constants.ONE);
|
||||
stationInfo.setParkType("255");
|
||||
stationInfo.setElectricityType(1);
|
||||
stationInfo.setCapacity(pileStationInfo.getCapacity().setScale(2, RoundingMode.HALF_UP));
|
||||
stationInfo.setRatedPower(pileStationInfo.getRatedPower().setScale(1, RoundingMode.HALF_UP));
|
||||
stationInfo.setOfficialRunTime(DateUtils.dateTime(pileStationInfo.getCreateTime()));
|
||||
stationInfo.setVideoMonitor(0);
|
||||
|
||||
// stationInfo.setParkFeeType(pileStationInfo); // 停车收费类型
|
||||
stationInfo.setBusinessExpandType(Integer.parseInt(pileStationInfo.getAloneApply()));
|
||||
@@ -260,7 +267,15 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表
|
||||
}
|
||||
resultList.add(stationInfo);
|
||||
|
||||
// areaCodeCountryside
|
||||
GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress());
|
||||
if (geoCode != null) {
|
||||
String areaCodeCountryside = geoCode.getCounty_code();
|
||||
stationInfo.setAreaCodeCountryside(areaCodeCountryside);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("PageNo", pageInfo.getPageNum());
|
||||
map.put("PageCount", pageInfo.getPages());
|
||||
@@ -292,6 +307,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// 组装所需要的数据格式
|
||||
SupStationInfo info = SupStationInfo.builder()
|
||||
.stationID(stationId)
|
||||
.equipmentClassification(Constants.ONE)
|
||||
.generalApplicationType(2)
|
||||
.operatorID(operatorId)
|
||||
.stationName(pileStationInfo.getStationName())
|
||||
.periodFee(1) // 峰谷分时 0-否;1-是
|
||||
@@ -318,6 +335,9 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
.parkFree(Integer.valueOf(pileStationInfo.getParkFree()))
|
||||
.supportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()))
|
||||
.parkFeeType(0)
|
||||
.ratedPower(BigDecimal.ONE)//站点额定总功率
|
||||
.officialRunTime(DateUtils.dateTime(pileStationInfo.getCreateTime()))//正式投运时间
|
||||
.businessExpandType(1)//报装类型
|
||||
|
||||
.toiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag()))
|
||||
.storeFlag(Integer.valueOf(pileStationInfo.getStoreFlag()))
|
||||
@@ -334,20 +354,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// 只取最后一部分 330213
|
||||
String subAreaCode = split[split.length - 1];
|
||||
info.setAreaCode(subAreaCode);
|
||||
// 截取运营商组织机构代码(去除最后一位后的最后九位)
|
||||
String organizationCode = "";
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPlatformType)) {
|
||||
// 联联平台先使用自己运营商的组织机构代码
|
||||
organizationCode = Constants.OPERATORID_LIANLIAN;
|
||||
info.setEquipmentOwnerID(organizationCode);
|
||||
} else {
|
||||
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(pileStationInfo.getMerchantId()));
|
||||
organizationCode = merchantInfo.getOrganizationCode();
|
||||
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
|
||||
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||
info.setEquipmentOwnerID(equipmentOwnerId);
|
||||
}
|
||||
}
|
||||
|
||||
info.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
|
||||
|
||||
info.setPayment(StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment()));
|
||||
if (StringUtils.isNotBlank(pileStationInfo.getParkingNumber())) {
|
||||
@@ -361,7 +369,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
|
||||
// 容量
|
||||
if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) {
|
||||
info.setCapacity(pileStationInfo.getCapacity().setScale(4, RoundingMode.HALF_UP));
|
||||
info.setCapacity(pileStationInfo.getCapacity().setScale(2, RoundingMode.HALF_UP));
|
||||
}
|
||||
List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId);
|
||||
if (CollectionUtils.isNotEmpty(pileList)) {
|
||||
@@ -400,54 +408,37 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
public Map<String, String> queryStationStatus(QueryStationInfoDTO dto) {
|
||||
List<String> stationIds = dto.getStationIds();
|
||||
List<StationStatusInfo> StationStatusInfos = new ArrayList<>();
|
||||
List<Object> ConnectorStatusInfos = new ArrayList<>();
|
||||
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
|
||||
if (configInfo == null) {
|
||||
List<Object> connectorStatusInfos = new ArrayList<>();
|
||||
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType);
|
||||
if (thirdPartySecretInfoVO == null) {
|
||||
return null;
|
||||
}
|
||||
ConnectorStatusInfo connectorStatusInfo;
|
||||
for (String stationId : stationIds) {
|
||||
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(stationId);
|
||||
StationStatusInfo stationStatusInfo = new StationStatusInfo();
|
||||
stationStatusInfo.setStationId(stationId);
|
||||
stationStatusInfo.setOperatorId(Constants.OPERATORID_JIANG_SU);
|
||||
stationStatusInfo.setStationStatus(50);
|
||||
String equipmentOwnerID = ThirdPartyPlatformUtils.extractEquipmentOwnerID(pileMerchantInfoVO.getOrganizationCode());
|
||||
stationStatusInfo.setEquipmentOwnerId(equipmentOwnerID);
|
||||
// 根据站点id查询
|
||||
List<ConnectorInfoVO> list = pileConnectorInfoService.getConnectorListForLianLian(Long.parseLong(stationId));
|
||||
for (ConnectorInfoVO connectorInfoVO : list) {
|
||||
|
||||
connectorStatusInfo = new ConnectorStatusInfo();
|
||||
String connectorStatus = connectorInfoVO.getConnectorStatus();
|
||||
if (StringUtils.equals(connectorStatus, PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue())) {
|
||||
// 充电中
|
||||
ConnectorChargeStatusInfo info = new ConnectorChargeStatusInfo();
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(connectorInfoVO.getPileConnectorCode());
|
||||
if (orderBasicInfo == null) {
|
||||
continue;
|
||||
}
|
||||
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode());
|
||||
if (CollectionUtils.isNotEmpty(chargingRealTimeData)) {
|
||||
RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
|
||||
connectorStatusInfo.setEquipmentClassification(1);
|
||||
connectorStatusInfo.setStationId(stationId);
|
||||
connectorStatusInfo.setConnectorID(connectorInfoVO.getPileConnectorCode());
|
||||
connectorStatusInfo.setEquipmentOwnerId(equipmentOwnerID);
|
||||
connectorStatusInfo.setOperatorId(Constants.OPERATORID_JIANG_SU);
|
||||
connectorStatusInfo.setEquipmentId(connectorInfoVO.getPileSn());
|
||||
connectorStatusInfo.setStatus(Integer.parseInt(connectorStatus));
|
||||
connectorStatusInfo.setUpdateTime(DateUtils.getDateTime());
|
||||
|
||||
info.setStartChargeSeq(orderBasicInfo.getOrderCode());
|
||||
info.setConnectorID(orderBasicInfo.getPileConnectorCode());
|
||||
info.setConnectorStatus(Integer.valueOf(connectorInfoVO.getConnectorStatus()));
|
||||
info.setCurrentA(new BigDecimal(realTimeMonitorData.getOutputCurrent()));
|
||||
info.setVoltageA(new BigDecimal(realTimeMonitorData.getOutputVoltage()));
|
||||
info.setSoc(new BigDecimal(realTimeMonitorData.getSOC()));
|
||||
info.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime()));
|
||||
info.setEndTime(DateUtils.getDateTime()); // 本次采样时间
|
||||
info.setTotalPower(new BigDecimal(realTimeMonitorData.getChargingDegree())); // 累计充电量
|
||||
info.setTotalMoney(new BigDecimal(realTimeMonitorData.getChargingAmount()));
|
||||
|
||||
ConnectorStatusInfos.add(info);
|
||||
}
|
||||
} else {
|
||||
// 其他
|
||||
connectorStatusInfo = new ConnectorStatusInfo();
|
||||
connectorStatusInfo.setConnectorID(connectorInfoVO.getPileConnectorCode());
|
||||
connectorStatusInfo.setStatus(Integer.parseInt(connectorInfoVO.getConnectorStatus()));
|
||||
|
||||
ConnectorStatusInfos.add(connectorStatusInfo);
|
||||
}
|
||||
connectorStatusInfos.add(connectorStatusInfo);
|
||||
}
|
||||
stationStatusInfo.setConnectorStatusInfos(ConnectorStatusInfos);
|
||||
stationStatusInfo.setConnectorStatusInfos(connectorStatusInfos);
|
||||
StationStatusInfos.add(stationStatusInfo);
|
||||
}
|
||||
// 将 StationStatusInfos 分页
|
||||
@@ -458,20 +449,10 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
.limit(pageSize)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int total = StationStatusInfos.size();
|
||||
int pages = PageUtil.totalPage(total, pageSize);
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("Total", total);
|
||||
map.put("StationStatusInfos", collect);
|
||||
|
||||
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||
// 加密数据
|
||||
String encryptData = Cryptos.aesEncrypt(JSON.toJSONString(map), configInfo.getDataSecret(), configInfo.getDataSecretIv());
|
||||
resultMap.put("Data", encryptData);
|
||||
// 生成sig
|
||||
String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret());
|
||||
resultMap.put("Sig", resultSign);
|
||||
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@@ -514,7 +495,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
String dataSecret = secretInfoVO.getTheirDataSecret();
|
||||
String dataSecretIv = secretInfoVO.getTheirDataSecretIv();
|
||||
String urlAddress = secretInfoVO.getTheirUrlPrefix();
|
||||
String url = urlAddress + "supervise_notification_connector_status";
|
||||
String url = urlAddress + "supervise_notification_station_status";
|
||||
|
||||
String jsonString = JSON.toJSONString(info);
|
||||
// 获取令牌
|
||||
@@ -534,11 +515,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
public String notificationEquipChargeStatus(String orderCode) {
|
||||
// 根据订单号查询订单信息
|
||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
// 查询枪口状态
|
||||
PileConnectorInfoVO info = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(orderInfo.getPileConnectorCode());
|
||||
BigDecimal current = info.getCurrent() == null ? BigDecimal.ZERO : info.getCurrent();
|
||||
BigDecimal voltage = info.getVoltage() == null ? BigDecimal.ZERO : info.getVoltage();
|
||||
String soc = info.getSOC() == null ? Constants.ZERO : info.getSOC();
|
||||
// 查询相关配置信息
|
||||
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo();
|
||||
|
||||
@@ -549,35 +525,69 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
String dataSecretIv = guiZhouPlatformSecretInfo.getTheirDataSecretIv();
|
||||
String urlAddress = guiZhouPlatformSecretInfo.getTheirUrlPrefix();
|
||||
|
||||
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
|
||||
RealTimeMonitorData realTimeMonitorData;
|
||||
if (CollectionUtils.isEmpty(chargingRealTimeData)) {
|
||||
realTimeMonitorData = RealTimeMonitorData.builder()
|
||||
.chargingDegree("0")
|
||||
.build();
|
||||
chargingRealTimeData.add(realTimeMonitorData);
|
||||
} else {
|
||||
realTimeMonitorData = chargingRealTimeData.get(0);
|
||||
}
|
||||
|
||||
// 查询枪口状态
|
||||
PileConnectorInfoVO info = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(orderInfo.getPileConnectorCode());
|
||||
if (Objects.isNull(info)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_CONNECTOR_INFO_NULL_ERROR);
|
||||
}
|
||||
String merchantId = info.getMerchantId();
|
||||
MerchantInfoVO merchantInfoVO = pileMerchantInfoService.getMerchantInfoVO(merchantId);
|
||||
if (Objects.isNull(merchantInfoVO)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_CONNECTOR_INFO_NULL_ERROR);
|
||||
}
|
||||
String orderStatus = orderInfo.getOrderStatus();
|
||||
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderStatus)) {
|
||||
// 充电中
|
||||
orderStatus = "2";
|
||||
} else if (StringUtils.equals(OrderStatusEnum.ORDER_COMPLETE.getValue(), orderStatus)) {
|
||||
// 充电完成
|
||||
orderStatus = "4";
|
||||
}
|
||||
BigDecimal current = info.getCurrent() == null ? BigDecimal.ZERO : info.getCurrent();
|
||||
BigDecimal voltage = info.getVoltage() == null ? BigDecimal.ZERO : info.getVoltage();
|
||||
String soc = info.getSOC() == null ? Constants.ZERO : info.getSOC();
|
||||
|
||||
String dateTime = DateUtils.getDateTime();
|
||||
SupEquipChargeStatusInfo supEquipChargeStatusInfo = SupEquipChargeStatusInfo.builder()
|
||||
.operatorID(Constants.OPERATORID_JIANG_SU)
|
||||
.equipmentOwnerID(Constants.OPERATORID_JIANG_SU)
|
||||
.equipmentOwnerID(Constants.OPERATORID_GUI_ZHOU)
|
||||
.stationID(orderInfo.getStationId())
|
||||
.equipmentID(orderInfo.getPileSn())
|
||||
.startChargeSeqStat(Integer.parseInt(orderStatus))
|
||||
.connectorID(orderInfo.getPileConnectorCode())
|
||||
.orderNo(orderInfo.getOrderCode())
|
||||
.orderStatus(2)
|
||||
.equipmentClassification(1)
|
||||
.pushTimeStamp(dateTime)
|
||||
.connectorStatus(info.getStatus()) // 3-充电中
|
||||
.connectorStatus(3) // 3-充电中
|
||||
.currentA(current.setScale(1, BigDecimal.ROUND_HALF_UP))
|
||||
.voltageA(voltage.setScale(1, BigDecimal.ROUND_HALF_UP))
|
||||
.soc(new BigDecimal(soc))
|
||||
// .currentA(BigDecimal.ONE)
|
||||
// .voltageA(BigDecimal.ONE)
|
||||
// .soc(BigDecimal.ZERO)
|
||||
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()))
|
||||
.endTime(dateTime)
|
||||
.totalPower(info.getChargingDegree())
|
||||
.totalPower(new BigDecimal(realTimeMonitorData.getChargingDegree()))
|
||||
.eventTime(dateTime)
|
||||
.chargeVoltage(voltage.setScale(1, BigDecimal.ROUND_HALF_UP))
|
||||
.chargeCurrent(current.setScale(1, BigDecimal.ROUND_HALF_UP))
|
||||
.build();
|
||||
|
||||
// 查询运营商信息
|
||||
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(orderInfo.getStationId());
|
||||
String organizationCode = pileMerchantInfoVO.getOrganizationCode();
|
||||
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
|
||||
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||
supEquipChargeStatusInfo.setEquipmentOwnerID(equipmentOwnerId);
|
||||
supEquipChargeStatusInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
|
||||
if (StringUtils.isNotBlank(info.getSOC())) {
|
||||
supEquipChargeStatusInfo.setSoc(new BigDecimal(info.getSOC()));
|
||||
}
|
||||
|
||||
String url = urlAddress + "supervise_notification_equip_charge_status";
|
||||
@@ -621,19 +631,9 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// 拼装成平台所需格式对象
|
||||
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
|
||||
orderInfo.setOperatorID(operatorId);
|
||||
String equipmentOwnerID;
|
||||
if (MerchantUtils.isXiXiaoMerchant(orderBasicInfo.getMerchantId())) {
|
||||
equipmentOwnerID = Constants.OPERATORID_XI_XIAO;
|
||||
} else {
|
||||
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(orderInfo.getStationID());
|
||||
String organizationCode = pileMerchantInfoVO.getOrganizationCode();
|
||||
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
|
||||
equipmentOwnerID = ThirdPartyPlatformUtils.extractEquipmentOwnerID(pileMerchantInfoVO.getOrganizationCode());
|
||||
} else {
|
||||
equipmentOwnerID = Constants.OPERATORID_JIANG_SU;
|
||||
}
|
||||
}
|
||||
orderInfo.setEquipmentOwnerID(equipmentOwnerID);
|
||||
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
|
||||
orderInfo.setTotalServiceMoney(orderInfo.getTotalSeviceMoney());
|
||||
orderInfo.setTotalElecMoney(orderDetail.getTotalElectricityAmount());
|
||||
|
||||
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
|
||||
// 先将list按照 尖、峰、平、谷 时段排序
|
||||
@@ -664,27 +664,21 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// 根据订单号查询出信息
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
|
||||
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo();
|
||||
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
|
||||
String operatorId = guiZhouPlatformSecretInfo.getTheirOperatorId();
|
||||
String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret();
|
||||
String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret();
|
||||
String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret();
|
||||
String dataSecretIv = guiZhouPlatformSecretInfo.getTheirDataSecretIv();
|
||||
String urlAddress = guiZhouPlatformSecretInfo.getTheirUrlPrefix();
|
||||
String operatorId = Constants.OPERATORID_JIANG_SU;
|
||||
String operatorSecret = getGuiZhouPlatformSecretInfo().getTheirOperatorSecret();
|
||||
String signSecret = getGuiZhouPlatformSecretInfo().getTheirSigSecret();
|
||||
String dataSecret = getGuiZhouPlatformSecretInfo().getTheirDataSecret();
|
||||
String dataSecretIv = getGuiZhouPlatformSecretInfo().getTheirDataSecretIv();
|
||||
String urlAddress = getGuiZhouPlatformSecretInfo().getTheirUrlPrefix();
|
||||
|
||||
String url = urlAddress + "supervise_notification_charge_order_info_history";
|
||||
|
||||
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
|
||||
orderInfo.setOperatorID(operatorId);
|
||||
String equipmentOwnerID;
|
||||
if (MerchantUtils.isXiXiaoMerchant(orderBasicInfo.getMerchantId())) {
|
||||
equipmentOwnerID = Constants.OPERATORID_XI_XIAO;
|
||||
} else {
|
||||
equipmentOwnerID = Constants.OPERATORID_LIANLIAN;
|
||||
}
|
||||
orderInfo.setEquipmentOwnerID(equipmentOwnerID);
|
||||
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
|
||||
|
||||
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
|
||||
// 先将list按照 尖、峰、平、谷 时段排序
|
||||
@@ -699,9 +693,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
return null;
|
||||
}
|
||||
// 调用联联平台接口
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("ChargeOrderInfo", orderInfo);
|
||||
String jsonString = JSON.toJSONString(json);
|
||||
String jsonString = JSON.toJSONString(orderInfo);
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
return result;
|
||||
}
|
||||
@@ -714,17 +706,11 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
*/
|
||||
@Override
|
||||
public String notificationOperationStatsInfo(String stationId) {
|
||||
SupStationStatsInfo.
|
||||
EquipmentStatsInfo equipmentStatsInfo = new SupStationStatsInfo.EquipmentStatsInfo();
|
||||
List<SupStationStatsInfo.
|
||||
EquipmentStatsInfo> equipmentStatsInfoList = new ArrayList<>();
|
||||
SupStationStatsInfo.EquipmentStatsInfo equipmentStatsInfo = new SupStationStatsInfo.EquipmentStatsInfo();
|
||||
List<SupStationStatsInfo.EquipmentStatsInfo> equipmentStatsInfoList = new ArrayList<>();
|
||||
|
||||
SupStationStatsInfo.
|
||||
EquipmentStatsInfo.
|
||||
ConnectorStatsInfo connectorStatsInfo = null;
|
||||
List<SupStationStatsInfo.
|
||||
EquipmentStatsInfo.
|
||||
ConnectorStatsInfo> connectorStatsInfoList = new ArrayList<>();
|
||||
SupStationStatsInfo.EquipmentStatsInfo.ConnectorStatsInfo connectorStatsInfo = null;
|
||||
List<SupStationStatsInfo.EquipmentStatsInfo.ConnectorStatsInfo> connectorStatsInfoList = new ArrayList<>();
|
||||
|
||||
// 根据站点id查询订单记录 (新建Service方法)
|
||||
List<SupStationStatsVO> orderVOS = orderBasicInfoService.queryOrderListByStationId(stationId);
|
||||
@@ -733,13 +719,12 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
int stationChargeTime = Constants.zero; // 充电站累计充电次数
|
||||
for (SupStationStatsVO orderVO : orderVOS) {
|
||||
// 充电站累计用电量
|
||||
BigDecimal totalPower = orderVO.getTotalPower();
|
||||
if (totalPower == null || orderVO.getChargingTime() == null) {
|
||||
continue;
|
||||
}
|
||||
BigDecimal totalPower = (orderVO.getTotalPower() != null) ? orderVO.getTotalPower() : BigDecimal.ZERO;
|
||||
Integer chargingTime = (orderVO.getChargingTime() != null) ? orderVO.getChargingTime() : Constants.zero;
|
||||
|
||||
stationTotalElectricity = stationTotalElectricity.add(totalPower);
|
||||
// 充电站累计充电时长(分钟)
|
||||
stationChargeTime += orderVO.getChargingTime();
|
||||
stationChargeTime += chargingTime;
|
||||
}
|
||||
|
||||
// 根据枪口排序,分组,将充电时长和充电量累加
|
||||
@@ -761,7 +746,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// key : pileConnectorCode
|
||||
// value: SupStationStatsVO
|
||||
for (Map.Entry<String, SupStationStatsVO> entry : sortedMap.entrySet()) {
|
||||
|
||||
String pileConnectorCode = entry.getKey();
|
||||
SupStationStatsVO vo = entry.getValue();
|
||||
|
||||
@@ -771,9 +755,9 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
connectorStatsInfo.setConnectorId(pileConnectorCode);
|
||||
|
||||
connectorStatsInfo.setEquipmentClassification(1);
|
||||
connectorStatsInfo.setConnectorElectricity(vo.getTotalPower());
|
||||
connectorStatsInfo.setConnectorTotalChargeTime(vo.getChargingTime());
|
||||
// TODO connectorStatsInfo.setConnectorTotalChargeNum();
|
||||
connectorStatsInfo.setConnectorElectricity((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
|
||||
connectorStatsInfo.setConnectorTotalChargeTime((vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero);
|
||||
connectorStatsInfo.setConnectorTotalChargeNum(orderVOS.size());
|
||||
connectorStatsInfo.setConnectorTotalWarningNum(0);
|
||||
|
||||
// 对比这次循环到的桩编号和上次的桩编号,如果是同一台桩,将数据进行汇总,如果不是,新建桩数据,并将之前的累计数据清0
|
||||
@@ -788,21 +772,21 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
|
||||
equipmentStatsInfo.setEquipmentId(pileSn);
|
||||
equipmentStatsInfo.setEquipmentClassification(1);
|
||||
equipmentStatsInfo.setEquipmentElectricity(vo.getTotalPower());
|
||||
equipmentStatsInfo.setEquipmentTotalChargeTime(vo.getChargingTime());
|
||||
// TODO equipmentStatsInfo.setEquipmentTotalChargeNum();
|
||||
equipmentStatsInfo.setEquipmentElectricity((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
|
||||
equipmentStatsInfo.setEquipmentTotalChargeTime((vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero);
|
||||
equipmentStatsInfo.setEquipmentTotalChargeNum(orderVOS.size());
|
||||
equipmentStatsInfo.setEquipmentTotalWarningNum(0);
|
||||
|
||||
pileTotalPower = pileTotalPower.add(vo.getTotalPower());
|
||||
pileChargeTime += vo.getChargingTime();
|
||||
pileTotalPower = pileTotalPower.add((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
|
||||
pileChargeTime += (vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero;
|
||||
|
||||
connectorStatsInfoList.add(connectorStatsInfo);
|
||||
equipmentStatsInfo.setConnectorStatsInfos(connectorStatsInfoList);
|
||||
equipmentStatsInfoList.add(equipmentStatsInfo);
|
||||
} else {
|
||||
// 同一台桩,枪口号不同,累加桩数据,将枪口数据新建
|
||||
|
||||
pileTotalPower = pileTotalPower.add(vo.getTotalPower());
|
||||
pileChargeTime += vo.getChargingTime();
|
||||
pileTotalPower = pileTotalPower.add((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
|
||||
pileChargeTime += (vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero;
|
||||
|
||||
equipmentStatsInfo.setEquipmentElectricity(pileTotalPower); // 第一次判断时一定不会进入到这里,所以不用判断 equipmentStatsInfo 是否为 null
|
||||
equipmentStatsInfo.setEquipmentTotalChargeTime(pileChargeTime);
|
||||
@@ -811,7 +795,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
equipmentStatsInfo.setConnectorStatsInfos(connectorStatsInfoList);
|
||||
equipmentStatsInfoList.add(equipmentStatsInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 创建对象
|
||||
@@ -830,7 +813,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
.stationTotalChargeTime(stationChargeTime)
|
||||
.stationTotalWarningNum(0)
|
||||
.equipmentStatsInfos(equipmentStatsInfoList)
|
||||
|
||||
.equipmentOwnerId(Constants.OPERATORID_GUI_ZHOU)
|
||||
.build();
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("StationStatsInfos", supStationStatsInfo);
|
||||
@@ -855,37 +838,31 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 推送充换电站实时功率 supervise_notification_realtime_power_info
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String notificationPowerInfo(List<String> stationIds) {
|
||||
com.jsowell.thirdparty.platform.common.SupStationPowerInfo supStationPowerInfo = null;
|
||||
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo> list = new ArrayList<>();
|
||||
String dateTimeNow = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||
|
||||
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo> supPileInfoList = null;
|
||||
com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo supPileInfo = null;
|
||||
|
||||
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo> connectorPowerInfoList;
|
||||
com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo connectorPowerInfo;
|
||||
for (String stationId : stationIds) {
|
||||
BigDecimal stationPower = BigDecimal.ZERO;
|
||||
supStationPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo();
|
||||
com.jsowell.thirdparty.platform.common.SupStationPowerInfo supStationPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo();
|
||||
|
||||
supStationPowerInfo.setOperatorID(Constants.OPERATORID_JIANG_SU);
|
||||
supStationPowerInfo.setStationId(stationId);
|
||||
supStationPowerInfo.setDataTime(dateTimeNow);
|
||||
supStationPowerInfo.setStationClassification(Constants.one);
|
||||
supStationPowerInfo.setStationRealTimePower(stationPower);
|
||||
|
||||
// 查询运营商基本信息
|
||||
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(stationId);
|
||||
String organizationCode = pileMerchantInfoVO.getOrganizationCode();
|
||||
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
|
||||
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||
supStationPowerInfo.setEquipmentOwnerID(equipmentOwnerId);
|
||||
} else {
|
||||
supStationPowerInfo.setEquipmentOwnerID(Constants.OPERATORID_JIANG_SU);
|
||||
supStationPowerInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
|
||||
}
|
||||
|
||||
// 根据站点id查询桩信息
|
||||
@@ -894,6 +871,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
logger.error("推送充换电站实时功率 error, 查询桩列表信息为空");
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
|
||||
}
|
||||
|
||||
// 将桩id筛选出来用于批量查询枪口数据
|
||||
List<Long> pileIds = pileList.stream()
|
||||
.map(PileBasicInfo::getId)
|
||||
@@ -905,20 +883,22 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
logger.error("推送充换电站实时功率 error, 查询枪口列表信息为空");
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
|
||||
}
|
||||
supPileInfoList = new ArrayList<>();
|
||||
|
||||
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo> supPileInfoList = new ArrayList<>();
|
||||
for (PileBasicInfo pileBasicInfo : pileList) {
|
||||
supPileInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo();
|
||||
com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo supPileInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo();
|
||||
supPileInfo.setEquipmentID(pileBasicInfo.getSn());
|
||||
supPileInfo.setEquipmentClassification(Constants.one);
|
||||
supPileInfo.setDataTime(dateTimeNow);
|
||||
supPileInfo.setEquipRealTimePower(BigDecimal.ZERO);
|
||||
BigDecimal pileInstantPower = BigDecimal.ZERO;
|
||||
connectorPowerInfoList = new ArrayList<>();
|
||||
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo> connectorPowerInfoList = new ArrayList<>();
|
||||
for (PileConnectorInfoVO pileConnectorInfoVO : connectorList) {
|
||||
if (!StringUtils.equals(pileBasicInfo.getSn(), pileConnectorInfoVO.getPileSn())) {
|
||||
continue;
|
||||
}
|
||||
BigDecimal instantPower = pileConnectorInfoVO.getInstantPower() == null ? BigDecimal.ZERO : pileConnectorInfoVO.getInstantPower();
|
||||
connectorPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo();
|
||||
com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo connectorPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo();
|
||||
connectorPowerInfo.setConnectorID(pileConnectorInfoVO.getPileConnectorCode());
|
||||
connectorPowerInfo.setEquipmentClassification(Constants.one);
|
||||
connectorPowerInfo.setDataTime(dateTimeNow);
|
||||
@@ -933,16 +913,17 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
// 桩实时功率
|
||||
supPileInfo.setEquipRealTimePower(pileInstantPower);
|
||||
stationPower = stationPower.add(pileInstantPower);
|
||||
|
||||
supPileInfoList.add(supPileInfo);
|
||||
}
|
||||
supStationPowerInfo.setEquipmentPowerInfos(supPileInfoList);
|
||||
supStationPowerInfo.setStationRealTimePower(stationPower);
|
||||
list.add(supStationPowerInfo);
|
||||
}
|
||||
list.add(supStationPowerInfo);
|
||||
|
||||
// 获取推送配置密钥信息
|
||||
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo();
|
||||
|
||||
String operatorId = guiZhouPlatformSecretInfo.getTheirOperatorId();
|
||||
String operatorId = guiZhouPlatformSecretInfo.getOurOperatorId();
|
||||
String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret();
|
||||
String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret();
|
||||
String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret();
|
||||
@@ -987,18 +968,24 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
* @return
|
||||
*/
|
||||
private ChargeOrderInfo transformChargeOrderInfo(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) {
|
||||
DecimalFormat df2 = new DecimalFormat("#.######");
|
||||
BigDecimal totalPower = new BigDecimal(df2.format(orderDetail.getTotalUsedElectricity()));
|
||||
totalPower = totalPower.setScale(4, RoundingMode.HALF_UP);
|
||||
|
||||
ChargeOrderInfo chargeOrderInfo = ChargeOrderInfo.builder()
|
||||
.operatorID(Constants.OPERATORID_JIANG_SU)
|
||||
.stationID(orderBasicInfo.getStationId())
|
||||
.equipmentID(orderBasicInfo.getPileSn())
|
||||
.orderNo(orderBasicInfo.getOrderCode())
|
||||
.connectorID(orderBasicInfo.getPileConnectorCode())
|
||||
.equipmentClassification(1)
|
||||
.licensePlate(orderBasicInfo.getPlateNumber())
|
||||
.vin(orderBasicInfo.getVinCode())
|
||||
.startSOC(orderBasicInfo.getStartSoc())
|
||||
.endSOC(orderBasicInfo.getEndSoc())
|
||||
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime()))
|
||||
.endTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeEndTime()))
|
||||
.totalPower(orderDetail.getTotalUsedElectricity())
|
||||
.totalPower(totalPower)
|
||||
.cuspElect(orderDetail.getSharpUsedElectricity())
|
||||
.peakElect(orderDetail.getSharpUsedElectricity())
|
||||
.flatElect(orderDetail.getFlatUsedElectricity())
|
||||
@@ -1006,8 +993,9 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
.pushTimeStamp(DateUtils.getDateTime())
|
||||
.totalElecMoney(orderDetail.getTotalElectricityAmount())
|
||||
.totalSeviceMoney(orderDetail.getTotalServiceAmount())
|
||||
.totalServiceMoney(orderDetail.getTotalServiceAmount())
|
||||
.totalMoney(orderDetail.getTotalOrderAmount())
|
||||
.stopReason(0)
|
||||
.stopReason(2)
|
||||
.stopDesc(orderBasicInfo.getReason()) // TODO 停止原因
|
||||
.sumPeriod(0)
|
||||
.build();
|
||||
@@ -1028,8 +1016,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
detail = new SupChargeDetails();
|
||||
if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.SHARP.getValue())) {
|
||||
// 尖时段
|
||||
detail.setDetailStartTime(billingPriceVO.getStartTime());
|
||||
detail.setDetailEndTime(billingPriceVO.getEndTime());
|
||||
detail.setDetailStartTime(DateUtils.getDateTime());
|
||||
detail.setDetailEndTime(DateUtils.getDateTime());
|
||||
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setDetailPower(orderDetail.getSharpUsedElectricity());
|
||||
@@ -1037,8 +1025,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
detail.setDetailSeviceMoney(orderDetail.getSharpServicePrice());
|
||||
} else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.PEAK.getValue())) {
|
||||
// 峰时段
|
||||
detail.setDetailStartTime(billingPriceVO.getStartTime());
|
||||
detail.setDetailEndTime(billingPriceVO.getEndTime());
|
||||
detail.setDetailStartTime(DateUtils.getDateTime());
|
||||
detail.setDetailEndTime(DateUtils.getDateTime());
|
||||
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setDetailPower(orderDetail.getPeakUsedElectricity());
|
||||
@@ -1046,8 +1034,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
detail.setDetailSeviceMoney(orderDetail.getPeakServicePrice());
|
||||
} else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.FLAT.getValue())) {
|
||||
// 平时段
|
||||
detail.setDetailStartTime(billingPriceVO.getStartTime());
|
||||
detail.setDetailEndTime(billingPriceVO.getEndTime());
|
||||
detail.setDetailStartTime(DateUtils.getDateTime());
|
||||
detail.setDetailEndTime(DateUtils.getDateTime());
|
||||
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setDetailPower(orderDetail.getFlatUsedElectricity());
|
||||
@@ -1055,8 +1043,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
|
||||
detail.setDetailSeviceMoney(orderDetail.getFlatServicePrice());
|
||||
} else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.VALLEY.getValue())) {
|
||||
// 谷时段
|
||||
detail.setDetailStartTime(billingPriceVO.getStartTime());
|
||||
detail.setDetailEndTime(billingPriceVO.getEndTime());
|
||||
detail.setDetailStartTime(DateUtils.getDateTime());
|
||||
detail.setDetailEndTime(DateUtils.getDateTime());
|
||||
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setDetailPower(orderDetail.getValleyUsedElectricity());
|
||||
|
||||
Reference in New Issue
Block a user