修改UAT问题 修改代替标准逻辑

This commit is contained in:
高嵩
2023-03-22 20:33:57 +08:00
parent 6523f968cb
commit d29009827b
@@ -264,31 +264,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String serialNumber = (String) map.get("serial_number");
String titleEn = (String) map.get("title_en");
String title = (String) map.get("title");
String category = (String)map.get("lei4_bie2");
if(StringUtils.isNotBlank(category)){
String finalCategory = category;
List<SysDictItem> stateDictItemList = dictItemList.stream()
.filter(e -> "type".equals(e.getDictCode()) && finalCategory.equals(e.getItemValue()))
.collect(Collectors.toList());
if(stateDictItemList.size() != 0){
if(CutEnum.CN.getValue().equals(cut)){
category = stateDictItemList.get(0).getItemText();
}else{
category = stateDictItemList.get(0).getEnName();
}
}
}else {
category = "";
}
//文档动态-------------------
String hrefTemp =category + " " + "<a href='/docManage/library/detail?id=" + id +
//文档动态-------------------
String hrefTemp ="<a href='/docManage/library/detail?id=" + id +
"&title=" + title +
"&serial_number=" + serialNumber + "'" + " target='_blank'>" + serialNumber + "</a>" + " " + titleEn + ",";
sbTemp.append(hrefTemp);
serialNumberListTemp.add(category + " " + serialNumber + " " + titleEn);
serialNumberListTempCn.add(category + " " + serialNumber + " " + title);
serialNumberListTemp.add(serialNumber + " " + titleEn);
serialNumberListTempCn.add(serialNumber + " " + title);
//---------------------------
if (documentIds.size() != 0 && documentIds.contains((String) map.get("id"))) {
serialNumberList.add(serialNumber);
@@ -2176,22 +2158,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<String> userIdList = domainUserRelService.queryDomainUserRelInfo(mapTemp);
String title = StringUtils.valueOf(map.get("title"));
String serialNumber = StringUtils.valueOf(map.get("serial_number"));
String category = StringUtils.valueOf(map.get("lei4_bie2"));
String categoryCn = "";
String titleEn = StringUtils.valueOf(map.get("title_en"));
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsAll();
if(StringUtils.isNotBlank(category)){
String finalCategory = category;
List<SysDictItem> stateDictItemList = dictItemList.stream()
.filter(e -> "type".equals(e.getDictCode()) && finalCategory.equals(e.getItemValue()))
.collect(Collectors.toList());
if(stateDictItemList.size() != 0){
category = stateDictItemList.get(0).getEnName();
categoryCn = stateDictItemList.get(0).getItemText();
}
}else{
category = "";
}
Set<String> technologyTerritorySet = new HashSet<>();
String technologyTerritoryId = "";
@@ -2229,19 +2197,19 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String href = category + " " + "<a href='/docManage/library/detail?id=" + idTemp +
String href = "<a href='/docManage/library/detail?id=" + idTemp +
"&title=" + title +
"&serial_number=" + serialNumber + "'" + " target='_blank'>" + serialNumber + "</a>" + " "+ titleEn + " ";
String hrefCn = categoryCn + " " + "<a href='/docManage/library/detail?id=" + idTemp +
String hrefCn = "<a href='/docManage/library/detail?id=" + idTemp +
"&title=" + title +
"&serial_number=" + serialNumber + "'" + " target='_blank'>" + serialNumber + "</a>" + " "+ title;
//文档动态, 文档库中新增了标准XXXX homeDocumentDynamicEOService
//The standard GB 7258-2017 Technical specifications has been added to the document library.
String msgContentCn = "文档库中新增了"+categoryCn+" "+serialNumber+" "+title;
String msgContentCn = "文档库中新增了" + serialNumber + " "+title;
String msgContentInfoCn = "文档库中新增了"+hrefCn;
HomeDocumentDynamicEO homeDocumentDynamicEO = new HomeDocumentDynamicEO();
homeDocumentDynamicEO.setMsgContent("The " + category + " " + serialNumber + " " + titleEn + " has been added to the document library.");
homeDocumentDynamicEO.setMsgContentInfo("The " + href + " has been added to the document library.");
homeDocumentDynamicEO.setMsgContent(serialNumber + " " + titleEn + " has been added to the document library.");
homeDocumentDynamicEO.setMsgContentInfo(href + " has been added to the document library.");
homeDocumentDynamicEO.setMsgContentCn(msgContentCn);
homeDocumentDynamicEO.setMsgContentInfoCn(msgContentInfoCn);
homeDocumentDynamicEOService.save(homeDocumentDynamicEO);
@@ -2259,7 +2227,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String hrefTemp = backUrl + "/docManage/library/detail?id=" + idTemp;
String content = "In the "+ technologyTerritoryName
+ " technical field you subscribed to, the "+category+" "+serialNumber+" has been updated.";
+ " technical field you subscribed to, the "+serialNumber+" has been updated.";
//In the XXXX technical field you subscribed to, the standard "GBXXX" has been updated.
String contentInfo = "In the "+ technologyTerritoryName
+ " technical field you subscribed to, the "
@@ -2267,26 +2235,26 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String msgTitle = "The " + technologyTerritoryName + " technical field you subscribed to has been updated";
String hrefYes = category + " " + "<a href='/docManage/library/detail?id=" + idTemp +
String hrefYes = "<a href='/docManage/library/detail?id=" + idTemp +
"&title=" + title +
"&serial_number=" + serialNumber + "'" + " target='_blank'>" + serialNumber + "</a>";
//消息英文--不带标签
String contentNo = "In the "+ technologyTerritoryName
+ " technical field you subscribed to, the "+
category + " " + serialNumber +" has been updated.";;
serialNumber +" has been updated.";;
//消息英文--带标签
String contentYes = "In the "+ technologyTerritoryName
+ " technical field you subscribed to, the "+
category + " " + hrefYes +" has been updated.";;
hrefYes +" has been updated.";;
//消息中文--不带标签
String contentInfoNo = "您所订阅的" + technologyTerritoryName + "技术领域中更新了" + category + " " + serialNumber;;
String contentInfoNo = "您所订阅的" + technologyTerritoryName + "技术领域中更新了" + serialNumber;;
//消息中文--带标签
String contentInfoYes = "您所订阅的" + technologyTerritoryName + "技术领域中更新了" + category + " " + hrefYes;;
String contentInfoYes = "您所订阅的" + technologyTerritoryName + "技术领域中更新了" + hrefYes;;
//封装消息的实体类
@@ -2303,9 +2271,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//飞书
try {
String contentInfoFeiShu = "In the "+ technologyTerritoryName
+ " technical field you subscribed to, the "+
category + " " + serialNumber +" has been updated.";
String contentInfoFeiShuCn = "您所订阅的" + technologyTerritoryName + "技术领域中更新了" + category + " " + serialNumber;
+ " technical field you subscribed to, "+
serialNumber +" has been updated.";
String contentInfoFeiShuCn = "您所订阅的" + technologyTerritoryName + "技术领域中更新了" + serialNumber;
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
@@ -2332,7 +2300,6 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<BussDocumentLibraryEO> list = this.list();
List<String> serialNumberList = list.stream().map(BussDocumentLibraryEO::getSerialNumber).collect(Collectors.toList());
String serialNumber = StringUtils.valueOf(map.get("serial_number"));
String category = StringUtils.valueOf(map.get("lei4_bie2"));
String id = StringUtils.valueOf(map.get("id"));
String title = StringUtils.valueOf(map.get("title"));
String titleEn = StringUtils.valueOf(map.get("title_en"));
@@ -2349,7 +2316,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//普通数据字典
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsAll();
//编辑时处理首页文档动态 1. 标准XXXX的状态改为 2. 标准XXXX的适用车型改为 3. 标准XXXX删除了XXXX文件 4. 标准XXXX上传了XXXX文件
homeDocumentDynamic(cut,map, serialNumber, id, title, dataList, fieldList,dictItemList,category,titleEn);
homeDocumentDynamic(cut,map, serialNumber, id, title, dataList, fieldList,dictItemList,titleEn);
try {
@@ -2725,21 +2692,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<Map<String, Object>> dataList,
List<OnlCgformField> fieldList,
List<SysDictItem> dictItemList,
String category,
String titleEn) {
String categoryCn = "";
if(StringUtils.isNotBlank(category)){
String finalCategory = category;
List<SysDictItem> stateDictItemList = dictItemList.stream()
.filter(e -> "type".equals(e.getDictCode()) && finalCategory.equals(e.getItemValue()))
.collect(Collectors.toList());
if(stateDictItemList.size() != 0){
category = stateDictItemList.get(0).getEnName();
categoryCn = stateDictItemList.get(0).getItemText();
}
}else{
category = "";
}
//文件类型字段
List<OnlCgformField> onlCgformFieldList = fieldList.stream()
.filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
@@ -2793,13 +2746,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String contentInfoFileCn = "";
if(StringUtils.isNotBlank(sbField)){
// String substring = sbField.substring(0, sbField.length() - 1);
contentFile = category + " " + serialNumber + " " + titleEn + " uploaded " + sbField;
contentFileCn = categoryCn + " " + serialNumber + " " + title + " 中上传了 " + sbFieldCn;
contentFile = serialNumber + " " + titleEn + " uploaded " + sbField;
contentFileCn = serialNumber + " " + title + " 中上传了 " + sbFieldCn;
}
if(StringUtils.isNotBlank(sbNew)){
// String substring = sbNew.substring(0, sbNew.length() - 1);
contentInfoFile = category + " " + href + " uploaded " + sbNew;
contentInfoFileCn = categoryCn + " " + hrefCn + " 中上传了" + sbNewCn;
contentInfoFile = href + " uploaded " + sbNew;
contentInfoFileCn = hrefCn + " 中上传了" + sbNewCn;
}
// if(StringUtils.isNotBlank(sbField)){
//// contentInfoFile = category + " " + href + " uploaded " + sbNew;
@@ -2818,13 +2771,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
StringBuilder msgContentSbCn = new StringBuilder();
StringBuilder msgContentInfoSbCn = new StringBuilder();
//适用车型
StringBuilder msgContentSbCarType = new StringBuilder("Vehicle Type of the " + category + " " + serialNumber + " " + titleEn);
StringBuilder msgContentInfoSbCarType = new StringBuilder("Vehicle Type of the " + category + " " + href);
StringBuilder msgContentSbCarType = new StringBuilder("Vehicle Type of the " + serialNumber + " " + titleEn);
StringBuilder msgContentInfoSbCarType = new StringBuilder("Vehicle Type of the " + href);
StringBuilder msgContentSbCarTypeCn = new StringBuilder(serialNumber + " " + title+" 的适用车型改为");
StringBuilder msgContentInfoSbCarTypeCn = new StringBuilder(hrefCn+" 的适用车型改为");
//状态
StringBuilder msgContentSbStatus = new StringBuilder("The Status of the " + category + " " + serialNumber + " " + titleEn);
StringBuilder msgContentInfoSbStatus = new StringBuilder("The Status of the " + category + " " + href);
StringBuilder msgContentSbStatus = new StringBuilder("The Status of the " + serialNumber + " " + titleEn);
StringBuilder msgContentInfoSbStatus = new StringBuilder("The Status of the " + href);
StringBuilder msgContentSbStatusCn = new StringBuilder(serialNumber + " " + title+" 的状态改为");
StringBuilder msgContentInfoSbStatusCn = new StringBuilder(hrefCn+" 的状态改为");
@@ -3501,22 +3454,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String serialNumber = (String) dataList.get(0).get("serial_number");
String category = (String)map.get("lei4_bie2");
String categoryCn = (String)map.get("lei4_bie2");
String technologyTerritory = (String) map.get("technology_territory");
if(StringUtils.isNotBlank(category)){
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsAll();
String finalCategory = category;
List<SysDictItem> stateDictItemList = dictItemList.stream()
.filter(e -> "type".equals(e.getDictCode()) && finalCategory.equals(e.getItemValue()))
.collect(Collectors.toList());
if(stateDictItemList.size() != 0){
category = stateDictItemList.get(0).getEnName();
categoryCn = stateDictItemList.get(0).getItemText();
}
}else{
category = "";
}
//只要修改了标准,就需要向订阅用户发送消息(内容为-->XXX对GB 7258 进行了修改请及时查看)
//向订阅领域管理中订阅了该技术领域的人和文档库中订阅了该条文档的人发送消息
// 只有技术领域变更为订阅的技术领域这一种情况发消息, 假如订阅了技术领域A,编辑的文档的技术领域也是A,这时编辑的是其他的字段,这种情况不发消息
@@ -3582,9 +3520,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//订阅管理
if(thirdIdList.size() != 0){
String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
category + " " + serialNumber+" has been updated.";
String contentInfoFeiCn = "您所订阅的" + technologyTerritoryNameEn + "技术领域中更新了" + categoryCn + " " + serialNumber;
String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, " +
serialNumber+" has been updated.";
String contentInfoFeiCn = "您所订阅的" + technologyTerritoryNameEn + "技术领域中更新了" + serialNumber;
try {
//跳转文档详情
String url = backUrl + "/docManage/library/detail?id=" + id;
@@ -3613,18 +3551,18 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String contentInfo = "In the " + technologyTerritoryNameEn + " technical field you subscribed to," +sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString();
String msgTitle = "The " + technologyTerritoryNameEn + " technical field you subscribed to has been updated";
//消息英文--不带标签
String contentNo = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
category + " " + serialNumber+" has been updated.";;
String contentNo = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, " +
serialNumber+" has been updated.";;
//消息英文--带标签
String contentYes = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
category + " " + href+" has been updated.";;
String contentYes = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, " +
href+" has been updated.";;
//消息中文--不带标签
String contentInfoNo = "您所订阅的" + technologyTerritoryNameEn + "技术领域中更新了" + categoryCn + " " + serialNumber;;
String contentInfoNo = "您所订阅的" + technologyTerritoryNameEn + "技术领域中更新了" + serialNumber;;
//消息中文--带标签
String contentInfoYes = "您所订阅的" + technologyTerritoryNameEn + "技术领域中更新了" + categoryCn + " " + href;;
String contentInfoYes = "您所订阅的" + technologyTerritoryNameEn + "技术领域中更新了" + href;;
// 封装消息的实体类
@@ -3653,21 +3591,21 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//去掉a标签
sbStr = sbStr.replaceAll("<text class='highlight-class'>", "").replaceAll("</text>", "");
//您订阅的XXX已被修改
content = "In the "+category + " " + serialNumber+" you subscribed to, has been modified,Please pay attention to check.";
content = "In the "+ serialNumber+" you subscribed to, has been modified,Please pay attention to check.";
//内容详情--英文(不带标签)
String contentInfoNo = "In the "+category + " " + serialNumber+" you subscribed to, "+ sbStr.toString();
String contentInfoNo = "In the "+ serialNumber+" you subscribed to, "+ sbStr.toString();
//内容详情--英文(带标签)
String contentInfoYes = "In the "+category + " " + href+" you subscribed to, "+ sbStr.toString();
String contentInfoYes = "In the "+ href+" you subscribed to, "+ sbStr.toString();
String msgTitle = serialNumber + " you subscribed to has been updated";
//内容详情-中文(不带标签)
String sbStrCnTemp = sbStrCn.replaceAll("<text class='highlight-class'>", "").replaceAll("</text>", "");
String contentCnNo = "您所订阅的"+categoryCn+serialNumber+","+sbStrCnTemp;
String contentCnNo = "您所订阅的"+serialNumber+","+sbStrCnTemp;
//内容详情--中文(带标签)
String contentInfoCnReplace = sbStrCn.replaceAll("<text class='highlight-class'>","").replaceAll("</text>","");
String contentInfoCnYes ="您所订阅的"+categoryCn+href+","+contentInfoCnReplace;;
String contentInfoCnYes ="您所订阅的"+href+","+contentInfoCnReplace;;
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdListUpdate,
msgTitle,
@@ -3683,9 +3621,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//订阅文档的飞书消息
try {
//英文消息
String contentInfoFei = "In the "+category + " " + serialNumber +" you subscribed to, "+ sbStr.toString();;
String contentInfoFei = "In the " + " " + serialNumber +" you subscribed to, "+ sbStr.toString();;
//中文消息
String contentInfoFeiCn ="您所订阅的"+categoryCn+ serialNumber +","+ sbStrCn.toString();;
String contentInfoFeiCn ="您所订阅的"+serialNumber +","+ sbStrCn.toString();;
//跳转文档详情
String url = backUrl + "/docManage/library/detail?id=" + id;
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();