| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.service.IMdcVacationManagementService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.quartz.Job; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çæå伿¥å®æ¶ä»»å¡ |
| | |
| | | @Resource |
| | | private IMdcVacationManagementService mdcVacationManagementService; |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("宿¶çæå伿¥ä»»å¡ GenerateWeekDaysJob start! æ¶é´:" + DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | mdcVacationManagementService.generateWeekDays(); |
| | | log.info("宿¶çæå伿¥ä»»å¡ GenerateWeekDaysJob æ§è¡æå!"); |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | log.error("宿¶çæå伿¥ä»»å¡ GenerateWeekDaysJob æ§è¡å¤±è´¥!"); |
| | | log.error(e.getMessage(), e); |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(e.toString()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentStatisticalShiftInfoService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 宿¶ç»è®¡åæ¥çæ¬¡æ°æ®ä»»å¡ |
| | |
| | | @Resource |
| | | private IMdcEquipmentStatisticalShiftInfoService mdcEquipmentStatisticalShiftInfoService; |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | quartzLog.setParams(this.parameter); |
| | | log.info(String.format("宿¶ç»è®¡åæ¥çæ¬¡æ°æ®ä»»å¡ param: %s RunningAllEquipmentShiftStatisticalProcessJob start! æ¶é´:" + DateUtils.now(), this.parameter)); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | mdcEquipmentStatisticalShiftInfoService.runningAllEquipmentShiftStatisticalProcess(this.parameter); |
| | | log.info("宿¶ç»è®¡åæ¥çæ¬¡æ°æ®ä»»å¡ RunningAllEquipmentShiftStatisticalProcessJob æ§è¡æå!"); |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | log.error("宿¶ç»è®¡åæ¥çæ¬¡æ°æ®ä»»å¡ RunningAllEquipmentShiftStatisticalProcessJob æ§è¡å¤±è´¥!"); |
| | | log.error(e.getMessage(), e); |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(e.toString()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentStatisticalInfoService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 宿¶ç»è®¡åæ¥æ°æ®ä»»å¡ |
| | |
| | | @Resource |
| | | private IMdcEquipmentStatisticalInfoService mdcEquipmentStatisticalInfoService; |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | quartzLog.setParams(this.parameter); |
| | | log.info(String.format("宿¶ç»è®¡åæ¥æ°æ®ä»»å¡ param: %s RunningAllEquipmentStatisticalProcessJob start! æ¶é´:" + DateUtils.now(), this.parameter)); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | mdcEquipmentStatisticalInfoService.runningAllEquipmentStatisticalProcess(this.parameter); |
| | | log.info("宿¶ç»è®¡åæ¥æ°æ®ä»»å¡ RunningAllEquipmentStatisticalProcessJob æ§è¡æå!"); |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | log.error("宿¶ç»è®¡åæ¥æ°æ®ä»»å¡ RunningAllEquipmentStatisticalProcessJob æ§è¡å¤±è´¥!"); |
| | | log.error(e.getMessage(), e); |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(e.toString()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentRunningSectionService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.quartz.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 宿¶è®¡ç®æ®µæ¶é´ |
| | |
| | | @Resource |
| | | private IMdcEquipmentRunningSectionService mdcEquipmentRunningSectionService; |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("宿¶ç»è®¡æ®µæ¶é´ä»»å¡ RunningAllEquipmentTraceProcessJob start! æ¶é´:" + DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | mdcEquipmentRunningSectionService.runningAllEquipmentTraceProcess(); |
| | | log.info("宿¶ç»è®¡æ®µæ¶é´ä»»å¡ RunningAllEquipmentTraceProcessJob æ§è¡æå!"); |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | log.error("宿¶ç»è®¡æ®µæ¶é´ä»»å¡ RunningAllEquipmentTraceProcessJob æ§è¡å¤±è´¥!"); |
| | | log.error(e.getMessage(), e); |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(e.toString()); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.quartz.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.quartz.dto.SysQuartzLogDto; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.quartz.vo.SysQuartzLogVo; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * @Description: 宿¶ä»»å¡æ¥å¿ |
| | | * @author: LiuS |
| | | * @create: 2023-08-05 14:01 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "宿¶ä»»å¡æ¥å¿æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/sys/quartzLog") |
| | | public class SysQuartzLogController extends JeecgController<SysQuartzLog, ISysQuartzLogService> { |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @AutoLog(value = "宿¶ä»»å¡æ¥å¿æ¥å£-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "宿¶ä»»å¡æ¥å¿æ¥å£-å页å表æ¥è¯¢", notes = "宿¶ä»»å¡æ¥å¿æ¥å£-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<SysQuartzLogDto>> queryList(SysQuartzLogVo sysQuartzLogVo, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | if (StringUtils.isBlank(sysQuartzLogVo.getJobId())) { |
| | | return Result.error("ä»»å¡IDä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | IPage<SysQuartzLogDto> result = sysQuartzLogService.pageList(pageNo, pageSize, sysQuartzLogVo); |
| | | return Result.OK(result); |
| | | } |
| | | |
| | | @AutoLog(value = "宿¶ä»»å¡æ¥å¿æ¥å£-导åº") |
| | | @ApiOperation(value = "宿¶ä»»å¡æ¥å¿æ¥å£-导åº", notes = "宿¶ä»»å¡æ¥å¿æ¥å£-导åº") |
| | | @RequestMapping("/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, SysQuartzLogVo sysQuartzLogVo) { |
| | | return this.sysQuartzLogService.exportXls(sysQuartzLogVo); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.quartz.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author: LiuS |
| | | * @create: 2023-08-05 14:05 |
| | | */ |
| | | @Data |
| | | public class SysQuartzLogDto { |
| | | |
| | | @Excel(name = "ä»»å¡ç±»å", width = 40) |
| | | private String jobClassName; |
| | | @Excel(name = "cron表达å¼", width = 30) |
| | | private String cronExpression; |
| | | @Excel(name = "åæ°", width = 15) |
| | | private String parameter; |
| | | @Excel(name = "æè¿°", width = 40) |
| | | private String description; |
| | | @Excel(name = "æ¥éä¿¡æ¯", width = 50) |
| | | private String exceptionDetail; |
| | | @Excel(name = "æåæ å¿ 0æå -1失败", width = 15) |
| | | private Integer isSuccess; |
| | | @Excel(name = "æ§è¡æ¶é´", width = 15) |
| | | private Integer executionTime; |
| | | @Excel(name = "å建æ¶é´", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.quartz.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | /** |
| | | * @Description: 宿¶ä»»å¡æ¥å¿ |
| | | * @Author: Lius |
| | | * @Date: 2023-08-05 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("sys_quartz_log") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "sys_quartz_log对象", description = "宿¶ä»»å¡æ¥å¿") |
| | | public class SysQuartzLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1804183004277004124L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "id") |
| | | private String id; |
| | | /** |
| | | * ä»»å¡id |
| | | */ |
| | | @Excel(name = "ä»»å¡id", width = 15) |
| | | @ApiModelProperty(value = "ä»»å¡id") |
| | | private String jobId; |
| | | /** |
| | | * æ¥éä¿¡æ¯ |
| | | */ |
| | | @Excel(name = "æ¥éä¿¡æ¯", width = 15) |
| | | @ApiModelProperty(value = "æ¥éä¿¡æ¯") |
| | | private String exceptionDetail; |
| | | /** |
| | | * æåæ å¿ 0æå -1失败 |
| | | */ |
| | | @Excel(name = "æåæ å¿ 0æå -1失败", width = 15) |
| | | @ApiModelProperty(value = "æåæ å¿ 0æå -1失败") |
| | | private Integer isSuccess; |
| | | /** |
| | | * åæ° |
| | | */ |
| | | @Excel(name = "åæ°", width = 15) |
| | | @ApiModelProperty(value = "åæ°") |
| | | private String params; |
| | | /** |
| | | * æ§è¡æ¶é´ |
| | | */ |
| | | @Excel(name = "æ§è¡æ¶é´", width = 15) |
| | | @ApiModelProperty(value = "æ§è¡æ¶é´") |
| | | private Integer executionTime; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @Excel(name = "å建æ¶é´", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.quartz.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.quartz.dto.SysQuartzLogDto; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.vo.SysQuartzLogVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 宿¶ä»»å¡æ¥å¿ |
| | | * @Author: Lius |
| | | * @Date: 2023-08-05 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface SysQuartzLogMapper extends BaseMapper<SysQuartzLog> { |
| | | |
| | | IPage<SysQuartzLogDto> pageList(IPage<SysQuartzLogDto> page, @Param("sysQuartzLogVo") SysQuartzLogVo sysQuartzLogVo); |
| | | |
| | | List<SysQuartzLogDto> list(@Param("sysQuartzLogVo") SysQuartzLogVo sysQuartzLogVo); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.quartz.mapper.SysQuartzLogMapper"> |
| | | |
| | | <!--å页å表æ¥è¯¢--> |
| | | <select id="pageList" resultType="org.jeecg.modules.quartz.dto.SysQuartzLogDto"> |
| | | SELECT |
| | | t2.job_class_name jobClassName, |
| | | t2.cron_expression cronExpression, |
| | | t1.params params, |
| | | t2.description description, |
| | | t1.exception_detail exceptionDetail, |
| | | t1.is_success isSuccess, |
| | | t1.execution_time executionTime, |
| | | t1.create_time createTime |
| | | FROM |
| | | sys_quartz_log t1 |
| | | LEFT JOIN sys_quartz_job t2 ON t1.job_id = t2.id |
| | | <where> |
| | | AND t2.id = #{ sysQuartzLogVo.jobId } |
| | | <if test="sysQuartzLogVo.isSuccess != null"> |
| | | AND t1.is_success = #{ sysQuartzLogVo.isSuccess } |
| | | </if> |
| | | <if test="sysQuartzLogVo.startTime != null and sysQuartzLogVo.startTime != '' and sysQuartzLogVo.endTime != null and sysQuartzLogVo.endTime != ''"> |
| | | AND t1.create_time BETWEEN #{ sysQuartzLogVo.startTime } AND #{ sysQuartzLogVo.endTime } |
| | | </if> |
| | | <if test="sysQuartzLogVo.jobClassName != null and sysQuartzLogVo.jobClassName != ''"> |
| | | AND t2.job_class_name LIKE CONCAT(CONCAT('%',#{ sysQuartzLogVo.jobClassName }),'%') |
| | | </if> |
| | | <if test="sysQuartzLogVo.description != null and sysQuartzLogVo.description != ''"> |
| | | AND t2.description LIKE CONCAT(CONCAT('%',#{ sysQuartzLogVo.description }),'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | | |
| | | |
| | | <select id="list" resultType="org.jeecg.modules.quartz.dto.SysQuartzLogDto"> |
| | | SELECT |
| | | t2.job_class_name jobClassName, |
| | | t2.cron_expression cronExpression, |
| | | t1.params params, |
| | | t2.description description, |
| | | t1.exception_detail exceptionDetail, |
| | | t1.is_success isSuccess, |
| | | t1.execution_time executionTime, |
| | | t1.create_time createTime |
| | | FROM |
| | | sys_quartz_log t1 |
| | | LEFT JOIN sys_quartz_job t2 ON t1.job_id = t2.id |
| | | <where> |
| | | AND t2.id = #{ sysQuartzLogVo.jobId } |
| | | <if test="sysQuartzLogVo.isSuccess != null"> |
| | | AND t1.is_success = #{ sysQuartzLogVo.isSuccess } |
| | | </if> |
| | | <if test="sysQuartzLogVo.startTime != null and sysQuartzLogVo.startTime != '' and sysQuartzLogVo.endTime != null and sysQuartzLogVo.endTime != ''"> |
| | | AND t1.create_time BETWEEN #{ sysQuartzLogVo.startTime } AND #{ sysQuartzLogVo.endTime } |
| | | </if> |
| | | <if test="sysQuartzLogVo.jobClassName != null and sysQuartzLogVo.jobClassName != ''"> |
| | | AND t2.job_class_name LIKE CONCAT(CONCAT('%',#{ sysQuartzLogVo.jobClassName }),'%') |
| | | </if> |
| | | <if test="sysQuartzLogVo.description != null and sysQuartzLogVo.description != ''"> |
| | | AND t2.description LIKE CONCAT(CONCAT('%',#{ sysQuartzLogVo.description }),'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.quartz.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.quartz.dto.SysQuartzLogDto; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.vo.SysQuartzLogVo; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | /** |
| | | * @Description: 宿¶ä»»å¡æ¥å¿ |
| | | * @Author: Lius |
| | | * @Date: 2023-08-05 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface ISysQuartzLogService extends IService<SysQuartzLog> { |
| | | |
| | | /** |
| | | * å页å表 |
| | | * |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param sysQuartzLogVo |
| | | * @return |
| | | */ |
| | | IPage<SysQuartzLogDto> pageList(Integer pageNo, Integer pageSize, SysQuartzLogVo sysQuartzLogVo); |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * |
| | | * @param sysQuartzLogVo |
| | | * @return |
| | | */ |
| | | ModelAndView exportXls(SysQuartzLogVo sysQuartzLogVo); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.quartz.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.quartz.dto.SysQuartzLogDto; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.mapper.SysQuartzLogMapper; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.quartz.vo.SysQuartzLogVo; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 宿¶ä»»å¡æ¥å¿ |
| | | * @Author: Lius |
| | | * @Date: 2023-08-05 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class SysQuartzLogServiceImpl extends ServiceImpl<SysQuartzLogMapper, SysQuartzLog> implements ISysQuartzLogService { |
| | | |
| | | @Override |
| | | public IPage<SysQuartzLogDto> pageList(Integer pageNo, Integer pageSize, SysQuartzLogVo sysQuartzLogVo) { |
| | | IPage<SysQuartzLogDto> page = new Page<>(pageNo, pageSize); |
| | | return this.baseMapper.pageList(page, sysQuartzLogVo); |
| | | } |
| | | |
| | | @Override |
| | | public ModelAndView exportXls(SysQuartzLogVo sysQuartzLogVo) { |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | List<SysQuartzLogDto> list = this.baseMapper.list(sysQuartzLogVo); |
| | | // å¯¼åºæä»¶åç§° |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, "宿¶ä»»å¡æ¥å¿å表"); |
| | | mv.addObject(NormalExcelConstants.CLASS, SysQuartzLogDto.class); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("宿¶ä»»å¡æ¥å¿åè¡¨æ°æ®", "导åºäºº:"+user.getRealname(), "导åºä¿¡æ¯")); |
| | | //update-end---author:wangshuai ---date:20211227 forï¼[JTC-116]导åºäººåæ»äº------------ |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, list); |
| | | return mv; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.quartz.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author: LiuS |
| | | * @create: 2023-08-05 14:07 |
| | | */ |
| | | @Data |
| | | public class SysQuartzLogVo { |
| | | |
| | | private String jobId; |
| | | |
| | | private Integer isSuccess; |
| | | |
| | | private String startTime; |
| | | |
| | | private String endTime; |
| | | |
| | | private String jobClassName; |
| | | |
| | | private String description; |
| | | |
| | | } |