消息队列
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.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.amqp.support.AmqpHeaders;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -54,110 +55,46 @@ public class SendQdUpdateMQService {
|
||||
key = "qd-update-key_SQ_GSAR_RELEASE"))
|
||||
public void createMQ(Map<String, Object> bussMap, Message message, Channel channel) throws Exception {
|
||||
|
||||
//数据字典数据组装
|
||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
||||
Map<String, String> dict = new HashMap<>();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) dicTypeEO.get("SYRZCLASS");
|
||||
arr.forEach(stringStringMap -> {
|
||||
dict.put(stringStringMap.get("label"), stringStringMap.get("value"));
|
||||
});
|
||||
try {
|
||||
//数据字典数据组装
|
||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
||||
Map<String, String> dict = new HashMap<>();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) dicTypeEO.get("SYRZCLASS");
|
||||
arr.forEach(stringStringMap -> {
|
||||
dict.put(stringStringMap.get("label"), stringStringMap.get("value"));
|
||||
});
|
||||
|
||||
|
||||
//写修改逻辑
|
||||
Thread.sleep(5000);
|
||||
Hashtable<String, String> tool = (Hashtable<String, String>) bussMap.get("tableData");
|
||||
List<String> remove = (List<String>) bussMap.get("remove");
|
||||
List<String> add = (List<String>) bussMap.get("add");
|
||||
remove.forEach(s -> {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", s);
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(s);
|
||||
sarStandardsInfo.setIsRelateAccess("2");
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(s);
|
||||
//写修改逻辑
|
||||
Thread.sleep(5000);
|
||||
Hashtable<String, String> tool = (Hashtable<String, String>) bussMap.get("tableData");
|
||||
List<String> remove = (List<String>) bussMap.get("remove");
|
||||
List<String> add = (List<String>) bussMap.get("add");
|
||||
remove.forEach(s -> {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", s);
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(s);
|
||||
sarStandardsInfo.setIsRelateAccess("2");
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(s);
|
||||
|
||||
if (bussAttrInfoMap != null) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (null != tool.get(s)) {
|
||||
if (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e)+",");
|
||||
if (bussAttrInfoMap != null) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (null != tool.get(s)) {
|
||||
if (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e) + ",");
|
||||
}
|
||||
} else {
|
||||
stringBuilder.append(dict.get(tool.get(s)) + ",");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0, stringBuilder.length() - 1));
|
||||
} else {
|
||||
stringBuilder.append(dict.get(tool.get(s))+",");
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0,stringBuilder.length()-1));
|
||||
} else {
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
}
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(sarStandardsInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
QueryWrapper<SarLawsStandInfo> wrapper1 = new QueryWrapper<>();
|
||||
wrapper1.eq("ID", s);
|
||||
List<SarLawsStandInfo> infos1 = lawsStandInfoService.list(wrapper1);
|
||||
if (null != infos1 && infos1.size() > 0) {
|
||||
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||
sarLawsStandInfo.setId(s);
|
||||
sarLawsStandInfo.setIsRelateAccess("2");
|
||||
sarLawsStandInfo.setModifyTime(new Date());
|
||||
Map<String, Object> bussAttrInfoMap = lawsAttrInfoService.getBussAttrInfo(s);
|
||||
if (bussAttrInfoMap != null) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (null != tool.get(s)) {
|
||||
if (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e)+",");
|
||||
}
|
||||
} else {
|
||||
stringBuilder.append(dict.get(tool.get(s))+",");
|
||||
}
|
||||
} else {
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0,stringBuilder.length()-1));
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
try {
|
||||
lawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
add.forEach(s -> {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", s);
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(s);
|
||||
sarStandardsInfo.setIsRelateAccess("1");
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(s);
|
||||
if (bussAttrInfoMap != null) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (null != tool.get(s)) {
|
||||
if (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e)+",");
|
||||
}
|
||||
} else {
|
||||
stringBuilder.append(dict.get(tool.get(s))+",");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ",stringBuilder.toString().substring(0,stringBuilder.length()-1) );
|
||||
} else {
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
try {
|
||||
@@ -166,40 +103,112 @@ public class SendQdUpdateMQService {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QueryWrapper<SarLawsStandInfo> wrapper1 = new QueryWrapper<>();
|
||||
wrapper.eq("ID", s);
|
||||
List<SarLawsStandInfo> infos1 = lawsStandInfoService.list(wrapper1);
|
||||
if (null != infos1 && infos1.size() > 0) {
|
||||
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||
sarLawsStandInfo.setId(s);
|
||||
sarLawsStandInfo.setIsRelateAccess("1");
|
||||
sarLawsStandInfo.setModifyTime(new Date());
|
||||
Map<String, Object> bussAttrInfoMap = lawsAttrInfoService.getBussAttrInfo(s);
|
||||
if (bussAttrInfoMap != null) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (null != tool.get(s)) {
|
||||
if (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e)+",");
|
||||
QueryWrapper<SarLawsStandInfo> wrapper1 = new QueryWrapper<>();
|
||||
wrapper1.eq("ID", s);
|
||||
List<SarLawsStandInfo> infos1 = lawsStandInfoService.list(wrapper1);
|
||||
if (null != infos1 && infos1.size() > 0) {
|
||||
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||
sarLawsStandInfo.setId(s);
|
||||
sarLawsStandInfo.setIsRelateAccess("2");
|
||||
sarLawsStandInfo.setModifyTime(new Date());
|
||||
Map<String, Object> bussAttrInfoMap = lawsAttrInfoService.getBussAttrInfo(s);
|
||||
if (bussAttrInfoMap != null) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (null != tool.get(s)) {
|
||||
if (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e) + ",");
|
||||
}
|
||||
} else {
|
||||
stringBuilder.append(dict.get(tool.get(s)) + ",");
|
||||
}
|
||||
} else {
|
||||
stringBuilder.append(dict.get(tool.get(s))+",");
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0, stringBuilder.length() - 1));
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
try {
|
||||
lawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0,stringBuilder.length()-1));
|
||||
} else {
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
try {
|
||||
lawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
add.forEach(s -> {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", s);
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(s);
|
||||
sarStandardsInfo.setIsRelateAccess("1");
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(s);
|
||||
if (bussAttrInfoMap != null) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (null != tool.get(s)) {
|
||||
if (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e) + ",");
|
||||
}
|
||||
} else {
|
||||
stringBuilder.append(dict.get(tool.get(s)) + ",");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0, stringBuilder.length() - 1));
|
||||
} else {
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(sarStandardsInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QueryWrapper<SarLawsStandInfo> wrapper1 = new QueryWrapper<>();
|
||||
wrapper.eq("ID", s);
|
||||
List<SarLawsStandInfo> infos1 = lawsStandInfoService.list(wrapper1);
|
||||
if (null != infos1 && infos1.size() > 0) {
|
||||
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||
sarLawsStandInfo.setId(s);
|
||||
sarLawsStandInfo.setIsRelateAccess("1");
|
||||
sarLawsStandInfo.setModifyTime(new Date());
|
||||
Map<String, Object> bussAttrInfoMap = lawsAttrInfoService.getBussAttrInfo(s);
|
||||
if (bussAttrInfoMap != null) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (null != tool.get(s)) {
|
||||
if (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e) + ",");
|
||||
}
|
||||
} else {
|
||||
stringBuilder.append(dict.get(tool.get(s)) + ",");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0, stringBuilder.length() - 1));
|
||||
} else {
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
try {
|
||||
lawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}catch(Exception e){
|
||||
logger.error(e.getMessage());
|
||||
}finally {
|
||||
Long tag = (Long) message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
|
||||
channel.basicAck(tag,false);
|
||||
logger.debug("消息确认成功!!!!!!!!!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -210,69 +219,73 @@ public class SendQdUpdateMQService {
|
||||
key = "standard-key_updateText_RELEASE"))
|
||||
public void createStandardMQ(Map<String, Object> bussMap, Message message, Channel channel) throws Exception {
|
||||
|
||||
//数据字典数据组装
|
||||
//数据字典数据组装
|
||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) dicTypeEO.get("WBZTCLASS");
|
||||
arr.forEach(stringStringMap -> {
|
||||
map.put(stringStringMap.get("label"), stringStringMap.get("value"));
|
||||
});
|
||||
try {
|
||||
//数据字典数据组装
|
||||
//数据字典数据组装
|
||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) dicTypeEO.get("WBZTCLASS");
|
||||
arr.forEach(stringStringMap -> {
|
||||
map.put(stringStringMap.get("label"), stringStringMap.get("value"));
|
||||
});
|
||||
|
||||
|
||||
List<DSarStandardDTO> changeJJSS= (List<DSarStandardDTO>) bussMap.get("changeJJSS");
|
||||
List<DSarStandardDTO> changeXXYX= (List<DSarStandardDTO>) bussMap.get("changeXXYX");
|
||||
List<DSarStandardDTO> changeJJSS = (List<DSarStandardDTO>) bussMap.get("changeJJSS");
|
||||
List<DSarStandardDTO> changeXXYX = (List<DSarStandardDTO>) bussMap.get("changeXXYX");
|
||||
|
||||
|
||||
//写修改逻辑
|
||||
Thread.sleep(5000);
|
||||
for (DSarStandardDTO jjss : changeJJSS) {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", jjss.getId());
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(jjss.getId());
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
sarStandardsInfo.setTextStatus(map.get("即将实施"));
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(jjss.getId());
|
||||
if (bussAttrInfoMap != null) {
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
}
|
||||
try {
|
||||
|
||||
//写修改逻辑
|
||||
Thread.sleep(5000);
|
||||
for (DSarStandardDTO jjss : changeJJSS) {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", jjss.getId());
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(jjss.getId());
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
sarStandardsInfo.setTextStatus(map.get("即将实施"));
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(jjss.getId());
|
||||
if (bussAttrInfoMap != null) {
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
}
|
||||
try {
|
||||
|
||||
sarStandardsInfoService.updateSarStandardsInfo(sarStandardsInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
sarStandardsInfoService.updateSarStandardsInfo(sarStandardsInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (DSarStandardDTO jjss : changeXXYX) {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", jjss.getId());
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(jjss.getId());
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
sarStandardsInfo.setTextStatus(map.get("现行有效"));
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(jjss.getId());
|
||||
if (bussAttrInfoMap != null) {
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
}
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(sarStandardsInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
for (DSarStandardDTO jjss : changeXXYX) {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("ID", jjss.getId());
|
||||
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||
if (null != infos && infos.size() > 0) {
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(jjss.getId());
|
||||
sarStandardsInfo.setModifyTime(new Date());
|
||||
sarStandardsInfo.setTextStatus(map.get("现行有效"));
|
||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(jjss.getId());
|
||||
if (bussAttrInfoMap != null) {
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
}
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(sarStandardsInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}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