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;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.logpm.factory.snm.entity.PanOrderStatusLog;
import com.logpm.factory.snm.service.IPanOrderStatusLogService;
import com.logpm.factory.snm.entity.OrderStatusLog;
import com.logpm.factory.snm.service.IOrderStatusLogService;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
@ -27,7 +27,7 @@ import java.util.Map;
public class ErrorQueueHandler {
@Autowired
private IPanOrderStatusLogService panOrderStatusLogService;
private IOrderStatusLogService orderStatusLogService;
@RabbitHandler
public void orderStatusHandlerManualAck(Map map, Message message, Channel channel) {
@ -35,10 +35,10 @@ public class ErrorQueueHandler {
final long deliveryTag = message.getMessageProperties().getDeliveryTag();
try {
Long logId = (Long) map.get("logId");
UpdateWrapper<PanOrderStatusLog> updateWrapper = new UpdateWrapper<>();
UpdateWrapper<OrderStatusLog> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("status",2)
.eq("id",logId);
boolean updateFlag = panOrderStatusLogService.update(updateWrapper);
boolean updateFlag = orderStatusLogService.update(updateWrapper);
if(updateFlag){
channel.basicAck(deliveryTag, false);
}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{
//先保存原始请求数据
PanOrderStatusLog panOrderStatusLog = new PanOrderStatusLog();
OrderStatusLog panOrderStatusLog = new OrderStatusLog();
panOrderStatusLog.setArgs(JSONObject.toJSONString(orderInfoDTO));
panOrderStatusLog.setStatus(1);
panOrderStatusLog.setType(1);
@ -207,7 +207,7 @@ public class PanFactoryDataController extends BladeController {
try{
//先保存原始请求数据
PanOrderStatusLog panOrderStatusLog = new PanOrderStatusLog();
OrderStatusLog panOrderStatusLog = new OrderStatusLog();
panOrderStatusLog.setArgs(JSONObject.toJSONString(orderStatusDTO));
panOrderStatusLog.setStatus(1);
panOrderStatusLog.setType(2);

Loading…
Cancel
Save