项目初始化
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
package com.ruoyi.job.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 任务完成回传Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/job/callBack")
|
||||
public class JobCallBackController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IJobCallBackService jobCallBackService;
|
||||
|
||||
/**
|
||||
* 查询任务完成回传列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:callBack:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(JobCallBack jobCallBack)
|
||||
{
|
||||
startPage();
|
||||
List<JobCallBack> list = jobCallBackService.selectJobCallBackList(jobCallBack);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出任务完成回传列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:callBack:export')")
|
||||
@Log(title = "任务完成回传", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, JobCallBack jobCallBack)
|
||||
{
|
||||
List<JobCallBack> list = jobCallBackService.selectJobCallBackList(jobCallBack);
|
||||
ExcelUtil<JobCallBack> util = new ExcelUtil<JobCallBack>(JobCallBack.class);
|
||||
util.exportExcel(response, list, "任务完成回传数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务完成回传详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:callBack:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(jobCallBackService.selectJobCallBackById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增任务完成回传
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:callBack:add')")
|
||||
@Log(title = "任务完成回传", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody JobCallBack jobCallBack)
|
||||
{
|
||||
return toAjax(jobCallBackService.insertJobCallBack(jobCallBack));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务完成回传
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:callBack:edit')")
|
||||
@Log(title = "任务完成回传", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody JobCallBack jobCallBack)
|
||||
{
|
||||
return toAjax(jobCallBackService.updateJobCallBack(jobCallBack));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务完成回传
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:callBack:remove')")
|
||||
@Log(title = "任务完成回传", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(jobCallBackService.deleteJobCallBackByIds(ids));
|
||||
}
|
||||
|
||||
//@Scheduled(fixedDelay=1500)
|
||||
public void jobCallBack() {
|
||||
jobCallBackService.jobCallBack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.ruoyi.job.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 作业信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/job/mydoJob")
|
||||
public class MydoJobController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
|
||||
/**
|
||||
* 查询作业信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MydoJob mydoJob)
|
||||
{
|
||||
startPage();
|
||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询作业信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
||||
@GetMapping("/listFinish")
|
||||
public TableDataInfo listFinish(MydoJob mydoJob)
|
||||
{
|
||||
startPage();
|
||||
List<MydoJob> list = mydoJobService.selectMydoJobFinishList(mydoJob);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出作业信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:export')")
|
||||
@Log(title = "作业信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MydoJob mydoJob)
|
||||
{
|
||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
||||
ExcelUtil<MydoJob> util = new ExcelUtil<MydoJob>(MydoJob.class);
|
||||
util.exportExcel(response, list, "作业信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取作业信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:query')")
|
||||
@GetMapping(value = "/{jobId}")
|
||||
public AjaxResult getInfo(@PathVariable("jobId") String jobId)
|
||||
{
|
||||
return success(mydoJobService.selectMydoJobByJobId(jobId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作业信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:add')")
|
||||
@Log(title = "作业信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MydoJob mydoJob)
|
||||
{
|
||||
return toAjax(mydoJobService.insertMydoJob(mydoJob));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作业信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:edit')")
|
||||
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MydoJob mydoJob)
|
||||
{
|
||||
return toAjax(mydoJobService.updateMydoJob(mydoJob));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作业信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:remove')")
|
||||
@Log(title = "作业信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{jobIds}")
|
||||
public AjaxResult remove(@PathVariable String[] jobIds)
|
||||
{
|
||||
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:manualCallback')")
|
||||
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/manualCallback/{jobId}")
|
||||
public AjaxResult manualCallback(@PathVariable("jobId") String jobId)
|
||||
{
|
||||
return mydoJobService.manualCallback(jobId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user