Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
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
zhangkb
indicators
Commits
0e9ac1fa
Commit
0e9ac1fa
authored
Feb 26, 2021
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交审核时要判重
parent
7df581b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
30 deletions
+45
-30
IndicatorsDefAuditService.java
...dicators/service/hytobacco/IndicatorsDefAuditService.java
+45
-30
No files found.
src/main/java/com/keymobile/indicators/service/hytobacco/IndicatorsDefAuditService.java
View file @
0e9ac1fa
...
...
@@ -39,37 +39,18 @@ public class IndicatorsDefAuditService {
@Autowired
private
BaseIndDefRecordMapper
baseIndDefRecordMapper
;
public
Result
addAplay
(
BaseIndDefAudit
baseIndDefAudit
)
{
List
<
BaseIndDef
>
baseIndDefs
=
baseIndDefMapper
.
selectByCatalogIdAndIndName
(
baseIndDefAudit
.
getCatalogId
(),
baseIndDefAudit
.
getIndName
());
if
(
baseIndDefs
!=
null
&&
baseIndDefs
.
size
()>
0
){
return
Result
.
genFailedResult
(
"数据项名称已存在,操作失败!!"
);
}
else
{
List
<
BaseIndDefAudit
>
baseIndDefAudits
=
indicatorsDefAuditMapper
.
selectByCatalogIdAndIndName
(
baseIndDefAudit
.
getCatalogId
(),
baseIndDefAudit
.
getIndName
());
if
(
baseIndDefAudits
!=
null
&&
baseIndDefAudits
.
size
()>
0
){
return
Result
.
genFailedResult
(
"数据项名称已存在,操作失败!!"
);
}
}
//判断公式合法性
if
(
StringUtils
.
isNotBlank
(
baseIndDefAudit
.
getIndFormat
())
&&
!
CalculateUtils
.
isValidformula
(
baseIndDefAudit
.
getIndFormat
()))
{
return
Result
.
genFailedResult
(
"公式校验不合法"
);
}
if
(
StringUtils
.
isBlank
(
baseIndDefAudit
.
getIndId
()))
{
return
Result
.
genFailedResult
(
"数据项编号不能为空"
);
}
BaseIndDef
dbBaseIndDef
=
baseIndDefMapper
.
selectByPrimaryKey
(
baseIndDefAudit
.
getIndId
());
if
(
dbBaseIndDef
!=
null
)
{
return
Result
.
genFailedResult
(
"数据项编号已存在,操作失败"
);
Result
result
=
this
.
checkData
(
baseIndDefAudit
);
if
(
result
.
isSuccess
()){
Date
date
=
new
Date
();
String
currentUser
=
SystemUserUtil
.
getCurrentUser
();
baseIndDefAudit
.
setCreateTime
(
date
);
baseIndDefAudit
.
setUpdateTime
(
date
);
baseIndDefAudit
.
setUpdater
(
currentUser
);
baseIndDefAudit
.
setCreater
(
currentUser
);
indicatorsDefAuditMapper
.
insert
(
baseIndDefAudit
);
log
.
info
(
"{}提交了申请,{}"
,
currentUser
,
baseIndDefAudit
);
}
Date
date
=
new
Date
();
String
currentUser
=
SystemUserUtil
.
getCurrentUser
();
baseIndDefAudit
.
setCreateTime
(
date
);
baseIndDefAudit
.
setUpdateTime
(
date
);
baseIndDefAudit
.
setUpdater
(
currentUser
);
baseIndDefAudit
.
setCreater
(
currentUser
);
indicatorsDefAuditMapper
.
insert
(
baseIndDefAudit
);
log
.
info
(
"{}提交了申请,{}"
,
currentUser
,
baseIndDefAudit
);
return
Result
.
genOkResult
();
return
result
;
}
/**
...
...
@@ -99,6 +80,14 @@ public class IndicatorsDefAuditService {
//审核数据---当审核通过时录入结果表
public
Result
auditData
(
String
indId
,
Integer
status
,
String
msg
)
{
if
(
status
==
2
){
//判重
BaseIndDefAudit
baseIndDefAudit1
=
indicatorsDefAuditMapper
.
selectByPrimaryKey
(
indId
);
Result
result
=
this
.
checkData
(
baseIndDefAudit1
);
if
(!
result
.
isSuccess
()){
return
result
;
}
}
BaseIndDefAudit
baseIndDefAudit
=
new
BaseIndDefAudit
();
Date
date
=
new
Date
();
String
currentUser
=
SystemUserUtil
.
getCurrentUser
();
...
...
@@ -152,4 +141,30 @@ public class IndicatorsDefAuditService {
indicatorsDefAuditMapper
.
deleteByPrimaryKey
(
indId
);
return
Result
.
genOkResult
();
}
private
Result
checkData
(
BaseIndDefAudit
baseIndDefAudit
){
List
<
BaseIndDef
>
baseIndDefs
=
baseIndDefMapper
.
selectByCatalogIdAndIndName
(
baseIndDefAudit
.
getCatalogId
(),
baseIndDefAudit
.
getIndName
());
if
(
baseIndDefs
!=
null
&&
baseIndDefs
.
size
()>
0
){
return
Result
.
genFailedResult
(
"数据项名称已存在,操作失败!!"
);
}
else
{
List
<
BaseIndDefAudit
>
baseIndDefAudits
=
indicatorsDefAuditMapper
.
selectByCatalogIdAndIndName
(
baseIndDefAudit
.
getCatalogId
(),
baseIndDefAudit
.
getIndName
());
if
(
baseIndDefAudits
!=
null
&&
baseIndDefAudits
.
size
()>
0
){
return
Result
.
genFailedResult
(
"数据项名称已存在,操作失败!!"
);
}
}
//判断公式合法性
if
(
StringUtils
.
isNotBlank
(
baseIndDefAudit
.
getIndFormat
())
&&
!
CalculateUtils
.
isValidformula
(
baseIndDefAudit
.
getIndFormat
()))
{
return
Result
.
genFailedResult
(
"公式校验不合法"
);
}
if
(
StringUtils
.
isBlank
(
baseIndDefAudit
.
getIndId
()))
{
return
Result
.
genFailedResult
(
"数据项编号不能为空"
);
}
BaseIndDef
dbBaseIndDef
=
baseIndDefMapper
.
selectByPrimaryKey
(
baseIndDefAudit
.
getIndId
());
if
(
dbBaseIndDef
!=
null
)
{
return
Result
.
genFailedResult
(
"数据项编号已存在,操作失败"
);
}
return
Result
.
genOkResult
();
}
}
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