118 lines
3.5 KiB
Java
118 lines
3.5 KiB
Java
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.*;
|
|
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.hasAnyPermi('job:mydoJob:OuthandFinish')")
|
|
@Log(title = "出库手动完成", businessType = BusinessType.OTHER)
|
|
@RequestMapping("/OuthandFinish")
|
|
public AjaxResult manualCompleted(@RequestParam("jobIds")String[] jobIds)
|
|
{
|
|
return mydoJobService.OuthandFinish(jobIds);
|
|
}
|
|
}
|