|
@@ -1,9 +1,11 @@
|
|
|
package com.ruoyi.project.listener.invoiceApprove;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.github.stuxuhai.jpinyin.PinyinFormat;
|
|
|
import com.github.stuxuhai.jpinyin.PinyinHelper;
|
|
|
import com.ruoyi.common.sendEmail.IMailService;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SpringContextUtils;
|
|
|
import com.ruoyi.project.invoice.domain.TApproveReserveInvoice;
|
|
|
import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticket;
|
|
@@ -87,7 +89,16 @@ public class ZzzgTaskCreateListener implements Serializable, TaskListener {
|
|
|
//拼接html
|
|
|
String html = start + prime + end;
|
|
|
logger.info("html:" + html);
|
|
|
- mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:You have a new to-do task (" + apNo + ")", html);
|
|
|
+ QueryWrapper<TInvoiceBookingworkticket> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.eq("work_unit", bookingworkticket.getWorkUnit()).eq("to_char(createdate, 'yyyy-mm-dd')", DateUtils.getDate()).eq("status",2);
|
|
|
+ int count = tInvoiceBookingworkticketService.count(wrapper);
|
|
|
+ logger.info("===============================计数::"+count);
|
|
|
+ if (count < 2) {
|
|
|
+ logger.info("===============================:发邮件");
|
|
|
+ mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:You have a new to-do task (" + apNo + ")", html);
|
|
|
+ }else {
|
|
|
+ logger.info("===============================:未发邮件");
|
|
|
+ }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.error("邮件发送失败" + JSON.toJSONString(e));
|