mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-25 13:35:15 +08:00
Merge branch 'dev-new' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev-new
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.AreaCodeInfo;
|
||||
|
||||
/**
|
||||
* 中国行政地区Service接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2024-12-20
|
||||
*/
|
||||
public interface IAreaCodeInfoService {
|
||||
/**
|
||||
* 查询中国行政地区
|
||||
*
|
||||
* @param id 中国行政地区主键
|
||||
* @return 中国行政地区
|
||||
*/
|
||||
public AreaCodeInfo selectAreaCodeInfoById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询中国行政地区列表
|
||||
*
|
||||
* @param areaCodeInfo 中国行政地区
|
||||
* @return 中国行政地区集合
|
||||
*/
|
||||
public List<AreaCodeInfo> selectAreaCodeInfoList(AreaCodeInfo areaCodeInfo);
|
||||
|
||||
/**
|
||||
* 新增中国行政地区
|
||||
*
|
||||
* @param areaCodeInfo 中国行政地区
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAreaCodeInfo(AreaCodeInfo areaCodeInfo);
|
||||
|
||||
/**
|
||||
* 修改中国行政地区
|
||||
*
|
||||
* @param areaCodeInfo 中国行政地区
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAreaCodeInfo(AreaCodeInfo areaCodeInfo);
|
||||
|
||||
/**
|
||||
* 批量删除中国行政地区
|
||||
*
|
||||
* @param ids 需要删除的中国行政地区主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAreaCodeInfoByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 删除中国行政地区信息
|
||||
*
|
||||
* @param id 中国行政地区主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAreaCodeInfoById(Integer id);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.alipay.api.domain.ChargeOrderInfo;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.jsowell.adapay.response.PaymentReverseResponse;
|
||||
import com.jsowell.adapay.vo.OrderSplitResult;
|
||||
@@ -476,6 +477,12 @@ public interface OrderBasicInfoService{
|
||||
*/
|
||||
void createReservationOrder(ReservationChargingStartupResult chargingStartupResult);
|
||||
|
||||
/**
|
||||
* 查询第三方平台订单列表
|
||||
* @param dto
|
||||
*/
|
||||
List<OrderVO> selectThirdPartyOrderList(QueryStartChargeDTO dto);
|
||||
|
||||
|
||||
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 后管小程序 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||
/**
|
||||
|
||||
@@ -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<PileDetailInfoVO> getPileDetailInfoList(String stationId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jsowell.pile.mapper.AreaCodeInfoMapper;
|
||||
import com.jsowell.pile.domain.AreaCodeInfo;
|
||||
import com.jsowell.pile.service.IAreaCodeInfoService;
|
||||
|
||||
/**
|
||||
* 中国行政地区Service业务层处理
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2024-12-20
|
||||
*/
|
||||
@Service
|
||||
public class AreaCodeInfoServiceImpl implements IAreaCodeInfoService {
|
||||
@Autowired
|
||||
private AreaCodeInfoMapper areaCodeInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询中国行政地区
|
||||
*
|
||||
* @param id 中国行政地区主键
|
||||
* @return 中国行政地区
|
||||
*/
|
||||
@Override
|
||||
public AreaCodeInfo selectAreaCodeInfoById(Integer id) {
|
||||
return areaCodeInfoMapper.selectAreaCodeInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询中国行政地区列表
|
||||
*
|
||||
* @param areaCodeInfo 中国行政地区
|
||||
* @return 中国行政地区
|
||||
*/
|
||||
@Override
|
||||
public List<AreaCodeInfo> selectAreaCodeInfoList(AreaCodeInfo areaCodeInfo) {
|
||||
return areaCodeInfoMapper.selectAreaCodeInfoList(areaCodeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增中国行政地区
|
||||
*
|
||||
* @param areaCodeInfo 中国行政地区
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAreaCodeInfo(AreaCodeInfo areaCodeInfo) {
|
||||
return areaCodeInfoMapper.insertAreaCodeInfo(areaCodeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改中国行政地区
|
||||
*
|
||||
* @param areaCodeInfo 中国行政地区
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAreaCodeInfo(AreaCodeInfo areaCodeInfo) {
|
||||
return areaCodeInfoMapper.updateAreaCodeInfo(areaCodeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除中国行政地区
|
||||
*
|
||||
* @param ids 需要删除的中国行政地区主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAreaCodeInfoByIds(Integer[] ids) {
|
||||
return areaCodeInfoMapper.deleteAreaCodeInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除中国行政地区信息
|
||||
*
|
||||
* @param id 中国行政地区主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAreaCodeInfoById(Integer id) {
|
||||
return areaCodeInfoMapper.deleteAreaCodeInfoById(id);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.jsowell.pile.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alipay.api.domain.ChargeOrderInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -1907,6 +1908,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
orderBasicInfo.setChargeStartTime(DateUtils.parseDate(data.getStartTime()));
|
||||
// 充电结束时间
|
||||
orderBasicInfo.setChargeEndTime(DateUtils.parseDate(data.getEndTime()));
|
||||
// 停止原因码
|
||||
orderBasicInfo.setStopReasonCode("0x" + data.getStopReasonCode());
|
||||
// 停止原因
|
||||
orderBasicInfo.setReason(data.getStopReasonMsg());
|
||||
// 结算时间
|
||||
@@ -2593,7 +2596,18 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
*/
|
||||
@Override
|
||||
public List<AccumulativeInfoVO> getAccumulativeInfoForLianLian(QueryStationInfoDTO dto) {
|
||||
return orderBasicInfoMapper.getAccumulativeInfoForLianLian(dto);
|
||||
List<AccumulativeInfoVO> accumulativeInfoList = orderBasicInfoMapper.getAccumulativeInfoForLianLian(dto);
|
||||
for (AccumulativeInfoVO accumulativeInfoVO : accumulativeInfoList) {
|
||||
String startTime = accumulativeInfoVO.getStartTime();
|
||||
String endTime = accumulativeInfoVO.getEndTime();
|
||||
if (startTime == null || endTime == null) {
|
||||
continue;
|
||||
}
|
||||
// 计算充电时长
|
||||
int chargingTime = Integer.parseInt(String.valueOf(DateUtils.intervalTime(startTime, endTime))) * 60;
|
||||
accumulativeInfoVO.setChargingTime(String.valueOf(chargingTime));
|
||||
}
|
||||
return accumulativeInfoList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4097,6 +4111,15 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
orderPayRecordService.batchInsert(Lists.newArrayList(principalPayRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询第三方平订单列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OrderVO> selectThirdPartyOrderList(QueryStartChargeDTO dto) {
|
||||
return orderBasicInfoMapper.selectThirdPartyOrderList(dto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.jsowell.pile.service.impl;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.PersonalChargingRecord;
|
||||
import com.jsowell.pile.domain.PileBasicInfo;
|
||||
@@ -130,7 +131,10 @@ public class PersonalChargingRecordServiceImpl implements PersonalChargingRecord
|
||||
chargingRecord.setValleyUsedElectricity(valleyUsedElectricity);
|
||||
BigDecimal totalUsedElectricity = sharpUsedElectricity.add(peakUsedElectricity).add(flatUsedElectricity).add(valleyUsedElectricity);
|
||||
chargingRecord.setTotalUsedElectricity(totalUsedElectricity);
|
||||
chargingRecord.setReason(data.getStopReasonMsg());
|
||||
chargingRecord.setStopReasonCode("0x" + data.getStopReasonCode());
|
||||
if (StringUtils.isNotBlank(data.getStopReasonMsg())) {
|
||||
chargingRecord.setReason(data.getStopReasonMsg());
|
||||
}
|
||||
// 创建或更新
|
||||
this.insertOrUpdateSelective(chargingRecord);
|
||||
}
|
||||
|
||||
@@ -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,35 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
public List<EquipmentInfo> getPileListForLianLian(String stationId) {
|
||||
List<EquipmentInfo> resultList = new ArrayList<>();
|
||||
// 通过站点id查询桩基本信息
|
||||
List<PileBasicInfo> list = this.getPileListByStationId(stationId);
|
||||
List<PileDetailInfoVO> 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<String, String> pileStatus = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileBasicInfo.getSn()));
|
||||
Map<String, String> 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));
|
||||
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<ConnectorInfo> connectorList = getConnectorListForLianLian(pileSn);
|
||||
List<ConnectorInfo> connectorList = getConnectorListForLianLian(pileDetailInfoVO);
|
||||
equipmentInfo.setConnectorInfos(connectorList);
|
||||
|
||||
resultList.add(equipmentInfo);
|
||||
@@ -1276,6 +1261,25 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PileDetailInfoVO> getPileDetailInfoList(String stationId) {
|
||||
List<PileDetailInfoVO> pileDetailInfoList = pileBasicInfoMapper.getPileDetailInfoList(stationId);
|
||||
if (CollectionUtils.isEmpty(pileDetailInfoList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<String> pileSnList = pileDetailInfoList.stream()
|
||||
.map(PileDetailInfoVO::getPileSn)
|
||||
.collect(Collectors.toList());
|
||||
Map<String, String> pileStatusV2 = pileConnectorInfoService.getPileStatus(pileSnList);
|
||||
pileDetailInfoList.forEach(pileDetailInfoVO -> {
|
||||
String pileSn = pileDetailInfoVO.getPileSn();
|
||||
if (pileStatusV2.containsKey(pileSn)) {
|
||||
pileDetailInfoVO.setPileStatus(pileStatusV2.get(pileSn));
|
||||
}
|
||||
});
|
||||
return pileDetailInfoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取枪口列表
|
||||
*
|
||||
@@ -1357,6 +1361,43 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
public List<ConnectorInfo> getConnectorListForLianLian(PileDetailInfoVO pileDetailInfoVO) {
|
||||
List<ConnectorInfo> resultList = new ArrayList<>();
|
||||
|
||||
List<PileConnectorInfo> 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<ZDLEquipmentInfo> getPileListForZDL(String stationId) {
|
||||
List<ZDLEquipmentInfo> resultList = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user