Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
Details
Activity
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
base_platform_enterprise
gic-platform-enterprise
Commits
a655e018
Commit
a655e018
authored
Mar 04, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平台规则详情接口添加
parent
73782f69
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
247 additions
and
0 deletions
+247
-0
ConfigRuleDTO.java
.../main/java/com/gic/enterprise/dto/rule/ConfigRuleDTO.java
+87
-0
ConfigRuleApiService.java
...java/com/gic/enterprise/service/ConfigRuleApiService.java
+11
-0
ConfigRuleApiServiceImpl.java
...terprise/service/outer/impl/ConfigRuleApiServiceImpl.java
+12
-0
ConfigRuleController.java
...om/gic/operation/web/controller/ConfigRuleController.java
+36
-0
RuleClassifySceneVO.java
.../gic/operation/web/vo/configrule/RuleClassifySceneVO.java
+39
-0
RuleClassifyVO.java
...a/com/gic/operation/web/vo/configrule/RuleClassifyVO.java
+34
-0
RuleVO.java
...main/java/com/gic/operation/web/vo/configrule/RuleVO.java
+28
-0
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/rule/ConfigRuleDTO.java
0 → 100644
View file @
a655e018
package
com
.
gic
.
enterprise
.
dto
.
rule
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
@Accessors
(
chain
=
true
)
@Data
public
class
ConfigRuleDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2992133298716031459L
;
/**
*
*/
private
Integer
ruleId
;
/**
* 规则/分类/场景名称(场景名称是冗余数据)
*/
private
String
name
;
/**
* 规则类型:应用名称
*/
private
String
appName
;
/**
* 规则类型:应用code
*/
private
String
appCode
;
/**
* 分类类型:icon
*/
private
String
classifyIcon
;
/**
* 分类/场景描述
*/
private
String
desc
;
/**
* 分类/场景备注
*/
private
String
remark
;
/**
* 营销场景ID/code
*/
private
String
marketScene
;
/**
* 营销对象 1:会员卡域 2:服务号域 3:小程序域
*/
private
Integer
marketObject
;
/**
* 父级id
*/
private
Integer
parentRuleId
;
/**
* 层级:1:规则 2:分类 3:场景
*/
private
Integer
ruleLevel
;
/**
* 规则链id:_2_3_格式数据
*/
private
String
ruleChain
;
/**
* 状态值 1:有效 0:无效
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/ConfigRuleApiService.java
View file @
a655e018
...
...
@@ -2,6 +2,7 @@ package com.gic.enterprise.service;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.enterprise.dto.rule.ConfigRuleDTO
;
import
com.gic.enterprise.dto.rule.RuleClassifyDTO
;
import
com.gic.enterprise.dto.rule.RuleClassifySceneDTO
;
import
com.gic.enterprise.dto.rule.RuleDTO
;
...
...
@@ -86,4 +87,14 @@ public interface ConfigRuleApiService {
ServiceResponse
<
String
>
deleteRule
(
Integer
ruleId
);
ServiceResponse
<
String
>
deleteRuleClassify
(
Integer
ruleId
);
ServiceResponse
<
String
>
deleteRuleClassifyScene
(
Integer
ruleId
);
/**
* 查询详情
* @Title: getDetailByRuleId
* @Description:
* @author guojuxing
* @param ruleId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.enterprise.dto.rule.ConfigRuleDTO>
*/
ServiceResponse
<
ConfigRuleDTO
>
getDetailByRuleId
(
Integer
ruleId
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/ConfigRuleApiServiceImpl.java
View file @
a655e018
...
...
@@ -3,6 +3,7 @@ package com.gic.enterprise.service.outer.impl;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.dto.rule.ConfigRuleDTO
;
import
com.gic.enterprise.dto.rule.RuleClassifyDTO
;
import
com.gic.enterprise.dto.rule.RuleClassifySceneDTO
;
import
com.gic.enterprise.dto.rule.RuleDTO
;
...
...
@@ -131,6 +132,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
record
.
getRuleLevel
()
!=
2
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"分类ID错误,不是分类类型"
);
}
dto
.
setParentRuleId
(
record
.
getParentRuleId
());
ServiceResponse
valid
=
validRuleClassify
(
dto
);
if
(!
valid
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
valid
.
getCode
(),
valid
.
getMessage
());
...
...
@@ -173,6 +175,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
if
(
record
.
getRuleLevel
()
!=
3
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"场景ID错误,不是场景类型"
);
}
dto
.
setParentRuleId
(
record
.
getParentRuleId
());
ServiceResponse
valid
=
validRuleClassifyScene
(
dto
);
if
(!
valid
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
valid
.
getCode
(),
valid
.
getMessage
());
...
...
@@ -232,6 +235,15 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
return
ServiceResponse
.
success
(
record
.
getName
());
}
@Override
public
ServiceResponse
<
ConfigRuleDTO
>
getDetailByRuleId
(
Integer
ruleId
)
{
TabConfigRule
record
=
configRuleService
.
getByRuleId
(
ruleId
);
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"记录不存在"
);
}
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityNew
(
ConfigRuleDTO
.
class
,
record
));
}
private
ServiceResponse
<
Void
>
validRuleClassify
(
RuleClassifyDTO
dto
)
{
TabConfigRule
record
=
configRuleService
.
getByRuleId
(
dto
.
getParentRuleId
());
if
(
record
==
null
)
{
...
...
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/ConfigRuleController.java
View file @
a655e018
...
...
@@ -7,6 +7,9 @@ import com.gic.enterprise.dto.rule.RuleDTO;
import
com.gic.enterprise.service.ConfigRuleApiService
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.operation.web.vo.SceneCategoryVO
;
import
com.gic.operation.web.vo.configrule.RuleClassifySceneVO
;
import
com.gic.operation.web.vo.configrule.RuleClassifyVO
;
import
com.gic.operation.web.vo.configrule.RuleVO
;
import
com.gic.rule.manage.api.service.DealOperationApiService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -40,6 +43,16 @@ public class ConfigRuleController {
return
ResultControllerUtils
.
commonResult
(
configRuleApiService
.
editRule
(
dto
));
}
@RequestMapping
(
"/listRule"
)
public
RestResponse
listRule
(
String
search
)
{
return
ResultControllerUtils
.
commonResult
(
configRuleApiService
.
listRule
(
search
),
RuleVO
.
class
);
}
@RequestMapping
(
"/getRule"
)
public
RestResponse
getRule
(
Integer
ruleId
)
{
return
ResultControllerUtils
.
commonResultOne
(
configRuleApiService
.
getDetailByRuleId
(
ruleId
),
RuleVO
.
class
);
}
@RequestMapping
(
"/saveRuleClassify"
)
public
RestResponse
saveRuleClassify
(
RuleClassifyDTO
dto
)
{
return
ResultControllerUtils
.
commonResult
(
configRuleApiService
.
saveRuleClassify
(
dto
));
...
...
@@ -50,6 +63,17 @@ public class ConfigRuleController {
return
ResultControllerUtils
.
commonResult
(
configRuleApiService
.
editRuleClassify
(
dto
));
}
@RequestMapping
(
"/listRuleClassify"
)
public
RestResponse
listRuleClassify
(
String
search
,
Integer
ruleId
,
Integer
pageNum
,
Integer
pageSize
)
{
return
ResultControllerUtils
.
commonResult
(
configRuleApiService
.
listRuleClassify
(
search
,
ruleId
,
pageNum
,
pageSize
),
RuleClassifyVO
.
class
);
}
@RequestMapping
(
"/getRuleClassify"
)
public
RestResponse
getRuleClassify
(
Integer
ruleId
)
{
return
ResultControllerUtils
.
commonResultOne
(
configRuleApiService
.
getDetailByRuleId
(
ruleId
),
RuleClassifyVO
.
class
);
}
@RequestMapping
(
"/saveRuleClassifyScene"
)
public
RestResponse
saveRuleClassifyScene
(
RuleClassifySceneDTO
dto
)
{
return
ResultControllerUtils
.
commonResult
(
configRuleApiService
.
saveRuleClassifyScene
(
dto
));
...
...
@@ -60,6 +84,18 @@ public class ConfigRuleController {
return
ResultControllerUtils
.
commonResult
(
configRuleApiService
.
editRuleClassifyScene
(
dto
));
}
@RequestMapping
(
"/listRuleClassifyScene"
)
public
RestResponse
listRuleClassifyScene
(
String
search
,
Integer
ruleId
,
Integer
pageNum
,
Integer
pageSize
)
{
return
ResultControllerUtils
.
commonResult
(
configRuleApiService
.
listRuleClassifyScene
(
search
,
ruleId
,
pageNum
,
pageSize
),
RuleClassifySceneVO
.
class
);
}
@RequestMapping
(
"/getRuleClassifyScene"
)
public
RestResponse
getRuleClassifyScene
(
Integer
ruleId
)
{
return
ResultControllerUtils
.
commonResultOne
(
configRuleApiService
.
getDetailByRuleId
(
ruleId
),
RuleClassifySceneVO
.
class
);
}
@RequestMapping
(
"/deleteClassify"
)
public
RestResponse
deleteClassify
(
Integer
ruleId
)
{
return
ResultControllerUtils
.
commonResult
(
configRuleApiService
.
deleteRuleClassify
(
ruleId
));
...
...
gic-platform-operation-web/src/main/java/com/gic/operation/web/vo/configrule/RuleClassifySceneVO.java
0 → 100644
View file @
a655e018
package
com
.
gic
.
operation
.
web
.
vo
.
configrule
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
RuleClassifySceneVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
2503067207037834122L
;
/**
*
*/
private
Integer
ruleId
;
/**
* 规则/分类/场景名称(场景名称是冗余数据)
*/
private
String
name
;
/**
* 分类/场景描述
*/
private
String
desc
;
/**
* 分类/场景备注
*/
private
String
remark
;
/**
* 营销场景ID/code
*/
private
String
marketScene
;
/**
* 营销对象 1:会员卡域 2:服务号域 3:小程序域
*/
private
Integer
marketObject
;
}
gic-platform-operation-web/src/main/java/com/gic/operation/web/vo/configrule/RuleClassifyVO.java
0 → 100644
View file @
a655e018
package
com
.
gic
.
operation
.
web
.
vo
.
configrule
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
RuleClassifyVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3351380808209918035L
;
/**
*
*/
private
Integer
ruleId
;
/**
* 规则/分类/场景名称(场景名称是冗余数据)
*/
private
String
name
;
/**
* 分类类型:icon
*/
private
String
classifyIcon
;
/**
* 分类/场景描述
*/
private
String
desc
;
/**
* 分类/场景备注
*/
private
String
remark
;
}
gic-platform-operation-web/src/main/java/com/gic/operation/web/vo/configrule/RuleVO.java
0 → 100644
View file @
a655e018
package
com
.
gic
.
operation
.
web
.
vo
.
configrule
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
RuleVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5033092463325603541L
;
/**
*
*/
private
Integer
ruleId
;
/**
* 规则/分类/场景名称(场景名称是冗余数据)
*/
private
String
name
;
/**
* 规则类型:应用名称
*/
private
String
appName
;
/**
* 规则类型:应用code
*/
private
String
appCode
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment