package com.ruoyi.system.controller;
|
|
import java.util.List;
|
import java.util.Map;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
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.core.page.TableDataInfo;
|
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.system.domain.CjFormConfig;
|
import com.ruoyi.system.service.ICjFormConfigService;
|
|
/**
|
* 填表配置Controller
|
*
|
* @author ruoyi
|
* @date 2026-09-09
|
*/
|
@RestController
|
@RequestMapping("/system/formConfig")
|
public class CjFormConfigController extends BaseController
|
{
|
@Autowired
|
private ICjFormConfigService cjFormConfigService;
|
|
/**
|
* 查询填表配置列表
|
*/
|
@PreAuthorize("@ss.hasPermi('system:formConfig:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(CjFormConfig cjFormConfig)
|
{
|
startPage();
|
List<CjFormConfig> list = cjFormConfigService.selectCjFormConfigList(cjFormConfig);
|
return getDataTable(list);
|
}
|
|
/**
|
* 获取内置默认表单定义(35字段),供“从内置库新建/复制”使用
|
*/
|
@PreAuthorize("@ss.hasPermi('system:formConfig:query')")
|
@GetMapping("/builtin")
|
public AjaxResult builtin()
|
{
|
Map<String, Object> node = cjFormConfigService.getBuiltin();
|
return AjaxResult.success(node);
|
}
|
|
/**
|
* 获取填表配置详细信息
|
*/
|
@PreAuthorize("@ss.hasPermi('system:formConfig:query')")
|
@GetMapping(value = "/{configId}")
|
public AjaxResult getInfo(@PathVariable("configId") Long configId)
|
{
|
return success(cjFormConfigService.selectCjFormConfigByConfigId(configId));
|
}
|
|
/**
|
* 新增填表配置
|
*/
|
@PreAuthorize("@ss.hasPermi('system:formConfig:add')")
|
@Log(title = "填表配置", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody CjFormConfig cjFormConfig)
|
{
|
return toAjax(cjFormConfigService.insertCjFormConfig(cjFormConfig));
|
}
|
|
/**
|
* 修改填表配置
|
*/
|
@PreAuthorize("@ss.hasPermi('system:formConfig:edit')")
|
@Log(title = "填表配置", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody CjFormConfig cjFormConfig)
|
{
|
return toAjax(cjFormConfigService.updateCjFormConfig(cjFormConfig));
|
}
|
|
/**
|
* 删除填表配置
|
*/
|
@PreAuthorize("@ss.hasPermi('system:formConfig:remove')")
|
@Log(title = "填表配置", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{configIds}")
|
public AjaxResult remove(@PathVariable Long[] configIds)
|
{
|
return toAjax(cjFormConfigService.deleteCjFormConfigByConfigIds(configIds));
|
}
|
}
|