feat: There is no way the, 动态消息库
This commit is contained in:
+81
@@ -18,6 +18,8 @@ import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.search.entity.SarBussionessStandEO;
|
||||
import com.adc.da.search.entity.StandLawsEO;
|
||||
import com.adc.da.search.service.StandLawsSearchService;
|
||||
import com.adc.da.slrs.NewsFeed.entity.NewsFeed;
|
||||
import com.adc.da.slrs.NewsFeed.service.INewsFeedService;
|
||||
import com.adc.da.slrs.otConvertMq.dao.OtConvertMqDao;
|
||||
import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
|
||||
@@ -155,6 +157,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
@Autowired
|
||||
private ISarMenuStandardService iSarMenuStandardService;
|
||||
|
||||
@Autowired
|
||||
private INewsFeedService iNewsFeedService;
|
||||
|
||||
@Override
|
||||
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus){
|
||||
return sarBussionessStandEODao.getStandInfoByReviseStatus(reviseStatus);
|
||||
@@ -238,6 +243,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
String content = "入库" + number + " 《" + sarBussionessStandEO.getStandName() + "》";
|
||||
String prcCreateUser = StringUtils.isNotBlank(sarBussionessStandEO.getPrcCreateUser()) ? sarBussionessStandEO.getPrcCreateUser() : "";
|
||||
sarUpdLogEOService.createBaseProcessLog(sarBussionessStandEO.getId(),"BUSINESS",content,prcCreateUser);
|
||||
saveNewFeed(sarBussionessStandEO,"2");
|
||||
if(elasflag) {
|
||||
attrInfoShowSearchDetails(sarBussionessStandEO,"add");
|
||||
createStandMQService.sendBussStandMQ(sarBussionessStandEO,"add");
|
||||
@@ -550,6 +556,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
|
||||
// 记录修改日志
|
||||
saveUpdateLog(sarBussionessStandEO,beforeStandEO);
|
||||
// saveNewFeed(sarBussionessStandEO,"2");
|
||||
if (elasflag) {
|
||||
attrInfoShowSearchDetails(sarBussionessStandEO,"upd");
|
||||
createStandMQService.sendBussStandMQ(sarBussionessStandEO, "update");
|
||||
@@ -558,6 +565,80 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
return sarBussionessStandEO;
|
||||
}
|
||||
|
||||
public void filterNewFeed(SarBussionessStand sarStandardsInfoEO,SarBussionessStand beforeSarStandardsInfo) throws Exception {
|
||||
Map<String, Object> newMap = new HashMap<>();
|
||||
Map<String, Object> oldMap = beforeSarStandardsInfo.getAttrInfoMap();
|
||||
String attrStr = sarStandardsInfoEO.getSarStandAttrEOStr();
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(attrStr)) {
|
||||
newMap = JSONObject.fromObject(attrStr);
|
||||
}
|
||||
|
||||
// 发布稿
|
||||
List<String> fbgNew = Arrays.stream(newMap.getOrDefault("FBGBJBD", "").toString().split(","))
|
||||
.map(String::trim).collect(Collectors.toList());
|
||||
|
||||
List<String> fbgOld = Arrays.stream(oldMap.getOrDefault("FBGBJBD", "").toString().split(","))
|
||||
.map(String::trim).collect(Collectors.toList());
|
||||
// 取差集 判断是否有新的发布稿
|
||||
List<String> filterDisunityFbg = fbgNew.stream()
|
||||
.filter(item -> !new ArrayList<>(fbgOld)
|
||||
.contains(item))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 在研稿件
|
||||
String strUsNew = newMap.getOrDefault("CA", "").toString()+
|
||||
","+newMap.getOrDefault("GLWJ", "").toString()+
|
||||
","+newMap.getOrDefault("XGD", "").toString()+
|
||||
","+newMap.getOrDefault("BPG", "").toString()+
|
||||
","+newMap.getOrDefault("ZQYJG", "").toString()+
|
||||
","+newMap.getOrDefault("SSG", "").toString()+
|
||||
","+newMap.getOrDefault("JDWJ", "").toString()+
|
||||
","+newMap.getOrDefault("KWJ", "").toString()+
|
||||
","+newMap.getOrDefault("XDB", "").toString()+
|
||||
","+newMap.getOrDefault("ZBJBD", "").toString();
|
||||
String strUsOld = oldMap.getOrDefault("CA", "").toString()+
|
||||
","+oldMap.getOrDefault("GLWJ", "").toString()+
|
||||
","+oldMap.getOrDefault("XGD", "").toString()+
|
||||
","+oldMap.getOrDefault("BPG", "").toString()+
|
||||
","+oldMap.getOrDefault("ZQYJG", "").toString()+
|
||||
","+oldMap.getOrDefault("SSG", "").toString()+
|
||||
","+oldMap.getOrDefault("JDWJ", "").toString()+
|
||||
","+oldMap.getOrDefault("KWJ", "").toString()+
|
||||
","+oldMap.getOrDefault("XDB", "").toString()+
|
||||
","+oldMap.getOrDefault("ZBJBD", "").toString();
|
||||
List<String> usNew = Arrays.stream(strUsNew.split(","))
|
||||
.map(String::trim).collect(Collectors.toList());
|
||||
List<String> usOld = Arrays.stream(strUsOld.split(","))
|
||||
.map(String::trim).collect(Collectors.toList());
|
||||
// 取差集 判断是否有新的在研稿件
|
||||
List<String> filterDisunityUs = usNew.stream()
|
||||
.filter(item -> !new ArrayList<>(usOld)
|
||||
.contains(item))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 0 发布稿件 新的文件数量 大于等于 在研稿件 就属于发布动态消息 则 为 1 在研
|
||||
if(filterDisunityFbg.size() >= filterDisunityUs.size()){
|
||||
saveNewFeed(sarStandardsInfoEO, "2");
|
||||
}else {
|
||||
saveNewFeed(sarStandardsInfoEO, "");
|
||||
}
|
||||
}
|
||||
|
||||
private void saveNewFeed(SarBussionessStand sarStandardsInfoEO, String s) {
|
||||
NewsFeed newsFeed = new NewsFeed();
|
||||
newsFeed.setId(UUIDUtils.randomUUID20());
|
||||
newsFeed.setRenewTime(new Date());
|
||||
newsFeed.setStandardId(sarStandardsInfoEO.getId());
|
||||
newsFeed.setResourceType("BUSINESS");
|
||||
newsFeed.setMessageType(s);
|
||||
newsFeed.setStandard(verifyObj(sarStandardsInfoEO.getStandCode()).toString());
|
||||
newsFeed.setStandardName(verifyObj(sarStandardsInfoEO.getStandName()).toString());
|
||||
newsFeed.setReleaseDate(verifyObj(sarStandardsInfoEO.getIssueTime()).toString());
|
||||
// 企标 技术标准或产品标准走完流程 文本状态默认 发布状态
|
||||
newsFeed.setTextState("6jnqba2mby");
|
||||
iNewsFeedService.insertNewsFeed(newsFeed);
|
||||
}
|
||||
|
||||
public void saveUpdateLog(SarBussionessStand sarStandardsInfoEO,SarBussionessStand beforeSarStandardsInfo) throws Exception{
|
||||
Map<String,Object> newMap = new HashMap<>();
|
||||
Map<String,Object> oldMap = beforeSarStandardsInfo.getAttrInfoMap();
|
||||
|
||||
Reference in New Issue
Block a user