| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.format.DateTimeParseException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @ApiImplicitParam(value = "任务类型", name = "type", dataType = "int"), |
| | | @ApiImplicitParam(value = "任务名称", name = "name", dataType = "String"), |
| | | @ApiImplicitParam(value = "系统审核状态(1=未执行,2=正常,3=异常)", name = "sysStatus", dataType = "int"), |
| | | @ApiImplicitParam(value = "执行时间范围(开始时间)", name = "startTime", dataType = "String"), |
| | | @ApiImplicitParam(value = "执行时间范围(结束时间)", name = "endTime", dataType = "String"), |
| | | }) |
| | | public void downloadTaskRecord(String ids, String code, String status,Integer type, String name, Integer sysStatus,HttpServletResponse response){ |
| | | public void downloadTaskRecord(String ids, String code, String status,Integer type, String name, Integer sysStatus,String startTime ,String endTime,HttpServletResponse response){ |
| | | List<String> id = null; |
| | | if(ToolUtil.isNotEmpty(ids)){ |
| | | String[] split = ids.split(","); |
| | |
| | | .collect(Collectors.toList()); |
| | | |
| | | } |
| | | taskDetailService.downloadTaskRecord(id, code, statusList,sysStatus,type,name, response); |
| | | LocalDateTime startTime2 = null; |
| | | LocalDateTime endTime2 = null; |
| | | |
| | | // 定义匹配前端时间格式的解析器(处理带毫秒和Z的情况) |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | try { |
| | | // 解析为LocalDateTime(Z代表UTC时区,这里直接按字符串处理) |
| | | startTime2 = LocalDateTime.parse(startTime, formatter); |
| | | endTime2 = LocalDateTime.parse(endTime, formatter); |
| | | } catch (DateTimeParseException e) { |
| | | System.err.println("时间格式错误 " ); |
| | | } |
| | | taskDetailService.downloadTaskRecord(id, code, statusList,sysStatus,type,name,startTime2,endTime2,response); |
| | | } |
| | | |
| | | |
| | |
| | | import com.stylefeng.guns.modular.system.model.vo.TaskRecordListVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @param status |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getDownloadTaskRecord(@Param("ids") List<String> ids, @Param("code") String code, @Param("status") List<Integer> status,@Param("sysStatus") Integer sysStatus,@Param("type") Integer type,@Param("typeName") String typeName); |
| | | List<Map<String, Object>> getDownloadTaskRecord(@Param("ids") List<String> ids, @Param("code") String code, @Param("status") List<Integer> status, @Param("sysStatus") Integer sysStatus, @Param("type") Integer type, @Param("typeName") String typeName, @Param("startTime")LocalDateTime startTime, @Param("endTime") LocalDateTime endTime); |
| | | } |
| | |
| | | <if test="null != typeName and '' != typeName"> |
| | | and c.name like CONCAT('%', #{typeName}, '%') |
| | | </if> |
| | | <if test="startTime != null"> |
| | | and b.execution_time >= #{startTime} |
| | | </if> |
| | | <if test="endTime != null"> |
| | | and b.execution_time < #{endTime} |
| | | </if> |
| | | order by b.execution_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | @WebFilter(urlPatterns = "/*") |
| | | public class WebFilterUtil implements Filter { |
| | | /** |
| | | * 截止时间 25年6月底 |
| | | * 截止时间 25年8月底 |
| | | */ |
| | | private Long thresholdValue = 1756655999000L; |
| | | |
| | |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @param status |
| | | * @param response |
| | | */ |
| | | void downloadTaskRecord(List<String> ids, String code,List<Integer> status,Integer sysStatus,Integer type,String typeName, HttpServletResponse response); |
| | | void downloadTaskRecord(List<String> ids, String code, List<Integer> status, Integer sysStatus, Integer type, String typeName, LocalDateTime startTime,LocalDateTime endTime, HttpServletResponse response); |
| | | |
| | | } |
| | |
| | | } |
| | | */ |
| | | @Override |
| | | public void downloadTaskRecord(List<String> ids, String code, List<Integer> status,Integer sysStatus, Integer type,String typeName,HttpServletResponse response){ |
| | | List<Map<String, Object>> mapList = this.baseMapper.getDownloadTaskRecord(ids, code, status, sysStatus, type, typeName); |
| | | public void downloadTaskRecord(List<String> ids, String code, List<Integer> status,Integer sysStatus, Integer type,String typeName,LocalDateTime startTime , LocalDateTime endTime,HttpServletResponse response){ |
| | | List<Map<String, Object>> mapList = this.baseMapper.getDownloadTaskRecord(ids, code, status, sysStatus, type, typeName,startTime,endTime); |
| | | try { |
| | | HSSFWorkbook hssfWorkbook = new HSSFWorkbook(); |
| | | // 1. 按 name 分组(先获取所有唯一 name) |