|
@@ -23,7 +23,9 @@ import com.qunzhixinxi.hnqz.admin.api.feign.RemoteScorePackageService;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.model.WmScorePackageSettleExcelModel;
|
|
|
import com.qunzhixinxi.hnqz.common.core.constant.SecurityConstants;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.config.LocalDateTimeConverter;
|
|
|
+import com.qunzhixinxi.hnqz.daemon.quartz.entity.SysDept;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.entity.WmScorePackage;
|
|
|
+import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SysDeptMapper;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.mapper.WmScorePackageMapper;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.service.WmScorePackageService;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -56,6 +58,8 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
|
|
|
private final RemoteScorePackageService remoteScorePackageService;
|
|
|
|
|
|
+ private final SysDeptMapper sysDeptMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean sendSelfSettleDataToDept(Integer deptId, String toEmail, LocalDateTime startOfDay, LocalDateTime endOfDay) throws Exception {
|
|
|
// 本企业当日结算成功数据-发送邮件
|
|
@@ -65,7 +69,9 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
helper.setFrom("yaoyi_report@yaoyi.net");
|
|
|
helper.setTo(toEmail);
|
|
|
|
|
|
- String title = "本企业结算成功数据(" + DateTimeFormatter.ofPattern("yyyy-MM-dd").format(startOfDay) + ")";
|
|
|
+ SysDept sysDept = sysDeptMapper.selectById(deptId);
|
|
|
+
|
|
|
+ String title = String.format("%s结算成功数据(%s)", sysDept.getName(), DateTimeFormatter.ofPattern("yyyy-MM-dd").format(startOfDay));
|
|
|
helper.setSubject(title);
|
|
|
|
|
|
// 获取指定企业当日结算的数据
|
|
@@ -80,7 +86,8 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.registerConverter(new LocalDateTimeConverter())
|
|
|
.autoCloseStream(false).sheet("本企业结算成功数据")
|
|
|
.doWrite(excelModels);
|
|
|
- helper.addAttachment(title, new ByteArrayResource(byteArrayOutputStream.toByteArray()), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
+// helper.addAttachment(title, new ByteArrayResource(byteArrayOutputStream.toByteArray()), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
+ helper.addAttachment(title, new ByteArrayResource(byteArrayOutputStream.toByteArray()), "application/vnd.ms-excel");
|
|
|
helper.setText(String.format("当日结算成功%s条,详情数据见附件", excelModels.size()));
|
|
|
|
|
|
sender.send(mail);
|
|
@@ -99,7 +106,9 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
helper2.setFrom("yaoyi_report@yaoyi.net");
|
|
|
helper2.setTo(toEmail);
|
|
|
|
|
|
- String title2 = "MAH企业结算成功数据(" + DateTimeFormatter.ofPattern("yyyy-MM-dd").format(startOfDay) + ")";
|
|
|
+ SysDept sysDept = sysDeptMapper.selectById(deptId);
|
|
|
+
|
|
|
+ String title2 = String.format("%sMAH结算成功数据(%s)", sysDept.getName(), DateTimeFormatter.ofPattern("yyyy-MM-dd").format(startOfDay));
|
|
|
helper2.setSubject(title2);
|
|
|
|
|
|
// 获取指定企业当日结算的数据
|
|
@@ -114,7 +123,7 @@ public class WmScorePackageServiceImpl extends ServiceImpl<WmScorePackageMapper,
|
|
|
.registerConverter(new LocalDateTimeConverter())
|
|
|
.autoCloseStream(false).sheet("MAH企业结算成功数据")
|
|
|
.doWrite(excelModels2);
|
|
|
- helper2.addAttachment(title2, new ByteArrayResource(byteArrayOutputStream2.toByteArray()), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
+ helper2.addAttachment(title2, new ByteArrayResource(byteArrayOutputStream2.toByteArray()), "application/vnd.ms-excel");
|
|
|
helper2.setText(String.format("当日结算成功%s条,详情数据见附件", excelModels2.size()));
|
|
|
|
|
|
sender.send(mail2);
|