diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java index 1a634e41..b3795e3f 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java @@ -61,8 +61,6 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService { if (count > 0) { return AjaxResult.error("桩编号重复"); } - - //桩 xhpcChargingPileMapper.addXhpcChargingPile(xhpcChargingPile); //终端 diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml index f175d47a..938c5d12 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcTerminalMapper.xml @@ -172,7 +172,10 @@ update_by, - remark + remark, + + + rate_model_id @@ -216,7 +219,10 @@ #{updateBy}, - #{remark} + #{remark}, + + + #{rateModelId} diff --git a/xhpc-modules/xhpc-common/pom.xml b/xhpc-modules/xhpc-common/pom.xml index 16050bed..d1f3f574 100644 --- a/xhpc-modules/xhpc-common/pom.xml +++ b/xhpc-modules/xhpc-common/pom.xml @@ -19,7 +19,11 @@ 8 - + + com.rabbitmq + amqp-client + 5.7.1 + com.ruoyi ruoyi-common-core diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/util/ConnectionRabbitMQUtil.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/ConnectionRabbitMQUtil.java similarity index 96% rename from xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/util/ConnectionRabbitMQUtil.java rename to xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/ConnectionRabbitMQUtil.java index 6532d177..fba34b06 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/util/ConnectionRabbitMQUtil.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/util/ConnectionRabbitMQUtil.java @@ -1,4 +1,4 @@ -package com.xhpc.order.util; +package com.xhpc.common.util; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; diff --git a/xhpc-modules/xhpc-order/pom.xml b/xhpc-modules/xhpc-order/pom.xml index 073fa95f..ce4429e1 100644 --- a/xhpc-modules/xhpc-order/pom.xml +++ b/xhpc-modules/xhpc-order/pom.xml @@ -21,11 +21,7 @@ - - com.rabbitmq - amqp-client - 5.7.1 - + com.alibaba.cloud diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcRealTimeOrderMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcRealTimeOrderMapper.java index db1bf831..d95b881b 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcRealTimeOrderMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcRealTimeOrderMapper.java @@ -40,7 +40,7 @@ public interface XhpcRealTimeOrderMapper { /** * 添加订单实时电流 - * @param XhpcChargeOrderVoltage + * @param xhpcChargeOrderVoltage * @return */ int addVoltage(XhpcChargeOrderVoltage xhpcChargeOrderVoltage); 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 2700a8ed..899b2e2a 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 @@ -1,7 +1,7 @@ package com.xhpc.order.rabbitmq; import com.rabbitmq.client.*; -import com.xhpc.order.util.ConnectionRabbitMQUtil; +import com.xhpc.common.util.ConnectionRabbitMQUtil; import java.io.IOException; import java.util.concurrent.TimeoutException; diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/rabbitmq/SendDemo.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/rabbitmq/SendDemo.java index 8f23eb51..fc693952 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/rabbitmq/SendDemo.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/rabbitmq/SendDemo.java @@ -2,7 +2,7 @@ package com.xhpc.order.rabbitmq; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; -import com.xhpc.order.util.ConnectionRabbitMQUtil; +import com.xhpc.common.util.ConnectionRabbitMQUtil; import java.io.IOException; import java.util.concurrent.TimeoutException; diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IHxpcChargeOrderService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IHxpcChargeOrderService.java index 32b8b2ff..b4d53222 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IHxpcChargeOrderService.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IHxpcChargeOrderService.java @@ -45,7 +45,7 @@ public interface IHxpcChargeOrderService { /** * 桩回调接口 * @param orderNo 订单编号 - * @param status 订单状态 (启动状态 1成功 2失败 实时订单状态 3充电中 4 桩充电完成 5 用户停止充电 6桩异常停止充电 ) + * @param status 订单状态 (启动状态 1成功 2失败 | 实时订单状态 3充电中 4 桩充电完成 6桩异常停止充电 ) * @param remark 失败的备注 */ void pileStatus(String orderNo,Integer status,String remark); diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/HxpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/HxpcChargeOrderServiceImpl.java index 456c13b4..b1f63fd5 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/HxpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/HxpcChargeOrderServiceImpl.java @@ -15,7 +15,7 @@ import com.xhpc.order.domain.XhpcHistoryOrder; import com.xhpc.order.mapper.HxpcChargeOrderMapper; import com.xhpc.order.service.IHxpcChargeOrderService; import com.xhpc.order.service.IXhpcHistoryOrderService; -import com.xhpc.order.util.ConnectionRabbitMQUtil; +import com.xhpc.common.util.ConnectionRabbitMQUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -25,7 +25,6 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -224,7 +223,8 @@ public class HxpcChargeOrderServiceImpl implements IHxpcChargeOrderService { if(type==4 ||type ==5){ Date date = new Date(); //获取实时订单 - REDIS.getCacheObject(orderNo); + Map cacheMap = REDIS.getCacheMap("order:"+orderNo); + cacheMap.get("realtimeDataList"); //用户第几次充电 int count = hxpcChargeOrderMapper.getCount(userId); diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml index 25c3291a..6a538f56 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml @@ -199,7 +199,7 @@ - insert into xhpc_charge_order_soc @@ -256,7 +256,119 @@ + + insert into xhpc_charge_order_current + + + charge_order_id, + + + current, + + + status, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark + + + + + #{chargeOrderId}, + + + #{current}, + + + #{status}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark} + + + + + insert into xhpc_charge_order_voltage + + + charge_order_id, + + + voltage, + + + status, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark + + + + + #{chargeOrderId}, + + + #{voltage}, + + + #{status}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark} + + +