提交 19191625 编写于 作者: sq3536's avatar sq3536

init

上级 f8a39c95
javaee
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>${pub.getCodeName()?lower_case}</artifactId>
<groupId>${pub.getPKGCodeName()?lower_case}</groupId>
<version>${pub.getVersionString()?default("V0.0.1_alpha")}</version>
</parent>
<artifactId>${pub.getCodeName()?lower_case}-boot</artifactId>
<name>${pub.getCodeName()?lower_case?cap_first} Dev Monolithic Boot</name>
<description>${pub.getCodeName()?lower_case?cap_first} Boot</description>
<dependencies>
<dependency>
<groupId>${pub.getPKGCodeName()?lower_case}</groupId>
<artifactId>${pub.getCodeName()?lower_case}-core</artifactId>
<version>${r'${project.version}'}</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id><#if pub.getPSSysServiceAPI?? && pub.getPSSysServiceAPI()??>${pub.getPSSysServiceAPI().getCodeName()?lower_case}<#else>runtime</#if></id>
<build>
<resources>
<resource>
<directory>${r'${basedir}'}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>${pub.getCodeName()?lower_case}-boot</finalName>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<mainClass>${pub.getPKGCodeName()}.BootApplication</mainClass>
<outputDirectory>../</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<#if pub.getPSDeployCenter()?? && pub.getPSDeployCenter().getPSRegistryRepo()??>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<serverId>ibiz-dev</serverId>
<imageName>${r'${docker.image.prefix}/${project.artifactId}'}:latest</imageName>
<dockerDirectory>${r'${project.basedir}'}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>../</directory>
<include>${r'${project.artifactId}'}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>prepare</id>
<configuration>
<executable>cp</executable>
<arguments>
<argument>../${r'${project.artifactId}'}.jar</argument>
<argument>${r'${project.basedir}'}/src/main/docker/</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>buildpush</id>
<configuration>
<executable>docker</executable>
<arguments>
<argument>buildx</argument>
<argument>build</argument>
<argument>--platform</argument>
<argument>linux/amd64,linux/arm64</argument>
<argument>-t</argument>
<argument>${r'${docker.image.prefix}/${project.artifactId}'}:latest</argument>
<argument>${r'${project.basedir}'}/src/main/docker</argument>
<argument>--push</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-model</id>
<phase>process-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<!-- 输出目录 -->
<outputDirectory>${r'${project.build.outputDirectory}'}/model--${sys.getPubSystemId()}--${sys.getSysVersion()}</outputDirectory>
<resources>
<resource>
<!-- 资源目录 -->
<directory>${r'${project.basedir}'}/../model</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</#if>
</plugins>
</build>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>${r'${basedir}'}/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>${pub.codeName?lower_case}-boot</finalName>
<jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
<mainClass>${pub.getPKGCodeName()}.BootApplication</mainClass>
<outputDirectory>../</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>cn.ibizlab</groupId>
<artifactId>ibizlab-generator-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<output>
../
</output>
<inputSpec>
${r'${basedir}'}/src/main/resources/model/${pub.getPKGCodeName()?replace(".","/")}
</inputSpec>
<templateDirs>
${r'${basedir}'}/src/main/resources/templ
</templateDirs>
<packageName>
${r'${project.groupId}'}
</packageName>
<name>
${r'${parent.artifactId}'}
</name>
</configuration>
<dependencies>
<dependency>
<groupId>cn.ibizlab</groupId>
<artifactId>ibizlab-template-ibizedge</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
<#ibiztemplate>
TARGET=PSSYSSERVICEAPI
</#ibiztemplate>
<#assign httpPort = "8081">
<#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" >
<#assign redisPort = "6379" >
<#assign redisDataBase = "0" >
<#assign dbUserName="root">
<#assign dbPassWord="123456">
<#assign dbUrl="jdbc:mysql://127.0.0.1:3306/"+sys.name+"?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true">
<#assign dbDriver="com.mysql.jdbc.Driver">
<#assign dockerPortMap="">
<#if sysrun?? && sysrun.getPSDevSlnMSDepAPI()?? >
<#assign depSysApi=sysrun.getPSDevSlnMSDepAPI()>
<#if depSysApi.getHttpPort()??>
<#assign httpPort = depSysApi.getHttpPort()?c>
</#if>
<#if depSysApi.getPSDCMSPlatformNode()??>
<#assign depSysApiPlatformNode=depSysApi.getPSDCMSPlatformNode()>
<#assign depSysApiPlatform=depSysApi.getPSDCMSPlatform()>
<#if depSysApiPlatform.getUserParam("nacos","127.0.0.1:8848")??>
<#assign nacosUrl = depSysApiPlatform.getUserParam("nacos","127.0.0.1:8848")>
</#if>
<#if depSysApi.getUserParam("spring.redis.host","")?? && depSysApi.getUserParam("spring.redis.host","")!="">
<#assign redisHost = depSysApi.getUserParam("spring.redis.host","")>
<#elseif depSysApiPlatform.getUserParam("spring.redis.host","")?? && depSysApiPlatform.getUserParam("spring.redis.host","")!="">
<#assign redisHost = depSysApiPlatform.getUserParam("spring.redis.host","")>
</#if>
<#if depSysApi.getUserParam("spring.redis.port","")?? && depSysApi.getUserParam("spring.redis.port","")!="">
<#assign redisPort = depSysApi.getUserParam("spring.redis.port")>
<#elseif depSysApiPlatform.getUserParam("spring.redis.port","")?? && depSysApiPlatform.getUserParam("spring.redis.port","")!="">
<#assign redisPort = depSysApiPlatform.getUserParam("spring.redis.port")>
</#if>
<#if depSysApi.getUserParam("spring.redis.database","")?? && depSysApi.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = depSysApi.getUserParam("spring.redis.database","")>
<#elseif depSysApiPlatform.getUserParam("spring.redis.database","")?? && depSysApiPlatform.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = depSysApiPlatform.getUserParam("spring.redis.database","")>
</#if>
<#if depSysApi.getUserParam("portmap","")?? && depSysApi.getUserParam("portmap","")!="">
<#assign dockerPortMap= depSysApi.getUserParam("portmap","")>
</#if>
</#if>
</#if>
<#comment>数据库配置</#comment>
<#if sysrun.getPSDBDevInst()??>
<#assign sysRunDBInst = sysrun.getPSDBDevInst()>
<#assign dbUserName=sysRunDBInst.getUserName()>
<#assign dbPassWord=sysRunDBInst.getPassword()>
<#assign dbUrl=sysRunDBInst.getConnUrl()>
<#if (sysRunDBInst.getDBType()=='MYSQL5')>
<#assign dbDriver="com.mysql.jdbc.Driver">
<#assign dbUrl=dbUrl+"&allowMultiQueries=true&serverTimezone=GMT%2B8">
<#elseif (sysRunDBInst.getDBType()=='DB2')>
<#assign dbDriver="com.ibm.db2.jcc.DB2Driver">
<#elseif (sysRunDBInst.getDBType()=='ORACLE')>
<#assign dbDriver="oracle.jdbc.driver.OracleDriver">
<#elseif (sysRunDBInst.getDBType()=='SQLSERVER')>
<#assign dbDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver">
<#elseif (sysRunDBInst.getDBType()=='POSTGRESQL')>
<#assign dbDriver="org.postgresql.Driver">
<#elseif (sysRunDBInst.getDBType()=='PPAS')>
<#assign dbDriver="com.edb.Driver">
</#if>
</#if>
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${pub.getCodeName()?lower_case}-boot
labels:
app: ${pub.getCodeName()?lower_case}-boot
spec:
replicas: 1
selector:
matchLabels:
app: ${pub.getCodeName()?lower_case}-boot
template:
metadata:
labels:
app: ${pub.getCodeName()?lower_case}-boot
spec:
imagePullSecrets:
- name: aly-shanghai
containers:
- name: ${pub.getCodeName()?lower_case}-boot
image: registry.cn-shanghai.aliyuncs.com/ibizsys/${pub.getCodeName()?lower_case}-boot:latest
imagePullPolicy: Always
ports:
- containerPort: ${httpPort}
<#if sysrun?? && sysrun.getPSDevSlnMSDepAPI()?? && sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode()??>
<#assign depSysApi=sysrun.getPSDevSlnMSDepAPI()>
<#assign depSysApiPlatformNode=sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode()>
<#assign depSysApiPlatform=sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatform()>
env:
<#if depSysApiPlatformNode.getSSHIPAddr()??>
- name: SPRING_CLOUD_NACOS_DISCOVERY_IP
value: "${depSysApiPlatformNode.getSSHIPAddr()}"
</#if>
<#comment>系统运行参数设置,从SysRun中获取到当前部署相关信息</#comment>
- name: SERVER_PORT
value: "${httpPort}"
- name: SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR
value: "${nacosUrl}"
- name: SPRING_REDIS_HOST
value: "${redisHost}"
- name: SPRING_REDIS_PORT
value: "${redisPort}"
- name: SPRING_REDIS_DATABASE
value: "${redisDataBase}"
- name: SPRING_DATASOURCE_USERNAME
value: "${dbUserName}"
- name: SPRING_DATASOURCE_PASSWORD
value: "${dbPassWord}"
- name: SPRING_DATASOURCE_URL
value: "${dbUrl}"
- name: SPRING_DATASOURCE_DRIVER-CLASS-NAME
value: "${dbDriver}"
- name: SPRING_DATASOURCE_DEFAULTSCHEMA
value: "${dbUserName}"
<#comment>输出服务接口自定义参数替换标准参数</#comment>
<#if depSysApi.getUserParamNames()??>
<@outputUserParam depSysApi depSysApi.getUserParamNames()/>
</#if>
<#comment>输出微服务平台自定义参数替换标准参数</#comment>
<#if depSysApiPlatform.getUserParamNames()??>
<@outputUserParam depSysApiPlatform depSysApiPlatform.getUserParamNames()/>
</#if>
</#if>
---
apiVersion: v1
kind: Service
metadata:
name: ${pub.getCodeName()?lower_case}-boot
labels:
app: ${pub.getCodeName()?lower_case}-boot
spec:
type: NodePort
ports:
- name: http
port: ${httpPort}
targetPort: ${httpPort}
nodePort: ${httpPort}
protocol: TCP
<#if dockerPortMap!=''>
- name: portmap
port: ${dockerPortMap}
targetPort: ${dockerPortMap}
nodePort: ${dockerPortMap}
protocol: TCP
</#if>
selector:
app: ${pub.getCodeName()?lower_case}-boot
<#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList>
<#list paramList as param>
<#assign userParamkey=param?upper_case?replace(".","_")>
<#comment>nacos、数据库连接等信息从sysRun中获取</#comment>
<#if userParamkey!="SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR" && userParamkey!="SPRING_REDIS_HOST" &&
userParamkey!="SERVER_PORT" &&userParamkey!="SPRING_REDIS_PORT" &&userParamkey!="SPRING_REDIS_DATABASE"
&&userParamkey!="SPRING_DATASOURCE_USERNAME" &&userParamkey!="SPRING_DATASOURCE_PASSWORD"
&&userParamkey!="SPRING_DATASOURCE_URL" &&userParamkey!="SPRING_DATASOURCE_DRIVER-CLASS-NAME" &&userParamkey!="SPRING_DATASOURCE_DEFAULTSCHEMA">
<#comment>扩展标准配置:用户配置参数替换标准配置(application-sys.yml)</#comment>
<#if !P.exists('SysApiDeployUserParam',param)>
- name: ${userParamkey}
value: "${paramObj.getUserParam(param,"")}"
</#if>
</#if>
</#list>
</#macro>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSSERVICEAPI
</#ibiztemplate>
<#assign httpPort = "8081">
<#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" >
<#assign redisPort = "6379" >
<#assign redisDataBase = "0" >
<#assign dbUserName="root">
<#assign dbPassWord="123456">
<#assign dbUrl="jdbc:mysql://127.0.0.1:3306/"+sys.name+"?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true">
<#assign dbDriver="com.mysql.jdbc.Driver">
<#assign dockerPortMap="">
<#assign dockerimage="">
<#assign servicehubid="">
<#if sysrun?? && sysrun.getPSDevSlnMSDepAPI()?? >
<#assign depSysApi=sysrun.getPSDevSlnMSDepAPI()>
<#if depSysApi.getHttpPort()??>
<#assign httpPort = depSysApi.getHttpPort()?c>
</#if>
<#if depSysApi.getPSDCMSPlatformNode()??>
<#assign depSysApiPlatformNode=depSysApi.getPSDCMSPlatformNode()>
<#assign depSysApiPlatform=depSysApi.getPSDCMSPlatform()>
<#if depSysApiPlatform.getUserParam("nacos","127.0.0.1:8848")??>
<#assign nacosUrl = depSysApiPlatform.getUserParam("nacos","127.0.0.1:8848")>
</#if>
<#if depSysApi.getUserParam("spring.redis.host","")?? && depSysApi.getUserParam("spring.redis.host","")!="">
<#assign redisHost = depSysApi.getUserParam("spring.redis.host","")>
<#elseif depSysApiPlatform.getUserParam("spring.redis.host","")?? && depSysApiPlatform.getUserParam("spring.redis.host","")!="">
<#assign redisHost = depSysApiPlatform.getUserParam("spring.redis.host","")>
</#if>
<#if depSysApi.getUserParam("spring.redis.port","")?? && depSysApi.getUserParam("spring.redis.port","")!="">
<#assign redisPort = depSysApi.getUserParam("spring.redis.port")>
<#elseif depSysApiPlatform.getUserParam("spring.redis.port","")?? && depSysApiPlatform.getUserParam("spring.redis.port","")!="">
<#assign redisPort = depSysApiPlatform.getUserParam("spring.redis.port")>
</#if>
<#if depSysApi.getUserParam("spring.redis.database","")?? && depSysApi.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = depSysApi.getUserParam("spring.redis.database","")>
<#elseif depSysApiPlatform.getUserParam("spring.redis.database","")?? && depSysApiPlatform.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = depSysApiPlatform.getUserParam("spring.redis.database","")>
</#if>
<#if depSysApi.getUserParam("portmap","")?? && depSysApi.getUserParam("portmap","")!="">
<#assign dockerPortMap= depSysApi.getUserParam("portmap","")>
</#if>
<#if depSysApi.getUserParam("dockerimage","")?? && depSysApi.getUserParam("dockerimage","")!="">
<#assign servicehubid=depSysApiPlatformNode.name>
<#assign dockerimage= depSysApi.getUserParam("dockerimage","")>
</#if>
</#if>
</#if>
<#comment>数据库配置</#comment>
<#if sysrun.getPSDBDevInst()??>
<#assign sysRunDBInst = sysrun.getPSDBDevInst()>
<#assign dbUserName=sysRunDBInst.getUserName()>
<#assign dbPassWord=sysRunDBInst.getPassword()>
<#assign dbUrl=sysRunDBInst.getConnUrl()>
<#if (sysRunDBInst.getDBType()=='MYSQL5')>
<#assign dbDriver="com.mysql.jdbc.Driver">
<#assign dbUrl=dbUrl+"&allowMultiQueries=true&serverTimezone=GMT%2B8">
<#elseif (sysRunDBInst.getDBType()=='DB2')>
<#assign dbDriver="com.ibm.db2.jcc.DB2Driver">
<#elseif (sysRunDBInst.getDBType()=='ORACLE')>
<#assign dbDriver="oracle.jdbc.driver.OracleDriver">
<#elseif (sysRunDBInst.getDBType()=='SQLSERVER')>
<#assign dbDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver">
<#elseif (sysRunDBInst.getDBType()=='POSTGRESQL')>
<#assign dbDriver="org.postgresql.Driver">
<#elseif (sysRunDBInst.getDBType()=='PPAS')>
<#assign dbDriver="com.edb.Driver">
</#if>
</#if>
version: "3.2"
services:
${pub.getCodeName()?lower_case}-provider:
<#if dockerimage!=''>
image: ${dockerimage}
<#else>
image: registry.cn-shanghai.aliyuncs.com/ibizsys/${pub.getCodeName()?lower_case}-provider:latest
</#if>
ports:
- "${httpPort}:${httpPort}"
<#if dockerPortMap!=''>
- "${dockerPortMap}"
</#if>
networks:
- agent_network
<#if sysrun?? && sysrun.getPSDevSlnMSDepAPI()?? && sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode()??>
<#assign depSysApi=sysrun.getPSDevSlnMSDepAPI()>
<#assign depSysApiPlatformNode=sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode()>
<#assign depSysApiPlatform=sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatform()>
environment:
<#if depSysApiPlatformNode.getSSHIPAddr()??>
- SPRING_CLOUD_NACOS_DISCOVERY_IP=${depSysApiPlatformNode.getSSHIPAddr()}
</#if>
<#if servicehubid!=''>
- IBIZ_SERVICEHUB_ID=${servicehubid}
</#if>
<#comment>系统运行参数设置,从SysRun中获取到当前部署相关信息</#comment>
- SERVER_PORT=${httpPort}
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=${nacosUrl}
- SPRING_CLOUD_NACOS_CONFIG_SERVER-ADDR=${nacosUrl}
- SPRING_REDIS_HOST=${redisHost}
- SPRING_REDIS_PORT=${redisPort}
- SPRING_REDIS_DATABASE=${redisDataBase}
- SPRING_DATASOURCE_USERNAME=${dbUserName}
- SPRING_DATASOURCE_PASSWORD=${dbPassWord}
- SPRING_DATASOURCE_URL=${dbUrl}
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=${dbDriver}
- SPRING_DATASOURCE_DEFAULTSCHEMA=${dbUserName}
<#comment>输出服务接口自定义参数替换标准参数</#comment>
<#if depSysApi.getUserParamNames()??>
<@outputUserParam depSysApi depSysApi.getUserParamNames()/>
</#if>
<#comment>输出微服务平台自定义参数替换标准参数</#comment>
<#if depSysApiPlatform.getUserParamNames()??>
<@outputUserParam depSysApiPlatform depSysApiPlatform.getUserParamNames()/>
</#if>
</#if>
deploy:
resources:
limits:
memory: 4048M
reservations:
memory: 400M
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
volumes:
- "nfs:/app/file"
volumes:
nfs:
driver: local
driver_opts:
type: "nfs"
o: "addr=172.16.240.140,rw"
device: ":/data/nfs"
networks:
agent_network:
driver: overlay
attachable: true
<#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList>
<#list paramList as param>
<#assign userParamkey=param?upper_case?replace(".","_")>
<#comment>nacos、数据库连接等信息从sysRun中获取</#comment>
<#if userParamkey!="SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR" && userParamkey!="SPRING_REDIS_HOST" &&
userParamkey!="SERVER_PORT" &&userParamkey!="SPRING_REDIS_PORT" &&userParamkey!="SPRING_REDIS_DATABASE"
&&userParamkey!="SPRING_DATASOURCE_USERNAME" &&userParamkey!="SPRING_DATASOURCE_PASSWORD"
&&userParamkey!="SPRING_DATASOURCE_URL" &&userParamkey!="SPRING_DATASOURCE_DRIVER-CLASS-NAME" &&userParamkey!="SPRING_DATASOURCE_DEFAULTSCHEMA">
<#comment>扩展标准配置:用户配置参数替换标准配置(application-sys.yml)</#comment>
<#if !P.exists('SysApiDeployUserParam',param)>
- ${userParamkey}=${paramObj.getUserParam(param,"")}
</#if>
</#if>
</#list>
</#macro>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSSERVICEAPI
</#ibiztemplate>
<#assign httpPort = "8081">
<#assign timezone = "Asia/Shanghai">
<#if sysrun?? >
<#if sysrun.getPSDevSlnMSDepAPI()??>
<#if sysrun.getPSDevSlnMSDepAPI().getHttpPort()??>
<#assign httpPort = sysrun.getPSDevSlnMSDepAPI().getHttpPort()?c>
</#if>
<#if sysrun.getPSDevSlnMSDepAPI().getUserParam("timezone","")?? && sysrun.getPSDevSlnMSDepAPI().getUserParam("timezone","")!="">
<#assign timezone = sysrun.getPSDevSlnMSDepAPI().getUserParam("timezone","")>
<#elseif sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatform().getUserParam("timezone","")?? && sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatform().getUserParam("timezone","")!="">
<#assign timezone = sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatform().getUserParam("timezone","")>
</#if>
</#if>
</#if>
FROM image.ibizlab.cn/library/openjdk:8-jre-alpine-fonts-v1
ENV TZ=${timezone} \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
IBIZ_SLEEP=0 \
JAVA_OPTS=""
CMD echo "The application will start in ${r'${IBIZ_SLEEP}'}s..." && \
sleep ${r'${IBIZ_SLEEP}'} && \
java ${r'${JAVA_OPTS}'} -Duser.timezone=$TZ -Djava.security.egd=file:/dev/./urandom -jar /${pub.getCodeName()?lower_case}-boot.jar
EXPOSE ${httpPort}
ADD ${pub.getCodeName()?lower_case}-boot.jar /${pub.getCodeName()?lower_case}-boot.jar
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign bmogo=false>
<#if sys.getAllPSDataEntities()??>
<#list sys.getAllPSDataEntities() as de>
<#if de.getStorageMode()?? && de.getStorageMode()==2>
<#assign bmogo=true>
<#break >
</#if>
</#list>
</#if>
<#if bmogo==true>
version: "3.2"
services:
${sys.name}-mongodb:
image: mongo:4.2.3
ports:
- 27017:27017
volumes:
- $PWD/../../../../volumes/mongodb/:/data/db/
networks:
- agent_network
networks:
agent_network:
attachable: true
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign dbUserName="root">
<#assign bflag=false>
<#if sys.getAllPSDevSlnMSDepAPIs()??>
<#list sys.getAllPSDevSlnMSDepAPIs() as depSysApi>
<#if depSysApi.getPSDBDevInst()??>
<#assign sysApiDBInst=depSysApi.getPSDBDevInst()>
<#assign dbUserName=sysApiDBInst.getUserName()>
<#if (sysApiDBInst.getDBType()=='MYSQL5')>
<#assign bflag=true>
</#if>
<#break>
</#if>
</#list>
</#if>
<#if bflag==true>
version: "3.2"
services:
${sys.name}-mysql:
image: mysql:5.7.20
volumes:
- $PWD/../../../../volumes/mysql/:/var/lib/mysql/
networks:
- agent_network
environment:
- TZ=Asia/Shanghai
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=${dbUserName}
ports:
- 3306:3306
command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8 --explicit_defaults_for_timestamp
networks:
agent_network:
attachable: true
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
version: "3.2"
services:
${sys.name}-nacos:
image: nacos/nacos-server:latest
container_name: nacos-standalone
environment:
- PREFER_HOST_MODE=hostname
- MODE=standalone
ports:
- "8848:8848"
networks:
- agent_network
networks:
agent_network:
attachable: true
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign bflag=false>
<#if sys.getAllPSDevSlnMSDepAPIs()??>
<#list sys.getAllPSDevSlnMSDepAPIs() as depSysApi>
<#if depSysApi.getPSDBDevInst()??>
<#assign sysApiDBInst=depSysApi.getPSDBDevInst()>
<#if (sysApiDBInst.getDBType()=='ORACLE')>
<#assign bflag=true>
</#if>
<#break>
</#if>
</#list>
</#if>
<#if bflag==true>
version: "3.2"
services:
${sys.name}-orcl:
image: liumiaocn/oracle:11.2.0
ports:
- "38080:8080"
- "1521:1521"
environment:
- DEFAULT_SYS_PASS=root
- processes=500
- sessions=555
- transactions=611
volumes:
- $PWD/../../../../volumes/orcl/:/u01/app/oracle/
networks:
- agent_network
networks:
agent_network:
attachable: true
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign dbUserName="root">
<#assign bflag=false>
<#if sys.getAllPSDevSlnMSDepAPIs()??>
<#list sys.getAllPSDevSlnMSDepAPIs() as depSysApi>
<#if depSysApi.getPSDBDevInst()??>
<#assign sysApiDBInst=depSysApi.getPSDBDevInst()>
<#assign dbUserName=sysApiDBInst.getUserName()>
<#if (sysApiDBInst.getDBType()=='POSTGRESQL')>
<#assign bflag=true>
</#if>
<#break>
</#if>
</#list>
</#if>
<#if bflag==true>
version: "3.2"
services:
${sys.name}-postgresql:
container_name: postgres
image: postgres
restart: always
environment:
POSTGRES_DB: ${dbUserName}
POSTGRES_USER: ${dbUserName}
POSTGRES_PASSWORD: root
ports:
- 5432:5432
volumes:
- $PWD/../../../../volumes/postgresql/:/var/lib/postgresql/data
networks:
- agent_network
networks:
agent_network:
attachable: true
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
version: "3.2"
services:
${sys.name}-redis:
image: redis
ports:
- 6379:6379
environment:
- TZ=Asia/Shanghai
logging:
driver: "json-file"
command: redis-server
networks:
- agent_network
networks:
agent_network:
attachable: true
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign bDynamicDS=false>
<#list sys.getAllPSDataEntities() as entity>
<#if (entity.getStorageMode()==1 || entity.getStorageMode()==2) && entity.getDSLink()!='DEFAULT'>
<#assign bDynamicDS=true>
<#break>
</#if>
</#list>
package ${pub.getPKGCodeName()};
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.util.List;
import cn.ibizlab.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@EnableDiscoveryClient
@Configuration
@EnableTransactionManagement
@EnableFeignClients(basePackages = {"cn.ibizlab.util","${pub.getPKGCodeName()}" })
@SpringBootApplication(exclude = {
<#--<#assign bmogo=false>-->
<#--<#if sys.getAllPSDataEntities()??>-->
<#--<#list sys.getAllPSDataEntities() as de>-->
<#--<#if de.getStorageMode()?? && de.getStorageMode()==2>-->
<#--<#assign bmogo=true>-->
<#--<#break >-->
<#--</#if>-->
<#--</#list>-->
<#--</#if>-->
<#--<#if bmogo==false>-->
<#--org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,-->
<#--</#if>-->
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure.class
})
@ComponentScan(basePackages = {"cn.ibizlab.util","${pub.getPKGCodeName()}"}
// ,excludeFilters = {
// @ComponentScan.Filter(type= org.springframework.context.annotation.FilterType.REGEX, pattern="${pub.getPKGCodeName()}.xxx.rest.xxx"),
// }
)
@Import({
org.springframework.cloud.openfeign.FeignClientsConfiguration.class
})
@EnableAsync
@EnableScheduling
public class BootApplication extends WebMvcConfigurerAdapter {
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) {
SpringApplication.run(DevBootApplication.class, args);
}
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(resolver);
}
}
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
**.ibizlab-generator-ignore
**.DS_Store
**@macro/**
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>${pub.getCodeName()?lower_case}</artifactId>
<groupId>${pub.getPKGCodeName()?lower_case}</groupId>
<version>${pub.getVersionString()?default("V0.0.1_alpha")}</version>
</parent>
<artifactId>${pub.getCodeName()?lower_case}-core</artifactId>
<name>${pub.getCodeName()?lower_case?cap_first} Core</name>
<description>${pub.getCodeName()?lower_case?cap_first} Core</description>
<dependencies>
<dependency>
<groupId>cn.ibizlab</groupId>
<artifactId>ibizlab-boot-starter-data</artifactId>
<version>2.4.0-SNAPSHOT</version>
</dependency>
</dependencies>
<properties>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
</properties>
<profiles>
<profile>
<id>diff</id>
<build>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${r'${liquibase.version}'}</version>
<executions>
<execution>
<id>prepare-newdb</id>
<configuration>
<changeLogFile>${r'${project.basedir}'}/src/main/resources/liquibase/h2_table.xml</changeLogFile>
<driver>org.h2.Driver</driver>
<url>jdbc:h2:file:${r'${project.build.directory}'}/db/new;MODE=mysql</url>
<username>root</username>
<dropFirst>true</dropFirst>
</configuration>
<phase>process-resources</phase>
<goals>
<goal>update</goal>
</goals>
</execution>
<execution>
<id>prepare-olddb</id>
<configuration>
<changeLogFile>${r'${project.basedir}'}/src/main/resources/liquibase/master_table.xml</changeLogFile>
<driver>org.h2.Driver</driver>
<url>jdbc:h2:file:${r'${project.build.directory}'}/db/last;MODE=mysql</url>
<username>root</username>
<dropFirst>true</dropFirst>
</configuration>
<phase>process-resources</phase>
<goals>
<goal>update</goal>
</goals>
</execution>
<execution>
<id>make-diff</id>
<configuration>
<changeLogFile>${r'${project.basedir}'}/src/main/resources/liquibase/empty.xml</changeLogFile>
<diffChangeLogFile>${r'${project.basedir}'}/src/main/resources/liquibase/changelog/${r'${maven.build.timestamp}'}_changelog.xml</diffChangeLogFile>
<driver>org.h2.Driver</driver>
<url>jdbc:h2:file:${r'${project.build.directory}'}/db/last;MODE=mysql</url>
<username>root</username>
<password></password>
<referenceUrl>jdbc:h2:file:${r'${project.build.directory}'}/db/new;MODE=mysql</referenceUrl>
<referenceDriver>org.h2.Driver</referenceDriver>
<referenceUsername>root</referenceUsername>
<verbose>true</verbose>
<logging>debug</logging>
<contexts>!test</contexts>
<diffExcludeObjects>Index:.*,table:ibzfile,ibzuser,ibzdataaudit,ibzcfg,IBZFILE,IBZUSER,IBZDATAAUDIT,IBZCFG</diffExcludeObjects>
</configuration>
<phase>process-resources</phase>
<goals>
<goal>diff</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="Think (generated)" id="1561433044682-1">
<createTable remarks="文件" tableName="IBZFILE">
<column name="FILEID" type="VARCHAR2(100 BYTE)">
<constraints primaryKey="true" primaryKeyName="SYS_C00168533"/>
</column>
<column name="FILENAME" type="VARCHAR2(200 BYTE)"/>
<column name="FILEPATH" type="VARCHAR2(500 BYTE)"/>
<column name="FOLDER" type="VARCHAR2(20 BYTE)"/>
<column name="CREATEMAN" type="VARCHAR2(60 BYTE)"/>
<column name="CREATEDATE" type="date"/>
<column name="UPDATEMAN" type="VARCHAR2(60 BYTE)"/>
<column name="UPDATEDATE" type="date"/>
<column name="FILEEXT" type="VARCHAR2(10 BYTE)"/>
<column name="FILESIZE" type="INTEGER"/>
<column name="DIGESTCODE" type="VARCHAR2(64 BYTE)"/>
<column name="OWNERTYPE" type="VARCHAR2(100 BYTE)"/>
<column name="OWNERID" type="VARCHAR2(100 BYTE)"/>
<column name="MEMO" type="VARCHAR2(500 BYTE)"/>
<column name="RESERVER" type="VARCHAR2(100 BYTE)"/>
</createTable>
</changeSet>
<changeSet author="Think (generated)" id="1561433044682-2">
<createTable remarks="用户" tableName="IBZUSER">
<column name="USERID" type="VARCHAR2(100 BYTE)">
<constraints primaryKey="true" primaryKeyName="SYS_C00168531"/>
</column>
<column name="PERSONNAME" type="VARCHAR2(200 BYTE)"/>
<column name="USERNAME" type="VARCHAR2(200 BYTE)"/>
<column name="USERCODE" type="VARCHAR2(100 BYTE)"/>
<column name="LOGINNAME" type="VARCHAR2(100 BYTE)"/>
<column name="PASSWORD" type="VARCHAR2(100 BYTE)"/>
<column name="DOMAINS" type="VARCHAR2(100 BYTE)"/>
<column name="MDEPTID" type="VARCHAR2(100 BYTE)"/>
<column name="MDEPTCODE" type="VARCHAR2(100 BYTE)"/>
<column name="MDEPTNAME" type="VARCHAR2(200 BYTE)"/>
<column name="BCODE" type="VARCHAR2(100 BYTE)"/>
<column name="POSTID" type="VARCHAR2(100 BYTE)"/>
<column name="POSTCODE" type="VARCHAR2(100 BYTE)"/>
<column name="POSTNAME" type="VARCHAR2(200 BYTE)"/>
<column name="ORGID" type="VARCHAR2(100 BYTE)"/>
<column name="ORGCODE" type="VARCHAR2(100 BYTE)"/>
<column name="ORGNAME" type="VARCHAR2(200 BYTE)"/>
<column name="NICKNAME" type="VARCHAR2(36 BYTE)"/>
<column name="EMAIL" type="VARCHAR2(100 BYTE)"/>
<column name="AVATAR" type="VARCHAR2(100 BYTE)"/>
<column name="PHONE" type="VARCHAR2(100 BYTE)"/>
<column name="RESERVER" type="VARCHAR2(100 BYTE)"/>
<column name="USERICON" type="VARCHAR2(100 BYTE)"/>
<column name="SEX" type="VARCHAR2(10 BYTE)"/>
<column name="BIRTHDAY" type="date"/>
<column name="CERTCODE" type="VARCHAR2(36 BYTE)"/>
<column name="ADDR" type="VARCHAR2(200 BYTE)"/>
<column name="THEME" type="VARCHAR2(100 BYTE)"/>
<column name="FONTSIZE" type="VARCHAR2(10 BYTE)"/>
<column name="LANG" type="VARCHAR2(100 BYTE)"/>
<column name="MEMO" type="VARCHAR2(500 BYTE)"/>
<column name="SUPERUSER" type="INTEGER"/>
</createTable>
</changeSet>
<changeSet author="Think (generated)" id="1561433044682-3">
<insert tableName="IBZUSER">
<column name="USERID" value="0100"/>
<column name="PERSONNAME" value="管理员"/>
<column name="USERNAME" value="系统管理员"/>
<column name="USERCODE" value="0100"/>
<column name="LOGINNAME" value="ibzadmin"/>
<column name="SUPERUSER" value="1"/>
<column name="PASSWORD" value="123456"/>
<column name="DOMAINS" value="100000"/>
<column name="MDEPTID"/>
<column name="MDEPTCODE"/>
<column name="MDEPTNAME"/>
<column name="BCODE"/>
<column name="POSTID"/>
<column name="POSTCODE"/>
<column name="POSTNAME"/>
<column name="ORGID"/>
<column name="ORGCODE"/>
<column name="ORGNAME"/>
<column name="NICKNAME"/>
<column name="EMAIL"/>
<column name="AVATAR"/>
<column name="PHONE"/>
<column name="RESERVER"/>
<column name="USERICON"/>
<column name="SEX"/>
<column name="BIRTHDAY"/>
<column name="CERTCODE"/>
<column name="ADDR"/>
<column name="THEME"/>
<column name="FONTSIZE"/>
<column name="LANG"/>
<column name="MEMO"/>
</insert>
</changeSet>
</databaseChangeLog>
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<changeSet author="Think (generated)" id="1592547336292-1">
<preConditions onFail="MARK_RAN" >
<not >
<tableExists tableName="IBZCFG" />
</not>
</preConditions>
<createTable remarks="配置" tableName="IBZCFG">
<column name="CFGID" remarks="配置标识" type="VARCHAR(100)">
<constraints primaryKey="true"/>
</column>
<column name="SYSTEMID" remarks="系统标识" type="VARCHAR(100)"/>
<column name="CFGTYPE" remarks="配置类型" type="VARCHAR(100)"/>
<column name="TARGETTYPE" remarks="引用对象" type="VARCHAR(100)"/>
<column name="USERID" remarks="用户标识" type="VARCHAR(100)"/>
<column name="CFG" remarks="配置" type="MEDIUMTEXT"/>
<column name="UPDATEDATE" remarks="更新时间" type="datetime"/>
</createTable>
</changeSet>
</databaseChangeLog>
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="Think (generated)" id="1566027230162-1">
<preConditions onFail="MARK_RAN" >
<not>
<tableExists tableName="IBZDATAAUDIT" />
</not>
</preConditions>
<createTable remarks="数据审计" tableName="IBZDATAAUDIT">
<column name="DATAAUDITID" remarks="数据审计标识" type="VARCHAR2(100 BYTE)">
<constraints primaryKey="true" primaryKeyName="SYS_C00115093"/>
</column>
<column name="OPPERSONID" remarks="操作人标识" type="VARCHAR2(100 BYTE)"/>
<column name="OPPERSONNAME" remarks="操作人名称" type="VARCHAR2(100 BYTE)"/>
<column name="AUDITTYPE" remarks="审计行为类型" type="VARCHAR2(60 BYTE)"/>
<column name="OPTIME" remarks="操作时间" type="date"/>
<column name="IPADDRESS" remarks="访问地址" type="VARCHAR2(100 BYTE)"/>
<column name="AUDITOBJECTDATA" remarks="审计对象(表数据)" type="VARCHAR2(100 BYTE)"/>
<column name="AUDITOBJECT" remarks="审计对象(表)" type="VARCHAR2(100 BYTE)"/>
<column name="AUDITINFO" remarks="审计明细" type="CLOB"/>
<column name="ISDATACHANGED" remarks="审计数据是否发生变化" type="INTEGER"/>
</createTable>
</changeSet>
</databaseChangeLog>
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#if pub.isEnableGlobalTransaction?? && pub.isEnableGlobalTransaction()?? && pub.isEnableGlobalTransaction()==true>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<changeSet author="Think (generated)" id="1595929877142-2">
<preConditions onFail="MARK_RAN" >
<not>
<tableExists tableName="undo_log" />
</not>
</preConditions>
<createTable remarks="AT transaction mode undo table" tableName="undo_log">
<column name="branch_id" remarks="branch transaction id" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="xid" remarks="global transaction id" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
<column name="context" remarks="undo_log context,such as serialization" type="VARCHAR(128)">
<constraints nullable="false"/>
</column>
<column name="rollback_info" remarks="rollback info" type="LONGBLOB">
<constraints nullable="false"/>
</column>
<column name="log_status" remarks="0:normal status,1:defense status" type="INT">
<constraints nullable="false"/>
</column>
<column name="log_created" remarks="create datetime" type="datetime">
<constraints nullable="false"/>
</column>
<column name="log_modified" remarks="modify datetime" type="datetime">
<constraints nullable="false"/>
</column>
</createTable>
<addUniqueConstraint columnNames="xid, branch_id" constraintName="ux_undo_log" tableName="undo_log"/>
</changeSet>
</databaseChangeLog>
</#if>
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#if sysrun.getPSDBDevInst()??>
<#assign dbinst = sysrun.getPSDBDevInst()>
create schema if not exists ${dbinst.getUserName()};
set schema ${dbinst.getUserName()};
<#--CREATE ALIAS IF NOT EXISTS TO_NUMBER AS $$-->
<#--Long toNumber(String value) {-->
<#--return value == null ? null : Long.valueOf(value);-->
<#--}-->
<#--$$;-->
</#if>
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<!--liquibase启动时需要指定chanlogxml,若无changelog,则使用此xml来初始化liquibase,使liquibase能正常启动 -->
</databaseChangeLog>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<include file="changelog/20190625112530_init_ibizsys.xml" relativeToChangelogFile="true"/>
<include file="h2_table.xml" relativeToChangelogFile="true"/>
<include file="view.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#if sysrun.getPSDBDevInst()??>
<#assign dbinst = sysrun.getPSDBDevInst()>
<#assign curdate=.now?string["yyyyMMddHHmmss"]>
</#if>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<#assign sequenceNumber=0>
<#list sys.getAllPSDataEntities() as de>
<#if de.getTableName?? &&de.getTableName()?? &&de.getTableName()?upper_case!='IBZUSER'&&de.getTableName()?upper_case!='IBZFILE'&&de.getTableName()?upper_case!='IBZDATAAUDIT' &&de.getStorageMode()?? &&de.getStorageMode()==1 && de.isSubSysDE()==false>
<#assign bPubDb=false>
<#if de.getAllPSDEDBConfigs()?? >
<#list de.getAllPSDEDBConfigs() as dbpub>
<#if dbpub.isPubModel() == true >
<#assign bPubDb = true>
<#break >
</#if>
</#list>
</#if>
<#assign sequenceNumber=sequenceNumber+1>
<#assign deVersion=de.getVersion()?c>
<#assign deName=de.getName()?lower_case>
<#assign hasPhisicalDEField=false>
<#comment>判断表中是否有物理属性</#comment>
<#list de.getAllPSDEFields() as defield>
<#if defield.isPhisicalDEField()==true>
<#assign hasPhisicalDEField=true>
<#break>
</#if>
</#list>
<#comment>输出表结构</#comment>
<!--输出实体[${de.getName()}]数据结构 -->
<#if !P.exists("table_",de.getTableName()?lower_case,"") && bPubDb==true && hasPhisicalDEField==true>
<changeSet author="<#if dbinst?? && dbinst.getUserName()??>${dbinst.getUserName()}<#else>root</#if>" id="tab-${deName}-${deVersion}-${sequenceNumber}">
<createTable tableName="${de.getTableName()}">
<#list de.getAllPSDEFields() as defield>
<#if defield.isPhisicalDEField()==true><#comment>物理属性</#comment>
<#assign dataType="${srfdatatype(defield.getStdDataType())}">
<#assign javaType="${srfr7javatype(defield.stdDataType)}">
<#comment>varchar需要设置字段长度,若不设置,则liquibase比较时会自动填充,最终恢复到生产库会报错</#comment>
<#if javaType=='String'>
<#if defield.getLength()?? && defield.getLength()?c!='-1'>
<#assign dataType="${srfdatatype(defield.getStdDataType())}(${defield.getLength()?c})" >
<#else>
<#assign dataType="${srfdatatype(defield.getStdDataType())}(200)">
</#if>
<#elseif dataType?lower_case=='decimal'>
<#assign dataType="${srfdatatype(defield.getStdDataType())}(38,2)"><#comment>设置数值类型精度</#comment>
</#if>
<#if javaType='BigDecimal'>
<#assign dataType="DECIMAL(38,2)"><#comment>数据类型转换varchar-->decimal</#comment>
</#if>
<#comment>由于liquibase不支持修改mysql的remarks,修改remarks会导致启动报错,所以mysql数据库暂时不发remarks</#comment>
<column name="${defield.getName()}" remarks="<#if dbinst?? && (dbinst.getDBType()!='MYSQL5')>${defield.getLogicName()}</#if>" type="${dataType}">
<#if defield.isKeyDEField()==true>
<#comment>oracle中约束名长度不能大于30</#comment>
<#assign constraintName="PK_"+de.getName()+"_"+defield.getName()>
<#if constraintName?length gt 30>
<#assign constraintName=constraintName?substring(0,30)>
</#if>
<constraints primaryKey="true" primaryKeyName="${constraintName}"/>
</#if>
</column>
</#if>
</#list>
</createTable>
</changeSet>
</#if>
</#if>
</#list>
<#comment>输出外键</#comment>
<#list sys.getAllPSDataEntities() as de>
<#assign deVersion=de.getVersion()?c>
<#assign deName=de.getName()?lower_case>
<#if de.getTableName?? &&de.getTableName()?? &&de.getTableName()?upper_case!='IBZUSER'&&de.getTableName()?upper_case!='IBZFILE'&&de.getTableName()?upper_case!='IBZDATAAUDIT' &&de.getStorageMode()?? &&de.getStorageMode()==1 && de.isSubSysDE()==false>
<#assign bPubDb=false>
<#if de.getAllPSDEDBConfigs()?? >
<#list de.getAllPSDEDBConfigs() as dbpub>
<#if dbpub.isPubModel() == true >
<#assign bPubDb = true>
<#break >
</#if>
</#list>
</#if>
<#if de.getMinorPSDERs?? && de.getMinorPSDERs()?? >
<!--输出实体[${de.getName()}]外键关系 -->
<#list de.getMinorPSDERs() as fk>
<#if fk.getDERType()=='DER1N' && fk.isEnableFKey()==true>
<#if fk.getMajorPSDataEntity().getTableName()??>
<#assign sequenceNumber=sequenceNumber+1>
<#comment>oracle中约束名长度不能大于30</#comment>
<#assign fkConstraintName=fk.getName()>
<#if fkConstraintName?length gt 30>
<#assign fkConstraintName=fkConstraintName?substring(0,30)>
</#if>
<#if !P.exists("fk_",fkConstraintName,"") && bPubDb==true>
<changeSet author="<#if dbinst?? && dbinst.getUserName()??>${dbinst.getUserName()}<#else>root</#if>" id="fk-${deName}-${deVersion}-${sequenceNumber}">
<addForeignKeyConstraint baseColumnNames="${fk.getPSPickupDEField().getName()}" baseTableName="${de.getTableName()}" constraintName="${fkConstraintName}" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="${fk.getMajorPSDataEntity().getKeyPSDEField().getName()}" referencedTableName="${fk.getMajorPSDataEntity().getTableName()}" validate="true"/>
</changeSet>
</#if>
</#if>
</#if>
</#list>
</#if>
</#if>
</#list>
</databaseChangeLog>
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<includeAll path="liquibase/changelog/"/>
<include file="view.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<includeAll path="liquibase/changelog/"/>
</databaseChangeLog>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
此文件只用于让模板能发出[rollback]文件夹,无实际用途
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#if sysrun.getPSDBDevInst()??>
<#assign dbinst = sysrun.getPSDBDevInst()>
<#assign curdate=.now?string["yyyyMMddHHmmss"]>
</#if>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<#assign sequenceNumber=0>
<#comment>输出视图信息</#comment>
<#list sys.getAllPSDataEntities() as de>
<#if de.getStorageMode()==1>
<#if de.getViewName?? && ((de.getViewName()!'')!='') && de.isSubSysDE()==false && de.isNoViewMode()!=true>
<#assign bPubDb=false>
<#if de.getAllPSDEDBConfigs()?? >
<#list de.getAllPSDEDBConfigs() as dbpub>
<#if dbpub.isPubModel() == true >
<#assign bPubDb = true>
<#break >
</#if>
</#list>
</#if>
<#assign sequenceNumber=sequenceNumber+1>
<#assign deVersion=de.getVersion()?c>
<#assign deName=de.getName()?lower_case>
<#if !P.exists("view_",de.getViewName(),"") && bPubDb == true>
<!--输出实体[${de.getName()}]视图结构信息 runOnChange="true" 当视图发生变更时,通过liquibase强刷prod的视图,实现视图的同步-->
<changeSet author="<#if dbinst?? && dbinst.getUserName()??>${dbinst.getUserName()}<#else>root</#if>" id="view-${deName}-${deVersion}-${sequenceNumber}" runOnChange="true">
<createView fullDefinition="false" replaceIfExists="true" viewName="${de.getViewName()}">
<#if de.getAllPSDEDataQueries?? && de.getAllPSDEDataQueries()??>
<#assign resultDataQuery = de.getAllPSDEDataQueries()>
<#list resultDataQuery as singleQuery>
<#if singleQuery.getCodeName()?lower_case=='default'>
<#if singleQuery.getAllPSDEDataQueryCodes()??>
<#assign queryCodeList = singleQuery.getAllPSDEDataQueryCodes()>
<#assign sql="">
<#comment>遍历数据查询,有oracle则输出,无则输出mysql</#comment>
<#list singleQuery.getAllPSDEDataQueryCodes() as dedqcode>
<#assign sql=srfjavasqlcode('${dedqcode.getQueryCode()}')>
<#assign dbtype=dedqcode.getDBType()?lower_case?replace("mysql5","mysql")>
<#if dbtype?lower_case=='oracle'>
<#break>
</#if>
</#list>
<![CDATA[ ${sql}]]>
<#break>
</#if>
</#if>
</#list>
</#if>
</createView>
</changeSet>
</#if>
</#if>
</#if>
</#list>
</databaseChangeLog>
<#assign hasAfterLogic =false>
<#assign hasAfterDrl=false>
<#assign de=item.getPSDataEntity()>
<#if item.getAfterPSDEActionLogics?? && item.getAfterPSDEActionLogics()??>
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#if afterlogic.isValid()==true && afterlogic.getActionLogicType()?c!='2'>
<#if afterlogic.isInternalLogic() && afterlogic.getPSDELogic().isEnableBackend() && afterlogic.getPSDELogic().isCustomCode()== false>
<#assign hasAfterLogic=true>
<#elseif (afterlogic.getDstPSDE()!'')!='' && (afterlogic.getDstPSDEAction()!'')!='' && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign hasAfterLogic=true>
<#assign hasAfterDrl=true>
<#break >
</#if>
</#if>
</#list>
</#if>
<#if hasAfterLogic>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.${de.codeName?lower_case}.${item.codeName?lower_case}.afterLogic" isClosed="false" isExecutable="true" name="${de.getPSSystemModule().codeName?lower_case}_${de.codeName?lower_case}_${item.codeName?lower_case}_afterLogic" processType="Private" tns:packageName="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.${de.codeName?lower_case}.${item.codeName?lower_case}.afterLogic">
<extensionElements>
<tns:import name="java.util.Map"/>
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="${pub.getPKGCodeName()}.util.helper.RuleUtils"/>
<tns:import name="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()}"/>
<#comment>插入服务对象</#comment>
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#if (afterlogic.getDstPSDE()!'')!='' && (afterlogic.getDstPSDEAction()!'')!='' && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = afterlogic.getDstPSDE()>
<#assign deaction = afterlogic.getDstPSDEAction()>
<#if !P.exists("refservice",dataentity+"service")>
<tns:metaData express="T(${pub.getPKGCodeName()}.util.security.SpringContextHolder).getBean(T(${pub.getPKGCodeName()}.core.${dataentity.getPSSystemModule().codeName?lower_case}.service.I${dataentity.codeName}Service))" name="${srfcaseformat(dataentity.getCodeName(),'l_u2lC')}Service" type="service"/>
</#if>
</#if>
</#list>
<#if hasAfterDrl>
<#comment>插入当前实体对象</#comment>
<tns:metaData express="" name="et" type="entity"/>
</#if>
</extensionElements>
<#if item.getAfterPSDEActionLogics?? && item.getAfterPSDEActionLogics()??>
<startEvent id="begin" isInterrupting="true"/>
<endEvent id="prepareparam1_end" name="end"/>
<#assign source="begin">
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#if afterlogic.isValid()==true && afterlogic.getActionLogicType()?c!='2'>
<#comment>实体行为附加逻辑</#comment>
<#if afterlogic.isInternalLogic() && afterlogic.getPSDELogic().isEnableBackend() && afterlogic.getPSDELogic().isCustomCode()== false>
<#assign delogic = afterlogic.getPSDELogic()>
<#assign target =afterlogic.getId()>
<callActivity activiti:exclusive="true" calledElement="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${delogic.getCodeName()?lower_case}" id="${target}" name="${delogic.codeName}.json.bpmn"/>
<#elseif afterlogic.getDstPSDEAction()?? && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = afterlogic.getDstPSDE()>
<#assign deaction = afterlogic.getDstPSDEAction()>
<#assign groupName = (dataentity.codeName + deaction.codeName)?lower_case>
<#assign target = afterlogic.getId()>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="${target}" id="${target}" implementation="http://www.jboss.org/drools/rule" name="${groupName}"/>
</#if>
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="${target}"/>
<#assign source = target>
<#if !afterlogic_has_next>
<sequenceFlow id="${source}_prepareparam1_end" sourceRef="${source}" targetRef="prepareparam1_end"/>
</#if>
</#if>
</#list>
</#if>
</process>
</definitions>
</#if>
\ No newline at end of file
<#comment>实体行为调用实体行为</#comment>
<#assign hasAfterLogic =false>
<#assign de=item.getPSDataEntity()>
<#if item.getAfterPSDEActionLogics?? && item.getAfterPSDEActionLogics()??>
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#if afterlogic.isValid()==true && afterlogic.getActionLogicType()?c!='2'>
<#if (afterlogic.getDstPSDE()!'')!='' && (afterlogic.getDstPSDEAction()!'')!='' && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign hasAfterLogic=true>
<#assign dataentity = afterlogic.getDstPSDE()>
<#if !P.exists("refservice",dataentity+"service")>
global ${pub.getPKGCodeName()}.core.${dataentity.getPSSystemModule().codeName?lower_case}.service.I${dataentity.codeName}Service ${srfcaseformat(dataentity.getCodeName(),'l_u2lC')}Service;
</#if>
</#if>
</#if>
</#list>
</#if>
<#if hasAfterLogic>
global ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()} et;
<#if item.getAfterPSDEActionLogics?? && item.getAfterPSDEActionLogics()??>
no-loop
<#list item.getAfterPSDEActionLogics() as afterlogic>
<#comment>实体行为附加逻辑</#comment>
<#if afterlogic.isValid()==true && afterlogic.getActionLogicType()?c!='2' && afterlogic.getDstPSDEAction()?? && afterlogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = afterlogic.getDstPSDE()>
<#assign deaction = afterlogic.getDstPSDEAction()>
<#assign dataentityCodeName = afterlogic.getDstPSDE().codeName>
<#assign deactionCodeName = srfmethodname(afterlogic.getDstPSDEAction().codeName)>
<#assign groupName = (dataentity.codeName + deaction.codeName)?lower_case>
<#assign target = afterlogic.getId()>
rule "${groupName}"
ruleflow-group "${target}"
when
then
<@addActionLogic deaction afterlogic/>
end
</#if>
</#list>
</#if>
</#if>
<#comment>附加实体行为</#comment>
<#macro addActionLogic deaction actionlogic>
<#assign actionLogicDE=actionlogic.getDstPSDE()>
<#assign actionLogicDEAction=actionlogic.getDstPSDEAction()>
<#assign sourceActionType=deaction.getActionType()>
<#assign sourceCodeName=deaction.getCodeName()?lower_case>
<#assign targetActionType=actionLogicDEAction.getActionType()>
<#assign targetCodeName=actionLogicDEAction.getCodeName()?lower_case>
<#if ((sourceActionType=='SCRIPT')|| (sourceActionType=='USERCUSTOM')|| sourceActionType=='DELOGIC'|| sourceCodeName == "create" || sourceCodeName == "update" ||
sourceCodeName == "save" || sourceCodeName == "getdraft" || sourceCodeName == "checkkey") &&
((targetActionType=='SCRIPT')|| (targetActionType=='USERCUSTOM')|| targetActionType=='DELOGIC'|| targetCodeName == "create" || targetCodeName == "update" ||
targetCodeName == "save" || targetCodeName == "getdraft" || targetCodeName == "checkkey")>
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
<@actionLogic_entity actionlogic/>
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
<#else>
<@actionLogic_entity actionlogic/>
</#if>
<#elseif sourceCodeName=='remove' && targetCodeName == "remove">
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
<@actionLogic_remove actionlogic/>
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
<#else>
<@actionLogic_remove actionlogic/>
</#if>
</#if>
</#macro>
<#comment>实体行为附加逻辑-参数:实体</#comment>
<#macro actionLogic_entity actionlogic>
<#assign actionLogicDE=actionlogic.getDstPSDE()>
<#assign actionLogicDEAction=actionlogic.getDstPSDEAction()>
${pub.getPKGCodeName()}.core.${actionLogicDE.getPSSystemModule().getCodeName()?lower_case}.domain.${actionLogicDE.getCodeName()} actionLogicDE =new ${pub.getPKGCodeName()}.core.${actionLogicDE.getPSSystemModule().getCodeName()?lower_case}.domain.${actionLogicDE.getCodeName()}();
et.copyTo(actionLogicDE,true);
${srfcaseformat(actionLogicDE.getCodeName(),'l_u2lC')}Service.${srfmethodname(actionLogicDEAction.getCodeName())}(actionLogicDE);
</#macro>
<#comment>实体行为附加逻辑-remove</#comment>
<#macro actionLogic_remove actionlogic>
<#if de.getKeyPSDEField().getStdDataType()==actionLogicDE.getKeyPSDEField().getStdDataType()>
<#assign privateCodeName = srfcaseformat(de.getKeyPSDEField().getCodeName(),'l_u2lC') >
<#assign publicCodeName = privateCodeName?cap_first >
${srfcaseformat(actionLogicDE.getCodeName(),'l_u2lC')}Service.remove(et.get${publicCodeName}());
</#if>
</#macro>
\ No newline at end of file
<#assign hasBeforeLogic =false>
<#assign hasBeforeDrl=false>
<#assign de=item.getPSDataEntity()>
<#if item.getBeforePSDEActionLogics?? && item.getBeforePSDEActionLogics()??>
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.isValid()==true && beforelogic.getActionLogicType()?c!='2'>
<#if beforelogic.isInternalLogic() && beforelogic.getPSDELogic().isEnableBackend() && beforelogic.getPSDELogic().isCustomCode()== false>
<#assign hasBeforeLogic=true>
<#elseif (beforelogic.getDstPSDE()!'')!='' && (beforelogic.getDstPSDEAction()!'')!='' && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign hasBeforeLogic=true>
<#assign hasBeforeDrl=true>
<#break>
</#if>
</#if>
</#list>
</#if>
<#if hasBeforeLogic>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="${pub.getPKGCodeName()}.core.extensions.service.logic.before" isClosed="false" isExecutable="true" name="${de.getPSSystemModule().codeName?lower_case}_${de.codeName?lower_case}_${item.codeName?lower_case}_beforeLogic" processType="Private" tns:packageName="${pub.getPKGCodeName()}.core.extensions.service.logic.before">
<extensionElements>
<tns:import name="java.util.Map"/>
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="${pub.getPKGCodeName()}.util.helper.RuleUtils"/>
<tns:import name="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()}"/>
<#comment>插入服务对象</#comment>
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#if (beforelogic.getDstPSDE()!'')!='' && (beforelogic.getDstPSDEAction()!'')!='' && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = beforelogic.getDstPSDE()>
<#assign deaction = beforelogic.getDstPSDEAction()>
<#if !P.exists("refservice",dataentity+"service")>
<tns:metaData express="T(${pub.getPKGCodeName()}.util.security.SpringContextHolder).getBean(T(${pub.getPKGCodeName()}.core.${dataentity.getPSSystemModule().codeName?lower_case}.service.I${dataentity.codeName}Service))" name="${srfcaseformat(dataentity.getCodeName(),'l_u2lC')}Service" type="service"/>
</#if>
</#if>
</#list>
<#if hasBeforeDrl>
<#comment>插入当前实体对象</#comment>
<tns:metaData express="" name="et" type="entity"/>
</#if>
</extensionElements>
<#if item.getBeforePSDEActionLogics?? && item.getBeforePSDEActionLogics()??>
<startEvent id="begin" isInterrupting="true"/>
<endEvent id="prepareparam1_end" name="end"/>
<#assign source="begin">
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.isValid()==true && beforelogic.getActionLogicType()?c!='2'>
<#comment>实体行为附加逻辑</#comment>
<#if beforelogic.isInternalLogic() && beforelogic.getPSDELogic().isEnableBackend() && beforelogic.getPSDELogic().isCustomCode()== false>
<#assign delogic = beforelogic.getPSDELogic()>
<#assign target =beforelogic.getId()>
<callActivity activiti:exclusive="true" calledElement="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${delogic.getCodeName()?lower_case}" id="${target}" name="${delogic.codeName}.json.bpmn"/>
<#elseif beforelogic.getDstPSDEAction()?? && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = beforelogic.getDstPSDE()>
<#assign deaction = beforelogic.getDstPSDEAction()>
<#assign target = beforelogic.getId()>
<#assign groupName = (dataentity.codeName + deaction.codeName)?lower_case>
<businessRuleTask activiti:exclusive="true" g:ruleFlowGroup="${target}" id="${target}" implementation="http://www.jboss.org/drools/rule" name="${groupName}"/>
</#if>
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="${target}"/>
<#assign source = target>
<#if !beforelogic_has_next>
<sequenceFlow id="${source}_prepareparam1_end" sourceRef="${source}" targetRef="prepareparam1_end"/>
</#if>
</#if>
</#list>
</#if>
</process>
</definitions>
</#if>
\ No newline at end of file
<#comment>实体行为调用实体行为</#comment>
<#assign hasBeforeLogic =false>
<#assign de=item.getPSDataEntity()>
<#if item.getBeforePSDEActionLogics?? && item.getBeforePSDEActionLogics()??>
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.isValid()==true && beforelogic.getActionLogicType()?c!='2'>
<#if (beforelogic.getDstPSDE()!'')!='' && (beforelogic.getDstPSDEAction()!'')!='' && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign hasBeforeLogic=true>
<#assign dataentity = beforelogic.getDstPSDE()>
<#if !P.exists("refservice",dataentity+"service")>
global ${pub.getPKGCodeName()}.core.${dataentity.getPSSystemModule().codeName?lower_case}.service.I${dataentity.codeName}Service ${srfcaseformat(dataentity.getCodeName(),'l_u2lC')}Service;
</#if>
</#if>
</#if>
</#list>
</#if>
<#if hasBeforeLogic>
global ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.getCodeName()} et;
<#if item.getBeforePSDEActionLogics?? && item.getBeforePSDEActionLogics()??>
no-loop
<#list item.getBeforePSDEActionLogics() as beforelogic>
<#comment>实体行为附加逻辑</#comment>
<#if beforelogic.isValid()==true && beforelogic.getActionLogicType()?c!='2' && beforelogic.getDstPSDEAction()?? && beforelogic.getDstPSDEAction().isEnableBackend()>
<#assign dataentity = beforelogic.getDstPSDE()>
<#assign deaction = beforelogic.getDstPSDEAction()>
<#assign dataentityCodeName = beforelogic.getDstPSDE().codeName>
<#assign deactionCodeName = srfmethodname(beforelogic.getDstPSDEAction().codeName)>
<#assign groupName = (dataentity.codeName + deaction.codeName)?lower_case>
<#assign target = beforelogic.getId()>
rule "${groupName}"
ruleflow-group "${target}"
when
then
<@addActionLogic deaction beforelogic/>
end
</#if>
</#list>
</#if>
</#if>
<#comment>附加实体行为</#comment>
<#macro addActionLogic deaction actionlogic>
<#assign actionLogicDE=actionlogic.getDstPSDE()>
<#assign actionLogicDEAction=actionlogic.getDstPSDEAction()>
<#assign sourceActionType=deaction.getActionType()>
<#assign sourceCodeName=deaction.getCodeName()?lower_case>
<#assign targetActionType=actionLogicDEAction.getActionType()>
<#assign targetCodeName=actionLogicDEAction.getCodeName()?lower_case>
<#if ((sourceActionType=='SCRIPT')|| (sourceActionType=='USERCUSTOM')|| sourceActionType=='DELOGIC'|| sourceCodeName == "create" || sourceCodeName == "update" ||
sourceCodeName == "save" || sourceCodeName == "getdraft" || sourceCodeName == "checkkey") &&
((targetActionType=='SCRIPT')|| (targetActionType=='USERCUSTOM')|| targetActionType=='DELOGIC'|| targetCodeName == "create" || targetCodeName == "update" ||
targetCodeName == "save" || targetCodeName == "getdraft" || targetCodeName == "checkkey")>
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
<@actionLogic_entity actionlogic/>
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
<#else>
<@actionLogic_entity actionlogic/>
</#if>
<#elseif sourceCodeName=='remove' && targetCodeName == "remove">
<#if actionlogic.isIgnoreException()?? && actionlogic.isIgnoreException()==true>
try {
<@actionLogic_remove actionlogic/>
}
catch(Exception e) {
log.error("执行[${srfmethodname(actionLogicDEAction.getCodeName())}]行为附加逻辑发生异常");
}
<#else>
<@actionLogic_remove actionlogic/>
</#if>
</#if>
</#macro>
<#comment>实体行为附加逻辑-参数:实体</#comment>
<#macro actionLogic_entity actionlogic>
<#assign actionLogicDE=actionlogic.getDstPSDE()>
<#assign actionLogicDEAction=actionlogic.getDstPSDEAction()>
${pub.getPKGCodeName()}.core.${actionLogicDE.getPSSystemModule().getCodeName()?lower_case}.domain.${actionLogicDE.getCodeName()} actionLogicDE =new ${pub.getPKGCodeName()}.core.${actionLogicDE.getPSSystemModule().getCodeName()?lower_case}.domain.${actionLogicDE.getCodeName()}();
et.copyTo(actionLogicDE,true);
${srfcaseformat(actionLogicDE.getCodeName(),'l_u2lC')}Service.${srfmethodname(actionLogicDEAction.getCodeName())}(actionLogicDE);
</#macro>
<#comment>实体行为附加逻辑-remove</#comment>
<#macro actionLogic_remove actionlogic>
<#if de.getKeyPSDEField().getStdDataType()==actionLogicDE.getKeyPSDEField().getStdDataType()>
<#assign privateCodeName = srfcaseformat(de.getKeyPSDEField().getCodeName(),'l_u2lC') >
<#assign publicCodeName = privateCodeName?cap_first >
${srfcaseformat(actionLogicDE.getCodeName(),'l_u2lC')}Service.remove(et.get${publicCodeName}());
</#if>
</#macro>
\ No newline at end of file
<#if item.getActionType()=='DELOGIC' && item.getPSDELogic()?? && item.getPSDELogic().isEnableBackend() && item.getPSDELogic().isCustomCode()== false>
<#assign de=item.getPSDataEntity()>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.mvel.org/2.0" id="Definition" name="" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<process id="${pub.getPKGCodeName()}.core.extensions.service.logic.execute" isClosed="false" isExecutable="true" name="${de.getPSSystemModule().codeName?lower_case}_${de.codeName?lower_case}_${item.codeName?lower_case}_execLogic" processType="Private" tns:packageName="${pub.getPKGCodeName()}.core.extensions.service.logic.execute">
<extensionElements>
<tns:import name="java.util.Map"/>
<tns:import name="org.springframework.util.StringUtils"/>
<tns:import name="${pub.getPKGCodeName()}.util.helper.RuleUtils"/>
</extensionElements>
<#comment>实体行为附加逻辑</#comment>
<#assign delogic = item.getPSDELogic()>
<#assign source="begin">
<#assign action=item.getPSDELogic()>
<startEvent id="begin" isInterrupting="true"/>
<endEvent id="prepareparam1_end" name="end"/>
<#assign target = action.getCodeName()>
<callActivity activiti:exclusive="true" calledElement="${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${delogic.getCodeName()?lower_case}" id="${target}" name="${delogic.codeName}.json.bpmn"/>
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="${target}"/>
<#assign source = target>
<sequenceFlow id="${source}_${target}" sourceRef="${source}" targetRef="prepareparam1_end"/>
</process>
</definitions>
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
{
"systemid":"${sys.codeName}",
"systemname":"${sys.getLogicName()}",
"entities":[
<#if sys.getAllPSDataEntities()??>
<#list sys.getAllPSDataEntities() as de>
{
"entity_name":"${de.name}",
"logic_name":"${de.logicName}",
"code_name":"${de.codeName}",
"table_name":"${de.getTableName()}",
"system_id":"${sys.codeName}",
"system_name":"${sys.logicName}",
"module_id":"${de.getPSSystemModule().codeName}",
"module_name":"${de.getPSSystemModule().name}",
<#--"ds_id":null,-->
<#--"ds_name":"",-->
"fields":[
<#if de.getPSDEFields()??>
<#list de.getPSDEFields() as defield>
{
"fieldname":"${defield.name}" ,
"codename":"${defield.codeName}",
"field_logic_name":"${defield.logicName}",
"entity_name":"${de.name}",
<#if defield.getRelatedPSDEField?? && defield.getRelatedPSDEField()??>
"ref_de":"${defield.getRelatedPSDEField().getPSDataEntity().name}",
"ref_field_name":"${defield.getRelatedPSDEField().name}",
</#if>
<#if (((defield.getDataType())!'')=='PICKUP' || ((defield.getDataType())!'')=='PICKUPDATA' || ((defield.getDataType())!'')=='PICKUPTEXT' ) && defield.getPSDER1N()?? >
"relation_name":"${defield.getPSDER1N().getName()}",
"relation_codename":"${defield.getPSDER1N().getCodeName()}",
</#if>
"field_type":"${defield.getDataType()}",
<#if defield.getPSCodeList()??>
"dict":"${defield.getPSCodeList().codeName}",
</#if>
"nullable":<#if defield.isAllowEmpty()>1<#else>0</#if>,
"physical_field":<#if defield.isPhisicalDEField()>1<#else>0</#if>,
"data_type":"${srfdatatype(defield.getStdDataType())}",
<#if defield.getLength()?c!='-1'>
"data_length":${defield.getLength()?c},
</#if>
<#if defield.getPrecision()?c!='0'>
"data_preci":${defield.getPrecision()?c},
</#if>
<#if defield.getDefaultPSDEFDTColumn?? && defield.getDefaultPSDEFDTColumn()?? && defield.getDefaultPSDEFDTColumn().isFormula()==true>
"expression":"${defield.getDefaultPSDEFDTColumn().getFormulaFormat()}",
</#if>
<#if defield.getPredefinedType()?? && defield.getPredefinedType()!=''>
"predefined":"${defield.getPredefinedType()}",
</#if>
"key_field":<#if defield.isKeyDEField()==true>1<#else>0</#if>,
<#if defield.getUnionKeyValue()?? && defield.getUnionKeyValue()!=''>
"union_key":"${defield.getUnionKeyValue()}",
</#if>
<#if defield.getOrderValue?? && defield.getOrderValue()??>
"show_order":${defield.getOrderValue()?c},
</#if>
"major_field":<#if defield.isMajorDEField()==true>1<#else>0</#if>
}<#if defield_has_next>,</#if>
</#list>
</#if>
],
"subEntitys":[
<#if de.getMinorPSDERs()??>
<#list de.getMajorPSDERs() as majorPSDER>
{"name":"${majorPSDER.name}",
"relation_type":"${majorPSDER.getDERType()}",
"code_name":"${majorPSDER.getCodeName()}",
"entity_name":"${majorPSDER.getMinorPSDataEntity().name}",
"ref_entity_name":"${majorPSDER.getMajorPSDataEntity().name}"
<#--"nested_name":"",-->
<#--"lookup":""-->
}<#if majorPSDER_has_next>,</#if>
</#list>
</#if>
],
"parentEntitys":[
<#if de.getMinorPSDERs()??>
<#list de.getMinorPSDERs() as minorPSDER>
{"name":"${minorPSDER.name}",
"relation_type":"${minorPSDER.getDERType()}",
"code_name":"${minorPSDER.getCodeName()}",
"entity_name":"${minorPSDER.getMinorPSDataEntity().name}",
"ref_entity_name":"${minorPSDER.getMajorPSDataEntity().name}"
<#--"nested_name":"",-->
<#--"lookup":""-->
}<#if minorPSDER_has_next>,</#if>
</#list>
</#if>
]
}
<#if de_has_next>,</#if>
</#list>
</#if>
]
}
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#comment>系统是否包含预定义代码表</#comment>
<#assign hasPredefinedCodeList=false>
<#list sys.getAllPSCodeLists() as codelist>
<#if codelist.getPredefinedType()?? && codelist.getPredefinedType()=='RUNTIME'>
<#assign hasPredefinedCodeList=true>
<#break>
</#if>
</#list>
<#if hasPredefinedCodeList>
<#assign isFirstCodeList=true>
[ <#list sys.getAllPSCodeLists() as codelist>
<#if codelist.getPredefinedType()?? && codelist.getPredefinedType()=='RUNTIME'>
<#if isFirstCodeList==false>,</#if>
{
"name":"${codelist.name}",
"code":"${codelist.codeName}",
"group":"",
"memo":"",
"enable":"",
<#if codelist.getAllPSCodeItems()??>
"items":[<#list codelist.getAllPSCodeItems() as codeItem>
{
"catalog_id":"${codelist.codeName}",
"catalog_name":"${codelist.name}",
"value_key":"${codelist.codeName}-${codeItem.codeName}",
"value":"${codeItem.value}",
"label":"${codeItem.text}",
"disabled":"",
"showorder":""
<#if codeItem.getParentCodeItem?? && codeItem.getParentCodeItem()??>
,"parent":"${codeItem.getParentCodeItem().value}"
</#if>
}<#if codeItem_has_next>,</#if>
</#list>
]
</#if>
}
<#assign isFirstCodeList=false>
</#if>
</#list>
]
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>${pub.getCodeName()?lower_case}</artifactId>
<groupId>${pub.getPKGCodeName()?lower_case}</groupId>
<version>${pub.getVersionString()?default("V0.0.1_alpha")}</version>
<name>${pub.getCodeName()?lower_case?cap_first}</name>
<description></description>
<packaging>pom</packaging>
<parent>
<groupId>cn.ibizlab</groupId>
<artifactId>ibizlab-boot-starter-parent</artifactId>
<version>2.4.0-SNAPSHOT</version>
</parent>
<modules>
<!-- cores -->
<module>${pub.getCodeName()?lower_case}-core</module>
<!-- boot -->
<module>${pub.getCodeName()?lower_case}-boot</module>
</modules>
<dependencies>
<dependency>
<groupId>cn.ibizlab</groupId>
<artifactId>ibizlab-template-ibizedge</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>ibizmvnrepository</id>
<name>ibizmvnrepository</name>
<url>http://172.16.240.220:8081/repository/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>aliyunmaven</id>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>ibizmvnrepository-plugin</id>
<url>http://172.16.240.220:8081/repository/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>aliyun-plugin</id>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<configuration>
<generateBackupPoms>false</generateBackupPoms>
</configuration>
</plugin>
</plugins>
</build>
</project>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册