Compare commits
No commits in common. "c9394fcc604bf94dc2511df6c4db8a02aaff84b0" and "8f1968ca9fad133a38855f1a20b89af685ac9010" have entirely different histories.
c9394fcc60
...
8f1968ca9f
|
|
@ -149,8 +149,9 @@
|
|||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.1.13.RELEASE</version>
|
||||
<configuration>
|
||||
<jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7087</jvmArguments>
|
||||
<executable>true</executable>
|
||||
<!-- executable fat jar -->
|
||||
<outputDirectory>../target</outputDirectory>
|
||||
<!-- <classifier>executable</classifier>-->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
|
@ -160,14 +161,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
package com.electromagnetic.industry.software.data.manage.controller.user;
|
||||
|
||||
import com.electromagnetic.industry.software.data.manage.facade.user.UserFacade;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.*;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.GetSingleUserRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserModiRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserPublishRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserLoginRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
||||
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.*;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@RequestMapping("/data/ed/user")
|
||||
@RestController
|
||||
|
|
@ -61,10 +65,4 @@ public class UserController {
|
|||
public ElectromagneticResult<?> deleteUser(@RequestBody UserDeleteRequest userDeleteRequest) {
|
||||
return userFacade.deleteUser(userDeleteRequest);
|
||||
}
|
||||
|
||||
@ApiOperation(value="登出", notes = "")
|
||||
@RequestMapping(value = "/logout", method = RequestMethod.POST)
|
||||
public ElectromagneticResult<?> logout(@RequestHeader("Authorization") String token) {
|
||||
return userFacade.logout(token);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
#required
|
||||
spring.application.name=electromagnetic-data
|
||||
|
||||
spring.profiles.active=test
|
||||
# security
|
||||
run.mode=NORMAL
|
||||
com.alipay.env=shared
|
||||
#log
|
||||
logging.path=./logs
|
||||
loggerPath=electromagnetic-data
|
||||
logging.level.com.aliyun.fsi.insurance=${LOG_LEVEL:INFO}
|
||||
#日志配置
|
||||
logging.config=classpath:${LOG_CONFIG:log4j2-spring.xml}
|
||||
|
||||
|
||||
spring.datasource.typd=com.alibaba.druid.pool.DruidDataSource
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/em_data?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
spring.datasource.username=comac
|
||||
spring.datasource.password=2024*Comac
|
||||
|
||||
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||
mybatis.mapper-locations=classpath:sqlmapper/*.xml
|
||||
pagehelper.helperDialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
server.port=8888
|
||||
|
||||
|
|
@ -12,6 +12,9 @@ logging.config=classpath:${LOG_CONFIG:log4j2-spring.xml}
|
|||
|
||||
|
||||
spring.datasource.typd=com.alibaba.druid.pool.DruidDataSource
|
||||
#spring.datasource.url=jdbc:mysql://${DATASOURCE_URL:obproxy-0c63.ops.cloud.cic.inter}:3306/${DATASOURCE_HOST:dataplatform_ptst}?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
#spring.datasource.username=${DATASOURCE_NAME:dataplatform@ProjectTest_tenant5#testdb}
|
||||
#spring.datasource.password=${DATASOURCE_PASSWORD:Y7G6v4_3ijn77K_Kbl_U85}
|
||||
spring.datasource.url=jdbc:mysql://139.224.43.89:3306/em_data?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
spring.datasource.username=comac
|
||||
spring.datasource.password=2024*Comac
|
||||
|
|
@ -24,6 +27,7 @@ mybatis.mapper-locations=classpath:sqlmapper/*.xml
|
|||
pagehelper.helperDialect=mysql
|
||||
pagehelper.reasonable=false
|
||||
server.port=8888
|
||||
zip.password=~~BYE6cWGBJJjsU9DczYtZIQ==
|
||||
|
||||
#windows文件存储目录
|
||||
data.windows.path=E:/comacFileStorage/
|
||||
|
|
@ -37,4 +41,3 @@ data.upload.cache.dir=upload
|
|||
data.export.cache.dir=export
|
||||
#导入数据时文件的缓存文件夹名称
|
||||
data.import.cache.dir=import
|
||||
file.encode.passwd=adknfhkj87654knd
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ package com.electromagnetic.industry.software.data.manage.domain.boardservice.in
|
|||
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.EDDataInfo;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.EDDataParams;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,11 +54,15 @@ import java.util.*;
|
|||
@Slf4j
|
||||
public class EDDataServiceImpl implements EDDataService {
|
||||
|
||||
// private static final Logger LOGGER = LoggerFactory.getLogger(LoggerConstant.DOMAIN_SERVICE);
|
||||
|
||||
@Resource
|
||||
private EDDataRepository edDataRepository;
|
||||
@Resource
|
||||
private CategoryRepository categoryRepository;
|
||||
|
||||
@Value("${zip.password}")
|
||||
private String passwordZIP;
|
||||
@Value("${data.windows.path}")
|
||||
private String windowsDir;
|
||||
@Value("${data.file.cache.dir}")
|
||||
|
|
@ -69,8 +73,6 @@ public class EDDataServiceImpl implements EDDataService {
|
|||
private String uploadCacheDir;
|
||||
@Value("${data.export.cache.dir}")
|
||||
private String exportCacheDir;
|
||||
@Value("${file.encode.passwd}")
|
||||
private String encodePasswd;
|
||||
|
||||
// 文件夹名称分隔符
|
||||
private static final String FOLDER_NAME_SEPARATOR = "_";
|
||||
|
|
@ -535,6 +537,7 @@ public class EDDataServiceImpl implements EDDataService {
|
|||
|
||||
log.info("文件数据已成功复制到目标目录。");
|
||||
|
||||
|
||||
// 将目录树数据 和 文件夹及文件夹内数据 进行压缩打包
|
||||
Date date = new Date();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd-HHmmss");
|
||||
|
|
@ -542,10 +545,11 @@ public class EDDataServiceImpl implements EDDataService {
|
|||
|
||||
zipPathFileName = dataCachePath + "/exportData_" + dateString;
|
||||
enCodeZipPathFileName = dataCachePath + "/exportData_" + dateString + ".comac";
|
||||
// EleZipUtil.zipFile(exportDataDirectory, zipPathFileName, passwordZIP);
|
||||
|
||||
ZipUtil.zip(exportDataCachePath, zipPathFileName);
|
||||
|
||||
AES aes = SecureUtil.aes(encodePasswd.getBytes()); // aesKey是加密密钥
|
||||
String password = "adknfhkj87654knd";
|
||||
AES aes = SecureUtil.aes(password.getBytes()); // aesKey是加密密钥
|
||||
try (
|
||||
InputStream inputStream = new FileInputStream(zipPathFileName);
|
||||
OutputStream outputStream = new FileOutputStream(enCodeZipPathFileName);
|
||||
|
|
@ -561,6 +565,8 @@ public class EDDataServiceImpl implements EDDataService {
|
|||
log.error("导出数据异常..", e);
|
||||
}
|
||||
finally {
|
||||
//删除临时文件
|
||||
//FileUtil.del(zipPathFileName);
|
||||
// 删除 导出数据的 缓存目录
|
||||
FileUtil.del(exportDataCachePath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 发布状态枚举
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PublishEnum {
|
||||
/**
|
||||
* 已发布
|
||||
*/
|
||||
PUBLISHED(1,"已发布"),
|
||||
/**
|
||||
* 未发布
|
||||
*/
|
||||
UNPUBLISHED(0,"未发布"),
|
||||
;
|
||||
private Integer code;
|
||||
private String desc;
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PublishParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.electromagnetic.industry.software.data.manage.domain.boardservice.us
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class UserDeleteKeyWords {
|
||||
|
||||
|
|
|
|||
|
|
@ -17,11 +17,4 @@ public interface TokenRepository {
|
|||
* @return
|
||||
*/
|
||||
public Token selectToken(String token);
|
||||
|
||||
/**
|
||||
* 删除令牌
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
public int deleteToken(String token);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.repository;
|
||||
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||
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.model.User;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.UserDeleteKeyWords;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -24,9 +24,4 @@ public interface TokenService {
|
|||
* 查看token是否有效
|
||||
*/
|
||||
public Boolean isTokenValid(String tokenStr);
|
||||
|
||||
/**
|
||||
* 删除token
|
||||
*/
|
||||
public int deleteToken(String tokenStr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service;
|
||||
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||
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.model.User;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.UserDeleteKeyWords;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -69,15 +69,8 @@ public interface UserService {
|
|||
|
||||
/**
|
||||
* 根据userId逻辑删除用户
|
||||
* @param userDeleteKeyWords
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteUser(UserDeleteKeyWords userDeleteKeyWords);
|
||||
|
||||
/**
|
||||
* 检查用户是否有效,未发布的用户无效,实习到期的用户无效
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
Boolean checkUserValid(User user);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,12 +71,4 @@ public class TokenServiceImpl implements TokenService {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除token
|
||||
*/
|
||||
@Override
|
||||
public int deleteToken(String tokenStr){
|
||||
return tokenRepository.deleteToken(tokenStr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
package com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service.impl;
|
||||
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.enums.EffectFlagEnum;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.enums.PublishEnum;
|
||||
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.model.User;
|
||||
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.service.UserService;
|
||||
|
|
@ -13,10 +11,9 @@ import electromagnetic.data.framework.share.util.SignUtils;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import static cn.hutool.core.date.DateTime.now;
|
||||
import java.lang.String;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class UserServiceImpl implements UserService {
|
||||
|
|
@ -114,22 +111,4 @@ public class UserServiceImpl implements UserService {
|
|||
public Boolean deleteUser(UserDeleteKeyWords userDeleteKeyWords) {
|
||||
return userRepository.deleteUser(userDeleteKeyWords)>0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户是否有效,未发布,实习到期,已被逻辑删除的用户无效
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean checkUserValid(User user){
|
||||
if ( user == null
|
||||
|| user.getIsPublished() == PublishEnum.UNPUBLISHED.getCode()
|
||||
|| user.getEffectFlag() == EffectFlagEnum.EFFECT_FLAG_0.getCode()
|
||||
) {
|
||||
return false;
|
||||
} else if( user.getInternshipEndDate()!=null && user.getInternshipEndDate().before(now())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,15 +8,14 @@ package electromagnetic.data.framework.share.sign;
|
|||
* @version $Id: AESUtils.java, v 0.1 2022-07-06 14:57
|
||||
*/
|
||||
|
||||
import org.apache.tomcat.util.codec.binary.Base64;
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
|
||||
import javax.crypto.*;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
import org.apache.tomcat.util.codec.binary.Base64;
|
||||
import java.security.Security;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.electromagnetic.industry.software.data.manage.facade.Category;
|
||||
|
||||
import java.util.List;
|
||||
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
||||
|
||||
public interface CategoryFacade {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.electromagnetic.industry.software.data.manage.facade.user;
|
||||
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.*;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.GetSingleUserRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserModiRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserPublishRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserLoginRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
||||
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.*;
|
||||
|
||||
public interface UserFacade {
|
||||
|
||||
|
|
@ -63,11 +66,4 @@ public interface UserFacade {
|
|||
* @return
|
||||
*/
|
||||
ElectromagneticResult<?> deleteUser(UserDeleteRequest userDeleteRequest);
|
||||
|
||||
/**
|
||||
* 用户登出
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
ElectromagneticResult<?> logout(String token);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.electromagnetic.industry.software.data.manage.request.indicator;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import electromagnetic.data.framework.share.model.BaseRequest;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.electromagnetic.industry.software.data.manage.request.user;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import electromagnetic.data.framework.share.model.BaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.electromagnetic.industry.software.data.manage.request.user;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import electromagnetic.data.framework.share.model.BaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.electromagnetic.industry.software.data.manage.request.user;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import electromagnetic.data.framework.share.model.BaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.electromagnetic.industry.software.data.manage.request.user;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import electromagnetic.data.framework.share.model.BaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
package com.electromagnetic.industry.software.data.manage.response.user;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.catalina.User;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.electromagnetic.industry.software.data.manage.repository.dao;
|
|||
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.EDDataInfo;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.EDDataParams;
|
||||
import com.electromagnetic.industry.software.data.manage.request.indicator.EDDataRequest;
|
||||
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -19,11 +19,4 @@ public interface TokenMapper {
|
|||
* @return Token
|
||||
*/
|
||||
Token selectToken(String token);
|
||||
|
||||
/**
|
||||
* 删除token
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
int deleteToken(String token);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.electromagnetic.industry.software.data.manage.repository.dao;
|
||||
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||
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.model.User;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.UserDeleteKeyWords;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.electromagnetic.industry.software.data.manage.domain.boardservice.ind
|
|||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.EDDataParams;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.repository.EDDataRepository;
|
||||
import com.electromagnetic.industry.software.data.manage.repository.dao.EDDataMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
|
|||
|
|
@ -30,12 +30,4 @@ public class TokenRepositoryImpl implements TokenRepository {
|
|||
*/
|
||||
@Override
|
||||
public Token selectToken(String token) {return tokenMapper.selectToken(token);}
|
||||
|
||||
/**
|
||||
* 删除令牌
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteToken(String token) {return tokenMapper.deleteToken(token);};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@
|
|||
package com.electromagnetic.industry.software.data.manage.repository.impl;
|
||||
|
||||
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.User;
|
||||
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.model.User;
|
||||
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.repository.dao.UserMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class UserRepositoryImpl implements UserRepository {
|
||||
|
|
|
|||
|
|
@ -36,8 +36,4 @@
|
|||
where token=#{token}
|
||||
</select>
|
||||
|
||||
<delete id="deleteToken" parameterType="String">
|
||||
delete from tokens where token=#{token}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
<if test="isPublished != null and isPublished != ''">
|
||||
<choose>
|
||||
<when test="isPublished != 'all'">
|
||||
AND is_published = CAST(#{isPublished} AS SIGNED)
|
||||
AND is_published = CAST(#{isPublished} AS INT)
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
|
|
|
|||
137
pom.xml
137
pom.xml
|
|
@ -258,78 +258,89 @@
|
|||
<finalName>electromagnetic</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<nonFilteredFileExtensions>
|
||||
<nonFilteredFileExtension>ico</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>tag</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
|
||||
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法:为了解决Unable to find main class的问题 -->
|
||||
<classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.2</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<!-- 添加引入本地jar组件 -->
|
||||
<!-- <compilerArguments>
|
||||
<extdirs>D:/code/tool/dataplatform-tool-parent/lib/dingtalk-1.0.0.jar</extdirs>
|
||||
</compilerArguments>-->
|
||||
<!--<compilerArgs>
|
||||
<arg>-extdirs</arg>
|
||||
<arg>${project.basedir}/lib/</arg>
|
||||
</compilerArgs>-->
|
||||
</configuration>
|
||||
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<configuration>
|
||||
<!-- <dataFile>target/jacoco.exec</dataFile>-->
|
||||
|
||||
<outputDirectory>/usr/src/target</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!--<plugin>-->
|
||||
<!--<groupId>org.springframework.boot</groupId>-->
|
||||
<!--<artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!--<configuration>-->
|
||||
<!--<fork>true</fork>-->
|
||||
<!--</configuration>-->
|
||||
<!--</plugin>-->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<artifactId>cobertura-maven-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<configuration>
|
||||
<delimiters>
|
||||
<delimiter>@</delimiter>
|
||||
</delimiters>
|
||||
<useDefaultDelimiters>true</useDefaultDelimiters>
|
||||
<instrumentation>
|
||||
<excludes>
|
||||
<exclude>**/*DO.class</exclude>
|
||||
<exclude>**/*Config.class</exclude>
|
||||
<exclude>**/*Param.class</exclude>
|
||||
<exclude>**/*Enum.class</exclude>
|
||||
</excludes>
|
||||
</instrumentation>
|
||||
<check/>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/webapp</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.btl</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<excludes>
|
||||
<exclude>static/**</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>static/**</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -9,7 +9,6 @@
|
|||
<groupId>com.electromagnetic.data</groupId>
|
||||
<artifactId>electromagnetic-data</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
||||
</parent>
|
||||
|
||||
<groupId>com.electromagnetic.data</groupId>
|
||||
|
|
@ -33,6 +32,7 @@
|
|||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.electromagnetic.data</groupId>
|
||||
<artifactId>electromagnetic-framework</artifactId>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package com.electromagnetic.industry.software.data.manage.service.facade;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.text.StrFormatter;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.crypto.symmetric.AES;
|
||||
|
|
@ -32,6 +32,8 @@ import javax.annotation.Resource;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -44,17 +46,19 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
|||
|
||||
@Value("${data.windows.path}")
|
||||
private String uploadFilePath;
|
||||
|
||||
@Value("${data.windows.path}")
|
||||
private String windowsDir;
|
||||
@Value("${data.file.cache.dir}")
|
||||
private String fileCacheDir;
|
||||
@Value("${data.file.storage.dir}")
|
||||
private String fileStorageDir;
|
||||
|
||||
|
||||
@Value("${data.upload.cache.dir}")
|
||||
private String uploadCacheDir;
|
||||
@Value("${data.export.cache.dir}")
|
||||
private String exportCacheDir;
|
||||
@Value("${data.import.cache.dir}")
|
||||
private String importCacheDir;
|
||||
|
||||
@Value("${file.encode.passwd}")
|
||||
private String encodePasswd;
|
||||
|
||||
private static final String UPLOAD_FILE_CHUNK_SUFFIX = ".part";
|
||||
|
||||
|
||||
|
|
@ -182,20 +186,28 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
|||
String filePath = storageFilePath + "/" + filePathOfFolder + "/" + edDataInfo.getDataName();
|
||||
|
||||
Assert.isTrue(FileUtil.exist(filePath), "下载文件不存在。");
|
||||
FileSystemResource fileSystemResource = new FileSystemResource(filePath);
|
||||
File file = new File(filePath);
|
||||
FileSystemResource fileSystemResource = new FileSystemResource(file);
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||
String fileName = fileSystemResource.getFilename();
|
||||
byte[] fileNameBytes = fileName.getBytes(StandardCharsets.UTF_8);
|
||||
fileName = new String(fileNameBytes, 0, fileNameBytes.length, StandardCharsets.ISO_8859_1);
|
||||
String attachment = StrFormatter.format("attachment;filename={}", fileName);
|
||||
//headers.add("Content-Disposition", attachment);
|
||||
// headers.set("attachment", fileName);
|
||||
headers.add("Pragma", "no-cache");
|
||||
headers.add("Expires", "0");
|
||||
String fileName = Base64.encode(fileSystemResource.getFilename());
|
||||
response.setHeader("content-disposition","attachment;filename=" + fileName);
|
||||
response.setHeader("content-disposition","attachment;filename=" + URLEncoder.encode(fileName,"UTF-8"));
|
||||
// response.setHeader("Content-Disposition", "attachment; filename=\"" + new String(fileSystemResource.getFilename().getBytes("UTF-8"), "ISO8859-1"));
|
||||
// 构建响应实体(可以返回<byte[]或Resource,返回类型取决body入参类型)
|
||||
return ResponseEntity
|
||||
.ok()
|
||||
.headers(headers)
|
||||
.contentLength(fileSystemResource.contentLength())
|
||||
.contentType(MediaType.parseMediaType("application/octet-stream;charset=UTF-8"))
|
||||
.contentType(MediaType.parseMediaType("application/octet-stream"))
|
||||
.body(new InputStreamResource(fileSystemResource.getInputStream()));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -223,10 +235,13 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
|||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||
String fileName = Base64.encode(fileSystemResource.getFilename());
|
||||
String fileName = fileSystemResource.getFilename();
|
||||
byte[] fileNameBytes = fileName.getBytes(StandardCharsets.UTF_8);
|
||||
fileName = new String(fileNameBytes, 0, fileNameBytes.length, StandardCharsets.ISO_8859_1);
|
||||
String attachment = StrFormatter.format("attachment;filename={}", fileName);
|
||||
headers.add("Pragma", "no-cache");
|
||||
headers.add("Expires", "0");
|
||||
response.setHeader("content-disposition","attachment;filename=" + fileName);
|
||||
response.setHeader("content-disposition","attachment;filename=" + URLEncoder.encode(fileName,"UTF-8"));
|
||||
|
||||
// 构建响应实体(可以返回<byte[]或Resource,返回类型取决body入参类型)
|
||||
return ResponseEntity
|
||||
|
|
@ -295,13 +310,14 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
|||
String dataCachePath = edDataService.getDataCachePath();
|
||||
String importDataCachePath = dataCachePath + importCacheDir;
|
||||
String destPath = importDataCachePath + identifier;
|
||||
|
||||
if (!FileUtil.exist(new File(destPath))) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<Integer> uploadedFileChunkNums = FileUtil.listFileNames(destPath)
|
||||
.stream()
|
||||
.filter(e -> !e.endsWith(".comac"))
|
||||
.filter(e -> !e.endsWith(".zip"))
|
||||
.map(e -> e.replace(UPLOAD_FILE_CHUNK_SUFFIX, ""))
|
||||
.map(Integer::parseInt)
|
||||
.collect(Collectors.toList());
|
||||
|
|
@ -353,7 +369,8 @@ public class EDDataFacadeImpl implements EDDataFacade {
|
|||
|
||||
// 解密文件
|
||||
String decryptFilePath = destZipPath + "_decrypted";
|
||||
AES aes = SecureUtil.aes(encodePasswd.getBytes()); // aesKey是加密密钥
|
||||
String password = "adknfhkj87654knd";
|
||||
AES aes = SecureUtil.aes(password.getBytes()); // aesKey是加密密钥
|
||||
try(
|
||||
InputStream inputStream = new FileInputStream(destZipPath);
|
||||
OutputStream outputStream = new FileOutputStream(decryptFilePath);
|
||||
|
|
|
|||
|
|
@ -11,10 +11,15 @@ import com.electromagnetic.industry.software.data.manage.domain.boardservice.use
|
|||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.util.UserConstant;
|
||||
import com.electromagnetic.industry.software.data.manage.facade.user.UserFacade;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.*;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserModiRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserPublishRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserLoginRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.response.user.SingleUserResponse;
|
||||
import com.electromagnetic.industry.software.data.manage.response.user.UserLoginResponse;
|
||||
import com.electromagnetic.industry.software.data.manage.response.user.UserSearchResponse;
|
||||
import com.electromagnetic.industry.software.data.manage.service.mappers.UserMappers;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import electromagnetic.data.framework.share.id.IdWorker;
|
||||
import electromagnetic.data.framework.share.model.ElectromagneticResult;
|
||||
import electromagnetic.data.framework.share.model.ElectromagneticResultUtil;
|
||||
|
|
@ -24,7 +29,6 @@ import org.apache.commons.lang3.RandomStringUtils;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
|
@ -45,7 +49,7 @@ public class UserFacadeImpl implements UserFacade {
|
|||
UserLoginInfo info = UserMappers.INSTANCE.getUserLoginRequestToModel(loginRequest);
|
||||
String decodePwd = AESUtils.decrypt(info.getUserPwd(), UserConstant.SECRET_KEY);
|
||||
User user = userService.getUserByWorkNumber(info.getWorkNumber());
|
||||
if ( userService.checkUserValid(user) && userService.matchPassword(user, decodePwd)) {
|
||||
if ( user!=null && userService.matchPassword(user, decodePwd)) {
|
||||
String tokenStr = tokenService.createToken(info);
|
||||
tokenService.createUserToken(user, tokenStr);
|
||||
UserLoginResponse userLoginResponse = new UserLoginResponse();
|
||||
|
|
@ -196,14 +200,6 @@ public class UserFacadeImpl implements UserFacade {
|
|||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 用户登出
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ElectromagneticResult<?> logout(String token) {
|
||||
token = token.substring(7);
|
||||
return ElectromagneticResultUtil.success(tokenService.deleteToken(token));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,15 @@
|
|||
*/
|
||||
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.UserLoginInfo;
|
||||
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.model.User;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.UserDeleteKeyWords;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserModiRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.*;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.model.UserLoginInfo;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserLoginRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.request.user.UserRequest;
|
||||
import com.electromagnetic.industry.software.data.manage.response.user.SingleUserResponse;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
|
|
|||
Loading…
Reference in New Issue