|
@@ -16,6 +16,7 @@ import com.uas.ps.inquiry.page.criteria.LogicalExpression;
|
|
|
import com.uas.ps.inquiry.page.criteria.PredicateUtils;
|
|
import com.uas.ps.inquiry.page.criteria.PredicateUtils;
|
|
|
import com.uas.ps.inquiry.page.criteria.SimpleExpression;
|
|
import com.uas.ps.inquiry.page.criteria.SimpleExpression;
|
|
|
import com.uas.ps.inquiry.page.exception.IllegalOperatorException;
|
|
import com.uas.ps.inquiry.page.exception.IllegalOperatorException;
|
|
|
|
|
+import com.uas.ps.inquiry.rabbit.RabbitConstants;
|
|
|
import com.uas.ps.inquiry.service.InquiryService;
|
|
import com.uas.ps.inquiry.service.InquiryService;
|
|
|
import com.uas.ps.inquiry.service.PublicInquiryService;
|
|
import com.uas.ps.inquiry.service.PublicInquiryService;
|
|
|
import com.uas.ps.inquiry.util.FlexJsonUtils;
|
|
import com.uas.ps.inquiry.util.FlexJsonUtils;
|
|
@@ -25,6 +26,7 @@ import com.uas.ps.inquiry.util.ThreadUtils;
|
|
|
import javassist.NotFoundException;
|
|
import javassist.NotFoundException;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Sort;
|
|
import org.springframework.data.domain.Sort;
|
|
@@ -88,10 +90,6 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
*/
|
|
*/
|
|
|
private final String INQUIRY_TYPE_SELLER_MALL = "MALL跳转卖家待报价页面";
|
|
private final String INQUIRY_TYPE_SELLER_MALL = "MALL跳转卖家待报价页面";
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 公共消息访问地址
|
|
|
|
|
- */
|
|
|
|
|
- private final String PS_MESSAGE_URL = ContextUtils.getBean(AccessConfiguration.class).getPsMessageUrl();
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 询价统计通知发送人UU
|
|
* 询价统计通知发送人UU
|
|
@@ -139,7 +137,8 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private InquiryEnRemindDao inquiryEnRemindDao;
|
|
private InquiryEnRemindDao inquiryEnRemindDao;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RabbitTemplate rabbitTemplate;
|
|
|
/**
|
|
/**
|
|
|
* 公共物料访问地址
|
|
* 公共物料访问地址
|
|
|
*/
|
|
*/
|
|
@@ -879,7 +878,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
model.setSmTemplate(SMS_TEMP_ID);
|
|
model.setSmTemplate(SMS_TEMP_ID);
|
|
|
models.add(model);
|
|
models.add(model);
|
|
|
long start = System.currentTimeMillis();
|
|
long start = System.currentTimeMillis();
|
|
|
- HttpUtil.doPost(PS_MESSAGE_URL + "/messages", FlexJsonUtils.toJsonDeep(models));
|
|
|
|
|
|
|
+ rabbitTemplate.convertAndSend(RabbitConstants.AMQ_DIRECT, RabbitConstants.INQUIRY_MESSAGE_ROUTINGKEY, models);
|
|
|
log.info("/message 耗时:{},消息数:{}", (System.currentTimeMillis() - start), models.size());
|
|
log.info("/message 耗时:{},消息数:{}", (System.currentTimeMillis() - start), models.size());
|
|
|
log.info("公共询价", "此次{}公司新增{}张公共询价", company, count);
|
|
log.info("公共询价", "此次{}公司新增{}张公共询价", company, count);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -929,7 +928,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
}
|
|
}
|
|
|
if (models.size() >= 500) {
|
|
if (models.size() >= 500) {
|
|
|
long start = System.currentTimeMillis();
|
|
long start = System.currentTimeMillis();
|
|
|
- String res = HttpUtil.doPost(PS_MESSAGE_URL + "/messages", FlexJsonUtils.toJsonDeep(models));
|
|
|
|
|
|
|
+ rabbitTemplate.convertAndSend(RabbitConstants.AMQ_DIRECT, RabbitConstants.INQUIRY_MESSAGE_ROUTINGKEY, models);
|
|
|
log.info("消息中心生成消息");
|
|
log.info("消息中心生成消息");
|
|
|
log.info("发送消息{},耗时:{}", models.size(), (System.currentTimeMillis() - start));
|
|
log.info("发送消息{},耗时:{}", models.size(), (System.currentTimeMillis() - start));
|
|
|
models = new ArrayList<>();
|
|
models = new ArrayList<>();
|
|
@@ -937,7 +936,7 @@ public class InquiryServiceImpl implements InquiryService {
|
|
|
}
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(models)) {
|
|
if (!CollectionUtils.isEmpty(models)) {
|
|
|
long start = System.currentTimeMillis();
|
|
long start = System.currentTimeMillis();
|
|
|
- String res = HttpUtil.doPost(PS_MESSAGE_URL + "/messages", FlexJsonUtils.toJsonDeep(models));
|
|
|
|
|
|
|
+ rabbitTemplate.convertAndSend(RabbitConstants.AMQ_DIRECT, RabbitConstants.INQUIRY_MESSAGE_ROUTINGKEY, models);
|
|
|
log.info("消息中心生成消息");
|
|
log.info("消息中心生成消息");
|
|
|
log.info("发送消息{},耗时:{}", models.size(), (System.currentTimeMillis() - start));
|
|
log.info("发送消息{},耗时:{}", models.size(), (System.currentTimeMillis() - start));
|
|
|
}
|
|
}
|