|
@@ -16,16 +16,21 @@ import com.fdkk.sxz.vo.request.RequestRenovationPartsDetailManager;
|
|
|
import com.fdkk.sxz.webApi.service.*;
|
|
|
import com.fdkk.sxz.webApi.service.custom.ICustomComponentService;
|
|
|
import com.fdkk.sxz.webApi.service.custom.ICustomProductService;
|
|
|
+import com.rabbitmq.client.AMQP;
|
|
|
+import com.rabbitmq.client.Channel;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
+import org.springframework.amqp.support.AmqpHeaders;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.messaging.Message;
|
|
|
+import org.springframework.messaging.handler.annotation.Header;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.io.File;
|
|
|
+import java.io.IOException;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -78,14 +83,22 @@ public class AddMoldelBuild {
|
|
|
@RabbitListener(queues = TopicRabbitConfig.ADDMODEL)
|
|
|
public void syncModel(Message<RequestRenovationPartsDetailManager> message) {
|
|
|
AddMoldelBuild.log.info("模型syncmodel:" + message.getPayload() + ",开始同步");
|
|
|
- if (message.getPayload().getQueryType() == 3) {
|
|
|
- syncModel(message.getPayload());
|
|
|
- } else {
|
|
|
- syncModelHandler(message.getPayload());
|
|
|
- }
|
|
|
+ syncModelHandler(message.getPayload());
|
|
|
+
|
|
|
|
|
|
}
|
|
|
+ @RabbitHandler
|
|
|
+ @RabbitListener(queues = TopicRabbitConfig.ADDMODELTO3D)
|
|
|
+ public void addmodelto3d(Message<RequestRenovationPartsDetailManager> message, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag, Channel channel) {
|
|
|
+ AddMoldelBuild.log.info("模型addmodelto3d:" + message.getPayload() + ",开始同步");
|
|
|
+ try {
|
|
|
+ syncModel(message.getPayload());
|
|
|
+ channel.basicAck(deliveryTag, false);//消息确认
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
public void syncModel(RequestRenovationPartsDetailManager param) {
|
|
|
String token = RedisUtil.tryLock(param.getFileId().toString() + "syncModel", 60 * 1000);
|
|
|
try {
|