Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
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
platform
hg-smart
Commits
85dfea34
Commit
85dfea34
authored
Jul 17, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-07-17 业务账期维护重复添加校验优化
parent
06610fdf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
ServiceHGCW001.java
.../java/com/baosight/hggp/hg/cw/service/ServiceHGCW001.java
+0
-7
HGCWTools.java
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
+16
-2
No files found.
src/main/java/com/baosight/hggp/hg/cw/service/ServiceHGCW001.java
View file @
85dfea34
...
...
@@ -97,13 +97,6 @@ public class ServiceHGCW001 extends ServiceBase {
hgcw001
.
setAccountPeriodDateStart
(
DateUtils
.
formatShort
(
hgcw001
.
getAccountPeriodDateStart
()));
hgcw001
.
setAccountPeriodDateEnd
(
DateUtils
.
formatShort
(
hgcw001
.
getAccountPeriodDateEnd
()));
if
(
hgcw001
.
getId
()
==
null
||
hgcw001
.
getId
()
==
0
)
{
Map
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
HGCW001
.
FIELD_COMPANY_CODE
,
hgcw001
.
getCompanyCode
());
paramMap
.
put
(
HGCW001
.
FIELD_ACCOUNT_PERIOD
,
hgcw001
.
getAccountPeriod
());
HGCW001
cw001
=
HGCWTools
.
HgCw001
.
getByCondition
(
paramMap
);
//获取当月业务账期
if
(
cw001
!=
null
)
{
throw
new
PlatException
(
String
.
format
(
"公司[%s]会计期[%s]已存在,保存失败!"
,
hgcw001
.
getCompanyCode
(),
hgcw001
.
getAccountPeriod
()));
}
this
.
add
(
hgcw001
);
}
else
{
this
.
modify
(
hgcw001
);
...
...
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
View file @
85dfea34
package
com
.
baosight
.
hggp
.
hg
.
cw
.
tools
;
import
cn.hutool.core.util.StrUtil
;
import
com.baosight.hggp.common.AccountPeriodStatusEnum
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.cb.domain.HGCB001
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.cw.domain.*
;
import
com.baosight.hggp.hg.cw.vo.UserVO
;
...
...
@@ -69,7 +69,9 @@ public class HGCWTools {
* @param paramMap
* @return
*/
public
static
HGCW001
getByCondition
(
Map
paramMap
){
public
static
HGCW001
getByCondition
(
Map
<
String
,
String
>
paramMap
){
AssertUtils
.
isEmpty
(
paramMap
.
get
(
HGCB001
.
FIELD_COMPANY_CODE
),
"公司不能为空!"
);
AssertUtils
.
isEmpty
(
paramMap
.
get
(
HGCB001
.
FIELD_ACCOUNT_PERIOD
),
"会计期不能为空!"
);
List
<
HGCW001
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW001
.
QUERY
,
paramMap
);
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
.
get
(
0
);
}
...
...
@@ -228,6 +230,18 @@ public class HGCWTools {
}
}
/**
* 检查数据是否重复
* @param hgcw001
*/
public
static
void
checkSaveData
(
HGCW001
hgcw001
){
Map
<
String
,
String
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
HGCW001
.
FIELD_COMPANY_CODE
,
hgcw001
.
getCompanyCode
());
paramMap
.
put
(
HGCW001
.
FIELD_ACCOUNT_PERIOD
,
hgcw001
.
getAccountPeriod
());
HGCW001
cw001
=
getByCondition
(
paramMap
);
//重复校验
AssertUtils
.
isNotNull
(
cw001
,
String
.
format
(
"[%s]会计期[%s]已存在,无法重复添加,保存失败!"
,
hgcw001
.
getCompanyName
(),
hgcw001
.
getAccountPeriod
()));
}
public
static
List
<
HGCW001
>
queryNoAuth
(
Map
paramMap
){
List
<
HGCW001
>
list
=
DaoBase
.
getInstance
().
query
(
HGCW001
.
QUERY_NO_AUTH
,
paramMap
);
return
list
;
...
...
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