|
@@ -1,36 +1,19 @@
|
|
|
package com.ruoyi;
|
|
package com.ruoyi;
|
|
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
-import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
-import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
|
|
-import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
|
|
import com.ruoyi.common.utils.SM4Util;
|
|
import com.ruoyi.common.utils.SM4Util;
|
|
|
-import com.ruoyi.common.utils.json.JSONUtils;
|
|
|
|
|
-import com.ruoyi.common.utils.spring.SpringUtils;
|
|
|
|
|
import com.ruoyi.interfaces.domain.MdModelInfo;
|
|
import com.ruoyi.interfaces.domain.MdModelInfo;
|
|
|
-import com.ruoyi.interfaces.domain.PtService;
|
|
|
|
|
-import com.ruoyi.interfaces.domain.SysMetaDatasource;
|
|
|
|
|
-import com.ruoyi.interfaces.service.IMdModelInfoService;
|
|
|
|
|
|
|
+import com.ruoyi.interfaces.mapper.MdModelInfoMapper;
|
|
|
import com.ruoyi.interfaces.service.ISysMetaDatasourceService;
|
|
import com.ruoyi.interfaces.service.ISysMetaDatasourceService;
|
|
|
import com.ruoyi.interfaces.service.PtServiceService;
|
|
import com.ruoyi.interfaces.service.PtServiceService;
|
|
|
-import com.ruoyi.model.dpp.dal.dataobject.etl.DppEtlTaskDO;
|
|
|
|
|
-import com.ruoyi.model.etl.mapper.DppEtlTaskMapper;
|
|
|
|
|
-import com.ruoyi.model.etl.mapper.TestDppEtlTaskMapper;
|
|
|
|
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
|
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
-import com.ruoyi.system.service.ISysDeptService;
|
|
|
|
|
-import com.ruoyi.system.service.ISysUserService;
|
|
|
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
-import org.springframework.context.ApplicationContext;
|
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
|
|
|
|
|
@@ -43,7 +26,7 @@ public class JasyptTest {
|
|
|
private SM4Util sm4Util;
|
|
private SM4Util sm4Util;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private IMdModelInfoService mdModelInfoService;
|
|
|
|
|
|
|
+ private MdModelInfoMapper modelMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PtServiceService ptServiceService;
|
|
private PtServiceService ptServiceService;
|
|
@@ -58,14 +41,20 @@ public class JasyptTest {
|
|
|
@Test
|
|
@Test
|
|
|
public void test() {
|
|
public void test() {
|
|
|
|
|
|
|
|
- /*List<MdModelInfo> mdModelInfos = mdModelInfoService.selectMdModelInfoList(null);
|
|
|
|
|
|
|
+/*List<MdModelInfo> mdModelInfos = modelMapper.selectMdModelInfoList(new MdModelInfo());
|
|
|
mdModelInfos.forEach(p->{
|
|
mdModelInfos.forEach(p->{
|
|
|
- p.setMdContact(sm4Util.encrypt(p.getMdContact()));
|
|
|
|
|
- p.setDevContact(sm4Util.encrypt(p.getDevContact()));
|
|
|
|
|
- mdModelInfoService.updateMdModelInfo(p);
|
|
|
|
|
- });
|
|
|
|
|
-*/
|
|
|
|
|
-/* List<PtService> ptServices = ptServiceService.selectAllColumns(null);
|
|
|
|
|
|
|
+ p.setName(sm4Util.decrypt(p.getName()));
|
|
|
|
|
+ p.setEnname(sm4Util.decrypt(p.getEnname()));
|
|
|
|
|
+ p.setMdUnit(sm4Util.decrypt(p.getMdUnit()));
|
|
|
|
|
+ p.setMdContact(sm4Util.decrypt(p.getMdContact()));
|
|
|
|
|
+ p.setDevUnit(sm4Util.decrypt(p.getDevUnit()));
|
|
|
|
|
+ p.setDevContact(sm4Util.decrypt(p.getDevContact()));
|
|
|
|
|
+ modelMapper.updateMdModelInfo(p);
|
|
|
|
|
+ });*/
|
|
|
|
|
+/*
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ List<PtService> ptServices = ptServiceService.selectAllColumns(null);
|
|
|
ptServices.forEach(p->{
|
|
ptServices.forEach(p->{
|
|
|
p.setDevelopContacter(sm4Util.encrypt(p.getDevelopContacter()));
|
|
p.setDevelopContacter(sm4Util.encrypt(p.getDevelopContacter()));
|
|
|
p.setMaintainContacer(sm4Util.encrypt(p.getMaintainContacer()));
|
|
p.setMaintainContacer(sm4Util.encrypt(p.getMaintainContacer()));
|
|
@@ -74,23 +63,26 @@ public class JasyptTest {
|
|
|
ptServiceService.put(p);
|
|
ptServiceService.put(p);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- */
|
|
|
|
|
- /* List<SysMetaDatasource> sysMetaDatasources = datasourceService.selectSysMetaDatasourceList(null);
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ List<SysMetaDatasource> sysMetaDatasources = datasourceService.selectSysMetaDatasourceList(null);
|
|
|
sysMetaDatasources.forEach(p -> {
|
|
sysMetaDatasources.forEach(p -> {
|
|
|
p.setDsUser(sm4Util.encrypt(p.getDsUser()));
|
|
p.setDsUser(sm4Util.encrypt(p.getDsUser()));
|
|
|
p.setDsPass(sm4Util.encrypt(p.getDsPass()));
|
|
p.setDsPass(sm4Util.encrypt(p.getDsPass()));
|
|
|
|
|
|
|
|
datasourceService.updateSysMetaDatasource(p);
|
|
datasourceService.updateSysMetaDatasource(p);
|
|
|
|
|
|
|
|
- });*/
|
|
|
|
|
-/*
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
String encrypt = sm4Util.decrypt("oMd930VR5zYn5ySU4ZJHPg==");
|
|
String encrypt = sm4Util.decrypt("oMd930VR5zYn5ySU4ZJHPg==");
|
|
|
|
|
|
|
|
- System.out.println(encrypt);*/
|
|
|
|
|
|
|
+ System.out.println(encrypt);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
List<SysMetaDatasource> sysMetaDatasources = datasourceService.selectSysMetaDatasourceList(null);
|
|
List<SysMetaDatasource> sysMetaDatasources = datasourceService.selectSysMetaDatasourceList(null);
|
|
|
String prettyJsonString = JSONUtils.toPrettyJsonString(sysMetaDatasources);
|
|
String prettyJsonString = JSONUtils.toPrettyJsonString(sysMetaDatasources);
|
|
|
System.out.println(prettyJsonString);
|
|
System.out.println(prettyJsonString);
|
|
|
|
|
+*/
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+}
|