|
@@ -0,0 +1,106 @@
|
|
|
|
|
+package com.ktg.web.controller.system;
|
|
|
|
|
+
|
|
|
|
|
+import cn.hutool.core.convert.Convert;
|
|
|
|
|
+import cn.hutool.core.lang.Assert;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
+import com.ktg.common.annotation.Log;
|
|
|
|
|
+import com.ktg.common.core.controller.BaseController;
|
|
|
|
|
+import com.ktg.common.enums.BusinessType;
|
|
|
|
|
+import com.ktg.common.pojo.CommonResult;
|
|
|
|
|
+import com.ktg.common.utils.poi.ExcelUtil;
|
|
|
|
|
+import com.ktg.system.domain.SysUserCharacteristic;
|
|
|
|
|
+import com.ktg.system.service.ISysUserCharacteristicService;
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
|
+import io.swagger.v3.oas.annotations.Parameters;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.util.Arrays;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 用户特征(指纹、面部)Controller
|
|
|
|
|
+ *
|
|
|
|
|
+ * @author cgj
|
|
|
|
|
+ * @date 2025-03-10
|
|
|
|
|
+ */
|
|
|
|
|
+@Api(tags = "用户特征(指纹、面部)")
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("/system/user/characteristic")
|
|
|
|
|
+public class SysUserCharacteristicController extends BaseController
|
|
|
|
|
+{
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysUserCharacteristicService sysUserCharacteristicService;
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("查询用户特征(指纹、面部)-分页")
|
|
|
|
|
+ @Parameters({
|
|
|
|
|
+ @Parameter(name = "page", description = "Page"),
|
|
|
|
|
+ @Parameter(name = "sysUserCharacteristic", description = "实体参数")
|
|
|
|
|
+ })
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:characteristic:list')")
|
|
|
|
|
+ @GetMapping("/getSysUserCharacteristicPage")
|
|
|
|
|
+ public CommonResult<Page<SysUserCharacteristic>> getSysUserCharacteristicPage(Page<SysUserCharacteristic> page, SysUserCharacteristic sysUserCharacteristic)
|
|
|
|
|
+ {
|
|
|
|
|
+ Page<SysUserCharacteristic> result = sysUserCharacteristicService.getSysUserCharacteristicPage(page, sysUserCharacteristic);
|
|
|
|
|
+ return CommonResult.success(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("导出用户特征(指纹、面部)列表")
|
|
|
|
|
+ @Parameter(name = "sysUserCharacteristic", description = "实体参数")
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:characteristic:export')")
|
|
|
|
|
+ @Log(title = "用户特征(指纹、面部)", businessType = BusinessType.EXPORT)
|
|
|
|
|
+ @PostMapping("/exportSysUserCharacteristic")
|
|
|
|
|
+ public void exportSysUserCharacteristic(HttpServletResponse response, SysUserCharacteristic sysUserCharacteristic)
|
|
|
|
|
+ {
|
|
|
|
|
+ Page<SysUserCharacteristic> page = new Page<>();
|
|
|
|
|
+ page.setSize(-1);
|
|
|
|
|
+ page.setCurrent(1);
|
|
|
|
|
+ List<SysUserCharacteristic> list = sysUserCharacteristicService.page(page, Wrappers.<SysUserCharacteristic>lambdaQuery()
|
|
|
|
|
+ .orderByDesc(SysUserCharacteristic::getRecordId)).getRecords();
|
|
|
|
|
+ ExcelUtil<SysUserCharacteristic> util = new ExcelUtil<SysUserCharacteristic>(SysUserCharacteristic.class);
|
|
|
|
|
+ util.exportExcel(response, list, "用户特征(指纹、面部)数据");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("获取用户特征(指纹、面部)详细信息")
|
|
|
|
|
+ @Parameter(name = "recordId", description = "recordId")
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:characteristic:query')")
|
|
|
|
|
+ @GetMapping(value = "/selectSysUserCharacteristicById")
|
|
|
|
|
+ public CommonResult<SysUserCharacteristic> selectSysUserCharacteristicById(Long recordId)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CommonResult.success(sysUserCharacteristicService.getById(recordId));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("新增用户特征(指纹、面部)")
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:characteristic:add')")
|
|
|
|
|
+ @Log(title = "用户特征(指纹、面部)", businessType = BusinessType.INSERT)
|
|
|
|
|
+ @PostMapping("/insertSysUserCharacteristic")
|
|
|
|
|
+ public CommonResult<Boolean> insertSysUserCharacteristic(@RequestBody @Parameter(name = "sysUserCharacteristic", description = "新增数据类,放到body") SysUserCharacteristic sysUserCharacteristic)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CommonResult.success(sysUserCharacteristicService.save(sysUserCharacteristic));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("修改用户特征(指纹、面部)")
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:characteristic:edit')")
|
|
|
|
|
+ @Log(title = "用户特征(指纹、面部)", businessType = BusinessType.UPDATE)
|
|
|
|
|
+ @PostMapping("/updateSysUserCharacteristic")
|
|
|
|
|
+ public CommonResult<Boolean> updateSysUserCharacteristic(@RequestBody @Parameter(name = "sysUserCharacteristic", description = "修改数据类,放到body") SysUserCharacteristic sysUserCharacteristic)
|
|
|
|
|
+ {
|
|
|
|
|
+ return CommonResult.success(sysUserCharacteristicService.updateById(sysUserCharacteristic));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("删除用户特征(指纹、面部)")
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('iscs:characteristic:remove')")
|
|
|
|
|
+ @Log(title = "用户特征(指纹、面部)", businessType = BusinessType.DELETE)
|
|
|
|
|
+ @PostMapping("/deleteSysUserCharacteristicByRecordIds")
|
|
|
|
|
+ public CommonResult<Boolean> deleteSysUserCharacteristicByRecordIds(String recordIds)
|
|
|
|
|
+ {
|
|
|
|
|
+ Assert.notBlank(recordIds, "请选择需要删除的数据!");
|
|
|
|
|
+ Long[] longIds = Convert.toLongArray(recordIds);
|
|
|
|
|
+ return CommonResult.success(sysUserCharacteristicService.removeBatchByIds(Arrays.asList(longIds)));
|
|
|
|
|
+ }
|
|
|
|
|
+}
|