From 52d5b1afff8ad51a84e11538e83a9b22a24bfa79 Mon Sep 17 00:00:00 2001 From: 18123374652 <2265829957@qq.com> Date: Thu, 22 Feb 2024 12:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E3=80=81=E5=85=85=E7=94=B5?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E3=80=81?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CDConnectorChargeStatusInfoTask.java | 2 +- .../CDNotificationOrderInfoTask.java | 3 +- .../CDNotificationStationFeeTask.java | 2 +- .../CDNotificationStationInfoTask.java | 89 +++++++++++++++++++ .../CDNotificationStationStatusTask.java | 2 +- .../NotificationCancelOrderTask.java | 2 +- ...NotificationChargeOrderInfo4BonusTask.java | 2 +- .../NotificationChargeOrderInfoTask.java | 2 +- .../NotificationEquipChargeStatusTask.java | 2 +- .../NotificationStartChargeResultTask.java | 2 +- .../NotificationStationStatusTask.java | 2 +- .../NotificationStopChargeResultTask.java | 2 +- .../xhpc/auth/controller/TokenController.java | 3 +- .../common/data/up/RemoteStartReplyData.java | 10 +++ .../common/util/ConnectionRabbitMQUtil.java | 6 +- .../order/api/XhpcChargeOrderController.java | 3 +- .../order/api/XhpcPileOrderController.java | 6 +- .../XhpcHistoryOrderController.java | 10 +++ .../order/mapper/XhpcHistoryOrderMapper.java | 1 + .../com/xhpc/order/rabbitmq/RecvDemo.java | 6 ++ .../service/IXhpcHistoryOrderService.java | 2 + .../impl/XhpcHistoryOrderServiceImpl.java | 8 ++ .../mapper/XhpcHistoryOrderMapper.xml | 5 ++ .../pp/logic/RemoteStartReplyDataLogic.java | 24 ++++- .../java/com/xhpc/pp/server/HBCheckTask.java | 3 +- .../java/com/xhpc/pp/tx/ServiceParameter.java | 9 ++ .../user/domain/AllInvoiceOrdersResponse.java | 7 +- .../user/domain/SaveInvoiceInfoRequest.java | 3 + .../xhpc/user/domain/SpecificInvoiceWrap.java | 5 ++ .../xhpc/user/mapper/XhpcAppUserMapper.java | 4 +- .../java/com/xhpc/user/pojo/XhpcInvoice.java | 3 + .../service/impl/XhpcAppUserServiceImpl.java | 5 ++ .../service/impl/XhpcInvoiceServiceImpl.java | 4 + .../resources/mapper/XhpcAppUserMapper.xml | 6 +- .../resources/mapper/XhpcInvoiceMapper.xml | 11 ++- 35 files changed, 227 insertions(+), 29 deletions(-) create mode 100644 evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationInfoTask.java diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDConnectorChargeStatusInfoTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDConnectorChargeStatusInfoTask.java index ce346b97..c334fee3 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDConnectorChargeStatusInfoTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDConnectorChargeStatusInfoTask.java @@ -43,7 +43,7 @@ public class CDConnectorChargeStatusInfoTask extends CoreDispatcher { * 设备充电中状态变化推送(我们平台推送成都市平台) --已推送 * 实时数据没40秒 */ - @Scheduled(fixedDelay = 1000 * 40) + //@Scheduled(fixedDelay = 1000 * 40) public void run() throws Exception{ List longList =new ArrayList<>(); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationOrderInfoTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationOrderInfoTask.java index 9df0e172..42c7f52d 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationOrderInfoTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationOrderInfoTask.java @@ -20,7 +20,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Example; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.io.IOException; @@ -60,7 +59,7 @@ public class CDNotificationOrderInfoTask extends CoreDispatcher { *订单信息推送 ---已推送--推送服务使用 * @throws IOException */ - @Scheduled(fixedDelay = 1000 * 60) + //@Scheduled(fixedDelay = 1000 * 60) public void run() throws IOException { AuthSecretToken authSecretTokenOut = diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationFeeTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationFeeTask.java index ba7da174..8d3909d3 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationFeeTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationFeeTask.java @@ -31,7 +31,7 @@ public class CDNotificationStationFeeTask extends CoreDispatcher { private final Logger logger = LoggerFactory.getLogger(CDNotificationStationFeeTask.class); //--推送服务使用 - @Scheduled(fixedDelay = 1000 * 60) + //@Scheduled(fixedDelay = 1000 * 60) public void run() throws IOException { AuthSecretToken authSecretTokenOut = diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationInfoTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationInfoTask.java new file mode 100644 index 00000000..11444790 --- /dev/null +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationInfoTask.java @@ -0,0 +1,89 @@ +package com.xhpc.evcs.cdjgpc.notification; + +import com.xhpc.common.api.dto.ChargingStationDto; +import com.xhpc.evcs.cdjgpc.dto.CDEquipmentInfo; +import com.xhpc.evcs.cdjgpc.dto.CDStationInfo; +import com.xhpc.evcs.domain.AuthSecretToken; +import com.xhpc.evcs.domain.XhpcStationInternetBlacklist; +import com.xhpc.evcs.dto.CommonRequest; +import com.xhpc.evcs.jpa.AuthSecretTokenRepository; +import com.xhpc.evcs.jpa.XhpcStationInternetBlacklistRepository; +import com.xhpc.evcs.notification.CoreDispatcher; +import com.xhpc.evcs.utils.JSONUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Scheduled; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.*; + +import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS; +import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT; + +public class CDNotificationStationInfoTask extends CoreDispatcher { + + + @Resource + private AuthSecretTokenRepository authSecretTokenRepository; + @Resource + private XhpcStationInternetBlacklistRepository xhpcStationInternetBlacklistRepo; + private final Logger logger = LoggerFactory.getLogger(CDNotificationStationInfoTask.class); + + //推送新平台场站信息 + //@Scheduled(cron = "0 0 0 1/15 * ? ") + public void run() throws IOException { + try{ + List xhpcStationInternetBlacklist = + xhpcStationInternetBlacklistRepo.findByInternetUserId(6L); + List stationKeys = new ArrayList<>(REDIS.keys("station:*")); + AuthSecretToken authSecretTokenOut = + authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType( + "MA6CC2LK7", "MA6DFCTD5", SECRET_TOKEN_TYPE_OUT).orElse(null); //todo + for (String stationKey : stationKeys) { + //查询不合作的电桩 + for (XhpcStationInternetBlacklist xhpcStationInternetBlack : xhpcStationInternetBlacklist) { + if (!stationKey.substring(8).equals(xhpcStationInternetBlack.getChargingStationId().toString())) { + // maybe对接第三方 + if (authSecretTokenOut != null) { + String chargingStationId = xhpcStationInternetBlack.getChargingStationId().toString(); + //获取场站信息 + String key = "cdjgpc:station:".concat(chargingStationId)+".notification"; + CDStationInfo cdStationInfo =REDIS.getCacheObject(key); + cdStationInfo.setEquipmentInfos(new ArrayList<>()); + //查询场站是桩是否对应上 + ChargingStationDto stationDto = REDIS.getCacheObject("station:"+chargingStationId); + Set pks = stationDto.getPiles(); + if (pks != null) { + List cdEquipmentInfos = new ArrayList<>(); + for (String pileNo : pks) { + String pk = "pile:".concat(pileNo); + String skey = "cdjgpc:".concat(pk)+".notification"; + CDEquipmentInfo cdEquipmentInfo = REDIS.getCacheObject(skey); + if(cdEquipmentInfo==null || "".equals(cdEquipmentInfo.getEquipmentID())){ + logger.info("该场站下面:"+pileNo+"桩未录入"); + }else{ + cdEquipmentInfos.add(cdEquipmentInfo); + } + } + cdStationInfo.setEquipmentInfos(cdEquipmentInfos); + } + cdStationInfo.setSwapMatchCarsName(null); + CommonRequest commonRequest = new CommonRequest<>(); + Map mapStationInfo =new HashMap<>(); + mapStationInfo.put("StationInfo",cdStationInfo); + String data = JSONUtil.toJSONString(mapStationInfo); + System.out.println("=======data========"+data); + commonRequest.setData(data); + String result =ok(commonRequest,"/notification_stationInfo",authSecretTokenOut); + System.out.println("=====推送充电站信息==result========"+result); + } + } + } + } + }catch (Exception e){ + e.printStackTrace(); + } + } + +} diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationStatusTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationStatusTask.java index f203a47b..69c53976 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationStatusTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/notification/CDNotificationStationStatusTask.java @@ -50,7 +50,7 @@ public class CDNotificationStationStatusTask extends CoreDispatcher { @Resource private XhpcTerminalRepository terminalRepository; //--推送服务使用 - @Scheduled(fixedRate = 1000 * 45) + //@Scheduled(fixedRate = 1000 * 45) protected void run() throws IOException { Collection stationTerminalKeys = REDIS.keys("stationTerminalStatus:*"); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationCancelOrderTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationCancelOrderTask.java index 45870d4e..15be4e16 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationCancelOrderTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationCancelOrderTask.java @@ -31,7 +31,7 @@ public class NotificationCancelOrderTask extends CoreDispatcher { //private Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class); //推送不开放 - //@Scheduled(fixedRate = 1000 * 15) + @Scheduled(fixedRate = 1000 * 15) public void run() throws JsonProcessingException { //Getting the orders, which need to be notified. diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java index 7b3a375b..b4864c9b 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java @@ -46,7 +46,7 @@ public class NotificationChargeOrderInfo4BonusTask extends CoreDispatcher { * 推送充电订单信息(运营奖补)(测试环境开) * @throws IOException */ - @Scheduled(fixedDelay = 1000 * 60) + //@Scheduled(fixedDelay = 1000 * 60) public void run() throws IOException { AuthSecretToken authSecretTokenOut = diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java index e1398cb3..03aaa773 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfoTask.java @@ -39,7 +39,7 @@ public class NotificationChargeOrderInfoTask extends CoreDispatcher { private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class); //推送不开放 - //@Scheduled(fixedRate = 1000 * 15) + @Scheduled(fixedRate = 1000 * 15) public void run() throws JsonProcessingException { Collection orderKeys = REDIS.keys("order:*"); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationEquipChargeStatusTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationEquipChargeStatusTask.java index 4cb5d015..68af472b 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationEquipChargeStatusTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationEquipChargeStatusTask.java @@ -49,7 +49,7 @@ public class NotificationEquipChargeStatusTask extends CoreDispatcher { * @throws IOException */ //推送不开放 - //@Scheduled(fixedRate = 1000 * 50) + @Scheduled(fixedRate = 1000 * 30) public void run() throws IOException { List authSecretTokenOutList = authSecretTokenRepository.findBySecretTokenType(SECRET_TOKEN_TYPE_OUT); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStartChargeResultTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStartChargeResultTask.java index d8856689..7bd45b51 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStartChargeResultTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStartChargeResultTask.java @@ -34,7 +34,7 @@ public class NotificationStartChargeResultTask extends CoreDispatcher { * Judging the 3rd whether it has got the start charging task. */ //推送不开放 - //@Scheduled(fixedRate = 1000 * 3) + @Scheduled(fixedRate = 1000 * 30) public void run() throws IOException { //Getting the charge orders which from 3rd. diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java index a425a723..3a48536e 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStationStatusTask.java @@ -50,7 +50,7 @@ public class NotificationStationStatusTask extends CoreDispatcher { private XhpcTerminalRepository terminalRepository; //推送不开放 - //@Scheduled(fixedRate = 1000 * 45) + @Scheduled(fixedRate = 1000 * 45) protected void run() throws IOException { Collection stationTerminalKeys = REDIS.keys("stationTerminalStatus:*"); diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java index a7d67af8..6ea8af28 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationStopChargeResultTask.java @@ -26,7 +26,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher { @Autowired private AuthSecretTokenRepository authSecretTokenRepository; - //@Scheduled(fixedRate = 1000 * 3) + @Scheduled(fixedRate = 1000 * 3) public void run() throws Exception { notifyService(); diff --git a/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java b/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java index 06917504..f62ad6f3 100644 --- a/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java +++ b/ruoyi-auth/src/main/java/com/xhpc/auth/controller/TokenController.java @@ -96,8 +96,7 @@ public class TokenController extends BaseController }else{ String captcha = redisService.getCacheObject("pcToken:" + form.getUsername()); - - if (!form.getPassword().equals(captcha) && !form.getPassword().equals("741852963")) { + if (!form.getPassword().equals(captcha)) { return R.fail(HttpStatus.ERROR_STATUS, "手机号验证码错误"); } } diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/data/up/RemoteStartReplyData.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/data/up/RemoteStartReplyData.java index 379015ba..b55305d2 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/data/up/RemoteStartReplyData.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/data/up/RemoteStartReplyData.java @@ -58,4 +58,14 @@ public class RemoteStartReplyData extends BaseData { this.failReason = failReason; } + @Override + public String toString() { + return "RemoteStartReplyData{" + + "orderNo='" + orderNo + '\'' + + ", pileNo='" + pileNo + '\'' + + ", gunId='" + gunId + '\'' + + ", startResult='" + startResult + '\'' + + ", failReason='" + failReason + '\'' + + '}'; + } } diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/ConnectionRabbitMQUtil.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/ConnectionRabbitMQUtil.java index fba34b06..6c238af3 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/ConnectionRabbitMQUtil.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/ConnectionRabbitMQUtil.java @@ -17,13 +17,13 @@ public class ConnectionRabbitMQUtil { //定义连接工厂 ConnectionFactory factory = new ConnectionFactory(); //设置服务地址 - factory.setHost("118.24.137.203"); + factory.setHost("47.109.133.116"); //端口 - factory.setPort(5673); + factory.setPort(5672); //设置账号信息,用户名、密码、vhost //factory.setVirtualHost("/guest");//设置虚拟机,一个mq服务可以设置多个虚拟机,每个虚拟机就相当于一个独立的mq factory.setUsername("admin"); - factory.setPassword("admin"); + factory.setPassword("123456"); // 通过工厂获取连接 Connection connection = factory.newConnection(); return connection; diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java index 30ea91a7..d0e8c359 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcChargeOrderController.java @@ -192,7 +192,8 @@ public class XhpcChargeOrderController extends BaseController { public R pileVin(String serialNumber,String vinNumber) { logger.info("<<<<<<<<<>>>>>>>"+serialNumber+">>>vinNumber>>>"+vinNumber+">>>"); - return iXhpcChargeOrderService.pileVin(serialNumber,vinNumber); + return R.fail(1880, "无效VIN码"); + // return iXhpcChargeOrderService.pileVin(serialNumber,vinNumber); } @GetMapping("/constantSoc") diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java index 3cf4632e..565cc1dc 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/api/XhpcPileOrderController.java @@ -311,8 +311,6 @@ public class XhpcPileOrderController extends BaseController { xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder); powerPileService.stopCharging(orderNo, substring,orderNo.substring(0, 16), "0A"); System.out.println("=====================p平台下发停止充电=============================="+xhpcChargeOrder.getSerialNumber()); - System.out.println("=====================p平台下发停止充电=============================="+xhpcChargeOrder.getSerialNumber()); - System.out.println("=====================p平台下发停止充电=============================="+xhpcChargeOrder.getSerialNumber()); return R.fail(500,"充电桩校验故障"); } } @@ -479,8 +477,8 @@ public class XhpcPileOrderController extends BaseController { } BigDecimal bigDecimal = new BigDecimal(10000); BigDecimal totalPowerQuantity = new BigDecimal(cacheOrderData.getTotalPowerQuantity()).divide(bigDecimal,4,BigDecimal.ROUND_HALF_UP); - if(totalPowerQuantity.compareTo(new BigDecimal(400)) > -1){ - logger.info("结算电量大于400度>>"+totalPowerQuantity+">>>orderNo:" + orderNo); + if(totalPowerQuantity.compareTo(new BigDecimal(500)) > -1){ + logger.info("结算电量大于500度>>"+totalPowerQuantity+">>>orderNo:" + orderNo); xhpcChargeOrder.setStatus(2); xhpcChargeOrder.setChargingDegree(totalPowerQuantity); xhpcChargeOrder.setUpdateTime(new Date()); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java index 582b6b60..e4f12851 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java @@ -1175,4 +1175,14 @@ public class XhpcHistoryOrderController extends BaseController { public AjaxResult updateChengDuPush(Long historyOrderId) { return xhpcHistoryOrderService.updateChengDuPush(historyOrderId); } + + //有争议的订单,平台自己修改订单转改 + @GetMapping("/cancelOrders") + public AjaxResult cancelOrders(Long historyOrderId) { + return xhpcHistoryOrderService.cancelOrders(historyOrderId); + } + + + + } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java index 0b206d35..3c880272 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java @@ -150,6 +150,7 @@ public interface XhpcHistoryOrderMapper { int updateOrderInternetPush(Long historyOrderId); + int cancelOrders(Long historyOrderId); int updateChengDuPush(Long historyOrderId); Map getXhpcRateTimeFee(@Param("date") String date, @Param("rateModelId") Long rateModelId); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/rabbitmq/RecvDemo.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/rabbitmq/RecvDemo.java index 1b93aa8d..08409462 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/rabbitmq/RecvDemo.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/rabbitmq/RecvDemo.java @@ -4,6 +4,8 @@ import com.rabbitmq.client.*; import com.xhpc.common.util.ConnectionRabbitMQUtil; import java.io.IOException; +import java.util.HashMap; +import java.util.Map; import java.util.concurrent.TimeoutException; /** @@ -28,7 +30,11 @@ public class RecvDemo { * 4、autoDelete 自动删除,队列不再使用时是否自动删除此队列,如果将此参数和exclusive参数设置为true就可以实现临时队列(队列不用了就自动删除) * 5、arguments 参数,可以设置一个队列的扩展参数,比如:可设置存活时间 */ + Map map =new HashMap<>(); + + channel.queueDeclare(NAME, false, false, false, null); + //实现消费方法 DefaultConsumer consumer = new DefaultConsumer(channel){ // 获取消息,并且处理,这个方法类似事件监听,如果有消息的时候,会被自动调用 diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java index 4343ff74..48faddb7 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java @@ -146,5 +146,7 @@ public interface IXhpcHistoryOrderService { AjaxResult updateChengDuPush(Long historyOrderId); + AjaxResult cancelOrders(Long historyOrderId); + Map getXhpcRateTimeFee(Long rateModelId); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java index 23907866..4fa57ed8 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java @@ -645,6 +645,14 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis } return AjaxResult.error("修改推送订单失败请联系管理员"); } + @Override + public AjaxResult cancelOrders(Long historyOrderId) { + int i = xhpcHistoryOrderMapper.cancelOrders(historyOrderId); + if(i>0){ + return AjaxResult.success(); + } + return AjaxResult.error("修改推送订单失败请联系管理员"); + } @Override public AjaxResult updateChengDuPush(Long historyOrderId) { diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index 6d74470a..dc1175f4 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -1702,6 +1702,11 @@ UPDATE xhpc_history_order set confirm_Result =-1 where history_order_id=#{historyOrderId} + + UPDATE xhpc_history_order set confirm_Result =0 where history_order_id=#{historyOrderId} + + + UPDATE et_auth_sec_token set last_push_order =#{historyOrderId} where id=2 diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStartReplyDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStartReplyDataLogic.java index c7ffca26..2f0db351 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStartReplyDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStartReplyDataLogic.java @@ -4,6 +4,9 @@ import cn.hutool.core.date.DateUtil; import com.fasterxml.jackson.databind.ObjectMapper; import com.xhpc.common.api.PileOrderService; import com.xhpc.common.data.up.RemoteStartReplyData; +import com.xhpc.common.enums.StationDeviceEnum; +import com.xhpc.pp.domain.XhpcDeviceMessage; +import com.xhpc.pp.mapper.XhpcDeviceMessageMapper; import com.xhpc.pp.tx.ServiceParameter; import com.xhpc.pp.tx.ServiceResult; import com.xhpc.pp.tx.logic.ServiceLogic; @@ -13,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; +import javax.annotation.Resource; import java.util.Calendar; import java.util.HashMap; import java.util.Map; @@ -40,10 +44,11 @@ public class RemoteStartReplyDataLogic implements ServiceLogic { @Autowired private PileOrderService pileOrderService; + @Resource + XhpcDeviceMessageMapper deviceMessageMapper; @Override public ServiceResult service(ServiceParameter sp) throws Exception { - Map req = sp.getParameters(); ObjectMapper objectMapper = new ObjectMapper(); RemoteStartReplyData remoteStartReplyData = objectMapper.convertValue(req, RemoteStartReplyData.class); @@ -58,13 +63,16 @@ public class RemoteStartReplyDataLogic implements ServiceLogic { REDIS.setCacheMap(gunkey, cacheGun); String pushOrderKey = orderkey.replace("order:", "pushOrder:"); Map pushOrder = REDIS.getCacheMap(pushOrderKey); + if (HEX_01.equals(remoteStartReplyData.getStartResult())) { final String orderstarttime = DateUtil.format(Calendar.getInstance().getTime(), NORM_DATETIME_FORMAT); cacheGun.put("pileStartTime", orderstarttime); cacheGun.put("orderstoptime", null); cacheGun.put("orderkey", orderkey); cacheOrder.put("pileStartTime", orderstarttime); - REDIS.setCacheMap(gunkey, cacheGun); + String substring = "gun:"+orderNo.substring(0, 16); + + REDIS.setCacheMap(substring, cacheGun); REDIS.setCacheMap(orderkey, cacheOrder); pileOrderService.pileStartup(orderNo, 1, "启动充电成功"); if (pushOrder != null) { @@ -85,7 +93,19 @@ public class RemoteStartReplyDataLogic implements ServiceLogic { REDIS.setCacheMap(pushOrderKey, map); } } + XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage(); + deviceMessage.setType(StationDeviceEnum.PILE.getCode()); + deviceMessage.setSerialNumber(sp.getPileNo()); + deviceMessage.setRemark("远程启动充电命令回复"); + deviceMessage.setStatus(0); + deviceMessage.setContent((String) req.get("hex")); + deviceMessage.setChargeOrderNo((String) req.get("orderNo")); + deviceMessageMapper.insertByDomain(deviceMessage); return new ServiceResult(false); } + public static void main(String[] args) { + String st ="80836000100009012401271201045239"; + System.out.println(st.substring(0,16)); + } } diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java index 66540370..ac82a651 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/HBCheckTask.java @@ -23,7 +23,8 @@ public class HBCheckTask { @Resource XhpcDeviceMessageMapper deviceMessageMapper; - //111@Scheduled(fixedRate = 10000) + //每5分钟执行一次 + @Scheduled(cron = "0 0/5 * * * ?") protected void run() { String svcSrvKey = "svcSrvGuns:".concat(getLocalIPAndPort()); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/tx/ServiceParameter.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/tx/ServiceParameter.java index 44b17161..0d7a8cc0 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/tx/ServiceParameter.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/tx/ServiceParameter.java @@ -62,4 +62,13 @@ public class ServiceParameter implements Serializable { this.pileNo = pileNo; } + @Override + public String toString() { + return "ServiceParameter{" + + "serviceName='" + serviceName + '\'' + + ", pileNo='" + pileNo + '\'' + + ", version='" + version + '\'' + + ", parameters=" + parameters + + '}'; + } } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/AllInvoiceOrdersResponse.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/AllInvoiceOrdersResponse.java index 16b2ec54..58299a97 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/AllInvoiceOrdersResponse.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/AllInvoiceOrdersResponse.java @@ -59,10 +59,15 @@ public class AllInvoiceOrdersResponse { @JsonProperty("creatorType") private Integer creatorType; /** - * 发票类型 0为普票,1为专票 + * */ @JsonProperty("invoiceType") private Integer invoiceType; + /** + * 发票类型 0为普票,1为专票 + */ + @JsonProperty("invoiceStatus") + private Integer invoiceStatus; /** * 发票金额 */ diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SaveInvoiceInfoRequest.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SaveInvoiceInfoRequest.java index 42dbac4a..1662b38e 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SaveInvoiceInfoRequest.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SaveInvoiceInfoRequest.java @@ -51,6 +51,9 @@ public class SaveInvoiceInfoRequest { private String creator; @JsonProperty("createTime") private String createTime; + @JsonProperty("invoiceStatus") + private Integer invoiceStatus; + @JsonProperty("historyOrderIds") private List historyOrderIds; diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SpecificInvoiceWrap.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SpecificInvoiceWrap.java index 6f6d9ac3..ef191c91 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SpecificInvoiceWrap.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/domain/SpecificInvoiceWrap.java @@ -53,6 +53,11 @@ public class SpecificInvoiceWrap { */ @JsonProperty("titleType") private Integer titleType; + /** + * 发票类型 + */ + @JsonProperty("invoiceStatus") + private Integer invoiceStatus; /** * 发票抬头内容 */ diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java index 5c1f07b4..f5121119 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcAppUserMapper.java @@ -103,12 +103,14 @@ public interface XhpcAppUserMapper { Map getUserLoginTime(@Param("type")Integer type,@Param("openid")String openid,@Param("tenantId")String tenantId); /** - * 该账号之前的登录信息,进行退出操作 + * 修改该账号之前的登录信息,进行退出操作 * @param account * @return */ int updateUserLoginTime(@Param("account")String account); + int updateopenIdUserLoginTime(@Param("openId")String openId); + /** * 查询开始时间是否在活动中 */ diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/pojo/XhpcInvoice.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/pojo/XhpcInvoice.java index 9e6bb761..34232ee9 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/pojo/XhpcInvoice.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/pojo/XhpcInvoice.java @@ -161,6 +161,9 @@ public class XhpcInvoice implements Serializable { private String tenantId; + //0增值税普通发票 1增值税专用发票 + private Integer invoiceStatus; + private static final long serialVersionUID = 1L; } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java index bf7558a8..4b0b6b3f 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java @@ -448,6 +448,9 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU logger.info("<<<<<<<<<>>>>>>>>>>>"); logger.info("<<<<<<<<<<自动登录openid>>>>>>>>>>>>"+openid); logger.info("<<<<<<<<<>>>>>>>>>>>"); + if("".equals(openid)|| openid==null){ + return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); + } Map userLoginTime = xhpcAppUserMapper.getUserLoginTime(Integer.valueOf(type), openid,tenantId); if(userLoginTime ==null){ return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); @@ -456,6 +459,8 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU if(userLoginTime.get("status") == null){ return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); } else if(UserTypeUtil.NO_LOGIN.equals(userLoginTime.get("status").toString())){ + //删除记录 + xhpcAppUserMapper.updateopenIdUserLoginTime(openid); return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); } logger.info("-------status---"+userLoginTime.get("status").toString()); diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInvoiceServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInvoiceServiceImpl.java index 3b6ebbd0..c2888824 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInvoiceServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcInvoiceServiceImpl.java @@ -92,6 +92,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { AllInvoiceOrdersResponse.ItemsDTO itemsDTO = new AllInvoiceOrdersResponse.ItemsDTO(); itemsDTO.setInvoiceId(xhpcInvoice.getInvoiceId()); itemsDTO.setInvoiceType(xhpcInvoice.getInvoiceType()); + itemsDTO.setInvoiceStatus(xhpcInvoice.getInvoiceStatus()); itemsDTO.setCreator(xhpcInvoice.getCreator()); itemsDTO.setCreatorType(xhpcInvoice.getCreatorType()); itemsDTO.setInvoiceMoney(xhpcInvoice.getInvoiceMoney()); @@ -101,6 +102,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { itemsDTO.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); } itemsDTO.setDrawer(xhpcInvoice.getDrawer()); + itemsDTOList.add(itemsDTO); } AllInvoiceOrdersResponse allInvoiceOrdersResponse = new AllInvoiceOrdersResponse(); @@ -588,6 +590,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { xhpcInvoice.setCreator(saveInvoiceInfoRequest.getCreator()); xhpcInvoice.setCreateTime(DateUtils.parseDate(saveInvoiceInfoRequest.getCreateTime())); xhpcInvoice.setStatus(0); + xhpcInvoice.setInvoiceStatus(saveInvoiceInfoRequest.getInvoiceStatus()); xhpcInvoiceMapper.insertSelectiveAndReturnId(xhpcInvoice); //建立订单与发票之间的关联 List xhpcHistoryOrderList = xhpcHistoryOrderMapper.findById(historyOrderIds); @@ -780,6 +783,7 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService { specificInvoiceWrap.setInvoiceMoney(xhpcInvoice.getInvoiceMoney()); specificInvoiceWrap.setInvoiceTotalEletricMoney(xhpcInvoice.getInvoiceOrderEletricTotalMoney()); specificInvoiceWrap.setInvoiceTotalServiceMoney(xhpcInvoice.getInvoiceOrderServiceTotalMoney()); + specificInvoiceWrap.setInvoiceStatus(xhpcInvoice.getInvoiceStatus()); if (xhpcInvoice.getInvoicingTime() != null) { specificInvoiceWrap.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime())); } diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml index 6dad2ed3..b434f481 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml @@ -347,7 +347,7 @@ open_id as openId, status as status from xhpc_user_login - where type = #{type} + where del_flag =0 and type = #{type} and open_id = #{openid} and tenant_id=#{tenantId} @@ -360,6 +360,10 @@ update xhpc_user_login set status =0 where account=#{account} and status=1 + + update xhpc_user_login set status =0 where open_id=#{openId} and status=1 + +