Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
c0024bd4
提交
c0024bd4
编写于
5月 06, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
合并dev2开发分支
上级
7fe90329
变更
25
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
679 行增加
和
296 行删除
+679
-296
pom.xml.ftl
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/pom.xml.ftl
+6
-2
%PUBPRJ%-app-%APP_PKGPATH%.yaml.ftl
...PATH%/src/main/docker/%PUBPRJ%-app-%APP_PKGPATH%.yaml.ftl
+4
-0
%APP%Application.java.ftl
...ava/%SYS_PKGPATH%/%APP_PKGPATH%/%APP%Application.java.ftl
+10
-1
%APP%SecurityConfig.java.ftl
...KGPATH%/%APP_PKGPATH%/config/%APP%SecurityConfig.java.ftl
+13
-0
application-%APP_PKGPATH%-prod.yml.ftl
...src/main/resources/application-%APP_PKGPATH%-prod.yml.ftl
+10
-0
DevBootApplication.java.ftl
...t/src/main/java/%SYS_PKGPATH%/DevBootApplication.java.ftl
+10
-1
DevBootSecurityConfig.java.ftl
.../java/%SYS_PKGPATH%/config/DevBootSecurityConfig.java.ftl
+13
-0
application-dev.yml.ftl
SLN/%PUBPRJ%-boot/src/main/resources/application-dev.yml.ftl
+36
-1
%DE%ServiceImpl.java.ftl
.../core/%MOD_PKGPATH%/service/impl/%DE%ServiceImpl.java.ftl
+1
-1
DEPrivs.json.ftl
...%PUBPRJ%-core/src/main/resources/deprivs/DEPrivs.json.ftl
+39
-4
${de.codeName}Mapper.xml.ftl
...r/%MOD_PKGPATH%/%DE_PKGPATH%/${de.codeName}Mapper.xml.ftl
+6
-4
pom.xml.ftl
...%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/pom.xml.ftl
+6
-1
%PUBPRJ%-provider-%SYSAPI_PKGPATH%.yaml.ftl
...c/main/docker/%PUBPRJ%-provider-%SYSAPI_PKGPATH%.yaml.ftl
+4
-0
%SYS%%API%Application.java.ftl
..._PKGPATH%/%SYSAPI_PKGPATH%/%SYS%%API%Application.java.ftl
+10
-1
%ITEM%Resource.java.ftl
...YS_PKGPATH%/%SYSAPI_PKGPATH%/rest/%ITEM%Resource.java.ftl
+10
-8
FileItem.java.ftl
...src/main/java/%SYS_PKGPATH%/util/domain/FileItem.java.ftl
+2
-0
SearchContextBase.java.ftl
...java/%SYS_PKGPATH%/util/filter/SearchContextBase.java.ftl
+5
-9
PermissionSyncJob.java.ftl
...in/java/%SYS_PKGPATH%/util/job/PermissionSyncJob.java.ftl
+3
-4
FileController.java.ftl
...main/java/%SYS_PKGPATH%/util/rest/FileController.java.ftl
+3
-4
AuthPermissionEvaluator.java.ftl
...S_PKGPATH%/util/security/AuthPermissionEvaluator.java.ftl
+454
-233
AuthenticationUser.java.ftl
...a/%SYS_PKGPATH%/util/security/AuthenticationUser.java.ftl
+4
-4
SimpleFileService.java.ftl
...ava/%SYS_PKGPATH%/util/service/SimpleFileService.java.ftl
+11
-15
SimpleUserService.java.ftl
...ava/%SYS_PKGPATH%/util/service/SimpleUserService.java.ftl
+3
-0
application-sys.yml.ftl
SLN/%PUBPRJ%-util/src/main/resources/application-sys.yml.ftl
+4
-0
config.xml.ftl
SLN/config.xml.ftl
+12
-3
未找到文件。
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/pom.xml.ftl
浏览文件 @
c0024bd4
...
...
@@ -31,9 +31,11 @@ TARGET=PSSYSAPP
</#if>
</dependencies>
<#if pub.getPSDeployCenter()?? && pub.getPSDeployCenter().getPSRegistryRepo()??>
<properties>
<docker.image.prefix>
registry.cn-shanghai.aliyuncs.com/ibizsys
</docker.image.prefix>
<docker.image.prefix>
${pub.getPSDeployCenter().getPSRegistryRepo().getConnStr()}
</docker.image.prefix>
</properties>
</#if>
<profiles>
...
...
@@ -107,7 +109,8 @@ TARGET=PSSYSAPP
</execution>
</executions>
</plugin>
<#if pub.getPSDeployCenter()?? && pub.getPSDeployCenter().getPSRegistryRepo()??>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
...
...
@@ -125,6 +128,7 @@ TARGET=PSSYSAPP
</resources>
</configuration>
</plugin>
</#if>
</plugins>
</build>
</profile>
...
...
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/docker/%PUBPRJ%-app-%APP_PKGPATH%.yaml.ftl
浏览文件 @
c0024bd4
...
...
@@ -17,6 +17,10 @@ services:
- "${httpPort}:${httpPort}"
networks:
- agent_network
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode().getSSHIPAddr()??>
environment:
SPRING_CLOUD_NACOS_DISCOVERY_IP: ${sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode().getSSHIPAddr()}
</#if>
deploy:
mode: replicated
replicas: 1
...
...
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/java/%SYS_PKGPATH%/%APP_PKGPATH%/%APP%Application.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -14,6 +14,9 @@ import org.springframework.context.annotation.Configuration;
import
org
.
springframework
.
context
.
annotation
.
Import
;
import
org
.
mybatis
.
spring
.
annotation
.
MapperScan
;
import
org
.
springframework
.
boot
.
SpringApplication
;
import
org
.
springframework
.
web
.
method
.
support
.
HandlerMethodArgumentResolver
;
import
org
.
springframework
.
web
.
servlet
.
config
.
annotation
.
WebMvcConfigurerAdapter
;
import
java
.
util
.
List
;
@
Slf4j
@
Import
({
...
...
@@ -28,9 +31,15 @@ import org.springframework.boot.SpringApplication;
@
SpringBootApplication
(
exclude
=
{
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
.
SecurityAutoConfiguration
.
class
,
})
public
class
${
app
.
getPKGCodeName
()}
Application
{
public
class
${
app
.
getPKGCodeName
()}
Application
extends
WebMvcConfigurerAdapter
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(${
app
.
getPKGCodeName
()}
Application
.
class
,
args
);
}
@
Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
super
.
addArgumentResolvers
(
argumentResolvers
);
argumentResolvers
.
add
(
new
${
pub
.
getPKGCodeName
()}.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
());
}
}
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/java/%SYS_PKGPATH%/%APP_PKGPATH%/config/%APP%SecurityConfig.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -44,6 +44,15 @@ public class ${app.getPKGCodeName()}SecurityConfig extends WebSecurityConfigurer
@
Value
(
"${r'${ibiz.auth.path:v7/login}"
'})
private String loginPath;
@Value("${r'
${
ibiz
.
file
.
uploadpath
:
ibizutil
/
upload
}
"'})
private String uploadpath;
@Value("
${
r
'${ibiz.file.downloadpath:ibizutil/download}"'
})
private
String
downloadpath
;
@
Value
(
"${r'${ibiz.file.previewpath:ibizutil/preview}"
'})
private String previewpath;
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
...
...
@@ -100,6 +109,10 @@ public class ${app.getPKGCodeName()}SecurityConfig extends WebSecurityConfigurer
).permitAll()
//放行登录请求
.antMatchers( HttpMethod.POST,"/"+loginPath).permitAll()
// 文件操作
.antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll()
.antMatchers("/"+previewpath+"/**").permitAll()
// 所有请求都需要认证
.anyRequest().authenticated()
// 防止iframe 造成跨域
...
...
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/resources/application-%APP_PKGPATH%-prod.yml.ftl
浏览文件 @
c0024bd4
...
...
@@ -16,12 +16,16 @@ server:
#zuul网关路由设置
zuul:
routes:
<#assign haswfentity=false>
<#list item.getAllPSAppDataEntities() as appDataEntity>
<#assign serviceId="">
<#assign serviceUrl=srfpluralize(appDataEntity.codeName?lower_case)>
<#assign appEntity=appDataEntity.name?lower_case>
<#assign psDataEntity=appDataEntity.getPSDataEntity()>
<#assign systemName=sys.getCodeName()?lower_case>
<#if psDataEntity.hasPSDEWF()??>
<#assign haswfentity=true>
</#if>
<#if psDataEntity.getStorageMode()==4>
<#comment>serviceApi模式</#comment>
<#assign serviceId=(psDataEntity.getPSSubSysServiceAPI().getServiceCodeName())!''>
...
...
@@ -36,6 +40,12 @@ zuul:
serviceId: ${serviceId}
stripPrefix: false
</#list>
<#if haswfentity==true>
wfcore:
path: /wfcore/**
serviceId: ibzwf-api
stripPrefix: false
</#if>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
sensitive-headers:
- Cookie,Set-Cookie,Authorization
...
...
SLN/%PUBPRJ%-boot/src/main/java/%SYS_PKGPATH%/DevBootApplication.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -10,6 +10,9 @@ import org.springframework.context.annotation.Configuration;
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
java
.
util
.
List
;
@
Slf4j
@
EnableDiscoveryClient
...
...
@@ -17,9 +20,15 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@
EnableTransactionManagement
@
SpringBootApplication
@
EnableFeignClients
(
basePackages
=
{
"${pub.getPKGCodeName()}"
})
public
class
DevBootApplication
{
public
class
DevBootApplication
extends
WebMvcConfigurerAdapter
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
DevBootApplication
.
class
,
args
);
}
@
Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
super
.
addArgumentResolvers
(
argumentResolvers
);
argumentResolvers
.
add
(
new
${
pub
.
getPKGCodeName
()}.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
());
}
}
SLN/%PUBPRJ%-boot/src/main/java/%SYS_PKGPATH%/config/DevBootSecurityConfig.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -43,6 +43,15 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
@
Value
(
"${r'${ibiz.auth.path:v7/login}"
'})
private String loginPath;
@Value("${r'
${
ibiz
.
file
.
uploadpath
:
ibizutil
/
upload
}
"'})
private String uploadpath;
@Value("
${
r
'${ibiz.file.downloadpath:ibizutil/download}"'
})
private
String
downloadpath
;
@
Value
(
"${r'${ibiz.file.previewpath:ibizutil/preview}"
'})
private String previewpath;
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
...
...
@@ -95,6 +104,10 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
).permitAll()
//放行登录请求
.antMatchers( HttpMethod.POST,"/"+loginPath).permitAll()
// 文件操作
.antMatchers("/"+downloadpath+"/**").permitAll()
.antMatchers("/"+uploadpath).permitAll()
.antMatchers("/"+previewpath+"/**").permitAll()
.anyRequest().authenticated()
// 防止iframe 造成跨域
.and().headers().frameOptions().disable();
...
...
SLN/%PUBPRJ%-boot/src/main/resources/application-dev.yml.ftl
浏览文件 @
c0024bd4
...
...
@@ -10,4 +10,39 @@ TARGET=PSSYSTEM
</#if>
</#if>
server:
port: ${httpPort}
\ No newline at end of file
port: ${httpPort}
<#if item.getAllPSAppDataEntities?? && app.getAllPSAppDataEntities()??>
#zuul网关路由设置
zuul:
routes:
<#assign haswfentity=false>
<#list item.getAllPSAppDataEntities() as appDataEntity>
<#assign serviceId="">
<#assign serviceUrl=srfpluralize(appDataEntity.codeName?lower_case)>
<#assign appEntity=appDataEntity.name?lower_case>
<#assign psDataEntity=appDataEntity.getPSDataEntity()>
<#assign systemName=sys.getCodeName()?lower_case>
<#if psDataEntity.hasPSDEWF()??>
<#assign haswfentity=true>
</#if>
<#if psDataEntity.getStorageMode()==4>
<#comment>serviceApi模式</#comment>
<#assign serviceId=(psDataEntity.getPSSubSysServiceAPI().getServiceCodeName())!''>
<#assign serviceUrl=srfpluralize(appDataEntity.name?lower_case)>
${appEntity}:
path: /${serviceUrl}/**
serviceId: ${serviceId}
stripPrefix: false
</#if>
</#list>
<#if haswfentity==true>
wfcore:
path: /wfcore/**
serviceId: ibzwf-api
stripPrefix: false
</#if>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
sensitive-headers:
- Cookie,Set-Cookie,Authorization
</#if>
\ No newline at end of file
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/%MOD_PKGPATH%/service/impl/%DE%ServiceImpl.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -50,7 +50,7 @@ import com.alibaba.fastjson.JSONObject;
*
实体
[${
item
.
getLogicName
()}]
服务对象接口实现
*/
@
Slf4j
@
Service
@
Service
(
"${item.getCodeName()}ServiceImpl"
)
public
class
${
item
.
getCodeName
()}
ServiceImpl
extends
ServiceImpl
<${
de
.
getCodeName
()}
Mapper
,
${
de
.
getCodeName
()}>
implements
I
${
de
.
getCodeName
()}
Service
{
<#
assign
keyfield
=
de
.
getKeyPSDEField
()>
...
...
SLN/%PUBPRJ%-core/src/main/resources/deprivs/DEPrivs.json.ftl
浏览文件 @
c0024bd4
...
...
@@ -2,8 +2,10 @@
TARGET=PSSYSTEM
</#ibiztemplate>
<#if sys.getAllPSApps()??>
{
"predefineddatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
<#assign ct=0>
[
"entities":
[
<#list sys.getAllPSApps() as app>
<#if app.getAllPSAppDataEntities?? && app.getAllPSAppDataEntities()??>
<#list app.getAllPSAppDataEntities() as appde><#comment>由于平台暂未开放获取实体操作标识的方法,所以暂时写死</#comment>
...
...
@@ -11,18 +13,51 @@ TARGET=PSSYSTEM
<#if !P.exists(de.getCodeName(),"")>
<#if (ct>0)>
,</#if><#assign ct=ct+1>
<#assign dataSetResult=getDataSet()>
<#assign deActionResult=getDEAction()>
{
"dename":"${de.codeName}",
"delogicname":"${de.logicName}",
"sysmoudle":{"id":"${de.getPSSystemModule().codeName?upper_case}","name":"${de.getPSSystemModule().name}"},
"dedataset":[{"id":"Default","name":"默认数据集"}],
"dedatarange":[{"id":"ALL","name":"全部数据"},{"id":"CURORG","name":"当前单位"},{"id":"PORG","name":"上级单位"},{"id":"SORG","name":"下级单位"},{"id":"CURORGDEPT","name":"当前部门"},{"id":"PORGDEPT","name":"上级部门"},{"id":"SORGDEPT","name":"下级部门"}],
"deprivs":[{"id":"READ","name":"READ"},{"id":"CREATE","name":"CREATE"},{"id":"UPDATE","name":"UPDATE"},{"id":"DELETE","name":"DELETE"}]
"dedataset":${dataSetResult},
"deaction":${deActionResult}
}
</#if>
</#list>
</#if>
</#list>
]
}
</#if>
<#comment>获取实体数据集</#comment>
<#function getDataSet>
<#assign result="[" >
<#if de.getAllPSDEDataSets()??>
<#list de.getAllPSDEDataSets() as dataSet>
<#if dataSet_index gt 0><#assign result=result+","></#if>
<#assign dataSetLogicName="">
<#if dataSet.getLogicName()?? && dataSet.getLogicName()!=''><#assign dataSetLogicName=dataSet.getLogicName()><#else><#assign dataSetLogicName=dataSet.codeName></#if>
<#assign result=result+"{\"id\":\""+dataSet.codeName+"\" , \"name\":\""+dataSetLogicName+"\"}">
</#list>
</#if>
<#assign result=result+"]" >
<#return result>
</#function>
<#comment>获取实体行为</#comment>
<#function getDEAction>
<#assign result="[" >
<#if de.getAllPSDEActions()??>
<#list de.getAllPSDEActions() as deAction>
<#if deAction_index gt 0><#assign result=result+","></#if>
<#assign deActionLogicName="">
<#if deAction.getLogicName()?? && deAction.getLogicName()!=''><#assign deActionLogicName=deAction.getLogicName()><#else><#assign deActionLogicName=deAction.codeName></#if>
<#assign result=result+"{\"id\":\""+deAction.codeName+"\" , \"name\":\""+deActionLogicName+"\" , \"type\":\""+deAction.getActionType()+"\" }">
</#list>
</#if>
<#assign result=result+"]" >
<#return result>
</#function>
SLN/%PUBPRJ%-core/src/main/resources/mapper/%MOD_PKGPATH%/%DE_PKGPATH%/${de.codeName}Mapper.xml.ftl
浏览文件 @
c0024bd4
...
...
@@ -185,11 +185,13 @@ TARGET=PSDATAENTITY
</mapper>
</#if>
<#comment>上下文参数转换</#comment>
<#comment>上下文参数转换 原字符串:${srfdatacontext('field','{"defname":"PORGNAME","dename":"IBZORG"}')})</#comment>
<#comment>第一次替换:#{srf.datacontext.field','{"defname":"PORGNAME","dename":"IBZORG"}')})</#comment>
<#comment>第二次替换:#{srf.datacontext.field}</#comment>
<#function contextParamConvert contextParam>
<#assign resultParam="">
<#assign resultParam=contextParam?replace('$\{srfdatacontext(\'','#\{srf.datacontext.')?replace("','\\{[\\S]*","\\}","r")><#comment>数据上下文</#comment>
<#assign resultParam=resultParam?replace('$\{srfsessioncontext(\'','#\{srf.sessioncontext.')?replace("','\\{[\\S]*","\\}","r")><#comment>用户上下文</#comment>
<#assign resultParam=resultParam?replace('$\{srfwebcontext(\'','#\{srf.webcontext.')?replace("','\\{[\\S]*","\\}","r")><#comment>网页请求上下文</#comment>
<#assign resultParam=contextParam?replace('$\{srfdatacontext(\'','#\{srf.datacontext.')?replace("','\\{[\\S]*
}'\\)}
","\\}","r")><#comment>数据上下文</#comment>
<#assign resultParam=resultParam?replace('$\{srfsessioncontext(\'','#\{srf.sessioncontext.')?replace("','\\{[\\S]*
}'\\)}
","\\}","r")><#comment>用户上下文</#comment>
<#assign resultParam=resultParam?replace('$\{srfwebcontext(\'','#\{srf.webcontext.')?replace("','\\{[\\S]*
}'\\)}
","\\}","r")><#comment>网页请求上下文</#comment>
<#return resultParam>
</#function>
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/pom.xml.ftl
浏览文件 @
c0024bd4
...
...
@@ -34,9 +34,11 @@ TARGET=PSSYSSERVICEAPI
</dependency>
</dependencies>
<#if pub.getPSDeployCenter()?? && pub.getPSDeployCenter().getPSRegistryRepo()??>
<properties>
<docker.image.prefix>
registry.cn-shanghai.aliyuncs.com/ibizsys
</docker.image.prefix>
<docker.image.prefix>
${pub.getPSDeployCenter().getPSRegistryRepo().getConnStr()}
</docker.image.prefix>
</properties>
</#if>
<profiles>
<profile>
...
...
@@ -69,6 +71,8 @@ TARGET=PSSYSSERVICEAPI
</execution>
</executions>
</plugin>
<#if pub.getPSDeployCenter()?? && pub.getPSDeployCenter().getPSRegistryRepo()??>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
...
...
@@ -86,6 +90,7 @@ TARGET=PSSYSSERVICEAPI
</resources>
</configuration>
</plugin>
</#if>
</plugins>
</build>
</profile>
...
...
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/docker/%PUBPRJ%-provider-%SYSAPI_PKGPATH%.yaml.ftl
浏览文件 @
c0024bd4
...
...
@@ -17,6 +17,10 @@ services:
- "${httpPort}:${httpPort}"
networks:
- agent_network
<#if sysrun?? && sysrun.getPSDevSlnMSDepAPI()?? && sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode()?? && sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode().getSSHIPAddr()??>
environment:
SPRING_CLOUD_NACOS_DISCOVERY_IP: ${sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode().getSSHIPAddr()}
</#if>
deploy:
mode: replicated
replicas: 1
...
...
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/%SYS%%API%Application.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -12,6 +12,9 @@ import org.springframework.context.annotation.Configuration;
import
org
.
springframework
.
data
.
mongodb
.
repository
.
config
.
EnableMongoRepositories
;
import
org
.
springframework
.
transaction
.
annotation
.
EnableTransactionManagement
;
import
org
.
mybatis
.
spring
.
annotation
.
MapperScan
;
import
org
.
springframework
.
web
.
method
.
support
.
HandlerMethodArgumentResolver
;
import
org
.
springframework
.
web
.
servlet
.
config
.
annotation
.
WebMvcConfigurerAdapter
;
import
java
.
util
.
List
;
@
Slf4j
@
EnableDiscoveryClient
...
...
@@ -23,9 +26,15 @@ import org.mybatis.spring.annotation.MapperScan;
@
SpringBootApplication
(
exclude
=
{
org
.
springframework
.
boot
.
autoconfigure
.
security
.
servlet
.
SecurityAutoConfiguration
.
class
,
})
public
class
${
sys
.
codeName
}${
item
.
codeName
}
Application
{
public
class
${
sys
.
codeName
}${
item
.
codeName
}
Application
extends
WebMvcConfigurerAdapter
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(${
sys
.
codeName
}${
item
.
codeName
}
Application
.
class
,
args
);
}
@
Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
super
.
addArgumentResolvers
(
argumentResolvers
);
argumentResolvers
.
add
(
new
${
pub
.
getPKGCodeName
()}.
util
.
web
.
SearchContextHandlerMethodArgumentResolver
());
}
}
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/rest/%ITEM%Resource.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -17,6 +17,8 @@ TARGET=PSDESERVICEAPI
<#
assign
itemSysApiCodeName
=
item
.
getPSSysServiceAPI
().
getCodeName
()>
<#
assign
itemSysApiCodeNameLC
=
item
.
getPSSysServiceAPI
().
getCodeName
()?
lower_case
>
<#
assign
keyCNLC
=
"_id"
>
<#
assign
deStorageMode
=
"None"
>
<#
if
de
.
getStorageMode
()==
1
><#
assign
deStorageMode
=
"Sql"
><#
elseif
de
.
getStorageMode
()==
2
><#
assign
deStorageMode
=
"NoSQL"
><#
elseif
de
.
getStorageMode
()==
4
><#
assign
deStorageMode
=
"ServiceApi"
></#
if
>
package
${
pubPkgCodeName
}.${
itemSysApiCodeNameLC
}.
rest
;
import
java
.
sql
.
Timestamp
;
...
...
@@ -147,7 +149,7 @@ public class ${itemCodeName}Resource {
<#
if
deaction
.
codeName
?
lower_case
==
'create'
>
@
PreAuthorize
(
"hasPermission('','C
REATE',this.getEntity()
)"
)
@
PreAuthorize
(
"hasPermission('','C
reate',{this.getEntity(),'${deStorageMode}'}
)"
)
@
ApiOperation
(
value
=
"${deaction.getLogicName()}"
,
tags
=
{
"${itemCodeName}"
},
notes
=
"${deaction.getLogicName()}"
)
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"${fullPath}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
...
...
@@ -158,7 +160,7 @@ public class ${itemCodeName}Resource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@
PreAuthorize
(
"hasPermission('','C
REATE',this.getEntity()
)"
)
@
PreAuthorize
(
"hasPermission('','C
reate',{this.getEntity(),'${deStorageMode}'}
)"
)
@
ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"${fullPath}/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(${
etParamsList
})
{
...
...
@@ -167,7 +169,7 @@ public class ${itemCodeName}Resource {
}
<#
elseif
deaction
.
codeName
?
lower_case
==
'update'
>
@
PreAuthorize
(
"hasPermission(#${itemCodeNameLC + keyCNLC},'U
PDATE',this.getEntity()
)"
)
@
PreAuthorize
(
"hasPermission(#${itemCodeNameLC + keyCNLC},'U
pdate',{this.getEntity(),'${deStorageMode}'}
)"
)
@
ApiOperation
(
value
=
"${deaction.getLogicName()}"
,
tags
=
{
"${itemCodeName}"
},
notes
=
"${deaction.getLogicName()}"
)
@
RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
...
...
@@ -179,7 +181,7 @@ public class ${itemCodeName}Resource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@
PreAuthorize
(
"hasPermission(#${itemCodeNameLC + keyCNLC},'U
PDATE',this.getEntity()
)"
)
@
PreAuthorize
(
"hasPermission(#${itemCodeNameLC + keyCNLC},'U
pdate',{this.getEntity(),'${deStorageMode}'}
)"
)
@
ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@
RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"${fullPath}/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(${
etParamsList
})
{
...
...
@@ -202,7 +204,7 @@ public class ${itemCodeName}Resource {
}
<#
elseif
deaction
.
codeName
?
lower_case
==
'remove'
>
@
PreAuthorize
(
"hasPermission('
DELETE',{#${itemCodeNameLC + keyCNLC},this.getEntity()
})"
)
@
PreAuthorize
(
"hasPermission('
Remove',{#${itemCodeNameLC + keyCNLC},{this.getEntity(),'${deStorageMode}'}
})"
)
@
ApiOperation
(
value
=
"${deaction.getLogicName()}"
,
tags
=
{
"${itemCodeName}"
},
notes
=
"${deaction.getLogicName()}"
)
@
RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}"
)
<#
if
de
.
getStorageMode
()==
4
><#
else
>
@
Transactional
</#
if
>
...
...
@@ -218,7 +220,7 @@ public class ${itemCodeName}Resource {
}
<#
elseif
deaction
.
codeName
?
lower_case
==
'get'
>
@
PreAuthorize
(
"hasPermission(#${itemCodeNameLC + keyCNLC},'
READ',this.getEntity()
)"
)
@
PreAuthorize
(
"hasPermission(#${itemCodeNameLC + keyCNLC},'
Get',{this.getEntity(),'${deStorageMode}'}
)"
)
@
ApiOperation
(
value
=
"${deaction.getLogicName()}"
,
tags
=
{
"${itemCodeName}"
},
notes
=
"${deaction.getLogicName()}"
)
@
RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"${fullPath}/{${itemCodeNameLC + keyCNLC}}"
)
public
ResponseEntity
<${
itemCodeName
}
DTO
>
get
(${
idParams
})
{
...
...
@@ -261,7 +263,7 @@ public class ${itemCodeName}Resource {
</#
if
>
<#
elseif
apiMethod
.
getActionType
()==
'FETCH'
>
<#
assign
deds
=
apiMethod
.
getPSDEDataSet
()>
@
PreAuthorize
(
"hasPermission('
READ',{#context,'${deds.getCodeName()}',this.getEntity()
})"
)
@
PreAuthorize
(
"hasPermission('
Get',{#context,'${deds.getCodeName()}',this.getEntity(),'${deStorageMode}'
})"
)
@
ApiOperation
(
value
=
"fetch${deds.getLogicName()}"
,
tags
=
{
"${itemCodeName}"
}
,
notes
=
"fetch${deds.getLogicName()}"
)
@
RequestMapping
(
method
=
RequestMethod
.${
reqMtd
}
,
value
=
"${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>"
)
public
ResponseEntity
<
List
<${
itemCodeName
}
DTO
>>
fetch
<#
if
(
deds
.
getName
()==
'DEFAULT'
)>${
deds
.
getCodeName
()}<#
else
>${
deds
.
getCodeName
()}</#
if
>(${
deCodeName
}
SearchContext
context
)
{
...
...
@@ -275,7 +277,7 @@ public class ${itemCodeName}Resource {
.
body
(
list
);
}
@
PreAuthorize
(
"hasPermission('
READ',{#context,'${deds.getCodeName()}',this.getEntity()
})"
)
@
PreAuthorize
(
"hasPermission('
Get',{#context,'${deds.getCodeName()}',this.getEntity(),'${deStorageMode}'
})"
)
@
ApiOperation
(
value
=
"search${deds.getLogicName()}"
,
tags
=
{
"${itemCodeName}"
}
,
notes
=
"search${deds.getLogicName()}"
)
@
RequestMapping
(
method
=
RequestMethod
.${
reqMtd
}
,
value
=
"${fullPath}/search<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>"
)
public
ResponseEntity
<
Page
<${
itemCodeName
}
DTO
>>
search
<#
if
(
deds
.
getName
()==
'DEFAULT'
)>${
deds
.
getCodeName
()}<#
else
>${
deds
.
getCodeName
()}</#
if
>(${
deCodeName
}
SearchContext
context
)
{
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/domain/FileItem.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -17,6 +17,8 @@ public class FileItem
{
private
String
id
;
private
String
name
;
private
String
fileid
;
private
String
filename
;
private
long
size
;
private
String
ext
;
}
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/filter/SearchContextBase.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -3,6 +3,7 @@ TARGET=PSSYSTEM
</#
ibiztemplate
>
package
${
pub
.
getPKGCodeName
()}.
util
.
filter
;
import
${
pub
.
getPKGCodeName
()}.
util
.
security
.
AuthenticationUser
;
import
com
.
fasterxml
.
jackson
.
annotation
.
JsonAnyGetter
;
import
com
.
fasterxml
.
jackson
.
annotation
.
JsonAnySetter
;
import
com
.
fasterxml
.
jackson
.
annotation
.
JsonProperty
;
...
...
@@ -109,16 +110,11 @@ public class SearchContextBase implements ISearchContext{
}
/**
*
用户上下文参数
*/
Map
<
String
,
Object
>
sessionparams
=
new
HashMap
<
String
,
Object
>()
;
/**
*
获取用户上下文
*
@
return
*/
*
获取用户上下文
*
@
return
*/
public
Map
<
String
,
Object
>
getSessioncontext
()
{
return
sessionparams
;
return
AuthenticationUser
.
getAuthenticationUser
().
getSessionParams
()
;
}
@
JsonAnyGetter
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/job/PermissionSyncJob.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -44,14 +44,13 @@ public class PermissionSyncJob implements ApplicationRunner {
private
String
systemId
;
@
Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
public
void
run
(
ApplicationArguments
args
)
{
if
(
enablePermissionValid
){
try
{
InputStream
permission
=
this
.
getClass
().
getResourceAsStream
(
"/deprivs/DEPrivs.json"
);
//
获取当前系统所有实体资源能力
String
permissionResult
=
IOUtils
.
toString
(
permission
,
"UTF-8"
);
JSONArray
jsonNodePermission
=
JSONArray
.
parseArray
(
permissionResult
);
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"menu"
,
new
JSONArray
());
JSONObject
jsonNodePermission
=
JSONObject
.
parseObject
(
permissionResult
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"permission"
,
jsonNodePermission
);
client
.
pushSystemPermissionData
(
map
,
systemId
);
}
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/rest/FileController.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -17,21 +17,20 @@ import java.io.*;
@
Slf4j
@
RestController
@
RequestMapping
(
"/"
)
public
class
FileController
{
@
Autowired
private
FileService
fileService
;
@
PostMapping
(
value
=
"${r'${ibiz.
uploadpath.
path:ibizutil/upload}'}"
)
@
PostMapping
(
value
=
"${r'${ibiz.
file.upload
path:ibizutil/upload}'}"
)
public
ResponseEntity
<
FileItem
>
upload
(@
RequestParam
(
"file"
)
MultipartFile
multipartFile
){
return
ResponseEntity
.
ok
().
body
(
fileService
.
saveFile
(
multipartFile
));
}
private
final
String
defaultdownloadpath
=
"ibizutil/download/{id}"
;
protected
String
getDefaultdownloadpath
(){
return
defaultdownloadpath
;
}
@
GetMapping
(
value
=
"${r'${ibiz.file.downloadpath:"
+
defaultdownloadpath
+
"}'}"
)
@
ResponseStatus
(
HttpStatus
.
OK
)
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/security/AuthPermissionEvaluator.java.ftl
浏览文件 @
c0024bd4
此差异已折叠。
点击以展开。
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/security/AuthenticationUser.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -58,7 +58,7 @@ public class AuthenticationUser implements UserDetails
private
String
fontsize
;
private
String
lang
;
private
String
memo
;
private
Map
<
String
,
String
>
sessionParams
;
private
Map
<
String
,
Object
>
sessionParams
;
@
JsonIgnore
private
Collection
<
GrantedAuthority
>
authorities
;
@
JsonIgnore
...
...
@@ -68,7 +68,7 @@ public class AuthenticationUser implements UserDetails
private
String
orglevel
;//
单位级别
private
String
deptlevel
;//
部门级别
@
JsonIgnore
private
Map
<
String
,
String
>
userSessionParam
;//
用户自定义
session
值
private
Map
<
String
,
Object
>
userSessionParam
;//
用户自定义
session
值
@
JsonIgnore
private
JSONObject
orgInfo
;//
上下级组织信息
...
...
@@ -118,7 +118,7 @@ public class AuthenticationUser implements UserDetails
return
authuserdetail
;
}
public
Map
<
String
,
String
>
getSessionParams
()
public
Map
<
String
,
Object
>
getSessionParams
()
{
if
(
this
.
sessionParams
==
null
)
{
...
...
@@ -142,7 +142,7 @@ public class AuthenticationUser implements UserDetails
}
return
this
.
sessionParams
;
}
private
Map
<
String
,
String
>
getUserSessionParam
()
{
private
Map
<
String
,
Object
>
getUserSessionParam
()
{
if
(
userSessionParam
!=null)
return
userSessionParam
;
else
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/SimpleFileService.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -4,8 +4,9 @@ TARGET=PSSYSTEM
package
${
pub
.
getPKGCodeName
()}.
util
.
service
;
import
${
pub
.
getPKGCodeName
()}.
util
.
domain
.
FileItem
;
import
com
.
cmbchina
.
util
.
errors
.
InternalServerErrorException
;
import
${
pub
.
getPKGCodeName
()}
.
util
.
errors
.
InternalServerErrorException
;
import
lombok
.
extern
.
slf4j
.
Slf4j
;
import
org
.
springframework
.
util
.
DigestUtils
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Value
;
import
org
.
springframework
.
context
.
annotation
.
Primary
;
import
org
.
springframework
.
stereotype
.
Service
;
...
...
@@ -14,7 +15,6 @@ import org.springframework.web.multipart.MultipartFile;
import
java
.
io
.
File
;
import
java
.
io
.
IOException
;
import
java
.
nio
.
file
.
Files
;
import
java
.
util
.
UUID
;
@
Primary
@
Slf4j
...
...
@@ -24,26 +24,22 @@ public class SimpleFileService implements FileService {
@
Value
(
"${r'${ibiz.filePath:/app/file/}'}"
)
private
String
fileRoot
;
@
Override
public
FileItem
saveFile
(
MultipartFile
multipartFile
)
{
FileItem
item
=
null
;
//
获取文件名
String
fileName
=
multipartFile
.
getOriginalFilename
();
//
获取文件后缀
String
extname
=
"."
+
getExtensionName
(
fileName
);
//
用
uuid
作为文件名,防止生成的临时文件重复
String
fileid
=
UUID
.
randomUUID
().
toString
();
String
fileFullPath
=
this
.
fileRoot
+
"ibztuit"
+
File
.
separator
+
fileid
+
File
.
separator
+
fileName
;
File
file
=
new
File
(
fileFullPath
);
File
parent
=
new
File
(
file
.
getParent
());
if
(
!parent.exists())
parent
.
mkdirs
();
try
{
FileCopyUtils
.
copy
(
multipartFile
.
getInputStream
()
,
Files
.
newOutputStream
(
file
.
toPath
()));
item
=
new
FileItem
(
fileid
,
fileName
,
(
int
)
multipartFile
.
getSize
()
,
extname
);
String
fileid
=
DigestUtils
.
md5DigestAsHex
(
multipartFile
.
getInputStream
());
String
fileFullPath
=
this
.
fileRoot
+
"ibizutil"
+
File
.
separator
+
fileid
+
File
.
separator
+
fileName
;
File
file
=
new
File
(
fileFullPath
);
File
parent
=
new
File
(
file
.
getParent
());
if
(
!parent.exists())
parent
.
mkdirs
();
FileCopyUtils
.
copy
(
multipartFile
.
getInputStream
(),
Files
.
newOutputStream
(
file
.
toPath
()));
item
=
new
FileItem
(
fileid
,
fileName
,
fileid
,
fileName
,(
int
)
multipartFile
.
getSize
(),
extname
);
}
catch
(
IOException
e
)
{
throw
new
InternalServerErrorException
(
"文件上传失败"
);
}
...
...
@@ -52,7 +48,7 @@ public class SimpleFileService implements FileService {
@
Override
public
File
getFile
(
String
fileid
)
{
String
dirpath
=
this
.
fileRoot
+
"ib
ztuit
"
+
File
.
separator
+
fileid
;
String
dirpath
=
this
.
fileRoot
+
"ib
izutil
"
+
File
.
separator
+
fileid
;
File
parent
=
new
File
(
dirpath
);
if
(
parent
.
exists
()
&&
parent
.
isDirectory
()
&&
parent
.
listFiles
().
length
>
0
)
{
return
parent
.
listFiles
()[
0
];
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/SimpleUserService.java.ftl
浏览文件 @
c0024bd4
...
...
@@ -112,7 +112,10 @@ public class SimpleUserService implements AuthenticationUserService{
JSONObject
orgInfo
=
ouFeignClient
.
getOrgInfo
(
user
.
getLoginname
());
if
(
orgInfo
==
null
)
throw
new
RuntimeException
(
"获取用户信息失败,请检查用户中心[IBZOU]中是否存在当前用户!"
);
JSONObject
curUser
=
orgInfo
.
getJSONObject
(
"curuser"
);
user
.
setOrgInfo
(
orgInfo
);
user
.
setMdeptid
(
curUser
.
getString
(
"orgdept"
));
user
.
setOrgid
(
curUser
.
getString
(
"org"
));
}
}
...
...
SLN/%PUBPRJ%-util/src/main/resources/application-sys.yml.ftl
浏览文件 @
c0024bd4
...
...
@@ -78,3 +78,7 @@ logging:
ribbon:
ReadTimeout: 60000
ConnectTimeout: 60000
#系统是否开启权限验证
ibiz:
enablePermissionValid: false
SLN/config.xml.ftl
浏览文件 @
c0024bd4
...
...
@@ -2,7 +2,7 @@
TARGET=PSSYSTEM
</#ibiztemplate>
<#if pub.getPSDeployCenter()?? && sysrun.getRunMode()??>
<#if pub.getPSDeployCenter().get
DeployCenterType()?? && (pub.getPSDeployCenter().getDeployCenter
Type()=="JENKINS") >
<#if pub.getPSDeployCenter().get
CIType()?? && (pub.getPSDeployCenter().getCI
Type()=="JENKINS") >
<#if sysrun.getRunMode() == "STARTMSAPI">
<#assign depapi = sysrun.getPSDevSlnMSDepAPI()>
<#assign configId = depapi.getId()>
...
...
@@ -53,6 +53,7 @@ TARGET=PSSYSTEM
<hudson.tasks.Shell>
<command>
BUILD_ID=DONTKILLME
echo "${pub.getPSDeployCenter().getPSRegistryRepo().getConnStr()}"
source /etc/profile
rm -rf ${sys.codeName?lower_case}
git clone -b ${branch} $para2 ${sys.codeName?lower_case}/
...
...
@@ -60,10 +61,13 @@ TARGET=PSSYSTEM
cd ${sys.codeName?lower_case}/
<#if sysrun.getRunMode() == "STARTMSAPP">
mvn clean package -P${pub.getPSApplication().getPKGCodeName()?lower_case}
<#if pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="SWARM") >
cd ${pub.getCodeName()?lower_case}-app/${pub.getCodeName()?lower_case}-app-${pub.getPSApplication().getPKGCodeName()?lower_case}
mvn -P${pub.getPSApplication().getPKGCodeName()?lower_case} docker:build
mvn -P${pub.getPSApplication().getPKGCodeName()?lower_case} docker:push
docker -H tcp://172.16.102.110:2375 stack deploy --compose-file=src/main/docker/${pub.getCodeName()?lower_case}-app-${pub.getPSApplication().getPKGCodeName()?lower_case}.yaml dev --with-registry-auth
docker -H $para1 stack deploy --compose-file=src/main/docker/${pub.getCodeName()?lower_case}-app-${pub.getPSApplication().getPKGCodeName()?lower_case}.yaml dev --with-registry-auth
<#elseif pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="K8S") >
<#else>
echo 'echo "$para1"' > apppasswd.sh
chmod -R 777 *
setsid env SSH_ASKPASS='./apppasswd.sh' DISPLAY='none:0' ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} "mkdir -p ${depnode.getWorkshopPath()}/${configId}"
...
...
@@ -71,18 +75,23 @@ TARGET=PSSYSTEM
setsid env SSH_ASKPASS='./apppasswd.sh' DISPLAY='none:0' ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} "ps -ef | grep '${depnode.getWorkshopPath()}/${configId}'| tr -s ' '|cut -d' ' -f2,8,9 | grep -v grep | grep 'jar' | cut -d' ' -f1|xargs --no-run-if-empty kill -9"
setsid env SSH_ASKPASS='./apppasswd.sh' DISPLAY='none:0' ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} "source /etc/profile;source ~/.bash_profile; nohup java -jar -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=128m ${depnode.getWorkshopPath()}/${configId}/${pub.getCodeName()?lower_case}-app-${pub.getPSApplication().getPKGCodeName()?lower_case}.jar >>${depnode.getWorkshopPath()}/${configId}/${sys.codeName?lower_case}_${config?lower_case}-`date --date='0 days ago' +%Y-%m-%d`.log 2>&1 &"
</#if>
</#if>
<#if sysrun.getRunMode() == "STARTMSAPI">
mvn clean package -P${pub.getPSSysServiceAPI().getCodeName()?lower_case}
<#if pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="SWARM") >
cd ${pub.getCodeName()?lower_case}-provider/${pub.getCodeName()?lower_case}-provider-${pub.getPSSysServiceAPI().getCodeName()?lower_case}
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} docker:build
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} docker:push
docker -H tcp://172.16.102.110:2375 stack deploy --compose-file=src/main/docker/${pub.getCodeName()?lower_case}-provider-${pub.getPSSysServiceAPI().getCodeName()?lower_case}.yaml dev --with-registry-auth
docker -H $para1 stack deploy --compose-file=src/main/docker/${pub.getCodeName()?lower_case}-provider-${pub.getPSSysServiceAPI().getCodeName()?lower_case}.yaml dev --with-registry-auth
<#elseif pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="K8S") >
<#else>
echo 'echo "$para1"' > apppasswd.sh
chmod -R 777 *
setsid env SSH_ASKPASS='./apppasswd.sh' DISPLAY='none:0' ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} "mkdir -p ${depnode.getWorkshopPath()}/${configId}"
setsid env SSH_ASKPASS='./apppasswd.sh' DISPLAY='none:0' scp -r ${pub.getCodeName()?lower_case}-provider-${pub.getPSSysServiceAPI().getCodeName()?lower_case}.jar ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()}:${depnode.getWorkshopPath()}/${configId}
setsid env SSH_ASKPASS='./apppasswd.sh' DISPLAY='none:0' ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} "ps -ef | grep '${depnode.getWorkshopPath()}/${configId}'| tr -s ' '|cut -d' ' -f2,8,9 | grep -v grep | grep 'jar' | cut -d' ' -f1|xargs --no-run-if-empty kill -9"
setsid env SSH_ASKPASS='./apppasswd.sh' DISPLAY='none:0' ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} "source /etc/profile;source ~/.bash_profile; nohup java -jar -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=128m ${depnode.getWorkshopPath()}/${configId}/${pub.getCodeName()?lower_case}-provider-${pub.getPSSysServiceAPI().getCodeName()?lower_case}.jar >>${depnode.getWorkshopPath()}/${configId}/${sys.codeName?lower_case}_${config?lower_case}-`date --date='0 days ago' +%Y-%m-%d`.log 2>&1 &"
</#if>
</#if>
</command>
</hudson.tasks.Shell>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录