Browse Source

1.合并mq版本

dev-warehouse
zhenghaoyu 2 years ago
parent
commit
80ba91f12d
  1. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ErrorQueueHandler.java
  2. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java

10
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/ErrorQueueHandler.java

@ -1,8 +1,8 @@
package com.logpm.factory.receiver; package com.logpm.factory.receiver;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.logpm.factory.snm.entity.PanOrderStatusLog; import com.logpm.factory.snm.entity.OrderStatusLog;
import com.logpm.factory.snm.service.IPanOrderStatusLogService; import com.logpm.factory.snm.service.IOrderStatusLogService;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.RabbitConstant;
@ -27,7 +27,7 @@ import java.util.Map;
public class ErrorQueueHandler { public class ErrorQueueHandler {
@Autowired @Autowired
private IPanOrderStatusLogService panOrderStatusLogService; private IOrderStatusLogService orderStatusLogService;
@RabbitHandler @RabbitHandler
public void orderStatusHandlerManualAck(Map map, Message message, Channel channel) { public void orderStatusHandlerManualAck(Map map, Message message, Channel channel) {
@ -35,10 +35,10 @@ public class ErrorQueueHandler {
final long deliveryTag = message.getMessageProperties().getDeliveryTag(); final long deliveryTag = message.getMessageProperties().getDeliveryTag();
try { try {
Long logId = (Long) map.get("logId"); Long logId = (Long) map.get("logId");
UpdateWrapper<PanOrderStatusLog> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<OrderStatusLog> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("status",2) updateWrapper.set("status",2)
.eq("id",logId); .eq("id",logId);
boolean updateFlag = panOrderStatusLogService.update(updateWrapper); boolean updateFlag = orderStatusLogService.update(updateWrapper);
if(updateFlag){ if(updateFlag){
channel.basicAck(deliveryTag, false); channel.basicAck(deliveryTag, false);
}else{ }else{

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java

@ -172,7 +172,7 @@ public class PanFactoryDataController extends BladeController {
try{ try{
//先保存原始请求数据 //先保存原始请求数据
PanOrderStatusLog panOrderStatusLog = new PanOrderStatusLog(); OrderStatusLog panOrderStatusLog = new OrderStatusLog();
panOrderStatusLog.setArgs(JSONObject.toJSONString(orderInfoDTO)); panOrderStatusLog.setArgs(JSONObject.toJSONString(orderInfoDTO));
panOrderStatusLog.setStatus(1); panOrderStatusLog.setStatus(1);
panOrderStatusLog.setType(1); panOrderStatusLog.setType(1);
@ -207,7 +207,7 @@ public class PanFactoryDataController extends BladeController {
try{ try{
//先保存原始请求数据 //先保存原始请求数据
PanOrderStatusLog panOrderStatusLog = new PanOrderStatusLog(); OrderStatusLog panOrderStatusLog = new OrderStatusLog();
panOrderStatusLog.setArgs(JSONObject.toJSONString(orderStatusDTO)); panOrderStatusLog.setArgs(JSONObject.toJSONString(orderStatusDTO));
panOrderStatusLog.setStatus(1); panOrderStatusLog.setStatus(1);
panOrderStatusLog.setType(2); panOrderStatusLog.setType(2);

Loading…
Cancel
Save