This commit is contained in:
2023-07-17 14:30:53 +08:00
parent eb69602e21
commit 2587110cc2
8 changed files with 53 additions and 75 deletions

View File

@@ -49,4 +49,33 @@ public class ZipUtil {
File zipFileFromImages = ZipUtil.createZipFileFromImages(list);
System.out.println(zipFileFromImages);
}
/**
* 删除指定文件夹下的所有文件
* @param path
* @return
*/
public static boolean delAllFile(String path) {
boolean flag = false;
File file = new File(path);
if (!file.exists()) {
return flag;
}
if (!file.isDirectory()) {
return flag;
}
String[] tempList = file.list();
File temp = null;
for (int i = 0; i < tempList.length; i++) {
if (path.endsWith(File.separator)) {
temp = new File(path + tempList[i]);
} else {
temp = new File(path + File.separator + tempList[i]);
}
if (temp.isFile()) {
temp.delete();
}
}
return flag;
}
}

View File

@@ -63,20 +63,6 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
// 将此桩正在进行充电的订单状态改为 异常
orderBasicInfoService.updateOrderStatusAsAbnormal(pileSn);
// List<OrderListVO> orderListVOS = orderBasicInfoService.selectChargingOrder(pileSn);
// if (CollectionUtils.isNotEmpty(orderListVOS)) {
// for (OrderListVO orderListVO : orderListVOS) {
// if (StringUtils.equals(orderListVO.getOrderStatus(), OrderStatusEnum.IN_THE_CHARGING.getValue())) {
// // 修改数据库订单状态
// OrderBasicInfo info = OrderBasicInfo.builder()
// .id(Long.parseLong(orderListVO.getId()))
// .orderStatus(OrderStatusEnum.ABNORMAL.getValue())
// .build();
// orderBasicInfoService.updateOrderBasicInfo(info);
// log.info("充电桩:{}退出, 修改充电桩正在充电的订单状态为异常, orderCode: {}", pileSn, orderListVO.getOrderCode());
// }
// }
// }
// 记录充电桩退出msg
// 保存报文
@@ -84,10 +70,6 @@ public class YKCBusinessServiceImpl implements YKCBusinessService {
String jsonMsg = YKCFrameTypeCode.PILE_LOG_OUT.getValue();
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, "");
// 自动重启 发送重启指令
// RebootCommand command = RebootCommand.builder().pileSn(pileSn).build();
// ykcPushCommandService.pushRebootCommand(command);
// 删除桩编号和channel的关系
PileChannelEntity.removeByPileSn(pileSn);
}

View File

