Signed-off-by: chy <chy@163.com>
This commit is contained in:
25
lidee-module/lidee-module-biz/.flattened-pom.xml
Normal file
25
lidee-module/lidee-module-biz/.flattened-pom.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.lideeyunji</groupId>
|
||||
<artifactId>lidee-module</artifactId>
|
||||
<version>2.2.4</version>
|
||||
</parent>
|
||||
<groupId>com.lideeyunji</groupId>
|
||||
<artifactId>lidee-module-biz</artifactId>
|
||||
<version>2.2.4</version>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>个人业务模块</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.lideeyunji</groupId>
|
||||
<artifactId>lidee-module-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lideeyunji</groupId>
|
||||
<artifactId>lidee-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
29
lidee-module/lidee-module-biz/pom.xml
Normal file
29
lidee-module/lidee-module-biz/pom.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.lideeyunji</groupId>
|
||||
<artifactId>lidee-module</artifactId>
|
||||
<version>${lidee.version}</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.lideeyunji</groupId>
|
||||
<artifactId>lidee-module-biz</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>${project.artifactId}</name>
|
||||
<version>${lidee.version}</version>
|
||||
<description> 个人业务模块 </description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.lideeyunji</groupId>
|
||||
<artifactId>lidee-module-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.lideeyunji</groupId>
|
||||
<artifactId>lidee-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
package com.lideeyunji.module.api;
|
||||
|
||||
import com.lideeyunji.core.framework.service.IFormService;
|
||||
import com.lideeyunji.core.framework.service.IReportService;
|
||||
import com.lideeyunji.tool.framework.yunji.enums.AuthTypeEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 低代码 API 接口
|
||||
*/
|
||||
@Service
|
||||
public class LideeYunJiApiImpl implements LideeYunJiApi {
|
||||
|
||||
@Autowired
|
||||
private IFormService formService;
|
||||
|
||||
@Autowired
|
||||
private IReportService reportService;
|
||||
|
||||
//获取表单设置的授权类型
|
||||
@Override
|
||||
public String getDbformAuthType(Long dbFormid) {
|
||||
AuthTypeEnum authType = formService.getAuthType(dbFormid);
|
||||
return authType.getType();
|
||||
|
||||
}
|
||||
|
||||
//获取表单设置的授权类型
|
||||
@Override
|
||||
public String getReportAuthType(String reportCode) {
|
||||
AuthTypeEnum authType = reportService.getAuthType(reportCode);
|
||||
return authType.getType();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
package com.lideeyunji.module.biz.component.btncommand;
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.btncommand.definable.DefinableButtonPlugin;
|
||||
import com.lideeyunji.core.framework.config.btncommand.param.ButtonParamAdd;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
|
||||
/**
|
||||
* A自定义方法
|
||||
*/
|
||||
public class ADefinableButtonPlugin implements DefinableButtonPlugin<String, ButtonParamAdd> {
|
||||
|
||||
|
||||
@Override
|
||||
public String execute(ButtonParamAdd param) {
|
||||
System.out.println("param========"+ Func.json2Str(param));
|
||||
|
||||
System.out.println("执行A方法");
|
||||
return "成功";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
package com.lideeyunji.module.biz.component.btncommand;
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.btncommand.definable.DefinableButtonPlugin;
|
||||
import com.lideeyunji.core.framework.config.btncommand.param.ButtonParamEdit;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
|
||||
/**
|
||||
* B自定义方法
|
||||
*/
|
||||
public class BDefinableButtonPlugin implements DefinableButtonPlugin<Integer, ButtonParamEdit> {
|
||||
@Override
|
||||
public Integer execute(ButtonParamEdit param) {
|
||||
System.out.println("param=========="+ Func.json2Str(param));
|
||||
System.out.println("执行B方法");
|
||||
return 123;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
package com.lideeyunji.module.biz.component.virtualization;
|
||||
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.virtualization.VirtualizationFieldPlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component("aVirtualizationPlugin")
|
||||
public class AVirtualizationPlugin implements VirtualizationFieldPlugin {
|
||||
|
||||
@Override
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
return "执行A插件返回的结果";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
package com.lideeyunji.module.biz.component.virtualization;
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.virtualization.VirtualizationFieldPlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component("bVirtualizationPlugin")
|
||||
public class BVirtualizationPlugin implements VirtualizationFieldPlugin {
|
||||
|
||||
@Override
|
||||
public String execute(Map<String, Object> dataMap) {
|
||||
System.out.println(Func.json2Str(dataMap));
|
||||
return "执行B插件返回的结果";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
package com.lideeyunji.module.biz.controller;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.lideeyunji.module.biz.service.IDemoService;
|
||||
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
||||
import com.lideeyunji.tool.framework.yunji.model.global.BaseWebResult;
|
||||
import com.lideeyunji.tool.framework.tenant.core.aop.TenantIgnore;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-02-26 14:59
|
||||
* @dedescription:
|
||||
*/
|
||||
@TenantIgnore
|
||||
@Tag(name = "低代码框架 - demo接口")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping(lideeYunJiBaseConstant.REQUEST_URL_START +"/demo")
|
||||
public class DemoController {
|
||||
|
||||
private final IDemoService demoService;
|
||||
|
||||
|
||||
|
||||
@GetMapping({"/getData"})
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "获取demo数据")
|
||||
public BaseWebResult getData() {
|
||||
List<Map<String, Object>> dataMapList = demoService.getDemoData();
|
||||
return BaseWebResult.success(dataMapList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-19 9:35
|
||||
* @dedescription:
|
||||
*/
|
||||
@Component("demoAfterAdvicePlugin")
|
||||
public class DemoAfterAdvicePlugin implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
List<Map<String, Object>> list = enhanceContext.getParam().getList();
|
||||
list.forEach(
|
||||
map -> map.replace("name", map.get("name") + "01"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-20 14:32
|
||||
* @dedescription:
|
||||
*/
|
||||
@Component("demoAfterAdvicePlugin02")
|
||||
public class DemoAfterAdvicePlugin02 implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
List<Map<String, Object>> list = enhanceContext.getParam().getList();
|
||||
list.forEach(
|
||||
map -> map.replace("name", map.get("name") + "02"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-21 9:34
|
||||
* @dedescription:
|
||||
*/
|
||||
@Component("demoAfterAdvicePlugin03")
|
||||
public class DemoAfterAdvicePlugin03 implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
List<Map<String, Object>> list = enhanceContext.getParam().getList();
|
||||
list.forEach(
|
||||
map -> map.replace("name", map.get("name") + "_合集"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-13 11:42
|
||||
* @dedescription: 环绕增强测试
|
||||
*/
|
||||
|
||||
@Component("demoAroundAdvicePlugin")
|
||||
public class DemoAroundAdvicePlugin implements AroundAdvicePlugin {
|
||||
|
||||
|
||||
@Override
|
||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||
//
|
||||
// System.out.println("----------------------------------------------------------beforeExecute----------------------------------------------------------");
|
||||
// EnhanceResult result = new EnhanceResult();
|
||||
// result.setExitFlag(false);
|
||||
// enhanceContext.setResult(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterExecute(EnhanceContext enhanceContext) {
|
||||
// System.out.println("----------------------------------------------------------afterExecute----------------------------------------------------------");
|
||||
// List<Map<String, Object>> records = enhanceContext.getResult().getRecords();
|
||||
// records.forEach(record -> {
|
||||
// record.replace("name", FuncBase.getMap2Str(record, "name")+"_after_enhance");
|
||||
// });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceParam;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceResult;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.BeforeAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import com.lideeyunji.tool.framework.exception.lideeYunJiException;
|
||||
import com.lideeyunji.tool.framework.yunji.utils.FuncBase;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-15 11:31
|
||||
* @dedescription: 前置增强测试
|
||||
*/
|
||||
public class DemoBeforeAdvicePlugin implements BeforeAdvicePlugin {
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceParam param = enhanceContext.getParam();
|
||||
Map<String, Object> params = param.getParams();
|
||||
String name = FuncBase.getMap2Str(params, "name");
|
||||
if (Func.equals(name, "lideeyunji")) {
|
||||
throw new lideeYunJiException("不允许使用lideeyunji");
|
||||
}
|
||||
params.replace("name",FuncBase.getMap2Str(params,"name")+"before_enhance");
|
||||
|
||||
EnhanceResult result = new EnhanceResult();
|
||||
result.setExitFlag(false);
|
||||
enhanceContext.setResult(result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceResult;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-19 15:05
|
||||
* @dedescription:
|
||||
*/
|
||||
public class TestAfterAdvicePlugin01 implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceResult result = enhanceContext.getResult();
|
||||
List<Map<String, Object>> records = result.getRecords();
|
||||
records.forEach(record -> {
|
||||
record.replace("name","test01");
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceResult;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import com.lideeyunji.tool.framework.yunji.utils.FuncBase;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-19 15:06
|
||||
* @dedescription:
|
||||
*/
|
||||
public class TestAfterAdvicePlugin02 implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceResult result = enhanceContext.getResult();
|
||||
List<Map<String, Object>> records = result.getRecords();
|
||||
records.forEach(
|
||||
record -> {
|
||||
if (FuncBase.getMap2Int(record,"id") >5){
|
||||
record.replace("name", "test02");
|
||||
}else {
|
||||
record.replace("name", "test01");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-09-09 14:51
|
||||
* @dedescription:
|
||||
*/
|
||||
|
||||
@Component("testListAndPageEnhance")
|
||||
public class TestListAndPageEnhance implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
List<Map<String, Object>> list = enhanceContext.getParam().getList();
|
||||
list.forEach(map -> {
|
||||
map.replace("name", Func.getMap2Str(map,"name")+"_list");
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-09-09 14:54
|
||||
* @dedescription:
|
||||
*/
|
||||
@Component("testPageEnhance")
|
||||
public class TestPageEnhance implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
List<Map<String, Object>> list = enhanceContext.getParam().getList();
|
||||
list.forEach(map -> {
|
||||
map.replace("name", Func.getMap2Str(map,"name")+"_page");
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
package com.lideeyunji.module.biz.demo.test;
|
||||
|
||||
import com.lideeyunji.tool.framework.common.util.json.JsonUtils;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceParam;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-09-12 9:50
|
||||
* @dedescription:
|
||||
*/
|
||||
@Slf4j
|
||||
public class TestUpdateEnhance implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceParam param = enhanceContext.getParam();
|
||||
Map<String, Object> params = param.getParams();
|
||||
log.error("TestUpdateEnhance execute params:{}", JsonUtils.toJsonString(params));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
package com.lideeyunji.module.biz.enhance;
|
||||
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceParam;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-19 15:05
|
||||
* @dedescription:
|
||||
*/
|
||||
@Component
|
||||
public class ExcelDemoEnhance implements AroundAdvicePlugin {
|
||||
@Override
|
||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||
EnhanceParam param = enhanceContext.getParam();
|
||||
Map<String, Object> params = param.getParams();
|
||||
String batchCode = Func.getMap2Str(params, "batchCode");
|
||||
System.out.println("batchCode=========="+batchCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterExecute(EnhanceContext enhanceContext) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
package com.lideeyunji.module.biz.enhance;
|
||||
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceResult;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-19 15:05
|
||||
* @dedescription:
|
||||
*/
|
||||
public class LinClassEnhance implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceResult result = enhanceContext.getResult();
|
||||
List<Map<String, Object>> records = result.getRecords();
|
||||
records.forEach(record -> {
|
||||
String njName = Func.getMap2Str(record, "nj_name");
|
||||
record.put("nj_name","class-24界"+njName);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
package com.lideeyunji.module.biz.enhance;
|
||||
|
||||
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceResult;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JX
|
||||
* @create 2024-08-19 15:05
|
||||
* @dedescription:
|
||||
*/
|
||||
@Component
|
||||
public class LinTestEnhance implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceResult result = enhanceContext.getResult();
|
||||
List<Map<String, Object>> records = result.getRecords();
|
||||
records.forEach(record -> {
|
||||
String name = Func.getMap2Str(record, "name");
|
||||
record.put("name",name+"先生");
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
|
||||
package com.lideeyunji.module.biz.enhance;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceResult;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 后置增强
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class MyAfterEnhance implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceResult result = enhanceContext.getResult();
|
||||
List<Map<String, Object>> dataMapList = result.getRecords();
|
||||
if(Func.isEmpty(dataMapList)){
|
||||
return;
|
||||
}
|
||||
for(Map<String,Object> dataMap:dataMapList){
|
||||
String name = Func.getMap2Str(dataMap,"name");
|
||||
dataMap.put("name",name+"-after");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
|
||||
package com.lideeyunji.module.biz.enhance;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceParam;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceResult;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import com.lideeyunji.tool.framework.exception.lideeYunJiException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 环绕增强
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class MyAroudEnhance implements AroundAdvicePlugin {
|
||||
@Override
|
||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||
EnhanceParam param = enhanceContext.getParam();
|
||||
Map<String, Object> params = param.getParams();
|
||||
String name = Func.getMap2Str(params, "name");
|
||||
if(Func.isNotEmpty(name) && Func.equals(name,"李四")){
|
||||
throw new lideeYunJiException("名称不能为李四");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterExecute(EnhanceContext enhanceContext) {
|
||||
EnhanceResult result = enhanceContext.getResult();
|
||||
List<Map<String, Object>> dataMapList = result.getRecords();
|
||||
if(Func.isEmpty(dataMapList)){
|
||||
return;
|
||||
}
|
||||
for(Map<String,Object> dataMap:dataMapList){
|
||||
String name = Func.getMap2Str(dataMap,"name");
|
||||
dataMap.put("name",name+"-aroud");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
package com.lideeyunji.module.biz.enhance;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceParam;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.BeforeAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import com.lideeyunji.tool.framework.exception.lideeYunJiException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 前置增强
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class MyBeforEnhance implements BeforeAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceParam param = enhanceContext.getParam();
|
||||
Map<String, Object> params = param.getParams();
|
||||
String name = Func.getMap2Str(params, "name");
|
||||
if(Func.isEmpty(name)){
|
||||
throw new lideeYunJiException("参数不允许为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
|
||||
package com.lideeyunji.module.biz.enhance.dbform.viewzqtest;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceResult;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AfterAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 后置增强
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class viewZqtestMyAfterEnhance implements AfterAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceResult result = enhanceContext.getResult();
|
||||
List<Map<String, Object>> dataMapList = result.getRecords();
|
||||
if(Func.isEmpty(dataMapList)){
|
||||
return;
|
||||
}
|
||||
for(Map<String,Object> dataMap:dataMapList){
|
||||
String name = Func.getMap2Str(dataMap,"name");
|
||||
dataMap.put("name",name+"-after");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
|
||||
package com.lideeyunji.module.biz.enhance.dbform.viewzqtest;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceParam;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceResult;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import com.lideeyunji.tool.framework.exception.lideeYunJiException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 环绕增强
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class viewZqtestMyAroudEnhance implements AroundAdvicePlugin {
|
||||
@Override
|
||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||
EnhanceParam param = enhanceContext.getParam();
|
||||
Map<String, Object> params = param.getParams();
|
||||
String name = Func.getMap2Str(params, "name");
|
||||
if(Func.isNotEmpty(name) && Func.equals(name,"李四")){
|
||||
throw new lideeYunJiException("名称不能为李四");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterExecute(EnhanceContext enhanceContext) {
|
||||
EnhanceResult result = enhanceContext.getResult();
|
||||
List<Map<String, Object>> dataMapList = result.getRecords();
|
||||
if(Func.isEmpty(dataMapList)){
|
||||
return;
|
||||
}
|
||||
for(Map<String,Object> dataMap:dataMapList){
|
||||
String name = Func.getMap2Str(dataMap,"name");
|
||||
dataMap.put("name",name+"-aroud");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
package com.lideeyunji.module.biz.enhance.dbform.viewzqtest;
|
||||
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceParam;
|
||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.BeforeAdvicePlugin;
|
||||
import com.lideeyunji.core.framework.utils.Func;
|
||||
import com.lideeyunji.tool.framework.exception.lideeYunJiException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 前置增强
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class viewZqtestMyBeforEnhance implements BeforeAdvicePlugin {
|
||||
@Override
|
||||
public void execute(EnhanceContext enhanceContext) {
|
||||
EnhanceParam param = enhanceContext.getParam();
|
||||
Map<String, Object> params = param.getParams();
|
||||
String name = Func.getMap2Str(params, "name");
|
||||
if(Func.isEmpty(name)){
|
||||
throw new lideeYunJiException("参数不允许为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
package com.lideeyunji.module.biz.mapper;
|
||||
|
||||
|
||||
/**
|
||||
* demo相关
|
||||
*/
|
||||
public interface DemoMapper {
|
||||
|
||||
void getDemoData(Long id);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
package com.lideeyunji.module.biz.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Demo相关
|
||||
*/
|
||||
public interface IDemoService {
|
||||
|
||||
List<Map<String, Object>> getDemoData();
|
||||
|
||||
void testAsync();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
package com.lideeyunji.module.biz.service.impl;
|
||||
|
||||
import com.lideeyunji.core.framework.service.IFrameSqlService;
|
||||
import com.lideeyunji.tool.framework.sql.SqlHelper;
|
||||
import com.lideeyunji.tool.framework.sql.build.buildmodel.wrapper.SqlInfoQueryWrapper;
|
||||
import com.lideeyunji.module.biz.mapper.DemoMapper;
|
||||
import com.lideeyunji.module.biz.service.IDemoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* demo
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class DemoServiceImpl implements IDemoService {
|
||||
|
||||
@Autowired
|
||||
private DemoMapper demoMapper;
|
||||
|
||||
@Autowired
|
||||
private IFrameSqlService sqlService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDemoData(){
|
||||
SqlInfoQueryWrapper.Wrapper wrapper = SqlHelper.getQueryWrapper();
|
||||
wrapper.setTableName("tbl_lin_class");
|
||||
List<Map<String, Object>> dataMapList = sqlService.getDataListByPlus(wrapper);
|
||||
return dataMapList;
|
||||
}
|
||||
|
||||
@Async("asyncPoolTaskExecutor")
|
||||
@Override
|
||||
public void testAsync(){
|
||||
log.info("哈哈哈");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lideeyunji.module.biz.mapper.DemoMapper">
|
||||
|
||||
<update id="getDemoData" >
|
||||
update test_lin set name=1 where id=#{id}
|
||||
</update>
|
||||
</mapper>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.lideeyunji.module.biz.mapper.DemoMapper">
|
||||
|
||||
<update id="getDemoData" >
|
||||
update test_lin set name=1 where id=#{id}
|
||||
</update>
|
||||
</mapper>
|
||||
BIN
lidee-module/lidee-module-biz/target/lidee-module-biz-2.2.4.jar
Normal file
BIN
lidee-module/lidee-module-biz/target/lidee-module-biz-2.2.4.jar
Normal file
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
artifactId=lidee-module-biz
|
||||
groupId=com.lideeyunji
|
||||
version=2.2.4
|
||||
@@ -0,0 +1,28 @@
|
||||
com\lideeyunji\module\biz\demo\test\DemoAfterAdvicePlugin02.class
|
||||
com\lideeyunji\module\biz\demo\test\TestPageEnhance.class
|
||||
com\lideeyunji\module\biz\demo\test\TestListAndPageEnhance.class
|
||||
com\lideeyunji\module\biz\component\btncommand\BDefinableButtonPlugin.class
|
||||
com\lideeyunji\module\api\LideeYunJiApiImpl.class
|
||||
com\lideeyunji\module\biz\enhance\dbform\viewzqtest\viewZqtestMyAfterEnhance.class
|
||||
com\lideeyunji\module\biz\enhance\ExcelDemoEnhance.class
|
||||
com\lideeyunji\module\biz\demo\test\DemoAfterAdvicePlugin.class
|
||||
com\lideeyunji\module\biz\mapper\DemoMapper.class
|
||||
com\lideeyunji\module\biz\enhance\dbform\viewzqtest\viewZqtestMyBeforEnhance.class
|
||||
com\lideeyunji\module\biz\demo\test\DemoAroundAdvicePlugin.class
|
||||
com\lideeyunji\module\biz\demo\test\TestAfterAdvicePlugin02.class
|
||||
com\lideeyunji\module\biz\demo\test\TestAfterAdvicePlugin01.class
|
||||
com\lideeyunji\module\biz\component\virtualization\BVirtualizationPlugin.class
|
||||
com\lideeyunji\module\biz\controller\DemoController.class
|
||||
com\lideeyunji\module\biz\demo\test\DemoAfterAdvicePlugin03.class
|
||||
com\lideeyunji\module\biz\enhance\LinClassEnhance.class
|
||||
com\lideeyunji\module\biz\demo\test\TestUpdateEnhance.class
|
||||
com\lideeyunji\module\biz\component\virtualization\AVirtualizationPlugin.class
|
||||
com\lideeyunji\module\biz\enhance\MyBeforEnhance.class
|
||||
com\lideeyunji\module\biz\service\impl\DemoServiceImpl.class
|
||||
com\lideeyunji\module\biz\enhance\MyAroudEnhance.class
|
||||
com\lideeyunji\module\biz\service\IDemoService.class
|
||||
com\lideeyunji\module\biz\demo\test\DemoBeforeAdvicePlugin.class
|
||||
com\lideeyunji\module\biz\enhance\LinTestEnhance.class
|
||||
com\lideeyunji\module\biz\component\btncommand\ADefinableButtonPlugin.class
|
||||
com\lideeyunji\module\biz\enhance\dbform\viewzqtest\viewZqtestMyAroudEnhance.class
|
||||
com\lideeyunji\module\biz\enhance\MyAfterEnhance.class
|
||||
@@ -0,0 +1,28 @@
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\enhance\dbform\viewzqtest\viewZqtestMyAfterEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\TestAfterAdvicePlugin01.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\TestListAndPageEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\DemoAfterAdvicePlugin03.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\DemoAroundAdvicePlugin.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\enhance\dbform\viewzqtest\viewZqtestMyBeforEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\component\virtualization\AVirtualizationPlugin.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\component\btncommand\BDefinableButtonPlugin.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\enhance\ExcelDemoEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\DemoBeforeAdvicePlugin.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\DemoAfterAdvicePlugin02.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\enhance\dbform\viewzqtest\viewZqtestMyAroudEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\component\btncommand\ADefinableButtonPlugin.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\TestUpdateEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\TestPageEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\api\LideeYunJiApiImpl.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\enhance\LinTestEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\TestAfterAdvicePlugin02.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\enhance\MyAroudEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\service\IDemoService.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\service\impl\DemoServiceImpl.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\enhance\LinClassEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\enhance\MyBeforEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\controller\DemoController.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\component\virtualization\BVirtualizationPlugin.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\enhance\MyAfterEnhance.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\mapper\DemoMapper.java
|
||||
F:\java_project\hngryy_report\lidee-module\lidee-module-biz\src\main\java\com\lideeyunji\module\biz\demo\test\DemoAfterAdvicePlugin.java
|
||||
Reference in New Issue
Block a user