清单修改 使用mq
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
package com.adc.da.mq;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
|
||||||
|
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.Hashtable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class CreateUpdateMQService {
|
||||||
|
@Autowired
|
||||||
|
private AmqpTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author yuezhihang
|
||||||
|
* @Description 创建消息队列
|
||||||
|
* Date 2018/8/24 13:59
|
||||||
|
* @Param [convert, convertType]
|
||||||
|
* @return int
|
||||||
|
**/
|
||||||
|
public void sendMQ(Hashtable<String,String> hashtable , List<String> remove , List<String> add){
|
||||||
|
Map<String,Object> map=new HashMap<>();
|
||||||
|
map.put("table",hashtable);
|
||||||
|
map.put("remove",remove);
|
||||||
|
map.put("add",add);
|
||||||
|
//发送消息队列
|
||||||
|
this.rabbitTemplate.convertAndSend("qd-update-exchange_SQ_GSAR_RELEASE", "qd-update-key_SQ_GSAR_RELEASE", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
package com.adc.da.mq;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
|
||||||
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||||
|
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
|
||||||
|
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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.rabbitmq.client.Channel;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
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.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.messaging.Message;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class SendQdUpdateMQService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarStandAttrInfoService iSarStandAttrInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarStandardsInfoService sarStandardsInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarLawsStandInfoService lawsStandInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISarLawsAttrInfoService lawsAttrInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
//查询数据字典
|
||||||
|
@Autowired
|
||||||
|
private IDicTypeEOService dicTypeEOService;
|
||||||
|
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(SendQdUpdateMQService.class);
|
||||||
|
|
||||||
|
|
||||||
|
@RabbitListener(bindings = @QueueBinding(
|
||||||
|
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{
|
||||||
|
|
||||||
|
//数据字典数据组装
|
||||||
|
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("table");
|
||||||
|
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");
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stringBuilder.append(dict.get(s));
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||||
|
sarLawsStandInfo.setId(s);
|
||||||
|
sarLawsStandInfo.setIsRelateAccess("2");
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stringBuilder.append(dict.get(s));
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||||
|
sarStandardsInfo.setId(s);
|
||||||
|
sarStandardsInfo.setIsRelateAccess("1");
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stringBuilder.append(dict.get(s));
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
|
||||||
|
sarLawsStandInfo.setId(s);
|
||||||
|
sarLawsStandInfo.setIsRelateAccess("1");
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stringBuilder.append(dict.get(s));
|
||||||
|
}
|
||||||
|
bussAttrInfoMap.replace("SYRZ", stringBuilder.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+4
@@ -55,4 +55,8 @@ public class SarLawsAttrDetailedList extends BaseEntity {
|
|||||||
@TableField(value = "zccssrq")
|
@TableField(value = "zccssrq")
|
||||||
private String zccssrq;
|
private String zccssrq;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "适用认证")
|
||||||
|
@TableField(value = "syrz")
|
||||||
|
private String syrz;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -224,6 +224,7 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
|||||||
.ssrq(timeDto1.getSsrq())
|
.ssrq(timeDto1.getSsrq())
|
||||||
.xcxssrq(timeDto1.getXcxssrqgj())
|
.xcxssrq(timeDto1.getXcxssrqgj())
|
||||||
.zccssrq(timeDto1.getZccssrqgj())
|
.zccssrq(timeDto1.getZccssrqgj())
|
||||||
|
.syrz(timeDto1.getSyrz())
|
||||||
.build();
|
.build();
|
||||||
attrDetailedLists.add(sarLawsAttrDetailedList);
|
attrDetailedLists.add(sarLawsAttrDetailedList);
|
||||||
a++;
|
a++;
|
||||||
|
|||||||
+4
@@ -3,6 +3,8 @@ package com.adc.da.slrs.sarLawsAttrInfo.service;
|
|||||||
import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
|
import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务类
|
* 服务类
|
||||||
@@ -16,4 +18,6 @@ public interface ISarLawsAttrInfoService extends IService<SarLawsAttrInfo> {
|
|||||||
String selectFieldValByLawsId(String field,String standId);
|
String selectFieldValByLawsId(String field,String standId);
|
||||||
|
|
||||||
int updateLawsInfo(String standId,String field,String value);
|
int updateLawsInfo(String standId,String field,String value);
|
||||||
|
|
||||||
|
Map<String, Object> getBussAttrInfo(String standId);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -3,9 +3,12 @@ package com.adc.da.slrs.sarLawsAttrInfo.service.impl;
|
|||||||
import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
|
import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
|
||||||
import com.adc.da.slrs.sarLawsAttrInfo.dao.SarLawsAttrInfoDao;
|
import com.adc.da.slrs.sarLawsAttrInfo.dao.SarLawsAttrInfoDao;
|
||||||
import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
|
import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
|
||||||
|
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务实现类
|
* 服务实现类
|
||||||
@@ -26,4 +29,10 @@ public class SarLawsAttrInfoServiceImpl extends ServiceImpl<SarLawsAttrInfoDao,
|
|||||||
public int updateLawsInfo(String standId,String field,String value){
|
public int updateLawsInfo(String standId,String field,String value){
|
||||||
return this.baseMapper.updateLawsInfo(standId,field,value);
|
return this.baseMapper.updateLawsInfo(standId,field,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getBussAttrInfo(String standId) {
|
||||||
|
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
|
||||||
|
return this.baseMapper.selectLawsFieldAndData(fieldInfo,standId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -68,4 +68,8 @@ public class DetailedUpDto {
|
|||||||
@ApiModelProperty(value = "新车型实施时间")
|
@ApiModelProperty(value = "新车型实施时间")
|
||||||
private String inforlist3;
|
private String inforlist3;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "适用认证")
|
||||||
|
private String inforlist4;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,4 +23,7 @@ public class TimeDto {
|
|||||||
@ApiModelProperty(value = "新车型实施日期")
|
@ApiModelProperty(value = "新车型实施日期")
|
||||||
private String xcxssrqgj;
|
private String xcxssrqgj;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "适用认证")
|
||||||
|
private String syrz;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+57
-7
@@ -1,6 +1,7 @@
|
|||||||
package com.adc.da.slrs.sarLawsDetailedList.service.impl;
|
package com.adc.da.slrs.sarLawsDetailedList.service.impl;
|
||||||
|
|
||||||
import com.adc.da.att.service.IAttFileEOService;
|
import com.adc.da.att.service.IAttFileEOService;
|
||||||
|
import com.adc.da.mq.CreateUpdateMQService;
|
||||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||||
import com.adc.da.slrs.sarBussionessStand.dao.SarBussionessStandDao;
|
import com.adc.da.slrs.sarBussionessStand.dao.SarBussionessStandDao;
|
||||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||||
@@ -86,6 +87,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IDicTypeEOService dicTypeEOService;
|
private IDicTypeEOService dicTypeEOService;
|
||||||
|
|
||||||
|
//查询数据字典
|
||||||
|
@Autowired
|
||||||
|
private CreateUpdateMQService createUpdateMQService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String del(List<String> idList) {
|
public String del(List<String> idList) {
|
||||||
@@ -633,6 +638,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
|||||||
String[] putTime = detailedUpDto.getInforlist1().split(";");
|
String[] putTime = detailedUpDto.getInforlist1().split(";");
|
||||||
String[] zcc = detailedUpDto.getInforlist2().split(";");
|
String[] zcc = detailedUpDto.getInforlist2().split(";");
|
||||||
String[] xcx = detailedUpDto.getInforlist3().split(";");
|
String[] xcx = detailedUpDto.getInforlist3().split(";");
|
||||||
|
String[] syrz = detailedUpDto.getInforlist4().split(";");
|
||||||
for (int a = 0; a < id.length; a++) {
|
for (int a = 0; a < id.length; a++) {
|
||||||
TimeDto dto = new TimeDto();
|
TimeDto dto = new TimeDto();
|
||||||
dto.setStandId(id[a]);
|
dto.setStandId(id[a]);
|
||||||
@@ -641,16 +647,21 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
|||||||
} else {
|
} else {
|
||||||
dto.setSsrq(putTime[a]);
|
dto.setSsrq(putTime[a]);
|
||||||
}
|
}
|
||||||
if (putTime.length <= a) {
|
if (xcx.length <= a) {
|
||||||
dto.setXcxssrqgj(null);
|
dto.setXcxssrqgj(null);
|
||||||
} else {
|
} else {
|
||||||
dto.setXcxssrqgj(xcx[a]);
|
dto.setXcxssrqgj(xcx[a]);
|
||||||
}
|
}
|
||||||
if (putTime.length <= a) {
|
if (zcc.length <= a) {
|
||||||
dto.setZccssrqgj(null);
|
dto.setZccssrqgj(null);
|
||||||
} else {
|
} else {
|
||||||
dto.setZccssrqgj(zcc[a]);
|
dto.setZccssrqgj(zcc[a]);
|
||||||
}
|
}
|
||||||
|
if (syrz.length <= a) {
|
||||||
|
dto.setSyrz(null);
|
||||||
|
} else {
|
||||||
|
dto.setSyrz(syrz[a]);
|
||||||
|
}
|
||||||
timeDto.add(dto);
|
timeDto.add(dto);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -659,6 +670,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
|||||||
dto.setSsrq(detailedUpDto.getInforlist1());
|
dto.setSsrq(detailedUpDto.getInforlist1());
|
||||||
dto.setXcxssrqgj(detailedUpDto.getInforlist2());
|
dto.setXcxssrqgj(detailedUpDto.getInforlist2());
|
||||||
dto.setZccssrqgj(detailedUpDto.getInforlist3());
|
dto.setZccssrqgj(detailedUpDto.getInforlist3());
|
||||||
|
dto.setSyrz(detailedUpDto.getInforlist4());
|
||||||
timeDto.add(dto);
|
timeDto.add(dto);
|
||||||
}
|
}
|
||||||
service.updateDetailedLaws(detailedUpDto.getId(), timeDto);
|
service.updateDetailedLaws(detailedUpDto.getId(), timeDto);
|
||||||
@@ -666,24 +678,62 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
|||||||
wrapper.eq("detailed_list_id",detailedUpDto.getId());
|
wrapper.eq("detailed_list_id",detailedUpDto.getId());
|
||||||
List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists=sarLawsAttrDetailedListDao.selectList(wrapper);
|
List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists=sarLawsAttrDetailedListDao.selectList(wrapper);
|
||||||
List<String> list1=new ArrayList<>();
|
List<String> list1=new ArrayList<>();
|
||||||
|
List<String> list2=new ArrayList<>();
|
||||||
|
//避免出现数据丢失 处理一下适用认证信息
|
||||||
|
Hashtable<String,String> hashtable=new Hashtable<>();
|
||||||
if (sarLawsAttrDetailedLists.size()>0){
|
if (sarLawsAttrDetailedLists.size()>0){
|
||||||
sarLawsAttrDetailedLists.forEach(sarLawsAttrDetailedList -> {list1.add(sarLawsAttrDetailedList.getStandId());});
|
sarLawsAttrDetailedLists.forEach(sarLawsAttrDetailedList -> {
|
||||||
|
dealWithHashTableData(list1, list2, hashtable, sarLawsAttrDetailedList);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
list1.removeAll(Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
list1.removeAll(Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
||||||
if (list1.size()>0){
|
if (list1.size()>0){
|
||||||
QueryWrapper<SarLawsAttrDetailedList> wrapper1 = new QueryWrapper<>();
|
QueryWrapper<SarLawsAttrDetailedList> wrapper1 = new QueryWrapper<>();
|
||||||
wrapper1.in("stand_id",list1);
|
wrapper1.in("stand_id",list1);
|
||||||
List<SarLawsAttrDetailedList> res=sarLawsAttrDetailedListDao.selectList(wrapper);
|
List<SarLawsAttrDetailedList> res=sarLawsAttrDetailedListDao.selectList(wrapper);
|
||||||
|
if (res.size()>0){
|
||||||
|
res.forEach(sarLawsAttrDetailedList -> {
|
||||||
|
dealWithHashTableData(list1, list2, hashtable, sarLawsAttrDetailedList);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
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("2", list1);
|
sarStandardsInfoDao.updateISRELATEACCESSById("1", list1);
|
||||||
|
}
|
||||||
|
//剩下的数据是需要加入到认证清单的
|
||||||
|
list2.removeAll(list1);
|
||||||
|
//下面写消息队列了开始
|
||||||
|
createUpdateMQService.sendMQ(hashtable,list1,list2);
|
||||||
|
}
|
||||||
|
// //更新标准是否纳入认证清单
|
||||||
|
// sarStandardsInfoDao.updateISRELATEACCESSById("1", Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dealWithHashTableData(List<String> list1, List<String> list2, Hashtable<String, String> hashtable, SarLawsAttrDetailedList sarLawsAttrDetailedList) {
|
||||||
|
list1.add(sarLawsAttrDetailedList.getStandId());
|
||||||
|
list2.add(sarLawsAttrDetailedList.getStandId());
|
||||||
|
if (null != hashtable.get(sarLawsAttrDetailedList.getId()) && null != sarLawsAttrDetailedList.getSyrz()) {
|
||||||
|
if (sarLawsAttrDetailedList.getSyrz().contains(",")) {
|
||||||
|
List<String> middle = new ArrayList<>(Arrays.asList(sarLawsAttrDetailedList.getSyrz().split(",")));
|
||||||
|
middle.forEach(s -> {
|
||||||
|
String as = hashtable.get(sarLawsAttrDetailedList.getId());
|
||||||
|
if (!as.contains(s)) {
|
||||||
|
hashtable.put(sarLawsAttrDetailedList.getId(), as + "," + s);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 先确定hashTable中不为空
|
||||||
|
if (null != sarLawsAttrDetailedList.getSyrz()) {
|
||||||
|
hashtable.put(sarLawsAttrDetailedList.getId(), sarLawsAttrDetailedList.getSyrz());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//更新标准是否纳入认证清单
|
|
||||||
sarStandardsInfoDao.updateISRELATEACCESSById("1", Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
@@ -3,6 +3,8 @@ package com.adc.da.slrs.sarStandAttrInfo.service;
|
|||||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务类
|
* 服务类
|
||||||
@@ -16,4 +18,6 @@ public interface ISarStandAttrInfoService extends IService<SarStandAttrInfo> {
|
|||||||
String selectFieldValByStandId(String field,String standId);
|
String selectFieldValByStandId(String field,String standId);
|
||||||
|
|
||||||
int updateStandInfo(String standId,String field,String value);
|
int updateStandInfo(String standId,String field,String value);
|
||||||
|
|
||||||
|
Map<String, Object> getBussAttrInfo(String standId);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -3,10 +3,13 @@ package com.adc.da.slrs.sarStandAttrInfo.service.impl;
|
|||||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||||
import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService;
|
import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService;
|
||||||
|
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
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 java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务实现类
|
* 服务实现类
|
||||||
@@ -30,4 +33,10 @@ public class SarStandAttrInfoServiceImpl extends ServiceImpl<SarStandAttrInfoDao
|
|||||||
public int updateStandInfo(String standId,String field,String value){
|
public int updateStandInfo(String standId,String field,String value){
|
||||||
return dao.updateStandInfo(standId,field,value);
|
return dao.updateStandInfo(standId,field,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map getBussAttrInfo(String standId){
|
||||||
|
String fieldInfo = InitStandAttrUtil.queryField;
|
||||||
|
return this.baseMapper.selectStandFieldAndData(fieldInfo,standId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -389,9 +389,10 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertList">
|
<insert id="insertList">
|
||||||
INSERT INTO sar_laws_attr_detailed_list ( id, number, detailed_list_id, stand_id ,ssrq,xcxssrq,zccssrq) VALUES
|
INSERT INTO sar_laws_attr_detailed_list ( id, number, detailed_list_id, stand_id ,ssrq,xcxssrq,zccssrq,syrz) VALUES
|
||||||
<foreach collection ="sarLawsAttrDetailedLists" item="list" separator =",">
|
<foreach collection ="sarLawsAttrDetailedLists" item="list" separator =",">
|
||||||
(#{list.id,jdbcType=VARCHAR}, #{list.number}, #{list.detailedListId,jdbcType=VARCHAR}, #{list.standId,jdbcType=VARCHAR},#{list.ssrq,jdbcType=VARCHAR},#{list.xcxssrq,jdbcType=VARCHAR},#{list.zccssrq,jdbcType=VARCHAR})
|
(#{list.id,jdbcType=VARCHAR}, #{list.number}, #{list.detailedListId,jdbcType=VARCHAR}, #{list.standId,jdbcType=VARCHAR},#{list.ssrq,jdbcType=VARCHAR},#{list.xcxssrq,jdbcType=VARCHAR},#{list.zccssrq,jdbcType=VARCHAR}
|
||||||
|
,#{list.syrz,jdbcType=VARCHAR})
|
||||||
</foreach >
|
</foreach >
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user