Compare commits
33 Commits
Author | SHA1 | Date |
---|---|---|
|
2f416ed198 | |
|
60a8739b06 | |
|
348f0caf2d | |
|
0b7a644ed0 | |
|
f01f5cd00a | |
|
9ace3f6737 | |
|
f9eb0bdea3 | |
|
460722dde6 | |
|
fa9def8ded | |
|
56841ca743 | |
|
b9bca5795d | |
|
d504b44601 | |
|
346dcdf75d | |
|
a5ee210a22 | |
|
095e58d812 | |
|
83f99be452 | |
|
58ff225c47 | |
|
675b4a7925 | |
|
a0900b1cee | |
|
d7413fb99f | |
|
7d60bdeef4 | |
|
c0ef153a17 | |
|
7abd8bbed9 | |
|
b228ab67a5 | |
|
7a5e8bf6f2 | |
|
6afd2264e3 | |
|
a37f6ab340 | |
|
72710dc255 | |
|
9acde1cb1e | |
|
e535d45df3 | |
|
5d9fb90fb1 | |
|
10aeddff70 | |
|
7262d4f9a3 |
|
@ -18,6 +18,28 @@
|
||||||
<artifactId>base-webapp</artifactId>
|
<artifactId>base-webapp</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.hzya.frame</groupId>
|
||||||
|
<artifactId>fw-nifi</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.bazaarvoice.jolt</groupId>
|
||||||
|
<artifactId>jolt-core</artifactId>
|
||||||
|
<version>${latest.jolt.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.bazaarvoice.jolt</groupId>
|
||||||
|
<artifactId>json-utils</artifactId>
|
||||||
|
<version>${latest.jolt.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.alibaba/QLExpress -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>QLExpress</artifactId>
|
||||||
|
<version>3.3.4</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
@ -32,6 +54,12 @@
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>liuy</id> <!--刘洋-->
|
||||||
|
<properties>
|
||||||
|
<profile.active>liuy</profile.active>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>llg</id> <!--吕磊钢-->
|
<id>llg</id> <!--吕磊钢-->
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
#######################dev环境#######################
|
||||||
|
logging:
|
||||||
|
#日志级别 指定目录级别
|
||||||
|
level:
|
||||||
|
root: warn
|
||||||
|
encodings: UTF-8
|
||||||
|
file:
|
||||||
|
# 日志保存路径
|
||||||
|
path: /Users/liuyang/workspaces/hzya/fw-nifi/zt-log
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
dynamic:
|
||||||
|
datasource:
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||||
|
username: root
|
||||||
|
password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||||
|
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||||
|
savefile:
|
||||||
|
# 文件保存路径
|
||||||
|
path: /Users/liuyang/workspaces/hzya/fw-nifi/zt-file
|
||||||
|
# path: D:\webservice\file
|
||||||
|
# pluginpath: D:\webservice\plugin
|
||||||
|
pluginpath: /home/webservice/zt/plugin
|
||||||
|
# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\
|
||||||
|
tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/
|
||||||
|
cbs8:
|
||||||
|
appId: 1P4AGrpz
|
||||||
|
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
|
||||||
|
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
|
||||||
|
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
|
||||||
|
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
|
||||||
|
# 这个私钥到时候上传到cbs,和下面到是同一对
|
||||||
|
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
|
||||||
|
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
|
||||||
|
cbs_public_key: 0469146F06BF3B01236E84632441E826
|
||||||
|
#电子回单下载临时存放位置
|
||||||
|
elec_path: /Users/xiangerlin/Downloads/
|
||||||
|
OA:
|
||||||
|
data_source_code: yc_oa
|
||||||
|
zt:
|
||||||
|
url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||||
|
|
||||||
|
nifi:
|
||||||
|
api:
|
||||||
|
url: https://192.168.2.233:8443/nifi-api
|
||||||
|
username: hzya
|
||||||
|
password: hzya1314*nifi
|
|
@ -0,0 +1,136 @@
|
||||||
|
package com.hzya.frame;
|
||||||
|
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreateprocessorandupdateparam.CreateProcessorAndUpdateParamJoin;
|
||||||
|
import com.hzya.frame.nifiapi.model.joingetallcontrollerservice.Component19;
|
||||||
|
import com.hzya.frame.nifiapi.model.joingetallcontrollerservice.ControllerServices19;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultNeedModifyController.PortFilterResult;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultprocessorsinfo.Component16;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultprocessorsinfo.Config16;
|
||||||
|
import com.hzya.frame.nifiapi.operation.INifiAppOperation;
|
||||||
|
import com.hzya.frame.nifiapi.operation.INifiBaseOperation;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestINifiBaseOperation
|
||||||
|
* @Date:2025/5/22 17:02
|
||||||
|
* @Filename:TestINifiBaseOperation
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = {WebappApplication.class})
|
||||||
|
public class TestINifiBaseOperation {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private INifiBaseOperation iNifiBaseOperation;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private INifiAppOperation iNifiAppOperation;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetNeedModifyControllerServicesByProcessGroup() throws Exception {
|
||||||
|
try {
|
||||||
|
List<ControllerServices19> needModifyControllerServicesByProcessGroup = iNifiBaseOperation.getNeedModifyControllerServicesByProcessGroup("4143d803-0196-1000-968f-b06f55b43a3f");
|
||||||
|
System.out.println(needModifyControllerServicesByProcessGroup.size());
|
||||||
|
ControllerServices19 controllerServices19 = needModifyControllerServicesByProcessGroup.get(0);
|
||||||
|
Component19 component = controllerServices19.getComponent();
|
||||||
|
System.out.println(component.getName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetNeedModifyControllerServicesByProcessGroup2() throws Exception {
|
||||||
|
try {
|
||||||
|
ControllerServices19 czfJwnb9sb = iNifiBaseOperation.getNeedModifyControllerServicesByProcessGroup("4143d803-0196-1000-968f-b06f55b43a3f", "CZFJwnb9sb");
|
||||||
|
if (czfJwnb9sb != null && czfJwnb9sb.getComponent() != null) {
|
||||||
|
Component19 component = czfJwnb9sb.getComponent();
|
||||||
|
String name = component.getName();
|
||||||
|
System.out.println(name);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetNeedModifyControllerRelationshipByProcessGroup() throws Exception {
|
||||||
|
try {
|
||||||
|
PortFilterResult needModifyControllerRelationshipByProcessGroup = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup("41437b87-0196-1000-6951-50e41e75c0da", "f5228bc8-0360-41eb-a640-9f4df953937c");
|
||||||
|
System.out.println(needModifyControllerRelationshipByProcessGroup);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCopyProcessor() throws Exception {
|
||||||
|
try {
|
||||||
|
String targetProcessorId = "7f70897a-0196-1000-241a-3a7cdf5bf521";
|
||||||
|
String parentProcessGroupId = "76e23100-ad84-1aab-4447-b9ee936ee7d5";
|
||||||
|
String copyTargetProcessGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||||
|
String s = iNifiBaseOperation.copyProcessor(targetProcessorId, parentProcessGroupId, copyTargetProcessGroupId);
|
||||||
|
System.out.println("新处理器id:" + s);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCreateProcessorAndUpdateParam() {
|
||||||
|
try {
|
||||||
|
Map<String, String> properties = new HashMap<>();
|
||||||
|
properties.put("File Size", "1B");
|
||||||
|
properties.put("Batch Size", "2");
|
||||||
|
properties.put("Data Format", "Binary");
|
||||||
|
properties.put("Unique FlowFiles", "true");
|
||||||
|
properties.put("character-set", "GBK");
|
||||||
|
|
||||||
|
Config16 config16 = new Config16();
|
||||||
|
config16.setProperties(properties);
|
||||||
|
|
||||||
|
Component16 component16 = new Component16();
|
||||||
|
component16.setName("修改处理器名称2");
|
||||||
|
component16.setConfig(config16);
|
||||||
|
|
||||||
|
CreateProcessorAndUpdateParamJoin createProcessorAndUpdateParamJoin = new CreateProcessorAndUpdateParamJoin();
|
||||||
|
createProcessorAndUpdateParamJoin.setComponent(component16);
|
||||||
|
createProcessorAndUpdateParamJoin.setTargetProcessorId("7f70897a-0196-1000-241a-3a7cdf5bf521");
|
||||||
|
createProcessorAndUpdateParamJoin.setCopyTargetProcessGroupId("76e23115-ad84-1aab-7630-21c76aa3973d");
|
||||||
|
createProcessorAndUpdateParamJoin.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||||
|
|
||||||
|
String processorAndUpdateParam = iNifiAppOperation.createProcessorAndUpdateParam(createProcessorAndUpdateParamJoin);
|
||||||
|
System.out.println("新处理器id:" + processorAndUpdateParam);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testgGetFindStateClearMarkProcessor() throws Exception {
|
||||||
|
try {
|
||||||
|
iNifiBaseOperation.getFindStateClearMarkProcessor("41437b87-0196-1000-6951-50e41e75c0da", "接口状态清理标记");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBatchEnabledControllerServices() throws Exception {
|
||||||
|
try {
|
||||||
|
iNifiBaseOperation.batchEnabledControllerServices("4143d803-0196-1000-968f-b06f55b43a3f", "xxxx");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,817 @@
|
||||||
|
package com.hzya.frame;
|
||||||
|
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreateconnections.Component18;
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreateconnections.CreateConnections18;
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreateconnections.Revision18;
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreateconnections.SourceOrDestination18;
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreateoracleapp.CreateAppInstanceJoin;
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreateprocessconnection.CreateProcessorConnections;
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreateprocessorandupdateparam.CreateProcessorAndUpdateParamJoin;
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreparamcontext.CreateParamContextJoin;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller.FindNeedModifyController;
|
||||||
|
import com.hzya.frame.nifiapi.model.joingetcontroller.Component12;
|
||||||
|
import com.hzya.frame.nifiapi.model.joingetcontroller.ControllerService12;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinparametercontexts.*;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinprocessgroups.Component7;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinprocessgroups.ProcessGroupsJoin;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinprocessgroups.Revision5;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinsnippetinstance.SnippetInstanceJoin;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinsnippets.Snippet;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinsnippets.SnippetsJoin;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup.Revision10;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup.StartOrStopProcessGroupsInfoJoin10;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultNeedModifyController.PortFilterResult;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultcreateoracleapp.CreateAppInstanceResult;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultcreateprocessor.*;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultcreateprocessors.CreateProcess16;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultcreatesnippet.Flow15;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultcreatesnippet.ProcessGroups15;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultcreatesnippet.SnippetInstance15;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultprocessgroups.ProcessgroupsResult;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultprocessgroupsinfo.ProcessGroupsInfoResult9;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultprocessgroupsinfo.Revision9;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultsnippets.Snippet13;
|
||||||
|
import com.hzya.frame.nifiapi.model.resultsnippets.SnippetResult13;
|
||||||
|
import com.hzya.frame.nifiapi.operation.INifiAppOperation;
|
||||||
|
import com.hzya.frame.nifiapi.operation.INifiBaseOperation;
|
||||||
|
import com.hzya.frame.nifiapi.service.NifiApiService;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestNifiDbSync
|
||||||
|
* @Date:2025/5/20 17:49
|
||||||
|
* @Filename:TestNifiDbSync
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = {WebappApplication.class})
|
||||||
|
public class TestNifiDbSync {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NifiApiService nifiApiService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private INifiAppOperation nifiOperation;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private INifiBaseOperation iNifiBaseOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试nifi数据同步场景调用
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDbSync2() throws Exception {
|
||||||
|
//创建业务数据流对应的流程组
|
||||||
|
String parentProcessGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||||
|
String processGroupsName = "Oracle19c->Mysql跨数据源同步";
|
||||||
|
String newProcessGroupsId = testCreateProcessGroups(parentProcessGroupId, processGroupsName);
|
||||||
|
|
||||||
|
//新建GenerateFlowFile处理器(开始的处理器)
|
||||||
|
// String generateFlowFileId = testCreateProcessor(newProcessGroupsId);
|
||||||
|
CreateProcessorAndUpdateParamJoin createProcessorAndUpdateParamJoin = new CreateProcessorAndUpdateParamJoin();
|
||||||
|
createProcessorAndUpdateParamJoin.setTargetProcessorId("02d23f3c-7003-1a1b-1cdc-e9f37874bd78");
|
||||||
|
createProcessorAndUpdateParamJoin.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||||
|
createProcessorAndUpdateParamJoin.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||||
|
String generateFlowFileId = nifiOperation.createProcessorAndUpdateParam(createProcessorAndUpdateParamJoin);
|
||||||
|
|
||||||
|
//创建Oracle应用
|
||||||
|
//初始化实例
|
||||||
|
CreateAppInstanceJoin createOracleApp = new CreateAppInstanceJoin();
|
||||||
|
createOracleApp.setAppProcessGroupId("41437b87-0196-1000-6951-50e41e75c0da");
|
||||||
|
createOracleApp.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||||
|
createOracleApp.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||||
|
//上下文
|
||||||
|
CreateParamContextJoin createParamContextJoin = setOracleParamContextJoin();
|
||||||
|
createOracleApp.setCreateParamContextJoin(createParamContextJoin);
|
||||||
|
//控制器
|
||||||
|
// FindNeedModifyController findNeedModifyController = setOracleFindNeedModifyController(newProcessGroupsId);
|
||||||
|
// createOracleApp.setFindNeedModifyController(findNeedModifyController);
|
||||||
|
CreateAppInstanceResult oracleAppContext = nifiOperation.createAppContext(createOracleApp);
|
||||||
|
|
||||||
|
//创建Mysql应用
|
||||||
|
//初始化实例
|
||||||
|
CreateAppInstanceJoin createOracleApp2 = new CreateAppInstanceJoin();
|
||||||
|
createOracleApp2.setAppProcessGroupId("4143d803-0196-1000-968f-b06f55b43a3f");
|
||||||
|
createOracleApp2.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||||
|
createOracleApp2.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||||
|
//上下文
|
||||||
|
CreateParamContextJoin createParamContextJoin2 = setMysqlParamContextJoin(newProcessGroupsId);
|
||||||
|
createOracleApp2.setCreateParamContextJoin(createParamContextJoin2);
|
||||||
|
//控制器
|
||||||
|
// FindNeedModifyController findNeedModifyController2 = setMysqlFindNeedModifyController(newProcessGroupsId);
|
||||||
|
// createOracleApp2.setFindNeedModifyController(findNeedModifyController2);
|
||||||
|
CreateAppInstanceResult mysqlAppContext = nifiOperation.createAppContext(createOracleApp2);
|
||||||
|
|
||||||
|
//新建LogAttribute处理器(结束处理器)
|
||||||
|
// String logAttributeId = testCreateProcessor2();
|
||||||
|
// String logAttributeId = null;
|
||||||
|
CreateProcessorAndUpdateParamJoin createProcessorAndUpdateParamJoin2 = new CreateProcessorAndUpdateParamJoin();
|
||||||
|
createProcessorAndUpdateParamJoin2.setTargetProcessorId("7f70897a-0196-1000-241a-3a7cdf5bf521");
|
||||||
|
createProcessorAndUpdateParamJoin2.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||||
|
createProcessorAndUpdateParamJoin2.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||||
|
String logAttributeId = nifiOperation.createProcessorAndUpdateParam(createProcessorAndUpdateParamJoin2);
|
||||||
|
|
||||||
|
//查找对应应用的连接标记
|
||||||
|
//TYPE=INPUT_PORT
|
||||||
|
PortFilterResult oracleMarkInput = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(oracleAppContext.getNewProcessGroupId(), "f5228bc8-0360-41eb-a640-9f4df953937c");
|
||||||
|
PortFilterResult oracleMarkOutPut = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(oracleAppContext.getNewProcessGroupId(), "4929a9ac-291a-4ea2-a4b1-286ddf47164a");
|
||||||
|
//TYPE=OUTPUT_PORT
|
||||||
|
PortFilterResult mysqlMarkInput = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(mysqlAppContext.getNewProcessGroupId(), "be05a6ad-a440-43ed-b4c0-d1edcf03334f");
|
||||||
|
PortFilterResult mysqlMarkOutput = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(mysqlAppContext.getNewProcessGroupId(), "7ac85368-f2c9-48df-ab5b-ea610449083d");
|
||||||
|
//
|
||||||
|
// PortFilterResult automaticTableCreation = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(mysqlAppContext.getNewProcessGroupId(), "9480f217-9d94-4dcd-ba80-f718cc6e59db");
|
||||||
|
|
||||||
|
//批量创建连接关系
|
||||||
|
//连接关系一:开始处理器->Oracle应用
|
||||||
|
SourceOrDestination18 source = new SourceOrDestination18();
|
||||||
|
source.setId(generateFlowFileId);
|
||||||
|
source.setGroupId(newProcessGroupsId);
|
||||||
|
source.setType("PROCESSOR");
|
||||||
|
|
||||||
|
SourceOrDestination18 destination = new SourceOrDestination18();
|
||||||
|
destination.setId(oracleMarkInput.getInputPorts().get(0).getId());
|
||||||
|
destination.setGroupId(oracleAppContext.getNewProcessGroupId());
|
||||||
|
destination.setType("INPUT_PORT");
|
||||||
|
|
||||||
|
List<String> selectedRelationships = new ArrayList<>();
|
||||||
|
selectedRelationships.add("success");
|
||||||
|
|
||||||
|
Component18 component18 = new Component18();
|
||||||
|
component18.setSource(source);
|
||||||
|
component18.setDestination(destination);
|
||||||
|
component18.setSelectedRelationships(selectedRelationships);
|
||||||
|
|
||||||
|
Revision18 revision18 = new Revision18();
|
||||||
|
revision18.setVersion("0");//默认传递0
|
||||||
|
|
||||||
|
CreateConnections18 createConnections17 = new CreateConnections18();
|
||||||
|
createConnections17.setComponent(component18);
|
||||||
|
createConnections17.setRevision(revision18);
|
||||||
|
|
||||||
|
List<CreateConnections18> createConnections18List = new ArrayList<>();
|
||||||
|
createConnections18List.add(createConnections17);
|
||||||
|
|
||||||
|
//连接关系二:Oracle应用->Mysql应用
|
||||||
|
SourceOrDestination18 source2 = new SourceOrDestination18();
|
||||||
|
source2.setId(oracleMarkOutPut.getOutputPorts().get(0).getId());
|
||||||
|
source2.setGroupId(oracleAppContext.getNewProcessGroupId());
|
||||||
|
source2.setType("OUTPUT_PORT");
|
||||||
|
|
||||||
|
SourceOrDestination18 destination2 = new SourceOrDestination18();
|
||||||
|
destination2.setId(mysqlMarkInput.getInputPorts().get(0).getId());
|
||||||
|
destination2.setGroupId(mysqlAppContext.getNewProcessGroupId());
|
||||||
|
destination2.setType("INPUT_PORT");
|
||||||
|
|
||||||
|
// List<String> selectedRelationships2 = new ArrayList<>();
|
||||||
|
// selectedRelationships2.add("success");
|
||||||
|
|
||||||
|
Component18 component182 = new Component18();
|
||||||
|
component182.setSource(source2);
|
||||||
|
component182.setDestination(destination2);
|
||||||
|
// component182.setSelectedRelationships(selectedRelationships2);
|
||||||
|
|
||||||
|
Revision18 revision182 = new Revision18();
|
||||||
|
revision182.setVersion("0");//默认传递0
|
||||||
|
|
||||||
|
CreateConnections18 createConnections172 = new CreateConnections18();
|
||||||
|
createConnections172.setComponent(component182);
|
||||||
|
createConnections172.setRevision(revision182);
|
||||||
|
createConnections18List.add(createConnections172);
|
||||||
|
|
||||||
|
//连接关系三:Mysql应用->结束处理器
|
||||||
|
SourceOrDestination18 source3 = new SourceOrDestination18();
|
||||||
|
source3.setId(mysqlMarkOutput.getOutputPorts().get(0).getId());
|
||||||
|
source3.setGroupId(mysqlAppContext.getNewProcessGroupId());
|
||||||
|
source3.setType("OUTPUT_PORT");
|
||||||
|
|
||||||
|
SourceOrDestination18 destination3 = new SourceOrDestination18();
|
||||||
|
destination3.setId(logAttributeId);
|
||||||
|
destination3.setGroupId(newProcessGroupsId);
|
||||||
|
destination3.setType("PROCESSOR");
|
||||||
|
|
||||||
|
// List<String> selectedRelationships3 = new ArrayList<>();
|
||||||
|
// selectedRelationships3.add("success");
|
||||||
|
|
||||||
|
Component18 component183 = new Component18();
|
||||||
|
component183.setSource(source3);
|
||||||
|
component183.setDestination(destination3);
|
||||||
|
// component183.setSelectedRelationships(selectedRelationships3);
|
||||||
|
|
||||||
|
Revision18 revision183 = new Revision18();
|
||||||
|
revision183.setVersion("0");//默认传递0
|
||||||
|
|
||||||
|
CreateConnections18 createConnections173 = new CreateConnections18();
|
||||||
|
createConnections173.setComponent(component183);
|
||||||
|
createConnections173.setRevision(revision183);
|
||||||
|
createConnections18List.add(createConnections173);
|
||||||
|
|
||||||
|
//连接关系四:如果存在自动建表,则需要从开始节点-连接到Mysql应用的"自动建表"的输入端口
|
||||||
|
List<String> selectedRelationships2 = new ArrayList<>();
|
||||||
|
selectedRelationships2.add("success");
|
||||||
|
|
||||||
|
SourceOrDestination18 source4 = new SourceOrDestination18();
|
||||||
|
source4.setId(generateFlowFileId);
|
||||||
|
source4.setGroupId(newProcessGroupsId);
|
||||||
|
source4.setType("PROCESSOR");
|
||||||
|
|
||||||
|
// SourceOrDestination18 destination4 = new SourceOrDestination18();
|
||||||
|
// destination4.setId(automaticTableCreation.getInputPorts().get(0).getId());
|
||||||
|
// destination4.setGroupId(mysqlAppContext.getNewProcessGroupId());
|
||||||
|
// destination4.setType("INPUT_PORT");
|
||||||
|
|
||||||
|
// Component18 component184 = new Component18();
|
||||||
|
// component184.setSource(source4);
|
||||||
|
// component184.setDestination(destination4);
|
||||||
|
// component184.setSelectedRelationships(selectedRelationships2);
|
||||||
|
|
||||||
|
// Revision18 revision184 = new Revision18();
|
||||||
|
// revision184.setVersion("0");//默认传递0
|
||||||
|
|
||||||
|
// CreateConnections18 createConnections174 = new CreateConnections18();
|
||||||
|
// createConnections174.setComponent(component184);
|
||||||
|
// createConnections174.setRevision(revision184);
|
||||||
|
// createConnections18List.add(createConnections174);
|
||||||
|
|
||||||
|
CreateProcessorConnections createProcessorConnections = new CreateProcessorConnections();
|
||||||
|
createProcessorConnections.setProcessGroupsId(newProcessGroupsId);
|
||||||
|
createProcessorConnections.setCreateConnections18(createConnections18List);
|
||||||
|
iNifiBaseOperation.batchCreateProcessorConnections(createProcessorConnections);
|
||||||
|
|
||||||
|
//去掉流程组内对应的处理器旧状态
|
||||||
|
// List<String> stringList = new ArrayList<>();
|
||||||
|
// stringList.add(oracleAppContext.getNewProcessGroupId());
|
||||||
|
// stringList.add(mysqlAppContext.getNewProcessGroupId());
|
||||||
|
// iNifiBaseOperation.clearProcessGroupState(stringList);
|
||||||
|
|
||||||
|
//启动业务处理器
|
||||||
|
ProcessGroupsInfoResult9 processGroups = nifiApiService.getProcessGroups(newProcessGroupsId);
|
||||||
|
Revision9 revision = processGroups.getRevision();
|
||||||
|
|
||||||
|
Revision10 revision10 = new Revision10();
|
||||||
|
revision10.setVersion(revision.getVersion());
|
||||||
|
|
||||||
|
StartOrStopProcessGroupsInfoJoin10 startOrStopProcessGroupsInfoJoin10 = new StartOrStopProcessGroupsInfoJoin10();
|
||||||
|
startOrStopProcessGroupsInfoJoin10.setId(processGroups.getId());
|
||||||
|
startOrStopProcessGroupsInfoJoin10.setState("RUNNING");
|
||||||
|
startOrStopProcessGroupsInfoJoin10.setRevision(revision10);
|
||||||
|
ProcessGroupsInfoResult9 processGroupsInfoResult9 = nifiApiService.startOrStopProcessGroups(startOrStopProcessGroupsInfoJoin10);
|
||||||
|
System.out.println("流程组id:" + processGroupsInfoResult9.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public CreateParamContextJoin setOracleParamContextJoin() throws Exception {
|
||||||
|
Revision revision = new Revision();
|
||||||
|
revision.setVersion(0);
|
||||||
|
|
||||||
|
Parameter2 parameter = new Parameter2();
|
||||||
|
parameter.setSensitive(false);
|
||||||
|
parameter.setName("additionalWhereClause");
|
||||||
|
parameter.setValue("1=1");
|
||||||
|
parameter.setDescription("where条件");
|
||||||
|
|
||||||
|
Parameter2 parameter2 = new Parameter2();
|
||||||
|
parameter2.setSensitive(false);
|
||||||
|
parameter2.setName("columnsToReturn");
|
||||||
|
parameter2.setValue("csaleid,vreceiptcode,ts");
|
||||||
|
parameter2.setDescription("需要查询的表字段");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数描述
|
||||||
|
* 注意,如果传递了排序参数,不能仅按ts时间排序,需要加上主键,ts时间存在重复,排序时存在随机性,会导致数据重复!
|
||||||
|
*
|
||||||
|
* 下面两个sql经过验证会导致部分数据重复
|
||||||
|
* sql1:SELECT PK_SYSINIT, TS FROM U8C241231.PUB_SYSINIT WHERE ( 1 = 1 ) AND ts <= '2025-05-16 15:56:25' ORDER BY ts FETCH NEXT 10000 ROWS ONLY
|
||||||
|
* sql2:SELECT PK_SYSINIT, TS FROM U8C241231.PUB_SYSINIT WHERE ( 1 = 1 ) AND ts <= '2025-05-16 15:56:25' ORDER BY ts OFFSET 10000 ROWS FETCH NEXT 10000 ROWS ONLY
|
||||||
|
*
|
||||||
|
* ORDER BY ts 仅按 ts 排序,但 ts 有重复值(如多行 ts = '2024-08-12 11:52:23')。数据库无法确定这些行的相对顺序,可能在不同子查询中产生不同排列,导致 0001A110... 被重复选中,OFFSET 和 FETCH 依赖排序,如果排序不稳定,分页范围可能错误地包含同一行
|
||||||
|
*
|
||||||
|
* 解决办法是,ts+主键排序,这样比较稳定
|
||||||
|
*/
|
||||||
|
Parameter2 parameter3 = new Parameter2();
|
||||||
|
parameter3.setSensitive(false);
|
||||||
|
parameter3.setName("customOrderByColumn");
|
||||||
|
parameter3.setValue("ts,csaleid asc");
|
||||||
|
parameter3.setDescription("排序规则,如果有增量同步需求,一定要通过时间+主键");
|
||||||
|
|
||||||
|
Parameter2 parameter4 = new Parameter2();
|
||||||
|
parameter4.setSensitive(false);
|
||||||
|
parameter4.setName("maximumValueColumns");
|
||||||
|
parameter4.setValue("ts");
|
||||||
|
parameter4.setDescription("分片字段");
|
||||||
|
|
||||||
|
Parameter2 parameter5 = new Parameter2();
|
||||||
|
parameter5.setSensitive(false);
|
||||||
|
parameter5.setName("sourceTbName");
|
||||||
|
parameter5.setValue("U8C241231.SO_SALE");
|
||||||
|
parameter5.setDescription("查询表名称");
|
||||||
|
|
||||||
|
Parameters2 parameters = new Parameters2();
|
||||||
|
parameters.setParameter(parameter);
|
||||||
|
|
||||||
|
Parameters2 parameters2 = new Parameters2();
|
||||||
|
parameters2.setParameter(parameter2);
|
||||||
|
|
||||||
|
Parameters2 parameters3 = new Parameters2();
|
||||||
|
parameters3.setParameter(parameter3);
|
||||||
|
|
||||||
|
Parameters2 parameters4 = new Parameters2();
|
||||||
|
parameters4.setParameter(parameter4);
|
||||||
|
|
||||||
|
Parameters2 parameters5 = new Parameters2();
|
||||||
|
parameters5.setParameter(parameter5);
|
||||||
|
|
||||||
|
List<Parameters2> parametersList = new ArrayList<>();
|
||||||
|
parametersList.add(parameters);
|
||||||
|
parametersList.add(parameters2);
|
||||||
|
parametersList.add(parameters3);
|
||||||
|
parametersList.add(parameters4);
|
||||||
|
parametersList.add(parameters5);
|
||||||
|
|
||||||
|
Component3 component = new Component3();
|
||||||
|
component.setName("oracle参数环境" + createParamTime());
|
||||||
|
component.setParameters(parametersList);
|
||||||
|
|
||||||
|
ParameterContextsJoin parameterContextsJoin = new ParameterContextsJoin();
|
||||||
|
parameterContextsJoin.setComponent(component);
|
||||||
|
parameterContextsJoin.setRevision(revision);
|
||||||
|
|
||||||
|
CreateParamContextJoin createParamContextJoin = new CreateParamContextJoin();
|
||||||
|
createParamContextJoin.setParameterContextsJoin(parameterContextsJoin);
|
||||||
|
// createParamContextJoin.setProcessGroupsId(processGroupsId);
|
||||||
|
return createParamContextJoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String createParamTime() {
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMMddHHmm");
|
||||||
|
String formattedTime = now.format(formatter);
|
||||||
|
return formattedTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateParamContextJoin setMysqlParamContextJoin(String processGroupsId) throws Exception {
|
||||||
|
Revision revision = new Revision();
|
||||||
|
revision.setVersion(0);
|
||||||
|
|
||||||
|
// Parameter2 parameter = new Parameter2();
|
||||||
|
// parameter.setSensitive(false);
|
||||||
|
// parameter.setName("Release Signal Identifier");
|
||||||
|
// parameter.setValue("table_creation");
|
||||||
|
// parameter.setDescription("参数描述");
|
||||||
|
|
||||||
|
// Parameter2 parameter2 = new Parameter2();
|
||||||
|
// parameter2.setSensitive(false);
|
||||||
|
// parameter2.setName("autoTableCreation");
|
||||||
|
// parameter2.setValue("Y");
|
||||||
|
// parameter2.setDescription("是否自动建表");
|
||||||
|
|
||||||
|
// Parameter2 parameter3 = new Parameter2();
|
||||||
|
// parameter3.setSensitive(false);
|
||||||
|
// parameter3.setName("mappingRelationship");
|
||||||
|
// parameter3.setValue("[\n" + " {\n" + " \"targetTbName\": \"iep_so_sale\",\n" + " \"targetDBType\": \"mysql8.0.44\",\n" + " \"writeType\": \"1\",\n" + " \"fieldRelationship\": [\n" + " {\n" + " \"sourceFieldName\": \"csaleid\",\n" + " \"sourceFieldType\": \"varchar2(30)\",\n" + " \"targetFieldName\": \"csaleid\",\n" + " \"targetFieldType\": \"varchar(100)\",\n" + " \"targetFieldNameNotes\": \"主键\",\n" + " \"primaryKey\": \"Y\"\n" + " },\n" + " {\n" + " \"sourceFieldName\": \"vreceiptcode\",\n" + " \"sourceFieldType\": \"varchar2(30)\",\n" + " \"targetFieldName\": \"vreceiptcode\",\n" + " \"targetFieldType\": \"varchar(100)\",\n" + " \"targetFieldNameNotes\": \"编码\"\n" + " },\n" + " {\n" + " \"sourceFieldName\": \"ts\",\n" + " \"sourceFieldType\": \"varchar2(30)\",\n" + " \"targetFieldName\": \"ts\",\n" + " \"targetFieldType\": \"varchar(100)\",\n" + " \"targetFieldNameNotes\": \"更新时间\"\n" + " }\n" + " ]\n" + " }\n" + "]");
|
||||||
|
// parameter3.setDescription("字段映射关系");
|
||||||
|
|
||||||
|
Parameter2 parameter3 = new Parameter2();
|
||||||
|
parameter3.setSensitive(false);
|
||||||
|
parameter3.setName("autoTableCreation");
|
||||||
|
parameter3.setValue("Y");
|
||||||
|
parameter3.setDescription("");
|
||||||
|
|
||||||
|
Parameter2 parameter4 = new Parameter2();
|
||||||
|
parameter4.setSensitive(false);
|
||||||
|
parameter4.setName("joltSpec");
|
||||||
|
parameter4.setValue("[\n" +
|
||||||
|
" {\n" +
|
||||||
|
" \"operation\": \"shift\",\n" +
|
||||||
|
" \"spec\": {\n" +
|
||||||
|
" \"A\": \"B\",\n" +
|
||||||
|
" \"*\": \"&\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
" }\n" +
|
||||||
|
"]");
|
||||||
|
parameter4.setDescription("");
|
||||||
|
|
||||||
|
Parameter2 parameter5 = new Parameter2();
|
||||||
|
parameter5.setSensitive(false);
|
||||||
|
parameter5.setName("jsonPrimaryKeyTag");
|
||||||
|
parameter5.setValue("[\"details_id\",\"header_id\",\"CSALEID\"]");
|
||||||
|
parameter5.setDescription("");
|
||||||
|
|
||||||
|
Parameter2 parameter6 = new Parameter2();
|
||||||
|
parameter6.setSensitive(false);
|
||||||
|
parameter6.setName("targetInsertTableName");
|
||||||
|
parameter6.setValue("iep_so_sale");
|
||||||
|
parameter6.setDescription("");
|
||||||
|
|
||||||
|
// Parameter2 parameter4 = new Parameter2();
|
||||||
|
// parameter4.setSensitive(false);
|
||||||
|
// parameter4.setName("releaseSignalIdentifier");
|
||||||
|
// parameter4.setValue(UUID.randomUUID().toString());
|
||||||
|
// parameter4.setDescription("建表信号,传随机值!");
|
||||||
|
|
||||||
|
// Parameter2 parameter4 = new Parameter2();
|
||||||
|
// parameter4.setSensitive(false);
|
||||||
|
// parameter4.setName("maximumValueColumns");
|
||||||
|
// parameter4.setValue("ts");
|
||||||
|
// parameter4.setDescription("参数描述");
|
||||||
|
|
||||||
|
// Parameter2 parameter5 = new Parameter2();
|
||||||
|
// parameter5.setSensitive(false);
|
||||||
|
// parameter5.setName("sourceTbName");
|
||||||
|
// parameter5.setValue("U8C241231.SO_SALE");
|
||||||
|
// parameter5.setDescription("参数描述");
|
||||||
|
|
||||||
|
// Parameters2 parameters = new Parameters2();
|
||||||
|
// parameters.setParameter(parameter4);
|
||||||
|
|
||||||
|
// Parameters2 parameters2 = new Parameters2();
|
||||||
|
// parameters2.setParameter(parameter2);
|
||||||
|
|
||||||
|
Parameters2 parameters3 = new Parameters2();
|
||||||
|
parameters3.setParameter(parameter3);
|
||||||
|
|
||||||
|
Parameters2 parameters4 = new Parameters2();
|
||||||
|
parameters4.setParameter(parameter4);
|
||||||
|
|
||||||
|
Parameters2 parameters5 = new Parameters2();
|
||||||
|
parameters5.setParameter(parameter5);
|
||||||
|
|
||||||
|
Parameters2 parameters6 = new Parameters2();
|
||||||
|
parameters6.setParameter(parameter6);
|
||||||
|
|
||||||
|
// Parameters2 parameters4 = new Parameters2();
|
||||||
|
// parameters4.setParameter(parameter4);
|
||||||
|
|
||||||
|
// Parameters2 parameters5 = new Parameters2();
|
||||||
|
// parameters5.setParameter(parameter5);
|
||||||
|
|
||||||
|
List<Parameters2> parametersList = new ArrayList<>();
|
||||||
|
// parametersList.add(parameters);
|
||||||
|
// parametersList.add(parameters2);
|
||||||
|
parametersList.add(parameters3);
|
||||||
|
parametersList.add(parameters4);
|
||||||
|
parametersList.add(parameters5);
|
||||||
|
parametersList.add(parameters6);
|
||||||
|
// parametersList.add(parameters4);
|
||||||
|
// parametersList.add(parameters5);
|
||||||
|
|
||||||
|
Component3 component = new Component3();
|
||||||
|
component.setName("mysql参数环境" + createParamTime());
|
||||||
|
component.setParameters(parametersList);
|
||||||
|
|
||||||
|
ParameterContextsJoin parameterContextsJoin = new ParameterContextsJoin();
|
||||||
|
parameterContextsJoin.setComponent(component);
|
||||||
|
parameterContextsJoin.setRevision(revision);
|
||||||
|
|
||||||
|
CreateParamContextJoin createParamContextJoin = new CreateParamContextJoin();
|
||||||
|
createParamContextJoin.setParameterContextsJoin(parameterContextsJoin);
|
||||||
|
createParamContextJoin.setProcessGroupsId(processGroupsId);
|
||||||
|
return createParamContextJoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制器参数-oracle
|
||||||
|
*/
|
||||||
|
private FindNeedModifyController setOracleFindNeedModifyController(String processGroupId) {
|
||||||
|
//创建Mysql数据源
|
||||||
|
Map<String, String> properties = new HashMap<>();
|
||||||
|
properties.put("Database Connection URL", "jdbc:oracle:thin:@39.170.109.90:1521:orcl");
|
||||||
|
properties.put("Database Driver Class Name", "oracle.jdbc.OracleDriver");
|
||||||
|
properties.put("database-driver-locations", "/data/nifi-1.28.1/lib/ojdbc8.jar");
|
||||||
|
properties.put("Database User", "U8C241231");
|
||||||
|
properties.put("Password", "U8C241231");
|
||||||
|
properties.put("Max Wait Time", "600001 millis");
|
||||||
|
properties.put("Max Total Connections", "20");
|
||||||
|
properties.put("Validation-query", "select 1 from dual");
|
||||||
|
properties.put("dbcp-min-idle-conns", "5");
|
||||||
|
properties.put("dbcp-max-idle-conns", "10");
|
||||||
|
properties.put("dbcp-max-conn-lifetime", "-1");
|
||||||
|
properties.put("dbcp-time-between-eviction-runs", "-1");
|
||||||
|
properties.put("dbcp-min-evictable-idle-time", "30 mins");
|
||||||
|
properties.put("dbcp-soft-min-evictable-idle-time", "-1");
|
||||||
|
|
||||||
|
Component12 component12 = new Component12();
|
||||||
|
component12.setName("Oracle数据源");
|
||||||
|
component12.setType("org.apache.nifi.dbcp.DBCPConnectionPool");
|
||||||
|
//传这个值并没有用
|
||||||
|
// component12.setState("ENABLED");
|
||||||
|
component12.setProperties(properties);
|
||||||
|
component12.setComments("Oracle数据源备注");
|
||||||
|
component12.setBulletinLevel("DEBUG");
|
||||||
|
// component12.setId();//需要修改的控制器id
|
||||||
|
|
||||||
|
ControllerService12 controllerService11 = new ControllerService12();
|
||||||
|
controllerService11.setComponent(component12);
|
||||||
|
controllerService11.setModifyMarkId("vuBXdbEu7v");
|
||||||
|
// controllerService11.setId();//需要修改的控制器id
|
||||||
|
|
||||||
|
List<ControllerService12> controllerService12List = new ArrayList<>();
|
||||||
|
controllerService12List.add(controllerService11);
|
||||||
|
|
||||||
|
FindNeedModifyController findNeedModifyController = new FindNeedModifyController();
|
||||||
|
findNeedModifyController.setNeedModifyController(controllerService12List);
|
||||||
|
findNeedModifyController.setProcessGroupId(processGroupId);
|
||||||
|
return findNeedModifyController;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制器参数-oracle
|
||||||
|
*/
|
||||||
|
private FindNeedModifyController setMysqlFindNeedModifyController(String processGroupId) {
|
||||||
|
//创建Mysql数据源
|
||||||
|
Map<String, String> properties = new HashMap<>();
|
||||||
|
properties.put("Database Connection URL", "jdbc:mysql://ufidahz.com.cn:9015/apache_nifi_sync?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8&useLegacyDatetimeCode=false");
|
||||||
|
properties.put("Database Driver Class Name", "com.mysql.cj.jdbc.Driver");
|
||||||
|
properties.put("database-driver-locations", "/data/nifi-1.28.1/lib/mysql-connector-java-8.0.30.jar");
|
||||||
|
properties.put("Database User", "root");
|
||||||
|
properties.put("Password", "hzya1314");
|
||||||
|
properties.put("Max Wait Time", "600001 millis");
|
||||||
|
properties.put("Max Total Connections", "15");
|
||||||
|
properties.put("Validation-query", "select 1");
|
||||||
|
properties.put("dbcp-min-idle-conns", "5");
|
||||||
|
properties.put("dbcp-max-idle-conns", "10");
|
||||||
|
properties.put("dbcp-max-conn-lifetime", "-1");
|
||||||
|
properties.put("dbcp-time-between-eviction-runs", "-1");
|
||||||
|
properties.put("dbcp-min-evictable-idle-time", "30 mins");
|
||||||
|
properties.put("dbcp-soft-min-evictable-idle-time", "-1");
|
||||||
|
|
||||||
|
Component12 component12 = new Component12();
|
||||||
|
component12.setName("Mysql数据源");
|
||||||
|
component12.setType("org.apache.nifi.dbcp.DBCPConnectionPool");
|
||||||
|
//传这个值并没有用
|
||||||
|
// component12.setState("ENABLED");
|
||||||
|
component12.setProperties(properties);
|
||||||
|
component12.setComments("Mysql数据源备注");
|
||||||
|
component12.setBulletinLevel("DEBUG");
|
||||||
|
// component12.setId();//需要修改的控制器id
|
||||||
|
|
||||||
|
ControllerService12 controllerService11 = new ControllerService12();
|
||||||
|
controllerService11.setComponent(component12);
|
||||||
|
controllerService11.setModifyMarkId("CZFJwnb9sb");
|
||||||
|
// controllerService11.setId();//需要修改的控制器id
|
||||||
|
|
||||||
|
List<ControllerService12> controllerService12List = new ArrayList<>();
|
||||||
|
controllerService12List.add(controllerService11);
|
||||||
|
|
||||||
|
FindNeedModifyController findNeedModifyController = new FindNeedModifyController();
|
||||||
|
findNeedModifyController.setNeedModifyController(controllerService12List);
|
||||||
|
findNeedModifyController.setProcessGroupId(processGroupId);
|
||||||
|
return findNeedModifyController;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试nifi数据同步场景调用
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDbSync() throws Exception {
|
||||||
|
//新建「开始」处理器
|
||||||
|
String parentProcessGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||||
|
String processGroupsName = "跨数据源同步";
|
||||||
|
String processGroupsId = testCreateProcessGroups(parentProcessGroupId, processGroupsName);
|
||||||
|
|
||||||
|
//新建GenerateFlowFile处理器(最开始的处理器)
|
||||||
|
String generateFlowFileId = testCreateProcessor(processGroupsId);
|
||||||
|
|
||||||
|
//拷贝Oracle应用,并实例化到新建的流程组
|
||||||
|
// String processGroupId = "41437b87-0196-1000-6951-50e41e75c0da";
|
||||||
|
// String parentProcessGroupId = "76e23100-ad84-1aab-4447-b9ee936ee7d5";
|
||||||
|
String oracleSnippetId = testCreateSnippets("41437b87-0196-1000-6951-50e41e75c0da", "76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||||
|
String oracleProcessGroupId = testCreateSnippetInstance(processGroupsId, parentProcessGroupId, oracleSnippetId);
|
||||||
|
|
||||||
|
//拷贝Mysql应用,并实例化到新建的流程组
|
||||||
|
// String processGroupId2 = "4143d803-0196-1000-968f-b06f55b43a3f";
|
||||||
|
// String parentProcessGroupId2 = "76e23100-ad84-1aab-4447-b9ee936ee7d5";
|
||||||
|
String mysqlSnippetId = testCreateSnippets("4143d803-0196-1000-968f-b06f55b43a3f", "76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||||
|
String mysqlProcessGroupId = testCreateSnippetInstance(processGroupsId, parentProcessGroupId, mysqlSnippetId);
|
||||||
|
|
||||||
|
//新建LogAttribute处理器(结束处理器)
|
||||||
|
// String logAttributeId = testCreateProcessor2();
|
||||||
|
String logAttributeId = null;
|
||||||
|
|
||||||
|
//修改Oracle应用数据源
|
||||||
|
//修改Oracle应用上下文环境
|
||||||
|
//修改mysql应用数据源
|
||||||
|
//修改mysql应用上下文环境
|
||||||
|
//启动Mysql应用对应的控制器服务
|
||||||
|
//启动Oracle应用对应的控制器服务
|
||||||
|
//创建连接关系
|
||||||
|
//启动处理器
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建空的流程组
|
||||||
|
*
|
||||||
|
* @param parentProcessGroupId 需要新建的目标流程组的父流程组id
|
||||||
|
* @param name 目标流程组名称
|
||||||
|
*/
|
||||||
|
public String testCreateProcessGroups(String parentProcessGroupId, String name) throws Exception {
|
||||||
|
String processGroupsId = "";
|
||||||
|
try {
|
||||||
|
Revision5 revision5 = new Revision5();
|
||||||
|
revision5.setVersion(0);
|
||||||
|
|
||||||
|
Component7 component7 = new Component7();
|
||||||
|
component7.setName(name);
|
||||||
|
|
||||||
|
ProcessGroupsJoin processGroupsJoin = new ProcessGroupsJoin();
|
||||||
|
processGroupsJoin.setRevision(revision5);
|
||||||
|
processGroupsJoin.setComponent(component7);
|
||||||
|
|
||||||
|
//父处理器组
|
||||||
|
// String parentGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||||
|
ProcessgroupsResult processGroups = nifiApiService.createProcessGroups(parentProcessGroupId, processGroupsJoin);
|
||||||
|
processGroupsId = processGroups.getId();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return processGroupsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建GenerateFlowFile处理器
|
||||||
|
*/
|
||||||
|
public String testCreateProcessor(String groupId) {
|
||||||
|
String processId = null;
|
||||||
|
try {
|
||||||
|
Revision15 revision15 = new Revision15();
|
||||||
|
revision15.setVersion("0");
|
||||||
|
|
||||||
|
Component15 component15 = new Component15();
|
||||||
|
component15.setType("org.apache.nifi.processors.standard.GenerateFlowFile");
|
||||||
|
component15.setName("定时调度");
|
||||||
|
|
||||||
|
// Position15 position15 = new Position15();
|
||||||
|
// position15.setX("0");
|
||||||
|
// position15.setY("0");
|
||||||
|
|
||||||
|
Config15 config15 = new Config15();
|
||||||
|
config15.setSchedulingPeriod("1 min");
|
||||||
|
|
||||||
|
Properties15 properties15 = new Properties15();
|
||||||
|
properties15.setFileSize("1KB");
|
||||||
|
|
||||||
|
config15.setProperties(properties15);
|
||||||
|
|
||||||
|
component15.setConfig(config15);
|
||||||
|
|
||||||
|
CreateProcessorJoin15 createProcessorJoin15 = new CreateProcessorJoin15();
|
||||||
|
createProcessorJoin15.setComponent(component15);
|
||||||
|
createProcessorJoin15.setRevision(revision15);
|
||||||
|
|
||||||
|
// String groupId = "019610d1-f933-1f70-16ea-3cf005012c4b";
|
||||||
|
CreateProcess16 processor = nifiApiService.createProcessor(groupId, createProcessorJoin15);
|
||||||
|
processId = processor.getId();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return processId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为指定流程组创建片段
|
||||||
|
*
|
||||||
|
* @param targetCopyProcessGroupId 需要复制的目标流程组id
|
||||||
|
* @param parentProcessGroupId 目标流程组的父流程组id
|
||||||
|
*/
|
||||||
|
public String testCreateSnippets(String targetCopyProcessGroupId, String parentProcessGroupId) {
|
||||||
|
String snippetId = null;
|
||||||
|
try {
|
||||||
|
//查询目标流程组版本
|
||||||
|
ProcessGroupsInfoResult9 processGroups = nifiApiService.getProcessGroups(targetCopyProcessGroupId);
|
||||||
|
Revision9 revision = processGroups.getRevision();
|
||||||
|
|
||||||
|
Map<String, String> processGroupsMap2 = new HashMap<>();
|
||||||
|
processGroupsMap2.put("version", revision.getVersion());//目标流程组版本号
|
||||||
|
|
||||||
|
Map<String, Map<String, String>> processGroupsMap = new HashMap<>();
|
||||||
|
processGroupsMap.put(targetCopyProcessGroupId, processGroupsMap2);//目标流程组id
|
||||||
|
|
||||||
|
Snippet snippet = new Snippet();
|
||||||
|
snippet.setParentGroupId(parentProcessGroupId);//目标流程组id的父流程组id
|
||||||
|
snippet.setProcessGroups(processGroupsMap);
|
||||||
|
|
||||||
|
SnippetsJoin snippetsJoin = new SnippetsJoin();
|
||||||
|
snippetsJoin.setSnippet(snippet);
|
||||||
|
SnippetResult13 snippets = nifiApiService.createSnippets(snippetsJoin);
|
||||||
|
Snippet13 snippet1 = snippets.getSnippet();
|
||||||
|
snippetId = snippet1.getId();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return snippetId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建LogAttribute处理器
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testCreateProcessor2() throws Exception {
|
||||||
|
// String processorId = null;
|
||||||
|
try {
|
||||||
|
Revision15 revision15 = new Revision15();
|
||||||
|
revision15.setVersion("0");
|
||||||
|
|
||||||
|
Component15 component15 = new Component15();
|
||||||
|
component15.setType("org.apache.nifi.processors.standard.LogAttribute");
|
||||||
|
component15.setName("结束节点");
|
||||||
|
|
||||||
|
// Position15 position15 = new Position15();
|
||||||
|
// position15.setX("0");
|
||||||
|
// position15.setY("0");
|
||||||
|
|
||||||
|
Properties15 properties15 = new Properties15();
|
||||||
|
properties15.setLogLevel("info");
|
||||||
|
properties15.setLogPayload("false");
|
||||||
|
properties15.setAttributesToLogRegex(".*");
|
||||||
|
properties15.setLogFlowFileProperties("true");
|
||||||
|
properties15.setOutputFormat("Line per Attribute");
|
||||||
|
properties15.setCharacterSet("UTF-8");
|
||||||
|
|
||||||
|
Config15 config15 = new Config15();
|
||||||
|
config15.setProperties(properties15);
|
||||||
|
config15.setBulletinLevel("DEBUG");
|
||||||
|
|
||||||
|
component15.setConfig(config15);
|
||||||
|
// component15.setPosition(position15);
|
||||||
|
|
||||||
|
//定义连接关系
|
||||||
|
Relationships15 relationships15 = new Relationships15();
|
||||||
|
relationships15.setName("success");
|
||||||
|
relationships15.setAutoTerminate(true);
|
||||||
|
// relationships15.setRetry(true);
|
||||||
|
// relationships15.setDescription("123");
|
||||||
|
List<Relationships15> relationships15List = new ArrayList<>();
|
||||||
|
relationships15List.add(relationships15);
|
||||||
|
component15.setRelationships(relationships15List);
|
||||||
|
|
||||||
|
CreateProcessorJoin15 createProcessorJoin15 = new CreateProcessorJoin15();
|
||||||
|
createProcessorJoin15.setComponent(component15);
|
||||||
|
createProcessorJoin15.setRevision(revision15);
|
||||||
|
|
||||||
|
String groupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||||
|
CreateProcess16 processor = nifiApiService.createProcessor(groupId, createProcessorJoin15);
|
||||||
|
// System.out.println("处理器id:" + processor.getId());
|
||||||
|
// processorId = processor.getId();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// return processorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将片段实例到指定位置
|
||||||
|
*
|
||||||
|
* @param groupId 目标流程组id(需要拷贝到哪个流程组)
|
||||||
|
* @param parentGroupId 目标流程组的父流程组id()
|
||||||
|
* @param snippetId 片段id
|
||||||
|
*/
|
||||||
|
public String testCreateSnippetInstance(String groupId, String parentGroupId, String snippetId) throws Exception {
|
||||||
|
String processGroupId = null;
|
||||||
|
try {
|
||||||
|
//先请求得到代码片段id
|
||||||
|
ProcessGroupsInfoResult9 processGroups = nifiApiService.getProcessGroups(groupId);
|
||||||
|
Revision9 revision = processGroups.getRevision();
|
||||||
|
|
||||||
|
Map<String, String> processGroupsMap2 = new HashMap<>();
|
||||||
|
processGroupsMap2.put("version", revision.getVersion());//目标流程组版本号
|
||||||
|
|
||||||
|
Map<String, Map<String, String>> processGroupsMap = new HashMap<>();
|
||||||
|
processGroupsMap.put(groupId, processGroupsMap2);//目标流程组id
|
||||||
|
|
||||||
|
// Snippet snippet = new Snippet();
|
||||||
|
// snippet.setParentGroupId(parentGroupId);//目标流程组id的父流程组id
|
||||||
|
// snippet.setProcessGroups(processGroupsMap);
|
||||||
|
|
||||||
|
// SnippetsJoin snippetsJoin = new SnippetsJoin();
|
||||||
|
// snippetsJoin.setSnippet(snippet);
|
||||||
|
// SnippetResult13 snippets = nifiApiService.createSnippets(snippetsJoin);
|
||||||
|
// Snippet13 snippet1 = snippets.getSnippet();
|
||||||
|
// System.out.println(snippet1.getId());
|
||||||
|
|
||||||
|
//将片段实例化到指定位置
|
||||||
|
// String groupId = "019610d1-f933-1f70-16ea-3cf005012c4b";//流程组id
|
||||||
|
SnippetInstanceJoin snippetInstanceJoin = new SnippetInstanceJoin();
|
||||||
|
snippetInstanceJoin.setSnippetId(snippetId);
|
||||||
|
// snippetInstanceJoin.setOriginY("0");
|
||||||
|
// snippetInstanceJoin.setOriginX("0");
|
||||||
|
SnippetInstance15 snippetInstance = nifiApiService.createSnippetInstance(groupId, snippetInstanceJoin);
|
||||||
|
Flow15 flow = snippetInstance.getFlow();
|
||||||
|
ProcessGroups15 processGroups15 = flow.getProcessGroups().get(0);
|
||||||
|
// System.out.println(processGroups15.getId());
|
||||||
|
processGroupId = processGroups15.getId();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return processGroupId;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.hzya.frame;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.hzya.frame.nifilog.dao.ILoggingEvent20250430Dao;
|
||||||
|
import com.hzya.frame.nifilog.entity.LoggingEvent20250430Entity;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestNifiLog
|
||||||
|
* @Date:2025/5/20 11:53
|
||||||
|
* @Filename:TestNifiLog
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = {WebappApplication.class})
|
||||||
|
public class TestNifiLog {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ILoggingEvent20250430Dao iLoggingEvent20250430Dao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取nifi token
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void getAccessToken() {
|
||||||
|
try {
|
||||||
|
// PageAttribute<LoggingEvent20250430Entity> loggingEvent20250430EntityPageAttribute = iLoggingEvent20250430Dao.queryPaged();
|
||||||
|
|
||||||
|
List<String> arg0List = new ArrayList<>();
|
||||||
|
arg0List.add("UpdateAttribute[id=ad841aed-30f7-16e2-4fa0-595ab0ab9fdc]");
|
||||||
|
|
||||||
|
List<String> logDateList = new ArrayList<>();
|
||||||
|
logDateList.add("20250519");
|
||||||
|
logDateList.add("20250520");
|
||||||
|
|
||||||
|
LoggingEvent20250430Entity loggingEvent20250430Entity = new LoggingEvent20250430Entity();
|
||||||
|
loggingEvent20250430Entity.setArg0List(arg0List);
|
||||||
|
loggingEvent20250430Entity.setLogDateList(logDateList);
|
||||||
|
loggingEvent20250430Entity.setPageNum(1);
|
||||||
|
loggingEvent20250430Entity.setPageSize(100);
|
||||||
|
|
||||||
|
PageInfo<LoggingEvent20250430Entity> loggingEvent20250430EntityPageInfo = iLoggingEvent20250430Dao.queryLoggingEventByProcessorId(loggingEvent20250430Entity);
|
||||||
|
List<LoggingEvent20250430Entity> list = loggingEvent20250430EntityPageInfo.getList();
|
||||||
|
System.out.println(list.size());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,26 @@
|
||||||
|
package com.hzya.frame;
|
||||||
|
|
||||||
|
import com.ql.util.express.ExpressRunner;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestQl
|
||||||
|
* @Date:2025/7/18 15:44
|
||||||
|
* @Filename:TestQl
|
||||||
|
*/
|
||||||
|
public class TestQl {
|
||||||
|
@Test
|
||||||
|
public void test1() throws Exception {
|
||||||
|
String exp = "import com.hzya.frame.vo.UserVo;" +
|
||||||
|
"UserVo cust = new UserVo();" +
|
||||||
|
"cust.setName(\"小强\");" +
|
||||||
|
"return cust.getName();";
|
||||||
|
ExpressRunner runner = new ExpressRunner();
|
||||||
|
String r = (String) runner.execute(exp, null, null, false, false);
|
||||||
|
Assert.assertEquals("操作符执行错误", "小强", r);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.hzya.frame.jolt;
|
||||||
|
|
||||||
|
import com.bazaarvoice.jolt.Chainr;
|
||||||
|
import com.bazaarvoice.jolt.JsonUtils;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "cardinality"
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestJolt
|
||||||
|
* @Date:2025/6/18 11:19
|
||||||
|
* @Filename:TestJolt
|
||||||
|
*/
|
||||||
|
public class TestJoltCardinality {
|
||||||
|
|
||||||
|
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ONE:如果输入值是一个列表,则获取该列表中的第一个元素,并将其设置为该元素的数据,不支持其他类型
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/input.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/spec.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 'MANY':如果输入不是列表,则创建一个列表并将第一个元素设置为输入值
|
||||||
|
* 如果输入是"null",使它成为一个空列表。如果输入是一个列表,不支持
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo2() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/input2.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/spec2.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDemo3() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/input3.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/spec3.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.hzya.frame.jolt;
|
||||||
|
|
||||||
|
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||||
|
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||||
|
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||||
|
|
||||||
|
import com.bazaarvoice.jolt.Chainr;
|
||||||
|
import com.bazaarvoice.jolt.JsonUtils;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
//import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jolt框架的default部分测试,
|
||||||
|
* default是一种为json对象设置默认值的核心操作,当目标json中某个字段不存在,或字段值为null时,
|
||||||
|
* 用你指定的默认值填充该字段,如果字段已存在且值非 null,则不会覆盖原有值
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestJolt
|
||||||
|
* @Date:2025/6/18 11:19
|
||||||
|
* @Filename:TestJolt
|
||||||
|
*/
|
||||||
|
public class TestJoltDefault {
|
||||||
|
|
||||||
|
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加一些指定属性
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/default/input.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/default/spec.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加一些指定属性
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo2() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/default/input3.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/default/spec3.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.hzya.frame.jolt;
|
||||||
|
|
||||||
|
import com.bazaarvoice.jolt.Chainr;
|
||||||
|
import com.bazaarvoice.jolt.JsonUtils;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jolt框架的modify部分测试
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestJolt
|
||||||
|
* @Date:2025/6/18 11:19
|
||||||
|
* @Filename:TestJolt
|
||||||
|
*/
|
||||||
|
public class TestJoltModify {
|
||||||
|
|
||||||
|
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDemo() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/modify/input.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/modify/spec.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.hzya.frame.jolt;
|
||||||
|
|
||||||
|
import com.bazaarvoice.jolt.Chainr;
|
||||||
|
import com.bazaarvoice.jolt.JsonUtils;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "remove" 是一种用于从输入 JSON 中删除指定字段或元素的核心转换操作
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestJolt
|
||||||
|
* @Date:2025/6/18 11:19
|
||||||
|
* @Filename:TestJolt
|
||||||
|
*/
|
||||||
|
public class TestJoltRemove {
|
||||||
|
|
||||||
|
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDemo() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/remove/input.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/remove/spec.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDemo2() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/remove/input3.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/remove/spec3.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,231 @@
|
||||||
|
package com.hzya.frame.jolt;
|
||||||
|
|
||||||
|
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||||
|
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||||
|
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||||
|
|
||||||
|
import com.bazaarvoice.jolt.Chainr;
|
||||||
|
import com.bazaarvoice.jolt.JsonUtils;
|
||||||
|
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
//import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jolt框架的shift部分测试,Shiftr的基本操作是复制输入JSON的value
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestJolt
|
||||||
|
* @Date:2025/6/18 11:19
|
||||||
|
* @Filename:TestJolt
|
||||||
|
*/
|
||||||
|
public class TestJoltShift {
|
||||||
|
|
||||||
|
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDemo() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段映射符
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo2() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input2.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec2.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* *通配符
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo3() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input3.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec3.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDemo4() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input4.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec4.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* &通配符
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo5() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input5.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec5.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $通配符
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo6() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input6.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec6.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* #通配符,在右边
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo7() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input7.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec7.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* #通配符,在左边
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo8() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input8.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec8.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* | 通配符,在左边
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo9() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input9.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec9.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @通配符,在左边
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo10() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input10.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec10.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @通配符,在右边
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo11() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input11.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec11.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理输入中的json数组
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo12() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input12.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec12.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理输出的json数组
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo13() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input13.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec13.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同一个输入源,可以输出到多个目标输出处
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo14() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input14.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec14.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 隐式数组
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo15() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input15.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec15.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段名替换
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo16() {
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input16.json");
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec16.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.hzya.frame.jolt;
|
||||||
|
|
||||||
|
import com.bazaarvoice.jolt.Chainr;
|
||||||
|
import com.bazaarvoice.jolt.JsonUtils;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* "Sort":排序场景
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:TestJolt
|
||||||
|
* @Date:2025/6/18 11:19
|
||||||
|
* @Filename:TestJolt
|
||||||
|
*/
|
||||||
|
public class TestJoltSort {
|
||||||
|
|
||||||
|
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认按字母升序排列(A → Z),排序后键顺序为:a → b → d → r
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo() {
|
||||||
|
//输入json
|
||||||
|
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/sort/input.json");
|
||||||
|
//spec
|
||||||
|
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/sort/spec.json");
|
||||||
|
|
||||||
|
Chainr chainr = Chainr.fromSpec(spec);
|
||||||
|
Object transform = chainr.transform(input);
|
||||||
|
System.out.println(JsonUtils.toJsonString(transform));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.vo
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:User
|
||||||
|
* @Date:2025/7/18 15:46
|
||||||
|
* @Filename:User
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserVo {
|
||||||
|
private String name;
|
||||||
|
}
|
|
@ -5,8 +5,6 @@ import cn.hutool.crypto.SecureUtil;
|
||||||
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
|
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
|
||||||
import cn.hutool.crypto.symmetric.SymmetricCrypto;
|
import cn.hutool.crypto.symmetric.SymmetricCrypto;
|
||||||
|
|
||||||
import static cn.hutool.crypto.CipherMode.encrypt;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description AES加密解密
|
* @Description AES加密解密
|
||||||
* @Author xiang2lin
|
* @Author xiang2lin
|
||||||
|
@ -79,9 +77,4 @@ public class AESUtil {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
String data = "U8C241231";
|
|
||||||
String encrypt1 = encrypt(data);
|
|
||||||
System.out.println(encrypt1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.context.support.ApplicationObjectSupport;
|
import org.springframework.context.support.ApplicationObjectSupport;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 郭军辉
|
* @author 郭军辉
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -25,7 +26,7 @@ public class DefaultController extends ApplicationObjectSupport {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public JsonResultEntity getFailureMessageEntity(String message) {
|
public JsonResultEntity getFailureMessageEntity(String message) {
|
||||||
return new JsonResultEntity(message, false, "500");
|
return new JsonResultEntity(message, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +36,7 @@ public class DefaultController extends ApplicationObjectSupport {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public JsonResultEntity getFailureMessageEntity(String message, Object mo) {
|
public JsonResultEntity getFailureMessageEntity(String message, Object mo) {
|
||||||
return new JsonResultEntity(message, false, "500", mo);
|
return new JsonResultEntity(message, false, mo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,7 +47,7 @@ public class DefaultController extends ApplicationObjectSupport {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public JsonResultEntity getSuccessMessageEntity(String message, Object mo) {
|
public JsonResultEntity getSuccessMessageEntity(String message, Object mo) {
|
||||||
return new JsonResultEntity(message, true, "200", mo);
|
return new JsonResultEntity(message, true, mo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,11 +56,18 @@ public class DefaultController extends ApplicationObjectSupport {
|
||||||
* @param message 提示消息
|
* @param message 提示消息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public JsonResultEntity getSuccessMessageEntity(String message) {
|
public JsonResultEntity getSuccessMessageEntity(String message ) {
|
||||||
return new JsonResultEntity(message, true, "200");
|
return new JsonResultEntity(message, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* //绑定org_id
|
* //绑定org_id
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
package com.hzya.frame.mdm.mdmModule;
|
|
||||||
|
|
||||||
import com.alibaba.excel.EasyExcel;
|
|
||||||
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
|
|
||||||
import com.hzya.frame.mdm.mdmModule.vo.ExcelTemplateVO;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public class WriteTest {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IMdmModuleService mdmModuleService;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGenerateExcelTemplate() throws IOException {
|
|
||||||
// 文件夹路径
|
|
||||||
String folderPath = "D:/test/";
|
|
||||||
// 完整文件路径(文件夹 + 文件名)
|
|
||||||
String localFilePath = folderPath + "表字段定义模版.xlsx";
|
|
||||||
File dir = new File(folderPath);
|
|
||||||
if (!dir.exists()) {
|
|
||||||
dir.mkdirs(); // 创建文件夹(如果不存在)
|
|
||||||
}
|
|
||||||
// 准备模板的示例数据
|
|
||||||
List<ExcelTemplateVO> demoData = new ArrayList<>();
|
|
||||||
// 生成Excel并保存到本地文件
|
|
||||||
try (OutputStream outputStream = new FileOutputStream(localFilePath)) {
|
|
||||||
EasyExcel.write(outputStream, ExcelTemplateVO.class)
|
|
||||||
.sheet("表字段定义模版")
|
|
||||||
.doWrite(demoData);
|
|
||||||
}
|
|
||||||
System.out.println("Excel模板已成功生成,保存路径:" + localFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
package com.hzya.frame.mdm.mdmModule.config;
|
|
||||||
|
|
||||||
import org.springframework.cache.annotation.CachingConfigurerSupport;
|
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
|
||||||
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@EnableCaching
|
|
||||||
public class CacheConfig extends CachingConfigurerSupport {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Bean
|
|
||||||
public ConcurrentMapCacheManager cacheManager() {
|
|
||||||
// 整合所有需要的缓存名称:原有的mdm相关缓存 + 新的业务缓存
|
|
||||||
List<String> cacheNames = Arrays.asList(
|
|
||||||
// 原有缓存(来自SimpleCacheManager的配置)
|
|
||||||
"mdmModuleDb",
|
|
||||||
"mdmModuleDbFileds",
|
|
||||||
"mdmModule",
|
|
||||||
// 新添加的业务缓存(来自之前的ConcurrentMapCacheManager配置)
|
|
||||||
"sysApplicationPlugin",
|
|
||||||
"IntegrationTask",
|
|
||||||
"IntegrationTaskLiving"
|
|
||||||
);
|
|
||||||
ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager();
|
|
||||||
cacheManager.setCacheNames(cacheNames); // 注册所有缓存名称
|
|
||||||
return cacheManager;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
package com.hzya.frame.mdm.mdmModule.controller;
|
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
|
|
||||||
import com.hzya.frame.mdm.mdmModule.vo.ImportExcelVO;
|
|
||||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
|
||||||
import jline.internal.Log;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping(value = "/excel")
|
|
||||||
public class ImportExcelController {
|
|
||||||
@Autowired
|
|
||||||
private IMdmModuleService iMdmModuleService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导入模版
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/importTemplateFile" ,method = RequestMethod.POST)
|
|
||||||
public JsonResultEntity importTemplateFile(@RequestParam("file") MultipartFile file,
|
|
||||||
@ModelAttribute ImportExcelVO importExcelVO){
|
|
||||||
|
|
||||||
List<MdmModuleDbFiledsEntity> entities = iMdmModuleService.importTemplateFile(file,importExcelVO);
|
|
||||||
// 新增字段
|
|
||||||
for (MdmModuleDbFiledsEntity entity : entities) {
|
|
||||||
// JSONObject object = (JSONObject) JSONObject.toJSON(entity);
|
|
||||||
|
|
||||||
String str = JSONObject.toJSONString(entity);
|
|
||||||
Map<String,String> jsonStr=new HashMap<>();
|
|
||||||
jsonStr.put("jsonStr",str);
|
|
||||||
String jsonS = JSON.toJSONString(jsonStr);
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(jsonS);
|
|
||||||
|
|
||||||
iMdmModuleService.saveMdmDbField(jsonObject);
|
|
||||||
}
|
|
||||||
return new JsonResultEntity("导入模版成功",true,200);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -26,45 +26,8 @@ public class MdmModuleEntity extends BaseEntity {
|
||||||
private String createUser;
|
private String createUser;
|
||||||
//修改人
|
//修改人
|
||||||
private String modifyUser;
|
private String modifyUser;
|
||||||
/** 0:预制 1:手工 */
|
|
||||||
private String tag;
|
|
||||||
private String u8cDbPk;
|
|
||||||
private String nccDbPk;
|
|
||||||
private String ysDbPk;
|
|
||||||
|
|
||||||
|
|
||||||
public String getTag() {
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTag(String tag) {
|
|
||||||
this.tag = tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getU8cDbPk() {
|
|
||||||
return u8cDbPk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setU8cDbPk(String u8cDbPk) {
|
|
||||||
this.u8cDbPk = u8cDbPk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNccDbPk() {
|
|
||||||
return nccDbPk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNccDbPk(String nccDbPk) {
|
|
||||||
this.nccDbPk = nccDbPk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getYsDbPk() {
|
|
||||||
return ysDbPk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setYsDbPk(String ysDbPk) {
|
|
||||||
this.ysDbPk = ysDbPk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMdmName() {
|
public String getMdmName() {
|
||||||
return mdmName;
|
return mdmName;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,6 @@
|
||||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||||
<result property="tag" column="tag" jdbcType="VARCHAR"/>
|
|
||||||
<result property="u8cDbPk" column="u8c_db_pk" jdbcType="VARCHAR"/>
|
|
||||||
<result property="nccDbPk" column="ncc_db_pk" jdbcType="VARCHAR"/>
|
|
||||||
<result property="ysDbPk" column="ys_db_pk" jdbcType="VARCHAR"/>
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,10 +39,6 @@
|
||||||
,sts
|
,sts
|
||||||
,org_id
|
,org_id
|
||||||
,company_id
|
,company_id
|
||||||
,tag
|
|
||||||
,u8c_db_pk
|
|
||||||
,ncc_db_pk
|
|
||||||
,ys_db_pk
|
|
||||||
</sql>
|
</sql>
|
||||||
<!--通过ID获取数据 -->
|
<!--通过ID获取数据 -->
|
||||||
<select id="entity_get" resultMap="get-MdmModuleEntity-result">
|
<select id="entity_get" resultMap="get-MdmModuleEntity-result">
|
||||||
|
@ -75,10 +67,6 @@
|
||||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
<if test="tag != null and tag != ''">and tag = #{tag}</if>
|
|
||||||
<if test="u8cDbPk != null and u8cDbPk != ''">and u8c_db_pk = #{u8cDbPk}</if>
|
|
||||||
<if test="nccDbPk != null and nccDbPk != ''">and ncc_db_pk = #{nccDbPk}</if>
|
|
||||||
<if test="ysDbPk != null and ysDbPk != ''">and ys_db_pk = #{ysDbPk}</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
|
@ -103,10 +91,6 @@
|
||||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
<if test="tag != null and tag != ''">and tag = #{tag}</if>
|
|
||||||
<if test="u8cDbPk != null and u8cDbPk != ''">and u8c_db_pk = #{u8cDbPk}</if>
|
|
||||||
<if test="nccDbPk != null and nccDbPk != ''">and ncc_db_pk = #{nccDbPk}</if>
|
|
||||||
<if test="ysDbPk != null and ysDbPk != ''">and ys_db_pk = #{ysDbPk}</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
|
@ -138,7 +122,6 @@
|
||||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||||
<if test="tag != null and tag != ''">and tag like concat('%',#{tag},'%')</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
|
@ -166,7 +149,6 @@
|
||||||
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||||
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||||
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||||
<if test="tag != null and tag != ''">or tag = #{tag}</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
|
@ -193,10 +175,6 @@
|
||||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||||
<if test="sts == null ">sts,</if>
|
<if test="sts == null ">sts,</if>
|
||||||
<if test="tag == null ">tag ,</if>
|
|
||||||
<if test="u8cDbPk != null and u8cDbPk != ''">u8c_db_pk,</if>
|
|
||||||
<if test="nccDbPk != null and nccDbPk != ''">ncc_db_pk,</if>
|
|
||||||
<if test="ysDbPk != null and ysDbPk != ''">ys_db_pk,</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
)values(
|
)values(
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
|
@ -216,10 +194,6 @@
|
||||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||||
<if test="sts == null ">'Y',</if>
|
<if test="sts == null ">'Y',</if>
|
||||||
<if test="tag == null ">'1',</if>
|
|
||||||
<if test="u8cDbPk != null and u8cDbPk != ''">#{u8cDbPk},</if>
|
|
||||||
<if test="nccDbPk != null and nccDbPk != ''">#{nccDbPk},</if>
|
|
||||||
<if test="ysDbPk != null and ysDbPk != ''">#{ysDbPk},</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
@ -307,9 +281,6 @@ where id = #{id}
|
||||||
<select id="queryMdm" resultMap="get-MdmModuleEntity-result"
|
<select id="queryMdm" resultMap="get-MdmModuleEntity-result"
|
||||||
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
|
parameterType="com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity">
|
||||||
select
|
select
|
||||||
a.u8c_db_pk as u8c_db_pk,
|
|
||||||
a.ncc_db_pk as ncc_db_pk,
|
|
||||||
a.ys_db_pk as ys_db_pk,
|
|
||||||
a.id as id,
|
a.id as id,
|
||||||
a.mdm_name as mdm_name,
|
a.mdm_name as mdm_name,
|
||||||
a.mdm_logo as mdm_logo,
|
a.mdm_logo as mdm_logo,
|
||||||
|
@ -1003,10 +974,10 @@ where id = #{id}
|
||||||
< #{item.filedVaule}
|
< #{item.filedVaule}
|
||||||
</when>
|
</when>
|
||||||
<when test="item.compareType == '5'.toString() ">
|
<when test="item.compareType == '5'.toString() ">
|
||||||
like concat('%',#{item.filedVaule},'%')
|
like #{item.filedVaule}
|
||||||
</when>
|
</when>
|
||||||
<when test="item.compareType == '6'.toString() ">
|
<when test="item.compareType == '6'.toString() ">
|
||||||
not like concat('%',#{item.filedVaule},'%')
|
not like #{item.filedVaule}
|
||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,7 @@ package com.hzya.frame.mdm.mdmModule.service;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||||
import com.hzya.frame.basedao.service.IBaseService;
|
import com.hzya.frame.basedao.service.IBaseService;
|
||||||
import com.hzya.frame.mdm.mdmModule.vo.ImportExcelVO;
|
|
||||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主数据模版(MdmModule)表服务接口
|
* 主数据模版(MdmModule)表服务接口
|
||||||
|
@ -404,16 +397,4 @@ public interface IMdmModuleService extends IBaseService<MdmModuleEntity, String>
|
||||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
**/
|
**/
|
||||||
JsonResultEntity queryMdmDistributeByMdmCode(JSONObject jsonObject);
|
JsonResultEntity queryMdmDistributeByMdmCode(JSONObject jsonObject);
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载导入模版
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void generateExcelTemplate(HttpServletResponse response) throws IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导入模版
|
|
||||||
* @param file
|
|
||||||
*/
|
|
||||||
List<MdmModuleDbFiledsEntity> importTemplateFile(MultipartFile file, ImportExcelVO importExcelVO);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,8 @@
|
||||||
package com.hzya.frame.mdm.mdmModule.service.impl;
|
package com.hzya.frame.mdm.mdmModule.service.impl;
|
||||||
|
|
||||||
import com.alibaba.excel.EasyExcel;
|
|
||||||
import com.alibaba.excel.ExcelWriter;
|
|
||||||
import com.alibaba.excel.context.AnalysisContext;
|
|
||||||
import com.alibaba.excel.event.AnalysisEventListener;
|
|
||||||
import com.alibaba.excel.util.StringUtils;
|
|
||||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
||||||
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.hzya.frame.beanutil.BeanUtil;
|
|
||||||
import com.hzya.frame.mdm.entity.MdmDbFiledVo;
|
import com.hzya.frame.mdm.entity.MdmDbFiledVo;
|
||||||
import com.hzya.frame.mdm.entity.MdmDto;
|
import com.hzya.frame.mdm.entity.MdmDto;
|
||||||
import com.hzya.frame.mdm.entity.MdmModuleViewVo;
|
import com.hzya.frame.mdm.entity.MdmModuleViewVo;
|
||||||
|
@ -19,8 +10,6 @@ import com.hzya.frame.mdm.entity.MdmQuery;
|
||||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||||
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
||||||
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
|
import com.hzya.frame.mdm.mdmModule.service.IMdmModuleService;
|
||||||
import com.hzya.frame.mdm.mdmModule.vo.ExcelTemplateVO;
|
|
||||||
import com.hzya.frame.mdm.mdmModule.vo.ImportExcelVO;
|
|
||||||
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
|
import com.hzya.frame.mdm.mdmModuleDb.dao.IMdmModuleDbDao;
|
||||||
import com.hzya.frame.mdm.mdmModuleDb.dao.impl.MdmModuleDbDaoImpl;
|
import com.hzya.frame.mdm.mdmModuleDb.dao.impl.MdmModuleDbDaoImpl;
|
||||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||||
|
@ -61,24 +50,17 @@ import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import com.hzya.frame.web.exception.BaseSystemException;
|
import com.hzya.frame.web.exception.BaseSystemException;
|
||||||
import org.checkerframework.checker.units.qual.A;
|
import org.checkerframework.checker.units.qual.A;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.util.ArrayList;
|
||||||
import java.io.IOException;
|
import java.util.HashMap;
|
||||||
import java.io.InputStream;
|
import java.util.List;
|
||||||
import java.io.OutputStream;
|
import java.util.Map;
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主数据模版(MdmModule)表服务实现类
|
* 主数据模版(MdmModule)表服务实现类
|
||||||
|
@ -461,22 +443,6 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
||||||
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
||||||
if ("1".equals(mdmModuleDbEntities.get(i).getDbType()) || "2".equals(mdmModuleDbEntities.get(i).getDbType())) {
|
if ("1".equals(mdmModuleDbEntities.get(i).getDbType()) || "2".equals(mdmModuleDbEntities.get(i).getDbType())) {
|
||||||
dbEntities.add(mdmModuleDbEntities.get(i));
|
dbEntities.add(mdmModuleDbEntities.get(i));
|
||||||
//查询合并规则。add by zyd 20250707
|
|
||||||
List<String> filedNames=new ArrayList<>();
|
|
||||||
if (mdmModuleDbEntities.get(i).getMergeRules() != null && !"".equals(mdmModuleDbEntities.get(i).getMergeRules())) {
|
|
||||||
String mergeRulesIds = mdmModuleDbEntities.get(i).getMergeRules();
|
|
||||||
String[] split = mergeRulesIds.split(",");
|
|
||||||
for (String filedId : split) {
|
|
||||||
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
|
|
||||||
mdmModuleDbFiledsEntity.setId(filedId);
|
|
||||||
List<MdmModuleDbFiledsEntity> fileds = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
|
|
||||||
if(fileds.size()!=0){
|
|
||||||
filedNames.add(fileds.get(0).getChName());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mdmModuleDbEntities.get(i).setMergeRulesStr(String.join(",",filedNames));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1437,8 +1403,7 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
||||||
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
|
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
|
||||||
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
|
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
|
||||||
mdmModuleDbFiledsEntity.setSts("Y");
|
mdmModuleDbFiledsEntity.setSts("Y");
|
||||||
// List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity);
|
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmServiceCache.queryMdmModuleDbFileds(mdmModuleDbFiledsEntity);
|
||||||
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
|
|
||||||
if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) {
|
if (mdmModuleDbFiledsEntityList != null && mdmModuleDbFiledsEntityList.size() > 0) {
|
||||||
for (int i = 0; i < mdmModuleDbFiledsEntityList.size(); i++) {
|
for (int i = 0; i < mdmModuleDbFiledsEntityList.size(); i++) {
|
||||||
if (entity.getDbId().equals(mdmModuleDbFiledsEntityList.get(i).getDbId()) && entity.getEnName().equals(mdmModuleDbFiledsEntityList.get(i).getEnName())) {
|
if (entity.getDbId().equals(mdmModuleDbFiledsEntityList.get(i).getDbId()) && entity.getEnName().equals(mdmModuleDbFiledsEntityList.get(i).getEnName())) {
|
||||||
|
@ -1446,42 +1411,6 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//新增时:查询sysPk,sysCode,sysName段是否存在 add by zyd 2025-06-09
|
|
||||||
boolean isSysPk = false;
|
|
||||||
boolean isSysCode = false;
|
|
||||||
boolean isSysName = false;
|
|
||||||
boolean isSysDate = false;
|
|
||||||
for (MdmModuleDbFiledsEntity dbFiledsEntity : mdmModuleDbFiledsEntityList) {
|
|
||||||
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
|
|
||||||
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
|
|
||||||
if ("Y".equals(dbFiledsEntity.getIsSysPk())) {
|
|
||||||
isSysPk = true;
|
|
||||||
}
|
|
||||||
if ("Y".equals(dbFiledsEntity.getIsSysCode())) {
|
|
||||||
isSysCode = true;
|
|
||||||
}
|
|
||||||
if ("Y".equals(dbFiledsEntity.getIsSysName())) {
|
|
||||||
isSysName = true;
|
|
||||||
}
|
|
||||||
if ("Y".equals(dbFiledsEntity.getIsSysDate())) {
|
|
||||||
isSysDate = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//判端该字段是不是sysPk,sysCode,sysName=true
|
|
||||||
if ("Y".equals(entity.getIsSysPk()) && isSysPk) {
|
|
||||||
return BaseResult.getFailureMessageEntity("系统主键字段已存在,请修改");
|
|
||||||
}
|
|
||||||
if ("Y".equals(entity.getIsSysCode()) && isSysCode) {
|
|
||||||
return BaseResult.getFailureMessageEntity("系统code字段已存在,请修改");
|
|
||||||
}
|
|
||||||
if ("Y".equals(entity.getIsSysName()) && isSysName) {
|
|
||||||
return BaseResult.getFailureMessageEntity("系统name字段已存在,请修改");
|
|
||||||
}
|
|
||||||
if ("Y".equals(entity.getIsSysDate()) && isSysDate) {
|
|
||||||
return BaseResult.getFailureMessageEntity("系统date字段已存在,请修改");
|
|
||||||
}
|
|
||||||
entity.setCreate();
|
entity.setCreate();
|
||||||
if ("1".equals(entity.getDbType())) {
|
if ("1".equals(entity.getDbType())) {
|
||||||
entity.setAddType("1");
|
entity.setAddType("1");
|
||||||
|
@ -1559,49 +1488,6 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BaseSystemException("表字段类型,修改失败,请联系管理员");
|
throw new BaseSystemException("表字段类型,修改失败,请联系管理员");
|
||||||
}
|
}
|
||||||
|
|
||||||
//更新时:查询sysPk,sysCode,sysName段是否存在 add by zyd 2025-06-09
|
|
||||||
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity = new MdmModuleDbFiledsEntity();
|
|
||||||
mdmModuleDbFiledsEntity.setDbId(entity.getDbId());
|
|
||||||
mdmModuleDbFiledsEntity.setMdmId(entity.getMdmId());
|
|
||||||
mdmModuleDbFiledsEntity.setSts("Y");
|
|
||||||
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList = mdmModuleDbFiledsDao.query(mdmModuleDbFiledsEntity);
|
|
||||||
boolean isSysPk = false;
|
|
||||||
boolean isSysCode = false;
|
|
||||||
boolean isSysName = false;
|
|
||||||
boolean isSysDate = false;
|
|
||||||
for (MdmModuleDbFiledsEntity dbFiledsEntity : mdmModuleDbFiledsEntityList) {
|
|
||||||
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
|
|
||||||
if (entity.getDbId().equals(dbFiledsEntity.getDbId())) {
|
|
||||||
if ("Y".equals(dbFiledsEntity.getIsSysPk())) {
|
|
||||||
isSysPk = true;
|
|
||||||
}
|
|
||||||
if ("Y".equals(dbFiledsEntity.getIsSysCode())) {
|
|
||||||
isSysCode = true;
|
|
||||||
}
|
|
||||||
if ("Y".equals(dbFiledsEntity.getIsSysName())) {
|
|
||||||
isSysName = true;
|
|
||||||
}
|
|
||||||
if ("Y".equals(dbFiledsEntity.getIsSysDate())) {
|
|
||||||
isSysDate = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//判端该字段是不是sysPk,sysCode,sysName=true
|
|
||||||
if ("Y".equals(entity.getIsSysPk()) && isSysPk) {
|
|
||||||
return BaseResult.getFailureMessageEntity("系统主键字段已存在,请修改");
|
|
||||||
}
|
|
||||||
if ("Y".equals(entity.getIsSysCode()) && isSysCode) {
|
|
||||||
return BaseResult.getFailureMessageEntity("系统code字段已存在,请修改");
|
|
||||||
}
|
|
||||||
if ("Y".equals(entity.getIsSysName()) && isSysName) {
|
|
||||||
return BaseResult.getFailureMessageEntity("系统name字段已存在,请修改");
|
|
||||||
}
|
|
||||||
if ("Y".equals(entity.getIsSysDate()) && isSysDate) {
|
|
||||||
return BaseResult.getFailureMessageEntity("系统date字段已存在,请修改");
|
|
||||||
}
|
|
||||||
|
|
||||||
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = new ArrayList<>();
|
List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities = new ArrayList<>();
|
||||||
mdmModuleDbFiledsEntities.add(entity);
|
mdmModuleDbFiledsEntities.add(entity);
|
||||||
mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities);
|
mdmServiceCache.saveOrUpdateMdmModuleDbFileds(entity.getMdmId(), mdmModuleDbFiledsEntities);
|
||||||
|
@ -1665,7 +1551,6 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
||||||
return BaseResult.getFailureMessageEntity("系统错误");
|
return BaseResult.getFailureMessageEntity("系统错误");
|
||||||
}
|
}
|
||||||
MdmModuleDbFiledsRuleEntity queryCount = new MdmModuleDbFiledsRuleEntity();
|
MdmModuleDbFiledsRuleEntity queryCount = new MdmModuleDbFiledsRuleEntity();
|
||||||
queryCount.setMdmId(entity.getMdmId());
|
|
||||||
queryCount.setDbId(entity.getDbId());
|
queryCount.setDbId(entity.getDbId());
|
||||||
queryCount.setRuleCode("label");
|
queryCount.setRuleCode("label");
|
||||||
queryCount.setRuleValue(entity.getEnName());
|
queryCount.setRuleValue(entity.getEnName());
|
||||||
|
@ -2979,290 +2864,4 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
||||||
List<MdmModuleDistributeEntity> list = mdmModuleDistributeDao.queryBase(entity);
|
List<MdmModuleDistributeEntity> list = mdmModuleDistributeDao.queryBase(entity);
|
||||||
return BaseResult.getSuccessMessageEntity("获取分发设置成功", list);
|
return BaseResult.getSuccessMessageEntity("获取分发设置成功", list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成导入模版
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void generateExcelTemplate(HttpServletResponse response) throws IOException {
|
|
||||||
// 设置响应内容类型
|
|
||||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
||||||
response.setCharacterEncoding("utf-8");
|
|
||||||
// 设置文件名,注意中文需要URLEncoder编码
|
|
||||||
String fileName = URLEncoder.encode("表字段定义模版", "UTF-8").replaceAll("\\+", "%20");
|
|
||||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
|
||||||
// 准备模板的示例数据
|
|
||||||
List<ExcelTemplateVO> demoData = new ArrayList<>(); //createTemplateDemoData()
|
|
||||||
// 使用EasyExcel直接写入响应输出流
|
|
||||||
EasyExcel.write(response.getOutputStream(), ExcelTemplateVO.class)
|
|
||||||
.sheet("表字段定义模版")
|
|
||||||
.doWrite(demoData);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*private List<ExcelTemplateVO> createTemplateDemoData() {
|
|
||||||
List<ExcelTemplateVO> demoData = new ArrayList<>();
|
|
||||||
ExcelTemplateVO demo = new ExcelTemplateVO();
|
|
||||||
demo.setChName("用户ID");
|
|
||||||
demo.setEnName("userId");
|
|
||||||
demo.setFiledType("1"); // 对应BIGINT类型
|
|
||||||
demo.setFiledLength("20");
|
|
||||||
demo.setIsSysPk("Y");
|
|
||||||
demo.setIsSysCode("Y");
|
|
||||||
demo.setIsSysName("N");
|
|
||||||
demo.setIsSysDate("N");
|
|
||||||
demo.setTitle("用户ID");
|
|
||||||
demo.setRow("6");
|
|
||||||
demo.setWidth("100");
|
|
||||||
demo.setType("input");
|
|
||||||
demo.setRequired("true");
|
|
||||||
demo.setDisabled("true");
|
|
||||||
|
|
||||||
demoData.add(demo);
|
|
||||||
return demoData;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* 导入模版
|
|
||||||
*/
|
|
||||||
@Transactional
|
|
||||||
@Override
|
|
||||||
public List<MdmModuleDbFiledsEntity> importTemplateFile(MultipartFile file , ImportExcelVO importExcelVO) {
|
|
||||||
// 校验文件合法性
|
|
||||||
if (file == null || file.isEmpty()) {
|
|
||||||
throw new IllegalArgumentException("导入文件不能为空");
|
|
||||||
}
|
|
||||||
// 校验文件格式
|
|
||||||
String fileName = file.getOriginalFilename();
|
|
||||||
if (fileName == null || (!fileName.endsWith(".xlsx") && !fileName.endsWith(".xls"))) {
|
|
||||||
throw new IllegalArgumentException("请上传Excel格式文件");
|
|
||||||
}
|
|
||||||
// 表头数据
|
|
||||||
List<List<String>> headerList = new ArrayList<>();
|
|
||||||
// 用于存储内容数据
|
|
||||||
List<ExcelTemplateVO> dataList = new ArrayList<>();
|
|
||||||
List<MdmModuleDbFiledsEntity> resultEntities = new ArrayList<>();
|
|
||||||
try (InputStream inputStream = file.getInputStream()) {
|
|
||||||
// 使用EasyExcel读取文件
|
|
||||||
EasyExcel.read(inputStream)
|
|
||||||
.head(ExcelTemplateVO.class) // 指定映射的实体类
|
|
||||||
.sheet(0) // 指定第一个sheet页
|
|
||||||
.headRowNumber(1) // 表头行数(从1开始)
|
|
||||||
.autoTrim(true)
|
|
||||||
.registerReadListener(new AnalysisEventListener<ExcelTemplateVO>() {
|
|
||||||
/**
|
|
||||||
* 获取表头行数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
|
|
||||||
// 1. 转换表头为有序列表
|
|
||||||
List<String> header = new ArrayList<>();
|
|
||||||
// 获取最大列索引,确保顺序正确
|
|
||||||
int maxColIndex = headMap.keySet().stream().mapToInt(Integer::intValue).max().orElse(-1);
|
|
||||||
for (int i = 0; i <= maxColIndex; i++) {
|
|
||||||
header.add(headMap.getOrDefault(i, "")); // 无数据的列填空
|
|
||||||
}
|
|
||||||
headerList.add(header);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 每解析一行数据触发
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void invoke(ExcelTemplateVO data, AnalysisContext context) {
|
|
||||||
// 空行直接跳过
|
|
||||||
if (isRowEmpty(data)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 数据校验
|
|
||||||
validateData(data, context.readRowHolder().getRowIndex() + 1);
|
|
||||||
dataList.add(data);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 所有数据解析完成后触发
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void doAfterAllAnalysed(AnalysisContext context) {
|
|
||||||
// 解析完成后的数据处理
|
|
||||||
List<MdmModuleDbFiledsEntity> entities = processImportData(headerList, dataList, importExcelVO);
|
|
||||||
if (entities != null) {
|
|
||||||
resultEntities.addAll(entities);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.doRead(); // 执行读取操作
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException("文件读取失败:" + e.getMessage(), e);
|
|
||||||
}
|
|
||||||
return resultEntities;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isRowEmpty(ExcelTemplateVO data) {
|
|
||||||
if(data == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return StringUtils.isEmpty(data.getChName() ) &&
|
|
||||||
StringUtils.isEmpty(data.getFiledType()) &&
|
|
||||||
StringUtils.isEmpty(data.getEnName()) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导入数据,新增字段
|
|
||||||
* @param headerList
|
|
||||||
* @param dataList
|
|
||||||
*/
|
|
||||||
private List<MdmModuleDbFiledsEntity> processImportData(List<List<String>> headerList, List<ExcelTemplateVO> dataList,ImportExcelVO importExcelVO) {
|
|
||||||
// 获取表头列名
|
|
||||||
List<String> headers = headerList.get(0);
|
|
||||||
// 数据库字段数据
|
|
||||||
List<MdmModuleDbFiledsEntity> entities = new ArrayList<>();
|
|
||||||
for (ExcelTemplateVO data : dataList) {
|
|
||||||
MdmModuleDbFiledsEntity entity = new MdmModuleDbFiledsEntity();
|
|
||||||
BeanUtils.copyProperties(data, entity);
|
|
||||||
// 字段规则数据集合
|
|
||||||
List<MdmModuleDbFiledsRuleEntity> rules = new ArrayList<>();
|
|
||||||
for (String header : headers) {
|
|
||||||
// 字段规则数据
|
|
||||||
MdmModuleDbFiledsRuleEntity rule = new MdmModuleDbFiledsRuleEntity();
|
|
||||||
rule.setRuleType("2");
|
|
||||||
rule.setFormName("optionRuleForm");
|
|
||||||
switch (header) {
|
|
||||||
case "显示名":
|
|
||||||
rule.setRuleName("显示名");
|
|
||||||
rule.setRuleCode("title");
|
|
||||||
rule.setRuleValue(data.getChName());
|
|
||||||
break;
|
|
||||||
case "宽度":
|
|
||||||
rule.setRuleName("宽度");
|
|
||||||
rule.setRuleCode("row");
|
|
||||||
rule.setRuleValue(data.getRow());
|
|
||||||
break;
|
|
||||||
case "单元格宽度":
|
|
||||||
rule.setRuleName("单元格宽度");
|
|
||||||
rule.setRuleCode("width");
|
|
||||||
rule.setRuleValue(data.getWidth());
|
|
||||||
break;
|
|
||||||
case "数据类型":
|
|
||||||
rule.setRuleName("数据类型");
|
|
||||||
rule.setRuleCode("type");
|
|
||||||
rule.setRuleValue(data.getType());
|
|
||||||
break;
|
|
||||||
case "必填":
|
|
||||||
rule.setRuleName("必填");
|
|
||||||
rule.setRuleCode("required");
|
|
||||||
rule.setRuleValue(data.getRequired() != null ? "true" : "false");
|
|
||||||
break;
|
|
||||||
case "禁止修改":
|
|
||||||
rule.setRuleName("禁止修改");
|
|
||||||
rule.setRuleCode("disabled");
|
|
||||||
rule.setRuleValue(data.getDisabled() != null ? "true" : "false");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
rules.add(rule);
|
|
||||||
}
|
|
||||||
entity.setMdmModuleDbFiledsRules(rules);
|
|
||||||
entity.setDbName(importExcelVO.getDbName());
|
|
||||||
entity.setDbId(importExcelVO.getDbId());
|
|
||||||
entity.setDbType(importExcelVO.getDbType());
|
|
||||||
entity.setMdmId(importExcelVO.getMdmId());
|
|
||||||
entities.add(entity);
|
|
||||||
}
|
|
||||||
return entities;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据校验方法,验证Excel导入的数据合法性
|
|
||||||
* @param data 导入的Excel数据对象
|
|
||||||
* @param rowNum 行号
|
|
||||||
*/
|
|
||||||
private void validateData(ExcelTemplateVO data, int rowNum) {
|
|
||||||
List<String> errors = new ArrayList<>();
|
|
||||||
|
|
||||||
// 1. 校验中文名称必填
|
|
||||||
if (StringUtils.isBlank(data.getChName())) {
|
|
||||||
errors.add("第" + rowNum + "行:中文名称不能为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. 校验字段类型合法性
|
|
||||||
if (StringUtils.isBlank(data.getFiledType())) {
|
|
||||||
errors.add("第" + rowNum + "行:字段类型不能为空");
|
|
||||||
} else {
|
|
||||||
Set<String> validTypes = new HashSet<>(Arrays.asList("1", "2", "3", "4"));
|
|
||||||
if (!validTypes.contains(data.getFiledType())) {
|
|
||||||
errors.add("第" + rowNum + "行:字段类型无效,允许值为1(BIGINT)、2(DECIMAL)、3(VARCHAR)、4(DATETIME)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 校验长度(数字类型且当字段类型为1、2、3时必填)
|
|
||||||
if (StringUtils.isNotBlank(data.getFiledType()) &&
|
|
||||||
(data.getFiledType().equals("1") || data.getFiledType().equals("2") || data.getFiledType().equals("3"))) {
|
|
||||||
|
|
||||||
if (StringUtils.isBlank(data.getFiledLength())) {
|
|
||||||
errors.add("第" + rowNum + "行:字段长度不能为空");
|
|
||||||
} else if (!StringUtils.isNumeric(data.getFiledLength())) {
|
|
||||||
errors.add("第" + rowNum + "行:字段长度必须为数字");
|
|
||||||
} else {
|
|
||||||
int length = Integer.parseInt(data.getFiledLength());
|
|
||||||
if (length <= 0) {
|
|
||||||
errors.add("第" + rowNum + "行:字段长度必须大于0");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. 校验系统主键标识合法性
|
|
||||||
if (StringUtils.isNotBlank(data.getIsSysPk()) &&
|
|
||||||
!"Y".equals(data.getIsSysPk()) && !"N".equals(data.getIsSysPk())) {
|
|
||||||
errors.add("第" + rowNum + "行:是否系统主键只能为Y或N");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 5. 校验系统数据编码标识合法性
|
|
||||||
if (StringUtils.isNotBlank(data.getIsSysCode()) &&
|
|
||||||
!"Y".equals(data.getIsSysCode()) && !"N".equals(data.getIsSysCode())) {
|
|
||||||
errors.add("第" + rowNum + "行:是否系统数据编码只能为Y或N");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 6. 校验系统数据名称标识合法性
|
|
||||||
if (StringUtils.isNotBlank(data.getIsSysName()) &&
|
|
||||||
!"Y".equals(data.getIsSysName()) && !"N".equals(data.getIsSysName())) {
|
|
||||||
errors.add("第" + rowNum + "行:是否系统数据名称只能为Y或N");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 7. 校验系统日期标识合法性
|
|
||||||
if (StringUtils.isNotBlank(data.getIsSysDate()) &&
|
|
||||||
!"Y".equals(data.getIsSysDate()) && !"N".equals(data.getIsSysDate())) {
|
|
||||||
errors.add("第" + rowNum + "行:是否系统日期只能为Y或N");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 8. 校验是否必填标识合法性
|
|
||||||
if (data.getRequired() != null && !data.getRequired().trim().isEmpty()) {
|
|
||||||
String required = data.getRequired().trim();
|
|
||||||
if (!"TRUE".equalsIgnoreCase(required) && !"FALSE".equalsIgnoreCase(required)) {
|
|
||||||
errors.add("第" + rowNum + "行:是否必填只能为true或false");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 9. 校验禁止修改标识合法性
|
|
||||||
if (data.getDisabled() != null && !data.getDisabled().trim().isEmpty()) {
|
|
||||||
String disabled = data.getDisabled().trim();
|
|
||||||
if (!"TRUE".equalsIgnoreCase(disabled) && !"FALSE".equalsIgnoreCase(disabled)) {
|
|
||||||
errors.add("第" + rowNum + "行:禁止修改只能为true或false");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果有错误,抛出异常中断导入
|
|
||||||
if (!errors.isEmpty()) {
|
|
||||||
throw new ExcelDataValidateException(String.join(";", errors));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 自定义异常类
|
|
||||||
public class ExcelDataValidateException extends RuntimeException {
|
|
||||||
public ExcelDataValidateException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
package com.hzya.frame.mdm.mdmModule.vo;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class ExcelTemplateVO {
|
|
||||||
|
|
||||||
@ExcelProperty(value = "中文名称", index = 0)
|
|
||||||
private String chName;
|
|
||||||
|
|
||||||
@ExcelProperty(value = "英文名称", index = 1)
|
|
||||||
private String enName;
|
|
||||||
|
|
||||||
/** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */
|
|
||||||
@ExcelProperty(value = "字段类型", index = 2)
|
|
||||||
private String filedType;
|
|
||||||
|
|
||||||
@ExcelProperty(value = "长度", index = 3)
|
|
||||||
private String filedLength;
|
|
||||||
|
|
||||||
@ExcelProperty(value = "是否系统主键", index = 4)
|
|
||||||
private String isSysPk;// Y N
|
|
||||||
|
|
||||||
@ExcelProperty(value = "系统数据编码", index = 5)
|
|
||||||
private String isSysCode;// Y N
|
|
||||||
|
|
||||||
@ExcelProperty(value = "系统数据名称", index = 6)
|
|
||||||
private String isSysName;// Y N
|
|
||||||
|
|
||||||
@ExcelProperty(value = "系统日期", index = 7)
|
|
||||||
private String isSysDate; // Y N
|
|
||||||
|
|
||||||
@ExcelProperty(value = "显示名", index = 8)
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@ExcelProperty(value = "宽度", index = 9)
|
|
||||||
private String row;
|
|
||||||
|
|
||||||
@ExcelProperty(value = "单元格宽度", index = 10)
|
|
||||||
private String width;
|
|
||||||
|
|
||||||
@ExcelProperty(value = "数据类型",index = 11)
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
@ExcelProperty(value= "必填",index = 12)
|
|
||||||
private String required; // true false
|
|
||||||
|
|
||||||
@ExcelProperty(value= "禁止修改",index = 13)
|
|
||||||
private String disabled; // true false
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.hzya.frame.mdm.mdmModule.vo;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import org.checkerframework.checker.units.qual.A;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class ImportExcelVO {
|
|
||||||
/** 主数据模版ID */
|
|
||||||
private String dbName;
|
|
||||||
/** 主数据模版ID */
|
|
||||||
private String mdmId;
|
|
||||||
/** 模版数据库id */
|
|
||||||
private String dbId;
|
|
||||||
/** 类型 1、主表 2、明细 3、操作日志 4、下发日志 */
|
|
||||||
private String dbType;
|
|
||||||
|
|
||||||
// MultipartFile file;
|
|
||||||
}
|
|
|
@ -27,25 +27,7 @@ public class MdmModuleDbEntity extends BaseEntity {
|
||||||
/** 数据类型 1、新增 2、修改 */
|
/** 数据类型 1、新增 2、修改 */
|
||||||
private String dataType;
|
private String dataType;
|
||||||
private List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds;
|
private List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds;
|
||||||
/** 合并规则,字段id使用逗号隔开 */
|
|
||||||
private String mergeRules;
|
|
||||||
private String mergeRulesStr;
|
|
||||||
|
|
||||||
public String getMergeRules() {
|
|
||||||
return mergeRules;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMergeRules(String mergeRules) {
|
|
||||||
this.mergeRules = mergeRules;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMergeRulesStr() {
|
|
||||||
return mergeRulesStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMergeRulesStr(String mergeRulesStr) {
|
|
||||||
this.mergeRulesStr = mergeRulesStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMdmId() {
|
public String getMdmId() {
|
||||||
return mdmId;
|
return mdmId;
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||||
<result property="mergeRules" column="merge_rules" jdbcType="VARCHAR"/>
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<!-- 查询的字段-->
|
<!-- 查询的字段-->
|
||||||
<sql id="MdmModuleDbEntity_Base_Column_List">
|
<sql id="MdmModuleDbEntity_Base_Column_List">
|
||||||
|
@ -33,7 +32,6 @@
|
||||||
,sts
|
,sts
|
||||||
,org_id
|
,org_id
|
||||||
,company_id
|
,company_id
|
||||||
,merge_rules
|
|
||||||
</sql>
|
</sql>
|
||||||
<!-- 查询 采用==查询 -->
|
<!-- 查询 采用==查询 -->
|
||||||
<select id="entity_list_base" resultMap="get-MdmModuleDbEntity-result"
|
<select id="entity_list_base" resultMap="get-MdmModuleDbEntity-result"
|
||||||
|
@ -55,7 +53,6 @@
|
||||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
<if test="mergeRules != null and mergeRules != ''">and merge_rules = #{mergeRules}</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
|
@ -80,7 +77,6 @@
|
||||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
<if test="mergeRules != null and mergeRules != ''">and merge_rules = #{mergeRules}</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
|
@ -111,7 +107,6 @@
|
||||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||||
<if test="mergeRules != null and mergeRules != ''">and merge_rules like concat('%',#{mergeRules},'%')</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
|
@ -138,7 +133,6 @@
|
||||||
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||||
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||||
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||||
<if test="mergeRules != null and mergeRules != ''">or merge_rules = #{mergeRules}</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
|
@ -162,7 +156,6 @@
|
||||||
<if test="sts != null and sts != ''">sts ,</if>
|
<if test="sts != null and sts != ''">sts ,</if>
|
||||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||||
<if test="mergeRules != null and mergeRules != ''">merge_rules ,</if>
|
|
||||||
<if test="sts == null ">sts,</if>
|
<if test="sts == null ">sts,</if>
|
||||||
</trim>
|
</trim>
|
||||||
)values(
|
)values(
|
||||||
|
@ -180,7 +173,6 @@
|
||||||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||||
<if test="mergeRules != null and mergeRules != ''">#{mergeRules} ,</if>
|
|
||||||
<if test="sts == null ">'Y',</if>
|
<if test="sts == null ">'Y',</if>
|
||||||
</trim>
|
</trim>
|
||||||
)
|
)
|
||||||
|
@ -188,10 +180,10 @@
|
||||||
<!-- 批量新增 -->
|
<!-- 批量新增 -->
|
||||||
<insert id="entityInsertBatch">
|
<insert id="entityInsertBatch">
|
||||||
insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id,
|
insert into mdm_module_db(mdm_id, db_name, db_type, remark, create_user_id, create_time, modify_user_id,
|
||||||
modify_time, sts, org_id, company_id, merge_rules, sts)
|
modify_time, sts, org_id, company_id, sts)
|
||||||
values
|
values
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
<foreach collection="entities" item="entity" separator=",">
|
||||||
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.mergeRules},
|
(#{entity.mdmId},#{entity.dbName},#{entity.dbType},#{entity.remark},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||||
'Y')
|
'Y')
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
@ -231,7 +223,6 @@
|
||||||
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
||||||
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
||||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||||
<if test="mergeRules != null and mergeRules != ''">merge_rules = #{mergeRules},</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
@ -253,7 +244,6 @@ where id = #{id}
|
||||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
<if test="mergeRules != null and mergeRules != ''">and merge_rules = #{mergeRules}</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
</update>
|
</update>
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
package com.hzya.frame.mdm.mdmModuleDbFileds.entity;
|
package com.hzya.frame.mdm.mdmModuleDbFileds.entity;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
|
||||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||||
import com.hzya.frame.web.entity.BaseEntity;
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
|
||||||
|
@ -23,13 +20,10 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
|
||||||
/** 模版数据库id */
|
/** 模版数据库id */
|
||||||
private String dbId;
|
private String dbId;
|
||||||
/** 中文名 */
|
/** 中文名 */
|
||||||
@ExcelProperty(value = "中文名称", index = 0)
|
|
||||||
private String chName;
|
private String chName;
|
||||||
/** 英文名 */
|
/** 英文名 */
|
||||||
@ExcelProperty(value = "英文名称", index = 1)
|
|
||||||
private String enName;
|
private String enName;
|
||||||
/** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */
|
/** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */
|
||||||
@ExcelProperty(value = "字段类型", index = 2)
|
|
||||||
private String filedType;
|
private String filedType;
|
||||||
/** 显示类型:新增 */
|
/** 显示类型:新增 */
|
||||||
private String addType;
|
private String addType;
|
||||||
|
@ -39,13 +33,11 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
|
||||||
private String showType;
|
private String showType;
|
||||||
/** 显示类型:查询 */
|
/** 显示类型:查询 */
|
||||||
private String queryType;
|
private String queryType;
|
||||||
|
|
||||||
/** 显示类型:列表 */
|
/** 显示类型:列表 */
|
||||||
private String listType;
|
private String listType;
|
||||||
/** 显示类型:显示 */
|
/** 显示类型:显示 */
|
||||||
private String viewType;
|
private String viewType;
|
||||||
/** 长度 */
|
/** 长度 */
|
||||||
@ExcelProperty(value = "长度", index = 3)
|
|
||||||
private String filedLength;
|
private String filedLength;
|
||||||
/** 公司id */
|
/** 公司id */
|
||||||
private String companyId;
|
private String companyId;
|
||||||
|
@ -65,26 +57,6 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
|
||||||
|
|
||||||
//1、查询2、列表3、新增4、修改 5、查看
|
//1、查询2、列表3、新增4、修改 5、查看
|
||||||
private String fieldType;
|
private String fieldType;
|
||||||
/**
|
|
||||||
* 是否sys主键 系统主键(三方系统主键,同步中台之后,该字段作为主键)Y/N
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "是否系统主键", index = 4)
|
|
||||||
private String isSysPk;
|
|
||||||
/**
|
|
||||||
* 是否sys编码 系统code(三方系统code,同步中台之后,该字段作为code)Y/N
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "是否系统数据编码", index = 5)
|
|
||||||
private String isSysCode;
|
|
||||||
/**
|
|
||||||
* 是否sys名称 系统name(三方系统name,同步中台之后,该字段作为name)Y/N
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "是否系统数据名称", index = 6)
|
|
||||||
private String isSysName;
|
|
||||||
/**
|
|
||||||
* 是否sys日期 系统date(三方系统name,同步中台之后,该字段作为name)Y/N
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "是否系统日期", index = 7)
|
|
||||||
private String isSysDate;
|
|
||||||
public String getMdmId() {
|
public String getMdmId() {
|
||||||
return mdmId;
|
return mdmId;
|
||||||
}
|
}
|
||||||
|
@ -244,67 +216,5 @@ public class MdmModuleDbFiledsEntity extends BaseEntity {
|
||||||
public void setDbType(String dbType) {
|
public void setDbType(String dbType) {
|
||||||
this.dbType = dbType;
|
this.dbType = dbType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getIsSysPk() {
|
|
||||||
return isSysPk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsSysPk(String isSysPk) {
|
|
||||||
this.isSysPk = isSysPk;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsSysCode() {
|
|
||||||
return isSysCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsSysCode(String isSysCode) {
|
|
||||||
this.isSysCode = isSysCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsSysName() {
|
|
||||||
return isSysName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsSysName(String isSysName) {
|
|
||||||
this.isSysName = isSysName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsSysDate() {
|
|
||||||
return isSysDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsSysDate(String isSysDate) {
|
|
||||||
this.isSysDate = isSysDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联的表
|
|
||||||
*/
|
|
||||||
private MdmModuleDbEntity mdmModuleDbEntity;
|
|
||||||
|
|
||||||
public MdmModuleDbEntity getMdmModuleDbEntity() {
|
|
||||||
return mdmModuleDbEntity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMdmModuleDbEntity(MdmModuleDbEntity mdmModuleDbEntity) {
|
|
||||||
this.mdmModuleDbEntity = mdmModuleDbEntity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联字段
|
|
||||||
*/
|
|
||||||
private List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds;
|
|
||||||
|
|
||||||
public List<MdmModuleDbFiledsEntity> getSublistMdmModuleDbFileds() {
|
|
||||||
return sublistMdmModuleDbFileds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSublistMdmModuleDbFileds(List<MdmModuleDbFiledsEntity> sublistMdmModuleDbFileds) {
|
|
||||||
this.sublistMdmModuleDbFileds = sublistMdmModuleDbFileds;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hzya.frame.mdm.mdmModuleDbFileds.dao.impl.MdmModuleDbFiledsDaoImpl">
|
<mapper namespace="com.hzya.frame.mdm.mdmModuleDbFileds.dao.impl.MdmModuleDbFiledsDaoImpl">
|
||||||
|
|
||||||
<resultMap id="get-MdmModuleDbFiledsEntity-result"
|
<resultMap id="get-MdmModuleDbFiledsEntity-result" type="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
|
||||||
type="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
|
||||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||||
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
|
<result property="dbId" column="db_id" jdbcType="VARCHAR"/>
|
||||||
|
@ -25,13 +24,9 @@
|
||||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||||
<result property="isSysPk" column="sys_pk" jdbcType="VARCHAR"/>
|
|
||||||
<result property="isSysCode" column="sys_code" jdbcType="VARCHAR"/>
|
|
||||||
<result property="isSysName" column="sys_name" jdbcType="VARCHAR"/>
|
|
||||||
<result property="isSysDate" column="sys_date" jdbcType="VARCHAR"/>
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<!-- 查询的字段-->
|
<!-- 查询的字段-->
|
||||||
<sql id="MdmModuleDbFiledsEntity_Base_Column_List">
|
<sql id = "MdmModuleDbFiledsEntity_Base_Column_List">
|
||||||
id
|
id
|
||||||
,mdm_id
|
,mdm_id
|
||||||
,db_id
|
,db_id
|
||||||
|
@ -53,43 +48,34 @@
|
||||||
,sts
|
,sts
|
||||||
,org_id
|
,org_id
|
||||||
,company_id
|
,company_id
|
||||||
,sys_pk
|
|
||||||
,sys_code
|
|
||||||
,sys_name
|
|
||||||
,sys_date
|
|
||||||
</sql>
|
</sql>
|
||||||
<!-- 查询 采用==查询 -->
|
<!-- 查询 采用==查询 -->
|
||||||
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsEntity-result"
|
<select id="entity_list_base" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
|
||||||
select
|
select
|
||||||
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
|
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" />
|
||||||
from mdm_module_db_fileds
|
from mdm_module_db_fileds
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''">and id = #{id}</if>
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||||
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
|
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
|
||||||
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
|
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if>
|
||||||
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
|
<if test="enName != null and enName != ''"> and en_name = #{enName} </if>
|
||||||
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
|
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if>
|
||||||
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
|
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
|
||||||
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
|
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if>
|
||||||
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
|
<if test="showType != null and showType != ''"> and show_type = #{showType} </if>
|
||||||
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
|
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if>
|
||||||
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
|
<if test="listType != null and listType != ''"> and list_type = #{listType} </if>
|
||||||
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
|
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if>
|
||||||
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
|
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if>
|
||||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||||
<if test="isSysPk != null and isSysPk != ''">and sys_pk = #{isSysPk}</if>
|
|
||||||
<if test="isSysCode != null and isSysCode != ''">and sys_code = #{isSysCode}</if>
|
|
||||||
<if test="isSysName != null and isSysName != ''">and sys_name = #{isSysName}</if>
|
|
||||||
<if test="isSysDate != null and isSysDate != ''">and sys_date = #{isSysDate}</if>
|
|
||||||
<if test="roletype != null and roletype != ''">
|
<if test="roletype != null and roletype != ''">
|
||||||
and id in (
|
and id in (
|
||||||
select
|
select
|
||||||
|
@ -100,208 +86,172 @@
|
||||||
</if>
|
</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询符合条件的数量 -->
|
<!-- 查询符合条件的数量 -->
|
||||||
<select id="entity_count" resultType="Integer"
|
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
|
||||||
select count(1) from mdm_module_db_fileds
|
select count(1) from mdm_module_db_fileds
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''">and id = #{id}</if>
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||||
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
|
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
|
||||||
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
|
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if>
|
||||||
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
|
<if test="enName != null and enName != ''"> and en_name = #{enName} </if>
|
||||||
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
|
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if>
|
||||||
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
|
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
|
||||||
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
|
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if>
|
||||||
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
|
<if test="showType != null and showType != ''"> and show_type = #{showType} </if>
|
||||||
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
|
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if>
|
||||||
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
|
<if test="listType != null and listType != ''"> and list_type = #{listType} </if>
|
||||||
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
|
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if>
|
||||||
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
|
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if>
|
||||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||||
<if test="isSysPk != null and isSysPk != ''">and sys_pk = #{isSysPk}</if>
|
|
||||||
<if test="isSysCode != null and isSysCode != ''">and sys_code = #{isSysCode}</if>
|
|
||||||
<if test="isSysName != null and isSysName != ''">and sys_name = #{isSysName}</if>
|
|
||||||
<if test="isSysDate != null and isSysDate != ''">and sys_date = #{isSysDate}</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 分页查询列表 采用like格式 -->
|
<!-- 分页查询列表 采用like格式 -->
|
||||||
<select id="entity_list_like" resultMap="get-MdmModuleDbFiledsEntity-result"
|
<select id="entity_list_like" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
|
||||||
select
|
select
|
||||||
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
|
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" />
|
||||||
from mdm_module_db_fileds
|
from mdm_module_db_fileds
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||||
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
|
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
|
||||||
<if test="dbId != null and dbId != ''">and db_id like concat('%',#{dbId},'%')</if>
|
<if test="dbId != null and dbId != ''"> and db_id like concat('%',#{dbId},'%') </if>
|
||||||
<if test="chName != null and chName != ''">and ch_name like concat('%',#{chName},'%')</if>
|
<if test="chName != null and chName != ''"> and ch_name like concat('%',#{chName},'%') </if>
|
||||||
<if test="enName != null and enName != ''">and en_name like concat('%',#{enName},'%')</if>
|
<if test="enName != null and enName != ''"> and en_name like concat('%',#{enName},'%') </if>
|
||||||
<if test="filedType != null and filedType != ''">and filed_type like concat('%',#{filedType},'%')</if>
|
<if test="filedType != null and filedType != ''"> and filed_type like concat('%',#{filedType},'%') </if>
|
||||||
<if test="addType != null and addType != ''">and add_type like concat('%',#{addType},'%')</if>
|
<if test="addType != null and addType != ''"> and add_type like concat('%',#{addType},'%') </if>
|
||||||
<if test="updateType != null and updateType != ''">and update_type like concat('%',#{updateType},'%')</if>
|
<if test="updateType != null and updateType != ''"> and update_type like concat('%',#{updateType},'%') </if>
|
||||||
<if test="showType != null and showType != ''">and show_type like concat('%',#{showType},'%')</if>
|
<if test="showType != null and showType != ''"> and show_type like concat('%',#{showType},'%') </if>
|
||||||
<if test="queryType != null and queryType != ''">and query_type like concat('%',#{queryType},'%')</if>
|
<if test="queryType != null and queryType != ''"> and query_type like concat('%',#{queryType},'%') </if>
|
||||||
<if test="listType != null and listType != ''">and list_type like concat('%',#{listType},'%')</if>
|
<if test="listType != null and listType != ''"> and list_type like concat('%',#{listType},'%') </if>
|
||||||
<if test="viewType != null and viewType != ''">and view_type like concat('%',#{viewType},'%')</if>
|
<if test="viewType != null and viewType != ''"> and view_type like concat('%',#{viewType},'%') </if>
|
||||||
<if test="filedLength != null and filedLength != ''">and filed_length like concat('%',#{filedLength},'%')
|
<if test="filedLength != null and filedLength != ''"> and filed_length like concat('%',#{filedLength},'%') </if>
|
||||||
</if>
|
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||||
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||||
concat('%',#{create_user_id},'%')
|
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||||
</if>
|
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||||
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||||
concat('%',#{modify_user_id},'%')
|
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
|
||||||
</if>
|
|
||||||
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
|
||||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
|
||||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
|
||||||
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
|
||||||
|
|
||||||
<if test="isSysPk != null and isSysPk != ''">and sys_pk like concat('%',#{isSysPk},'%')</if>
|
|
||||||
<if test="isSysCode != null and isSysCode != ''">and sys_code like concat('%',#{isSysCode},'%')</if>
|
|
||||||
<if test="isSysName != null and isSysName != ''">and sys_name like concat('%',#{isSysName},'%')</if>
|
|
||||||
<if test="isSysDate != null and isSysDate != ''">and sys_date like concat('%',#{isSysDate},'%')</if>
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询列表 字段采用or格式 -->
|
<!-- 查询列表 字段采用or格式 -->
|
||||||
<select id="MdmModuleDbFiledsentity_list_or" resultMap="get-MdmModuleDbFiledsEntity-result"
|
<select id="MdmModuleDbFiledsentity_list_or" resultMap="get-MdmModuleDbFiledsEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
||||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
|
||||||
select
|
select
|
||||||
<include refid="MdmModuleDbFiledsEntity_Base_Column_List"/>
|
<include refid="MdmModuleDbFiledsEntity_Base_Column_List" />
|
||||||
from mdm_module_db_fileds
|
from mdm_module_db_fileds
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''">or id = #{id}</if>
|
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||||
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
|
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
|
||||||
<if test="dbId != null and dbId != ''">or db_id = #{dbId}</if>
|
<if test="dbId != null and dbId != ''"> or db_id = #{dbId} </if>
|
||||||
<if test="chName != null and chName != ''">or ch_name = #{chName}</if>
|
<if test="chName != null and chName != ''"> or ch_name = #{chName} </if>
|
||||||
<if test="enName != null and enName != ''">or en_name = #{enName}</if>
|
<if test="enName != null and enName != ''"> or en_name = #{enName} </if>
|
||||||
<if test="filedType != null and filedType != ''">or filed_type = #{filedType}</if>
|
<if test="filedType != null and filedType != ''"> or filed_type = #{filedType} </if>
|
||||||
<if test="addType != null and addType != ''">or add_type = #{addType}</if>
|
<if test="addType != null and addType != ''"> or add_type = #{addType} </if>
|
||||||
<if test="updateType != null and updateType != ''">or update_type = #{updateType}</if>
|
<if test="updateType != null and updateType != ''"> or update_type = #{updateType} </if>
|
||||||
<if test="showType != null and showType != ''">or show_type = #{showType}</if>
|
<if test="showType != null and showType != ''"> or show_type = #{showType} </if>
|
||||||
<if test="queryType != null and queryType != ''">or query_type = #{queryType}</if>
|
<if test="queryType != null and queryType != ''"> or query_type = #{queryType} </if>
|
||||||
<if test="listType != null and listType != ''">or list_type = #{listType}</if>
|
<if test="listType != null and listType != ''"> or list_type = #{listType} </if>
|
||||||
<if test="viewType != null and viewType != ''">or view_type = #{viewType}</if>
|
<if test="viewType != null and viewType != ''"> or view_type = #{viewType} </if>
|
||||||
<if test="filedLength != null and filedLength != ''">or filed_length = #{filedLength}</if>
|
<if test="filedLength != null and filedLength != ''"> or filed_length = #{filedLength} </if>
|
||||||
<if test="sorts != null">or sorts = #{sorts}</if>
|
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||||
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
|
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||||
<if test="create_time != null">or create_time = #{create_time}</if>
|
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
|
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
||||||
<if test="modify_time != null">or modify_time = #{modify_time}</if>
|
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
||||||
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||||
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||||
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
|
||||||
|
|
||||||
<if test="isSysPk != null and isSysPk != ''">or sys_pk = #{isSysPk}</if>
|
|
||||||
<if test="isSysCode != null and isSysCode != ''">or sys_code = #{isSysCode}</if>
|
|
||||||
<if test="isSysName != null and isSysName != ''">or sys_name = #{isSysName}</if>
|
|
||||||
<if test="isSysDate != null and isSysDate != ''">or sys_date = #{isSysDate}</if>
|
|
||||||
|
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--新增所有列-->
|
<!--新增所有列-->
|
||||||
<insert id="entity_insert" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
|
||||||
insert into mdm_module_db_fileds(
|
insert into mdm_module_db_fileds(
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="id != null and id != ''">id ,</if>
|
<if test="id != null and id != ''"> id , </if>
|
||||||
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
|
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
|
||||||
<if test="dbId != null and dbId != ''">db_id ,</if>
|
<if test="dbId != null and dbId != ''"> db_id , </if>
|
||||||
<if test="chName != null and chName != ''">ch_name ,</if>
|
<if test="chName != null and chName != ''"> ch_name , </if>
|
||||||
<if test="enName != null and enName != ''">en_name ,</if>
|
<if test="enName != null and enName != ''"> en_name , </if>
|
||||||
<if test="filedType != null and filedType != ''">filed_type ,</if>
|
<if test="filedType != null and filedType != ''"> filed_type , </if>
|
||||||
<if test="addType != null and addType != ''">add_type ,</if>
|
<if test="addType != null and addType != ''"> add_type , </if>
|
||||||
<if test="updateType != null and updateType != ''">update_type ,</if>
|
<if test="updateType != null and updateType != ''"> update_type , </if>
|
||||||
<if test="showType != null and showType != ''">show_type ,</if>
|
<if test="showType != null and showType != ''"> show_type , </if>
|
||||||
<if test="queryType != null and queryType != ''">query_type ,</if>
|
<if test="queryType != null and queryType != ''"> query_type , </if>
|
||||||
<if test="listType != null and listType != ''">list_type ,</if>
|
<if test="listType != null and listType != ''"> list_type , </if>
|
||||||
<if test="viewType != null and viewType != ''">view_type ,</if>
|
<if test="viewType != null and viewType != ''"> view_type , </if>
|
||||||
<if test="filedLength != null and filedLength != ''">filed_length ,</if>
|
<if test="filedLength != null and filedLength != ''"> filed_length , </if>
|
||||||
<if test="sorts != null">sorts ,</if>
|
<if test="sorts != null"> sorts , </if>
|
||||||
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
|
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||||
<if test="create_time != null">create_time ,</if>
|
<if test="create_time != null"> create_time , </if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
|
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
||||||
<if test="modify_time != null">modify_time ,</if>
|
<if test="modify_time != null"> modify_time , </if>
|
||||||
<if test="sts != null and sts != ''">sts ,</if>
|
<if test="sts != null and sts != ''"> sts , </if>
|
||||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||||
<if test="isSysPk != null and isSysPk != ''">sys_pk ,</if>
|
|
||||||
<if test="isSysCode != null and isSysCode != ''">sys_code ,</if>
|
|
||||||
<if test="isSysName != null and isSysName != ''">sys_name ,</if>
|
|
||||||
<if test="isSysDate != null and isSysDate != ''">sys_date ,</if>
|
|
||||||
<if test="sts == null ">sts,</if>
|
<if test="sts == null ">sts,</if>
|
||||||
</trim>
|
</trim>
|
||||||
)values(
|
)values(
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="id != null and id != ''">#{id} ,</if>
|
<if test="id != null and id != ''"> #{id} ,</if>
|
||||||
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
|
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
|
||||||
<if test="dbId != null and dbId != ''">#{dbId} ,</if>
|
<if test="dbId != null and dbId != ''"> #{dbId} ,</if>
|
||||||
<if test="chName != null and chName != ''">#{chName} ,</if>
|
<if test="chName != null and chName != ''"> #{chName} ,</if>
|
||||||
<if test="enName != null and enName != ''">#{enName} ,</if>
|
<if test="enName != null and enName != ''"> #{enName} ,</if>
|
||||||
<if test="filedType != null and filedType != ''">#{filedType} ,</if>
|
<if test="filedType != null and filedType != ''"> #{filedType} ,</if>
|
||||||
<if test="addType != null and addType != ''">#{addType} ,</if>
|
<if test="addType != null and addType != ''"> #{addType} ,</if>
|
||||||
<if test="updateType != null and updateType != ''">#{updateType} ,</if>
|
<if test="updateType != null and updateType != ''"> #{updateType} ,</if>
|
||||||
<if test="showType != null and showType != ''">#{showType} ,</if>
|
<if test="showType != null and showType != ''"> #{showType} ,</if>
|
||||||
<if test="queryType != null and queryType != ''">#{queryType} ,</if>
|
<if test="queryType != null and queryType != ''"> #{queryType} ,</if>
|
||||||
<if test="listType != null and listType != ''">#{listType} ,</if>
|
<if test="listType != null and listType != ''"> #{listType} ,</if>
|
||||||
<if test="viewType != null and viewType != ''">#{viewType} ,</if>
|
<if test="viewType != null and viewType != ''"> #{viewType} ,</if>
|
||||||
<if test="filedLength != null and filedLength != ''">#{filedLength} ,</if>
|
<if test="filedLength != null and filedLength != ''"> #{filedLength} ,</if>
|
||||||
<if test="sorts != null">#{sorts} ,</if>
|
<if test="sorts != null"> #{sorts} ,</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
|
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||||
<if test="create_time != null">#{create_time} ,</if>
|
<if test="create_time != null"> #{create_time} ,</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
|
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
||||||
<if test="modify_time != null">#{modify_time} ,</if>
|
<if test="modify_time != null"> #{modify_time} ,</if>
|
||||||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||||
<if test="isSysPk != null and isSysPk != ''">#{isSysPk} ,</if>
|
|
||||||
<if test="isSysCode != null and isSysCode != ''">#{isSysCode} ,</if>
|
|
||||||
<if test="isSysName != null and isSysName != ''">#{isSysName} ,</if>
|
|
||||||
<if test="isSysDate != null and isSysDate != ''">#{isSysDate} ,</if>
|
|
||||||
<if test="sts == null ">'Y',</if>
|
<if test="sts == null ">'Y',</if>
|
||||||
</trim>
|
</trim>
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<!-- 批量新增 -->
|
<!-- 批量新增 -->
|
||||||
<insert id="entityInsertBatch">
|
<insert id="entityInsertBatch" >
|
||||||
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type,
|
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||||
query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts,
|
|
||||||
org_id, company_id, sts)
|
|
||||||
values
|
values
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
<foreach collection="entities" item="entity" separator=",">
|
||||||
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
||||||
'Y')
|
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
<!-- 批量新增或者修改-->
|
<!-- 批量新增或者修改-->
|
||||||
<insert id="entityInsertOrUpdateBatch">
|
<insert id="entityInsertOrUpdateBatch" >
|
||||||
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type,
|
insert into mdm_module_db_fileds(mdm_id, db_id, ch_name, en_name, filed_type, add_type, update_type, show_type, query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||||
query_type, list_type, view_type, filed_length, create_user_id, create_time, modify_user_id, modify_time, sts,
|
|
||||||
org_id, company_id)
|
|
||||||
values
|
values
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
<foreach collection="entities" item="entity" separator=",">
|
||||||
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
(#{entity.mdmId},#{entity.dbId},#{entity.chName},#{entity.enName},#{entity.filedType},#{entity.addType},#{entity.updateType},#{entity.showType},#{entity.queryType},#{entity.listType},#{entity.viewType},#{entity.filedLength},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||||
|
@ -325,85 +275,68 @@
|
||||||
modify_time = values(modify_time),
|
modify_time = values(modify_time),
|
||||||
sts = values(sts),
|
sts = values(sts),
|
||||||
org_id = values(org_id),
|
org_id = values(org_id),
|
||||||
company_id = values(company_id)
|
company_id = values(company_id)</insert>
|
||||||
</insert>
|
<!--通过主键修改方法-->
|
||||||
<!--通过主键修改方法-->
|
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
|
||||||
<update id="entity_update" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
update mdm_module_db_fileds set
|
||||||
update mdm_module_db_fileds set
|
<trim suffix="" suffixOverrides=",">
|
||||||
<trim suffix="" suffixOverrides=",">
|
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
|
||||||
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
<if test="dbId != null and dbId != ''"> db_id = #{dbId},</if>
|
||||||
<if test="dbId != null and dbId != ''">db_id = #{dbId},</if>
|
<if test="chName != null and chName != ''"> ch_name = #{chName},</if>
|
||||||
<if test="chName != null and chName != ''">ch_name = #{chName},</if>
|
<if test="enName != null and enName != ''"> en_name = #{enName},</if>
|
||||||
<if test="enName != null and enName != ''">en_name = #{enName},</if>
|
<if test="filedType != null and filedType != ''"> filed_type = #{filedType},</if>
|
||||||
<if test="filedType != null and filedType != ''">filed_type = #{filedType},</if>
|
<if test="addType != null and addType != ''"> add_type = #{addType},</if>
|
||||||
<if test="addType != null and addType != ''">add_type = #{addType},</if>
|
<if test="updateType != null and updateType != ''"> update_type = #{updateType},</if>
|
||||||
<if test="updateType != null and updateType != ''">update_type = #{updateType},</if>
|
<if test="showType != null and showType != ''"> show_type = #{showType},</if>
|
||||||
<if test="showType != null and showType != ''">show_type = #{showType},</if>
|
<if test="queryType != null and queryType != ''"> query_type = #{queryType},</if>
|
||||||
<if test="queryType != null and queryType != ''">query_type = #{queryType},</if>
|
<if test="listType != null and listType != ''"> list_type = #{listType},</if>
|
||||||
<if test="listType != null and listType != ''">list_type = #{listType},</if>
|
<if test="viewType != null and viewType != ''"> view_type = #{viewType},</if>
|
||||||
<if test="viewType != null and viewType != ''">view_type = #{viewType},</if>
|
|
||||||
filed_length = #{filedLength},
|
filed_length = #{filedLength},
|
||||||
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
|
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||||
<if test="create_time != null">create_time = #{create_time},</if>
|
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
|
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
||||||
<if test="modify_time != null">modify_time = #{modify_time},</if>
|
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
||||||
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||||
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
||||||
<if test="isSysPk != null and isSysPk != ''">sys_pk = #{isSysPk},</if>
|
</trim>
|
||||||
<if test="isSysPk == null ">sys_pk = null,</if>
|
where id = #{id}
|
||||||
<if test="isSysCode != null and isSysCode != ''">sys_code = #{isSysCode},</if>
|
</update>
|
||||||
<if test="isSysCode == null ">sys_code = null,</if>
|
<!-- 逻辑删除 -->
|
||||||
<if test="isSysName != null and isSysName != ''">sys_name = #{isSysName},</if>
|
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
|
||||||
<if test="isSysName == null ">sys_name = null,</if>
|
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||||
<if test="isSysDate != null and isSysDate != ''">sys_date = #{isSysDate},</if>
|
where id = #{id}
|
||||||
<if test="isSysDate == null ">sys_date = null,</if>
|
</update>
|
||||||
</trim>
|
<!-- 多条件逻辑删除 -->
|
||||||
where id = #{id}
|
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity" >
|
||||||
</update>
|
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||||
<!-- 逻辑删除 -->
|
|
||||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
|
||||||
update mdm_module_db_fileds
|
|
||||||
set sts= 'N',
|
|
||||||
modify_time = #{modify_time},
|
|
||||||
modify_user_id = #{modify_user_id}
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
<!-- 多条件逻辑删除 -->
|
|
||||||
<update id="entity_logicDelete_Multi_Condition"
|
|
||||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity">
|
|
||||||
update mdm_module_db_fileds set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''">and id = #{id}</if>
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
||||||
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
|
<if test="dbId != null and dbId != ''"> and db_id = #{dbId} </if>
|
||||||
<if test="chName != null and chName != ''">and ch_name = #{chName}</if>
|
<if test="chName != null and chName != ''"> and ch_name = #{chName} </if>
|
||||||
<if test="enName != null and enName != ''">and en_name = #{enName}</if>
|
<if test="enName != null and enName != ''"> and en_name = #{enName} </if>
|
||||||
<if test="filedType != null and filedType != ''">and filed_type = #{filedType}</if>
|
<if test="filedType != null and filedType != ''"> and filed_type = #{filedType} </if>
|
||||||
<if test="addType != null and addType != ''">and add_type = #{addType}</if>
|
<if test="addType != null and addType != ''"> and add_type = #{addType} </if>
|
||||||
<if test="updateType != null and updateType != ''">and update_type = #{updateType}</if>
|
<if test="updateType != null and updateType != ''"> and update_type = #{updateType} </if>
|
||||||
<if test="showType != null and showType != ''">and show_type = #{showType}</if>
|
<if test="showType != null and showType != ''"> and show_type = #{showType} </if>
|
||||||
<if test="queryType != null and queryType != ''">and query_type = #{queryType}</if>
|
<if test="queryType != null and queryType != ''"> and query_type = #{queryType} </if>
|
||||||
<if test="listType != null and listType != ''">and list_type = #{listType}</if>
|
<if test="listType != null and listType != ''"> and list_type = #{listType} </if>
|
||||||
<if test="viewType != null and viewType != ''">and view_type = #{viewType}</if>
|
<if test="viewType != null and viewType != ''"> and view_type = #{viewType} </if>
|
||||||
<if test="filedLength != null and filedLength != ''">and filed_length = #{filedLength}</if>
|
<if test="filedLength != null and filedLength != ''"> and filed_length = #{filedLength} </if>
|
||||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
</update>
|
</update>
|
||||||
<!--通过主键删除-->
|
<!--通过主键删除-->
|
||||||
<delete id="entity_delete">
|
<delete id="entity_delete">
|
||||||
delete
|
delete from mdm_module_db_fileds where id = #{id}
|
||||||
from mdm_module_db_fileds
|
</delete>
|
||||||
where id = #{id}
|
|
||||||
</delete>
|
|
||||||
<!--通过mdmCode删除-->
|
<!--通过mdmCode删除-->
|
||||||
<delete id="deleteMdmModuleDbFileds" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
<delete id="deleteMdmModuleDbFileds" parameterType="com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity">
|
||||||
delete
|
delete from mdm_module_db_fileds where mdm_id = #{mdmId}
|
||||||
from mdm_module_db_fileds
|
</delete>
|
||||||
where mdm_id = #{mdmId}
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.hzya.frame.mdm.mdmModuleDbFileds.service.impl;
|
||||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||||
import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
|
import com.hzya.frame.mdm.mdmModuleDbFileds.dao.IMdmModuleDbFiledsDao;
|
||||||
import com.hzya.frame.mdm.mdmModuleDbFileds.service.IMdmModuleDbFiledsService;
|
import com.hzya.frame.mdm.mdmModuleDbFileds.service.IMdmModuleDbFiledsService;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
|
@ -310,12 +310,7 @@
|
||||||
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
parameterType="com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity">
|
||||||
select count(1) from mdm_module_db_fileds_rule
|
select count(1) from mdm_module_db_fileds_rule
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<!-- <if test="mdmId != null and mdmId != ''">and mdm_id != #{mdmId}</if>-->
|
<if test="mdmId != null and mdmId != ''">and mdm_id != #{mdmId}</if>
|
||||||
<!-- <if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>-->
|
|
||||||
<!-- <if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>-->
|
|
||||||
|
|
||||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
|
||||||
<if test="dbId != null and dbId != ''">and db_id = #{dbId}</if>
|
|
||||||
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
|
<if test="ruleCode != null and ruleCode != ''">and rule_code = #{ruleCode}</if>
|
||||||
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>
|
<if test="ruleValue != null and ruleValue != ''">and rule_value = #{ruleValue}</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.hzya.frame.nifiapi;//package com.hzya.frame.nifi;
|
||||||
|
//
|
||||||
|
//import org.springframework.boot.SpringApplication;
|
||||||
|
//import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
//
|
||||||
|
//@SpringBootApplication(scanBasePackages = "com.hzya.frame.nifi")
|
||||||
|
//public class NifiApplication {
|
||||||
|
// public static void main(String[] args) {
|
||||||
|
// SpringApplication.run(NifiApplication.class, args);
|
||||||
|
// }
|
||||||
|
//}
|
|
@ -0,0 +1,238 @@
|
||||||
|
package com.hzya.frame.nifiapi.client;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.hzya.frame.nifiapi.config.NifiServiceConfig;
|
||||||
|
import okhttp3.*;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nifi客户端请求处理
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.client
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:NifiClient
|
||||||
|
* @Date:2025/5/14 10:00
|
||||||
|
* @Filename:NifiClient
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class NifiClient {
|
||||||
|
|
||||||
|
private final NifiServiceConfig config;
|
||||||
|
private final OkHttpClient httpClient;
|
||||||
|
private final ObjectMapper objectMapper;
|
||||||
|
private final AtomicReference<String> accessToken = new AtomicReference<>();
|
||||||
|
private volatile long tokenIssueTime; // Token 发行时间(毫秒)
|
||||||
|
private volatile long tokenExpiration; // Token 过期时间(毫秒)
|
||||||
|
Logger logger = LoggerFactory.getLogger(NifiClient.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public NifiClient(NifiServiceConfig config, OkHttpClient httpClient, ObjectMapper objectMapper) {
|
||||||
|
this.config = config;
|
||||||
|
this.httpClient = httpClient;
|
||||||
|
this.objectMapper = objectMapper;
|
||||||
|
initializeToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initializeToken() {
|
||||||
|
try {
|
||||||
|
accessToken.set(getAccessToken());
|
||||||
|
tokenIssueTime = System.currentTimeMillis();
|
||||||
|
tokenExpiration = tokenIssueTime + (12 * 60 * 60 * 1000); // 默认 12 小时
|
||||||
|
logger.info("令牌已初始化,过期时间:" + new java.util.Date(tokenExpiration));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("初始化NiFi访问令牌失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T get(String path, Class<T> responseType) throws IOException {
|
||||||
|
return executeRequestWithRetry(() -> {
|
||||||
|
Request request = new Request.Builder().url(config.getApiUrl() + path).get().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||||
|
return executeRequest(request, responseType);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取原始JSON响应字符串,不进行反序列化
|
||||||
|
*/
|
||||||
|
public String getRaw(String path) throws IOException {
|
||||||
|
return executeRequestWithRetry(() -> {
|
||||||
|
Request request = new Request.Builder().url(config.getApiUrl() + path).get().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||||
|
try (Response response = httpClient.newCall(request).execute()) {
|
||||||
|
if (!response.isSuccessful()) {
|
||||||
|
throw new IOException("意外的响应码: " + response.code());
|
||||||
|
}
|
||||||
|
return response.body().string();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行GET请求并返回文件流,供调用者处理(如保存到文件或浏览器下载)
|
||||||
|
*/
|
||||||
|
public InputStream getAsStream(String path) throws IOException {
|
||||||
|
return executeRequestWithRetry(() -> {
|
||||||
|
Request request = new Request.Builder().url(config.getApiUrl() + path).get().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||||
|
return executeStreamRequest(request);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T post(String path, Object requestBody, Class<T> responseType) throws IOException {
|
||||||
|
String jsonBody = objectMapper.writeValueAsString(requestBody);
|
||||||
|
RequestBody body = RequestBody.create(jsonBody, MediaType.get("application/json; charset=utf-8"));
|
||||||
|
return executeRequestWithRetry(() -> {
|
||||||
|
Request request = new Request.Builder().url(config.getApiUrl() + path).post(body).header("Authorization", "Bearer " + accessToken.get()).build();
|
||||||
|
return executeRequest(request, responseType);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T delete(String path, Class<T> responseType) throws IOException {
|
||||||
|
return executeRequestWithRetry(() -> {
|
||||||
|
Request request = new Request.Builder().url(config.getApiUrl() + path).delete().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||||
|
return executeRequest(request, responseType);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T delete(String path, Map<String, String> queryParams, Class<T> responseType) throws IOException {
|
||||||
|
// 构建 URL 并添加查询参数
|
||||||
|
HttpUrl.Builder urlBuilder = HttpUrl.parse(config.getApiUrl() + path).newBuilder();
|
||||||
|
if (queryParams != null) {
|
||||||
|
queryParams.forEach(urlBuilder::addQueryParameter);
|
||||||
|
}
|
||||||
|
String url = urlBuilder.build().toString();
|
||||||
|
|
||||||
|
return executeRequestWithRetry(() -> {
|
||||||
|
Request request = new Request.Builder().url(url).delete().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||||
|
return executeRequest(request, responseType);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T put(String path, Object requestBody, Class<T> responseType) throws IOException {
|
||||||
|
String jsonBody = objectMapper.writeValueAsString(requestBody);
|
||||||
|
RequestBody body = RequestBody.create(jsonBody, MediaType.get("application/json; charset=utf-8"));
|
||||||
|
return executeRequestWithRetry(() -> {
|
||||||
|
Request request = new Request.Builder().url(config.getApiUrl() + path).put(body).header("Authorization", "Bearer " + accessToken.get()).build();
|
||||||
|
return executeRequest(request, responseType);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> T executeRequestWithRetry(IOExceptionRunnable<T> runnable) throws IOException {
|
||||||
|
int maxRetries = 2;
|
||||||
|
for (int attempt = 0; attempt < maxRetries; attempt++) {
|
||||||
|
try {
|
||||||
|
checkAndRefreshToken();
|
||||||
|
return runnable.run();
|
||||||
|
} catch (IOException e) {
|
||||||
|
if (attempt == maxRetries - 1 || !isTokenExpiredError(e)) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
logger.info("令牌可能已过期,请刷新并重试...");
|
||||||
|
try {
|
||||||
|
accessToken.set(getAccessToken());
|
||||||
|
tokenIssueTime = System.currentTimeMillis();
|
||||||
|
tokenExpiration = tokenIssueTime + (12 * 60 * 60 * 1000); // 默认 12 小时
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new IOException("刷新令牌失败: " + ex.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IOException("已达到最大重试次数");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkAndRefreshToken() throws IOException {
|
||||||
|
long currentTime = System.currentTimeMillis();
|
||||||
|
if (currentTime > tokenExpiration - 300000) { // 提前 5 分钟刷新
|
||||||
|
try {
|
||||||
|
accessToken.set(getAccessToken());
|
||||||
|
tokenIssueTime = System.currentTimeMillis();
|
||||||
|
tokenExpiration = tokenIssueTime + (12 * 60 * 60 * 1000); // 默认 12 小时
|
||||||
|
logger.info("令牌已刷新,到期时间: " + new java.util.Date(tokenExpiration));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IOException("刷新令牌失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isTokenExpiredError(IOException e) {
|
||||||
|
// 判断是否为 401 错误(Token 过期)
|
||||||
|
return e.getMessage().contains("401") || e.getMessage().contains("Unauthorized");
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> T executeRequest(Request request, Class<T> responseType) throws IOException {
|
||||||
|
try (Response response = httpClient.newCall(request).execute()) {
|
||||||
|
String responseBody = response.body().string();
|
||||||
|
logger.info("响应体:" + responseBody);
|
||||||
|
if (!response.isSuccessful()) {
|
||||||
|
throw new IOException(StrUtil.format("意外的响应码: {}", responseBody));
|
||||||
|
}
|
||||||
|
return objectMapper.readValue(responseBody, responseType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized String getAccessToken() throws Exception {
|
||||||
|
// 创建信任所有证书的 OkHttpClient
|
||||||
|
// OkHttpClient client = httpClient.newBuilder().sslSocketFactory(createTrustAllSslSocketFactory(), createTrustAllTrustManager()).hostnameVerifier((hostname, session) -> true).build();
|
||||||
|
|
||||||
|
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
||||||
|
RequestBody body = RequestBody.create(mediaType, "username=" + config.getUsername() + "&password=" + config.getPassword());
|
||||||
|
Request request = new Request.Builder().url(config.getApiUrl() + "/access/token").post(body).addHeader("Content-Type", "application/x-www-form-urlencoded").addHeader("Accept", "*/*").addHeader("User-Agent", "fw-nifi-client/1.0").addHeader("Connection", "keep-alive").build();
|
||||||
|
|
||||||
|
try (Response response = httpClient.newCall(request).execute()) {
|
||||||
|
if (!response.isSuccessful()) {
|
||||||
|
throw new IOException("获取访问令牌失败,响应码: " + response.code() + " - " + response.message());
|
||||||
|
}
|
||||||
|
byte[] bytes = response.body().bytes();
|
||||||
|
String newToken = new String(bytes, StandardCharsets.UTF_8);
|
||||||
|
return newToken;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// private SSLSocketFactory createTrustAllSslSocketFactory() throws Exception {
|
||||||
|
// SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||||
|
// sslContext.init(null, new TrustManager[]{createTrustAllTrustManager()}, new SecureRandom());
|
||||||
|
// return sslContext.getSocketFactory();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private X509TrustManager createTrustAllTrustManager() {
|
||||||
|
// return new X509TrustManager() {
|
||||||
|
// @Override
|
||||||
|
// public void checkClientTrusted(X509Certificate[] chain, String authType) {
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void checkServerTrusted(X509Certificate[] chain, String authType) {
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public X509Certificate[] getAcceptedIssuers() {
|
||||||
|
// return new X509Certificate[0];
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
|
||||||
|
private InputStream executeStreamRequest(Request request) throws IOException {
|
||||||
|
Response response = httpClient.newCall(request).execute();
|
||||||
|
if (!response.isSuccessful()) {
|
||||||
|
String responseBody = response.body().string();
|
||||||
|
response.close();
|
||||||
|
throw new IOException("意外的响应码: " + responseBody);
|
||||||
|
}
|
||||||
|
return response.body().byteStream();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 功能接口,用于重试逻辑
|
||||||
|
@FunctionalInterface
|
||||||
|
private interface IOExceptionRunnable<T> {
|
||||||
|
T run() throws IOException;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.hzya.frame.nifiapi.config;
|
||||||
|
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLContext;
|
||||||
|
import javax.net.ssl.SSLSocketFactory;
|
||||||
|
import javax.net.ssl.TrustManager;
|
||||||
|
import javax.net.ssl.X509TrustManager;
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OkHttpClient配置类
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.config
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:HttpClientConfig
|
||||||
|
* @Date:2025/5/14 11:45
|
||||||
|
* @Filename:HttpClientConfig
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class HttpClientConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public OkHttpClient okHttpClient() throws Exception {
|
||||||
|
|
||||||
|
//调用nifi接口正常情况不会超过60秒的,目前遇到的接口1秒以内调用完毕
|
||||||
|
return new OkHttpClient.Builder().sslSocketFactory(createTrustAllSslSocketFactory(), createTrustAllTrustManager()).hostnameVerifier((hostname, session) -> true).connectTimeout(60, TimeUnit.SECONDS) // 连接超时时间
|
||||||
|
.readTimeout(60, TimeUnit.SECONDS) // 读取超时时间
|
||||||
|
.writeTimeout(60, TimeUnit.SECONDS) // 写入超时时间
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private SSLSocketFactory createTrustAllSslSocketFactory() throws Exception {
|
||||||
|
SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||||
|
sslContext.init(null, new TrustManager[]{createTrustAllTrustManager()}, new SecureRandom());
|
||||||
|
return sslContext.getSocketFactory();
|
||||||
|
}
|
||||||
|
|
||||||
|
private X509TrustManager createTrustAllTrustManager() {
|
||||||
|
return new X509TrustManager() {
|
||||||
|
@Override
|
||||||
|
public void checkClientTrusted(X509Certificate[] chain, String authType) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkServerTrusted(X509Certificate[] chain, String authType) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return new X509Certificate[0];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.hzya.frame.nifiapi.config;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jackson配置类
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.config
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:JacksonConfig
|
||||||
|
* @Date:2025/5/14 11:54
|
||||||
|
* @Filename:JacksonConfig
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class JacksonConfig {
|
||||||
|
@Bean
|
||||||
|
public ObjectMapper objectMapper() {
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
// 自动注册模块
|
||||||
|
objectMapper.findAndRegisterModules();
|
||||||
|
// 忽略 JSON 中存在但实体类中缺少的字段
|
||||||
|
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
return objectMapper;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.hzya.frame.nifiapi.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nifi service配置类
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.config
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:NifiConfig
|
||||||
|
* @Date:2025/5/14 09:59
|
||||||
|
* @Filename:NifiConfig
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@Data
|
||||||
|
public class NifiServiceConfig {
|
||||||
|
|
||||||
|
@Value("${nifi.api.url:https://192.168.2.233:8443/nifi-api}")
|
||||||
|
private String apiUrl;
|
||||||
|
|
||||||
|
@Value("${nifi.api.username:hzya}")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@Value("${nifi.api.password:hzya1314*nifi}")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Value("${nifi.api.controllerModifymark:接口修改标记}")
|
||||||
|
private String controllerModifyMark;
|
||||||
|
|
||||||
|
@Value("${nifi.api.relationshipMark:接口关系标记}")
|
||||||
|
private String relationshipMark;
|
||||||
|
|
||||||
|
@Value("${nifi.api.relationshipMark:接口状态清理标记}")
|
||||||
|
private String stateClearMark;
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.basemodel;
|
||||||
|
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreparamcontext.CreateParamContextJoin;
|
||||||
|
import com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller.FindNeedModifyController;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基类封转创建应用操作公共的字段
|
||||||
|
*
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joincreateoracleapp
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:CreateOracleApp
|
||||||
|
* @Date:2025/5/21 17:44
|
||||||
|
* @Filename:CreateOracleApp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class JoinBashModel {
|
||||||
|
//实例化
|
||||||
|
private String appProcessGroupId;
|
||||||
|
private String parentProcessGroupId;
|
||||||
|
private String copyTargetProcessGroupId;
|
||||||
|
// private String copyTargetParentProcessGroupId;
|
||||||
|
|
||||||
|
//上下文
|
||||||
|
private CreateParamContextJoin createParamContextJoin;
|
||||||
|
|
||||||
|
//控制器
|
||||||
|
private FindNeedModifyController findNeedModifyController;
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated: 2025-05-16 11:1:46
|
||||||
|
*
|
||||||
|
* @author bejson.com (i@bejson.com)
|
||||||
|
* @website http://www.bejson.com/java2pojo/
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BindParameterContextsJoin11 {
|
||||||
|
private Revision11 revision;
|
||||||
|
private Component11 component;
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated: 2025-05-16 11:1:46
|
||||||
|
*
|
||||||
|
* @author bejson.com (i@bejson.com)
|
||||||
|
* @website http://www.bejson.com/java2pojo/
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Component11 {
|
||||||
|
private String id;
|
||||||
|
private ParameterContext11 parameterContext;
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ParameterContext11 {
|
||||||
|
private String id;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2025 bejson.com
|
||||||
|
*/
|
||||||
|
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated: 2025-05-16 11:1:46
|
||||||
|
*
|
||||||
|
* @author bejson.com (i@bejson.com)
|
||||||
|
* @website http://www.bejson.com/java2pojo/
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Revision11 {
|
||||||
|
private String version;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincontrollerenabled;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincontrollerenabled
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:EnOrDiControllerServices
|
||||||
|
* @Date:2025/5/16 16:54
|
||||||
|
* @Filename:EnOrDiControllerServices
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EnOrDiControllerServices12 {
|
||||||
|
private String state;
|
||||||
|
private Revision13 revision;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincontrollerenabled;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincontrollerenabled
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:ControllerServiceStatus
|
||||||
|
* @Date:2025/5/16 16:54
|
||||||
|
* @Filename:ControllerServiceStatus
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Revision13 {
|
||||||
|
private String version;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateconnection;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincreateconnection
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Component18
|
||||||
|
* @Date:2025/5/19 15:39
|
||||||
|
* @Filename:Component18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Component18 {
|
||||||
|
private String id;
|
||||||
|
private String parentGroupId;
|
||||||
|
private String backPressureObjectThreshold;
|
||||||
|
private String backPressureDataSizeThreshold;
|
||||||
|
private String flowFileExpiration;
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateconnection;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincreateconnection
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:CreateConnection
|
||||||
|
* @Date:2025/5/19 15:35
|
||||||
|
* @Filename:CreateConnection
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreateConnection18 {
|
||||||
|
private String id;
|
||||||
|
private String sourceId;
|
||||||
|
private String sourceGroupId;
|
||||||
|
private String sourceType;
|
||||||
|
private String destinationId;
|
||||||
|
private String destinationGroupId;
|
||||||
|
private String destinationType;
|
||||||
|
private Revision18 revision;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateconnection;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincreateconnection
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Revision18
|
||||||
|
* @Date:2025/5/19 15:36
|
||||||
|
* @Filename:Revision18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Revision18 {
|
||||||
|
private String version;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Component17
|
||||||
|
* @Date:2025/5/19 11:58
|
||||||
|
* @Filename:Component17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Component18 {
|
||||||
|
private SourceOrDestination18 source;
|
||||||
|
private SourceOrDestination18 destination;
|
||||||
|
private List<String> selectedRelationships;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:CreateConnections
|
||||||
|
* @Date:2025/5/19 11:56
|
||||||
|
* @Filename:CreateConnections
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreateConnections18 {
|
||||||
|
private Revision18 revision;
|
||||||
|
private Component18 component;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Revision17
|
||||||
|
* @Date:2025/5/19 11:56
|
||||||
|
* @Filename:Revision17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Revision18 {
|
||||||
|
private String version;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:SourceOrDestination
|
||||||
|
* @Date:2025/5/19 13:39
|
||||||
|
* @Filename:SourceOrDestination
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SourceOrDestination18 {
|
||||||
|
private String id;
|
||||||
|
private String groupId;
|
||||||
|
private String type;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreatemysqlapp;
|
||||||
|
|
||||||
|
import com.hzya.frame.nifiapi.model.basemodel.JoinBashModel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joincreateoracleapp
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:CreateOracleApp
|
||||||
|
* @Date:2025/5/21 17:44
|
||||||
|
* @Filename:CreateOracleApp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreateMysqlApp extends JoinBashModel {
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateoracleapp;
|
||||||
|
|
||||||
|
import com.hzya.frame.nifiapi.model.basemodel.JoinBashModel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joincreateoracleapp
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:CreateOracleApp
|
||||||
|
* @Date:2025/5/21 17:44
|
||||||
|
* @Filename:CreateOracleApp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreateAppInstanceJoin extends JoinBashModel {
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateprocessconnection;
|
||||||
|
|
||||||
|
import com.hzya.frame.nifiapi.model.joincreateconnections.CreateConnections18;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joincreateprocessconnection
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:CreateProcessorConnections
|
||||||
|
* @Date:2025/5/22 14:06
|
||||||
|
* @Filename:CreateProcessorConnections
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreateProcessorConnections {
|
||||||
|
private String processGroupsId;
|
||||||
|
private List<CreateConnections18> createConnections18;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreateprocessorandupdateparam;
|
||||||
|
|
||||||
|
import com.hzya.frame.nifiapi.model.resultprocessorsinfo.Component16;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joincerateprocessorandupdateparam
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:CreateProcessorAndUpdateParam
|
||||||
|
* @Date:2025/5/26 15:59
|
||||||
|
* @Filename:CreateProcessorAndUpdateParam
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreateProcessorAndUpdateParamJoin {
|
||||||
|
private String targetProcessorId;
|
||||||
|
private String parentProcessGroupId;
|
||||||
|
private String copyTargetProcessGroupId;
|
||||||
|
private Component16 component;
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreatetemp;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joincreatetemp
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:CreateTemplateJoin
|
||||||
|
* @Date:2025/5/17 10:52
|
||||||
|
* @Filename:CreateTemplateJoin
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreateTemplateJoin {
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
private String snippetId;
|
||||||
|
private String disconnectedNodeAcknowledged;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joincreparamcontext;
|
||||||
|
|
||||||
|
import com.hzya.frame.nifiapi.model.joinparametercontexts.ParameterContextsJoin;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joincreparamcontext
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:CreateParamContextJoin
|
||||||
|
* @Date:2025/5/22 08:58
|
||||||
|
* @Filename:CreateParamContextJoin
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreateParamContextJoin {
|
||||||
|
private ParameterContextsJoin parameterContextsJoin;
|
||||||
|
private String processGroupsId;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller;
|
||||||
|
|
||||||
|
import com.hzya.frame.nifiapi.model.joingetcontroller.ControllerService12;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:FindNeedModifyController
|
||||||
|
* @Date:2025/5/22 11:03
|
||||||
|
* @Filename:FindNeedModifyController
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FindNeedModifyController {
|
||||||
|
private String processGroupId;
|
||||||
|
private List<ControllerService12> needModifyController;
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joingetallcontrollerservice;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joingetallcontrollerservice
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Component19
|
||||||
|
* @Date:2025/5/22 10:28
|
||||||
|
* @Filename:Component19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Component19 {
|
||||||
|
private String id;
|
||||||
|
private String name;
|
||||||
|
private String type;
|
||||||
|
private String state;
|
||||||
|
private String validationStatus;
|
||||||
|
private String bulletinLevel;
|
||||||
|
private String extensionMissing;
|
||||||
|
private String comments;
|
||||||
|
private Map<String, String> properties;
|
||||||
|
private String persistsState;
|
||||||
|
private String restricted;
|
||||||
|
private String deprecated;
|
||||||
|
private String multipleVersionsAvailable;
|
||||||
|
private String supportsSensitiveDynamicProperties;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joingetallcontrollerservice;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joingetallcontrollerservice
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:ControllerServices19
|
||||||
|
* @Date:2025/5/22 10:15
|
||||||
|
* @Filename:ControllerServices19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ControllerServices19 {
|
||||||
|
private String id;
|
||||||
|
private String uri;
|
||||||
|
private Component19 component;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joingetallcontrollerservice;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author :liuyang
|
||||||
|
* @Package :com.hzya.frame.nifiapi.model.joingetallcontrollerservice
|
||||||
|
* @Project :fw-nifi
|
||||||
|
* @name :GetAllController
|
||||||
|
* @Date :2025/5/22 10:13
|
||||||
|
* @Filename :GetAllController
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class GetAllController19 {
|
||||||
|
private List<ControllerServices19> controllerServices;
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joingetcontroller;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Component11
|
||||||
|
* @Date:2025/5/16 13:59
|
||||||
|
* @Filename:Component11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Component12 {
|
||||||
|
private String id;//随机字符串
|
||||||
|
private String name;
|
||||||
|
private String type;
|
||||||
|
private String state;
|
||||||
|
//每个不同类型的控制器服务对应的属性都不一样,这里就很坑
|
||||||
|
private Map<String, String> properties;
|
||||||
|
private String validationStatus;
|
||||||
|
private String bulletinLevel;
|
||||||
|
private String extensionMissing;
|
||||||
|
private String comments;
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joingetcontroller;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:ControllerSerbices
|
||||||
|
* @Date:2025/5/16 13:57
|
||||||
|
* @Filename:ControllerSerbices
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ControllerService12 {
|
||||||
|
//控制器服务id
|
||||||
|
private String id;
|
||||||
|
private Revision12 revision;
|
||||||
|
private Component12 component;
|
||||||
|
//修改标记id
|
||||||
|
private String modifyMarkId;
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joingetcontroller;//package com.hzya.frame.nifi.model.joingetcontroller;
|
||||||
|
//
|
||||||
|
//import lombok.Data;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * @Author:liuyang
|
||||||
|
// * @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||||
|
// * @Project:fw-nifi
|
||||||
|
// * @name:Properties11
|
||||||
|
// * @Date:2025/5/16 14:00
|
||||||
|
// * @Filename:Properties11
|
||||||
|
// */
|
||||||
|
//@Data
|
||||||
|
//public class Properties11 {
|
||||||
|
// private String databaseConnectionUrl;
|
||||||
|
// private String databaseDriverClassName;
|
||||||
|
// private String databaseDriverLocations;
|
||||||
|
// private String databaseUser;
|
||||||
|
// private String password;
|
||||||
|
// private String maxWaitTime;
|
||||||
|
// private String maxTotalConnections;
|
||||||
|
// private String validationQuery;
|
||||||
|
// private String dbcpMinIdleConns;
|
||||||
|
//}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joingetcontroller;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Revision11
|
||||||
|
* @Date:2025/5/16 13:58
|
||||||
|
* @Filename:Revision11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Revision12 {
|
||||||
|
private String version;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated: 2025-05-14 18:33:21
|
||||||
|
*
|
||||||
|
* @author bejson.com (i@bejson.com)
|
||||||
|
* @website http://www.bejson.com/java2pojo/
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Component3 {
|
||||||
|
private String name;
|
||||||
|
private List<Parameters2> parameters;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Parameter2 {
|
||||||
|
private String name;
|
||||||
|
private String value;
|
||||||
|
private boolean sensitive;
|
||||||
|
private String description;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ParameterContextsJoin {
|
||||||
|
private Revision revision;
|
||||||
|
private Component3 component;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2025 bejson.com
|
||||||
|
*/
|
||||||
|
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Parameters2 {
|
||||||
|
private Parameter2 parameter;
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Revision {
|
||||||
|
private int version;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Component7 {
|
||||||
|
private String name;
|
||||||
|
private Position7 position;
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifiapi.model.joinprocessgroups
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Position7
|
||||||
|
* @Date:2025/5/21 14:57
|
||||||
|
* @Filename:Position7
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Position7 {
|
||||||
|
private String x;
|
||||||
|
private String y;
|
||||||
|
|
||||||
|
public Position7() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Position7(String x, String y) {
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joinprocessgroups
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:ProcessGroupStatus
|
||||||
|
* @Date:2025/5/15 10:43
|
||||||
|
* @Filename:ProcessGroupStatus
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProcessGroupStatus {
|
||||||
|
private String name;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joinprocessgroups
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:ProcessGroupsJoin
|
||||||
|
* @Date:2025/5/15 10:43
|
||||||
|
* @Filename:ProcessGroupsJoin
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProcessGroupsJoin {
|
||||||
|
private Revision5 revision;
|
||||||
|
// private ProcessGroupStatus status;
|
||||||
|
private Component7 component;
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Revision5 {
|
||||||
|
private int version;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinsnippetinstance;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joinsnippetinstance
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:SnippetInstanceJoin
|
||||||
|
* @Date:2025/5/17 14:21
|
||||||
|
* @Filename:SnippetInstanceJoin
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SnippetInstanceJoin {
|
||||||
|
private String snippetId;
|
||||||
|
private String originX;
|
||||||
|
private String originY;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinsnippets;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joinsnippets
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Snippet
|
||||||
|
* @Date:2025/5/17 11:01
|
||||||
|
* @Filename:Snippet
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Snippet {
|
||||||
|
private String parentGroupId;
|
||||||
|
private Map<String, Map<String, String>> processGroups;
|
||||||
|
private Map<String, Map<String, String>> processors;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinsnippets;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joinsnippets
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:SnippetsJoin
|
||||||
|
* @Date:2025/5/17 11:00
|
||||||
|
* @Filename:SnippetsJoin
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SnippetsJoin {
|
||||||
|
private Snippet snippet;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
/**
|
||||||
|
* Copyright 2025 bejson.com
|
||||||
|
*/
|
||||||
|
package com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated: 2025-05-16 10:47:3
|
||||||
|
*
|
||||||
|
* @author bejson.com (i@bejson.com)
|
||||||
|
* @website http://www.bejson.com/java2pojo/
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Revision10 {
|
||||||
|
private String version;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated: 2025-05-16 10:47:3
|
||||||
|
*
|
||||||
|
* @author bejson.com (i@bejson.com)
|
||||||
|
* @website http://www.bejson.com/java2pojo/
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StartOrStopProcessGroupsInfoJoin10 {
|
||||||
|
private String id;
|
||||||
|
private String state;
|
||||||
|
private Revision10 revision;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinupdateprocessor;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joinupdateprocessor
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Revision17
|
||||||
|
* @Date:2025/5/19 11:26
|
||||||
|
* @Filename:Revision17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Revision17 {
|
||||||
|
private String version;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.joinupdateprocessor;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.joinupdateprocessor
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:RunStatusOrStop
|
||||||
|
* @Date:2025/5/19 11:25
|
||||||
|
* @Filename:RunStatusOrStop
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RunStatusOrStop17 {
|
||||||
|
private String state;
|
||||||
|
private Revision17 revision;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class NifiTemplates {
|
||||||
|
private List<Templates> templates;
|
||||||
|
private String generated;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Permissions {
|
||||||
|
private String canRead;
|
||||||
|
private String canWrite;
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Template {
|
||||||
|
private String uri;
|
||||||
|
private String id;
|
||||||
|
private String groupId;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
private String timestamp;
|
||||||
|
@JsonProperty("encoding-version")
|
||||||
|
private String encodingVersion;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Templates {
|
||||||
|
private String id;
|
||||||
|
private Permissions permissions;
|
||||||
|
private Template template;
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AggregateSnapshot {
|
||||||
|
private String id;
|
||||||
|
private String groupId;
|
||||||
|
private String name;
|
||||||
|
private String type;
|
||||||
|
private String runStatus;
|
||||||
|
private String executionNode;
|
||||||
|
private String bytesRead;
|
||||||
|
private String bytesWritten;
|
||||||
|
private String read;
|
||||||
|
private String written;
|
||||||
|
private String flowFilesIn;
|
||||||
|
private String bytesIn;
|
||||||
|
private String input;
|
||||||
|
private String flowFilesOut;
|
||||||
|
private String bytesOut;
|
||||||
|
private String output;
|
||||||
|
private String taskCount;
|
||||||
|
private String tasksDurationNanos;
|
||||||
|
private String tasks;
|
||||||
|
private String tasksDuration;
|
||||||
|
private String activeThreadCount;
|
||||||
|
private String terminatedThreadCount;
|
||||||
|
private ProcessingPerformanceStatus processingPerformanceStatus;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AllowableValue {
|
||||||
|
private String displayName;
|
||||||
|
private String value;
|
||||||
|
private String description;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AllowableValues {
|
||||||
|
private AllowableValue allowableValue;
|
||||||
|
private String canRead;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AttributesToIgnore {
|
||||||
|
private String name;
|
||||||
|
private String displayName;
|
||||||
|
private String description;
|
||||||
|
private String required;
|
||||||
|
private String sensitive;
|
||||||
|
private String dynamic;
|
||||||
|
private String supportsEl;
|
||||||
|
private String expressionLanguageScope;
|
||||||
|
private List<String> dependencies;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AttributesToIgnoreRegex {
|
||||||
|
private String name;
|
||||||
|
private String displayName;
|
||||||
|
private String description;
|
||||||
|
private String required;
|
||||||
|
private String sensitive;
|
||||||
|
private String dynamic;
|
||||||
|
private String supportsEl;
|
||||||
|
private String expressionLanguageScope;
|
||||||
|
private List<String> dependencies;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AttributesToLog {
|
||||||
|
private String name;
|
||||||
|
private String displayName;
|
||||||
|
private String description;
|
||||||
|
private String required;
|
||||||
|
private String sensitive;
|
||||||
|
private String dynamic;
|
||||||
|
private String supportsEl;
|
||||||
|
private String expressionLanguageScope;
|
||||||
|
private List<String> dependencies;
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AttributesToLogRegex {
|
||||||
|
private String name;
|
||||||
|
private String displayName;
|
||||||
|
private String description;
|
||||||
|
private String defaultValue;
|
||||||
|
private String required;
|
||||||
|
private String sensitive;
|
||||||
|
private String dynamic;
|
||||||
|
private String supportsEl;
|
||||||
|
private String expressionLanguageScope;
|
||||||
|
private List<String> dependencies;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Breadcrumb {
|
||||||
|
private String id;
|
||||||
|
private String name;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Breadcrumb2 {
|
||||||
|
private String id;
|
||||||
|
private Permissions2 permissions;
|
||||||
|
private Breadcrumb3 breadcrumb;
|
||||||
|
private ParentBreadcrumb2 parentBreadcrumb;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:liuyang
|
||||||
|
* @Package:com.hzya.frame.nifi.model.processgroupid
|
||||||
|
* @Project:fw-nifi
|
||||||
|
* @name:Breadcrumb3
|
||||||
|
* @Date:2025/5/14 17:57
|
||||||
|
* @Filename:Breadcrumb3
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Breadcrumb3 {
|
||||||
|
private String id;
|
||||||
|
private String name;
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Bulletin {
|
||||||
|
private String id;
|
||||||
|
private String category;
|
||||||
|
private String groupId;
|
||||||
|
private String sourceId;
|
||||||
|
private String sourceName;
|
||||||
|
private String level;
|
||||||
|
private String message;
|
||||||
|
private String timestamp;
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Bulletins {
|
||||||
|
private String id;
|
||||||
|
private String groupId;
|
||||||
|
private String sourceId;
|
||||||
|
private String timestamp;
|
||||||
|
private String canRead;
|
||||||
|
private Bulletin bulletin;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Bundle {
|
||||||
|
private String group;
|
||||||
|
private String artifact;
|
||||||
|
private String version;
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CharacterSet {
|
||||||
|
private String name;
|
||||||
|
private String displayName;
|
||||||
|
private String description;
|
||||||
|
private String defaultValue;
|
||||||
|
private String required;
|
||||||
|
private String sensitive;
|
||||||
|
private String dynamic;
|
||||||
|
private String supportsEl;
|
||||||
|
private String expressionLanguageScope;
|
||||||
|
private List<String> dependencies;
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Component {
|
||||||
|
private String id;
|
||||||
|
private String name;
|
||||||
|
private String comments;
|
||||||
|
private String state;
|
||||||
|
private String type;
|
||||||
|
private String concurrentlySchedulableTaskCount;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue