移动Rabbitm 位置

This commit is contained in:
yuyang 2021-08-12 18:05:12 +08:00
parent 622874a72c
commit e4bcdfbc0c
12 changed files with 136 additions and 20 deletions

View File

@ -61,8 +61,6 @@ public class XhpcChargingPileServiceImpl implements IXhpcChargingPileService {
if (count > 0) { if (count > 0) {
return AjaxResult.error("桩编号重复"); return AjaxResult.error("桩编号重复");
} }
// //
xhpcChargingPileMapper.addXhpcChargingPile(xhpcChargingPile); xhpcChargingPileMapper.addXhpcChargingPile(xhpcChargingPile);
//终端 //终端

View File

@ -172,7 +172,10 @@
update_by, update_by,
</if> </if>
<if test="null != remark and '' != remark"> <if test="null != remark and '' != remark">
remark remark,
</if>
<if test="null != rateModelId">
rate_model_id
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -216,7 +219,10 @@
#{updateBy}, #{updateBy},
</if> </if>
<if test="null != remark and '' != remark"> <if test="null != remark and '' != remark">
#{remark} #{remark},
</if>
<if test="null != rateModelId">
#{rateModelId}
</if> </if>
</trim> </trim>
</insert> </insert>

View File

@ -19,7 +19,11 @@
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>5.7.1</version>
</dependency>
<dependency> <dependency>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-core</artifactId> <artifactId>ruoyi-common-core</artifactId>

View File

@ -1,4 +1,4 @@
package com.xhpc.order.util; package com.xhpc.common.util;
import com.rabbitmq.client.Connection; import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.ConnectionFactory;

View File

@ -21,11 +21,7 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>5.7.1</version>
</dependency>
<!-- SpringCloud Alibaba Nacos --> <!-- SpringCloud Alibaba Nacos -->
<dependency> <dependency>
<groupId>com.alibaba.cloud</groupId> <groupId>com.alibaba.cloud</groupId>

View File

@ -40,7 +40,7 @@ public interface XhpcRealTimeOrderMapper {
/** /**
* 添加订单实时电流 * 添加订单实时电流
* @param XhpcChargeOrderVoltage * @param xhpcChargeOrderVoltage
* @return * @return
*/ */
int addVoltage(XhpcChargeOrderVoltage xhpcChargeOrderVoltage); int addVoltage(XhpcChargeOrderVoltage xhpcChargeOrderVoltage);

View File

@ -1,7 +1,7 @@
package com.xhpc.order.rabbitmq; package com.xhpc.order.rabbitmq;
import com.rabbitmq.client.*; import com.rabbitmq.client.*;
import com.xhpc.order.util.ConnectionRabbitMQUtil; import com.xhpc.common.util.ConnectionRabbitMQUtil;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;

View File

@ -2,7 +2,7 @@ package com.xhpc.order.rabbitmq;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection; import com.rabbitmq.client.Connection;
import com.xhpc.order.util.ConnectionRabbitMQUtil; import com.xhpc.common.util.ConnectionRabbitMQUtil;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;

View File

@ -45,7 +45,7 @@ public interface IHxpcChargeOrderService {
/** /**
* 桩回调接口 * 桩回调接口
* @param orderNo 订单编号 * @param orderNo 订单编号
* @param status 订单状态 (启动状态 1成功 2失败 实时订单状态 3充电中 4 桩充电完成 5 用户停止充电 6桩异常停止充电 ) * @param status 订单状态 (启动状态 1成功 2失败 | 实时订单状态 3充电中 4 桩充电完成 6桩异常停止充电 )
* @param remark 失败的备注 * @param remark 失败的备注
*/ */
void pileStatus(String orderNo,Integer status,String remark); void pileStatus(String orderNo,Integer status,String remark);

View File

@ -15,7 +15,7 @@ import com.xhpc.order.domain.XhpcHistoryOrder;
import com.xhpc.order.mapper.HxpcChargeOrderMapper; import com.xhpc.order.mapper.HxpcChargeOrderMapper;
import com.xhpc.order.service.IHxpcChargeOrderService; import com.xhpc.order.service.IHxpcChargeOrderService;
import com.xhpc.order.service.IXhpcHistoryOrderService; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -25,7 +25,6 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -224,7 +223,8 @@ public class HxpcChargeOrderServiceImpl implements IHxpcChargeOrderService {
if(type==4 ||type ==5){ if(type==4 ||type ==5){
Date date = new Date(); Date date = new Date();
//获取实时订单 //获取实时订单
REDIS.getCacheObject(orderNo); Map<String, Object> cacheMap = REDIS.getCacheMap("order:"+orderNo);
cacheMap.get("realtimeDataList");
//用户第几次充电 //用户第几次充电
int count = hxpcChargeOrderMapper.getCount(userId); int count = hxpcChargeOrderMapper.getCount(userId);

View File

@ -199,7 +199,7 @@
</trim> </trim>
</insert> </insert>
<insert id="addSOC" parameterType="com.xhpc.order.domain.XhpcRealTimeOrder" useGeneratedKeys="true" <insert id="addSOC" parameterType="com.xhpc.order.domain.XhpcChargeOrderSoc" useGeneratedKeys="true"
keyProperty="chargeOrderSocId"> keyProperty="chargeOrderSocId">
insert into xhpc_charge_order_soc insert into xhpc_charge_order_soc
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -256,7 +256,119 @@
</trim> </trim>
</insert> </insert>
<insert id="addCurrent" parameterType="com.xhpc.order.domain.XhpcChargeOrderCurrent" useGeneratedKeys="true"
keyProperty="chargeOrderCurrentId">
insert into xhpc_charge_order_current
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != chargeOrderId ">
charge_order_id,
</if>
<if test="null != current ">
current,
</if>
<if test="null != status ">
status,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != createBy ">
create_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != updateBy ">
update_by,
</if>
<if test="null != remark ">
remark
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != chargeOrderId ">
#{chargeOrderId},
</if>
<if test="null != current ">
#{current},
</if>
<if test="null != status ">
#{status},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != createBy ">
#{createBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != updateBy ">
#{updateBy},
</if>
<if test="null != remark ">
#{remark}
</if>
</trim>
</insert>
<insert id="addVoltage" parameterType="com.xhpc.order.domain.XhpcChargeOrderVoltage" useGeneratedKeys="true"
keyProperty="chargeOrderVoltageId">
insert into xhpc_charge_order_voltage
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != chargeOrderId ">
charge_order_id,
</if>
<if test="null != voltage ">
voltage,
</if>
<if test="null != status ">
status,
</if>
<if test="null != createTime ">
create_time,
</if>
<if test="null != createBy ">
create_by,
</if>
<if test="null != updateTime ">
update_time,
</if>
<if test="null != updateBy ">
update_by,
</if>
<if test="null != remark ">
remark
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != chargeOrderId ">
#{chargeOrderId},
</if>
<if test="null != voltage ">
#{voltage},
</if>
<if test="null != status ">
#{status},
</if>
<if test="null != createTime ">
#{createTime},
</if>
<if test="null != createBy ">
#{createBy},
</if>
<if test="null != updateTime ">
#{updateTime},
</if>
<if test="null != updateBy ">
#{updateBy},
</if>
<if test="null != remark ">
#{remark}
</if>
</trim>
</insert>
<select id="list" resultType="map"> <select id="list" resultType="map">
select select

View File

@ -1,7 +1,7 @@
package com.xhpc.wxma.rabbitm; package com.xhpc.wxma.rabbitm;
import com.rabbitmq.client.*; import com.rabbitmq.client.*;
import com.xhpc.order.util.ConnectionRabbitMQUtil; import com.xhpc.common.util.ConnectionRabbitMQUtil;
import com.xhpc.wxma.socket.OrderNotificationWebSocket; import com.xhpc.wxma.socket.OrderNotificationWebSocket;
import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner; import org.springframework.boot.ApplicationRunner;