Merge remote-tracking branch 'origin/fix_bug_first_stage' into fix_bug_first_stage

This commit is contained in:
wangzhijiang
2022-07-12 09:38:23 +08:00
13 changed files with 83 additions and 44 deletions
@@ -1571,13 +1571,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String serialNumber = StringUtils.valueOf(map.get("serial_number"));
//String serialNumber = StringUtils.valueOf(map.get("serial_number"));
//编码验重
List<BussDocumentLibraryEO> list = this.list();
if(list.size() != 0){
List<String> serialNumberList = list.stream().map(BussDocumentLibraryEO::getSerialNumber).collect(Collectors.toList());
if(serialNumberList.contains(serialNumber)){
throw new JeroBootException("编号已存在不能重复添加");
}
}
// List<BussDocumentLibraryEO> list = this.list();
// if(list.size() != 0){
// List<String> serialNumberList = list.stream().map(BussDocumentLibraryEO::getSerialNumber).collect(Collectors.toList());
// if(serialNumberList.contains(serialNumber)){
// throw new JeroBootException("编号已存在不能重复添加");
// }
// }
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String issueTime = (String) (map.get("issue_time"));
@@ -3144,7 +3144,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
sbStr = sbStr.replaceAll("<text class='highlight-class'>", "").replaceAll("</text>", "");
//您订阅的XXX已被修改
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 msgTitle = "The " + technologyTerritoryNameEn + " technical field you subscribed to has been updated";
// 封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userList, msgTitle, contentInfoFei, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
@@ -3166,7 +3166,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//您订阅的XXX已被修改
content = "In the "+category + " " + serialNumber+" you subscribed to, has been modified,Please pay attention to check.";
String contentInfo = "In the "+category + " " + href+" you subscribed to, "+sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString();
String msgTitle = serialNumber + "you subsribed to has been updated";
String msgTitle = serialNumber + " you subsribed to has been updated";
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdListUpdate, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
@@ -4766,9 +4766,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
}
});
String contentTemp = sysUser.getUsername() + " pushed " + StringUtils.join(list, ",") + " to you. Please be reminded to check it out.";
FeishuMsgVo feishuMsgVo = getFeishuMsgVo(MessageTypeEnum.PUSH.getName(),MessageTypeEnum.PUSH.getName(), contentTemp, encode);
iFeishuService.sendCardMsg(thirdIdList.toArray(new String[]{}), feishuMsgVo);
// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentTemp, MessageTypeEnum.PUSH.getName(), encode);
// FeishuMsgVo feishuMsgVo = getFeishuMsgVo(MessageTypeEnum.PUSH.getName(),null, contentTemp, encode);
// iFeishuService.sendCardMsg(thirdIdList.toArray(new String[]{}), feishuMsgVo);
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentTemp, MessageTypeEnum.PUSH.getName(), encode);
}
} catch (IOException e) {
log.error("飞书推送失败");
@@ -5453,6 +5453,27 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
FileUnZip.deleteDir(saveDirectory);
throw new JeroBootException(html);
} else {
//验证重复的标准号
List<String> serialNumberList = new ArrayList<>();
if (mapList.size() != 0) {
for (Map<String, Object> map : mapList) {
serialNumberList.add(StringUtils.valueOf(map.get("serial_number")));
}
}
List<BussDocumentLibraryEO> list = this.list();
if(list.size() != 0){
List<BussDocumentLibraryEO> serialNumberListTemp = list.stream()
.filter(e -> serialNumberList.contains(e.getSerialNumber())).collect(Collectors.toList());
if(serialNumberListTemp.size() != 0){
List<String> collect = serialNumberListTemp.stream().map(BussDocumentLibraryEO::getSerialNumber).distinct().collect(Collectors.toList());
if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException(StringUtils.join(collect,",")+" 编号已存在不能重复添加");
}else{
throw new JeroBootException(StringUtils.join(collect,",")+" already exists and cannot be added again");
}
}
}
if (mapList.size() != 0) {
for (Map<String, Object> map : mapList) {
this.addInfo(map);
@@ -265,7 +265,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
}
lawName.append(lawEngineerName).append(",");
}
projectRelatedPersonnel.setLawEngineerName(lawName.substring(0,lawName.toString().length()-3));
projectRelatedPersonnel.setLawEngineerName(lawName.substring(0,lawName.toString().length()-1));
}
}
@@ -291,7 +291,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
}
engineeringName.append(engineeringInterfacePersonName).append(",");
}
projectRelatedPersonnel.setEngineeringInterfacePersonName(engineeringName.substring(0,engineeringName.toString().length()-3));
projectRelatedPersonnel.setEngineeringInterfacePersonName(engineeringName.substring(0,engineeringName.toString().length()-1));
}
}
@@ -316,7 +316,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
}
certificationName.append(certificationEngineerName).append(",");
}
projectRelatedPersonnel.setCertificationEngineerName(certificationName.substring(0,certificationName.toString().length()-3));
projectRelatedPersonnel.setCertificationEngineerName(certificationName.substring(0,certificationName.toString().length()-1));
}
}