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
a0a5dc3b
Commit
a0a5dc3b
authored
Oct 25, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-10-24 验证项目立项客户已使用过的客户不能删除
parent
5b7fd38e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
ServiceHGPZ002.java
.../java/com/baosight/hggp/hg/pz/service/ServiceHGPZ002.java
+12
-9
HGSC001.xml
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC001.xml
+4
-0
No files found.
src/main/java/com/baosight/hggp/hg/pz/service/ServiceHGPZ002.java
View file @
a0a5dc3b
...
...
@@ -8,6 +8,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.cw.domain.HGCW002
;
import
com.baosight.hggp.hg.pz.domain.HGPZ002
;
import
com.baosight.hggp.hg.sc.domain.HGSC001
;
import
com.baosight.hggp.hg.xs.tools.HGXSTools
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.CommonMethod
;
...
...
@@ -205,7 +206,7 @@ public class ServiceHGPZ002 extends ServiceBase {
try
{
List
<
Map
>
resultRows
=
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
();
List
<
String
>
custCodes
=
resultRows
.
stream
().
map
(
row
->
row
.
get
(
HGPZ002
.
FIELD_CUST_CODE
).
toString
()).
collect
(
Collectors
.
toList
());
List
<
HG
CW002
>
hgcw002
List
=
queryCustCode
(
custCodes
);
List
<
HG
SC001
>
hgsc001
List
=
queryCustCode
(
custCodes
);
for
(
Map
resultRow
:
resultRows
)
{
HGPZ002
hgpz002
=
new
HGPZ002
();
hgpz002
.
fromMap
(
resultRow
);
...
...
@@ -214,26 +215,28 @@ public class ServiceHGPZ002 extends ServiceBase {
if
(
count
>
0
)
{
//throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgpz002.getAccountName()));
}
List
<
HGCW002
>
hgcw002s
=
hgcw002List
.
stream
().
filter
(
hgcw002
->
hgcw002
.
getPartyA
().
equals
(
hgpz002
.
getCustCode
())).
collect
(
Collectors
.
toList
());
AssertUtils
.
isNotEmpty
(
hgcw002s
,
String
.
format
(
"客户[%s]已关联业务,请先解除业务"
,
hgpz002
.
getCustName
()));
List
<
HGSC001
>
hgcw002s
=
hgsc001List
.
stream
().
filter
(
hgsc001
->
hgsc001
.
getSubcontractCode
().
equals
(
hgpz002
.
getCustCode
())||
hgsc001
.
getGenralContractCode
().
equals
(
hgpz002
.
getCustCode
())
).
collect
(
Collectors
.
toList
());
AssertUtils
.
isNotEmpty
(
hgcw002s
,
String
.
format
(
"客户[%s]已关联业务,无法删除"
,
hgpz002
.
getCustName
()));
DaoUtils
.
update
(
HGPZ002
.
DELETE
,
hgpz002
);
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
resultRows
.
size
()
+
"]条数据删除成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"
修改
失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"
删除
失败"
);
}
return
inInfo
;
}
public
List
<
HG
CW002
>
queryCustCode
(
List
<
String
>
custCodes
){
public
List
<
HG
SC001
>
queryCustCode
(
List
<
String
>
custCodes
){
List
<
HG
CW002
>
hgcw002List
=
DaoBase
.
getInstance
().
query
(
HGCW002
.
QUERY
,
List
<
HG
SC001
>
hgsc001List
=
DaoBase
.
getInstance
().
query
(
HGSC001
.
QUERY
,
new
HashMap
<
String
,
Object
>(){{
put
(
"partyA"
,
custCodes
);
put
(
"partyB"
,
custCodes
);
put
(
"custCodes"
,
custCodes
);
}});
return
hg
cw002
List
;
return
hg
sc001
List
;
}
}
src/main/java/com/baosight/hggp/hg/sc/sql/HGSC001.xml
View file @
a0a5dc3b
...
...
@@ -122,6 +122,10 @@
<isNotEmpty
prepend=
" AND "
property=
"branchUnit"
>
branch_unit = #branchUnit#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"custCodes"
>
(subcontract_code in
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"custCodes"
>
#custCodes[]#
</iterate>
or genral_contract_code in
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"custCodes"
>
#custCodes[]#
</iterate>
)
</isNotEmpty>
</sql>
<sql
id=
"customCondition"
>
...
...
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