Compare commits
No commits in common. "1c958dc5df833a9426d3c4471dcd971c43bd566f" and "1871c2915d6b82b793579ccfec007b142216e958" have entirely different histories.
1c958dc5df
...
1871c2915d
|
|
@ -4,8 +4,6 @@
|
||||||
package com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.service.impl;
|
package com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.core.util.ZipUtil;
|
import cn.hutool.core.util.ZipUtil;
|
||||||
import cn.hutool.crypto.SecureUtil;
|
import cn.hutool.crypto.SecureUtil;
|
||||||
import cn.hutool.crypto.symmetric.AES;
|
import cn.hutool.crypto.symmetric.AES;
|
||||||
|
|
@ -27,11 +25,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import electromagnetic.data.framework.share.constants.ElectromagneticConstants;
|
|
||||||
import electromagnetic.data.framework.share.exception.LoggerConstant;
|
import electromagnetic.data.framework.share.exception.LoggerConstant;
|
||||||
import electromagnetic.data.framework.share.id.IdWorker;
|
import electromagnetic.data.framework.share.id.IdWorker;
|
||||||
import electromagnetic.data.framework.share.model.ElectromagneticResultUtil;
|
import electromagnetic.data.framework.share.model.ElectromagneticResultUtil;
|
||||||
import electromagnetic.data.framework.share.util.EleCommonUtil;
|
|
||||||
import electromagnetic.data.framework.share.util.EleZipUtil;
|
import electromagnetic.data.framework.share.util.EleZipUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
@ -49,7 +45,6 @@ import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author
|
* @author
|
||||||
|
|
@ -138,8 +133,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
categoryParent = categoryParentList.get(0);
|
categoryParent = categoryParentList.get(0);
|
||||||
filePathOfFolder = categoryParent.getCategoryId() + FOLDER_NAME_SEPARATOR + categoryParent.getCategoryName();
|
filePathOfFolder = categoryParent.getCategoryId() + FOLDER_NAME_SEPARATOR + categoryParent.getCategoryName();
|
||||||
if(edDataInfoParent != null){
|
if(edDataInfoParent != null){
|
||||||
String fileType = StrUtil.isEmpty(edDataInfoParent.getFileType()) ? "" : "." + edDataInfoParent.getFileType();
|
filePathOfFolder = filePathOfFolder + File.separator + edDataInfoParent.getDataName();
|
||||||
filePathOfFolder = filePathOfFolder + File.separator + edDataInfoParent.getDataName() + fileType;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,13 +148,9 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
public Boolean createDataInfo(EDDataInfo edDataInfo) throws Exception
|
public Boolean createDataInfo(EDDataInfo edDataInfo) throws Exception
|
||||||
{
|
{
|
||||||
// 获取上级目录的名称
|
// 获取上级目录的名称
|
||||||
String fileName = edDataInfo.getDataName();
|
|
||||||
Assert.isTrue(EleCommonUtil.isFileNameValid(fileName), "文件名不符合规范,只能包含中文字符、下划线、连字符、加号、数字和英文字符且长度小于32。");
|
|
||||||
|
|
||||||
Category categoryParent = new Category();
|
Category categoryParent = new Category();
|
||||||
categoryParent.setCategoryId(edDataInfo.getCategoryId());
|
categoryParent.setCategoryId(edDataInfo.getCategoryId());
|
||||||
List<Category> categoryParentList = categoryRepository.selectCategories(categoryParent);
|
List<Category> categoryParentList = categoryRepository.selectCategories(categoryParent);
|
||||||
|
|
||||||
if(categoryParentList.size() < 1) {
|
if(categoryParentList.size() < 1) {
|
||||||
throw new Exception("上级文件夹不存在");
|
throw new Exception("上级文件夹不存在");
|
||||||
}
|
}
|
||||||
|
|
@ -243,14 +233,13 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
|
|
||||||
EDDataInfo edDataInfo = edDataInfoList.get(0);
|
EDDataInfo edDataInfo = edDataInfoList.get(0);
|
||||||
String filePathOfFolder = getFilePathOfFolder(edDataInfo.getCategoryId());
|
String filePathOfFolder = getFilePathOfFolder(edDataInfo.getCategoryId());
|
||||||
String fileType = StrUtil.isEmpty(edDataInfo.getFileType()) ? "" : "." + edDataInfo.getFileType();
|
String fileStorageFullPath = dataStoragePath + filePathOfFolder + File.separator + edDataInfo.getDataName();
|
||||||
String fileStorageFullPath = dataStoragePath + filePathOfFolder + File.separator + edDataInfo.getDataName() + fileType;
|
|
||||||
|
|
||||||
if (!FileUtil.exist(fileStorageFullPath)){
|
if (!FileUtil.exist(fileStorageFullPath)){
|
||||||
throw new Exception("文件不存在");
|
throw new Exception("文件不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
String fileNameNew = parames.getName() + fileType;
|
String fileNameNew = parames.getName();
|
||||||
if(fileNameNew != null && fileNameNew != "" && !fileNameNew.equals(edDataInfo.getDataName())) {
|
if(fileNameNew != null && fileNameNew != "" && !fileNameNew.equals(edDataInfo.getDataName())) {
|
||||||
FileUtil.rename(Paths.get(fileStorageFullPath) ,fileNameNew,true);
|
FileUtil.rename(Paths.get(fileStorageFullPath) ,fileNameNew,true);
|
||||||
}
|
}
|
||||||
|
|
@ -285,7 +274,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
parames.setParentId(edDataInfo.getDataId());
|
parames.setParentId(edDataInfo.getDataId());
|
||||||
childFileCount += getChildFileCount(parames);
|
childFileCount += getChildFileCount(parames);
|
||||||
}
|
}
|
||||||
else if(edDataInfo.getDataType().equals(dataTypeFile) && edDataInfo.getEffectFlag().equals(1))
|
else if(edDataInfo.getDataType().equals(dataTypeFile))
|
||||||
{
|
{
|
||||||
++childFileCount;
|
++childFileCount;
|
||||||
}
|
}
|
||||||
|
|
@ -299,7 +288,8 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
* @param parames
|
* @param parames
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean uploadFile(EDDataParams parames) throws Exception {
|
public Boolean uploadFile(EDDataParams parames) throws Exception
|
||||||
|
{
|
||||||
|
|
||||||
// 获取目录编码ID
|
// 获取目录编码ID
|
||||||
String categoryId = parames.getParentId();
|
String categoryId = parames.getParentId();
|
||||||
|
|
@ -315,10 +305,14 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
// 获取文件名
|
// 获取文件名
|
||||||
String fileFullName = fileInput.getOriginalFilename();
|
String fileFullName = fileInput.getOriginalFilename();
|
||||||
// 获取文件类型
|
// 获取文件类型
|
||||||
String fileType = EleCommonUtil.getFileType(fileFullName);
|
String fileType = "";
|
||||||
// 获取文件名称
|
// 获取文件名称
|
||||||
String fileName = EleCommonUtil.getFileName(fileFullName);
|
String fileName = "";
|
||||||
Assert.isTrue(EleCommonUtil.isFileNameValid(fileName), "文件名不符合规范,只能包含中文字符、下划线、连字符、加号、数字和英文字符且长度小于32。");
|
if (fileFullName.lastIndexOf(".") != -1 && fileFullName.lastIndexOf(".") != 0) {
|
||||||
|
fileType = fileFullName.substring(fileFullName.lastIndexOf(".") + 1);
|
||||||
|
fileName = fileFullName.substring(fileFullName.lastIndexOf("."));
|
||||||
|
}
|
||||||
|
|
||||||
// 判断文件名称是否存在
|
// 判断文件名称是否存在
|
||||||
EDDataParams folderParames = new EDDataParams();
|
EDDataParams folderParames = new EDDataParams();
|
||||||
folderParames.setParentId(categoryId);
|
folderParames.setParentId(categoryId);
|
||||||
|
|
@ -348,7 +342,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
edDataInfo.setModifier(parames.getUserId());
|
edDataInfo.setModifier(parames.getUserId());
|
||||||
edDataInfo.setModifierName(parames.getUserName());
|
edDataInfo.setModifierName(parames.getUserName());
|
||||||
edDataInfo.setCategoryId(parames.getParentId());
|
edDataInfo.setCategoryId(parames.getParentId());
|
||||||
edDataInfo.setDataName(fileName);
|
edDataInfo.setDataName(fileFullName);
|
||||||
edDataInfo.setNote(parames.getNote());
|
edDataInfo.setNote(parames.getNote());
|
||||||
edDataInfo.setFileType(fileType);
|
edDataInfo.setFileType(fileType);
|
||||||
edDataInfo.setGmtBatchUpload(parames.getGmtBatchUpload());
|
edDataInfo.setGmtBatchUpload(parames.getGmtBatchUpload());
|
||||||
|
|
@ -567,7 +561,7 @@ public class EDDataServiceImpl implements EDDataService {
|
||||||
String dateString = sdf.format(date);
|
String dateString = sdf.format(date);
|
||||||
|
|
||||||
zipPathFileName = dataCachePath + "/exportData_" + dateString;
|
zipPathFileName = dataCachePath + "/exportData_" + dateString;
|
||||||
enCodeZipPathFileName = dataCachePath + "/exportData_" + dateString + ElectromagneticConstants.EXPORT_FILE_SUFFIX;
|
enCodeZipPathFileName = dataCachePath + "/exportData_" + dateString + ".comac";
|
||||||
|
|
||||||
ZipUtil.zip(exportDataCachePath, zipPathFileName);
|
ZipUtil.zip(exportDataCachePath, zipPathFileName);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import com.electromagnetic.industry.software.data.manage.domain.boardservice.use
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.UserDeleteKeyWords;
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.UserDeleteKeyWords;
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.repository.UserRepository;
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.repository.UserRepository;
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service.UserService;
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service.UserService;
|
||||||
import electromagnetic.data.framework.share.constants.UserConstants;
|
|
||||||
import electromagnetic.data.framework.share.exception.LoggerConstant;
|
import electromagnetic.data.framework.share.exception.LoggerConstant;
|
||||||
import electromagnetic.data.framework.share.util.SignUtils;
|
import electromagnetic.data.framework.share.util.SignUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
@ -113,11 +112,6 @@ public class UserServiceImpl implements UserService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteUser(UserDeleteKeyWords userDeleteKeyWords) {
|
public Boolean deleteUser(UserDeleteKeyWords userDeleteKeyWords) {
|
||||||
|
|
||||||
String workNumber = userRepository.getSingleUser(userDeleteKeyWords.getUserId()).getWorkNumber();
|
|
||||||
if (UserConstants.ADMIN_WORK_NUMBER.equals(workNumber)) {
|
|
||||||
throw new RuntimeException("管理员用户无法删除");
|
|
||||||
}
|
|
||||||
return userRepository.deleteUser(userDeleteKeyWords)>0;
|
return userRepository.deleteUser(userDeleteKeyWords)>0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,4 @@ public final class ElectromagneticConstants {
|
||||||
public static final String TAG_SEGMENT="TagSegment";
|
public static final String TAG_SEGMENT="TagSegment";
|
||||||
|
|
||||||
public static final String TYPE_SEGMENT="TypeSegment";
|
public static final String TYPE_SEGMENT="TypeSegment";
|
||||||
|
|
||||||
public static final String EXPORT_FILE_SUFFIX = ".colib";
|
|
||||||
}
|
}
|
||||||
|
|
@ -28,9 +28,4 @@ public class UserConstants {
|
||||||
public static final String LOGIN_USER_NAME = "userName";
|
public static final String LOGIN_USER_NAME = "userName";
|
||||||
public static final String LOGIN_WORK_NUMBER = "workNumber";
|
public static final String LOGIN_WORK_NUMBER = "workNumber";
|
||||||
public static final String LOGIN_USER_ID = "userId";
|
public static final String LOGIN_USER_ID = "userId";
|
||||||
|
|
||||||
/**
|
|
||||||
* 管理员账号
|
|
||||||
*/
|
|
||||||
public static final String ADMIN_WORK_NUMBER = "100000";
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
package electromagnetic.data.framework.share.util;
|
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public final class EleCommonUtil {
|
|
||||||
|
|
||||||
// 正则表达式模式,匹配中文字符、下划线、连字符、加号、数字和英文字符
|
|
||||||
private static final String PATTERN = "^[\\u4e00-\\u9fa5a-zA-Z0-9._\\-+]+$";
|
|
||||||
|
|
||||||
// 编译正则表达式
|
|
||||||
private static final Pattern pattern = Pattern.compile(PATTERN);
|
|
||||||
|
|
||||||
public static String getFileName(String fileFullName) {
|
|
||||||
if (fileFullName == null) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
if (!fileFullName.contains(".")) {
|
|
||||||
return fileFullName;
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = fileFullName.lastIndexOf(".");
|
|
||||||
return fileFullName.substring(0, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getFileType(String fileFullName) {
|
|
||||||
if (fileFullName == null || !fileFullName.contains(".")) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
int index = fileFullName.lastIndexOf(".");
|
|
||||||
return fileFullName.substring(index + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isFileNameValid(String fileFullName) {
|
|
||||||
if (fileFullName.length() > 32) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pattern.matcher(fileFullName).matches();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.electromagnetic.industry.software.data.manage.request.user;
|
package com.electromagnetic.industry.software.data.manage.request.user;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import cn.hutool.core.date.DateTime;
|
||||||
import electromagnetic.data.framework.share.model.BaseRequest;
|
import electromagnetic.data.framework.share.model.BaseRequest;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
@ -46,8 +46,7 @@ public class UserModiRequest extends BaseRequest implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 入职日期
|
* 入职日期
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
private DateTime joinTime;
|
||||||
private Date joinTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作状态
|
* 工作状态
|
||||||
|
|
@ -57,6 +56,5 @@ public class UserModiRequest extends BaseRequest implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 实习截止日期
|
* 实习截止日期
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private Date internshipEndDate;
|
private Date internshipEndDate;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.electromagnetic.industry.software.data.manage.request.user;
|
package com.electromagnetic.industry.software.data.manage.request.user;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import electromagnetic.data.framework.share.model.BaseRequest;
|
import electromagnetic.data.framework.share.model.BaseRequest;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
@ -42,8 +41,7 @@ public class UserRequest extends BaseRequest implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 入职日期
|
* 入职日期
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern="yyyy-MM-dd")
|
private DateTime joinTime;
|
||||||
private Date joinTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作状态
|
* 工作状态
|
||||||
|
|
@ -53,7 +51,6 @@ public class UserRequest extends BaseRequest implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 实习截止日期
|
* 实习截止日期
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern="yyyy-MM-dd")
|
|
||||||
private Date internshipEndDate;
|
private Date internshipEndDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.electromagnetic.industry.software.data.manage.response.user;
|
package com.electromagnetic.industry.software.data.manage.response.user;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
@ -53,7 +52,6 @@ public class SingleUserResponse {
|
||||||
/**
|
/**
|
||||||
* 入职日期
|
* 入职日期
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private Date joinTime;
|
private Date joinTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -64,7 +62,6 @@ public class SingleUserResponse {
|
||||||
/**
|
/**
|
||||||
* 实习截止日期
|
* 实习截止日期
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private Date internshipEndDate;
|
private Date internshipEndDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||||
SELECT LAST_INSERT_ID()
|
SELECT LAST_INSERT_ID()
|
||||||
</selectKey>
|
</selectKey>
|
||||||
replace into ed_data_info (id,
|
insert into ed_data_info (id,
|
||||||
category_type_id, parent_id, category_id,
|
category_type_id, parent_id, category_id,
|
||||||
category_name, category_status,
|
category_name, category_status,
|
||||||
creator, creator_name, gmt_create,
|
creator, creator_name, gmt_create,
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||||
SELECT LAST_INSERT_ID()
|
SELECT LAST_INSERT_ID()
|
||||||
</selectKey>
|
</selectKey>
|
||||||
replace into ed_data_info (category_id,
|
insert into ed_data_info (category_id,
|
||||||
data_id, data_no, data_name,
|
data_id, data_no, data_name,
|
||||||
data_type, file_type, version,
|
data_type, file_type, version,
|
||||||
content, implant_json, data_status,
|
content, implant_json, data_status,
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
<if test="userTitle != null and userTitle != ''">user_title = #{userTitle},</if>
|
<if test="userTitle != null and userTitle != ''">user_title = #{userTitle},</if>
|
||||||
<if test="joinTime != null">join_time = #{joinTime},</if>
|
<if test="joinTime != null">join_time = #{joinTime},</if>
|
||||||
<if test="userStatus != null and userStatus != ''">user_status = #{userStatus},</if>
|
<if test="userStatus != null and userStatus != ''">user_status = #{userStatus},</if>
|
||||||
internship_end_date = #{internshipEndDate},
|
<if test="internshipEndDate != null">internship_end_date = #{internshipEndDate},</if>
|
||||||
<if test="modifier != null and modifier != ''">modifier = #{modifier},</if>
|
<if test="modifier != null and modifier != ''">modifier = #{modifier},</if>
|
||||||
<if test="modifierName != null and modifierName != ''">modifier_name = #{modifierName},</if>
|
<if test="modifierName != null and modifierName != ''">modifier_name = #{modifierName},</if>
|
||||||
gmt_modified=now()
|
gmt_modified=now()
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import cn.hutool.core.codec.Base64;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.core.util.ZipUtil;
|
import cn.hutool.core.util.ZipUtil;
|
||||||
import cn.hutool.crypto.SecureUtil;
|
import cn.hutool.crypto.SecureUtil;
|
||||||
import cn.hutool.crypto.symmetric.AES;
|
import cn.hutool.crypto.symmetric.AES;
|
||||||
|
|
@ -18,7 +17,6 @@ import com.electromagnetic.industry.software.data.manage.request.indicator.FileC
|
||||||
import com.electromagnetic.industry.software.data.manage.request.indicator.FileChunkResultDTO;
|
import com.electromagnetic.industry.software.data.manage.request.indicator.FileChunkResultDTO;
|
||||||
import com.electromagnetic.industry.software.data.manage.response.indicator.EDDataPageResponse;
|
import com.electromagnetic.industry.software.data.manage.response.indicator.EDDataPageResponse;
|
||||||
import com.electromagnetic.industry.software.data.manage.service.mappers.EDDataMappers;
|
import com.electromagnetic.industry.software.data.manage.service.mappers.EDDataMappers;
|
||||||
import electromagnetic.data.framework.share.constants.ElectromagneticConstants;
|
|
||||||
import electromagnetic.data.framework.share.id.IdWorker;
|
import electromagnetic.data.framework.share.id.IdWorker;
|
||||||
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
||||||
import electromagnetic.data.framework.share.model.ElectromagneticResultUtil;
|
import electromagnetic.data.framework.share.model.ElectromagneticResultUtil;
|
||||||
|
|
@ -195,8 +193,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
||||||
EDDataInfo edDataInfo = edDataService.getDataInfo(parames);
|
EDDataInfo edDataInfo = edDataService.getDataInfo(parames);
|
||||||
Assert.isTrue(edDataInfo != null, "没有找到该下载文件");
|
Assert.isTrue(edDataInfo != null, "没有找到该下载文件");
|
||||||
String filePathOfFolder = edDataService.getFilePathOfFolder(edDataInfo.getCategoryId());
|
String filePathOfFolder = edDataService.getFilePathOfFolder(edDataInfo.getCategoryId());
|
||||||
String fileType = StrUtil.isEmpty(edDataInfo.getFileType()) ? "" : "." + edDataInfo.getFileType();
|
String filePath = storageFilePath + "/" + filePathOfFolder + "/" + edDataInfo.getDataName();
|
||||||
String filePath = storageFilePath + "/" + filePathOfFolder + "/" + edDataInfo.getDataName() + fileType;
|
|
||||||
|
|
||||||
Assert.isTrue(FileUtil.exist(filePath), "下载文件不存在。");
|
Assert.isTrue(FileUtil.exist(filePath), "下载文件不存在。");
|
||||||
FileSystemResource fileSystemResource = new FileSystemResource(filePath);
|
FileSystemResource fileSystemResource = new FileSystemResource(filePath);
|
||||||
|
|
@ -231,7 +228,7 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
||||||
|
|
||||||
Map<String, String> result = new HashMap<>();
|
Map<String, String> result = new HashMap<>();
|
||||||
List<String> dataIdList = Arrays.asList(dataIdArr.split(","));
|
List<String> dataIdList = Arrays.asList(dataIdArr.split(","));
|
||||||
if(!dataIdList.isEmpty()) {
|
if(dataIdList.size() > 0) {
|
||||||
String filePath = edDataService.exportData(dataIdList);
|
String filePath = edDataService.exportData(dataIdList);
|
||||||
|
|
||||||
Assert.isTrue(FileUtil.exist(filePath), "下载文件不存在。");
|
Assert.isTrue(FileUtil.exist(filePath), "下载文件不存在。");
|
||||||
|
|
@ -316,12 +313,13 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return FileUtil.listFileNames(destPath)
|
List<Integer> uploadedFileChunkNums = FileUtil.listFileNames(destPath)
|
||||||
.stream()
|
.stream()
|
||||||
.filter(e -> !e.endsWith(ElectromagneticConstants.EXPORT_FILE_SUFFIX))
|
.filter(e -> !e.endsWith(".comac"))
|
||||||
.map(e -> e.replace(UPLOAD_FILE_CHUNK_SUFFIX, ""))
|
.map(e -> e.replace(UPLOAD_FILE_CHUNK_SUFFIX, ""))
|
||||||
.map(Integer::parseInt)
|
.map(Integer::parseInt)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
return uploadedFileChunkNums;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 需要验证如果一个分片上传一半网络断开,则该分片的存储情况。
|
// TODO 需要验证如果一个分片上传一半网络断开,则该分片的存储情况。
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.electromagnetic.industry.software.data.manage.service.mappers;
|
package com.electromagnetic.industry.software.data.manage.service.mappers;
|
||||||
|
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||||
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.UserLoginInfo;
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.PublishParam;
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.PublishParam;
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.SearchKeyWords;
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.SearchKeyWords;
|
||||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.UserDeleteKeyWords;
|
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.UserDeleteKeyWords;
|
||||||
|
|
@ -12,14 +13,13 @@ import com.electromagnetic.industry.software.data.manage.request.user.UserPublis
|
||||||
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
||||||
import com.electromagnetic.industry.software.data.manage.request.user.UserWorkNumRequest;
|
import com.electromagnetic.industry.software.data.manage.request.user.UserWorkNumRequest;
|
||||||
import com.electromagnetic.industry.software.data.manage.response.user.SingleUserResponse;
|
import com.electromagnetic.industry.software.data.manage.response.user.SingleUserResponse;
|
||||||
import electromagnetic.data.framework.share.model.UserLoginInfo;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.Generated;
|
import javax.annotation.Generated;
|
||||||
|
|
||||||
@Generated(
|
@Generated(
|
||||||
value = "org.mapstruct.ap.MappingProcessor",
|
value = "org.mapstruct.ap.MappingProcessor",
|
||||||
date = "2024-12-05T15:02:06+0800",
|
date = "2024-11-21T15:49:09+0800",
|
||||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_281 (Oracle Corporation)"
|
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_281 (Oracle Corporation)"
|
||||||
)
|
)
|
||||||
public class UserMappersImpl implements UserMappers {
|
public class UserMappersImpl implements UserMappers {
|
||||||
|
|
@ -41,6 +41,10 @@ public class UserMappersImpl implements UserMappers {
|
||||||
user.setJoinTime( userRequest.getJoinTime() );
|
user.setJoinTime( userRequest.getJoinTime() );
|
||||||
user.setUserStatus( userRequest.getUserStatus() );
|
user.setUserStatus( userRequest.getUserStatus() );
|
||||||
user.setInternshipEndDate( userRequest.getInternshipEndDate() );
|
user.setInternshipEndDate( userRequest.getInternshipEndDate() );
|
||||||
|
user.setCreator( userRequest.getCreator() );
|
||||||
|
user.setCreatorName( userRequest.getCreatorName() );
|
||||||
|
user.setModifier( userRequest.getModifier() );
|
||||||
|
user.setModifierName( userRequest.getModifierName() );
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
@ -54,7 +58,6 @@ public class UserMappersImpl implements UserMappers {
|
||||||
UserLoginInfo userLoginInfo = new UserLoginInfo();
|
UserLoginInfo userLoginInfo = new UserLoginInfo();
|
||||||
|
|
||||||
userLoginInfo.setWorkNumber( loginRequest.getWorkNumber() );
|
userLoginInfo.setWorkNumber( loginRequest.getWorkNumber() );
|
||||||
userLoginInfo.setUserId( loginRequest.getUserId() );
|
|
||||||
userLoginInfo.setUserPwd( loginRequest.getUserPwd() );
|
userLoginInfo.setUserPwd( loginRequest.getUserPwd() );
|
||||||
|
|
||||||
return userLoginInfo;
|
return userLoginInfo;
|
||||||
|
|
@ -104,6 +107,8 @@ public class UserMappersImpl implements UserMappers {
|
||||||
if ( list != null ) {
|
if ( list != null ) {
|
||||||
publishParam.setUserIds( new ArrayList<String>( list ) );
|
publishParam.setUserIds( new ArrayList<String>( list ) );
|
||||||
}
|
}
|
||||||
|
publishParam.setModifier( userPublishRequest.getModifier() );
|
||||||
|
publishParam.setModifierName( userPublishRequest.getModifierName() );
|
||||||
|
|
||||||
return publishParam;
|
return publishParam;
|
||||||
}
|
}
|
||||||
|
|
@ -159,6 +164,8 @@ public class UserMappersImpl implements UserMappers {
|
||||||
user.setJoinTime( userModiRequest.getJoinTime() );
|
user.setJoinTime( userModiRequest.getJoinTime() );
|
||||||
user.setUserStatus( userModiRequest.getUserStatus() );
|
user.setUserStatus( userModiRequest.getUserStatus() );
|
||||||
user.setInternshipEndDate( userModiRequest.getInternshipEndDate() );
|
user.setInternshipEndDate( userModiRequest.getInternshipEndDate() );
|
||||||
|
user.setModifier( userModiRequest.getModifier() );
|
||||||
|
user.setModifierName( userModiRequest.getModifierName() );
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
@ -187,6 +194,8 @@ public class UserMappersImpl implements UserMappers {
|
||||||
UserDeleteKeyWords userDeleteKeyWords = new UserDeleteKeyWords();
|
UserDeleteKeyWords userDeleteKeyWords = new UserDeleteKeyWords();
|
||||||
|
|
||||||
userDeleteKeyWords.setUserId( userDeleteRequest.getUserId() );
|
userDeleteKeyWords.setUserId( userDeleteRequest.getUserId() );
|
||||||
|
userDeleteKeyWords.setModifier( userDeleteRequest.getModifier() );
|
||||||
|
userDeleteKeyWords.setModifierName( userDeleteRequest.getModifierName() );
|
||||||
|
|
||||||
return userDeleteKeyWords;
|
return userDeleteKeyWords;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue