Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rop-dj-staff
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1b0e7b09
authored
Jan 29, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提成参数非空判断
1 parent
1478b8a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
src/main/java/cn/com/glsx/dj/staff/service/performance/PerformanceConfigService.java
src/main/java/cn/com/glsx/dj/staff/service/performance/PerformanceConfigService.java
View file @
1b0e7b0
...
@@ -9,6 +9,7 @@ import cn.com.glsx.dj.staff.util.CommonUtil;
...
@@ -9,6 +9,7 @@ import cn.com.glsx.dj.staff.util.CommonUtil;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -26,8 +27,12 @@ public class PerformanceConfigService {
...
@@ -26,8 +27,12 @@ public class PerformanceConfigService {
log
.
error
(
"参数错误, 参数为空."
);
log
.
error
(
"参数错误, 参数为空."
);
return
RopResponse
.
error
(
RopErrorEnum
.
PERFORMANCE_SCHEME_REQUIREMENT_PARAM_ERROR
);
return
RopResponse
.
error
(
RopErrorEnum
.
PERFORMANCE_SCHEME_REQUIREMENT_PARAM_ERROR
);
}
}
PerformanceConfigDTO
performanceConfig
=
CommonUtil
.
convertRequest
(
PerformanceConfigDTO
.
class
);
PerformanceConfigDTO
performanceConfig
=
CommonUtil
.
convertRequest
(
PerformanceConfigDTO
.
class
);
if
(!
check
(
performanceConfig
))
{
log
.
error
(
"参数错误, 参数为空."
);
return
RopResponse
.
error
(
RopErrorEnum
.
PERFORMANCE_SCHEME_REQUIREMENT_PARAM_ERROR
);
};
// 名称不能重复, 除非id相同
// 名称不能重复, 除非id相同
RpcResponse
<
PerformanceConfigDTO
>
performanceConfigDTORpcResponse
=
performanceConfigRemote
.
selectByName
(
performanceConfig
);
RpcResponse
<
PerformanceConfigDTO
>
performanceConfigDTORpcResponse
=
performanceConfigRemote
.
selectByName
(
performanceConfig
);
PerformanceConfigDTO
result
=
performanceConfigDTORpcResponse
.
getResult
();
PerformanceConfigDTO
result
=
performanceConfigDTORpcResponse
.
getResult
();
...
@@ -40,7 +45,7 @@ public class PerformanceConfigService {
...
@@ -40,7 +45,7 @@ public class PerformanceConfigService {
performanceConfig
.
setEnableFlag
(
"N"
);
performanceConfig
.
setEnableFlag
(
"N"
);
List
<
PerformanceParamConfigDTO
>
performanceParamConfigList
=
request
.
getParamConfigList
();
List
<
PerformanceParamConfigDTO
>
performanceParamConfigList
=
request
.
getParamConfigList
();
if
(
performanceParamConfigList
==
null
)
{
if
(
performanceParamConfigList
==
null
)
{
performanceParamConfigList
=
new
ArrayList
<>(
);
return
RopResponse
.
error
(
RopErrorEnum
.
PERFORMANCE_SCHEME_REQUIREMENT_PARAM_ERROR
,
"提成参数为空,错误。"
);
}
}
// 一个考核因子最多有十个不同的产品,或者套餐,如果选择了全部产品,则不能选择商品分类
// 一个考核因子最多有十个不同的产品,或者套餐,如果选择了全部产品,则不能选择商品分类
PerformanceConfigRuleDTO
performanceConfigRule
=
request
.
getPerformanceConfigRule
();
PerformanceConfigRuleDTO
performanceConfigRule
=
request
.
getPerformanceConfigRule
();
...
@@ -118,6 +123,47 @@ public class PerformanceConfigService {
...
@@ -118,6 +123,47 @@ public class PerformanceConfigService {
return
RopResponse
.
success
(
performanceConfigRemote
.
performanceConfigSave
(
performanceConfig
).
getResult
());
return
RopResponse
.
success
(
performanceConfigRemote
.
performanceConfigSave
(
performanceConfig
).
getResult
());
}
}
private
boolean
check
(
PerformanceConfigDTO
performanceConfig
)
{
if
(
performanceConfig
==
null
)
{
log
.
info
(
" 方案为空,错误。"
);
return
false
;
}
if
(
performanceConfig
.
getSchemeName
()
==
null
)
{
log
.
info
(
" 方案名称为空,错误。"
);
return
false
;
}
if
(
performanceConfig
.
getSchemeType
()
==
null
)
{
log
.
info
(
" 方案类型为空,错误。"
);
return
false
;
}
if
(
StringUtils
.
isBlank
(
performanceConfig
.
getEffectiveMonth
()))
{
log
.
info
(
" 生效月份为空,错误。"
);
return
false
;
}
PerformanceConfigRuleDTO
performanceConfigRule
=
performanceConfig
.
getPerformanceConfigRule
();
if
(
performanceConfigRule
==
null
)
{
log
.
info
(
" 提成方案配置为空,错误。"
);
return
false
;
}
if
(
StringUtils
.
isBlank
(
performanceConfigRule
.
getAssessmentFactors
()))
{
log
.
info
(
" 考核因子为空,错误。"
);
return
false
;
}
if
(
StringUtils
.
isBlank
(
performanceConfigRule
.
getCommissionBases
()))
{
log
.
info
(
" 提成基数为空,错误。"
);
return
false
;
}
if
(
StringUtils
.
isBlank
(
performanceConfigRule
.
getCommissionTypes
()))
{
log
.
info
(
" 提成方式为空,错误。"
);
return
false
;
}
if
(
StringUtils
.
isBlank
(
performanceConfigRule
.
getGoodsConfigTypes
()))
{
log
.
info
(
" 商品配置方式为空,错误。"
);
return
false
;
}
return
true
;
}
/**
/**
* 检测考核因子配置的数量是否符合规定
* 检测考核因子配置的数量是否符合规定
*/
*/
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment