提交 bfe64b64 authored 作者: huyufan's avatar huyufan

监听运单取消释放借款金额

上级 ef9f72e7
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
public class OrderChildCancelEvent extends ApplicationEvent { public class OrderChildCancelEvent extends ApplicationEvent {
private List<String> childNoList; private String childNo;
/** /**
...@@ -24,9 +24,10 @@ public class OrderChildCancelEvent extends ApplicationEvent { ...@@ -24,9 +24,10 @@ public class OrderChildCancelEvent extends ApplicationEvent {
super(source); super(source);
} }
public OrderChildCancelEvent(Object source, List<String> childNoList) {
public OrderChildCancelEvent(Object source, String childNo) {
super(source); super(source);
this.childNoList = childNoList; this.childNo = childNo;
} }
} }
...@@ -13,6 +13,7 @@ import com.clx.performance.constant.RabbitKeyConstants; ...@@ -13,6 +13,7 @@ import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dto.dts.DataTransportDTO; import com.clx.performance.dto.dts.DataTransportDTO;
import com.clx.performance.enums.DtsOperationTypeEnum; import com.clx.performance.enums.DtsOperationTypeEnum;
import com.clx.performance.enums.OrderChildEnum; import com.clx.performance.enums.OrderChildEnum;
import com.clx.performance.event.OrderChildCancelEvent;
import com.clx.performance.model.OrderChild; import com.clx.performance.model.OrderChild;
import com.clx.performance.service.LastTruckService; import com.clx.performance.service.LastTruckService;
import com.clx.performance.struct.OrderChildStruct; import com.clx.performance.struct.OrderChildStruct;
...@@ -23,6 +24,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -23,6 +24,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message; import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Objects; import java.util.Objects;
...@@ -44,6 +46,9 @@ public class OrderChildDtsListener { ...@@ -44,6 +46,9 @@ public class OrderChildDtsListener {
@Autowired @Autowired
OrderChildStruct orderChildStruct; OrderChildStruct orderChildStruct;
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
@RabbitListener(queues = RabbitKeyConstants.CLX_PERFORMANCE_ORDER_CHILD_QUEUE) @RabbitListener(queues = RabbitKeyConstants.CLX_PERFORMANCE_ORDER_CHILD_QUEUE)
public void onMessage(Message message) { public void onMessage(Message message) {
...@@ -91,6 +96,10 @@ public class OrderChildDtsListener { ...@@ -91,6 +96,10 @@ public class OrderChildDtsListener {
//如果订单是取消操作,同步给交易平台统一 10000 的code //如果订单是取消操作,同步给交易平台统一 10000 的code
if(OrderChildEnum.DTS_LISTEN_CANCEL_lIST.contains(after.getStatus())){ if(OrderChildEnum.DTS_LISTEN_CANCEL_lIST.contains(after.getStatus())){
after.setStatus(com.clx.open.sdk.enums.OrderChildEnum.Status.COMMON_CANCEL.getCode()); after.setStatus(com.clx.open.sdk.enums.OrderChildEnum.Status.COMMON_CANCEL.getCode());
//运单取消释放借款冻结金额
log.info("DTS运单取消释放借款冻结金额");
applicationEventPublisher.publishEvent(new OrderChildCancelEvent(this, after.getChildNo()));
} }
after.setLastFlag(ResultStatusEnum.NO.getCode()); after.setLastFlag(ResultStatusEnum.NO.getCode());
OpenCallBackClient client = new OpenCallBackClient(mslAppConfig.getUrl(),mslAppConfig.getAppId(),mslAppConfig.getSecret()); OpenCallBackClient client = new OpenCallBackClient(mslAppConfig.getUrl(),mslAppConfig.getAppId(),mslAppConfig.getSecret());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论