清单修改
This commit is contained in:
@@ -7,8 +7,10 @@ import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.sys.service.IDicTypeEOService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
@@ -18,6 +20,7 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
@@ -48,114 +51,156 @@ public class SendQdUpdateMQService {
|
||||
value = @Queue(value = "createQdUpdateMQ_SQ_GSAR_RELEASE", durable = "true"),
|
||||
exchange = @Exchange(value = "qd-update-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
|
||||
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 {
|
||||
|
||||
//数据字典数据组装
|
||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
||||
Map<String,String> dict=new HashMap<>();
|
||||
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"));
|
||||
dict.put(stringStringMap.get("label"), stringStringMap.get("value"));
|
||||
});
|
||||
|
||||
|
||||
//写修改逻辑
|
||||
//写修改逻辑
|
||||
Thread.sleep(5000);
|
||||
Hashtable<String,String> tool= (Hashtable<String, String>) bussMap.get("table");
|
||||
List<String> remove= (List<String>) bussMap.get("remove");
|
||||
List<String> add= (List<String>) bussMap.get("add");
|
||||
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) {
|
||||
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 (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e));
|
||||
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(s)+",");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0,stringBuilder.length()-1));
|
||||
} else {
|
||||
stringBuilder.append(dict.get(s));
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
bussAttrInfoMap.replace("SYRZ", stringBuilder.toString());
|
||||
}
|
||||
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) {
|
||||
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 (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e));
|
||||
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(s)+",");
|
||||
}
|
||||
} else {
|
||||
stringBuilder.append(dict.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.replace("SYRZ", stringBuilder.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
add.forEach(s -> {
|
||||
QueryWrapper<SarStandardsInfo> wrapper=new QueryWrapper<>();
|
||||
wrapper.eq("ID",s);
|
||||
List<SarStandardsInfo> infos=sarStandardsInfoService.list(wrapper);
|
||||
if (null!=infos && infos.size()>0) {
|
||||
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 (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e));
|
||||
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(s)+",");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ",stringBuilder.toString().substring(0,stringBuilder.length()-1) );
|
||||
} else {
|
||||
stringBuilder.append(dict.get(s));
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(sarStandardsInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
bussAttrInfoMap.replace("SYRZ", stringBuilder.toString());
|
||||
}
|
||||
}
|
||||
|
||||
QueryWrapper<SarLawsStandInfo> wrapper1=new QueryWrapper<>();
|
||||
wrapper.eq("ID",s);
|
||||
List<SarLawsStandInfo> infos1=lawsStandInfoService.list(wrapper1);
|
||||
if (null!=infos1 && infos1.size()>0) {
|
||||
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 (tool.get(s).contains(",")) {
|
||||
for (String e : tool.get(s).split(",")) {
|
||||
stringBuilder.append(dict.get(e));
|
||||
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(s)+",");
|
||||
}
|
||||
bussAttrInfoMap.put("SYRZ", stringBuilder.toString().substring(0,stringBuilder.length()-1));
|
||||
} else {
|
||||
stringBuilder.append(dict.get(s));
|
||||
bussAttrInfoMap.put("SYRZ", "");
|
||||
}
|
||||
sarLawsStandInfo.setSarStandAttrEOStr(JSONObject.toJSONString(bussAttrInfoMap));
|
||||
try {
|
||||
lawsStandInfoService.updateSarLawsStandInfo(sarLawsStandInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
bussAttrInfoMap.replace("SYRZ", stringBuilder.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user