package com.ruoyi.web.controller.investment; import javax.servlet.http.HttpServletResponse; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.investment.ZxInvestment; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PathVariable; 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.enums.BusinessType; import com.ruoyi.system.service.IZxInvestmentService; import com.ruoyi.common.core.page.TableDataInfo; import java.util.List; /** * 政协委员招商引资Controller * * @author boman * @date 2024-03-27 */ @RestController @RequestMapping("/zx/investment") public class ZxInvestmentController extends BaseController { @Autowired private IZxInvestmentService zxInvestmentService; /** * 查询政协委员招商引资列表 */ @PreAuthorize("@ss.hasPermi('zx:investment:list')") @GetMapping("/list") public TableDataInfo list(ZxInvestment zxInvestment) { startPage(); List list = zxInvestmentService.selectZxInvestmentList(zxInvestment); return getDataTable(list); } /** * 导出政协委员招商引资列表 */ @PreAuthorize("@ss.hasPermi('zx:investment:export')") @Log(title = "政协委员招商引资", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ZxInvestment zxInvestment) { List list = zxInvestmentService.selectZxInvestmentList(zxInvestment); ExcelUtil util = new ExcelUtil(ZxInvestment.class); util.exportExcel(response, list, "政协委员招商引资数据"); } /** * 获取政协委员招商引资详细信息 */ @PreAuthorize("@ss.hasPermi('zx:investment:query')") @GetMapping(value = "/{investmentId}") public AjaxResult getInfo(@PathVariable("investmentId") Long investmentId) { return success(zxInvestmentService.selectZxInvestmentByInvestmentId(investmentId)); } /** * 新增政协委员招商引资 */ @PreAuthorize("@ss.hasPermi('zx:investment:add')") @Log(title = "政协委员招商引资", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ZxInvestment zxInvestment) { return toAjax(zxInvestmentService.insertZxInvestment(zxInvestment)); } /** * 修改政协委员招商引资 */ @PreAuthorize("@ss.hasPermi('zx:investment:edit')") @Log(title = "政协委员招商引资", businessType = BusinessType.UPDATE) @PostMapping("/put") public AjaxResult edit(@RequestBody ZxInvestment zxInvestment) { return zxInvestmentService.updateZxInvestment(zxInvestment); } /** * 审核/签约按钮政协委员招商引资 */ @PreAuthorize("@ss.hasPermi('zx:investment:examine')") @Log(title = "政协委员招商引资", businessType = BusinessType.UPDATE) @PostMapping("/examine") public AjaxResult examine(@RequestBody ZxInvestment zxInvestment) { return zxInvestmentService.updateZxInvestment(zxInvestment); } /** * 删除政协委员招商引资 */ @PreAuthorize("@ss.hasPermi('zx:investment:remove')") @Log(title = "政协委员招商引资", businessType = BusinessType.DELETE) @GetMapping("/delete/{investmentIds}") public AjaxResult remove(@PathVariable Long[] investmentIds) { return toAjax(zxInvestmentService.deleteZxInvestmentByInvestmentIds(investmentIds)); } }