You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tcZz-java/ruoyi-admin/src/main/java/com/ruoyi/tcZz/controller/TcJgdwController.java

121 lines
3.8 KiB

2 years ago
package com.ruoyi.tcZz.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;
2 years ago
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
2 years ago
import com.ruoyi.tcZz.domain.TcJgdw;
import com.ruoyi.tcZz.service.ITcJgdwService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
2 years ago
/**
* Controller
*
2 years ago
* @author ruoyi
* @date 2023-10-13
2 years ago
*/
@RestController
@Api(tags = "监管单位")
2 years ago
@RequestMapping("/tcZz/networkSecurity/jgdw")
public class TcJgdwController extends BaseController {
2 years ago
@Autowired
private ITcJgdwService tcJgdwService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:jgdw:list')")
@GetMapping("/list")
public TableDataInfo list(TcJgdw tcJgdw) {
2 years ago
startPage();
List<TcJgdw> list = tcJgdwService.selectTcJgdwList(tcJgdw);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:jgdw:export')")
@Log(title = "监管单位", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TcJgdw tcJgdw) {
2 years ago
List<TcJgdw> list = tcJgdwService.selectTcJgdwList(tcJgdw);
ExcelUtil<TcJgdw> util = new ExcelUtil<TcJgdw>(TcJgdw.class);
util.exportExcel(response, list, "监管单位数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:jgdw:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
2 years ago
return success(tcJgdwService.selectTcJgdwById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:jgdw:add')")
@Log(title = "监管单位", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TcJgdw tcJgdw) {
2 years ago
return toAjax(tcJgdwService.insertTcJgdw(tcJgdw));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:jgdw:edit')")
@Log(title = "监管单位", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TcJgdw tcJgdw) {
2 years ago
return toAjax(tcJgdwService.updateTcJgdw(tcJgdw));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:jgdw:remove')")
@Log(title = "监管单位", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
2 years ago
return toAjax(tcJgdwService.deleteTcJgdwByIds(ids));
}
/**
*
*/
@ApiOperation(value = "查询监管单位列表", response = TcJgdw.class)
@GetMapping("/ListNoToken")
public TableDataInfo ListNoToken(TcJgdw tcJgdw) {
startPage();
List<TcJgdw> list = tcJgdwService.selectTcJgdwList(tcJgdw);
return getDataTable(list);
}
/**
*
*/
@ApiOperation("通用导入excel信息")
@PostMapping("/common/importExcel")
public AjaxResult importExcel(MultipartFile file) throws Exception {
ExcelUtil<TcJgdw> util = new ExcelUtil<TcJgdw>(TcJgdw.class);
List<TcJgdw> tcJgdwList = util.importExcel(file.getInputStream());
tcJgdwService.importUser(tcJgdwList);
return AjaxResult.success();
}
2 years ago
}