工作组催款提醒添加邮件发送失败提醒

This commit is contained in:
梁琦涛
2022-05-07 15:33:12 +08:00
parent a7d00cd791
commit fe2a9e87e1
@@ -912,6 +912,10 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
if(!StringUtils.isBlank(input.getChargeNoticeId())){
OSSFile file = iossFileService.getById(input.getChargeNoticeId());
String path = env.getProperty("jero.path.upload") + File.separator;
File fi = new File(path + file.getUrl());
if(!fi.exists()){
throw new JeroBootException("附件不存在!");
}
listFile.add(path + file.getUrl());
}
List<PayWorkingGroupSubItem> list = payWorkingGroupSubItemService.listByIds(Arrays.asList(s));
@@ -919,7 +923,9 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
List<String> listMsg = new ArrayList<>();
if(!CollectionUtils.isEmpty(list)){
List<String> listStr = list.stream().map(PayWorkingGroupSubItem::getId).collect(Collectors.toList());
List<PayWorkingGroupSubItemContacts> listPayWorkingGroupSubItemContacts = payWorkingGroupSubItemContactsService.listByIds(listStr);
LambdaQueryWrapper<PayWorkingGroupSubItemContacts> queryPayWorkingGroupSubItemContacts = new LambdaQueryWrapper<>();
queryPayWorkingGroupSubItemContacts.in(PayWorkingGroupSubItemContacts::getWorkingGroupSubId,listStr);
List<PayWorkingGroupSubItemContacts> listPayWorkingGroupSubItemContacts = payWorkingGroupSubItemContactsService.list(queryPayWorkingGroupSubItemContacts);
List<PayContactsManagementTemporary> listPayContactsManagementTemporary = new ArrayList<>();
if(!CollectionUtils.isEmpty(listPayWorkingGroupSubItemContacts)){
List<String> listContacts = listPayWorkingGroupSubItemContacts.stream().map(PayWorkingGroupSubItemContacts::getContactsTemporaryId).collect(Collectors.toList());
@@ -943,6 +949,10 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
throw new JeroBootException("负责人不存在!");
}
list.forEach(p->{
// 收费通知为合同的,不进行变更,其他方式直接变更
if(Objects.equals(p.getChargeWay(),PayProjectCommon.CHARGE_WAY2)){
return;
}
LambdaUpdateWrapper<PayWorkingGroupSubItem> updatePayWorkingGroupSubItem = new LambdaUpdateWrapper<>();
// 变更应收金额,重新校验状态
ProjectStatusVO projectStatusVO = projectDetailService.getStatus(p.getId(),input.getReceivableAmount(),p.getNeedInvoice());
@@ -981,7 +991,7 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
List<String> listIds = listNew.stream().map(PayWorkingGroupSubItemContacts::getContactsTemporaryId).collect(Collectors.toList());
// 发消息 项目负责人发给企业联系人、工作组联系人
List<PayContactsManagementTemporary> listContacts = finalListPayContactsManagementTemporary.stream().filter(item->listIds.contains(item.getId())).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(listContacts)) {
if(CollectionUtils.isEmpty(listContacts)) {
return;
}
listContacts.forEach(m->{
@@ -1007,8 +1017,8 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
sendMessageDTO.setBusId(json.toJSONString());
sendMessageService.SendMessageService(sendMessageDTO);
}catch (Exception e){
if(e.getMessage().contains("邮件发送") && !listMsg.contains(p.getChargeCompanyTemporaryName() + "单位邮箱发送失败")){
listMsg.add(p.getChargeCompanyTemporaryName() + "单位邮箱发送失败");
if(e.getMessage().contains("邮件发送") && !listMsg.contains(p.getChargeCompanyTemporaryName() + "单位" + m.getName() + "邮箱发送失败")){
listMsg.add(p.getChargeCompanyTemporaryName() + "单位" + m.getName() + "邮箱发送失败");
}
}
});