remove
This commit is contained in:
@@ -5,9 +5,6 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springblade.core.test.BladeBootTest;
|
||||
import org.springblade.core.test.BladeSpringExtension;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springblade.flow.engine.entity.FlowModel;
|
||||
import org.springblade.flow.engine.service.FlowEngineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,26 +17,26 @@ import java.util.List;
|
||||
@BladeBootTest(appName = "blade-runner", enableLoader = true)
|
||||
public class BladeTest {
|
||||
|
||||
@Autowired
|
||||
private FlowEngineService service;
|
||||
|
||||
//@Test
|
||||
public void contextLoads() {
|
||||
System.out.println("=====数据迁移启动=====");
|
||||
|
||||
// 获取 ACT_DE_MODEL 表需要转换的数据
|
||||
List<FlowModel> list = service.list();
|
||||
// 循环转换
|
||||
list.forEach(flowModel -> {
|
||||
if (StringUtil.isBlank(flowModel.getModelEditorXml())) {
|
||||
service.update(Wrappers.<FlowModel>lambdaUpdate()
|
||||
.set(FlowModel::getModelEditorXml, new String(service.getModelEditorXML(flowModel)))
|
||||
.ge(FlowModel::getId, flowModel.getId())
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
System.out.println("=====数据迁移完毕=====");
|
||||
}
|
||||
// @Autowired
|
||||
// private FlowEngineService service;
|
||||
//
|
||||
// //@Test
|
||||
// public void contextLoads() {
|
||||
// System.out.println("=====数据迁移启动=====");
|
||||
//
|
||||
// // 获取 ACT_DE_MODEL 表需要转换的数据
|
||||
// List<FlowModel> list = service.list();
|
||||
// // 循环转换
|
||||
// list.forEach(flowModel -> {
|
||||
// if (StringUtil.isBlank(flowModel.getModelEditorXml())) {
|
||||
// service.update(Wrappers.<FlowModel>lambdaUpdate()
|
||||
// .set(FlowModel::getModelEditorXml, new String(service.getModelEditorXML(flowModel)))
|
||||
// .ge(FlowModel::getId, flowModel.getId())
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// System.out.println("=====数据迁移完毕=====");
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -22,37 +22,44 @@ public class Sm2KeyGenerator {
|
||||
String publicKey = "049a315b42a9fd789c321442185f0375fdd7686461fad1276e999a738700375ece22e8a343052ee6be0d1cba174adacaa875c4ffdd0a2b936df26c330f5815599a";
|
||||
String privateKey = "3d3713f75f9d91583360388428693ddbebd480b8141414b59655a6e6bbbaec15";
|
||||
|
||||
System.out.println("#blade配置 \n" +
|
||||
"blade:\n" +
|
||||
" oauth2:\n" +
|
||||
" enabled: true\n" +
|
||||
" public-key: " + publicKey + "\n" +
|
||||
" private-key: " + privateKey);
|
||||
System.out.println("=======================================================");
|
||||
System.out.println(StringPool.EMPTY);
|
||||
System.out.println("============== saber website.js 配置如下 ===============");
|
||||
System.out.println("//saber配置\n" +
|
||||
"oauth2: {\n" +
|
||||
" publicKey: '" + publicKey + "',\n" +
|
||||
"}");
|
||||
System.out.println("=======================================================");
|
||||
System.out.println(StringPool.EMPTY);
|
||||
System.out.println("============== 密码:[admin] 加密流程如下 ================");
|
||||
String password = "123456";
|
||||
byte[] encryptedData = SM2Util.encrypt(password, publicKey);
|
||||
String phone = "13370065231";
|
||||
byte[] encryptedData = SM2Util.encrypt(phone, publicKey);
|
||||
String decryptedText = SM2Util.decrypt(encryptedData, privateKey);
|
||||
System.out.println("加密前: " + password);
|
||||
System.out.println("加密后: " + Hex.toHexString(encryptedData));
|
||||
System.out.println("解密后: " + decryptedText);
|
||||
System.out.println("请注意: 此密文为前端加密后调用token接口的密码参数");
|
||||
System.out.println("=======================================================");
|
||||
|
||||
String encryptedPassword = "04a3ed85133ca830edd0e48e53836298a1528c7692240af9f73aade547d06bc80df13a155c304323f83e37ae5d6f68c385ede1bb3c17db921d218e45b75e9417ef0996f8671d77f87d26eea17a735812bb476b355f5cf4abbfe7bc2f32746e8c122d4edd5e3161";
|
||||
System.out.println("密码: " + encryptedPassword);
|
||||
System.out.println("解密后: " + SM2Util.decrypt(encryptedPassword, privateKey));
|
||||
|
||||
String hex = DigestUtil.encrypt("123456");
|
||||
System.out.println("加密后: " + hex);
|
||||
// System.out.println("#blade配置 \n" +
|
||||
// "blade:\n" +
|
||||
// " oauth2:\n" +
|
||||
// " enabled: true\n" +
|
||||
// " public-key: " + publicKey + "\n" +
|
||||
// " private-key: " + privateKey);
|
||||
// System.out.println("=======================================================");
|
||||
// System.out.println(StringPool.EMPTY);
|
||||
// System.out.println("============== saber website.js 配置如下 ===============");
|
||||
// System.out.println("//saber配置\n" +
|
||||
// "oauth2: {\n" +
|
||||
// " publicKey: '" + publicKey + "',\n" +
|
||||
// "}");
|
||||
// System.out.println("=======================================================");
|
||||
// System.out.println(StringPool.EMPTY);
|
||||
// System.out.println("============== 密码:[admin] 加密流程如下 ================");
|
||||
// String password = "123456";
|
||||
// byte[] encryptedData = SM2Util.encrypt(password, publicKey);
|
||||
// String decryptedText = SM2Util.decrypt(encryptedData, privateKey);
|
||||
// System.out.println("加密前: " + password);
|
||||
// System.out.println("加密后: " + Hex.toHexString(encryptedData));
|
||||
// System.out.println("解密后: " + decryptedText);
|
||||
// System.out.println("请注意: 此密文为前端加密后调用token接口的密码参数");
|
||||
// System.out.println("=======================================================");
|
||||
//
|
||||
// String encryptedPassword = "04a3ed85133ca830edd0e48e53836298a1528c7692240af9f73aade547d06bc80df13a155c304323f83e37ae5d6f68c385ede1bb3c17db921d218e45b75e9417ef0996f8671d77f87d26eea17a735812bb476b355f5cf4abbfe7bc2f32746e8c122d4edd5e3161";
|
||||
// System.out.println("密码: " + encryptedPassword);
|
||||
// System.out.println("解密后: " + SM2Util.decrypt(encryptedPassword, privateKey));
|
||||
//
|
||||
// String hex = DigestUtil.encrypt("123456");
|
||||
// System.out.println("加密后: " + hex);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
package org.springblade.test.param;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springblade.core.test.BladeBootTest;
|
||||
import org.springblade.core.test.BladeSpringExtension;
|
||||
import org.springblade.modules.appFormal.dto.CutAmountRangDTO;
|
||||
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
|
||||
import org.springblade.modules.appOffline.dto.WatchVideoTimeRangeDTO;
|
||||
import org.springblade.modules.auth.dto.UserRegisterRoleDTO;
|
||||
import org.springblade.modules.system.pojo.entity.Param;
|
||||
import org.springblade.modules.system.service.IParamService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ExtendWith(BladeSpringExtension.class)
|
||||
@BladeBootTest(appName = "blade-runner" , profile = "test")
|
||||
public class ParamTest {
|
||||
|
||||
@Resource
|
||||
private IParamService paramService;
|
||||
|
||||
@Test
|
||||
public void addRegisterRoleInfoParamValue() {
|
||||
|
||||
String paramKey = "yichayilu:app:register:role-info";
|
||||
String paramName = "app用户注册默认角色信息";
|
||||
String remark = "app用户注册默认角色信息-包含角色、部门、岗位、头像";
|
||||
|
||||
UserRegisterRoleDTO userRegisterRoleInfo = new UserRegisterRoleDTO();
|
||||
userRegisterRoleInfo.setRoleId("1123598816738675202");
|
||||
userRegisterRoleInfo.setDeptId("1123598813738675201");
|
||||
userRegisterRoleInfo.setPostId("1123598817738675208");
|
||||
userRegisterRoleInfo.setAvatar("https://tse1-mm.cn.bing.net/th/id/OIP-C.BM4bF8_qipHCQu014y_8UgAAAA?w=220&h=217&c=7&r=0&o=7&pid=1.7&rm=3");
|
||||
|
||||
Param param = new Param();
|
||||
param.setParamKey(paramKey);
|
||||
param.setParamName(paramName);
|
||||
param.setParamValue(JSONObject.toJSONString(userRegisterRoleInfo));
|
||||
param.setRemark(remark);
|
||||
|
||||
paramService.save(param);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addAppFormalPrivacyParamValue() {
|
||||
|
||||
String paramKey = "yichayilu:app:formal:user:privacy";
|
||||
String paramName = "商城app用户隐私政策";
|
||||
String remark = "商城app用户隐私政策";
|
||||
|
||||
|
||||
Param param = new Param();
|
||||
param.setParamKey(paramKey);
|
||||
param.setParamName(paramName);
|
||||
param.setParamValue("隐私政策");
|
||||
param.setRemark(remark);
|
||||
|
||||
paramService.save(param);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void addAppFormalAgreementParamValue() {
|
||||
|
||||
String paramKey = "yichayilu:app:formal:user:agreement";
|
||||
String paramName = "商城app用户协议";
|
||||
String remark = "商城app用户协议";
|
||||
|
||||
|
||||
Param param = new Param();
|
||||
param.setParamKey(paramKey);
|
||||
param.setParamName(paramName);
|
||||
param.setParamValue("商城app用户协议");
|
||||
param.setRemark(remark);
|
||||
|
||||
paramService.save(param);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addAppFormalOrderModelType() {
|
||||
|
||||
String paramKey = "yichayilu:app:formal:order:model_type";
|
||||
String paramName = "商城app订单类型";
|
||||
String remark = "商城app订单类型";
|
||||
//{"id":1,"code":"MALL","name":"商城"}
|
||||
List<PayOrderDicDTO> payOrderDicDTOS = List.of(
|
||||
new PayOrderDicDTO().setId(1).setCode("MALL").setName("商城")
|
||||
);
|
||||
|
||||
|
||||
Param param = new Param();
|
||||
param.setParamKey(paramKey);
|
||||
param.setParamName(paramName);
|
||||
param.setParamValue(JSONArray.toJSONString(payOrderDicDTOS));
|
||||
param.setRemark(remark);
|
||||
|
||||
paramService.save(param);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void addAppFormalCashToPointRate() {
|
||||
|
||||
String paramKey = "yichayilu:app:formal:mall.cash.to.point.Rate";
|
||||
String paramName = "商城app订单现金兑换积分比例";
|
||||
String remark = "商城app订单现金兑换积分比例";
|
||||
|
||||
|
||||
Param param = new Param();
|
||||
param.setParamKey(paramKey);
|
||||
param.setParamName(paramName);
|
||||
param.setParamValue(String.valueOf("0.3"));
|
||||
param.setRemark(remark);
|
||||
|
||||
paramService.save(param);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void addAppFormalCutAmountRang() {
|
||||
|
||||
String paramKey = "yichayilu:app:formal:mall.cut.amount.rang";
|
||||
String paramName = "商城app随机立减比例范围";
|
||||
String remark = "商城app随机立减比例范围";
|
||||
|
||||
CutAmountRangDTO cutAmountRangDTO = new CutAmountRangDTO();
|
||||
cutAmountRangDTO.setMin(BigDecimal.valueOf(0.01));
|
||||
cutAmountRangDTO.setMax(BigDecimal.valueOf(0.001));
|
||||
|
||||
Param param = new Param();
|
||||
param.setParamKey(paramKey);
|
||||
param.setParamName(paramName);
|
||||
param.setParamValue(JSONObject.toJSONString(cutAmountRangDTO));
|
||||
param.setRemark(remark);
|
||||
|
||||
paramService.save(param);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void addAppFormalPayType() {
|
||||
|
||||
String paramKey = "yichayilu:app:formal:pay.type";
|
||||
String paramName = "商城app支付类型";
|
||||
String remark = "商城app支付类型";
|
||||
|
||||
List<PayOrderDicDTO> payOrderDicDTOS = List.of(
|
||||
new PayOrderDicDTO().setId(1).setCode("ALI").setName("支付宝"),
|
||||
new PayOrderDicDTO().setId(2).setCode("WEI").setName("微信")
|
||||
);
|
||||
|
||||
Map<Integer, List<PayOrderDicDTO>> payOrderDicMap = new HashMap<>();
|
||||
payOrderDicMap.put(1, payOrderDicDTOS);
|
||||
|
||||
Param param = new Param();
|
||||
param.setParamKey(paramKey);
|
||||
param.setParamName(paramName);
|
||||
param.setParamValue(JSONObject.toJSONString(payOrderDicMap));
|
||||
param.setRemark(remark);
|
||||
|
||||
paramService.save(param);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addDailySignIsLookAds() {
|
||||
|
||||
String paramKey = "yichayilu:app:dailysign.is.look.ads";
|
||||
String paramName = "积分app是否看广告";
|
||||
String remark = "积分app是否看广告";
|
||||
|
||||
|
||||
Param param = new Param();
|
||||
param.setParamKey(paramKey);
|
||||
param.setParamName(paramName);
|
||||
param.setParamValue("true");
|
||||
param.setRemark(remark);
|
||||
|
||||
paramService.save(param);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addWatchVideoTimeRange() {
|
||||
|
||||
String paramKey = "yichayilu:app:dailysign:watch.video.time.rang";
|
||||
String paramName = "积分app看广告的时间范围";
|
||||
String remark = "积分app看广告的时间范围";
|
||||
|
||||
WatchVideoTimeRangeDTO dto = new WatchVideoTimeRangeDTO();
|
||||
dto.setStartTime("08:00");
|
||||
dto.setEndTime("22:00");
|
||||
|
||||
Param param = new Param();
|
||||
param.setParamKey(paramKey);
|
||||
param.setParamName(paramName);
|
||||
param.setParamValue(JSONObject.toJSONString(dto));
|
||||
param.setRemark(remark);
|
||||
|
||||
paramService.save(param);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package org.springblade.test.userPoint;
|
||||
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springblade.core.test.BladeBootTest;
|
||||
import org.springblade.core.test.BladeSpringExtension;
|
||||
import org.springblade.modules.userPoint.dto.UserAmountDTO;
|
||||
import org.springblade.modules.userPoint.pojo.entity.UserMallIntegralEntity;
|
||||
import org.springblade.modules.userPoint.service.IUserMallIntegralService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ExtendWith(BladeSpringExtension.class)
|
||||
@BladeBootTest(appName = "blade-runner" , profile = "test")
|
||||
public class UserPointTest {
|
||||
|
||||
@Resource
|
||||
private IUserMallIntegralService userMallIntegralService;
|
||||
|
||||
@Test
|
||||
public void addAmount() {
|
||||
|
||||
for (int i = 0; i < 20; i++){
|
||||
UserMallIntegralEntity mallIntegral = userMallIntegralService.getById(2017162601210183681L);
|
||||
Integer version = 1;
|
||||
if (mallIntegral == null){
|
||||
mallIntegral = new UserMallIntegralEntity();
|
||||
mallIntegral.setAmount(BigDecimal.ZERO);
|
||||
mallIntegral.setId(2017162601210183681L);
|
||||
mallIntegral.setVersion(version);
|
||||
userMallIntegralService.save(mallIntegral);
|
||||
}else {
|
||||
version = mallIntegral.getVersion();
|
||||
}
|
||||
UserAmountDTO dto = new UserAmountDTO();
|
||||
dto.setUserId(2017162601210183681L);
|
||||
dto.setAmount(new BigDecimal(666));
|
||||
dto.setOrderId(1L);
|
||||
dto.setSourceId(2017162601210183681L);
|
||||
dto.setSourceDetail("19115988697");
|
||||
dto.setVersion(version);
|
||||
dto.setRemark("测试");
|
||||
|
||||
userMallIntegralService.addAmount(dto);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user