消息队列
This commit is contained in:
@@ -18,6 +18,7 @@ import org.springframework.amqp.rabbit.annotation.Exchange;
|
|||||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
|
import org.springframework.amqp.support.AmqpHeaders;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.messaging.Message;
|
import org.springframework.messaging.Message;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -54,6 +55,7 @@ public class SendQdUpdateMQService {
|
|||||||
key = "qd-update-key_SQ_GSAR_RELEASE"))
|
key = "qd-update-key_SQ_GSAR_RELEASE"))
|
||||||
public void createMQ(Map<String, Object> bussMap, Message message, Channel channel) throws Exception {
|
public void createMQ(Map<String, Object> bussMap, Message message, Channel channel) throws Exception {
|
||||||
|
|
||||||
|
try {
|
||||||
//数据字典数据组装
|
//数据字典数据组装
|
||||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
||||||
Map<String, String> dict = new HashMap<>();
|
Map<String, String> dict = new HashMap<>();
|
||||||
@@ -84,12 +86,12 @@ public class SendQdUpdateMQService {
|
|||||||
if (null != tool.get(s)) {
|
if (null != tool.get(s)) {
|
||||||
if (tool.get(s).contains(",")) {
|
if (tool.get(s).contains(",")) {
|
||||||
for (String e : tool.get(s).split(",")) {
|
for (String e : tool.get(s).split(",")) {
|
||||||
stringBuilder.append(dict.get(e)+",");
|
stringBuilder.append(dict.get(e) + ",");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stringBuilder.append(dict.get(tool.get(s))+",");
|
stringBuilder.append(dict.get(tool.get(s)) + ",");
|
||||||
}
|
}
|
||||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0,stringBuilder.length()-1));
|
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0, stringBuilder.length() - 1));
|
||||||
} else {
|
} else {
|
||||||
bussAttrInfoMap.put("SYRZ", "");
|
bussAttrInfoMap.put("SYRZ", "");
|
||||||
}
|
}
|
||||||
@@ -116,15 +118,15 @@ public class SendQdUpdateMQService {
|
|||||||
if (null != tool.get(s)) {
|
if (null != tool.get(s)) {
|
||||||
if (tool.get(s).contains(",")) {
|
if (tool.get(s).contains(",")) {
|
||||||
for (String e : tool.get(s).split(",")) {
|
for (String e : tool.get(s).split(",")) {
|
||||||
stringBuilder.append(dict.get(e)+",");
|
stringBuilder.append(dict.get(e) + ",");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stringBuilder.append(dict.get(tool.get(s))+",");
|
stringBuilder.append(dict.get(tool.get(s)) + ",");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bussAttrInfoMap.put("SYRZ", "");
|
bussAttrInfoMap.put("SYRZ", "");
|
||||||
}
|
}
|
||||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0,stringBuilder.length()-1));
|
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0, stringBuilder.length() - 1));
|
||||||
sarLawsStandInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
sarLawsStandInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||||
try {
|
try {
|
||||||
lawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
lawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||||
@@ -150,12 +152,12 @@ public class SendQdUpdateMQService {
|
|||||||
if (null != tool.get(s)) {
|
if (null != tool.get(s)) {
|
||||||
if (tool.get(s).contains(",")) {
|
if (tool.get(s).contains(",")) {
|
||||||
for (String e : tool.get(s).split(",")) {
|
for (String e : tool.get(s).split(",")) {
|
||||||
stringBuilder.append(dict.get(e)+",");
|
stringBuilder.append(dict.get(e) + ",");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stringBuilder.append(dict.get(tool.get(s))+",");
|
stringBuilder.append(dict.get(tool.get(s)) + ",");
|
||||||
}
|
}
|
||||||
bussAttrInfoMap.put("SYRZ",stringBuilder.toString().substring(0,stringBuilder.length()-1) );
|
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0, stringBuilder.length() - 1));
|
||||||
} else {
|
} else {
|
||||||
bussAttrInfoMap.put("SYRZ", "");
|
bussAttrInfoMap.put("SYRZ", "");
|
||||||
}
|
}
|
||||||
@@ -182,12 +184,12 @@ public class SendQdUpdateMQService {
|
|||||||
if (null != tool.get(s)) {
|
if (null != tool.get(s)) {
|
||||||
if (tool.get(s).contains(",")) {
|
if (tool.get(s).contains(",")) {
|
||||||
for (String e : tool.get(s).split(",")) {
|
for (String e : tool.get(s).split(",")) {
|
||||||
stringBuilder.append(dict.get(e)+",");
|
stringBuilder.append(dict.get(e) + ",");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stringBuilder.append(dict.get(tool.get(s))+",");
|
stringBuilder.append(dict.get(tool.get(s)) + ",");
|
||||||
}
|
}
|
||||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0,stringBuilder.length()-1));
|
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0, stringBuilder.length() - 1));
|
||||||
} else {
|
} else {
|
||||||
bussAttrInfoMap.put("SYRZ", "");
|
bussAttrInfoMap.put("SYRZ", "");
|
||||||
}
|
}
|
||||||
@@ -200,6 +202,13 @@ public class SendQdUpdateMQService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
}finally {
|
||||||
|
Long tag = (Long) message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
|
||||||
|
channel.basicAck(tag,false);
|
||||||
|
logger.debug("消息确认成功!!!!!!!!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -210,6 +219,7 @@ public class SendQdUpdateMQService {
|
|||||||
key = "standard-key_updateText_RELEASE"))
|
key = "standard-key_updateText_RELEASE"))
|
||||||
public void createStandardMQ(Map<String, Object> bussMap, Message message, Channel channel) throws Exception {
|
public void createStandardMQ(Map<String, Object> bussMap, Message message, Channel channel) throws Exception {
|
||||||
|
|
||||||
|
try {
|
||||||
//数据字典数据组装
|
//数据字典数据组装
|
||||||
//数据字典数据组装
|
//数据字典数据组装
|
||||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
||||||
@@ -220,9 +230,8 @@ public class SendQdUpdateMQService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
List<DSarStandardDTO> changeJJSS= (List<DSarStandardDTO>) bussMap.get("changeJJSS");
|
List<DSarStandardDTO> changeJJSS = (List<DSarStandardDTO>) bussMap.get("changeJJSS");
|
||||||
List<DSarStandardDTO> changeXXYX= (List<DSarStandardDTO>) bussMap.get("changeXXYX");
|
List<DSarStandardDTO> changeXXYX = (List<DSarStandardDTO>) bussMap.get("changeXXYX");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//写修改逻辑
|
//写修改逻辑
|
||||||
@@ -269,9 +278,13 @@ public class SendQdUpdateMQService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
}finally {
|
||||||
|
Long tag = (Long) message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
|
||||||
|
channel.basicAck(tag,false);
|
||||||
|
logger.debug("消息确认成功!!!!!!!!!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user