package com.gear.admin.controller.finance;
|
|
import java.util.List;
|
import javax.servlet.http.HttpServletResponse;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.gear.common.builder.WhereBuilder;
|
import com.gear.common.vo.Result;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
import com.gear.common.annotation.Log;
|
import com.gear.common.core.controller.BaseController;
|
import com.gear.common.enums.BusinessType;
|
import com.gear.finance.domain.FinanceIdentificationRecord;
|
import com.gear.finance.service.IFinanceIdentificationRecordService;
|
import com.gear.common.utils.poi.ExcelUtil;
|
|
/**
|
* 实名认证记录Controller
|
*
|
* @author czx
|
* @date 2023-11-16
|
*/
|
@RestController
|
@RequestMapping("/finance/idefiterRecord")
|
public class FinanceIdentificationRecordController extends BaseController
|
{
|
@Autowired
|
private IFinanceIdentificationRecordService financeIdentificationRecordService;
|
|
/**
|
* 查询实名认证记录列表
|
*/
|
@PreAuthorize("@ss.hasPermi('finance:idefiterRecord:list')")
|
@GetMapping("/list")
|
public Result<IPage<FinanceIdentificationRecord>> list(FinanceIdentificationRecord financeIdentificationRecord,
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
|
QueryWrapper<FinanceIdentificationRecord> queryWrapper = WhereBuilder.build(financeIdentificationRecord);
|
Page<FinanceIdentificationRecord> page = new Page<FinanceIdentificationRecord>(pageNo, pageSize);
|
IPage<FinanceIdentificationRecord> pageList = financeIdentificationRecordService.page(page, queryWrapper);
|
return Result.OK(pageList);
|
}
|
|
/**
|
* 导出实名认证记录列表
|
*/
|
@PreAuthorize("@ss.hasPermi('finance:idefiterRecord:export')")
|
@Log(title = "实名认证记录", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, FinanceIdentificationRecord financeIdentificationRecord){
|
QueryWrapper<FinanceIdentificationRecord> queryWrapper = WhereBuilder.build(financeIdentificationRecord);
|
List<FinanceIdentificationRecord> list = financeIdentificationRecordService.list(queryWrapper);
|
ExcelUtil<FinanceIdentificationRecord> util = new ExcelUtil<FinanceIdentificationRecord>(FinanceIdentificationRecord.class);
|
util.exportExcel(response, list, "实名认证记录数据");
|
}
|
|
/**
|
* 获取实名认证记录详细信息
|
*/
|
@PreAuthorize("@ss.hasPermi('finance:idefiterRecord:query')")
|
@GetMapping(value = "/{id}")
|
public Result<FinanceIdentificationRecord> getInfo(@PathVariable("id") String id){
|
FinanceIdentificationRecord financeIdentificationRecord = financeIdentificationRecordService.getById(id);
|
if(financeIdentificationRecord==null) {
|
return Result.error("未找到对应数据");
|
}
|
return Result.OK(financeIdentificationRecord);
|
}
|
|
/**
|
* 新增实名认证记录
|
*/
|
@PreAuthorize("@ss.hasPermi('finance:idefiterRecord:add')")
|
@Log(title = "实名认证记录", businessType = BusinessType.INSERT)
|
@PostMapping
|
public Result<String> add(@RequestBody FinanceIdentificationRecord financeIdentificationRecord){
|
financeIdentificationRecordService.save(financeIdentificationRecord);
|
return Result.ok("添加成功!");
|
}
|
|
/**
|
* 修改实名认证记录
|
*/
|
@PreAuthorize("@ss.hasPermi('finance:idefiterRecord:edit')")
|
@Log(title = "实名认证记录", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public Result<String> edit(@RequestBody FinanceIdentificationRecord financeIdentificationRecord){
|
financeIdentificationRecordService.updateById(financeIdentificationRecord);
|
return Result.ok("编辑成功!");
|
}
|
|
/**
|
* 删除实名认证记录
|
*/
|
@PreAuthorize("@ss.hasPermi('finance:idefiterRecord:remove')")
|
@Log(title = "实名认证记录", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public Result<String> remove(@PathVariable List<String> ids){
|
financeIdentificationRecordService.removeBatchByIds(ids);
|
return Result.ok("删除成功!");
|
}
|
}
|