Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
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
fulixin
dsk-operate-sys-cscec
Commits
652e35a9
Commit
652e35a9
authored
Dec 19, 2023
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
逻辑优化
parent
e377b95a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
DSubcontractMapper.java
...rc/main/java/com/dsk/cscec/mapper/DSubcontractMapper.java
+5
-0
DCustomerServiceImpl.java
...java/com/dsk/cscec/service/impl/DCustomerServiceImpl.java
+6
-4
DSubcontractMapper.xml
...pi/src/main/resources/mapper/cscec/DSubcontractMapper.xml
+10
-0
No files found.
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/mapper/DSubcontractMapper.java
View file @
652e35a9
...
@@ -3,6 +3,9 @@ package com.dsk.cscec.mapper;
...
@@ -3,6 +3,9 @@ package com.dsk.cscec.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.dsk.cscec.domain.DSubcontract
;
import
com.dsk.cscec.domain.DSubcontract
;
import
com.dsk.cscec.domain.vo.DCustomerListVo
;
import
java.util.Map
;
/**
/**
* 分包分供合同(DSubcontract)表数据库访问层
* 分包分供合同(DSubcontract)表数据库访问层
...
@@ -16,5 +19,7 @@ public interface DSubcontractMapper extends BaseMapper<DSubcontract> {
...
@@ -16,5 +19,7 @@ public interface DSubcontractMapper extends BaseMapper<DSubcontract> {
Integer
selectProjectCountByCustomerId
(
String
customerId
);
Integer
selectProjectCountByCustomerId
(
String
customerId
);
DCustomerListVo
selectStatisticByCustomerId
(
String
customerId
);
}
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/service/impl/DCustomerServiceImpl.java
View file @
652e35a9
...
@@ -45,10 +45,11 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
...
@@ -45,10 +45,11 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
Page
<
DCustomerListVo
>
page
=
baseMapper
.
allSearchList
(
query
.
build
(),
bo
);
Page
<
DCustomerListVo
>
page
=
baseMapper
.
allSearchList
(
query
.
build
(),
bo
);
if
(
CollectionUtils
.
isNotEmpty
(
page
.
getRecords
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
page
.
getRecords
()))
{
page
.
getRecords
().
parallelStream
().
forEach
(
item
->{
page
.
getRecords
().
parallelStream
().
forEach
(
item
->{
DCustomerListVo
vo
=
subcontractMapper
.
selectStatisticByCustomerId
(
item
.
getCustomerId
());
//企业合作数量
//企业合作数量
item
.
setEnterpriseCooperationCount
(
subcontractMapper
.
selectEnterpriseCountByCustomerId
(
item
.
getCustomerId
()
));
item
.
setEnterpriseCooperationCount
(
vo
.
getEnterpriseCooperationCount
(
));
//项目合作数量
//项目合作数量
item
.
setProjectCooperationCount
(
subcontractMapper
.
selectProjectCountByCustomerId
(
item
.
getCustomerId
()
));
item
.
setProjectCooperationCount
(
vo
.
getProjectCooperationCount
(
));
try
{
try
{
Map
<
String
,
Object
>
map
=
opportunityRadarService
.
enterpriseByName
(
item
.
getCustomerName
());
Map
<
String
,
Object
>
map
=
opportunityRadarService
.
enterpriseByName
(
item
.
getCustomerName
());
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"data"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"data"
)))
{
...
@@ -71,10 +72,11 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
...
@@ -71,10 +72,11 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
List
<
DCustomerListVo
>
records
=
baseMapper
.
allSearchList
(
query
.
build
(),
bo
).
getRecords
();
List
<
DCustomerListVo
>
records
=
baseMapper
.
allSearchList
(
query
.
build
(),
bo
).
getRecords
();
if
(
CollectionUtils
.
isNotEmpty
(
records
)){
if
(
CollectionUtils
.
isNotEmpty
(
records
)){
records
.
parallelStream
().
forEach
(
item
->{
records
.
parallelStream
().
forEach
(
item
->{
DCustomerListVo
vo
=
subcontractMapper
.
selectStatisticByCustomerId
(
item
.
getCustomerId
());
//企业合作数量
//企业合作数量
item
.
setEnterpriseCooperationCount
(
subcontractMapper
.
selectEnterpriseCountByCustomerId
(
item
.
getCustomerId
()
));
item
.
setEnterpriseCooperationCount
(
vo
.
getEnterpriseCooperationCount
(
));
//项目合作数量
//项目合作数量
item
.
setProjectCooperationCount
(
subcontractMapper
.
selectProjectCountByCustomerId
(
item
.
getCustomerId
()
));
item
.
setProjectCooperationCount
(
vo
.
getProjectCooperationCount
(
));
});
});
}
}
return
records
;
return
records
;
...
...
dsk-module/dsk-biz-api/src/main/resources/mapper/cscec/DSubcontractMapper.xml
View file @
652e35a9
...
@@ -17,4 +17,14 @@
...
@@ -17,4 +17,14 @@
) a
) a
</select>
</select>
<select
id=
"selectStatisticByCustomerId"
resultType=
"com.dsk.cscec.domain.vo.DCustomerListVo"
>
select
count(DISTINCT org.customer_id) enterpriseCooperationCount,
count(DISTINCT project.customer_id) projectCooperationCount
from d_customer dc
left join d_subcontract org on org.customer_id = dc.customer_id
left join d_subcontract project on project.customer_id = dc.customer_id
where dc.customer_id = #{customerId}
</select>
</mapper>
</mapper>
\ No newline at end of file
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