|
|
|
|
@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
import com.biutag.constants.AppConstants; |
|
|
|
|
import com.biutag.entity.setting.DictData; |
|
|
|
|
import com.biutag.entity.system.Dept; |
|
|
|
|
import com.biutag.lan.domain.Mail; |
|
|
|
|
import com.biutag.lan.domain.Report; |
|
|
|
|
import com.biutag.lan.domain.vo.*; |
|
|
|
|
import com.biutag.lan.enums.DeptCategory; |
|
|
|
|
@ -37,6 +38,7 @@ import java.time.LocalDate;
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
import java.time.temporal.TemporalAdjusters; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
@ -53,6 +55,8 @@ public class GenReportService {
|
|
|
|
|
|
|
|
|
|
private final MailMapper mailMapper; |
|
|
|
|
|
|
|
|
|
private final MailService mailService; |
|
|
|
|
|
|
|
|
|
private final IDictDataService dictDataService; |
|
|
|
|
|
|
|
|
|
private final Template template; |
|
|
|
|
@ -62,11 +66,12 @@ public class GenReportService {
|
|
|
|
|
private StorageService storageService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
public GenReportService(IDictDataService dictDataService, DataMapper dataMapper, ReportMapper reportMapper, DeptMapper deptMapper, MailMapper mailMapper) throws IOException { |
|
|
|
|
public GenReportService(IDictDataService dictDataService, DataMapper dataMapper, ReportMapper reportMapper, DeptMapper deptMapper, MailMapper mailMapper, MailService mailService) throws IOException { |
|
|
|
|
this.dataMapper = dataMapper; |
|
|
|
|
this.reportMapper = reportMapper; |
|
|
|
|
this.deptMapper = deptMapper; |
|
|
|
|
this.mailMapper = mailMapper; |
|
|
|
|
this.mailService = mailService; |
|
|
|
|
this.dictDataService = dictDataService; |
|
|
|
|
Configuration configuration = new Configuration(new Version("2.3.28")); |
|
|
|
|
configuration.setDefaultEncoding("UTF-8"); |
|
|
|
|
@ -282,4 +287,19 @@ public class GenReportService {
|
|
|
|
|
.eq(Report::getId, reportId)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 半月报 |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
@Async |
|
|
|
|
public void genBimonthly(Integer reportId, String startTime, String endTime) { |
|
|
|
|
String startTime1 = DateUtil.format(DateUtil.parse(startTime, DatePattern.NORM_DATETIME_FORMATTER), DatePattern.CHINESE_DATE_FORMAT); |
|
|
|
|
String endTime1 = DateUtil.format(DateUtil.parse(endTime, DatePattern.NORM_DATETIME_FORMATTER), DatePattern.CHINESE_DATE_FORMAT); |
|
|
|
|
String createTime = DateUtil.format(new Date(), DatePattern.CHINESE_DATE_FORMAT); |
|
|
|
|
|
|
|
|
|
List<Mail> mails = mailService.list(new LambdaQueryWrapper<Mail>().between(Mail::getMailTime, startTime, endTime)); |
|
|
|
|
Map<String, List<Mail>> categoryGroup = mails.stream().collect(Collectors.groupingBy(Mail::getMailFirstCategory)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |