|
@@ -20,6 +20,7 @@ package com.qunzhixinxi.hnqz.daemon.quartz.task;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.copier.CopyOptions;
|
|
import cn.hutool.core.bean.copier.CopyOptions;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
+import cn.hutool.core.map.MapUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.constants.HnqzQuartzEnum;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.constants.HnqzQuartzEnum;
|
|
@@ -32,21 +33,30 @@ import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SingleEnterpriseSettleSameAmoun
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SingleMemberSettleAmountOverrunInSeveralMonthsMapper;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SingleMemberSettleAmountOverrunInSeveralMonthsMapper;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SingleMemberSettleSameAmountInSeveralMonthsMapper;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SingleMemberSettleSameAmountInSeveralMonthsMapper;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SingleMemberWithoutSuchTaskTypesInSeveralMonthsMapper;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SingleMemberWithoutSuchTaskTypesInSeveralMonthsMapper;
|
|
|
|
+import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SysUserMapper;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.service.*;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.service.*;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.zhuqu.ZhuaquTest;
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.zhuqu.ZhuaquTest;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.SneakyThrows;
|
|
import lombok.SneakyThrows;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.mail.javamail.JavaMailSender;
|
|
|
|
+import org.springframework.mail.javamail.MimeMessageHelper;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import javax.mail.MessagingException;
|
|
|
|
+import javax.mail.internet.MimeMessage;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalTime;
|
|
import java.time.LocalTime;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
import java.time.temporal.TemporalAdjusters;
|
|
import java.time.temporal.TemporalAdjusters;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author 郑健楠
|
|
* @author 郑健楠
|
|
@@ -58,6 +68,8 @@ public class SpringBeanTaskDemo {
|
|
private final WmScorePackageStatusService wmScorePackageStatusService;
|
|
private final WmScorePackageStatusService wmScorePackageStatusService;
|
|
private final WmScorePackageSettleNoteService scorePackageSettleNoteService;
|
|
private final WmScorePackageSettleNoteService scorePackageSettleNoteService;
|
|
private final WmScorePackageService wmScorePackageService;
|
|
private final WmScorePackageService wmScorePackageService;
|
|
|
|
+ private final SysUserMapper sysUserMapper;
|
|
|
|
+ private final JavaMailSender sender;
|
|
private final ZhuaquTest zhuaquTest;
|
|
private final ZhuaquTest zhuaquTest;
|
|
private final WmTaskTypeService wmTaskTypeService;
|
|
private final WmTaskTypeService wmTaskTypeService;
|
|
private final WmTaskService wmTaskService;
|
|
private final WmTaskService wmTaskService;
|
|
@@ -334,11 +346,11 @@ public class SpringBeanTaskDemo {
|
|
|
|
|
|
result.forEach(e -> {
|
|
result.forEach(e -> {
|
|
SingleMemberWithoutSuchTaskTypesInSeveralMonths singleMemberWithoutSuchTaskTypesInSeveralMonths
|
|
SingleMemberWithoutSuchTaskTypesInSeveralMonths singleMemberWithoutSuchTaskTypesInSeveralMonths
|
|
- = BeanUtil.mapToBean(e, SingleMemberWithoutSuchTaskTypesInSeveralMonths.class,true, new CopyOptions());
|
|
|
|
|
|
+ = BeanUtil.mapToBean(e, SingleMemberWithoutSuchTaskTypesInSeveralMonths.class, true, new CopyOptions());
|
|
|
|
|
|
List<WmTask> list = wmTaskService.list(Wrappers.<WmTask>lambdaQuery().eq(WmTask::getScorePackageId, e.get(singleMemberWithoutSuchTaskTypesInSeveralMonths.getPackageId())).orderByDesc(WmTask::getCreateTime));
|
|
List<WmTask> list = wmTaskService.list(Wrappers.<WmTask>lambdaQuery().eq(WmTask::getScorePackageId, e.get(singleMemberWithoutSuchTaskTypesInSeveralMonths.getPackageId())).orderByDesc(WmTask::getCreateTime));
|
|
|
|
|
|
- if (CollUtil.isNotEmpty(list)){
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(list)) {
|
|
singleMemberWithoutSuchTaskTypesInSeveralMonths.setFirstTaskTime(list.get(0).getCreateTime());
|
|
singleMemberWithoutSuchTaskTypesInSeveralMonths.setFirstTaskTime(list.get(0).getCreateTime());
|
|
}
|
|
}
|
|
singleMemberWithoutSuchTaskTypesInSeveralMonths.setPeriod(period);
|
|
singleMemberWithoutSuchTaskTypesInSeveralMonths.setPeriod(period);
|
|
@@ -354,4 +366,66 @@ public class SpringBeanTaskDemo {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @SneakyThrows
|
|
|
|
+ public String pushUserCertFailure(String para) {
|
|
|
|
+
|
|
|
|
+ String[] re = {"qutong@yaoyi.net"};
|
|
|
|
+
|
|
|
|
+ log.info("pushUserCertFailure:{},输入参数{}", LocalDateTime.now(), para);
|
|
|
|
+
|
|
|
|
+ List<Map<String, Object>> stringObjectMap = sysUserMapper.listUserCertFailure();
|
|
|
|
+ if (CollUtil.isNotEmpty(stringObjectMap)) {
|
|
|
|
+
|
|
|
|
+ StringBuilder text = new StringBuilder("<table style=\"width:100%\">\n" +
|
|
|
|
+ " <tr>\n" +
|
|
|
|
+ " <th>ID</th>\n" +
|
|
|
|
+ " <th>姓名</th>\n" +
|
|
|
|
+ " <th>账号</th>\n" +
|
|
|
|
+ " <th>所属企业</th>\n" +
|
|
|
|
+ " <th>结算平台</th>\n" +
|
|
|
|
+ " <th>税源地</th>\n" +
|
|
|
|
+ " <th>认证表述</th>\n" +
|
|
|
|
+ " <th>认证状态</th>\n" +
|
|
|
|
+ " <th>发起状态</th>\n" +
|
|
|
|
+ " <th>上次回信信息</th>\n" +
|
|
|
|
+ " <th>是否有手签</th>\n" +
|
|
|
|
+ " <th>是否有e证通认证结果</th>\n" +
|
|
|
|
+ " <th>用户操作认证时间</th>\n" +
|
|
|
|
+ " </tr>");
|
|
|
|
+
|
|
|
|
+ stringObjectMap.forEach(e -> {
|
|
|
|
+ text.append("<tr>");
|
|
|
|
+ e.forEach((k, v) -> {
|
|
|
|
+ text.append("<td>").append(v).append("</td>");
|
|
|
|
+ });
|
|
|
|
+ text.append("</tr>");
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ text.append("</table>");
|
|
|
|
+ Arrays.stream(re).forEach(reciver -> {
|
|
|
|
+ MimeMessage mail = sender.createMimeMessage();
|
|
|
|
+ try {
|
|
|
|
+
|
|
|
|
+ MimeMessageHelper helper = new MimeMessageHelper(mail, true);
|
|
|
|
+
|
|
|
|
+ helper.setFrom("yaoyi_report@yaoyi.net");
|
|
|
|
+ helper.setTo(re);
|
|
|
|
+
|
|
|
|
+ helper.setSubject("零工平台人员认证未完成信息汇总(" + DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDate.now().minusDays(1L)) + ")");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ helper.setText(text.toString());
|
|
|
|
+
|
|
|
|
+ sender.send(mail);
|
|
|
|
+ } catch (MessagingException ex) {
|
|
|
|
+ log.error("邮件发送失败");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return HnqzQuartzEnum.JOB_LOG_STATUS_SUCCESS.getType();
|
|
|
|
+ }
|
|
}
|
|
}
|