@@ -57,22 +57,6 @@ public interface PileConnectorInfoMapper {
*/
public int updatePileConnectorInfo(PileConnectorInfo pileConnectorInfo);
/**
* 删除充电桩枪口信息
*
* @param id 充电桩枪口信息主键
* @return 结果
*/
// public int deletePileConnectorInfoById(Integer id);
/**
* 批量删除充电桩枪口信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
// public int deletePileConnectorInfoByIds(Integer[] ids);
/**
* 根据充电桩编号删除充电桩枪口信息
* @param pileSnList

View File

@@ -2171,27 +2171,6 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
orderInfo.setPayTime(new Date());
this.updateOrderBasicInfo(orderInfo);
// 如果是鉴权卡启动或者vin启动不发启动充电指令
// if (!(StringUtils.equals(dto.getStartMode(), StartModeEnum.AUTH_CARD.getValue())
// || StringUtils.equals(dto.getStartMode(), StartModeEnum.VIN_CODE.getValue()))) {
//
// if (StringUtils.equals(orderInfo.getStartType(), StartTypeEnum.NOW.getValue())) { // 立即启动充电
// String pileSn = orderInfo.getPileSn();
// // 发送启动充电指令前,再次下发计费模板
// BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
// if (billingTemplateVO != null) {
// pileRemoteService.publishPileBillingTemplate(pileSn, billingTemplateVO);
// }
// // 发送启动指令
// pileRemoteService.remoteStartCharging(pileSn, orderInfo.getConnectorCode(), orderInfo.getTransactionCode(), orderInfo.getPayAmount());
// } else { // 预约充电
// // 修改枪口状态为 占用预约
//
// // 下发修改充电桩设置指令
//
// }
// }
// 是否发送启动指令
boolean sendStartCharging = true;

View File

@@ -21,6 +21,11 @@ public class ConnectorInfoVO {
*/
private String stationId;
/**
* 充电桩编号
*/
private String pileSn;
/**
* 枪口号
*/

View File

@@ -140,7 +140,7 @@
t1.id as connectorId,
t1.station_id as stationId,
t1.sn as pileSn,
t2.pile_connector_code as connectorCode,
t2.pile_connector_code as pileConnectorCode,
t2.status,
t1.merchant_id as merchantId,
t3.merchant_name as merchantName
@@ -226,8 +226,8 @@
t1.pile_connector_code as pileConnectorCode,
t2.station_id as stationId,
t1.STATUS as connectorStatus,
t1.pile_sn,
t2.model_id,
t1.pile_sn as pileSn,
t2.model_id as modelId,
t3.speed_type as chargingType,
t3.rated_power as ratedPower
FROM

View File

@@ -25,11 +25,11 @@ public interface AMapService {
/**
* 商家推送充电设备动态数据
* @param pileConnectorCode
* @param stationId
* @return
* @throws Exception
*/
String pushChargingDeviceDynamics(String pileConnectorCode) throws Exception;
String pushChargingDeviceDynamics(String stationId) throws Exception;
/**
* 商家推送充电订单信息

View File

@@ -6,7 +6,6 @@ import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.PageUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.spring.SpringUtils;
@@ -18,7 +17,6 @@ import com.jsowell.pile.service.*;
import com.jsowell.pile.vo.base.ConnectorInfoVO;
import com.jsowell.pile.vo.base.PileInfoVO;
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
import com.jsowell.pile.vo.uniapp.PileConnectorDetailVO;
import com.jsowell.pile.vo.web.BillingDetailVO;
import com.jsowell.pile.vo.web.BillingTemplateVO;
import com.jsowell.pile.vo.web.PileModelInfoVO;
@@ -344,25 +342,26 @@ public class AMapServiceImpl implements AMapService {
/**
* 商家推送充电设备动态数据
* @param pileConnectorCode
* @param stationId 充电站id
* @return
* @throws Exception
*/
@Override
public String pushChargingDeviceDynamics(String pileConnectorCode) throws Exception {
public String pushChargingDeviceDynamics(String stationId) throws Exception {
// 根据枪口号查出桩信息
PileConnectorDetailVO pileConnectorDetailVO = pileBasicInfoService.queryPileConnectorDetail(pileConnectorCode);
if (pileConnectorDetailVO == null) {
throw new BusinessException("", "");
}
String stationId = pileConnectorDetailVO.getStationId();
Map<String, Integer> pileNumMap = pileConnectorInfoService.getPileTypeNum(Long.parseLong(stationId));
AMapConnectorStatusInfo info = new AMapConnectorStatusInfo();
info.setConnectorID(pileConnectorCode);
info.setEquipmentID(pileConnectorDetailVO.getPileSn());
info.setStatus(pileConnectorDetailVO.getConnectorStatus());
// 根据站点id查询枪口信息
List<AMapConnectorStatusInfo> connectorStatusInfoList = Lists.newArrayList();
AMapConnectorStatusInfo info;
List<ConnectorInfoVO> connectorList = pileConnectorInfoService.getUniAppConnectorList(Long.parseLong(stationId));
for (ConnectorInfoVO connectorInfoVO : connectorList) {
info = new AMapConnectorStatusInfo();
info.setConnectorID(connectorInfoVO.getPileConnectorCode());
info.setEquipmentID(connectorInfoVO.getPileSn());
info.setStatus(connectorInfoVO.getConnectorStatus());
connectorStatusInfoList.add(info);
}
// 拼装业务参数
JSONObject json = new JSONObject();
@@ -371,7 +370,7 @@ public class AMapServiceImpl implements AMapService {
json.put("fast_total", pileNumMap.get("fastTotal"));
json.put("slow_free", pileNumMap.get("slowFree"));
json.put("slow_total", pileNumMap.get("slowTotal"));
json.put("connectorStatusInfo", info);
json.put("connectorStatusInfo", connectorStatusInfoList);
String SPI = "amap.charging.pushStationStatus";