清单修改
This commit is contained in:
@@ -25,7 +25,7 @@ public class CreateUpdateMQService {
|
|||||||
**/
|
**/
|
||||||
public void sendMQ(Hashtable<String,String> hashtable , List<String> remove , List<String> add){
|
public void sendMQ(Hashtable<String,String> hashtable , List<String> remove , List<String> add){
|
||||||
Map<String,Object> map=new HashMap<>();
|
Map<String,Object> map=new HashMap<>();
|
||||||
map.put("table",hashtable);
|
map.put("tableData",hashtable);
|
||||||
map.put("remove",remove);
|
map.put("remove",remove);
|
||||||
map.put("add",add);
|
map.put("add",add);
|
||||||
//发送消息队列
|
//发送消息队列
|
||||||
|
|||||||
@@ -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.entity.SarStandardsInfo;
|
||||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||||
import com.adc.da.sys.service.IDicTypeEOService;
|
import com.adc.da.sys.service.IDicTypeEOService;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.rabbitmq.client.Channel;
|
import com.rabbitmq.client.Channel;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.messaging.Message;
|
import org.springframework.messaging.Message;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@@ -48,114 +51,156 @@ public class SendQdUpdateMQService {
|
|||||||
value = @Queue(value = "createQdUpdateMQ_SQ_GSAR_RELEASE", durable = "true"),
|
value = @Queue(value = "createQdUpdateMQ_SQ_GSAR_RELEASE", durable = "true"),
|
||||||
exchange = @Exchange(value = "qd-update-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
|
exchange = @Exchange(value = "qd-update-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
|
||||||
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 {
|
||||||
|
|
||||||
//数据字典数据组装
|
//数据字典数据组装
|
||||||
Map<String, Object> dicTypeEO = dicTypeEOService.getDicTypeListCode();
|
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");
|
List<Map<String, String>> arr = (List<Map<String, String>>) dicTypeEO.get("SYRZCLASS");
|
||||||
arr.forEach(stringStringMap -> {
|
arr.forEach(stringStringMap -> {
|
||||||
dict.put(stringStringMap.get("label"),stringStringMap.get("value"));
|
dict.put(stringStringMap.get("label"), stringStringMap.get("value"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//写修改逻辑
|
//写修改逻辑
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
Hashtable<String,String> tool= (Hashtable<String, String>) bussMap.get("table");
|
Hashtable<String, String> tool = (Hashtable<String, String>) bussMap.get("tableData");
|
||||||
List<String> remove= (List<String>) bussMap.get("remove");
|
List<String> remove = (List<String>) bussMap.get("remove");
|
||||||
List<String> add= (List<String>) bussMap.get("add");
|
List<String> add = (List<String>) bussMap.get("add");
|
||||||
remove.forEach(s -> {
|
remove.forEach(s -> {
|
||||||
QueryWrapper<SarStandardsInfo> wrapper=new QueryWrapper<>();
|
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("ID",s);
|
wrapper.eq("ID", s);
|
||||||
List<SarStandardsInfo> infos=sarStandardsInfoService.list(wrapper);
|
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||||
if (null!=infos && infos.size()>0) {
|
if (null != infos && infos.size() > 0) {
|
||||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||||
sarStandardsInfo.setId(s);
|
sarStandardsInfo.setId(s);
|
||||||
sarStandardsInfo.setIsRelateAccess("2");
|
sarStandardsInfo.setIsRelateAccess("2");
|
||||||
|
sarStandardsInfo.setModifyTime(new Date());
|
||||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(s);
|
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(s);
|
||||||
|
|
||||||
if (bussAttrInfoMap != null) {
|
if (bussAttrInfoMap != null) {
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
if (tool.get(s).contains(",")) {
|
if (null != tool.get(s)) {
|
||||||
for (String e : tool.get(s).split(",")) {
|
if (tool.get(s).contains(",")) {
|
||||||
stringBuilder.append(dict.get(e));
|
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 {
|
} 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<>();
|
QueryWrapper<SarLawsStandInfo> wrapper1 = new QueryWrapper<>();
|
||||||
wrapper.eq("ID",s);
|
wrapper1.eq("ID", s);
|
||||||
List<SarLawsStandInfo> infos1=lawsStandInfoService.list(wrapper1);
|
List<SarLawsStandInfo> infos1 = lawsStandInfoService.list(wrapper1);
|
||||||
if (null!=infos1 && infos1.size()>0) {
|
if (null != infos1 && infos1.size() > 0) {
|
||||||
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||||
sarLawsStandInfo.setId(s);
|
sarLawsStandInfo.setId(s);
|
||||||
sarLawsStandInfo.setIsRelateAccess("2");
|
sarLawsStandInfo.setIsRelateAccess("2");
|
||||||
|
sarLawsStandInfo.setModifyTime(new Date());
|
||||||
Map<String, Object> bussAttrInfoMap = lawsAttrInfoService.getBussAttrInfo(s);
|
Map<String, Object> bussAttrInfoMap = lawsAttrInfoService.getBussAttrInfo(s);
|
||||||
if (bussAttrInfoMap != null) {
|
if (bussAttrInfoMap != null) {
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
if (tool.get(s).contains(",")) {
|
if (null != tool.get(s)) {
|
||||||
for (String e : tool.get(s).split(",")) {
|
if (tool.get(s).contains(",")) {
|
||||||
stringBuilder.append(dict.get(e));
|
for (String e : tool.get(s).split(",")) {
|
||||||
|
stringBuilder.append(dict.get(e)+",");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stringBuilder.append(dict.get(s)+",");
|
||||||
}
|
}
|
||||||
} else {
|
} 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 -> {
|
add.forEach(s -> {
|
||||||
QueryWrapper<SarStandardsInfo> wrapper=new QueryWrapper<>();
|
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("ID",s);
|
wrapper.eq("ID", s);
|
||||||
List<SarStandardsInfo> infos=sarStandardsInfoService.list(wrapper);
|
List<SarStandardsInfo> infos = sarStandardsInfoService.list(wrapper);
|
||||||
if (null!=infos && infos.size()>0) {
|
if (null != infos && infos.size() > 0) {
|
||||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||||
sarStandardsInfo.setId(s);
|
sarStandardsInfo.setId(s);
|
||||||
sarStandardsInfo.setIsRelateAccess("1");
|
sarStandardsInfo.setIsRelateAccess("1");
|
||||||
|
sarStandardsInfo.setModifyTime(new Date());
|
||||||
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(s);
|
Map<String, Object> bussAttrInfoMap = iSarStandAttrInfoService.getBussAttrInfo(s);
|
||||||
if (bussAttrInfoMap != null) {
|
if (bussAttrInfoMap != null) {
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
if (tool.get(s).contains(",")) {
|
if (null != tool.get(s)) {
|
||||||
for (String e : tool.get(s).split(",")) {
|
if (tool.get(s).contains(",")) {
|
||||||
stringBuilder.append(dict.get(e));
|
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 {
|
} 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<>();
|
QueryWrapper<SarLawsStandInfo> wrapper1 = new QueryWrapper<>();
|
||||||
wrapper.eq("ID",s);
|
wrapper.eq("ID", s);
|
||||||
List<SarLawsStandInfo> infos1=lawsStandInfoService.list(wrapper1);
|
List<SarLawsStandInfo> infos1 = lawsStandInfoService.list(wrapper1);
|
||||||
if (null!=infos1 && infos1.size()>0) {
|
if (null != infos1 && infos1.size() > 0) {
|
||||||
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||||
sarLawsStandInfo.setId(s);
|
sarLawsStandInfo.setId(s);
|
||||||
sarLawsStandInfo.setIsRelateAccess("1");
|
sarLawsStandInfo.setIsRelateAccess("1");
|
||||||
|
sarLawsStandInfo.setModifyTime(new Date());
|
||||||
Map<String, Object> bussAttrInfoMap = lawsAttrInfoService.getBussAttrInfo(s);
|
Map<String, Object> bussAttrInfoMap = lawsAttrInfoService.getBussAttrInfo(s);
|
||||||
if (bussAttrInfoMap != null) {
|
if (bussAttrInfoMap != null) {
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
if (tool.get(s).contains(",")) {
|
if (null != tool.get(s)) {
|
||||||
for (String e : tool.get(s).split(",")) {
|
if (tool.get(s).contains(",")) {
|
||||||
stringBuilder.append(dict.get(e));
|
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 {
|
} 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());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,4 +118,7 @@ public class LawsDto {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "适用车型")
|
@ApiModelProperty(value = "适用车型")
|
||||||
private String applyArctic;
|
private String applyArctic;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "适用认证")
|
||||||
|
private String syrz;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.util.StringUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -81,6 +82,9 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
|||||||
}
|
}
|
||||||
if ("INLAND".equals(lawsDto.getStandType())) lawsDto.setStandType("INLAND_STAND");
|
if ("INLAND".equals(lawsDto.getStandType())) lawsDto.setStandType("INLAND_STAND");
|
||||||
if ("FOREIGN".equals(lawsDto.getStandType())) lawsDto.setStandType("FOREIGN_STAND");
|
if ("FOREIGN".equals(lawsDto.getStandType())) lawsDto.setStandType("FOREIGN_STAND");
|
||||||
|
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getSyrz())){
|
||||||
|
lawsDto.setSyrz(sarLawsAttrDetailedLists.get(0).getSyrz());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//适用车型
|
//适用车型
|
||||||
|
|||||||
+19
-15
@@ -701,15 +701,16 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
|||||||
res.forEach(sarLawsAttrDetailedList -> {
|
res.forEach(sarLawsAttrDetailedList -> {
|
||||||
list1.remove(sarLawsAttrDetailedList.getStandId());
|
list1.remove(sarLawsAttrDetailedList.getStandId());
|
||||||
});
|
});
|
||||||
//前面筛选出 移除认证清单
|
// //前面筛选出 移除认证清单
|
||||||
if (null!=list1 && list1.size()>0){
|
// if (null!=list1 && list1.size()>0){
|
||||||
sarStandardsInfoDao.updateISRELATEACCESSById("1", list1);
|
// sarStandardsInfoDao.updateISRELATEACCESSById("1", list1);
|
||||||
}
|
// }
|
||||||
//剩下的数据是需要加入到认证清单的
|
|
||||||
list2.removeAll(list1);
|
|
||||||
//下面写消息队列了开始
|
|
||||||
createUpdateMQService.sendMQ(hashtable,list1,list2);
|
|
||||||
}
|
}
|
||||||
|
//剩下的数据是需要加入到认证清单的
|
||||||
|
list2.removeAll(list1);
|
||||||
|
//下面写消息队列了开始
|
||||||
|
createUpdateMQService.sendMQ(hashtable,list1,list2);
|
||||||
// //更新标准是否纳入认证清单
|
// //更新标准是否纳入认证清单
|
||||||
// sarStandardsInfoDao.updateISRELATEACCESSById("1", Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
// sarStandardsInfoDao.updateISRELATEACCESSById("1", Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
||||||
|
|
||||||
@@ -719,22 +720,25 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
|||||||
private void dealWithHashTableData(List<String> list1, List<String> list2, Hashtable<String, String> hashtable, SarLawsAttrDetailedList sarLawsAttrDetailedList) {
|
private void dealWithHashTableData(List<String> list1, List<String> list2, Hashtable<String, String> hashtable, SarLawsAttrDetailedList sarLawsAttrDetailedList) {
|
||||||
list1.add(sarLawsAttrDetailedList.getStandId());
|
list1.add(sarLawsAttrDetailedList.getStandId());
|
||||||
list2.add(sarLawsAttrDetailedList.getStandId());
|
list2.add(sarLawsAttrDetailedList.getStandId());
|
||||||
if (null != hashtable.get(sarLawsAttrDetailedList.getId()) && null != sarLawsAttrDetailedList.getSyrz()) {
|
if (null != hashtable.get(sarLawsAttrDetailedList.getStandId()) && !"-".equals( sarLawsAttrDetailedList.getSyrz())) {
|
||||||
if (sarLawsAttrDetailedList.getSyrz().contains(",")) {
|
if (sarLawsAttrDetailedList.getSyrz().contains(",")) {
|
||||||
List<String> middle = new ArrayList<>(Arrays.asList(sarLawsAttrDetailedList.getSyrz().split(",")));
|
List<String> middle = new ArrayList<>(Arrays.asList(sarLawsAttrDetailedList.getSyrz().split(",")));
|
||||||
middle.forEach(s -> {
|
middle.forEach(s -> {
|
||||||
String as = hashtable.get(sarLawsAttrDetailedList.getId());
|
String as = hashtable.get(sarLawsAttrDetailedList.getStandId());
|
||||||
if (!as.contains(s)) {
|
if (!as.contains(s)) {
|
||||||
hashtable.put(sarLawsAttrDetailedList.getId(), as + "," + s);
|
hashtable.put(sarLawsAttrDetailedList.getStandId(), as + "," + s);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
}else {
|
||||||
|
hashtable.put(sarLawsAttrDetailedList.getStandId(), hashtable.get(sarLawsAttrDetailedList.getStandId()) + "," + sarLawsAttrDetailedList.getSyrz());
|
||||||
|
}
|
||||||
|
}else {
|
||||||
// 先确定hashTable中不为空
|
// 先确定hashTable中不为空
|
||||||
if (null != sarLawsAttrDetailedList.getSyrz()) {
|
if (!"-".equals( sarLawsAttrDetailedList.getSyrz())) {
|
||||||
hashtable.put(sarLawsAttrDetailedList.getId(), sarLawsAttrDetailedList.getSyrz());
|
hashtable.put(sarLawsAttrDetailedList.getStandId(), sarLawsAttrDetailedList.getSyrz());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user