feat: ossFile表和minio数据有效性检测接口
This commit is contained in:
+9
-9
@@ -113,8 +113,8 @@ public class LoginServiceImpl implements ILoginService {
|
|||||||
//redisUtil.del(realKey);
|
//redisUtil.del(realKey);
|
||||||
try {
|
try {
|
||||||
//解密获取密码和用户名
|
//解密获取密码和用户名
|
||||||
// password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
|
password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
|
||||||
username = "admin";
|
username = CommonUtils.decryptBtRsaPriKey(username, rsaPrivateKey);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -141,13 +141,13 @@ public class LoginServiceImpl implements ILoginService {
|
|||||||
//2. 校验用户名或密码是否正确
|
//2. 校验用户名或密码是否正确
|
||||||
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||||
String syspassword = sysUser.getPassword();
|
String syspassword = sysUser.getPassword();
|
||||||
// if (!syspassword.equals(userpassword)) {
|
if (!syspassword.equals(userpassword)) {
|
||||||
// // 重试登录次数加一
|
// 重试登录次数加一
|
||||||
// retryCount++;
|
retryCount++;
|
||||||
// this.setRetryInfoToRedis(username, retryCount);
|
this.setRetryInfoToRedis(username, retryCount);
|
||||||
// String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
|
String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
|
||||||
// return Result.error(msg);
|
return Result.error(msg);
|
||||||
// }
|
}
|
||||||
//登录成功,清除错误登录次数
|
//登录成功,清除错误登录次数
|
||||||
redisUtil.del(RETRY_LOGIN_PREFIX + username);
|
redisUtil.del(RETRY_LOGIN_PREFIX + username);
|
||||||
if (checkSysPermission(username)) {
|
if (checkSysPermission(username)) {
|
||||||
|
|||||||
+8
@@ -192,4 +192,12 @@ public class OldSystemController {
|
|||||||
return Result.OK(oldSystemDeptRelationService.esAuthDeptDataFix());
|
return Result.OK(oldSystemDeptRelationService.esAuthDeptDataFix());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/dataFileFix")
|
||||||
|
@AutoLog(value = "老法规系统-上线后检测ossFile表中的数据和minio中的数据是否一致/找到minio中不存在的数据")
|
||||||
|
@ApiOperation(value="老法规系统-上线后检测ossFile表中的数据和minio中的数据是否一致/找到minio中不存在的数据", notes="老法规系统-上线后检测ossFile表中的数据和minio中的数据是否一致/找到minio中不存在的数据")
|
||||||
|
@ApiOperationSupport(order = 15)
|
||||||
|
public void dataFileFix(HttpServletResponse response) {
|
||||||
|
oldSystemService.dataFileFix(response);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -176,6 +176,10 @@ public class OldSystemImportDTO {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String errorInfo;
|
private String errorInfo;
|
||||||
|
|
||||||
|
@Excel(name = "OssFileID", width = 15, orderNum = "53")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String ossFileId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否是空行
|
* 判断是否是空行
|
||||||
* @return 如果所有字段都为null或空字符串,返回true,否则返回false
|
* @return 如果所有字段都为null或空字符串,返回true,否则返回false
|
||||||
|
|||||||
+6
@@ -113,4 +113,10 @@ public interface OldSystemService {
|
|||||||
* @param response
|
* @param response
|
||||||
*/
|
*/
|
||||||
void importOldSystemFileFixDocPath(MultipartFile file, String type, HttpServletResponse response);
|
void importOldSystemFileFixDocPath(MultipartFile file, String type, HttpServletResponse response);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上线后检测ossFile表中的数据和minio中的数据是否一致/找到minio中不存在的数据
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
void dataFileFix(HttpServletResponse response);
|
||||||
}
|
}
|
||||||
|
|||||||
+30
@@ -419,6 +419,36 @@ public class OldSystemServiceImpl implements OldSystemService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dataFileFix(HttpServletResponse response) {
|
||||||
|
List<OldSystemImportDTO> errImportList = new ArrayList<>();
|
||||||
|
|
||||||
|
List<OSSFile> ossFileList = ossFileService.list();
|
||||||
|
for (OSSFile ossFile : ossFileList) {
|
||||||
|
String url = ossFile.getUrl();
|
||||||
|
if (StrUtil.isBlank(url)) {
|
||||||
|
OldSystemImportDTO dto = new OldSystemImportDTO();
|
||||||
|
dto.setBzh(ossFile.getStandardNo());
|
||||||
|
log.error("文件路径为空");
|
||||||
|
dto.setErrorInfo("文件路径为空");
|
||||||
|
dto.setOssFileId(ossFile.getId());
|
||||||
|
errImportList.add(dto);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!MinioUtil.doesObjectExist(url)) {
|
||||||
|
OldSystemImportDTO dto = new OldSystemImportDTO();
|
||||||
|
dto.setBzh(ossFile.getStandardNo());
|
||||||
|
log.error("文件不存在,路径是:" + url);
|
||||||
|
dto.setErrorInfo("文件不存在,路径是:" + url);
|
||||||
|
dto.setOssFileId(ossFile.getId());
|
||||||
|
errImportList.add(dto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!errImportList.isEmpty()) {
|
||||||
|
this.exportWithExcel(response, errImportList, "OldSystemStandardErrorData.xls");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void oldSysFBDataFileDocPath(List<OldSystemImportDTO> allDatalist, List<OldSystemImportDTO> errImportList) {
|
private void oldSysFBDataFileDocPath(List<OldSystemImportDTO> allDatalist, List<OldSystemImportDTO> errImportList) {
|
||||||
List<OldSystemImportDTO> fbDatalist = allDatalist.stream().filter(o -> o.getBzfl().contains("ISO") ||
|
List<OldSystemImportDTO> fbDatalist = allDatalist.stream().filter(o -> o.getBzfl().contains("ISO") ||
|
||||||
o.getBzfl().contains("引进") ||
|
o.getBzfl().contains("引进") ||
|
||||||
|
|||||||
Reference in New Issue
Block a user