update
This commit is contained in:
parent
fc6d88a783
commit
58df49f91c
@ -24,6 +24,10 @@ spring:
|
|||||||
url: ${common.mysql.master.url}
|
url: ${common.mysql.master.url}
|
||||||
username: ${common.mysql.master.username}
|
username: ${common.mysql.master.username}
|
||||||
password: ${common.mysql.master.password}
|
password: ${common.mysql.master.password}
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 50MB
|
||||||
|
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
mapper-locations: classpath*:mapper/*Mapper.xml
|
mapper-locations: classpath*:mapper/*Mapper.xml
|
||||||
|
@ -0,0 +1,87 @@
|
|||||||
|
package cn.datax.service.data.metadata.api.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据源信息表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author AllDataDC
|
||||||
|
* @date 2022-11-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName(value = "offline_data_file", autoResultMap = true)
|
||||||
|
public class OfflineDataFileEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@TableField(value = "create_by", fill = FieldFill.INSERT)
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@TableField(value = "switch_time")
|
||||||
|
private LocalDateTime switchTime;
|
||||||
|
|
||||||
|
@TableField(value = "remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField(value = "offline_type")
|
||||||
|
private String offlineType;
|
||||||
|
|
||||||
|
@TableField(value = "is_switch")
|
||||||
|
private String isSwitch;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件原始名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "original_file_name")
|
||||||
|
private String originalFileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_name")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件大小
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_size")
|
||||||
|
private Long fileSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 访问路径
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_path")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "content_type")
|
||||||
|
private String contentType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件来源
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_type")
|
||||||
|
private String fileType;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.datax.service.data.metadata.api.query;
|
||||||
|
|
||||||
|
import cn.datax.common.base.BaseQueryParams;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据源信息表 查询实体
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author AllDataDC
|
||||||
|
* @date 2022-11-14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class OfflineDataFileQuery extends BaseQueryParams {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
private String fileName;
|
||||||
|
}
|
@ -29,6 +29,7 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@ -261,4 +262,10 @@ public class MetadataSourceController extends BaseController {
|
|||||||
List<Map<String, Object>> list = metadataSourceService.getMetadatablood(params.get("sourceId"), params.get("tableId"));
|
List<Map<String, Object>> list = metadataSourceService.getMetadatablood(params.get("sourceId"), params.get("tableId"));
|
||||||
return R.ok().setData(list);
|
return R.ok().setData(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/upload/{type}")
|
||||||
|
public R upload(@RequestParam("file") MultipartFile file, @PathVariable String type) {
|
||||||
|
metadataSourceService.uploadFile(file, type);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,60 @@
|
|||||||
|
package cn.datax.service.data.metadata.controller;
|
||||||
|
|
||||||
|
import cn.datax.common.base.BaseController;
|
||||||
|
import cn.datax.common.core.JsonPage;
|
||||||
|
import cn.datax.common.core.R;
|
||||||
|
import cn.datax.service.data.metadata.api.entity.OfflineDataFileEntity;
|
||||||
|
import cn.datax.service.data.metadata.api.query.OfflineDataFileQuery;
|
||||||
|
import cn.datax.service.data.metadata.service.OfflineDataFileService;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/offline")
|
||||||
|
public class OfflineDataFileController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OfflineDataFileService offlineDataFileService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID查询信息
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||||
|
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R getOfflineDataFileById(@PathVariable String id) {
|
||||||
|
OfflineDataFileEntity offlineDataFileEntity = offlineDataFileService.getOfflineDataFileById(id);
|
||||||
|
return R.ok().setData(offlineDataFileEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
public R getOfflineDataFilePage(OfflineDataFileQuery offlineDataFileQuery) {
|
||||||
|
QueryWrapper<OfflineDataFileEntity> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.like(StrUtil.isNotBlank(offlineDataFileQuery.getFileName()), "s.file_name", offlineDataFileQuery.getFileName());
|
||||||
|
IPage<OfflineDataFileEntity> page = offlineDataFileService.pageWithAuth(new Page<>(offlineDataFileQuery.getPageNum(), offlineDataFileQuery.getPageSize()), queryWrapper);
|
||||||
|
List<OfflineDataFileEntity> collect = page.getRecords();
|
||||||
|
JsonPage<OfflineDataFileEntity> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||||
|
return R.ok().setData(jsonPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package cn.datax.service.data.metadata.dao;
|
||||||
|
|
||||||
|
import cn.datax.common.base.BaseDao;
|
||||||
|
import cn.datax.service.data.metadata.api.entity.OfflineDataFileEntity;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface OfflineDataFileDao extends BaseDao<OfflineDataFileEntity> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
OfflineDataFileEntity selectById(Serializable id);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
List<OfflineDataFileEntity> selectList(@Param(Constants.WRAPPER) Wrapper<OfflineDataFileEntity> queryWrapper);
|
||||||
|
|
||||||
|
<E extends IPage<OfflineDataFileEntity>> E selectPageWithAuth(E page, @Param(Constants.WRAPPER) Wrapper<OfflineDataFileEntity> queryWrapper, @Param("roles") List<String> roles);
|
||||||
|
}
|
@ -6,9 +6,12 @@ import cn.datax.common.database.core.DbColumn;
|
|||||||
import cn.datax.common.database.core.DbTable;
|
import cn.datax.common.database.core.DbTable;
|
||||||
import cn.datax.service.data.metadata.api.dto.MetadataSourceDto;
|
import cn.datax.service.data.metadata.api.dto.MetadataSourceDto;
|
||||||
import cn.datax.service.data.metadata.api.entity.MetadataSourceEntity;
|
import cn.datax.service.data.metadata.api.entity.MetadataSourceEntity;
|
||||||
|
import cn.datax.service.data.metadata.api.entity.OfflineDataFileEntity;
|
||||||
import com.aspose.words.Document;
|
import com.aspose.words.Document;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.apache.hc.core5.http.io.entity.FileEntity;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -54,4 +57,7 @@ public interface MetadataSourceService extends BaseService<MetadataSourceEntity>
|
|||||||
<E extends IPage<MetadataSourceEntity>> E pageWithAuth(E page, Wrapper<MetadataSourceEntity> queryWrapper);
|
<E extends IPage<MetadataSourceEntity>> E pageWithAuth(E page, Wrapper<MetadataSourceEntity> queryWrapper);
|
||||||
|
|
||||||
List<Map<String, Object>> getMetadatablood(String datasourceId, String tableName);
|
List<Map<String, Object>> getMetadatablood(String datasourceId, String tableName);
|
||||||
|
|
||||||
|
OfflineDataFileEntity uploadFile(MultipartFile file, String type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package cn.datax.service.data.metadata.service;
|
||||||
|
|
||||||
|
import cn.datax.common.base.BaseService;
|
||||||
|
import cn.datax.service.data.metadata.api.entity.MetadataSourceEntity;
|
||||||
|
import cn.datax.service.data.metadata.api.entity.OfflineDataFileEntity;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据源信息表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author AllDataDC
|
||||||
|
* @date 2022-11-14
|
||||||
|
*/
|
||||||
|
public interface OfflineDataFileService extends BaseService<OfflineDataFileEntity> {
|
||||||
|
|
||||||
|
OfflineDataFileEntity getOfflineDataFileById(String id);
|
||||||
|
|
||||||
|
<E extends IPage<OfflineDataFileEntity>> E pageWithAuth(E page, Wrapper<OfflineDataFileEntity> queryWrapper);
|
||||||
|
|
||||||
|
}
|
@ -12,6 +12,7 @@ import cn.datax.common.database.core.DbTable;
|
|||||||
import cn.datax.common.exception.DataException;
|
import cn.datax.common.exception.DataException;
|
||||||
import cn.datax.common.redis.service.RedisService;
|
import cn.datax.common.redis.service.RedisService;
|
||||||
import cn.datax.common.utils.SecurityUtil;
|
import cn.datax.common.utils.SecurityUtil;
|
||||||
|
import cn.datax.common.utils.ThrowableUtil;
|
||||||
import cn.datax.service.data.market.api.entity.DataApiEntity;
|
import cn.datax.service.data.market.api.entity.DataApiEntity;
|
||||||
import cn.datax.service.data.market.api.feign.DataApiServiceFeign;
|
import cn.datax.service.data.market.api.feign.DataApiServiceFeign;
|
||||||
import cn.datax.service.data.metadata.api.dto.DbSchema;
|
import cn.datax.service.data.metadata.api.dto.DbSchema;
|
||||||
@ -30,7 +31,10 @@ import cn.datax.service.data.standard.api.entity.ContrastEntity;
|
|||||||
import cn.datax.service.data.standard.api.feign.StandardServiceFeign;
|
import cn.datax.service.data.standard.api.feign.StandardServiceFeign;
|
||||||
import cn.datax.service.data.visual.api.entity.DataSetEntity;
|
import cn.datax.service.data.visual.api.entity.DataSetEntity;
|
||||||
import cn.datax.service.data.visual.api.feign.VisualServiceFeign;
|
import cn.datax.service.data.visual.api.feign.VisualServiceFeign;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.system.SystemUtil;
|
||||||
import com.aspose.words.Document;
|
import com.aspose.words.Document;
|
||||||
import com.aspose.words.MailMerge;
|
import com.aspose.words.MailMerge;
|
||||||
import com.aspose.words.net.System.Data.DataRelation;
|
import com.aspose.words.net.System.Data.DataRelation;
|
||||||
@ -48,7 +52,10 @@ import org.springframework.scheduling.annotation.Async;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@ -115,6 +122,9 @@ public class MetadataSourceServiceImpl extends BaseServiceImpl<MetadataSourceDao
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MetadataTableService metadataTableService;
|
private MetadataTableService metadataTableService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OfflineDataFileDao offlineDataFileDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void saveMetadataSource(MetadataSourceDto metadataSourceDto) {
|
public void saveMetadataSource(MetadataSourceDto metadataSourceDto) {
|
||||||
@ -435,4 +445,42 @@ public class MetadataSourceServiceImpl extends BaseServiceImpl<MetadataSourceDao
|
|||||||
}
|
}
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OfflineDataFileEntity uploadFile(MultipartFile file, String type) {
|
||||||
|
OfflineDataFileEntity fileEntity = new OfflineDataFileEntity();
|
||||||
|
fileEntity.setContentType(file.getContentType())
|
||||||
|
.setOriginalFileName(file.getOriginalFilename())
|
||||||
|
.setFileSize(file.getSize());
|
||||||
|
String fileName = file.getOriginalFilename();
|
||||||
|
fileEntity.setFileName(fileName);
|
||||||
|
uploadLocalFile(file, fileEntity);
|
||||||
|
// 设置文件来源
|
||||||
|
fileEntity.setFileType("local");
|
||||||
|
|
||||||
|
fileEntity.setOfflineType(type);
|
||||||
|
fileEntity.setIsSwitch("djr");
|
||||||
|
|
||||||
|
// 将文件信息保存到数据库
|
||||||
|
offlineDataFileDao.insert(fileEntity);
|
||||||
|
return fileEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void uploadLocalFile(MultipartFile file, OfflineDataFileEntity fileEntity) {
|
||||||
|
String localPath = System.getProperty(SystemUtil.USER_DIR) + File.separator + "home" + File.separator + "zoomlion" + File.separator + "uploadTemp";
|
||||||
|
File parentFile = new File(localPath);
|
||||||
|
if (!parentFile.exists()) {
|
||||||
|
if (!parentFile.mkdirs()) {
|
||||||
|
throw new RuntimeException("创建保存路径失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fileEntity.setFilePath(localPath + File.separator + fileEntity.getOriginalFileName());
|
||||||
|
File dest = new File(localPath + File.separator + fileEntity.getOriginalFileName());
|
||||||
|
try {
|
||||||
|
file.transferTo(dest);
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("离线文件上传异常ex={}, StackTrace={}" + e.getMessage() + ThrowableUtil.getStackTrace(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,50 @@
|
|||||||
|
package cn.datax.service.data.metadata.service.impl;
|
||||||
|
|
||||||
|
import cn.datax.common.base.BaseServiceImpl;
|
||||||
|
import cn.datax.common.utils.SecurityUtil;
|
||||||
|
import cn.datax.service.data.metadata.api.entity.MetadataSourceEntity;
|
||||||
|
import cn.datax.service.data.metadata.api.entity.OfflineDataFileEntity;
|
||||||
|
import cn.datax.service.data.metadata.dao.OfflineDataFileDao;
|
||||||
|
import cn.datax.service.data.metadata.service.OfflineDataFileService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据源信息表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author AllDataDC
|
||||||
|
* @date 2022-11-14
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||||
|
public class OfflineDataFileServiceImpl extends BaseServiceImpl<OfflineDataFileDao, OfflineDataFileEntity> implements OfflineDataFileService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OfflineDataFileDao offlineDataFileDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OfflineDataFileEntity getOfflineDataFileById(String id) {
|
||||||
|
OfflineDataFileEntity offlineDataFileEntity = super.getById(id);
|
||||||
|
return offlineDataFileEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <E extends IPage<OfflineDataFileEntity>> E pageWithAuth(E page, Wrapper<OfflineDataFileEntity> queryWrapper) {
|
||||||
|
boolean admin = SecurityUtil.isAdmin();
|
||||||
|
List<String> roles = new ArrayList<>();
|
||||||
|
if (!admin) {
|
||||||
|
roles = SecurityUtil.getUserRoleIds();
|
||||||
|
}
|
||||||
|
return offlineDataFileDao.selectPageWithAuth(page, queryWrapper, roles);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.datax.service.data.metadata.dao.OfflineDataFileDao">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="cn.datax.service.data.metadata.api.entity.OfflineDataFileEntity">
|
||||||
|
<result column="id" property="id" />
|
||||||
|
<result column="create_by" property="createBy" />
|
||||||
|
<result column="create_time" property="createTime" />
|
||||||
|
<result column="switch_time" property="switchTime" />
|
||||||
|
<result column="remark" property="remark" />
|
||||||
|
<result column="offline_type" property="offlineType" />
|
||||||
|
<result column="is_switch" property="isSwitch" />
|
||||||
|
<result column="original_file_name" property="originalFileName" />
|
||||||
|
<result column="file_name" property="fileName" />
|
||||||
|
<result column="file_size" property="fileSize" />
|
||||||
|
<result column="file_path" property="filePath" />
|
||||||
|
<result column="content_type" property="contentType" />
|
||||||
|
<result column="file_type" property="fileType" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="ExtendResultMap" type="cn.datax.service.data.metadata.api.entity.OfflineDataFileEntity" extends="BaseResultMap">
|
||||||
|
<result column="db_schema" property="dbSchema" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
switch_time,
|
||||||
|
remark,
|
||||||
|
offline_type,
|
||||||
|
is_switch,
|
||||||
|
original_file_name, file_name, file_size, file_path, content_type, file_type
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="Source_Column_List">
|
||||||
|
${alias}.id,
|
||||||
|
${alias}.create_by,
|
||||||
|
${alias}.create_time,
|
||||||
|
${alias}.switch_time,
|
||||||
|
${alias}.remark,
|
||||||
|
${alias}.offline_type,
|
||||||
|
${alias}.is_switch,
|
||||||
|
${alias}.original_file_name, ${alias}.file_name, ${alias}.file_size, ${alias}.file_path, ${alias}.content_type, ${alias}.file_type
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectById" resultMap="ExtendResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="Source_Column_List"><property name="alias" value="s"/></include>
|
||||||
|
FROM offline_data_file s
|
||||||
|
WHERE 1=1 AND s.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectList" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="Base_Column_List"></include>
|
||||||
|
FROM offline_data_file
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPageWithAuth" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="Source_Column_List"><property name="alias" value="s"/></include>
|
||||||
|
FROM offline_data_file s
|
||||||
|
<trim prefix="WHERE" prefixOverrides="WHERE |AND |OR ">
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -61,6 +61,10 @@ public class CheckReportEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String checkBatch;
|
private String checkBatch;
|
||||||
|
|
||||||
|
private String checkReportType;
|
||||||
|
|
||||||
|
private Integer checkTimeConsuming;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规则名称
|
* 规则名称
|
||||||
*/
|
*/
|
||||||
|
@ -25,6 +25,8 @@ public class CheckReportVo implements Serializable {
|
|||||||
private LocalDateTime checkDate;
|
private LocalDateTime checkDate;
|
||||||
private String checkResult;
|
private String checkResult;
|
||||||
private Integer checkTotalCount;
|
private Integer checkTotalCount;
|
||||||
|
private String checkReportType;
|
||||||
|
private String checkTimeConsuming;
|
||||||
private Integer checkErrorCount;
|
private Integer checkErrorCount;
|
||||||
private String ruleName;
|
private String ruleName;
|
||||||
private String ruleType;
|
private String ruleType;
|
||||||
|
@ -88,7 +88,6 @@
|
|||||||
<groupId>com.platform</groupId>
|
<groupId>com.platform</groupId>
|
||||||
<artifactId>data-metadata-service</artifactId>
|
<artifactId>data-metadata-service</artifactId>
|
||||||
<version>0.4.x</version>
|
<version>0.4.x</version>
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class StartedUpRunner implements ApplicationRunner {
|
|||||||
List<ScheduleJobEntity> list = scheduleJobService.list(Wrappers.<ScheduleJobEntity>lambdaQuery().eq(ScheduleJobEntity::getStatus, DataConstant.TrueOrFalse.TRUE.getKey()));
|
List<ScheduleJobEntity> list = scheduleJobService.list(Wrappers.<ScheduleJobEntity>lambdaQuery().eq(ScheduleJobEntity::getStatus, DataConstant.TrueOrFalse.TRUE.getKey()));
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
list.forEach(job -> {
|
list.forEach(job -> {
|
||||||
SchedulingRunnable task = new SchedulingRunnable(job.getId(), job.getBeanName(), job.getMethodName(), job.getMethodParams());
|
SchedulingRunnable task = new SchedulingRunnable(job.getId(), job.getBeanName(), job.getMethodName(), job.getMethodParams(), job.getJobType());
|
||||||
cronTaskRegistrar.addCronTask(task, job.getCronExpression());
|
cronTaskRegistrar.addCronTask(task, job.getCronExpression());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,6 @@ public class CheckReportController extends BaseController {
|
|||||||
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleSource()), "r.rule_source", checkReportQuery.getRuleSource());
|
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleSource()), "r.rule_source", checkReportQuery.getRuleSource());
|
||||||
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleTable()), "r.rule_table", checkReportQuery.getRuleTable());
|
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleTable()), "r.rule_table", checkReportQuery.getRuleTable());
|
||||||
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleColumn()), "r.rule_column", checkReportQuery.getRuleColumn());
|
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleColumn()), "r.rule_column", checkReportQuery.getRuleColumn());
|
||||||
// 确定唯一核查报告
|
|
||||||
queryWrapper.apply("c.check_batch = r.last_check_batch");
|
|
||||||
IPage<CheckReportEntity> page = checkReportService.page(new Page<>(checkReportQuery.getPageNum(), checkReportQuery.getPageSize()), queryWrapper);
|
IPage<CheckReportEntity> page = checkReportService.page(new Page<>(checkReportQuery.getPageNum(), checkReportQuery.getPageSize()), queryWrapper);
|
||||||
List<CheckReportVo> collect = page.getRecords().stream().map(checkReportMapper::toVO).collect(Collectors.toList());
|
List<CheckReportVo> collect = page.getRecords().stream().map(checkReportMapper::toVO).collect(Collectors.toList());
|
||||||
JsonPage<CheckReportVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
JsonPage<CheckReportVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||||
|
@ -25,11 +25,14 @@ public class SchedulingRunnable implements Runnable {
|
|||||||
|
|
||||||
private String params;
|
private String params;
|
||||||
|
|
||||||
public SchedulingRunnable(String id, String beanName, String methodName, String params) {
|
private String jobType;
|
||||||
|
|
||||||
|
public SchedulingRunnable(String id, String beanName, String methodName, String params, String jobType) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.beanName = beanName;
|
this.beanName = beanName;
|
||||||
this.methodName = methodName;
|
this.methodName = methodName;
|
||||||
this.params = params;
|
this.params = params;
|
||||||
|
this.jobType = jobType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -47,6 +50,7 @@ public class SchedulingRunnable implements Runnable {
|
|||||||
}
|
}
|
||||||
batch = DateUtil.format(LocalDateTime.now(), DatePattern.PURE_DATETIME_PATTERN);
|
batch = DateUtil.format(LocalDateTime.now(), DatePattern.PURE_DATETIME_PATTERN);
|
||||||
map.put("batch", batch);
|
map.put("batch", batch);
|
||||||
|
map.put("jobType", jobType);
|
||||||
ReflectionUtils.makeAccessible(method);
|
ReflectionUtils.makeAccessible(method);
|
||||||
method.invoke(target, map);
|
method.invoke(target, map);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -65,6 +65,8 @@ public class QualityTask {
|
|||||||
tasks.add(task);
|
tasks.add(task);
|
||||||
});
|
});
|
||||||
List<Future<CheckReportEntity>> futures;
|
List<Future<CheckReportEntity>> futures;
|
||||||
|
long checkConsumeTime = 0L;
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
try {
|
try {
|
||||||
futures = threadPoolExecutor.invokeAll(tasks);
|
futures = threadPoolExecutor.invokeAll(tasks);
|
||||||
// 处理线程返回结果
|
// 处理线程返回结果
|
||||||
@ -76,13 +78,18 @@ public class QualityTask {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
checkConsumeTime = System.currentTimeMillis() - startTime;
|
||||||
// 关闭线程池
|
// 关闭线程池
|
||||||
threadPoolExecutor.shutdown();
|
threadPoolExecutor.shutdown();
|
||||||
// 核查报告
|
// 核查报告
|
||||||
|
long finalCheckConsumeTime = checkConsumeTime;
|
||||||
result.forEach(s -> {
|
result.forEach(s -> {
|
||||||
// 插入核查结果正常的数据
|
// 插入核查结果正常的数据
|
||||||
String status = StrUtil.isBlank(s.getCheckResult()) ? DataConstant.TrueOrFalse.TRUE.getKey() : DataConstant.TrueOrFalse.FALSE.getKey();
|
String status = StrUtil.isBlank(s.getCheckResult()) ? DataConstant.TrueOrFalse.TRUE.getKey() : DataConstant.TrueOrFalse.FALSE.getKey();
|
||||||
if (StrUtil.isBlank(s.getCheckResult())) {
|
if (StrUtil.isBlank(s.getCheckResult())) {
|
||||||
|
s.setCheckTimeConsuming((int) finalCheckConsumeTime);
|
||||||
|
s.setCheckResult(DataConstant.TrueOrFalse.TRUE.getKey());
|
||||||
|
s.setCheckReportType((String) map.get("jobType"));
|
||||||
s.setCheckBatch((String) map.get("batch"));
|
s.setCheckBatch((String) map.get("batch"));
|
||||||
checkReportService.save(s);
|
checkReportService.save(s);
|
||||||
// 更新最近核查批次号
|
// 更新最近核查批次号
|
||||||
|
@ -5,7 +5,6 @@ import cn.datax.common.core.RedisConstant;
|
|||||||
import cn.datax.common.database.constants.DbType;
|
import cn.datax.common.database.constants.DbType;
|
||||||
import cn.datax.common.redis.service.RedisService;
|
import cn.datax.common.redis.service.RedisService;
|
||||||
import cn.datax.service.data.metadata.api.entity.MetadataTableEntity;
|
import cn.datax.service.data.metadata.api.entity.MetadataTableEntity;
|
||||||
import cn.datax.service.data.metadata.dao.MetadataTableDao;
|
|
||||||
import cn.datax.service.data.quality.api.dto.*;
|
import cn.datax.service.data.quality.api.dto.*;
|
||||||
import cn.datax.service.data.quality.api.entity.CheckRuleEntity;
|
import cn.datax.service.data.quality.api.entity.CheckRuleEntity;
|
||||||
import cn.datax.service.data.quality.api.enums.RuleItem;
|
import cn.datax.service.data.quality.api.enums.RuleItem;
|
||||||
@ -46,8 +45,8 @@ public class CheckRuleServiceImpl extends BaseServiceImpl<CheckRuleDao, CheckRul
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
@Autowired
|
/*@Autowired
|
||||||
private MetadataTableDao metadataTableDao;
|
private MetadataTableDao metadataTableDao;*/
|
||||||
|
|
||||||
private static String BIND_GB_CODE = "gb_code";
|
private static String BIND_GB_CODE = "gb_code";
|
||||||
private static String BIND_GB_NAME = "gb_name";
|
private static String BIND_GB_NAME = "gb_name";
|
||||||
@ -65,10 +64,10 @@ public class CheckRuleServiceImpl extends BaseServiceImpl<CheckRuleDao, CheckRul
|
|||||||
QueryWrapper<MetadataTableEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<MetadataTableEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("source_id", checkRuleDto.getRuleSourceId());
|
queryWrapper.eq("source_id", checkRuleDto.getRuleSourceId());
|
||||||
queryWrapper.eq("table_name",currentString);
|
queryWrapper.eq("table_name",currentString);
|
||||||
MetadataTableEntity metadataTableEntity = metadataTableDao.selectOne(queryWrapper);
|
//MetadataTableEntity metadataTableEntity = metadataTableDao.selectOne(queryWrapper);
|
||||||
checkRule = checkRuleMapper.toEntity(checkRuleDto);
|
checkRule = checkRuleMapper.toEntity(checkRuleDto);
|
||||||
checkRule.setRuleTable(currentString);
|
checkRule.setRuleTable(currentString);
|
||||||
checkRule.setRuleTableId(metadataTableEntity.getId());
|
//checkRule.setRuleTableId(metadataTableEntity.getId());
|
||||||
checkRuleDao.insert(checkRule);
|
checkRuleDao.insert(checkRule);
|
||||||
}
|
}
|
||||||
return checkRule;
|
return checkRule;
|
||||||
|
@ -73,7 +73,7 @@ public class ScheduleJobServiceImpl extends BaseServiceImpl<ScheduleJobDao, Sche
|
|||||||
@Override
|
@Override
|
||||||
public void pauseScheduleJobById(String id) {
|
public void pauseScheduleJobById(String id) {
|
||||||
ScheduleJobEntity scheduleJobEntity = super.getById(id);
|
ScheduleJobEntity scheduleJobEntity = super.getById(id);
|
||||||
SchedulingRunnable task = new SchedulingRunnable(id, scheduleJobEntity.getBeanName(), scheduleJobEntity.getMethodName(), scheduleJobEntity.getMethodParams());
|
SchedulingRunnable task = new SchedulingRunnable(id, scheduleJobEntity.getBeanName(), scheduleJobEntity.getMethodName(), scheduleJobEntity.getMethodParams(), scheduleJobEntity.getJobType());
|
||||||
cronTaskRegistrar.removeCronTask(task);
|
cronTaskRegistrar.removeCronTask(task);
|
||||||
scheduleJobEntity.setStatus(DataConstant.TrueOrFalse.FALSE.getKey());
|
scheduleJobEntity.setStatus(DataConstant.TrueOrFalse.FALSE.getKey());
|
||||||
scheduleJobDao.updateById(scheduleJobEntity);
|
scheduleJobDao.updateById(scheduleJobEntity);
|
||||||
@ -82,7 +82,7 @@ public class ScheduleJobServiceImpl extends BaseServiceImpl<ScheduleJobDao, Sche
|
|||||||
@Override
|
@Override
|
||||||
public void resumeScheduleJobById(String id) {
|
public void resumeScheduleJobById(String id) {
|
||||||
ScheduleJobEntity scheduleJobEntity = super.getById(id);
|
ScheduleJobEntity scheduleJobEntity = super.getById(id);
|
||||||
SchedulingRunnable task = new SchedulingRunnable(id, scheduleJobEntity.getBeanName(), scheduleJobEntity.getMethodName(), scheduleJobEntity.getMethodParams());
|
SchedulingRunnable task = new SchedulingRunnable(id, scheduleJobEntity.getBeanName(), scheduleJobEntity.getMethodName(), scheduleJobEntity.getMethodParams(), scheduleJobEntity.getJobType());
|
||||||
cronTaskRegistrar.addCronTask(task, scheduleJobEntity.getCronExpression());
|
cronTaskRegistrar.addCronTask(task, scheduleJobEntity.getCronExpression());
|
||||||
scheduleJobEntity.setStatus(DataConstant.TrueOrFalse.TRUE.getKey());
|
scheduleJobEntity.setStatus(DataConstant.TrueOrFalse.TRUE.getKey());
|
||||||
scheduleJobDao.updateById(scheduleJobEntity);
|
scheduleJobDao.updateById(scheduleJobEntity);
|
||||||
@ -92,7 +92,7 @@ public class ScheduleJobServiceImpl extends BaseServiceImpl<ScheduleJobDao, Sche
|
|||||||
@Async("taskExecutor")
|
@Async("taskExecutor")
|
||||||
public void runScheduleJobById(String id) {
|
public void runScheduleJobById(String id) {
|
||||||
ScheduleJobEntity scheduleJobEntity = super.getById(id);
|
ScheduleJobEntity scheduleJobEntity = super.getById(id);
|
||||||
SchedulingRunnable task = new SchedulingRunnable(id, scheduleJobEntity.getBeanName(), scheduleJobEntity.getMethodName(), scheduleJobEntity.getMethodParams());
|
SchedulingRunnable task = new SchedulingRunnable(id, scheduleJobEntity.getBeanName(), scheduleJobEntity.getMethodName(), scheduleJobEntity.getMethodParams(), scheduleJobEntity.getJobType());
|
||||||
task.run();
|
task.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<result column="check_total_count" property="checkTotalCount" />
|
<result column="check_total_count" property="checkTotalCount" />
|
||||||
<result column="check_error_count" property="checkErrorCount" />
|
<result column="check_error_count" property="checkErrorCount" />
|
||||||
<result column="check_batch" property="checkBatch" />
|
<result column="check_batch" property="checkBatch" />
|
||||||
|
<result column="check_report_type" property="checkReportType" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="ExtendResultMap" type="cn.datax.service.data.quality.api.entity.CheckReportEntity" extends="BaseResultMap">
|
<resultMap id="ExtendResultMap" type="cn.datax.service.data.quality.api.entity.CheckReportEntity" extends="BaseResultMap">
|
||||||
@ -24,12 +25,12 @@
|
|||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id,
|
id,
|
||||||
check_rule_id, check_date, check_result, check_total_count, check_error_count, check_batch
|
check_rule_id, check_date, check_result, check_total_count, check_error_count, check_batch, check_report_type, check_time_consuming
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="Report_Column_List">
|
<sql id="Report_Column_List">
|
||||||
${alias}.id,
|
${alias}.id,
|
||||||
${alias}.check_rule_id, ${alias}.check_date, ${alias}.check_result, ${alias}.check_total_count, ${alias}.check_error_count, ${alias}.check_batch
|
${alias}.check_rule_id, ${alias}.check_date, ${alias}.check_result, ${alias}.check_total_count, ${alias}.check_error_count, ${alias}.check_batch, ${alias}.check_report_type, ${alias}.check_time_consuming
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectPage" resultMap="ExtendResultMap">
|
<select id="selectPage" resultMap="ExtendResultMap">
|
||||||
@ -51,6 +52,8 @@
|
|||||||
<result column="rule_level_id" property="ruleLevelId" />
|
<result column="rule_level_id" property="ruleLevelId" />
|
||||||
<result column="rule_level_name" property="ruleLevelName" />
|
<result column="rule_level_name" property="ruleLevelName" />
|
||||||
<result column="check_error_count" property="checkErrorCount" />
|
<result column="check_error_count" property="checkErrorCount" />
|
||||||
|
<result column="check_report_type" property="checkReportType" />
|
||||||
|
<result column="check_time_consuming" property="checkTimeConsuming" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="ExtendReportResultMap" type="cn.datax.service.data.quality.api.entity.DataReportEntity" extends="ReportResultMap">
|
<resultMap id="ExtendReportResultMap" type="cn.datax.service.data.quality.api.entity.DataReportEntity" extends="ReportResultMap">
|
||||||
@ -60,6 +63,8 @@
|
|||||||
<result column="rule_column_name" property="ruleColumnName" />
|
<result column="rule_column_name" property="ruleColumnName" />
|
||||||
<result column="rule_column_comment" property="ruleColumnComment" />
|
<result column="rule_column_comment" property="ruleColumnComment" />
|
||||||
<result column="check_total_count" property="checkTotalCount" />
|
<result column="check_total_count" property="checkTotalCount" />
|
||||||
|
<result column="check_report_type" property="checkReportType" />
|
||||||
|
<result column="check_time_consuming" property="checkTimeConsuming" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="getReportBySource" resultMap="ReportResultMap">
|
<select id="getReportBySource" resultMap="ReportResultMap">
|
||||||
|
@ -63,7 +63,7 @@ public class AuthorizationController {
|
|||||||
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
||||||
// 密码解密
|
// 密码解密
|
||||||
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
|
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
|
||||||
// 查询验证码
|
/* // 查询验证码
|
||||||
String code = (String) redisUtils.get(authUser.getUuid());
|
String code = (String) redisUtils.get(authUser.getUuid());
|
||||||
// 清除验证码
|
// 清除验证码
|
||||||
redisUtils.del(authUser.getUuid());
|
redisUtils.del(authUser.getUuid());
|
||||||
@ -72,7 +72,7 @@ public class AuthorizationController {
|
|||||||
}
|
}
|
||||||
if (StringUtils.isBlank(authUser.getCode()) || !authUser.getCode().equalsIgnoreCase(code)) {
|
if (StringUtils.isBlank(authUser.getCode()) || !authUser.getCode().equalsIgnoreCase(code)) {
|
||||||
throw new BadRequestException("验证码错误");
|
throw new BadRequestException("验证码错误");
|
||||||
}
|
}*/
|
||||||
UsernamePasswordAuthenticationToken authenticationToken =
|
UsernamePasswordAuthenticationToken authenticationToken =
|
||||||
new UsernamePasswordAuthenticationToken(authUser.getUsername(), password);
|
new UsernamePasswordAuthenticationToken(authUser.getUsername(), password);
|
||||||
Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
|
Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user