Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jz-dmp-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
jz-dmp-service
Commits
bc4fcb94
Commit
bc4fcb94
authored
Jan 25, 2021
by
sml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置相关代码及traceId及方法日志
parent
b51801a2
Changes
32
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
5157 additions
and
21 deletions
+5157
-21
MethodCallLogPrint.java
...ain/java/com/jz/common/annotation/MethodCallLogPrint.java
+19
-0
MethodCallLogPrintAspect.java
...n/java/com/jz/common/aspect/MethodCallLogPrintAspect.java
+76
-0
CommConstant.java
src/main/java/com/jz/common/constant/CommConstant.java
+11
-6
LogInterceptor.java
src/main/java/com/jz/common/interceptor/LogInterceptor.java
+44
-0
BaseService.java
src/main/java/com/jz/common/persistence/BaseService.java
+12
-7
CodeGeneratorUtils.java
src/main/java/com/jz/common/utils/CodeGeneratorUtils.java
+15
-0
WebAppConfig.java
src/main/java/com/jz/dmp/config/WebAppConfig.java
+27
-0
DmpSyncingDatasourceTypeController.java
...odules/controller/DmpSyncingDatasourceTypeController.java
+1
-1
DmpProjectConfigInfoController.java
...controller/projconfig/DmpProjectConfigInfoController.java
+98
-0
DmpPublicConfigInfoController.java
.../controller/projconfig/DmpPublicConfigInfoController.java
+79
-0
DmpComputEngineDto.java
...odules/controller/projconfig/bean/DmpComputEngineDto.java
+21
-0
DmpComputEngine.java
src/main/java/com/jz/dmp/modules/model/DmpComputEngine.java
+13
-0
DmpProject.java
src/main/java/com/jz/dmp/modules/model/DmpProject.java
+36
-1
DmpProjectConfigEngine.java
...java/com/jz/dmp/modules/model/DmpProjectConfigEngine.java
+13
-3
DmpProjectConfigInfo.java
...n/java/com/jz/dmp/modules/model/DmpProjectConfigInfo.java
+13
-0
DmpPublicConfigInfo.java
...in/java/com/jz/dmp/modules/model/DmpPublicConfigInfo.java
+13
-0
DmpProjectServiceImpl.java
...om/jz/dmp/modules/service/impl/DmpProjectServiceImpl.java
+7
-0
DmpComputEngineParamService.java
...dules/service/projconfig/DmpComputEngineParamService.java
+135
-0
DmpComputEngineService.java
...mp/modules/service/projconfig/DmpComputEngineService.java
+135
-0
DmpProjectConfigEngineService.java
...les/service/projconfig/DmpProjectConfigEngineService.java
+135
-0
DmpProjectConfigInfoService.java
...dules/service/projconfig/DmpProjectConfigInfoService.java
+147
-0
DmpProjectEngineParamService.java
...ules/service/projconfig/DmpProjectEngineParamService.java
+135
-0
DmpPublicConfigInfoService.java
...odules/service/projconfig/DmpPublicConfigInfoService.java
+135
-0
DmpComputEngineParamServiceImpl.java
...vice/projconfig/impl/DmpComputEngineParamServiceImpl.java
+575
-0
DmpComputEngineServiceImpl.java
...s/service/projconfig/impl/DmpComputEngineServiceImpl.java
+527
-0
DmpProjectConfigEngineServiceImpl.java
...ce/projconfig/impl/DmpProjectConfigEngineServiceImpl.java
+543
-0
DmpProjectConfigInfoServiceImpl.java
...vice/projconfig/impl/DmpProjectConfigInfoServiceImpl.java
+676
-0
DmpProjectEngineParamServiceImpl.java
...ice/projconfig/impl/DmpProjectEngineParamServiceImpl.java
+575
-0
DmpPublicConfigInfoServiceImpl.java
...rvice/projconfig/impl/DmpPublicConfigInfoServiceImpl.java
+906
-0
application-test.yml
src/main/resources/application-test.yml
+2
-2
logback-spring.xml
src/main/resources/logback-spring.xml
+1
-1
DmpComputEngineMapper.xml
...ain/resources/mapper/projconfig/DmpComputEngineMapper.xml
+32
-0
No files found.
src/main/java/com/jz/common/annotation/MethodCallLogPrint.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
common
.
annotation
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @ClassName: MethodCallLogPrint
* @Description: TODO(方法统一打印日志注解)
* @author ybz
* @date 2021年1月21日
*
*/
@Target
({
ElementType
.
METHOD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
MethodCallLogPrint
{
}
src/main/java/com/jz/common/aspect/MethodCallLogPrintAspect.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
common
.
aspect
;
import
java.lang.reflect.Method
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSONObject
;
/**方法日志打印
* @author ybz
*
*/
@Aspect
@Component
public
class
MethodCallLogPrintAspect
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
MethodCallLogPrintAspect
.
class
);
@Pointcut
(
"@annotation( com.jz.common.annotation.MethodCallLogPrint)"
)
public
void
methodCallLogPrintPointCut
(){
}
@Around
(
"methodCallLogPrintPointCut()"
)
public
Object
methodCallLogPrint
(
ProceedingJoinPoint
pjp
)
throws
Throwable
{
//从切面织入点处通过反射机制获取织入点处的方法
MethodSignature
signature
=
(
MethodSignature
)
pjp
.
getSignature
();
//获取切入点所在的方法
Method
method
=
signature
.
getMethod
();
//获取请求的类名
String
className
=
pjp
.
getTarget
().
getClass
().
getName
();
//获取请求的方法名
String
methodName
=
method
.
getName
();
logger
.
info
(
"**{}**{}**START****************************************"
,
className
,
methodName
);
Long
currentTime
=
System
.
currentTimeMillis
();
logger
.
info
(
"开始时间:{}"
,
currentTime
);
//请求的参数
String
[]
argNames
=
signature
.
getParameterNames
();
// 参数名
Object
[]
argObjs
=
pjp
.
getArgs
()
;
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
for
(
int
index
=
0
;
index
<
argNames
.
length
;
index
++)
{
String
argName
=
argNames
[
index
];
Object
argObj
=
argObjs
[
index
];
if
(
argObj
instanceof
HttpServletRequest
)
{
continue
;
}
paramMap
.
put
(
argName
,
argObj
);
}
logger
.
info
(
"请求参数:【{}】"
,
JSONObject
.
toJSONString
(
paramMap
));
Object
obj
=
pjp
.
proceed
();
Long
currentTime2
=
System
.
currentTimeMillis
();
logger
.
info
(
"调用结果:【{}】"
,
JSONObject
.
toJSONString
(
obj
));
logger
.
info
(
"方法调用结束"
);
logger
.
info
(
"当前时间:{},总耗时:{}"
,
currentTime2
,
currentTime2
-
currentTime
);
logger
.
info
(
"**END****************************************"
);
return
obj
;
}
}
\ No newline at end of file
src/main/java/com/jz/common/constant/CommConstant.java
View file @
bc4fcb94
...
...
@@ -11,17 +11,22 @@ public class CommConstant {
/***************************************************/
//tree类型
public
static
String
TREE_SYNCING_DATA
=
"1"
;
public
static
final
String
TREE_SYNCING_DATA
=
"1"
;
//开发任务
public
static
String
TREE_DEVELOP_TASK
=
"2"
;
public
static
final
String
TREE_DEVELOP_TASK
=
"2"
;
public
static
String
TREE_DEVELOP_WORKFLOW
=
"2W"
;
public
static
final
String
TREE_DEVELOP_WORKFLOW
=
"2W"
;
public
static
String
TREE_DEVELOP_SCRIPT
=
"3"
;
public
static
final
String
TREE_DEVELOP_SCRIPT
=
"3"
;
public
static
String
TREE_MANAGE_RESOURCE
=
"4"
;
public
static
final
String
TREE_MANAGE_RESOURCE
=
"4"
;
public
static
final
String
TREE_MANAGE_FUNCTION
=
"5"
;
/***************************************************/
//MDC
public
static
final
String
TRACE_ID
=
"traceId"
;
public
static
String
TREE_MANAGE_FUNCTION
=
"5"
;
/***************************************************/
}
src/main/java/com/jz/common/interceptor/LogInterceptor.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
common
.
interceptor
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.slf4j.MDC
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
org.springframework.web.servlet.ModelAndView
;
import
com.jz.common.constant.CommConstant
;
import
com.jz.common.utils.CodeGeneratorUtils
;
/**
* @ClassName: LogInterceptor
* @Description: TODO(日志MDC)
* @author ybz
* @date 2021年1月25日
*
*/
public
class
LogInterceptor
implements
HandlerInterceptor
{
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
//如果有上层调用就用上层的ID
String
traceId
=
request
.
getHeader
(
CommConstant
.
TRACE_ID
);
if
(
traceId
==
null
)
{
traceId
=
CodeGeneratorUtils
.
generatorTraceId
();
}
MDC
.
put
(
CommConstant
.
TRACE_ID
,
traceId
);
return
true
;
}
@Override
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
}
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
//调用结束后删除
MDC
.
remove
(
CommConstant
.
TRACE_ID
);
}
}
\ No newline at end of file
src/main/java/com/jz/common/persistence/BaseService.java
View file @
bc4fcb94
...
...
@@ -78,13 +78,18 @@ public class BaseService {
* @return
* @throws Exception
*/
public
Integer
getHttpRequestUserId
(
HttpServletRequest
httpRequest
)
throws
Exception
{
DmpMember
dmpMember
=
SessionUtils
.
getSecurityUser
();
public
Integer
getHttpRequestUserId
(
HttpServletRequest
httpRequest
){
DmpMember
dmpMember
=
null
;
try
{
dmpMember
=
SessionUtils
.
getSecurityUser
();
if
(
dmpMember
==
null
)
{
return
null
;
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"获取当前用户主键异常:【{}】"
,
e
);
}
return
dmpMember
.
getUserId
();
}
...
...
src/main/java/com/jz/common/utils/CodeGeneratorUtils.java
View file @
bc4fcb94
package
com
.
jz
.
common
.
utils
;
import
java.util.UUID
;
/**
* @ClassName: CodeGeneratorUtil
* @Description: TODO(按照规则生成编码工具类)
...
...
@@ -40,6 +42,19 @@ public class CodeGeneratorUtils {
return
"V"
+
number_1
+
"."
+
number_2
;
}
/**
* @Title: generatorTraceId
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @return
* @param @throws Exception 参数
* @return String 返回类型
* @throws
*/
public
static
String
generatorTraceId
()
throws
Exception
{
String
uuid
=
UUID
.
randomUUID
().
toString
();
return
uuid
.
replace
(
"-"
,
""
);
}
}
src/main/java/com/jz/dmp/config/WebAppConfig.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
config
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
com.jz.common.interceptor.LogInterceptor
;
/**
* @ClassName: WebAppConfig
* @Description: TODO(web mvc相关配置)
* @author ybz
* @date 2021年1月25日
*
*/
@Configuration
public
class
WebAppConfig
implements
WebMvcConfigurer
{
/**
*拦截器注册
*/
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
new
LogInterceptor
());
}
}
src/main/java/com/jz/dmp/modules/controller/DmpSyncingDatasourceTypeController.java
View file @
bc4fcb94
...
...
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping
(
"/dmpSyncingDatasourceType"
)
//
@Api(tags = "数据源类型")
@Api
(
tags
=
"数据源类型"
)
public
class
DmpSyncingDatasourceTypeController
{
/**
* 服务对象
...
...
src/main/java/com/jz/dmp/modules/controller/projconfig/DmpProjectConfigInfoController.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
controller
.
projconfig
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.jz.common.annotation.MethodCallLogPrint
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoRequest
;
import
com.jz.dmp.modules.model.DmpProjectConfigInfo
;
import
com.jz.dmp.modules.service.projconfig.DmpProjectConfigInfoService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
/**
* 项目配置表Controller
* @author ybz
*
*/
@RestController
@RequestMapping
(
"/dmp/project/config/info"
)
@Api
(
tags
=
"项目配置表"
)
public
class
DmpProjectConfigInfoController
{
@Autowired
private
DmpProjectConfigInfoService
dmpProjectConfigInfoService
;
/**列表查询项目配置表
* @param dmpProjectConfigInfoRequest
* @return
*/
//@MethodCallLogPrint
//@RequestMapping(method = RequestMethod.POST, value = "/findList")
//@ApiOperation(value = "列表查询项目配置表", notes = "列表查询项目配置表")
public
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
findList
(
@RequestBody
DmpProjectConfigInfoRequest
dmpProjectConfigInfoRequest
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpProjectConfigInfoDto
>();
try
{
baseBeanResponse
=
dmpProjectConfigInfoService
.
findList
(
dmpProjectConfigInfoRequest
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"查询失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
/**获取项目配置信息
* @param dmpProjectConfigInfoRequest
* @return
*/
@MethodCallLogPrint
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/view"
)
@ApiOperation
(
value
=
"获取项目配置信息"
,
notes
=
"获取项目配置信息"
)
@ApiImplicitParam
(
name
=
"projectId"
,
value
=
"项目主键"
)
public
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
view
(
@RequestParam
(
name
=
"projectId"
,
required
=
true
)
Integer
projectId
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpProjectConfigInfoDto
>();
try
{
baseBeanResponse
=
dmpProjectConfigInfoService
.
findByProjectId
(
projectId
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"请求失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
/**新增或修改项目配置表
* @param dmpProjectConfigInfoRequest
* @return
*/
@MethodCallLogPrint
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/addOrEdit"
)
@ApiOperation
(
value
=
"新增或修改项目配置表"
,
notes
=
"新增或修改项目配置表"
)
public
BaseBeanResponse
<
DmpProjectConfigInfo
>
addOrEdit
(
@RequestBody
DmpProjectConfigInfo
dmpProjectConfigInfo
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpProjectConfigInfo
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpProjectConfigInfo
>();
try
{
baseBeanResponse
=
dmpProjectConfigInfoService
.
addOrEdit
(
dmpProjectConfigInfo
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"新增或修改失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
}
src/main/java/com/jz/dmp/modules/controller/projconfig/DmpPublicConfigInfoController.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
controller
.
projconfig
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.jz.common.annotation.MethodCallLogPrint
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineRequest
;
import
com.jz.dmp.modules.model.DmpPublicConfigInfo
;
import
com.jz.dmp.modules.service.projconfig.DmpComputEngineService
;
import
com.jz.dmp.modules.service.projconfig.DmpPublicConfigInfoService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/**
* 公共配置表Controller
* @author ybz
*
*/
@RestController
@RequestMapping
(
"/dmp/public/config/info"
)
@Api
(
tags
=
"公共配置表"
)
public
class
DmpPublicConfigInfoController
{
@Autowired
private
DmpPublicConfigInfoService
dmpPublicConfigInfoService
;
@Autowired
private
DmpComputEngineService
dmpComputEngineService
;
/**列表查询计算引擎表
* @param dmpComputEngineRequest
* @return
*/
@MethodCallLogPrint
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/findList"
)
@ApiOperation
(
value
=
"列表查询计算引擎表"
,
notes
=
"列表查询计算引擎表"
)
public
BaseBeanResponse
<
DmpComputEngineDto
>
findList
(
@RequestBody
DmpComputEngineRequest
dmpComputEngineRequest
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpComputEngineDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpComputEngineDto
>();
try
{
baseBeanResponse
=
dmpComputEngineService
.
findList
(
dmpComputEngineRequest
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"查询失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
/**新增或修改公共配置表
* @param dmpPublicConfigInfoRequest
* @return
*/
@MethodCallLogPrint
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/addOrEdit"
)
@ApiOperation
(
value
=
"新增或修改公共配置表"
,
notes
=
"新增或修改公共配置表"
)
public
BaseBeanResponse
<
DmpPublicConfigInfo
>
addOrEdit
(
@RequestBody
DmpPublicConfigInfo
dmpPublicConfigInfo
,
HttpServletRequest
httpRequest
){
BaseBeanResponse
<
DmpPublicConfigInfo
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpPublicConfigInfo
>();
try
{
baseBeanResponse
=
dmpPublicConfigInfoService
.
addOrEdit
(
dmpPublicConfigInfo
,
httpRequest
);
}
catch
(
Exception
e
)
{
baseBeanResponse
.
setMessage
(
"新增或修改失败"
);
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
e
.
printStackTrace
();
}
return
baseBeanResponse
;
}
}
src/main/java/com/jz/dmp/modules/controller/projconfig/bean/DmpComputEngineDto.java
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
controller
.
projconfig
.
bean
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.jz.dmp.modules.model.DmpComputEngine
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**计算引擎表Dto
* @author ybz
*
*/
@ApiModel
(
value
=
"计算引擎表Dto"
,
description
=
"计算引擎表Dto"
)
@JsonIgnoreProperties
(
value
=
{
"handler"
})
public
class
DmpComputEngineDto
extends
DmpComputEngine
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"计算引擎参数列表"
)
private
List
<
DmpComputEngineParamDto
>
paramDtos
;
public
List
<
DmpComputEngineParamDto
>
getParamDtos
()
{
return
paramDtos
;
}
public
void
setParamDtos
(
List
<
DmpComputEngineParamDto
>
paramDtos
)
{
this
.
paramDtos
=
paramDtos
;
}
}
src/main/java/com/jz/dmp/modules/model/DmpComputEngine.java
View file @
bc4fcb94
...
...
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
import
java.util.List
;
/**计算引擎表
* @author ybz
...
...
@@ -70,6 +71,9 @@ public class DmpComputEngine implements Serializable{
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"计算引擎参数"
)
private
List
<
DmpComputEngineParam
>
params
;
public
Integer
getEngineId
()
{
return
engineId
;
}
...
...
@@ -133,4 +137,13 @@ public class DmpComputEngine implements Serializable{
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
List
<
DmpComputEngineParam
>
getParams
()
{
return
params
;
}
public
void
setParams
(
List
<
DmpComputEngineParam
>
params
)
{
this
.
params
=
params
;
}
}
src/main/java/com/jz/dmp/modules/model/DmpProject.java
View file @
bc4fcb94
...
...
@@ -2,8 +2,8 @@ package com.jz.dmp.modules.model;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* 项目信息(DmpProject)实体类
...
...
@@ -16,98 +16,125 @@ public class DmpProject implements Serializable {
/**
* ID
*/
@ApiModelProperty
(
value
=
"ID"
)
private
Integer
id
;
/**
* 管理员帐号
*/
@ApiModelProperty
(
value
=
"管理员帐号"
)
private
String
ownerId
;
/**
* 生产帐号
*/
@ApiModelProperty
(
value
=
"生产帐号"
)
private
String
productionId
;
/**
* 数据仓库帐号
*/
@ApiModelProperty
(
value
=
"数据仓库帐号"
)
private
String
dataWarehouseId
;
/**
* 项目名称
*/
@ApiModelProperty
(
value
=
"项目名称"
)
private
String
name
;
/**
* 项目显示名称
*/
@ApiModelProperty
(
value
=
"项目显示名称"
)
private
String
displayName
;
/**
* 项目描述
*/
@ApiModelProperty
(
value
=
"项目描述"
)
private
String
projectDesc
;
/**
* 发布目标
*/
@ApiModelProperty
(
value
=
"发布目标"
)
private
Integer
publishTargetId
;
/**
* 启动调度周期
*/
@ApiModelProperty
(
value
=
"启动调度周期"
)
private
String
isEnableScheduler
;
/**
* 允许在本项目中直接编辑任务和代码
*/
@ApiModelProperty
(
value
=
"允许在本项目中直接编辑任务和代码"
)
private
String
isEditTaskCode
;
/**
* 能否下载select结果
*/
@ApiModelProperty
(
value
=
"能否下载select结果"
)
private
String
isEnableSelect
;
/**
* 数据仓库项目名称
*/
@ApiModelProperty
(
value
=
"数据仓库项目名称"
)
private
String
dwName
;
/**
* 数据仓库访问身份类型
*/
@ApiModelProperty
(
value
=
"数据仓库访问身份类型"
)
private
String
dwAccessType
;
/**
* 使用ACL授权
*/
@ApiModelProperty
(
value
=
"使用ACL授权"
)
private
String
dwIsEnableAcl
;
/**
* 允许对象创建者访问对象
*/
@ApiModelProperty
(
value
=
"允许对象创建者访问对象"
)
private
String
dwIsEnableAccessObj
;
/**
* 允许对象创建者授权对象
*/
@ApiModelProperty
(
value
=
"允许对象创建者授权对象"
)
private
String
dwIsEnableAuthObj
;
/**
* 项目空间数据保护
*/
@ApiModelProperty
(
value
=
"项目空间数据保护"
)
private
String
dwIsProtectData
;
/**
* 数据状态
*/
@ApiModelProperty
(
value
=
"数据状态"
)
private
String
dataStatus
;
/**
* 创建用户ID
*/
@ApiModelProperty
(
value
=
"创建用户ID"
)
private
String
createUserId
;
/**
* 数据创建时间
*/
@ApiModelProperty
(
value
=
"数据创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/**
* 创建用户ID
*/
@ApiModelProperty
(
value
=
" 创建用户ID"
)
private
String
updateUserId
;
@ApiModelProperty
(
value
=
""
)
private
String
impalaJdbcUrl
;
@ApiModelProperty
(
value
=
""
)
private
String
impalaMasterFqdn
;
/**
* 数据更新时间
*/
@ApiModelProperty
(
value
=
"数据更新时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"项目配置文件"
)
private
DmpProjectConfigInfo
dmpProjectConfigInfo
;
public
Integer
getId
()
{
return
id
;
...
...
@@ -301,4 +328,12 @@ public class DmpProject implements Serializable {
this
.
updateTime
=
updateTime
;
}
public
DmpProjectConfigInfo
getDmpProjectConfigInfo
()
{
return
dmpProjectConfigInfo
;
}
public
void
setDmpProjectConfigInfo
(
DmpProjectConfigInfo
dmpProjectConfigInfo
)
{
this
.
dmpProjectConfigInfo
=
dmpProjectConfigInfo
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/model/DmpProjectConfigEngine.java
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
model
;
import
java.io.Serializable
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
import
java.util.List
;
/**项目配置计算引擎关系表
* @author ybz
...
...
@@ -78,6 +76,9 @@ public class DmpProjectConfigEngine implements Serializable{
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"选择引擎私有配置参数"
)
private
List
<
DmpProjectEngineParam
>
dmpProjectEngineParams
;
public
Integer
getConfigEngineId
()
{
return
configEngineId
;
}
...
...
@@ -149,4 +150,13 @@ public class DmpProjectConfigEngine implements Serializable{
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
List
<
DmpProjectEngineParam
>
getDmpProjectEngineParams
()
{
return
dmpProjectEngineParams
;
}
public
void
setDmpProjectEngineParams
(
List
<
DmpProjectEngineParam
>
dmpProjectEngineParams
)
{
this
.
dmpProjectEngineParams
=
dmpProjectEngineParams
;
}
}
src/main/java/com/jz/dmp/modules/model/DmpProjectConfigInfo.java
View file @
bc4fcb94
...
...
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
import
java.util.List
;
/**项目配置表
* @author ybz
...
...
@@ -69,6 +70,9 @@ public class DmpProjectConfigInfo implements Serializable{
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"选择的计算引擎"
)
private
List
<
DmpProjectConfigEngine
>
dmpProjectConfigEngines
;
public
Integer
getProjectConfigId
()
{
return
projectConfigId
;
}
...
...
@@ -132,4 +136,13 @@ public class DmpProjectConfigInfo implements Serializable{
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
List
<
DmpProjectConfigEngine
>
getDmpProjectConfigEngines
()
{
return
dmpProjectConfigEngines
;
}
public
void
setDmpProjectConfigEngines
(
List
<
DmpProjectConfigEngine
>
dmpProjectConfigEngines
)
{
this
.
dmpProjectConfigEngines
=
dmpProjectConfigEngines
;
}
}
src/main/java/com/jz/dmp/modules/model/DmpPublicConfigInfo.java
View file @
bc4fcb94
...
...
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
import
java.util.List
;
/**公共配置表
* @author ybz
...
...
@@ -201,6 +202,9 @@ public class DmpPublicConfigInfo implements Serializable{
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"计算引擎"
)
private
List
<
DmpComputEngine
>
computEngines
;
public
Integer
getPublicConfigId
()
{
return
publicConfigId
;
}
...
...
@@ -440,4 +444,13 @@ public class DmpPublicConfigInfo implements Serializable{
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
List
<
DmpComputEngine
>
getComputEngines
()
{
return
computEngines
;
}
public
void
setComputEngines
(
List
<
DmpComputEngine
>
computEngines
)
{
this
.
computEngines
=
computEngines
;
}
}
src/main/java/com/jz/dmp/modules/service/impl/DmpProjectServiceImpl.java
View file @
bc4fcb94
...
...
@@ -32,6 +32,7 @@ import com.jz.dmp.modules.model.DmpMember;
import
com.jz.dmp.modules.model.DmpProject
;
import
com.jz.dmp.modules.model.DmpProjectSystemInfo
;
import
com.jz.dmp.modules.service.DmpProjectService
;
import
com.jz.dmp.modules.service.projconfig.DmpProjectConfigInfoService
;
/**
* 项目信息服务的实现?
...
...
@@ -49,6 +50,9 @@ public class DmpProjectServiceImpl extends BaseService implements DmpProjectServ
@Autowired
private
ProjectFlowsMapper
projectFlowsMapper
;
@Autowired
private
DmpProjectConfigInfoService
dmpProjectConfigInfoService
;
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DmpProjectService#findList(com.ycxc.vmts.controller.bean.DmpProjectRequest, javax.servlet.http.HttpServletRequest)
*/
...
...
@@ -340,6 +344,9 @@ public class DmpProjectServiceImpl extends BaseService implements DmpProjectServ
dmpProjectDao
.
insert
(
dmpProject
);
//保存项目配置信息
dmpProjectConfigInfoService
.
addOrEdit
(
dmpProject
.
getDmpProjectConfigInfo
(),
httpRequest
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpProject
);
...
...
src/main/java/com/jz/dmp/modules/service/projconfig/DmpComputEngineParamService.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineParamBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineParamDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineParamRequest
;
import
com.jz.dmp.modules.model.DmpComputEngineParam
;
/**
* 计算引擎参数表服务接口
* @author ybz
*
*/
public
interface
DmpComputEngineParamService
{
/**条件分頁查询所有计算引擎参数表
* @param dmpComputEngineParamRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
PageInfoResponse
<
DmpComputEngineParamDto
>
findListWithPage
(
DmpComputEngineParamRequest
dmpComputEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件查询所有计算引擎参数表
* @param dmpComputEngineParamRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngineParamDto
>
findList
(
DmpComputEngineParamRequest
dmpComputEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增计算引擎参数表
* @param dmpComputEngineParam
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngineParam
>
add
(
DmpComputEngineParam
dmpComputEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键查询计算引擎参数表
* @param paramId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngineParamDto
>
findById
(
Integer
paramId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**修改计算引擎参数表
* @param dmpComputEngineParam
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngineParam
>
edit
(
DmpComputEngineParam
dmpComputEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增或修改计算引擎参数表
* @param dmpComputEngineParam
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngineParam
>
addOrEdit
(
DmpComputEngineParam
dmpComputEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键删除计算引擎参数表
* @param paramId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
deleteById
(
Integer
paramId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键软删除计算引擎参数表
* @param paramId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDeleteById
(
Integer
paramId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件删除计算引擎参数表
* @param dmpComputEngineParamRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
delete
(
DmpComputEngineParamRequest
dmpComputEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件软删除计算引擎参数表
* @param dmpComputEngineParamRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDelete
(
DmpComputEngineParamRequest
dmpComputEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**批量新增计算引擎参数表
* @param dmpComputEngineParamVo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngineParamBatch
>
addBatch
(
DmpComputEngineParamBatch
dmpComputEngineParamBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: deleteByIds
* @Description: TODO(根据主键批量删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: softDeleteByIds
* @Description: TODO(根据主键批量软删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/service/projconfig/DmpComputEngineService.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineRequest
;
import
com.jz.dmp.modules.model.DmpComputEngine
;
/**
* 计算引擎表服务接口
* @author ybz
*
*/
public
interface
DmpComputEngineService
{
/**条件分頁查询所有计算引擎表
* @param dmpComputEngineRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
PageInfoResponse
<
DmpComputEngineDto
>
findListWithPage
(
DmpComputEngineRequest
dmpComputEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件查询所有计算引擎表
* @param dmpComputEngineRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngineDto
>
findList
(
DmpComputEngineRequest
dmpComputEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增计算引擎表
* @param dmpComputEngine
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngine
>
add
(
DmpComputEngine
dmpComputEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键查询计算引擎表
* @param engineId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngineDto
>
findById
(
Integer
engineId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**修改计算引擎表
* @param dmpComputEngine
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngine
>
edit
(
DmpComputEngine
dmpComputEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增或修改计算引擎表
* @param dmpComputEngine
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngine
>
addOrEdit
(
DmpComputEngine
dmpComputEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键删除计算引擎表
* @param engineId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
deleteById
(
Integer
engineId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键软删除计算引擎表
* @param engineId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDeleteById
(
Integer
engineId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件删除计算引擎表
* @param dmpComputEngineRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
delete
(
DmpComputEngineRequest
dmpComputEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件软删除计算引擎表
* @param dmpComputEngineRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDelete
(
DmpComputEngineRequest
dmpComputEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**批量新增计算引擎表
* @param dmpComputEngineVo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpComputEngineBatch
>
addBatch
(
DmpComputEngineBatch
dmpComputEngineBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: deleteByIds
* @Description: TODO(根据主键批量删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: softDeleteByIds
* @Description: TODO(根据主键批量软删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/service/projconfig/DmpProjectConfigEngineService.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineRequest
;
import
com.jz.dmp.modules.model.DmpProjectConfigEngine
;
/**
* 项目配置计算引擎关系表服务接口
* @author ybz
*
*/
public
interface
DmpProjectConfigEngineService
{
/**条件分頁查询所有项目配置计算引擎关系表
* @param dmpProjectConfigEngineRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
PageInfoResponse
<
DmpProjectConfigEngineDto
>
findListWithPage
(
DmpProjectConfigEngineRequest
dmpProjectConfigEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件查询所有项目配置计算引擎关系表
* @param dmpProjectConfigEngineRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigEngineDto
>
findList
(
DmpProjectConfigEngineRequest
dmpProjectConfigEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增项目配置计算引擎关系表
* @param dmpProjectConfigEngine
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigEngine
>
add
(
DmpProjectConfigEngine
dmpProjectConfigEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键查询项目配置计算引擎关系表
* @param configEngineId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigEngineDto
>
findById
(
Integer
configEngineId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**修改项目配置计算引擎关系表
* @param dmpProjectConfigEngine
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigEngine
>
edit
(
DmpProjectConfigEngine
dmpProjectConfigEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增或修改项目配置计算引擎关系表
* @param dmpProjectConfigEngine
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigEngine
>
addOrEdit
(
DmpProjectConfigEngine
dmpProjectConfigEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键删除项目配置计算引擎关系表
* @param configEngineId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
deleteById
(
Integer
configEngineId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键软删除项目配置计算引擎关系表
* @param configEngineId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDeleteById
(
Integer
configEngineId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件删除项目配置计算引擎关系表
* @param dmpProjectConfigEngineRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
delete
(
DmpProjectConfigEngineRequest
dmpProjectConfigEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件软删除项目配置计算引擎关系表
* @param dmpProjectConfigEngineRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDelete
(
DmpProjectConfigEngineRequest
dmpProjectConfigEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**批量新增项目配置计算引擎关系表
* @param dmpProjectConfigEngineVo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigEngineBatch
>
addBatch
(
DmpProjectConfigEngineBatch
dmpProjectConfigEngineBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: deleteByIds
* @Description: TODO(根据主键批量删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: softDeleteByIds
* @Description: TODO(根据主键批量软删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/service/projconfig/DmpProjectConfigInfoService.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoRequest
;
import
com.jz.dmp.modules.model.DmpProjectConfigInfo
;
/**
* 项目配置表服务接口
* @author ybz
*
*/
public
interface
DmpProjectConfigInfoService
{
/**条件分頁查询所有项目配置表
* @param dmpProjectConfigInfoRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
PageInfoResponse
<
DmpProjectConfigInfoDto
>
findListWithPage
(
DmpProjectConfigInfoRequest
dmpProjectConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件查询所有项目配置表
* @param dmpProjectConfigInfoRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
findList
(
DmpProjectConfigInfoRequest
dmpProjectConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增项目配置表
* @param dmpProjectConfigInfo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigInfo
>
add
(
DmpProjectConfigInfo
dmpProjectConfigInfo
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键查询项目配置表
* @param projectConfigId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
findById
(
Integer
projectConfigId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**修改项目配置表
* @param dmpProjectConfigInfo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigInfo
>
edit
(
DmpProjectConfigInfo
dmpProjectConfigInfo
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增或修改项目配置表
* @param dmpProjectConfigInfo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigInfo
>
addOrEdit
(
DmpProjectConfigInfo
dmpProjectConfigInfo
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键删除项目配置表
* @param projectConfigId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
deleteById
(
Integer
projectConfigId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键软删除项目配置表
* @param projectConfigId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDeleteById
(
Integer
projectConfigId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件删除项目配置表
* @param dmpProjectConfigInfoRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
delete
(
DmpProjectConfigInfoRequest
dmpProjectConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件软删除项目配置表
* @param dmpProjectConfigInfoRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDelete
(
DmpProjectConfigInfoRequest
dmpProjectConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**批量新增项目配置表
* @param dmpProjectConfigInfoVo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectConfigInfoBatch
>
addBatch
(
DmpProjectConfigInfoBatch
dmpProjectConfigInfoBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: deleteByIds
* @Description: TODO(根据主键批量删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: softDeleteByIds
* @Description: TODO(根据主键批量软删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: findByProjectId
* @Description: TODO(获取项目配置信息)
* @param @param projectId
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseBeanResponse<DmpProjectConfigInfoDto> 返回类型
* @throws
*/
public
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
findByProjectId
(
Integer
projectId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/service/projconfig/DmpProjectEngineParamService.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectEngineParamBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectEngineParamDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectEngineParamRequest
;
import
com.jz.dmp.modules.model.DmpProjectEngineParam
;
/**
* 计算引擎项目参数表服务接口
* @author ybz
*
*/
public
interface
DmpProjectEngineParamService
{
/**条件分頁查询所有计算引擎项目参数表
* @param dmpProjectEngineParamRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
PageInfoResponse
<
DmpProjectEngineParamDto
>
findListWithPage
(
DmpProjectEngineParamRequest
dmpProjectEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件查询所有计算引擎项目参数表
* @param dmpProjectEngineParamRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectEngineParamDto
>
findList
(
DmpProjectEngineParamRequest
dmpProjectEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增计算引擎项目参数表
* @param dmpProjectEngineParam
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectEngineParam
>
add
(
DmpProjectEngineParam
dmpProjectEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键查询计算引擎项目参数表
* @param projectParamId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectEngineParamDto
>
findById
(
Integer
projectParamId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**修改计算引擎项目参数表
* @param dmpProjectEngineParam
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectEngineParam
>
edit
(
DmpProjectEngineParam
dmpProjectEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增或修改计算引擎项目参数表
* @param dmpProjectEngineParam
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectEngineParam
>
addOrEdit
(
DmpProjectEngineParam
dmpProjectEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键删除计算引擎项目参数表
* @param projectParamId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
deleteById
(
Integer
projectParamId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键软删除计算引擎项目参数表
* @param projectParamId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDeleteById
(
Integer
projectParamId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件删除计算引擎项目参数表
* @param dmpProjectEngineParamRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
delete
(
DmpProjectEngineParamRequest
dmpProjectEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件软删除计算引擎项目参数表
* @param dmpProjectEngineParamRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDelete
(
DmpProjectEngineParamRequest
dmpProjectEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**批量新增计算引擎项目参数表
* @param dmpProjectEngineParamVo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpProjectEngineParamBatch
>
addBatch
(
DmpProjectEngineParamBatch
dmpProjectEngineParamBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: deleteByIds
* @Description: TODO(根据主键批量删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: softDeleteByIds
* @Description: TODO(根据主键批量软删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/service/projconfig/DmpPublicConfigInfoService.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoRequest
;
import
com.jz.dmp.modules.model.DmpPublicConfigInfo
;
/**
* 公共配置表服务接口
* @author ybz
*
*/
public
interface
DmpPublicConfigInfoService
{
/**条件分頁查询所有公共配置表
* @param dmpPublicConfigInfoRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
PageInfoResponse
<
DmpPublicConfigInfoDto
>
findListWithPage
(
DmpPublicConfigInfoRequest
dmpPublicConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件查询所有公共配置表
* @param dmpPublicConfigInfoRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpPublicConfigInfoDto
>
findList
(
DmpPublicConfigInfoRequest
dmpPublicConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增公共配置表
* @param dmpPublicConfigInfo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpPublicConfigInfo
>
add
(
DmpPublicConfigInfo
dmpPublicConfigInfo
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键查询公共配置表
* @param publicConfigId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpPublicConfigInfoDto
>
findById
(
Integer
publicConfigId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**修改公共配置表
* @param dmpPublicConfigInfo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpPublicConfigInfo
>
edit
(
DmpPublicConfigInfo
dmpPublicConfigInfo
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**新增或修改公共配置表
* @param dmpPublicConfigInfo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpPublicConfigInfo
>
addOrEdit
(
DmpPublicConfigInfo
dmpPublicConfigInfo
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键删除公共配置表
* @param publicConfigId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
deleteById
(
Integer
publicConfigId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**主键软删除公共配置表
* @param publicConfigId
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDeleteById
(
Integer
publicConfigId
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件删除公共配置表
* @param dmpPublicConfigInfoRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
delete
(
DmpPublicConfigInfoRequest
dmpPublicConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**条件软删除公共配置表
* @param dmpPublicConfigInfoRequest
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseResponse
softDelete
(
DmpPublicConfigInfoRequest
dmpPublicConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**批量新增公共配置表
* @param dmpPublicConfigInfoVo
* @param httpRequest
* @return
* @throws Exception
*/
public
BaseBeanResponse
<
DmpPublicConfigInfoBatch
>
addBatch
(
DmpPublicConfigInfoBatch
dmpPublicConfigInfoBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: deleteByIds
* @Description: TODO(根据主键批量删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
/**
* @Title: softDeleteByIds
* @Description: TODO(根据主键批量软删除)
* @param @param idList
* @param @param httpRequest
* @param @return
* @param @throws Exception 参数
* @return BaseResponse 返回类型
* @throws
*/
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
;
}
src/main/java/com/jz/dmp/modules/service/projconfig/impl/DmpComputEngineParamServiceImpl.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
.
impl
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.common.persistence.BaseService
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineParamBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineParamDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineParamRequest
;
import
com.jz.dmp.modules.dao.projconfig.DmpComputEngineParamMapper
;
import
com.jz.dmp.modules.model.DmpComputEngineParam
;
import
com.jz.dmp.modules.service.projconfig.DmpComputEngineParamService
;
/**
* 计算引擎参数表服务的实现?
*
* @author ybz
*
*/
@Service
(
"dmpComputEngineParamService"
)
public
class
DmpComputEngineParamServiceImpl
extends
BaseService
implements
DmpComputEngineParamService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DmpComputEngineParamServiceImpl
.
class
);
@Autowired
private
DmpComputEngineParamMapper
dmpComputEngineParamMapper
;
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
PageInfoResponse
<
DmpComputEngineParamDto
>
findListWithPage
(
DmpComputEngineParamRequest
dmpComputEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
PageInfoResponse
<
DmpComputEngineParamDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpComputEngineParamRequest
.
getParamId
()
!=
null
)
{
param
.
put
(
"paramId"
,
dmpComputEngineParamRequest
.
getParamId
());
}
//引擎主键
if
(
dmpComputEngineParamRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpComputEngineParamRequest
.
getEngineId
());
}
//参数名称
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamName
()))
{
param
.
put
(
"paramName"
,
dmpComputEngineParamRequest
.
getParamName
());
}
//类型(0:引擎公共参数,1:引擎私配置参数)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamType
()))
{
param
.
put
(
"paramType"
,
dmpComputEngineParamRequest
.
getParamType
());
}
//参数值
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamValue
()))
{
param
.
put
(
"paramValue"
,
dmpComputEngineParamRequest
.
getParamValue
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpComputEngineParamRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpComputEngineParamRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpComputEngineParamRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpComputEngineParamRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpComputEngineParamRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpComputEngineParamRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpComputEngineParamRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpComputEngineParamRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpComputEngineParamRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpComputEngineParamRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpComputEngineParamRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpComputEngineParamRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpComputEngineParamRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpComputEngineParamRequest
.
getUpdateTimeEnd
());
}
PageHelper
.
startPage
(
dmpComputEngineParamRequest
.
getPageNum
(),
dmpComputEngineParamRequest
.
getPageSize
());
List
<
DmpComputEngineParamDto
>
list
=
dmpComputEngineParamMapper
.
findList
(
param
);
PageInfo
<
DmpComputEngineParamDto
>
pageInfo
=
new
PageInfo
<>(
list
);
pageInfoResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
pageInfoResponse
.
setMessage
(
"查询成功"
);
pageInfoResponse
.
setData
(
pageInfo
);
return
pageInfoResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpComputEngineParamDto
>
findList
(
DmpComputEngineParamRequest
dmpComputEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngineParamDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpComputEngineParamRequest
.
getParamId
()
!=
null
)
{
param
.
put
(
"paramId"
,
dmpComputEngineParamRequest
.
getParamId
());
}
//引擎主键
if
(
dmpComputEngineParamRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpComputEngineParamRequest
.
getEngineId
());
}
//参数名称
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamName
()))
{
param
.
put
(
"paramName"
,
dmpComputEngineParamRequest
.
getParamName
());
}
//类型(0:引擎公共参数,1:引擎私配置参数)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamType
()))
{
param
.
put
(
"paramType"
,
dmpComputEngineParamRequest
.
getParamType
());
}
//参数值
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamValue
()))
{
param
.
put
(
"paramValue"
,
dmpComputEngineParamRequest
.
getParamValue
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpComputEngineParamRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpComputEngineParamRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpComputEngineParamRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpComputEngineParamRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpComputEngineParamRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpComputEngineParamRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpComputEngineParamRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpComputEngineParamRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpComputEngineParamRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpComputEngineParamRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpComputEngineParamRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpComputEngineParamRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpComputEngineParamRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpComputEngineParamRequest
.
getUpdateTimeEnd
());
}
List
<
DmpComputEngineParamDto
>
list
=
dmpComputEngineParamMapper
.
findList
(
param
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setDatas
(
list
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#add(com.ycxc.vmts.entity.DmpComputEngineParam,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpComputEngineParam
>
add
(
DmpComputEngineParam
dmpComputEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngineParam
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
/*$*setParamIdCodeReplace*$*/
// 创建人
dmpComputEngineParam
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpComputEngineParam
.
setCreateTime
(
new
Date
());
dmpComputEngineParamMapper
.
insertSelective
(
dmpComputEngineParam
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpComputEngineParam
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#edit(com.ycxc.vmts.entity.DmpComputEngineParam,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpComputEngineParam
>
edit
(
DmpComputEngineParam
dmpComputEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngineParam
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
// 修改人
dmpComputEngineParam
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpComputEngineParam
.
setUpdateTime
(
new
Date
());
dmpComputEngineParamMapper
.
updateByPrimaryKeySelective
(
dmpComputEngineParam
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpComputEngineParam
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#addOrEdit(com.ycxc.vmts.entity.DmpComputEngineParam,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpComputEngineParam
>
addOrEdit
(
DmpComputEngineParam
dmpComputEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngineParam
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Integer
paramId
=
dmpComputEngineParam
.
getParamId
();
if
(
null
==
paramId
)
{
//新增
// 创建人
dmpComputEngineParam
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpComputEngineParam
.
setCreateTime
(
new
Date
());
dmpComputEngineParamMapper
.
insertSelective
(
dmpComputEngineParam
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpComputEngineParam
);
}
else
{
//修改
// 修改人
dmpComputEngineParam
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpComputEngineParam
.
setUpdateTime
(
new
Date
());
dmpComputEngineParamMapper
.
updateByPrimaryKeySelective
(
dmpComputEngineParam
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpComputEngineParam
);
}
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#findById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpComputEngineParamDto
>
findById
(
Integer
paramId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngineParamDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
DmpComputEngineParamDto
dmpComputEngineParamDto
=
dmpComputEngineParamMapper
.
findById
(
paramId
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setData
(
dmpComputEngineParamDto
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteById
(
Integer
paramId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpComputEngineParamMapper
.
deleteByPrimaryKey
(
paramId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteById
(
Integer
paramId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpComputEngineParamMapper
.
softDeleteByPrimaryKey
(
paramId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
delete
(
DmpComputEngineParamRequest
dmpComputEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpComputEngineParamRequest
.
getParamId
()
!=
null
)
{
param
.
put
(
"paramId"
,
dmpComputEngineParamRequest
.
getParamId
());
}
//引擎主键
if
(
dmpComputEngineParamRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpComputEngineParamRequest
.
getEngineId
());
}
//参数名称
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamName
()))
{
param
.
put
(
"paramName"
,
dmpComputEngineParamRequest
.
getParamName
());
}
//类型(0:引擎公共参数,1:引擎私配置参数)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamType
()))
{
param
.
put
(
"paramType"
,
dmpComputEngineParamRequest
.
getParamType
());
}
//参数值
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamValue
()))
{
param
.
put
(
"paramValue"
,
dmpComputEngineParamRequest
.
getParamValue
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpComputEngineParamRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpComputEngineParamRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpComputEngineParamRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpComputEngineParamRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpComputEngineParamRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpComputEngineParamRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpComputEngineParamRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpComputEngineParamRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpComputEngineParamRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpComputEngineParamRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpComputEngineParamRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpComputEngineParamRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpComputEngineParamRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpComputEngineParamRequest
.
getUpdateTimeEnd
());
}
dmpComputEngineParamMapper
.
delete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDelete
(
DmpComputEngineParamRequest
dmpComputEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpComputEngineParamRequest
.
getParamId
()
!=
null
)
{
param
.
put
(
"paramId"
,
dmpComputEngineParamRequest
.
getParamId
());
}
//引擎主键
if
(
dmpComputEngineParamRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpComputEngineParamRequest
.
getEngineId
());
}
//参数名称
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamName
()))
{
param
.
put
(
"paramName"
,
dmpComputEngineParamRequest
.
getParamName
());
}
//类型(0:引擎公共参数,1:引擎私配置参数)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamType
()))
{
param
.
put
(
"paramType"
,
dmpComputEngineParamRequest
.
getParamType
());
}
//参数值
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getParamValue
()))
{
param
.
put
(
"paramValue"
,
dmpComputEngineParamRequest
.
getParamValue
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpComputEngineParamRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineParamRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpComputEngineParamRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpComputEngineParamRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpComputEngineParamRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpComputEngineParamRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpComputEngineParamRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpComputEngineParamRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpComputEngineParamRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpComputEngineParamRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpComputEngineParamRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpComputEngineParamRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpComputEngineParamRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpComputEngineParamRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpComputEngineParamRequest
.
getUpdateTimeEnd
());
}
dmpComputEngineParamMapper
.
softDelete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineParamService#addBatch(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineParamVo, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpComputEngineParamBatch
>
addBatch
(
DmpComputEngineParamBatch
dmpComputEngineParamBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngineParamBatch
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
List
<
DmpComputEngineParam
>
dmpComputEngineParams
=
dmpComputEngineParamBatch
.
getDmpComputEngineParams
();
if
(
CollectionUtils
.
isEmpty
(
dmpComputEngineParams
))
{
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
baseBeanResponse
.
setMessage
(
"数据不能为空!"
);
return
baseBeanResponse
;
}
dmpComputEngineParams
=
dmpComputEngineParams
.
stream
().
map
(
dmpComputEngineParam
->
{
/*$*setParamIdCodeReplace*$*/
// 创建人
try
{
dmpComputEngineParam
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
}
catch
(
Exception
e
)
{
logger
.
info
(
e
.
getMessage
());
e
.
printStackTrace
();
}
// 创建时间
dmpComputEngineParam
.
setCreateTime
(
new
Date
());
return
dmpComputEngineParam
;
}).
collect
(
Collectors
.
toList
());
dmpComputEngineParamMapper
.
insertBatch
(
dmpComputEngineParams
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"批量新增成功"
);
baseBeanResponse
.
setData
(
dmpComputEngineParamBatch
);
return
baseBeanResponse
;
}
/**
*批量删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpComputEngineParamMapper
.
deleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/**
*批量软删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpComputEngineParamMapper
.
softDeleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
}
src/main/java/com/jz/dmp/modules/service/projconfig/impl/DmpComputEngineServiceImpl.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
.
impl
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.common.persistence.BaseService
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineRequest
;
import
com.jz.dmp.modules.dao.projconfig.DmpComputEngineMapper
;
import
com.jz.dmp.modules.model.DmpComputEngine
;
import
com.jz.dmp.modules.service.projconfig.DmpComputEngineService
;
/**
* 计算引擎表服务的实现?
*
* @author ybz
*
*/
@Service
(
"dmpComputEngineService"
)
public
class
DmpComputEngineServiceImpl
extends
BaseService
implements
DmpComputEngineService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DmpComputEngineServiceImpl
.
class
);
@Autowired
private
DmpComputEngineMapper
dmpComputEngineMapper
;
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
PageInfoResponse
<
DmpComputEngineDto
>
findListWithPage
(
DmpComputEngineRequest
dmpComputEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
PageInfoResponse
<
DmpComputEngineDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpComputEngineRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpComputEngineRequest
.
getEngineId
());
}
//引擎名称
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getEngineName
()))
{
param
.
put
(
"engineName"
,
dmpComputEngineRequest
.
getEngineName
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpComputEngineRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpComputEngineRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpComputEngineRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpComputEngineRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpComputEngineRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpComputEngineRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpComputEngineRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpComputEngineRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpComputEngineRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpComputEngineRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpComputEngineRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpComputEngineRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpComputEngineRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpComputEngineRequest
.
getUpdateTimeEnd
());
}
PageHelper
.
startPage
(
dmpComputEngineRequest
.
getPageNum
(),
dmpComputEngineRequest
.
getPageSize
());
List
<
DmpComputEngineDto
>
list
=
dmpComputEngineMapper
.
findList
(
param
);
PageInfo
<
DmpComputEngineDto
>
pageInfo
=
new
PageInfo
<>(
list
);
pageInfoResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
pageInfoResponse
.
setMessage
(
"查询成功"
);
pageInfoResponse
.
setData
(
pageInfo
);
return
pageInfoResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpComputEngineDto
>
findList
(
DmpComputEngineRequest
dmpComputEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngineDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpComputEngineRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpComputEngineRequest
.
getEngineId
());
}
//引擎名称
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getEngineName
()))
{
param
.
put
(
"engineName"
,
dmpComputEngineRequest
.
getEngineName
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpComputEngineRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpComputEngineRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpComputEngineRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpComputEngineRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpComputEngineRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpComputEngineRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpComputEngineRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpComputEngineRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpComputEngineRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpComputEngineRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpComputEngineRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpComputEngineRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpComputEngineRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpComputEngineRequest
.
getUpdateTimeEnd
());
}
List
<
DmpComputEngineDto
>
list
=
dmpComputEngineMapper
.
findList
(
param
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setDatas
(
list
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#add(com.ycxc.vmts.entity.DmpComputEngine,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpComputEngine
>
add
(
DmpComputEngine
dmpComputEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngine
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
/*$*setEngineIdCodeReplace*$*/
// 创建人
dmpComputEngine
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpComputEngine
.
setCreateTime
(
new
Date
());
dmpComputEngineMapper
.
insertSelective
(
dmpComputEngine
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpComputEngine
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#edit(com.ycxc.vmts.entity.DmpComputEngine,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpComputEngine
>
edit
(
DmpComputEngine
dmpComputEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngine
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
// 修改人
dmpComputEngine
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpComputEngine
.
setUpdateTime
(
new
Date
());
dmpComputEngineMapper
.
updateByPrimaryKeySelective
(
dmpComputEngine
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpComputEngine
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#addOrEdit(com.ycxc.vmts.entity.DmpComputEngine,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpComputEngine
>
addOrEdit
(
DmpComputEngine
dmpComputEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngine
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Integer
engineId
=
dmpComputEngine
.
getEngineId
();
if
(
null
==
engineId
)
{
//新增
// 创建人
dmpComputEngine
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpComputEngine
.
setCreateTime
(
new
Date
());
dmpComputEngineMapper
.
insertSelective
(
dmpComputEngine
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpComputEngine
);
}
else
{
//修改
// 修改人
dmpComputEngine
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpComputEngine
.
setUpdateTime
(
new
Date
());
dmpComputEngineMapper
.
updateByPrimaryKeySelective
(
dmpComputEngine
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpComputEngine
);
}
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#findById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpComputEngineDto
>
findById
(
Integer
engineId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngineDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
DmpComputEngineDto
dmpComputEngineDto
=
dmpComputEngineMapper
.
findById
(
engineId
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setData
(
dmpComputEngineDto
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteById
(
Integer
engineId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpComputEngineMapper
.
deleteByPrimaryKey
(
engineId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteById
(
Integer
engineId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpComputEngineMapper
.
softDeleteByPrimaryKey
(
engineId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
delete
(
DmpComputEngineRequest
dmpComputEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpComputEngineRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpComputEngineRequest
.
getEngineId
());
}
//引擎名称
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getEngineName
()))
{
param
.
put
(
"engineName"
,
dmpComputEngineRequest
.
getEngineName
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpComputEngineRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpComputEngineRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpComputEngineRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpComputEngineRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpComputEngineRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpComputEngineRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpComputEngineRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpComputEngineRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpComputEngineRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpComputEngineRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpComputEngineRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpComputEngineRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpComputEngineRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpComputEngineRequest
.
getUpdateTimeEnd
());
}
dmpComputEngineMapper
.
delete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDelete
(
DmpComputEngineRequest
dmpComputEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpComputEngineRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpComputEngineRequest
.
getEngineId
());
}
//引擎名称
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getEngineName
()))
{
param
.
put
(
"engineName"
,
dmpComputEngineRequest
.
getEngineName
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpComputEngineRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpComputEngineRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpComputEngineRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpComputEngineRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpComputEngineRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpComputEngineRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpComputEngineRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpComputEngineRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpComputEngineRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpComputEngineRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpComputEngineRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpComputEngineRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpComputEngineRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpComputEngineRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpComputEngineRequest
.
getUpdateTimeEnd
());
}
dmpComputEngineMapper
.
softDelete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpComputEngineService#addBatch(com.ycxc.vmts.controller.bas.
* bean.DmpComputEngineVo, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpComputEngineBatch
>
addBatch
(
DmpComputEngineBatch
dmpComputEngineBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpComputEngineBatch
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
List
<
DmpComputEngine
>
dmpComputEngines
=
dmpComputEngineBatch
.
getDmpComputEngines
();
if
(
CollectionUtils
.
isEmpty
(
dmpComputEngines
))
{
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
baseBeanResponse
.
setMessage
(
"数据不能为空!"
);
return
baseBeanResponse
;
}
dmpComputEngines
=
dmpComputEngines
.
stream
().
map
(
dmpComputEngine
->
{
/*$*setEngineIdCodeReplace*$*/
// 创建人
try
{
dmpComputEngine
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
}
catch
(
Exception
e
)
{
logger
.
info
(
e
.
getMessage
());
e
.
printStackTrace
();
}
// 创建时间
dmpComputEngine
.
setCreateTime
(
new
Date
());
return
dmpComputEngine
;
}).
collect
(
Collectors
.
toList
());
dmpComputEngineMapper
.
insertBatch
(
dmpComputEngines
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"批量新增成功"
);
baseBeanResponse
.
setData
(
dmpComputEngineBatch
);
return
baseBeanResponse
;
}
/**
*批量删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpComputEngineMapper
.
deleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/**
*批量软删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpComputEngineMapper
.
softDeleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
}
src/main/java/com/jz/dmp/modules/service/projconfig/impl/DmpProjectConfigEngineServiceImpl.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
.
impl
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.common.persistence.BaseService
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineRequest
;
import
com.jz.dmp.modules.dao.projconfig.DmpProjectConfigEngineMapper
;
import
com.jz.dmp.modules.model.DmpProjectConfigEngine
;
import
com.jz.dmp.modules.service.projconfig.DmpProjectConfigEngineService
;
/**
* 项目配置计算引擎关系表服务的实现?
*
* @author ybz
*
*/
@Service
(
"dmpProjectConfigEngineService"
)
public
class
DmpProjectConfigEngineServiceImpl
extends
BaseService
implements
DmpProjectConfigEngineService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DmpProjectConfigEngineServiceImpl
.
class
);
@Autowired
private
DmpProjectConfigEngineMapper
dmpProjectConfigEngineMapper
;
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
PageInfoResponse
<
DmpProjectConfigEngineDto
>
findListWithPage
(
DmpProjectConfigEngineRequest
dmpProjectConfigEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
PageInfoResponse
<
DmpProjectConfigEngineDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectConfigEngineRequest
.
getConfigEngineId
()
!=
null
)
{
param
.
put
(
"configEngineId"
,
dmpProjectConfigEngineRequest
.
getConfigEngineId
());
}
//项目主键
if
(
dmpProjectConfigEngineRequest
.
getProjectId
()
!=
null
)
{
param
.
put
(
"projectId"
,
dmpProjectConfigEngineRequest
.
getProjectId
());
}
//引擎主键
if
(
dmpProjectConfigEngineRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpProjectConfigEngineRequest
.
getEngineId
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigEngineRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectConfigEngineRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigEngineRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectConfigEngineRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectConfigEngineRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectConfigEngineRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectConfigEngineRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectConfigEngineRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectConfigEngineRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectConfigEngineRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectConfigEngineRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectConfigEngineRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectConfigEngineRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectConfigEngineRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectConfigEngineRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectConfigEngineRequest
.
getUpdateTimeEnd
());
}
PageHelper
.
startPage
(
dmpProjectConfigEngineRequest
.
getPageNum
(),
dmpProjectConfigEngineRequest
.
getPageSize
());
List
<
DmpProjectConfigEngineDto
>
list
=
dmpProjectConfigEngineMapper
.
findList
(
param
);
PageInfo
<
DmpProjectConfigEngineDto
>
pageInfo
=
new
PageInfo
<>(
list
);
pageInfoResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
pageInfoResponse
.
setMessage
(
"查询成功"
);
pageInfoResponse
.
setData
(
pageInfo
);
return
pageInfoResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpProjectConfigEngineDto
>
findList
(
DmpProjectConfigEngineRequest
dmpProjectConfigEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigEngineDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectConfigEngineRequest
.
getConfigEngineId
()
!=
null
)
{
param
.
put
(
"configEngineId"
,
dmpProjectConfigEngineRequest
.
getConfigEngineId
());
}
//项目主键
if
(
dmpProjectConfigEngineRequest
.
getProjectId
()
!=
null
)
{
param
.
put
(
"projectId"
,
dmpProjectConfigEngineRequest
.
getProjectId
());
}
//引擎主键
if
(
dmpProjectConfigEngineRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpProjectConfigEngineRequest
.
getEngineId
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigEngineRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectConfigEngineRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigEngineRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectConfigEngineRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectConfigEngineRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectConfigEngineRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectConfigEngineRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectConfigEngineRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectConfigEngineRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectConfigEngineRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectConfigEngineRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectConfigEngineRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectConfigEngineRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectConfigEngineRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectConfigEngineRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectConfigEngineRequest
.
getUpdateTimeEnd
());
}
List
<
DmpProjectConfigEngineDto
>
list
=
dmpProjectConfigEngineMapper
.
findList
(
param
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setDatas
(
list
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#add(com.ycxc.vmts.entity.DmpProjectConfigEngine,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectConfigEngine
>
add
(
DmpProjectConfigEngine
dmpProjectConfigEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigEngine
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
/*$*setConfigEngineIdCodeReplace*$*/
// 创建人
dmpProjectConfigEngine
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpProjectConfigEngine
.
setCreateTime
(
new
Date
());
dmpProjectConfigEngineMapper
.
insertSelective
(
dmpProjectConfigEngine
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigEngine
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#edit(com.ycxc.vmts.entity.DmpProjectConfigEngine,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectConfigEngine
>
edit
(
DmpProjectConfigEngine
dmpProjectConfigEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigEngine
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
// 修改人
dmpProjectConfigEngine
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpProjectConfigEngine
.
setUpdateTime
(
new
Date
());
dmpProjectConfigEngineMapper
.
updateByPrimaryKeySelective
(
dmpProjectConfigEngine
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigEngine
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#addOrEdit(com.ycxc.vmts.entity.DmpProjectConfigEngine,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectConfigEngine
>
addOrEdit
(
DmpProjectConfigEngine
dmpProjectConfigEngine
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigEngine
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Integer
configEngineId
=
dmpProjectConfigEngine
.
getConfigEngineId
();
if
(
null
==
configEngineId
)
{
//新增
// 创建人
dmpProjectConfigEngine
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpProjectConfigEngine
.
setCreateTime
(
new
Date
());
dmpProjectConfigEngineMapper
.
insertSelective
(
dmpProjectConfigEngine
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigEngine
);
}
else
{
//修改
// 修改人
dmpProjectConfigEngine
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpProjectConfigEngine
.
setUpdateTime
(
new
Date
());
dmpProjectConfigEngineMapper
.
updateByPrimaryKeySelective
(
dmpProjectConfigEngine
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigEngine
);
}
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#findById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpProjectConfigEngineDto
>
findById
(
Integer
configEngineId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigEngineDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
DmpProjectConfigEngineDto
dmpProjectConfigEngineDto
=
dmpProjectConfigEngineMapper
.
findById
(
configEngineId
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigEngineDto
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteById
(
Integer
configEngineId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectConfigEngineMapper
.
deleteByPrimaryKey
(
configEngineId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteById
(
Integer
configEngineId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectConfigEngineMapper
.
softDeleteByPrimaryKey
(
configEngineId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
delete
(
DmpProjectConfigEngineRequest
dmpProjectConfigEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectConfigEngineRequest
.
getConfigEngineId
()
!=
null
)
{
param
.
put
(
"configEngineId"
,
dmpProjectConfigEngineRequest
.
getConfigEngineId
());
}
//项目主键
if
(
dmpProjectConfigEngineRequest
.
getProjectId
()
!=
null
)
{
param
.
put
(
"projectId"
,
dmpProjectConfigEngineRequest
.
getProjectId
());
}
//引擎主键
if
(
dmpProjectConfigEngineRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpProjectConfigEngineRequest
.
getEngineId
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigEngineRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectConfigEngineRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigEngineRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectConfigEngineRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectConfigEngineRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectConfigEngineRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectConfigEngineRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectConfigEngineRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectConfigEngineRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectConfigEngineRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectConfigEngineRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectConfigEngineRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectConfigEngineRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectConfigEngineRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectConfigEngineRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectConfigEngineRequest
.
getUpdateTimeEnd
());
}
dmpProjectConfigEngineMapper
.
delete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigEngineRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDelete
(
DmpProjectConfigEngineRequest
dmpProjectConfigEngineRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectConfigEngineRequest
.
getConfigEngineId
()
!=
null
)
{
param
.
put
(
"configEngineId"
,
dmpProjectConfigEngineRequest
.
getConfigEngineId
());
}
//项目主键
if
(
dmpProjectConfigEngineRequest
.
getProjectId
()
!=
null
)
{
param
.
put
(
"projectId"
,
dmpProjectConfigEngineRequest
.
getProjectId
());
}
//引擎主键
if
(
dmpProjectConfigEngineRequest
.
getEngineId
()
!=
null
)
{
param
.
put
(
"engineId"
,
dmpProjectConfigEngineRequest
.
getEngineId
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigEngineRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectConfigEngineRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigEngineRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectConfigEngineRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectConfigEngineRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectConfigEngineRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectConfigEngineRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectConfigEngineRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectConfigEngineRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectConfigEngineRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectConfigEngineRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectConfigEngineRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectConfigEngineRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectConfigEngineRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectConfigEngineRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectConfigEngineRequest
.
getUpdateTimeEnd
());
}
dmpProjectConfigEngineMapper
.
softDelete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigEngineService#addBatch(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigEngineVo, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectConfigEngineBatch
>
addBatch
(
DmpProjectConfigEngineBatch
dmpProjectConfigEngineBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigEngineBatch
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
List
<
DmpProjectConfigEngine
>
dmpProjectConfigEngines
=
dmpProjectConfigEngineBatch
.
getDmpProjectConfigEngines
();
if
(
CollectionUtils
.
isEmpty
(
dmpProjectConfigEngines
))
{
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
baseBeanResponse
.
setMessage
(
"数据不能为空!"
);
return
baseBeanResponse
;
}
dmpProjectConfigEngines
=
dmpProjectConfigEngines
.
stream
().
map
(
dmpProjectConfigEngine
->
{
/*$*setConfigEngineIdCodeReplace*$*/
// 创建人
try
{
dmpProjectConfigEngine
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
}
catch
(
Exception
e
)
{
logger
.
info
(
e
.
getMessage
());
e
.
printStackTrace
();
}
// 创建时间
dmpProjectConfigEngine
.
setCreateTime
(
new
Date
());
return
dmpProjectConfigEngine
;
}).
collect
(
Collectors
.
toList
());
dmpProjectConfigEngineMapper
.
insertBatch
(
dmpProjectConfigEngines
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"批量新增成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigEngineBatch
);
return
baseBeanResponse
;
}
/**
*批量删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectConfigEngineMapper
.
deleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/**
*批量软删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectConfigEngineMapper
.
softDeleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
}
src/main/java/com/jz/dmp/modules/service/projconfig/impl/DmpProjectConfigInfoServiceImpl.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.common.persistence.BaseService
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoRequest
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectEngineParamDto
;
import
com.jz.dmp.modules.dao.projconfig.DmpProjectConfigEngineMapper
;
import
com.jz.dmp.modules.dao.projconfig.DmpProjectConfigInfoMapper
;
import
com.jz.dmp.modules.dao.projconfig.DmpProjectEngineParamMapper
;
import
com.jz.dmp.modules.model.DmpProjectConfigEngine
;
import
com.jz.dmp.modules.model.DmpProjectConfigInfo
;
import
com.jz.dmp.modules.model.DmpProjectEngineParam
;
import
com.jz.dmp.modules.service.projconfig.DmpProjectConfigInfoService
;
/**
* 项目配置表服务的实现?
*
* @author ybz
*
*/
@Service
(
"dmpProjectConfigInfoService"
)
public
class
DmpProjectConfigInfoServiceImpl
extends
BaseService
implements
DmpProjectConfigInfoService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DmpProjectConfigInfoServiceImpl
.
class
);
@Autowired
private
DmpProjectConfigInfoMapper
dmpProjectConfigInfoMapper
;
@Autowired
private
DmpProjectConfigEngineMapper
dmpProjectConfigEngineMapper
;
@Autowired
private
DmpProjectEngineParamMapper
dmpProjectEngineParamMapper
;
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigInfoRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
PageInfoResponse
<
DmpProjectConfigInfoDto
>
findListWithPage
(
DmpProjectConfigInfoRequest
dmpProjectConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
PageInfoResponse
<
DmpProjectConfigInfoDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectConfigInfoRequest
.
getProjectConfigId
()
!=
null
)
{
param
.
put
(
"projectConfigId"
,
dmpProjectConfigInfoRequest
.
getProjectConfigId
());
}
//项目主键
if
(
dmpProjectConfigInfoRequest
.
getProjectId
()
!=
null
)
{
param
.
put
(
"projectId"
,
dmpProjectConfigInfoRequest
.
getProjectId
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigInfoRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectConfigInfoRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigInfoRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectConfigInfoRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectConfigInfoRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectConfigInfoRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectConfigInfoRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectConfigInfoRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectConfigInfoRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectConfigInfoRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectConfigInfoRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectConfigInfoRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectConfigInfoRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectConfigInfoRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectConfigInfoRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectConfigInfoRequest
.
getUpdateTimeEnd
());
}
PageHelper
.
startPage
(
dmpProjectConfigInfoRequest
.
getPageNum
(),
dmpProjectConfigInfoRequest
.
getPageSize
());
List
<
DmpProjectConfigInfoDto
>
list
=
dmpProjectConfigInfoMapper
.
findList
(
param
);
PageInfo
<
DmpProjectConfigInfoDto
>
pageInfo
=
new
PageInfo
<>(
list
);
pageInfoResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
pageInfoResponse
.
setMessage
(
"查询成功"
);
pageInfoResponse
.
setData
(
pageInfo
);
return
pageInfoResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigInfoRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
findList
(
DmpProjectConfigInfoRequest
dmpProjectConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectConfigInfoRequest
.
getProjectConfigId
()
!=
null
)
{
param
.
put
(
"projectConfigId"
,
dmpProjectConfigInfoRequest
.
getProjectConfigId
());
}
//项目主键
if
(
dmpProjectConfigInfoRequest
.
getProjectId
()
!=
null
)
{
param
.
put
(
"projectId"
,
dmpProjectConfigInfoRequest
.
getProjectId
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigInfoRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectConfigInfoRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigInfoRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectConfigInfoRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectConfigInfoRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectConfigInfoRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectConfigInfoRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectConfigInfoRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectConfigInfoRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectConfigInfoRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectConfigInfoRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectConfigInfoRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectConfigInfoRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectConfigInfoRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectConfigInfoRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectConfigInfoRequest
.
getUpdateTimeEnd
());
}
List
<
DmpProjectConfigInfoDto
>
list
=
dmpProjectConfigInfoMapper
.
findList
(
param
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setDatas
(
list
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#add(com.ycxc.vmts.entity.DmpProjectConfigInfo,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectConfigInfo
>
add
(
DmpProjectConfigInfo
dmpProjectConfigInfo
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigInfo
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
/*$*setProjectConfigIdCodeReplace*$*/
// 创建人
dmpProjectConfigInfo
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpProjectConfigInfo
.
setCreateTime
(
new
Date
());
dmpProjectConfigInfoMapper
.
insertSelective
(
dmpProjectConfigInfo
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigInfo
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#edit(com.ycxc.vmts.entity.DmpProjectConfigInfo,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectConfigInfo
>
edit
(
DmpProjectConfigInfo
dmpProjectConfigInfo
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigInfo
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
// 修改人
dmpProjectConfigInfo
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpProjectConfigInfo
.
setUpdateTime
(
new
Date
());
dmpProjectConfigInfoMapper
.
updateByPrimaryKeySelective
(
dmpProjectConfigInfo
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigInfo
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#addOrEdit(com.ycxc.vmts.entity.DmpProjectConfigInfo,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectConfigInfo
>
addOrEdit
(
DmpProjectConfigInfo
dmpProjectConfigInfo
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigInfo
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Integer
projectConfigId
=
dmpProjectConfigInfo
.
getProjectConfigId
();
if
(
null
==
projectConfigId
)
{
//新增
// 创建人
dmpProjectConfigInfo
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpProjectConfigInfo
.
setCreateTime
(
new
Date
());
dmpProjectConfigInfoMapper
.
insertSelective
(
dmpProjectConfigInfo
);
//保存选择的引擎
List
<
DmpProjectConfigEngine
>
dmpProjectConfigEngines
=
dmpProjectConfigInfo
.
getDmpProjectConfigEngines
();
dmpProjectConfigEngineMapper
.
insertBatch
(
dmpProjectConfigEngines
);
//保存填写的私有引擎参数
List
<
DmpProjectEngineParam
>
dmpProjectEngineParams
=
dmpProjectConfigEngines
.
stream
()
.
flatMap
(
x
->{
return
x
.
getDmpProjectEngineParams
().
stream
();
}).
collect
(
Collectors
.
toList
());
dmpProjectEngineParamMapper
.
insertBatch
(
dmpProjectEngineParams
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigInfo
);
}
else
{
//修改
// 修改人
dmpProjectConfigInfo
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpProjectConfigInfo
.
setUpdateTime
(
new
Date
());
dmpProjectConfigInfoMapper
.
updateByPrimaryKeySelective
(
dmpProjectConfigInfo
);
//保存选择的引擎
Map
<
String
,
Object
>
projConfigEngineParam
=
new
HashMap
<
String
,
Object
>();
projConfigEngineParam
.
put
(
"projectId"
,
dmpProjectConfigInfo
.
getProjectId
());
List
<
DmpProjectConfigEngineDto
>
dmpProjConfigEngineDtosDb
=
dmpProjectConfigEngineMapper
.
findList
(
projConfigEngineParam
);
List
<
DmpProjectConfigEngine
>
dmpProjConfigEngines
=
dmpProjectConfigInfo
.
getDmpProjectConfigEngines
();
//新增
List
<
DmpProjectConfigEngine
>
dmpProjConfigEnginesNew
=
dmpProjConfigEngines
.
stream
()
.
filter
(
x
->{
if
(
x
.
getConfigEngineId
()==
null
)
{
return
true
;
}
return
false
;
}).
map
(
y
->{
y
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
y
.
setCreateTime
(
new
Date
());
return
y
;
}).
collect
(
Collectors
.
toList
());
dmpProjectConfigEngineMapper
.
insertBatch
(
dmpProjConfigEnginesNew
);
//修改
List
<
DmpProjectConfigEngine
>
dmpProjConfigEnginesUpdate
=
dmpProjConfigEngines
.
parallelStream
()
.
filter
(
x
->{
if
(
x
.
getConfigEngineId
()==
null
)
{
return
false
;
}
return
true
;
})
.
collect
(
Collectors
.
toList
());
for
(
DmpProjectConfigEngine
dmpProjectConfigEngine
:
dmpProjConfigEnginesUpdate
)
{
dmpProjectConfigEngine
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
dmpProjectConfigEngine
.
setUpdateTime
(
new
Date
());
dmpProjectConfigEngineMapper
.
updateByPrimaryKeySelective
(
dmpProjectConfigEngine
);
}
//删除
Map
<
Integer
,
Integer
>
dicMap
=
dmpProjConfigEnginesUpdate
.
parallelStream
()
.
collect
(
Collectors
.
toMap
(
DmpProjectConfigEngine:
:
getConfigEngineId
,
DmpProjectConfigEngine:
:
getConfigEngineId
));
List
<
Integer
>
deleteIds
=
new
ArrayList
<
Integer
>();
dmpProjConfigEngineDtosDb
.
parallelStream
().
forEach
(
x
->{
if
(
dicMap
.
get
(
x
.
getConfigEngineId
())==
null
)
{
deleteIds
.
add
(
x
.
getConfigEngineId
());
}
});
dmpProjectConfigEngineMapper
.
deleteByIds
(
deleteIds
);
//保存填写的私有引擎参数
Map
<
String
,
Object
>
projEngineParamMap
=
new
HashMap
<
String
,
Object
>();
projEngineParamMap
.
put
(
"projectId"
,
dmpProjectConfigInfo
.
getProjectId
());
List
<
DmpProjectEngineParamDto
>
dmpProjEngineParamDtosDb
=
dmpProjectEngineParamMapper
.
findList
(
projEngineParamMap
);
List
<
DmpProjectEngineParam
>
dmpProjectEngineParams
=
dmpProjConfigEngines
.
stream
()
.
flatMap
(
x
->{
return
x
.
getDmpProjectEngineParams
().
stream
();
}).
collect
(
Collectors
.
toList
());
dmpProjectEngineParamMapper
.
insertBatch
(
dmpProjectEngineParams
);
//新增
List
<
DmpProjectEngineParam
>
dmpProjectEngineParamsNew
=
dmpProjectEngineParams
.
stream
()
.
filter
(
x
->{
if
(
x
.
getProjectParamId
()==
null
)
{
return
true
;
}
return
false
;
}).
map
(
y
->{
y
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
y
.
setCreateTime
(
new
Date
());
return
y
;
}).
collect
(
Collectors
.
toList
());
dmpProjectEngineParamMapper
.
insertBatch
(
dmpProjectEngineParamsNew
);
//修改
List
<
DmpProjectEngineParam
>
dmpProjEngineParamsUpdate
=
dmpProjectEngineParams
.
parallelStream
()
.
filter
(
x
->{
if
(
x
.
getProjectParamId
()==
null
)
{
return
false
;
}
return
true
;
})
.
collect
(
Collectors
.
toList
());
for
(
DmpProjectEngineParam
dmpProjectEngineParam
:
dmpProjEngineParamsUpdate
)
{
dmpProjectEngineParam
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
dmpProjectEngineParam
.
setUpdateTime
(
new
Date
());
dmpProjectEngineParamMapper
.
updateByPrimaryKeySelective
(
dmpProjectEngineParam
);
}
//删除
Map
<
Integer
,
Integer
>
dicParamMap
=
dmpProjEngineParamsUpdate
.
parallelStream
()
.
collect
(
Collectors
.
toMap
(
DmpProjectEngineParam:
:
getProjectParamId
,
DmpProjectEngineParam:
:
getProjectParamId
));
List
<
Integer
>
deleteParamIds
=
new
ArrayList
<
Integer
>();
dmpProjEngineParamDtosDb
.
parallelStream
().
forEach
(
x
->{
if
(
dicParamMap
.
get
(
x
.
getProjectParamId
())==
null
)
{
deleteParamIds
.
add
(
x
.
getProjectParamId
());
}
});
dmpProjectEngineParamMapper
.
deleteByIds
(
deleteParamIds
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigInfo
);
}
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#findById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigInfoRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
findById
(
Integer
projectConfigId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
DmpProjectConfigInfoDto
dmpProjectConfigInfoDto
=
dmpProjectConfigInfoMapper
.
findById
(
projectConfigId
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigInfoDto
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigInfoRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteById
(
Integer
projectConfigId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectConfigInfoMapper
.
deleteByPrimaryKey
(
projectConfigId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigInfoRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteById
(
Integer
projectConfigId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectConfigInfoMapper
.
softDeleteByPrimaryKey
(
projectConfigId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigInfoRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
delete
(
DmpProjectConfigInfoRequest
dmpProjectConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectConfigInfoRequest
.
getProjectConfigId
()
!=
null
)
{
param
.
put
(
"projectConfigId"
,
dmpProjectConfigInfoRequest
.
getProjectConfigId
());
}
//项目主键
if
(
dmpProjectConfigInfoRequest
.
getProjectId
()
!=
null
)
{
param
.
put
(
"projectId"
,
dmpProjectConfigInfoRequest
.
getProjectId
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigInfoRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectConfigInfoRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigInfoRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectConfigInfoRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectConfigInfoRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectConfigInfoRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectConfigInfoRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectConfigInfoRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectConfigInfoRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectConfigInfoRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectConfigInfoRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectConfigInfoRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectConfigInfoRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectConfigInfoRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectConfigInfoRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectConfigInfoRequest
.
getUpdateTimeEnd
());
}
dmpProjectConfigInfoMapper
.
delete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigInfoRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDelete
(
DmpProjectConfigInfoRequest
dmpProjectConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectConfigInfoRequest
.
getProjectConfigId
()
!=
null
)
{
param
.
put
(
"projectConfigId"
,
dmpProjectConfigInfoRequest
.
getProjectConfigId
());
}
//项目主键
if
(
dmpProjectConfigInfoRequest
.
getProjectId
()
!=
null
)
{
param
.
put
(
"projectId"
,
dmpProjectConfigInfoRequest
.
getProjectId
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigInfoRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectConfigInfoRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectConfigInfoRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectConfigInfoRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectConfigInfoRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectConfigInfoRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectConfigInfoRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectConfigInfoRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectConfigInfoRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectConfigInfoRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectConfigInfoRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectConfigInfoRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectConfigInfoRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectConfigInfoRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectConfigInfoRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectConfigInfoRequest
.
getUpdateTimeEnd
());
}
dmpProjectConfigInfoMapper
.
softDelete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectConfigInfoService#addBatch(com.ycxc.vmts.controller.bas.
* bean.DmpProjectConfigInfoVo, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectConfigInfoBatch
>
addBatch
(
DmpProjectConfigInfoBatch
dmpProjectConfigInfoBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigInfoBatch
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
List
<
DmpProjectConfigInfo
>
dmpProjectConfigInfos
=
dmpProjectConfigInfoBatch
.
getDmpProjectConfigInfos
();
if
(
CollectionUtils
.
isEmpty
(
dmpProjectConfigInfos
))
{
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
baseBeanResponse
.
setMessage
(
"数据不能为空!"
);
return
baseBeanResponse
;
}
dmpProjectConfigInfos
=
dmpProjectConfigInfos
.
stream
().
map
(
dmpProjectConfigInfo
->
{
/*$*setProjectConfigIdCodeReplace*$*/
// 创建人
try
{
dmpProjectConfigInfo
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
}
catch
(
Exception
e
)
{
logger
.
info
(
e
.
getMessage
());
e
.
printStackTrace
();
}
// 创建时间
dmpProjectConfigInfo
.
setCreateTime
(
new
Date
());
return
dmpProjectConfigInfo
;
}).
collect
(
Collectors
.
toList
());
dmpProjectConfigInfoMapper
.
insertBatch
(
dmpProjectConfigInfos
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"批量新增成功"
);
baseBeanResponse
.
setData
(
dmpProjectConfigInfoBatch
);
return
baseBeanResponse
;
}
/**
*批量删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectConfigInfoMapper
.
deleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/**
*批量软删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectConfigInfoMapper
.
softDeleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/**
*获取项目配置信息
*/
@Override
public
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
findByProjectId
(
Integer
projectId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectConfigInfoDto
>
baseBeanResponse
=
new
BaseBeanResponse
<
DmpProjectConfigInfoDto
>();
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"projectId"
,
projectId
);
DmpProjectConfigInfoDto
dto
=
null
;
List
<
DmpProjectConfigInfoDto
>
list
=
dmpProjectConfigInfoMapper
.
findList
(
param
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
dto
=
list
.
get
(
0
);
}
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setData
(
dto
);
return
baseBeanResponse
;
}
}
src/main/java/com/jz/dmp/modules/service/projconfig/impl/DmpProjectEngineParamServiceImpl.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
.
impl
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.common.persistence.BaseService
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectEngineParamBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectEngineParamDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpProjectEngineParamRequest
;
import
com.jz.dmp.modules.dao.projconfig.DmpProjectEngineParamMapper
;
import
com.jz.dmp.modules.model.DmpProjectEngineParam
;
import
com.jz.dmp.modules.service.projconfig.DmpProjectEngineParamService
;
/**
* 计算引擎项目参数表服务的实现?
*
* @author ybz
*
*/
@Service
(
"dmpProjectEngineParamService"
)
public
class
DmpProjectEngineParamServiceImpl
extends
BaseService
implements
DmpProjectEngineParamService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DmpProjectEngineParamServiceImpl
.
class
);
@Autowired
private
DmpProjectEngineParamMapper
dmpProjectEngineParamMapper
;
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpProjectEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
PageInfoResponse
<
DmpProjectEngineParamDto
>
findListWithPage
(
DmpProjectEngineParamRequest
dmpProjectEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
PageInfoResponse
<
DmpProjectEngineParamDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectEngineParamRequest
.
getProjectParamId
()
!=
null
)
{
param
.
put
(
"projectParamId"
,
dmpProjectEngineParamRequest
.
getProjectParamId
());
}
//项目配置引擎关系主键
if
(
dmpProjectEngineParamRequest
.
getConfigEngineId
()
!=
null
)
{
param
.
put
(
"configEngineId"
,
dmpProjectEngineParamRequest
.
getConfigEngineId
());
}
//引擎参数主键
if
(
dmpProjectEngineParamRequest
.
getParamId
()
!=
null
)
{
param
.
put
(
"paramId"
,
dmpProjectEngineParamRequest
.
getParamId
());
}
//参数名称
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getParamName
()))
{
param
.
put
(
"paramName"
,
dmpProjectEngineParamRequest
.
getParamName
());
}
//参数值
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getParamValue
()))
{
param
.
put
(
"paramValue"
,
dmpProjectEngineParamRequest
.
getParamValue
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectEngineParamRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectEngineParamRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectEngineParamRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectEngineParamRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectEngineParamRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectEngineParamRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectEngineParamRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectEngineParamRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectEngineParamRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectEngineParamRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectEngineParamRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectEngineParamRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectEngineParamRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectEngineParamRequest
.
getUpdateTimeEnd
());
}
PageHelper
.
startPage
(
dmpProjectEngineParamRequest
.
getPageNum
(),
dmpProjectEngineParamRequest
.
getPageSize
());
List
<
DmpProjectEngineParamDto
>
list
=
dmpProjectEngineParamMapper
.
findList
(
param
);
PageInfo
<
DmpProjectEngineParamDto
>
pageInfo
=
new
PageInfo
<>(
list
);
pageInfoResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
pageInfoResponse
.
setMessage
(
"查询成功"
);
pageInfoResponse
.
setData
(
pageInfo
);
return
pageInfoResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpProjectEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpProjectEngineParamDto
>
findList
(
DmpProjectEngineParamRequest
dmpProjectEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectEngineParamDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectEngineParamRequest
.
getProjectParamId
()
!=
null
)
{
param
.
put
(
"projectParamId"
,
dmpProjectEngineParamRequest
.
getProjectParamId
());
}
//项目配置引擎关系主键
if
(
dmpProjectEngineParamRequest
.
getConfigEngineId
()
!=
null
)
{
param
.
put
(
"configEngineId"
,
dmpProjectEngineParamRequest
.
getConfigEngineId
());
}
//引擎参数主键
if
(
dmpProjectEngineParamRequest
.
getParamId
()
!=
null
)
{
param
.
put
(
"paramId"
,
dmpProjectEngineParamRequest
.
getParamId
());
}
//参数名称
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getParamName
()))
{
param
.
put
(
"paramName"
,
dmpProjectEngineParamRequest
.
getParamName
());
}
//参数值
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getParamValue
()))
{
param
.
put
(
"paramValue"
,
dmpProjectEngineParamRequest
.
getParamValue
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectEngineParamRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectEngineParamRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectEngineParamRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectEngineParamRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectEngineParamRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectEngineParamRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectEngineParamRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectEngineParamRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectEngineParamRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectEngineParamRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectEngineParamRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectEngineParamRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectEngineParamRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectEngineParamRequest
.
getUpdateTimeEnd
());
}
List
<
DmpProjectEngineParamDto
>
list
=
dmpProjectEngineParamMapper
.
findList
(
param
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setDatas
(
list
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#add(com.ycxc.vmts.entity.DmpProjectEngineParam,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectEngineParam
>
add
(
DmpProjectEngineParam
dmpProjectEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectEngineParam
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
/*$*setProjectParamIdCodeReplace*$*/
// 创建人
dmpProjectEngineParam
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpProjectEngineParam
.
setCreateTime
(
new
Date
());
dmpProjectEngineParamMapper
.
insertSelective
(
dmpProjectEngineParam
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpProjectEngineParam
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#edit(com.ycxc.vmts.entity.DmpProjectEngineParam,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectEngineParam
>
edit
(
DmpProjectEngineParam
dmpProjectEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectEngineParam
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
// 修改人
dmpProjectEngineParam
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpProjectEngineParam
.
setUpdateTime
(
new
Date
());
dmpProjectEngineParamMapper
.
updateByPrimaryKeySelective
(
dmpProjectEngineParam
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpProjectEngineParam
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#addOrEdit(com.ycxc.vmts.entity.DmpProjectEngineParam,
* javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectEngineParam
>
addOrEdit
(
DmpProjectEngineParam
dmpProjectEngineParam
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectEngineParam
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Integer
projectParamId
=
dmpProjectEngineParam
.
getProjectParamId
();
if
(
null
==
projectParamId
)
{
//新增
// 创建人
dmpProjectEngineParam
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 创建时间
dmpProjectEngineParam
.
setCreateTime
(
new
Date
());
dmpProjectEngineParamMapper
.
insertSelective
(
dmpProjectEngineParam
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"新增成功"
);
baseBeanResponse
.
setData
(
dmpProjectEngineParam
);
}
else
{
//修改
// 修改人
dmpProjectEngineParam
.
setUpdateUserId
(
getHttpRequestUserId
(
httpRequest
));
// 修改时间
dmpProjectEngineParam
.
setUpdateTime
(
new
Date
());
dmpProjectEngineParamMapper
.
updateByPrimaryKeySelective
(
dmpProjectEngineParam
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"修改成功"
);
baseBeanResponse
.
setData
(
dmpProjectEngineParam
);
}
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#findById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpProjectEngineParamDto
>
findById
(
Integer
projectParamId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectEngineParamDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
DmpProjectEngineParamDto
dmpProjectEngineParamDto
=
dmpProjectEngineParamMapper
.
findById
(
projectParamId
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"查询成功"
);
baseBeanResponse
.
setData
(
dmpProjectEngineParamDto
);
return
baseBeanResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteById
(
Integer
projectParamId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectEngineParamMapper
.
deleteByPrimaryKey
(
projectParamId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteById
(
Integer
projectParamId
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectEngineParamMapper
.
softDeleteByPrimaryKey
(
projectParamId
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
delete
(
DmpProjectEngineParamRequest
dmpProjectEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectEngineParamRequest
.
getProjectParamId
()
!=
null
)
{
param
.
put
(
"projectParamId"
,
dmpProjectEngineParamRequest
.
getProjectParamId
());
}
//项目配置引擎关系主键
if
(
dmpProjectEngineParamRequest
.
getConfigEngineId
()
!=
null
)
{
param
.
put
(
"configEngineId"
,
dmpProjectEngineParamRequest
.
getConfigEngineId
());
}
//引擎参数主键
if
(
dmpProjectEngineParamRequest
.
getParamId
()
!=
null
)
{
param
.
put
(
"paramId"
,
dmpProjectEngineParamRequest
.
getParamId
());
}
//参数名称
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getParamName
()))
{
param
.
put
(
"paramName"
,
dmpProjectEngineParamRequest
.
getParamName
());
}
//参数值
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getParamValue
()))
{
param
.
put
(
"paramValue"
,
dmpProjectEngineParamRequest
.
getParamValue
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectEngineParamRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectEngineParamRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectEngineParamRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectEngineParamRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectEngineParamRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectEngineParamRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectEngineParamRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectEngineParamRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectEngineParamRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectEngineParamRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectEngineParamRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectEngineParamRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectEngineParamRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectEngineParamRequest
.
getUpdateTimeEnd
());
}
dmpProjectEngineParamMapper
.
delete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#deleteById(com.ycxc.vmts.controller.bas.
* bean.DmpProjectEngineParamRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDelete
(
DmpProjectEngineParamRequest
dmpProjectEngineParamRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpProjectEngineParamRequest
.
getProjectParamId
()
!=
null
)
{
param
.
put
(
"projectParamId"
,
dmpProjectEngineParamRequest
.
getProjectParamId
());
}
//项目配置引擎关系主键
if
(
dmpProjectEngineParamRequest
.
getConfigEngineId
()
!=
null
)
{
param
.
put
(
"configEngineId"
,
dmpProjectEngineParamRequest
.
getConfigEngineId
());
}
//引擎参数主键
if
(
dmpProjectEngineParamRequest
.
getParamId
()
!=
null
)
{
param
.
put
(
"paramId"
,
dmpProjectEngineParamRequest
.
getParamId
());
}
//参数名称
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getParamName
()))
{
param
.
put
(
"paramName"
,
dmpProjectEngineParamRequest
.
getParamName
());
}
//参数值
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getParamValue
()))
{
param
.
put
(
"paramValue"
,
dmpProjectEngineParamRequest
.
getParamValue
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpProjectEngineParamRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpProjectEngineParamRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpProjectEngineParamRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpProjectEngineParamRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpProjectEngineParamRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpProjectEngineParamRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpProjectEngineParamRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpProjectEngineParamRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpProjectEngineParamRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpProjectEngineParamRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpProjectEngineParamRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpProjectEngineParamRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpProjectEngineParamRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpProjectEngineParamRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpProjectEngineParamRequest
.
getUpdateTimeEnd
());
}
dmpProjectEngineParamMapper
.
softDelete
(
param
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpProjectEngineParamService#addBatch(com.ycxc.vmts.controller.bas.
* bean.DmpProjectEngineParamVo, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseBeanResponse
<
DmpProjectEngineParamBatch
>
addBatch
(
DmpProjectEngineParamBatch
dmpProjectEngineParamBatch
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpProjectEngineParamBatch
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
List
<
DmpProjectEngineParam
>
dmpProjectEngineParams
=
dmpProjectEngineParamBatch
.
getDmpProjectEngineParams
();
if
(
CollectionUtils
.
isEmpty
(
dmpProjectEngineParams
))
{
baseBeanResponse
.
setCode
(
StatuConstant
.
FAILURE_CODE
);
baseBeanResponse
.
setMessage
(
"数据不能为空!"
);
return
baseBeanResponse
;
}
dmpProjectEngineParams
=
dmpProjectEngineParams
.
stream
().
map
(
dmpProjectEngineParam
->
{
/*$*setProjectParamIdCodeReplace*$*/
// 创建人
try
{
dmpProjectEngineParam
.
setCreateUserId
(
getHttpRequestUserId
(
httpRequest
));
}
catch
(
Exception
e
)
{
logger
.
info
(
e
.
getMessage
());
e
.
printStackTrace
();
}
// 创建时间
dmpProjectEngineParam
.
setCreateTime
(
new
Date
());
return
dmpProjectEngineParam
;
}).
collect
(
Collectors
.
toList
());
dmpProjectEngineParamMapper
.
insertBatch
(
dmpProjectEngineParams
);
baseBeanResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseBeanResponse
.
setMessage
(
"批量新增成功"
);
baseBeanResponse
.
setData
(
dmpProjectEngineParamBatch
);
return
baseBeanResponse
;
}
/**
*批量删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
deleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectEngineParamMapper
.
deleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"删除成功"
);
return
baseResponse
;
}
/**
*批量软删除
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
softDeleteByIds
(
List
<
Integer
>
idList
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseResponse
baseResponse
=
new
BaseResponse
();
dmpProjectEngineParamMapper
.
softDeleteByIds
(
idList
);
baseResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
baseResponse
.
setMessage
(
"软删除成功"
);
return
baseResponse
;
}
}
src/main/java/com/jz/dmp/modules/service/projconfig/impl/DmpPublicConfigInfoServiceImpl.java
0 → 100644
View file @
bc4fcb94
package
com
.
jz
.
dmp
.
modules
.
service
.
projconfig
.
impl
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.bean.BaseBeanResponse
;
import
com.jz.common.bean.BaseResponse
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.constant.StatuConstant
;
import
com.jz.common.persistence.BaseService
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoBatch
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoDto
;
import
com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoRequest
;
import
com.jz.dmp.modules.dao.projconfig.DmpComputEngineParamMapper
;
import
com.jz.dmp.modules.dao.projconfig.DmpPublicConfigInfoMapper
;
import
com.jz.dmp.modules.model.DmpComputEngineParam
;
import
com.jz.dmp.modules.model.DmpPublicConfigInfo
;
import
com.jz.dmp.modules.service.projconfig.DmpComputEngineParamService
;
import
com.jz.dmp.modules.service.projconfig.DmpPublicConfigInfoService
;
/**
* 公共配置表服务的实现?
*
* @author ybz
*
*/
@Service
(
"dmpPublicConfigInfoService"
)
public
class
DmpPublicConfigInfoServiceImpl
extends
BaseService
implements
DmpPublicConfigInfoService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DmpPublicConfigInfoServiceImpl
.
class
);
@Autowired
private
DmpPublicConfigInfoMapper
dmpPublicConfigInfoMapper
;
@Autowired
private
DmpComputEngineParamMapper
dmpComputEngineParamMapper
;
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpPublicConfigInfoService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpPublicConfigInfoRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
PageInfoResponse
<
DmpPublicConfigInfoDto
>
findListWithPage
(
DmpPublicConfigInfoRequest
dmpPublicConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
PageInfoResponse
<
DmpPublicConfigInfoDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpPublicConfigInfoRequest
.
getPublicConfigId
()
!=
null
)
{
param
.
put
(
"publicConfigId"
,
dmpPublicConfigInfoRequest
.
getPublicConfigId
());
}
//是否启动kerberos(单选按钮)(0:不启用,1,启用)
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosIsenable
()))
{
param
.
put
(
"kerberosIsenable"
,
dmpPublicConfigInfoRequest
.
getKerberosIsenable
());
}
//jaas默认Client名称
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosJaasClientName
()))
{
param
.
put
(
"kerberosJaasClientName"
,
dmpPublicConfigInfoRequest
.
getKerberosJaasClientName
());
}
//krb5地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosKrb5Conf
()))
{
param
.
put
(
"kerberosKrb5Conf"
,
dmpPublicConfigInfoRequest
.
getKerberosKrb5Conf
());
}
//jaas地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosJaasConf
()))
{
param
.
put
(
"kerberosJaasConf"
,
dmpPublicConfigInfoRequest
.
getKerberosJaasConf
());
}
//FQDN
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosFqdn
()))
{
param
.
put
(
"kerberosFqdn"
,
dmpPublicConfigInfoRequest
.
getKerberosFqdn
());
}
//keytab地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosKeytabConf
()))
{
param
.
put
(
"kerberosKeytabConf"
,
dmpPublicConfigInfoRequest
.
getKerberosKeytabConf
());
}
//keytab用户
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosKeytabUser
()))
{
param
.
put
(
"kerberosKeytabUser"
,
dmpPublicConfigInfoRequest
.
getKerberosKeytabUser
());
}
//spark专用jaas
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosSparkJaasConf
()))
{
param
.
put
(
"kerberosSparkJaasConf"
,
dmpPublicConfigInfoRequest
.
getKerberosSparkJaasConf
());
}
//提交 XML默认defaultFS
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getHdfsHttpPath
()))
{
param
.
put
(
"hdfsHttpPath"
,
dmpPublicConfigInfoRequest
.
getHdfsHttpPath
());
}
//提交XML到HDFS路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getHdfsSyncingPath
()))
{
param
.
put
(
"hdfsSyncingPath"
,
dmpPublicConfigInfoRequest
.
getHdfsSyncingPath
());
}
//Hadoop 用户名
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getHdfsUserName
()))
{
param
.
put
(
"hdfsUserName"
,
dmpPublicConfigInfoRequest
.
getHdfsUserName
());
}
//Kafka connector url
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKafkaConectorUrl
()))
{
param
.
put
(
"kafkaConectorUrl"
,
dmpPublicConfigInfoRequest
.
getKafkaConectorUrl
());
}
//schema register url
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKafkaSchemaRegisterUrl
()))
{
param
.
put
(
"kafkaSchemaRegisterUrl"
,
dmpPublicConfigInfoRequest
.
getKafkaSchemaRegisterUrl
());
}
//kafka bootstarp servers
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKafkaBootstrapServers
()))
{
param
.
put
(
"kafkaBootstrapServers"
,
dmpPublicConfigInfoRequest
.
getKafkaBootstrapServers
());
}
//执行shell任务命令
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellExec
()))
{
param
.
put
(
"azkabanExectorShellExec"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellExec
());
}
//执行impala sql任务命令
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorSqlExec
()))
{
param
.
put
(
"azkabanExectorSqlExec"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorSqlExec
());
}
//执行数据同步任务命令
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorXmlExec
()))
{
param
.
put
(
"azkabanExectorXmlExec"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorXmlExec
());
}
//调度执行sql路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorSqlPath
()))
{
param
.
put
(
"azkabanExectorSqlPath"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorSqlPath
());
}
//调度执行shell路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellPath
()))
{
param
.
put
(
"azkabanExectorShellPath"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellPath
());
}
//task配置文件路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanLocalTaskFilePath
()))
{
param
.
put
(
"azkabanLocalTaskFilePath"
,
dmpPublicConfigInfoRequest
.
getAzkabanLocalTaskFilePath
());
}
//执行数据导出任务命令的shell路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellExportData
()))
{
param
.
put
(
"azkabanExectorShellExportData"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellExportData
());
}
//调度web服务地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanMonitorUrl
()))
{
param
.
put
(
"azkabanMonitorUrl"
,
dmpPublicConfigInfoRequest
.
getAzkabanMonitorUrl
());
}
//元数据服务web地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAtlasMonitorUrl
()))
{
param
.
put
(
"atlasMonitorUrl"
,
dmpPublicConfigInfoRequest
.
getAtlasMonitorUrl
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpPublicConfigInfoRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpPublicConfigInfoRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpPublicConfigInfoRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpPublicConfigInfoRequest
.
getCreateUserId
());
}
//创建时间起
if
(
dmpPublicConfigInfoRequest
.
getCreateTimeStart
()
!=
null
)
{
param
.
put
(
"createTimeStart"
,
dmpPublicConfigInfoRequest
.
getCreateTimeStart
());
}
//创建时间止
if
(
dmpPublicConfigInfoRequest
.
getCreateTimeEnd
()
!=
null
)
{
param
.
put
(
"createTimeEnd"
,
dmpPublicConfigInfoRequest
.
getCreateTimeEnd
());
}
//修改用户ID
if
(
dmpPublicConfigInfoRequest
.
getUpdateUserId
()
!=
null
)
{
param
.
put
(
"updateUserId"
,
dmpPublicConfigInfoRequest
.
getUpdateUserId
());
}
//修改时间起
if
(
dmpPublicConfigInfoRequest
.
getUpdateTimeStart
()
!=
null
)
{
param
.
put
(
"updateTimeStart"
,
dmpPublicConfigInfoRequest
.
getUpdateTimeStart
());
}
//修改时间止
if
(
dmpPublicConfigInfoRequest
.
getUpdateTimeEnd
()
!=
null
)
{
param
.
put
(
"updateTimeEnd"
,
dmpPublicConfigInfoRequest
.
getUpdateTimeEnd
());
}
PageHelper
.
startPage
(
dmpPublicConfigInfoRequest
.
getPageNum
(),
dmpPublicConfigInfoRequest
.
getPageSize
());
List
<
DmpPublicConfigInfoDto
>
list
=
dmpPublicConfigInfoMapper
.
findList
(
param
);
PageInfo
<
DmpPublicConfigInfoDto
>
pageInfo
=
new
PageInfo
<>(
list
);
pageInfoResponse
.
setCode
(
StatuConstant
.
SUCCESS_CODE
);
pageInfoResponse
.
setMessage
(
"查询成功"
);
pageInfoResponse
.
setData
(
pageInfo
);
return
pageInfoResponse
;
}
/*
* (non-Javadoc)
*
* @see
* com.ycxc.vmts.service.DmpPublicConfigInfoService#findList(com.ycxc.vmts.controller.bas.
* bean.DmpPublicConfigInfoRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public
BaseBeanResponse
<
DmpPublicConfigInfoDto
>
findList
(
DmpPublicConfigInfoRequest
dmpPublicConfigInfoRequest
,
HttpServletRequest
httpRequest
)
throws
Exception
{
BaseBeanResponse
<
DmpPublicConfigInfoDto
>
baseBeanResponse
=
new
BaseBeanResponse
<>();
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
//主键
if
(
dmpPublicConfigInfoRequest
.
getPublicConfigId
()
!=
null
)
{
param
.
put
(
"publicConfigId"
,
dmpPublicConfigInfoRequest
.
getPublicConfigId
());
}
//是否启动kerberos(单选按钮)(0:不启用,1,启用)
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosIsenable
()))
{
param
.
put
(
"kerberosIsenable"
,
dmpPublicConfigInfoRequest
.
getKerberosIsenable
());
}
//jaas默认Client名称
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosJaasClientName
()))
{
param
.
put
(
"kerberosJaasClientName"
,
dmpPublicConfigInfoRequest
.
getKerberosJaasClientName
());
}
//krb5地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosKrb5Conf
()))
{
param
.
put
(
"kerberosKrb5Conf"
,
dmpPublicConfigInfoRequest
.
getKerberosKrb5Conf
());
}
//jaas地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosJaasConf
()))
{
param
.
put
(
"kerberosJaasConf"
,
dmpPublicConfigInfoRequest
.
getKerberosJaasConf
());
}
//FQDN
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosFqdn
()))
{
param
.
put
(
"kerberosFqdn"
,
dmpPublicConfigInfoRequest
.
getKerberosFqdn
());
}
//keytab地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosKeytabConf
()))
{
param
.
put
(
"kerberosKeytabConf"
,
dmpPublicConfigInfoRequest
.
getKerberosKeytabConf
());
}
//keytab用户
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosKeytabUser
()))
{
param
.
put
(
"kerberosKeytabUser"
,
dmpPublicConfigInfoRequest
.
getKerberosKeytabUser
());
}
//spark专用jaas
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKerberosSparkJaasConf
()))
{
param
.
put
(
"kerberosSparkJaasConf"
,
dmpPublicConfigInfoRequest
.
getKerberosSparkJaasConf
());
}
//提交 XML默认defaultFS
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getHdfsHttpPath
()))
{
param
.
put
(
"hdfsHttpPath"
,
dmpPublicConfigInfoRequest
.
getHdfsHttpPath
());
}
//提交XML到HDFS路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getHdfsSyncingPath
()))
{
param
.
put
(
"hdfsSyncingPath"
,
dmpPublicConfigInfoRequest
.
getHdfsSyncingPath
());
}
//Hadoop 用户名
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getHdfsUserName
()))
{
param
.
put
(
"hdfsUserName"
,
dmpPublicConfigInfoRequest
.
getHdfsUserName
());
}
//Kafka connector url
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKafkaConectorUrl
()))
{
param
.
put
(
"kafkaConectorUrl"
,
dmpPublicConfigInfoRequest
.
getKafkaConectorUrl
());
}
//schema register url
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKafkaSchemaRegisterUrl
()))
{
param
.
put
(
"kafkaSchemaRegisterUrl"
,
dmpPublicConfigInfoRequest
.
getKafkaSchemaRegisterUrl
());
}
//kafka bootstarp servers
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getKafkaBootstrapServers
()))
{
param
.
put
(
"kafkaBootstrapServers"
,
dmpPublicConfigInfoRequest
.
getKafkaBootstrapServers
());
}
//执行shell任务命令
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellExec
()))
{
param
.
put
(
"azkabanExectorShellExec"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellExec
());
}
//执行impala sql任务命令
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorSqlExec
()))
{
param
.
put
(
"azkabanExectorSqlExec"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorSqlExec
());
}
//执行数据同步任务命令
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorXmlExec
()))
{
param
.
put
(
"azkabanExectorXmlExec"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorXmlExec
());
}
//调度执行sql路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorSqlPath
()))
{
param
.
put
(
"azkabanExectorSqlPath"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorSqlPath
());
}
//调度执行shell路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellPath
()))
{
param
.
put
(
"azkabanExectorShellPath"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellPath
());
}
//task配置文件路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanLocalTaskFilePath
()))
{
param
.
put
(
"azkabanLocalTaskFilePath"
,
dmpPublicConfigInfoRequest
.
getAzkabanLocalTaskFilePath
());
}
//执行数据导出任务命令的shell路径
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellExportData
()))
{
param
.
put
(
"azkabanExectorShellExportData"
,
dmpPublicConfigInfoRequest
.
getAzkabanExectorShellExportData
());
}
//调度web服务地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAzkabanMonitorUrl
()))
{
param
.
put
(
"azkabanMonitorUrl"
,
dmpPublicConfigInfoRequest
.
getAzkabanMonitorUrl
());
}
//元数据服务web地址
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getAtlasMonitorUrl
()))
{
param
.
put
(
"atlasMonitorUrl"
,
dmpPublicConfigInfoRequest
.
getAtlasMonitorUrl
());
}
//备注
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getRemark
()))
{
param
.
put
(
"remark"
,
dmpPublicConfigInfoRequest
.
getRemark
());
}
//数据状态(0:删除,1,未删除)
if
(!
StringUtils
.
isEmpty
(
dmpPublicConfigInfoRequest
.
getDataStatus
()))
{
param
.
put
(
"dataStatus"
,
dmpPublicConfigInfoRequest
.
getDataStatus
());
}
//创建用户ID
if
(
dmpPublicConfigInfoRequest
.
getCreateUserId
()
!=
null
)
{
param
.
put
(
"createUserId"
,
dmpPublicConfigInfoRequest
.
getCreateUserId
());
}
//创建时间起