cjl
2024-01-25 12448cb6604875e3b3df367e3b132dd1db45bff8
fix:补充提交
4 files modified
25 ■■■■■ changed files
screen-job/src/main/java/com/moral/api/controller/PubController.java 4 ●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/mapper/DeviceMapper.java 2 ●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java 2 ●●● patch | view | raw | blame | history
screen-job/src/main/resources/application-dev.yml 17 ●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/controller/PubController.java
@@ -21,6 +21,7 @@
import javax.mail.MessagingException;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.util.*;
/**
@@ -177,7 +178,8 @@
    public void  excelDevice() throws IOException {
        String startTime = DateUtils.dateToDateString(DateUtils.addDays(new Date(),-1),DateUtils.yyyy_MM_dd_EN);
        List<DeviceExcelDTO> list = deviceService.ListDeviceExcel(startTime,null,72);
        String path = Objects.requireNonNull(this.getClass().getClassLoader().getResource("")).getPath();
       // String path = this.getClass().getClassLoader().getResource("/data/file").getPath();
        String path = System.getProperty("user.dir")+"/";
        String fileName = String.format("%s疾控中心数据-%s.xlsx",path,startTime);
        ByteArrayOutputStream out = null;
        try {
screen-job/src/main/java/com/moral/api/mapper/DeviceMapper.java
@@ -17,5 +17,5 @@
 */
public interface DeviceMapper extends BaseMapper<Device> {
    List<DeviceExcelDTO> ListDeviceExcel(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("id") int id);
    List<DeviceExcelDTO> ListDeviceExcel(@Param("startTime") String startTime,@Param("id") int id);
}
screen-job/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
@@ -78,6 +78,6 @@
    @Override
    public List<DeviceExcelDTO> ListDeviceExcel(String startTime, String endTime, int id) {
        return this.baseMapper.ListDeviceExcel(startTime,endTime,id);
        return this.baseMapper.ListDeviceExcel(startTime,id);
    }
}
screen-job/src/main/resources/application-dev.yml
@@ -18,7 +18,7 @@
  application:
    name: screen-job
  redis:
    host: r-bp1xdlb9wfc6zt0msp18.redis.rds.aliyuncs.com
    host: r-bp1xdlb9wfc6zt0msppd13.redis.rds.aliyuncs.com
    port: 6379
    password: QxPcRedis_moarl_2320
    timeout: 30000
@@ -35,7 +35,7 @@
        max-wait: 30000
        min-idle: 32
  tokenRedis:
    host: r-bp1xdlb9wfc6zt0msp18.redis.rds.aliyuncs.com
    host: r-bp1xdlb9wfc6zt0msppd13.redis.rds.aliyuncs.com
    port: 6379
    password: QxPcRedis_moarl_2320
    timeout: 30000
@@ -55,7 +55,7 @@
    filters: stat
    type: com.alibaba.druid.pool.DruidDataSource
    max-wait: 60000
    url: jdbc:mysql://rm-bp1pr3rx9m3fnkwsk18.mysql.rds.aliyuncs.com:3306/moral?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
    url: jdbc:mysql://rm-bp1pr3rx9m3fnkwskso.mysql.rds.aliyuncs.com:3306/moral?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
    username: moral_qx
    password: QxPcRedis_moarl_2320
    test-on-borrow: false
@@ -74,9 +74,16 @@
      mail:
        smtp:
          auth: true  # 必须进行授权认证,它的目的就是阻止他人任意乱发邮件
          socketFactory:
            port: 465
            class: javax.net.ssl.SSLSocketFactory
            fallback: false
          starttls: #SMTP加密方式:连接到一个TLS保护连接
          enable: true
          required: true
            enable: true
            required: true
    protocol: smtp
    port: 465
    default-encoding: UTF-8
mybatis-plus:
  mapper-locations: classpath:mapper/*.xml
  global-config: