|
|
|
package com.zc.business.controller;
|
|
|
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
import com.ruoyi.common.exception.job.TaskException;
|
|
|
|
import com.zc.business.domain.DcBatchFunctionsJob;
|
|
|
|
import com.zc.business.service.IDcBatchFunctionsJobService;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.quartz.SchedulerException;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 定时任务Controller
|
|
|
|
*
|
|
|
|
* @author zhaoxianglong
|
|
|
|
*/
|
|
|
|
@Api(tags = {"定时任务"})
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/business/dcBatchFunctionsJob")
|
|
|
|
public class DcBatchFunctionsJobController extends BaseController {
|
|
|
|
@Resource
|
|
|
|
private IDcBatchFunctionsJobService dcBatchFunctionsJobService;
|
|
|
|
|
|
|
|
//*********************************调用功能记录增删改查******************************************
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 分页查询列表
|
|
|
|
*
|
|
|
|
* @param dcBatchFunctionsJob 请求参数
|
|
|
|
* @return 分页查询结果
|
|
|
|
*/
|
|
|
|
@ApiOperation("分页查询列表")
|
|
|
|
//@PreAuthorize("@ss.hasPermi('iot:facility:list')")
|
|
|
|
@GetMapping("list")
|
|
|
|
public TableDataInfo listFacility(DcBatchFunctionsJob dcBatchFunctionsJob) {
|
|
|
|
return getDataTable(dcBatchFunctionsJobService.pageDcBatchFunctionsJob(dcBatchFunctionsJob));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 无分页查询列表
|
|
|
|
*
|
|
|
|
* @param dcBatchFunctionsJob 请求参数
|
|
|
|
* @return 查询结果
|
|
|
|
*/
|
|
|
|
@ApiOperation("无分页查询列表")
|
|
|
|
//@PreAuthorize("@ss.hasPermi('iot:facility:query')")
|
|
|
|
@GetMapping("query")
|
|
|
|
public AjaxResult queryFacility(DcBatchFunctionsJob dcBatchFunctionsJob) throws SchedulerException {
|
|
|
|
return AjaxResult.success(dcBatchFunctionsJobService.listDcBatchFunctionsJob(dcBatchFunctionsJob));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据id查询信息
|
|
|
|
*
|
|
|
|
* @param id id
|
|
|
|
* @return 查询结果
|
|
|
|
*/
|
|
|
|
@ApiOperation("根据id查询信息")
|
|
|
|
// @PreAuthorize("@ss.hasPermi('iot:facility:query')")
|
|
|
|
@GetMapping("{id}")
|
|
|
|
public AjaxResult getFacility(@PathVariable String id) {
|
|
|
|
return AjaxResult.success(dcBatchFunctionsJobService.getById(id));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 新增
|
|
|
|
*
|
|
|
|
* @param dcBatchFunctionsJob 新增参数
|
|
|
|
* @return 新增操作结果
|
|
|
|
*/
|
|
|
|
@ApiOperation("新增")
|
|
|
|
//@PreAuthorize("@ss.hasPermi('iot:facility:add')")
|
|
|
|
@Log(title = "新增", businessType = BusinessType.INSERT)
|
|
|
|
@PostMapping
|
|
|
|
public AjaxResult addFacility(@Valid @RequestBody DcBatchFunctionsJob dcBatchFunctionsJob) throws SchedulerException, TaskException {
|
|
|
|
return AjaxResult.success(dcBatchFunctionsJobService.addDcBatchFunctionsJob(dcBatchFunctionsJob));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改
|
|
|
|
*
|
|
|
|
* @param dcBatchFunctionsJob 修改参数
|
|
|
|
* @return 修改操作结果
|
|
|
|
*/
|
|
|
|
@ApiOperation("修改")
|
|
|
|
// @PreAuthorize("@ss.hasPermi('iot:facility:edit')")
|
|
|
|
@Log(title = "修改", businessType = BusinessType.UPDATE)
|
|
|
|
@PutMapping
|
|
|
|
public AjaxResult editFacility(@Valid @RequestBody DcBatchFunctionsJob dcBatchFunctionsJob) throws SchedulerException, TaskException {
|
|
|
|
return toAjax(dcBatchFunctionsJobService.editDcBatchFunctionsJob(dcBatchFunctionsJob));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除
|
|
|
|
*
|
|
|
|
* @param ids id集
|
|
|
|
* @return 删除操作结果
|
|
|
|
*/
|
|
|
|
@ApiOperation("删除")
|
|
|
|
//@PreAuthorize("@ss.hasPermi('iot:facility:remove')")
|
|
|
|
@Log(title = "删除", businessType = BusinessType.DELETE)
|
|
|
|
@DeleteMapping("{ids}")
|
|
|
|
public AjaxResult removeFacility(@PathVariable List<String> ids) throws SchedulerException, TaskException {
|
|
|
|
return toAjax(dcBatchFunctionsJobService.removeDcBatchFunctionsJob(ids));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除
|
|
|
|
*
|
|
|
|
* @return 删除操作结果
|
|
|
|
*/
|
|
|
|
@ApiOperation("删除")
|
|
|
|
// @PreAuthorize("@ss.hasPermi('iot:facility:remove')")
|
|
|
|
@Log(title = "删除", businessType = BusinessType.DELETE)
|
|
|
|
@DeleteMapping("/time/{groupId}/{time}")
|
|
|
|
public AjaxResult deletesATaskByTime(@PathVariable String groupId, @PathVariable String time) {
|
|
|
|
return toAjax(dcBatchFunctionsJobService.deletesATaskByTime(groupId, time));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|