feat: There is no way the Buss and Convert
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package com.adc.da.mq;
|
||||
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.springframework.amqp.core.AmqpTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class CreateStandMQService {
|
||||
@Autowired
|
||||
private AmqpTemplate rabbitTemplate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param sarStandardsInfoEO 标准实体
|
||||
* @param addOrUpdate
|
||||
* @throws Exception
|
||||
*/
|
||||
public void sendStandMQ(Object sarStandardsInfoEO, String addOrUpdate) throws Exception{
|
||||
JSONObject json = JSONObject.fromObject(sarStandardsInfoEO);
|
||||
String sarStandardsInfoStr = json.toString();
|
||||
Map<String,Object> standMap = new HashMap<String,Object>();
|
||||
standMap.put("sarStandards", sarStandardsInfoStr);
|
||||
standMap.put("addOrUpdate", addOrUpdate);
|
||||
|
||||
//发送消息队列
|
||||
this.rabbitTemplate.convertAndSend("stand-exchange_SQ_GSAR", "stand-key_SQ_GSAR", standMap);
|
||||
}
|
||||
|
||||
public void sendLawsMQ(SarLawsInfo sarLawsInfoEO, String addOrUpdate) throws Exception{
|
||||
JSONObject json = JSONObject.fromObject(sarLawsInfoEO);
|
||||
String sarLawsInfoStr = json.toString();
|
||||
Map<String,Object> lawsMap = new HashMap<String,Object>();
|
||||
lawsMap.put("sarLaws", sarLawsInfoStr);
|
||||
lawsMap.put("addOrUpdate", addOrUpdate);
|
||||
|
||||
//发送消息队列
|
||||
this.rabbitTemplate.convertAndSend("laws-exchange_SQ_GSAR", "laws-key_SQ_GSAR", lawsMap);
|
||||
}
|
||||
|
||||
public void sendBussStandMQ(SarBussionessStand sarBussionessStandEO, String addOrUpdate) throws Exception{
|
||||
JSONObject json = JSONObject.fromObject(sarBussionessStandEO);
|
||||
String sarBussInfoStr = json.toString();
|
||||
Map<String,Object> bussMap = new HashMap<String,Object>();
|
||||
bussMap.put("sarBuss", sarBussInfoStr);
|
||||
bussMap.put("addOrUpdate", addOrUpdate);
|
||||
|
||||
//发送消息队列
|
||||
this.rabbitTemplate.convertAndSend("buss-exchange_SQ_GSAR", "buss-key_SQ_GSAR", bussMap);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user