feat: There is no way the, 动态消息库
This commit is contained in:
+15
-2
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,13 +39,25 @@ public class NewsFeedController extends BaseController<NewsFeed> {
|
|||||||
@GetMapping("/getNewsFeed")
|
@GetMapping("/getNewsFeed")
|
||||||
public ResponseMessage<IPage<NewsFeed>> NewFeedPage(NewsFeedPage page){
|
public ResponseMessage<IPage<NewsFeed>> NewFeedPage(NewsFeedPage page){
|
||||||
IPage<NewsFeed> iPage = new Page<>();
|
IPage<NewsFeed> iPage = new Page<>();
|
||||||
|
iPage.setCurrent(page.getPage());
|
||||||
iPage.setSize(page.getPageSize());
|
iPage.setSize(page.getPageSize());
|
||||||
iPage.setTotal(page.getPage());
|
List<String> list = new ArrayList<>();
|
||||||
|
if("GNWBZFG".equals(page.getMessageType())){
|
||||||
|
list.add("hc99551723c");
|
||||||
|
}else if("ZYBZFG".equals(page.getMessageType())){
|
||||||
|
list.add("hya6gay4vx");
|
||||||
|
list.add("8rjsx83ows");
|
||||||
|
list.add("ncb6osftj8");
|
||||||
|
list.add("3dx7oy5jff");
|
||||||
|
}else if("QYBZFB".equals(page.getMessageType())){
|
||||||
|
list.add("6jnqba2mby");
|
||||||
|
}
|
||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.eq(StringUtils.isNotEmpty(page.getStandardId()),"STANDARD_ID",page.getStandardId());
|
queryWrapper.eq(StringUtils.isNotEmpty(page.getStandardId()),"STANDARD_ID",page.getStandardId());
|
||||||
queryWrapper.eq(StringUtils.isNotEmpty(page.getStandardName()),"STANDARD_NAME",page.getStandardName());
|
queryWrapper.eq(StringUtils.isNotEmpty(page.getStandardName()),"STANDARD_NAME",page.getStandardName());
|
||||||
queryWrapper.eq("MESSAGE_TYPE",page.getMessageType());
|
queryWrapper.eq("MESSAGE_TYPE",page.getMessageType());
|
||||||
queryWrapper.orderByDesc("UPDATE_TIME");
|
queryWrapper.in("TEXT_STATE",list);
|
||||||
|
queryWrapper.orderByDesc("RENEW_TIME");
|
||||||
IPage<NewsFeed> newsFeedList = newsFeedService.page(iPage,queryWrapper);
|
IPage<NewsFeed> newsFeedList = newsFeedService.page(iPage,queryWrapper);
|
||||||
return Result.success(newsFeedList);
|
return Result.success(newsFeedList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.adc.da.slrs.NewsFeed.entity;
|
|||||||
import com.adc.da.base.entity.BaseEntity;
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -59,5 +60,6 @@ public class NewsFeed extends BaseEntity {
|
|||||||
|
|
||||||
@TableField("RENEW_TIME")
|
@TableField("RENEW_TIME")
|
||||||
@ApiModelProperty(value = "更新时间")
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date renewTime;
|
private Date renewTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import org.springframework.stereotype.Service;
|
|||||||
* @Date: 2022/5/23 0023 15:01
|
* @Date: 2022/5/23 0023 15:01
|
||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
*/
|
*/
|
||||||
@Service
|
|
||||||
public interface INewsFeedService extends IService<NewsFeed> {
|
public interface INewsFeedService extends IService<NewsFeed> {
|
||||||
int insertNewsFeed(NewsFeed newsFeed);
|
int insertNewsFeed(NewsFeed newsFeed);
|
||||||
}
|
}
|
||||||
|
|||||||
+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.SarBussionessStandEO;
|
||||||
import com.adc.da.search.entity.StandLawsEO;
|
import com.adc.da.search.entity.StandLawsEO;
|
||||||
import com.adc.da.search.service.StandLawsSearchService;
|
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.dao.OtConvertMqDao;
|
||||||
import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
|
import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
|
||||||
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
|
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
|
||||||
@@ -155,6 +157,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISarMenuStandardService iSarMenuStandardService;
|
private ISarMenuStandardService iSarMenuStandardService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private INewsFeedService iNewsFeedService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus){
|
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus){
|
||||||
return sarBussionessStandEODao.getStandInfoByReviseStatus(reviseStatus);
|
return sarBussionessStandEODao.getStandInfoByReviseStatus(reviseStatus);
|
||||||
@@ -238,6 +243,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String content = "入库" + number + " 《" + sarBussionessStandEO.getStandName() + "》";
|
String content = "入库" + number + " 《" + sarBussionessStandEO.getStandName() + "》";
|
||||||
String prcCreateUser = StringUtils.isNotBlank(sarBussionessStandEO.getPrcCreateUser()) ? sarBussionessStandEO.getPrcCreateUser() : "";
|
String prcCreateUser = StringUtils.isNotBlank(sarBussionessStandEO.getPrcCreateUser()) ? sarBussionessStandEO.getPrcCreateUser() : "";
|
||||||
sarUpdLogEOService.createBaseProcessLog(sarBussionessStandEO.getId(),"BUSINESS",content,prcCreateUser);
|
sarUpdLogEOService.createBaseProcessLog(sarBussionessStandEO.getId(),"BUSINESS",content,prcCreateUser);
|
||||||
|
saveNewFeed(sarBussionessStandEO,"2");
|
||||||
if(elasflag) {
|
if(elasflag) {
|
||||||
attrInfoShowSearchDetails(sarBussionessStandEO,"add");
|
attrInfoShowSearchDetails(sarBussionessStandEO,"add");
|
||||||
createStandMQService.sendBussStandMQ(sarBussionessStandEO,"add");
|
createStandMQService.sendBussStandMQ(sarBussionessStandEO,"add");
|
||||||
@@ -550,6 +556,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
|
|
||||||
// 记录修改日志
|
// 记录修改日志
|
||||||
saveUpdateLog(sarBussionessStandEO,beforeStandEO);
|
saveUpdateLog(sarBussionessStandEO,beforeStandEO);
|
||||||
|
// saveNewFeed(sarBussionessStandEO,"2");
|
||||||
if (elasflag) {
|
if (elasflag) {
|
||||||
attrInfoShowSearchDetails(sarBussionessStandEO,"upd");
|
attrInfoShowSearchDetails(sarBussionessStandEO,"upd");
|
||||||
createStandMQService.sendBussStandMQ(sarBussionessStandEO, "update");
|
createStandMQService.sendBussStandMQ(sarBussionessStandEO, "update");
|
||||||
@@ -558,6 +565,80 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
return sarBussionessStandEO;
|
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{
|
public void saveUpdateLog(SarBussionessStand sarStandardsInfoEO,SarBussionessStand beforeSarStandardsInfo) throws Exception{
|
||||||
Map<String,Object> newMap = new HashMap<>();
|
Map<String,Object> newMap = new HashMap<>();
|
||||||
Map<String,Object> oldMap = beforeSarStandardsInfo.getAttrInfoMap();
|
Map<String,Object> oldMap = beforeSarStandardsInfo.getAttrInfoMap();
|
||||||
|
|||||||
+98
-1
@@ -4,6 +4,8 @@ import com.adc.da.att.dao.AttFileEODao;
|
|||||||
import com.adc.da.att.entity.AttFileEO;
|
import com.adc.da.att.entity.AttFileEO;
|
||||||
import com.adc.da.person.entity.StandInfo;
|
import com.adc.da.person.entity.StandInfo;
|
||||||
import com.adc.da.person.entity.TsPersonCollect;
|
import com.adc.da.person.entity.TsPersonCollect;
|
||||||
|
import com.adc.da.slrs.NewsFeed.entity.NewsFeed;
|
||||||
|
import com.adc.da.slrs.NewsFeed.service.INewsFeedService;
|
||||||
import com.adc.da.slrs.regulations.dao.StandDataDao;
|
import com.adc.da.slrs.regulations.dao.StandDataDao;
|
||||||
import com.adc.da.slrs.regulations.entity.SearchStandContext;
|
import com.adc.da.slrs.regulations.entity.SearchStandContext;
|
||||||
import com.adc.da.slrs.regulations.entity.StandData;
|
import com.adc.da.slrs.regulations.entity.StandData;
|
||||||
@@ -105,11 +107,13 @@ import org.apache.poi.openxml4j.opc.OPCPackage;
|
|||||||
import org.apache.poi.poifs.filesystem.FileMagic;
|
import org.apache.poi.poifs.filesystem.FileMagic;
|
||||||
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
|
import org.json.JSONArray;
|
||||||
import org.json.JSONTokener;
|
import org.json.JSONTokener;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
@@ -278,6 +282,10 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AttFileEODao attFileEODao;
|
private AttFileEODao attFileEODao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private INewsFeedService iNewsFeedService;
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 反向操作标准
|
// * 反向操作标准
|
||||||
// */
|
// */
|
||||||
@@ -1018,7 +1026,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||||
if (StringUtils.isNotBlank(entry.getValue().toString())) {
|
if (StringUtils.isNotBlank(entry.getValue().toString())) {
|
||||||
Object json = new JSONTokener(entry.getValue().toString()).nextValue();
|
Object json = new JSONTokener(entry.getValue().toString()).nextValue();
|
||||||
if (json instanceof org.json.JSONArray) {
|
if (json instanceof JSONArray) {
|
||||||
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(), String.class);
|
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(), String.class);
|
||||||
} else {
|
} else {
|
||||||
value = entry.getValue().toString();
|
value = entry.getValue().toString();
|
||||||
@@ -1227,6 +1235,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
}
|
}
|
||||||
String content = "入库" + number + " 《" + sarStandardsInfoEO.getStandName() + "》";
|
String content = "入库" + number + " 《" + sarStandardsInfoEO.getStandName() + "》";
|
||||||
sarUpdLogEOService.createBaseLog(sarStandardsInfoEO.getId(), sarStandardsInfoEO.getStandType() + "_STAND", content);
|
sarUpdLogEOService.createBaseLog(sarStandardsInfoEO.getId(), sarStandardsInfoEO.getStandType() + "_STAND", content);
|
||||||
|
SarStandardsInfo old = new SarStandardsInfo();
|
||||||
|
filterNewFeed(sarStandardsInfoEO,old);
|
||||||
if (elasflag) {
|
if (elasflag) {
|
||||||
// 消息队列
|
// 消息队列
|
||||||
attrInfoShowSearchDetails(sarStandardsInfoEO, "add");
|
attrInfoShowSearchDetails(sarStandardsInfoEO, "add");
|
||||||
@@ -1927,6 +1937,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
// replaseStandState(sarStandardsInfoEO);
|
// replaseStandState(sarStandardsInfoEO);
|
||||||
// 记录修改日志
|
// 记录修改日志
|
||||||
saveUpdateLog(sarStandardsInfoEO, beforeSarStandardsInfo);
|
saveUpdateLog(sarStandardsInfoEO, beforeSarStandardsInfo);
|
||||||
|
filterNewFeed(sarStandardsInfoEO, beforeSarStandardsInfo);
|
||||||
if (elasflag) { //what?
|
if (elasflag) { //what?
|
||||||
attrInfoShowSearchDetails(sarStandardsInfoEO, "upd");
|
attrInfoShowSearchDetails(sarStandardsInfoEO, "upd");
|
||||||
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
|
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
|
||||||
@@ -1949,6 +1960,92 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void filterNewFeed(SarStandardsInfo sarStandardsInfoEO, SarStandardsInfo beforeSarStandardsInfo) throws Exception {
|
||||||
|
Map<String, Object> newMap = new HashMap<>();
|
||||||
|
Map<String, Object> oldMap = beforeSarStandardsInfo.getAttrInfoMap();
|
||||||
|
String attrStr = sarStandardsInfoEO.getSarStandAttrEOStr();
|
||||||
|
if (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());
|
||||||
|
|
||||||
|
filterDisunityFbg = filterDisunityFbg.stream().filter(s -> !s.equals("")).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());
|
||||||
|
|
||||||
|
filterDisunityUs = filterDisunityUs.stream().filter(s -> !s.equals("")).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
// 0 发布稿件 新的文件数量 大于等于 在研稿件 就属于发布动态消息 则 为 1 在研
|
||||||
|
if(filterDisunityFbg.size() >= filterDisunityUs.size()){
|
||||||
|
saveNewFeed(sarStandardsInfoEO, "0");
|
||||||
|
}else {
|
||||||
|
saveNewFeed(sarStandardsInfoEO, "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveNewFeed(SarStandardsInfo sarStandardsInfoEO, String s) {
|
||||||
|
NewsFeed newsFeed = new NewsFeed();
|
||||||
|
newsFeed.setId(UUIDUtils.randomUUID20());
|
||||||
|
newsFeed.setRenewTime(new Date());
|
||||||
|
newsFeed.setStandardId(sarStandardsInfoEO.getId());
|
||||||
|
newsFeed.setResourceType(verifyObj(sarStandardsInfoEO.getStandType()).toString());
|
||||||
|
newsFeed.setMessageType(s);
|
||||||
|
String standard = "";
|
||||||
|
if(StringUtils.isNotBlank(sarStandardsInfoEO.getStandYear())){
|
||||||
|
standard = verifyObj(sarStandardsInfoEO.getStandSort()).toString() +" "+ verifyObj(sarStandardsInfoEO.getStandNumber()).toString()+"-"+verifyObj(sarStandardsInfoEO.getStandYear()).toString();
|
||||||
|
}else {
|
||||||
|
standard = verifyObj(sarStandardsInfoEO.getStandSort()).toString() +" "+ verifyObj(sarStandardsInfoEO.getStandNumber()).toString();
|
||||||
|
}
|
||||||
|
newsFeed.setStandard(standard);
|
||||||
|
newsFeed.setStandardName(verifyObj(sarStandardsInfoEO.getStandName()).toString());
|
||||||
|
newsFeed.setReleaseDate(verifyObj(sarStandardsInfoEO.getIssueTime()).toString());
|
||||||
|
newsFeed.setTextState(verifyObj(sarStandardsInfoEO.getTextStatus()).toString());
|
||||||
|
iNewsFeedService.insertNewsFeed(newsFeed);
|
||||||
|
}
|
||||||
|
|
||||||
public void saveUpdateLog(SarStandardsInfo sarStandardsInfoEO, SarStandardsInfo beforeSarStandardsInfo) throws Exception {
|
public void saveUpdateLog(SarStandardsInfo sarStandardsInfoEO, SarStandardsInfo beforeSarStandardsInfo) throws Exception {
|
||||||
Map<String, Object> newMap = new HashMap<>();
|
Map<String, Object> newMap = new HashMap<>();
|
||||||
Map<String, Object> oldMap = beforeSarStandardsInfo.getAttrInfoMap();
|
Map<String, Object> oldMap = beforeSarStandardsInfo.getAttrInfoMap();
|
||||||
|
|||||||
Reference in New Issue
Block a user