diff --git a/jsowell-common/src/main/java/com/jsowell/common/util/ZipUtil.java b/jsowell-common/src/main/java/com/jsowell/common/util/ZipUtil.java index 387bdf3b1..3ae26fb8d 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/util/ZipUtil.java +++ b/jsowell-common/src/main/java/com/jsowell/common/util/ZipUtil.java @@ -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; + } } diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/service/yunkuaichong/impl/YKCBusinessServiceImpl.java b/jsowell-netty/src/main/java/com/jsowell/netty/service/yunkuaichong/impl/YKCBusinessServiceImpl.java index 15e43d6b7..4f4388ece 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/service/yunkuaichong/impl/YKCBusinessServiceImpl.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/service/yunkuaichong/impl/YKCBusinessServiceImpl.java @@ -63,20 +63,6 @@ public class YKCBusinessServiceImpl implements YKCBusinessService { // 将此桩正在进行充电的订单状态改为 异常 orderBasicInfoService.updateOrderStatusAsAbnormal(pileSn); - // List 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); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileConnectorInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileConnectorInfoMapper.java index 03bf5e382..0eb04c504 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileConnectorInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileConnectorInfoMapper.java @@ -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 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index fc591e8fd..73ca9c806 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -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; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ConnectorInfoVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ConnectorInfoVO.java index bb7688249..f381425d9 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ConnectorInfoVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ConnectorInfoVO.java @@ -21,6 +21,11 @@ public class ConnectorInfoVO { */ private String stationId; + /** + * 充电桩编号 + */ + private String pileSn; + /** * 枪口号 */ diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileConnectorInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileConnectorInfoMapper.xml index f5f986df0..4945da47a 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileConnectorInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileConnectorInfoMapper.xml @@ -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 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/AMapService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/AMapService.java index 6de818c50..d2f3679af 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/AMapService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/AMapService.java @@ -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; /** * 商家推送充电订单信息 diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/impl/AMapServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/impl/AMapServiceImpl.java index 504d93fd6..129db900f 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/impl/AMapServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/amap/service/impl/AMapServiceImpl.java @@ -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 pileNumMap = pileConnectorInfoService.getPileTypeNum(Long.parseLong(stationId)); - AMapConnectorStatusInfo info = new AMapConnectorStatusInfo(); - info.setConnectorID(pileConnectorCode); - info.setEquipmentID(pileConnectorDetailVO.getPileSn()); - info.setStatus(pileConnectorDetailVO.getConnectorStatus()); + // 根据站点id查询枪口信息 + List connectorStatusInfoList = Lists.newArrayList(); + AMapConnectorStatusInfo info; + List 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";