upd: 编码规范

This commit is contained in:
2025-03-25 19:39:00 +08:00
parent fe09b0db73
commit a5def21601
5 changed files with 8 additions and 11 deletions
@@ -17,7 +17,7 @@ import java.util.List;
@RequiredArgsConstructor @RequiredArgsConstructor
public class JobRunner implements ApplicationRunner { public class JobRunner implements ApplicationRunner {
private static final Logger log = LoggerFactory.getLogger(JobRunner.class); private static final Logger log = LoggerFactory.getLogger(JobRunner.class);
private final QuartzJobService quartzJobService; private final QuartzJobMapper quartzJobMapper;
private final QuartzManage quartzManage; private final QuartzManage quartzManage;
/** /**
@@ -27,7 +27,7 @@ public class JobRunner implements ApplicationRunner {
*/ */
@Override @Override
public void run(ApplicationArguments applicationArguments) { public void run(ApplicationArguments applicationArguments) {
List<QuartzJob> quartzJobs = quartzJobService.listActiveJob(); List<QuartzJob> quartzJobs = quartzJobMapper.selectActiveJob();
quartzJobs.forEach(quartzManage::addJob); quartzJobs.forEach(quartzManage::addJob);
log.info("Timing task injection complete"); log.info("Timing task injection complete");
} }
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
@@ -16,4 +17,7 @@ public interface QuartzJobMapper extends BaseMapper<QuartzJob> {
IPage<QuartzJob> selectByPage(@Param("criteria") QuartzJobQueryCriteria criteria, Page<Object> page); IPage<QuartzJob> selectByPage(@Param("criteria") QuartzJobQueryCriteria criteria, Page<Object> page);
List<QuartzJob> selectByPage(@Param("criteria") QuartzJobQueryCriteria criteria); List<QuartzJob> selectByPage(@Param("criteria") QuartzJobQueryCriteria criteria);
@Select("SELECT * FROM sys_quartz_job WHERE is_pause = 0")
List<QuartzJob> selectActiveJob();
} }
@@ -109,5 +109,4 @@ public interface QuartzJobService extends IService<QuartzJob> {
* @throws InterruptedException / * @throws InterruptedException /
*/ */
void executionSubJob(String[] tasks) throws InterruptedException; void executionSubJob(String[] tasks) throws InterruptedException;
List<QuartzJob> listActiveJob();
} }
@@ -134,11 +134,6 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
} }
} }
@Override
public List<QuartzJob> listActiveJob() {
return lambdaQuery().eq(QuartzJob::getIsPause, 0).list();
}
@Override @Override
public void download(List<QuartzJob> quartzJobs, HttpServletResponse response) throws IOException { public void download(List<QuartzJob> quartzJobs, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
@@ -16,14 +16,13 @@ public interface DeptMapper extends BaseMapper<Dept> {
List<Dept> selectAll(@Param("criteria") DeptQueryCriteria criteria); List<Dept> selectAll(@Param("criteria") DeptQueryCriteria criteria);
List<Dept> selectByPid(@Param("pid") Long pid); List<Dept> selectByPid(@Param("pid") Long pid);
@Select("select count(*) from sys_dept where pid = #{pid}")
int countByPid(@Param("pid") Long pid);
List<Dept> selectByPidIsNull(); List<Dept> selectByPidIsNull();
Set<Dept> selectByRoleId(@Param("roleId") Long roleId); Set<Dept> selectByRoleId(@Param("roleId") Long roleId);
@Select("select count(*) from sys_dept where pid = #{pid}")
int countByPid(@Param("pid") Long pid);
@Select("update sys_dept set sub_count = #{count} where dept_id = #{id}") @Select("update sys_dept set sub_count = #{count} where dept_id = #{id}")
void updateSubCntById(@Param("count") Integer count, @Param("id") Long id); void updateSubCntById(@Param("count") Integer count, @Param("id") Long id);
} }