|
@@ -5,19 +5,11 @@ import cn.hutool.core.lang.Assert;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ktg.common.annotation.Log;
|
|
import com.ktg.common.annotation.Log;
|
|
|
-import com.ktg.common.config.RuoYiConfig;
|
|
|
|
|
import com.ktg.common.core.controller.BaseController;
|
|
import com.ktg.common.core.controller.BaseController;
|
|
|
-import com.ktg.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ktg.common.enums.BusinessType;
|
|
import com.ktg.common.enums.BusinessType;
|
|
|
import com.ktg.common.pojo.CommonResult;
|
|
import com.ktg.common.pojo.CommonResult;
|
|
|
-import com.ktg.common.utils.StringUtils;
|
|
|
|
|
-import com.ktg.common.utils.file.FileUploadUtils;
|
|
|
|
|
-import com.ktg.common.utils.file.FileUtils;
|
|
|
|
|
import com.ktg.common.utils.poi.ExcelUtil;
|
|
import com.ktg.common.utils.poi.ExcelUtil;
|
|
|
-import com.ktg.framework.config.ServerConfig;
|
|
|
|
|
-import com.ktg.system.domain.SysUploadFile;
|
|
|
|
|
import com.ktg.system.domain.SysUserCharacteristic;
|
|
import com.ktg.system.domain.SysUserCharacteristic;
|
|
|
-import com.ktg.system.service.ISysUploadFileService;
|
|
|
|
|
import com.ktg.system.service.ISysUserCharacteristicService;
|
|
import com.ktg.system.service.ISysUserCharacteristicService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -25,13 +17,13 @@ import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.Parameters;
|
|
import io.swagger.v3.oas.annotations.Parameters;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -49,12 +41,6 @@ public class SysUserCharacteristicController extends BaseController
|
|
|
{
|
|
{
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysUserCharacteristicService sysUserCharacteristicService;
|
|
private ISysUserCharacteristicService sysUserCharacteristicService;
|
|
|
- @Autowired
|
|
|
|
|
- private ServerConfig serverConfig;
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private ISysUploadFileService iSysUploadFileService;
|
|
|
|
|
- @Value("${ktg-mes.prod}")
|
|
|
|
|
- private String prodApi;
|
|
|
|
|
|
|
|
|
|
@ApiOperation("查询用户特征(指纹、面部)-分页")
|
|
@ApiOperation("查询用户特征(指纹、面部)-分页")
|
|
|
@Parameters({
|
|
@Parameters({
|
|
@@ -99,41 +85,8 @@ public class SysUserCharacteristicController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('iscs:characteristic:add')")
|
|
@PreAuthorize("@ss.hasPermi('iscs:characteristic:add')")
|
|
|
@Log(title = "新增指纹录入-指纹图片转成dat存储", businessType = BusinessType.INSERT)
|
|
@Log(title = "新增指纹录入-指纹图片转成dat存储", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/insertUserFingerprintDat")
|
|
@PostMapping("/insertUserFingerprintDat")
|
|
|
- public CommonResult<Boolean> insertUserFingerprintDat(MultipartFile file, Long userId)
|
|
|
|
|
- {
|
|
|
|
|
- try {
|
|
|
|
|
- // 上传文件路径
|
|
|
|
|
- String filePath = RuoYiConfig.getUploadPath();
|
|
|
|
|
- // 上传并返回新文件名称
|
|
|
|
|
- String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
|
|
- String url;
|
|
|
|
|
- String absolutePath;
|
|
|
|
|
- if (StringUtils.isNotBlank(prodApi)) {
|
|
|
|
|
- url = serverConfig.getUrl() + prodApi + fileName;
|
|
|
|
|
- absolutePath = fileName.replace("/profile/upload", filePath);
|
|
|
|
|
- } else {
|
|
|
|
|
- url = serverConfig.getUrl() + fileName;
|
|
|
|
|
- absolutePath = "C:" + fileName.replace("/profile/upload", filePath);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- AjaxResult ajax = AjaxResult.success();
|
|
|
|
|
- ajax.put("url", url);
|
|
|
|
|
- ajax.put("fileName", fileName);
|
|
|
|
|
- ajax.put("newFileName", FileUtils.getName(fileName));
|
|
|
|
|
- ajax.put("originalFilename", file.getOriginalFilename());
|
|
|
|
|
-
|
|
|
|
|
- // 2.开始新增文件上传信息
|
|
|
|
|
- SysUploadFile sysFile = new SysUploadFile();
|
|
|
|
|
- sysFile.setName(file.getOriginalFilename());
|
|
|
|
|
- sysFile.setPath(absolutePath);
|
|
|
|
|
- sysFile.setUrl(url);
|
|
|
|
|
- sysFile.setType(file.getContentType());
|
|
|
|
|
- sysFile.setSize(file.getSize());
|
|
|
|
|
- iSysUploadFileService.insertSysUploadFile(sysFile);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("上传指纹失败:" + e);
|
|
|
|
|
- }
|
|
|
|
|
- return CommonResult.success(sysUserCharacteristicService.insertUserFingerprintDat(file, userId));
|
|
|
|
|
|
|
+ public CommonResult<Boolean> insertUserFingerprintDat(MultipartFile file, String userName) throws IOException {
|
|
|
|
|
+ return CommonResult.success(sysUserCharacteristicService.insertUserFingerprintDat(file, userName));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation("修改用户特征(指纹、面部)")
|
|
@ApiOperation("修改用户特征(指纹、面部)")
|