|
@@ -79,9 +79,6 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
|
|
|
if(record.getType() == 3 && StringUtils.isBlank(record.getShipMobile()) && map.get(record.getUserId())!= null){
|
|
|
record.setShipMobile(map.get(record.getUserId()).getShipMobile());
|
|
|
}
|
|
|
- if(record.getType() == 3 && StringUtils.isBlank(record.getEmail()) ){
|
|
|
- record.setEmail(record.getOrganizedAddress());
|
|
|
- }
|
|
|
}
|
|
|
return invoiceVOPage ;
|
|
|
}
|
|
@@ -99,6 +96,9 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
|
|
|
if(InvoiceType.NO_NEAD.code().equals(type)){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
+ if(StringUtils.isBlank(invoice.getEmailAddress())){
|
|
|
+ throw new BusinessException(ResultCode.EMAIL_BLANK);
|
|
|
+ }
|
|
|
|
|
|
InvoiceRegister invoiceRegister = invoiceRegisterService.getByInvoiceId(id);
|
|
|
if(Objects.isNull(invoiceRegister)){
|
|
@@ -141,9 +141,8 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
|
|
|
String userName = user == null ? null : user.getNickName();
|
|
|
|
|
|
MailTemplate mailTemplate = this.setMailMsg(orderNum,userName);
|
|
|
- String email = StringUtils.isNotBlank(invoice.getEmailAddress())?invoice.getEmailAddress(): invoice.getOrganizedAddress();
|
|
|
|
|
|
- Boolean mail = mailTemplateService.sendMail(email, mailTemplate,localFile.getPath());
|
|
|
+ Boolean mail = mailTemplateService.sendMail(invoice.getEmailAddress(), mailTemplate,localFile.getPath());
|
|
|
if(!mail){
|
|
|
throw new BusinessException(ResultCode.MAIL_SEND_ERROR);
|
|
|
}
|