15 changed files with 649 additions and 25 deletions
@ -0,0 +1,129 @@ |
|||
package com.zdxt.enforcementcode.controller.app.enforcement; |
|||
|
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import com.zdxt.enforcementcode.domain.bo.EnforcementInspectionProgramBo; |
|||
import com.zdxt.enforcementcode.domain.vo.EnforcementInspectionProgramVo; |
|||
import com.zdxt.enforcementcode.service.IEnforcementInspectionProgramService; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.NotEmpty; |
|||
import jakarta.validation.constraints.NotNull; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 执法检查计划 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-04-17 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/app-enf/inspectionProgram") |
|||
public class AppEnforcementInspectionProgramController extends BaseController { |
|||
|
|||
private final IEnforcementInspectionProgramService enforcementInspectionProgramService; |
|||
|
|||
/** |
|||
* 查询执法检查计划列表 |
|||
*/ |
|||
// @SaCheckPermission("enforcementcode:inspectionProgram:list")
|
|||
@GetMapping("/list") |
|||
public TableDataInfo<EnforcementInspectionProgramVo> list(EnforcementInspectionProgramBo bo, PageQuery pageQuery) { |
|||
return enforcementInspectionProgramService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出执法检查计划列表 |
|||
*/ |
|||
// @SaCheckPermission("enforcementcode:inspectionProgram:export")
|
|||
@Log(title = "执法检查计划", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(EnforcementInspectionProgramBo bo, HttpServletResponse response) { |
|||
List<EnforcementInspectionProgramVo> list = enforcementInspectionProgramService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "执法检查计划", EnforcementInspectionProgramVo.class, response); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 查询执法检查计划列表(支持复杂查询条件) |
|||
*/ |
|||
// @SaCheckPermission("enforcementcode:inspectionProgram:list")
|
|||
@GetMapping("/selectInspectionProgramList") |
|||
public TableDataInfo<EnforcementInspectionProgramVo> selectInspectionProgramList(EnforcementInspectionProgramBo bo, PageQuery pageQuery) { |
|||
return enforcementInspectionProgramService.selectEnforcementInspectionProgramPage(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 查询计划列表(包含权限控制) |
|||
*/ |
|||
// @SaCheckPermission("enforcementcode:inspectionProgram:list")
|
|||
@GetMapping("/queryListNoPermission") |
|||
public TableDataInfo<EnforcementInspectionProgramVo> queryListNoPermission(EnforcementInspectionProgramBo bo, PageQuery pageQuery) { |
|||
String deptId = LoginHelper.getDeptId(); |
|||
bo.setDeptId(deptId); |
|||
return enforcementInspectionProgramService.selectPlanPage(bo, pageQuery); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取执法检查计划详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
// @SaCheckPermission("enforcementcode:inspectionProgram:query")
|
|||
@GetMapping("/getInfo") |
|||
public R<EnforcementInspectionProgramVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable String id) { |
|||
return R.ok(enforcementInspectionProgramService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增执法检查计划 |
|||
*/ |
|||
// @SaCheckPermission("enforcementcode:inspectionProgram:add")
|
|||
@Log(title = "执法检查计划", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EnforcementInspectionProgramBo bo) { |
|||
return toAjax(enforcementInspectionProgramService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改执法检查计划 |
|||
*/ |
|||
// @SaCheckPermission("enforcementcode:inspectionProgram:edit")
|
|||
@Log(title = "执法检查计划", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody EnforcementInspectionProgramBo bo) { |
|||
return toAjax(enforcementInspectionProgramService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除执法检查计划 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
// @SaCheckPermission("enforcementcode:inspectionProgram:remove")
|
|||
@Log(title = "执法检查计划", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable String[] ids) { |
|||
return toAjax(enforcementInspectionProgramService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue