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
035c20d7
Commit
035c20d7
authored
Aug 16, 2023
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
20650a06
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
275 additions
and
15 deletions
+275
-15
CustomerOverviewController.java
...k/web/controller/customer/CustomerOverviewController.java
+48
-0
CustomerSearchDto.java
...com/dsk/system/domain/customer/dto/CustomerSearchDto.java
+45
-0
CustomerAnalyzeVo.java
.../com/dsk/system/domain/customer/vo/CustomerAnalyzeVo.java
+39
-0
JskCombineSearchDto.java
...va/com/dsk/system/domain/dsk/dto/JskCombineSearchDto.java
+2
-2
JskCombineInfoService.java
...java/com/dsk/system/dskService/JskCombineInfoService.java
+11
-0
CustomerMapper.java
...m/src/main/java/com/dsk/system/mapper/CustomerMapper.java
+5
-2
ICustomerOverviewService.java
...java/com/dsk/system/service/ICustomerOverviewService.java
+19
-0
CustomerOverviewServiceImpl.java
.../dsk/system/service/impl/CustomerOverviewServiceImpl.java
+53
-0
CustomerMapper.xml
.../main/resources/mapper/system/customer/CustomerMapper.xml
+53
-11
No files found.
dsk-admin/src/main/java/com/dsk/web/controller/customer/CustomerOverviewController.java
0 → 100644
View file @
035c20d7
package
com
.
dsk
.
web
.
controller
.
customer
;
import
com.dsk.common.core.controller.BaseController
;
import
com.dsk.common.core.domain.AjaxResult
;
import
com.dsk.common.utils.SecurityUtils
;
import
com.dsk.system.domain.customer.dto.CustomerSearchDto
;
import
com.dsk.system.service.ICustomerOverviewService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 客户概览
* @author lcl
* @create 2023/8/15
*/
@RestController
@RequestMapping
(
"/customer/overview"
)
public
class
CustomerOverviewController
extends
BaseController
{
@Autowired
private
ICustomerOverviewService
baseService
;
/**
* 客户统计
*/
@GetMapping
(
"/statistics"
)
public
AjaxResult
statistics
(){
return
AjaxResult
.
success
(
baseService
.
statistics
(
new
CustomerSearchDto
()));
}
/**
* 客户合作情况
*/
@GetMapping
(
"/cooperation/top"
)
public
AjaxResult
cooperationTop
(){
return
AjaxResult
.
success
(
baseService
.
cooperationTop
(
new
CustomerSearchDto
()));
}
/**
* 客户信资评级
*/
@GetMapping
(
"/credit/level"
)
public
AjaxResult
creditLevel
(){
return
AjaxResult
.
success
(
baseService
.
cooperationTop
(
new
CustomerSearchDto
()));
}
}
dsk-system/src/main/java/com/dsk/system/domain/customer/dto/CustomerSearchDto.java
View file @
035c20d7
package
com
.
dsk
.
system
.
domain
.
customer
.
dto
;
package
com
.
dsk
.
system
.
domain
.
customer
.
dto
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author lcl
* @author lcl
* @create 2023/5/16
* @create 2023/5/16
*/
*/
@Data
@Data
@NoArgsConstructor
public
class
CustomerSearchDto
implements
Serializable
{
public
class
CustomerSearchDto
implements
Serializable
{
/**
/**
* 企业id
* 企业id
...
@@ -22,6 +27,10 @@ public class CustomerSearchDto implements Serializable {
...
@@ -22,6 +27,10 @@ public class CustomerSearchDto implements Serializable {
* 企业名称
* 企业名称
*/
*/
private
String
companyName
;
private
String
companyName
;
/**
* 企业性质
*/
private
String
companyNature
;
/**
/**
* 客户id
* 客户id
*/
*/
...
@@ -34,5 +43,41 @@ public class CustomerSearchDto implements Serializable {
...
@@ -34,5 +43,41 @@ public class CustomerSearchDto implements Serializable {
* 客户状态 0:正常 1:历史
* 客户状态 0:正常 1:历史
*/
*/
private
Integer
status
;
private
Integer
status
;
/**
* 是否上市 0:否 1:是
*/
private
Integer
isOn
;
/**
* 省id
*/
private
List
<
Integer
>
provinceIds
;
/**
* 市id
*/
private
List
<
Integer
>
cityIds
;
/**
* 区id
*/
private
List
<
Integer
>
districtIds
;
/**
* 企业性质
*/
private
List
<
String
>
companyNatures
;
/**
* 信资等级
*/
private
List
<
String
>
creditLevels
;
/**
* 数据权限
*/
private
Map
<
String
,
Object
>
params
;
public
Map
<
String
,
Object
>
getParams
()
{
if
(
params
==
null
)
{
params
=
new
HashMap
<>();
}
return
params
;
}
}
}
dsk-system/src/main/java/com/dsk/system/domain/customer/vo/CustomerAnalyzeVo.java
0 → 100644
View file @
035c20d7
package
com
.
dsk
.
system
.
domain
.
customer
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 客户分析
*
* @author lcl
* @create 2023/8/15
*/
@Data
public
class
CustomerAnalyzeVo
implements
Serializable
{
/**
* 客户id
*/
private
String
customerId
;
/**
* 企业名称
*/
private
String
companyName
;
/**
* 企业id
*/
private
Integer
companyId
;
/**
* 城投id
*/
private
String
uipId
;
/**
* 项目数量
*/
private
Integer
businessCount
;
/**
* 总投资金额
*/
private
Double
totalAmount
;
}
dsk-system/src/main/java/com/dsk/system/domain/dsk/dto/JskCombineSearchDto.java
View file @
035c20d7
...
@@ -71,11 +71,11 @@ public class JskCombineSearchDto implements Serializable {
...
@@ -71,11 +71,11 @@ public class JskCombineSearchDto implements Serializable {
/**
/**
* 中标时间(开始)
* 中标时间(开始)
*/
*/
private
Date
startBidTime
;
private
String
startBidTime
;
/**
/**
* 中标时间(结束)
* 中标时间(结束)
*/
*/
private
Date
endBidTime
;
private
String
endBidTime
;
/**
/**
* 业绩类型
* 业绩类型
*/
*/
...
...
dsk-system/src/main/java/com/dsk/system/dskService/JskCombineInfoService.java
View file @
035c20d7
...
@@ -37,6 +37,17 @@ public class JskCombineInfoService {
...
@@ -37,6 +37,17 @@ public class JskCombineInfoService {
public
TableDataInfo
memberList
(
JskCombineSearchDto
dto
)
throws
Exception
{
public
TableDataInfo
memberList
(
JskCombineSearchDto
dto
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/operate/combine/memberList"
,
BeanUtil
.
beanToMap
(
dto
,
false
,
false
));
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/operate/combine/memberList"
,
BeanUtil
.
beanToMap
(
dto
,
false
,
false
));
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"data"
)))
{
Map
<
String
,
Object
>
data
=
BeanUtil
.
beanToMap
(
map
.
get
(
"data"
));
if
(!
ObjectUtils
.
isEmpty
(
data
.
get
(
"list"
)))
{
List
<
Map
<
String
,
Object
>>
list
=
(
List
<
Map
<
String
,
Object
>>)
data
.
get
(
"list"
);
list
.
parallelStream
().
forEach
(
res
->
{
Integer
companyId
=
MapUtils
.
getInteger
(
res
,
"companyId"
);
String
companyName
=
MapUtils
.
getString
(
res
,
"companyName"
);
res
.
put
(
"uipId"
,
enterpriseService
.
getUipIdByCompanyNameOrCompanyId
(
companyName
,
companyId
));
});
}
}
return
dskOpenApiUtil
.
responsePage
(
map
);
return
dskOpenApiUtil
.
responsePage
(
map
);
}
}
...
...
dsk-system/src/main/java/com/dsk/system/mapper/CustomerMapper.java
View file @
035c20d7
...
@@ -3,6 +3,7 @@ package com.dsk.system.mapper;
...
@@ -3,6 +3,7 @@ package com.dsk.system.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.dsk.system.domain.customer.Customer
;
import
com.dsk.system.domain.customer.Customer
;
import
com.dsk.system.domain.customer.dto.CustomerSearchDto
;
import
com.dsk.system.domain.customer.dto.CustomerSearchDto
;
import
com.dsk.system.domain.customer.vo.CustomerAnalyzeVo
;
import
com.dsk.system.domain.customer.vo.CustomerListVo
;
import
com.dsk.system.domain.customer.vo.CustomerListVo
;
import
com.dsk.system.domain.customer.vo.CustomerStatusListVo
;
import
com.dsk.system.domain.customer.vo.CustomerStatusListVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
...
@@ -20,7 +21,7 @@ import java.util.List;
...
@@ -20,7 +21,7 @@ import java.util.List;
@Mapper
@Mapper
public
interface
CustomerMapper
extends
BaseMapper
<
Customer
>
{
public
interface
CustomerMapper
extends
BaseMapper
<
Customer
>
{
List
<
CustomerListVo
>
selectList
(
@Param
(
"dto"
)
CustomerSearchDto
dto
);
List
<
CustomerListVo
>
selectList
(
CustomerSearchDto
dto
);
List
<
Customer
>
selectUserList
(
Long
userId
);
List
<
Customer
>
selectUserList
(
Long
userId
);
...
@@ -30,7 +31,9 @@ public interface CustomerMapper extends BaseMapper<Customer> {
...
@@ -30,7 +31,9 @@ public interface CustomerMapper extends BaseMapper<Customer> {
List
<
CustomerStatusListVo
>
selectStatusListByCompanyName
(
@Param
(
"companyNames"
)
List
<
String
>
companyNames
,
@Param
(
"userId"
)
Long
userId
);
List
<
CustomerStatusListVo
>
selectStatusListByCompanyName
(
@Param
(
"companyNames"
)
List
<
String
>
companyNames
,
@Param
(
"userId"
)
Long
userId
);
// List<String> selectUipIdList(@Param("uipIds") List<String> uipIds, @Param("userId") Long userId);
int
selectCustomerCount
(
CustomerSearchDto
dto
);
List
<
CustomerAnalyzeVo
>
selectCooperationTop
(
CustomerSearchDto
dto
);
}
}
dsk-system/src/main/java/com/dsk/system/service/ICustomerOverviewService.java
0 → 100644
View file @
035c20d7
package
com
.
dsk
.
system
.
service
;
import
com.dsk.system.domain.customer.dto.CustomerSearchDto
;
import
com.dsk.system.domain.customer.vo.CustomerAnalyzeVo
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author lcl
* @create 2023/8/15
*/
public
interface
ICustomerOverviewService
{
Map
<
String
,
Object
>
statistics
(
CustomerSearchDto
dto
);
List
<
CustomerAnalyzeVo
>
cooperationTop
(
CustomerSearchDto
dto
);
}
dsk-system/src/main/java/com/dsk/system/service/impl/CustomerOverviewServiceImpl.java
0 → 100644
View file @
035c20d7
package
com
.
dsk
.
system
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.dsk.common.utils.SecurityUtils
;
import
com.dsk.system.domain.customer.Customer
;
import
com.dsk.system.domain.customer.dto.CustomerSearchDto
;
import
com.dsk.system.domain.customer.vo.CustomerAnalyzeVo
;
import
com.dsk.system.mapper.CustomerMapper
;
import
com.dsk.system.service.ICustomerOverviewService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 客户概览相关
* @author lcl
* @create 2023/8/15
*/
@Service
public
class
CustomerOverviewServiceImpl
implements
ICustomerOverviewService
{
@Resource
private
CustomerMapper
customerMapper
;
@Override
public
Map
<
String
,
Object
>
statistics
(
CustomerSearchDto
dto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
dto
.
setUserId
(
SecurityUtils
.
getUserId
());
//总
resultMap
.
put
(
"totalCount"
,
customerMapper
.
selectCustomerCount
(
dto
));
//国企
dto
.
setCompanyNature
(
"国有企业"
);
resultMap
.
put
(
"nationCount"
,
customerMapper
.
selectCustomerCount
(
dto
));
//央企
dto
.
setCompanyNature
(
"央企"
);
resultMap
.
put
(
"centreCount"
,
customerMapper
.
selectCustomerCount
(
dto
));
//事业
dto
.
setCompanyNature
(
"事业单位"
);
resultMap
.
put
(
"undertakingCount"
,
customerMapper
.
selectCustomerCount
(
dto
));
return
resultMap
;
}
@Override
public
List
<
CustomerAnalyzeVo
>
cooperationTop
(
CustomerSearchDto
dto
)
{
dto
.
setUserId
(
SecurityUtils
.
getUserId
());
return
customerMapper
.
selectCooperationTop
(
dto
);
}
}
dsk-system/src/main/resources/mapper/system/customer/CustomerMapper.xml
View file @
035c20d7
...
@@ -27,7 +27,38 @@
...
@@ -27,7 +27,38 @@
select count(status) num,customer_id from business_info where `status` = 2 group by customer_id
select count(status) num,customer_id from business_info where `status` = 2 group by customer_id
) bi3 on bi3.customer_id = ct.customer_id
) bi3 on bi3.customer_id = ct.customer_id
where ctu.user_id = #{dto.userId} and ctu.status = #{dto.status}
where ctu.user_id = #{dto.userId} and ctu.status = #{dto.status}
<if
test=
"dto.companyName != null and dto.companyName != '' "
>
and ct.company_name like concat('%',#{dto.companyName},'%')
</if>
<if
test=
"companyName != null and companyName != '' "
>
and ct.company_name like concat('%',#{companyName},'%')
</if>
<if
test=
"isOn != null "
>
and ct.is_on = #{isOn}
</if>
<if
test=
"provinceIds != null and provinceIds.size > 0 "
>
and ct.province_id in
<foreach
collection=
"provinceIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"cityIds != null and cityIds.size > 0 "
>
and ct.city_id in
<foreach
collection=
"cityIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"districtIds != null and districtIds.size > 0 "
>
and ct.district_id in
<foreach
collection=
"districtIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"companyNatures != null and companyNatures.size > 0 "
>
and ct.company_nature in
<foreach
collection=
"companyNatures"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"creditLevels != null and creditLevels.size > 0 "
>
and ct.credit_level in
<foreach
collection=
"creditLevels"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
order by ct.create_time desc
order by ct.create_time desc
</select>
</select>
...
@@ -69,16 +100,27 @@
...
@@ -69,16 +100,27 @@
</foreach>
</foreach>
</select>
</select>
<!-- <select id="selectUipIdList" resultType="java.lang.String">-->
<select
id=
"selectCustomerCount"
resultType=
"java.lang.Integer"
>
<!-- select-->
select
<!-- ct.uip_id-->
count(ct.customer_id)
<!-- from customer ct-->
from customer ct
<!-- join customer_user ctu on ct.customer_id = ctu.customer_id-->
join customer_user ctu on ct.customer_id = ctu.customer_id
<!-- where ctu.user_id = #{userId} and ctu.status = 0 and ct.uip_id in-->
where ctu.status = 0 and ctu.user_id = #{userId}
<!-- <foreach collection="uipIds" item="uipId" open="(" separator="," close=")">-->
<if
test=
"companyNature != null and companyNature != ''"
>
and ct.company_nature = #{companyNature}
</if>
<!-- #{uipId}-->
</select>
<!-- </foreach>-->
<!-- </select>-->
<select
id=
"selectCooperationTop"
resultType=
"com.dsk.system.domain.customer.vo.CustomerAnalyzeVo"
>
select
ct.customer_id, ct.company_name, ct.company_id, ct.uip_id, count(bi.id) businessCount,
sum(bi.investment_amount) totalAmount
from customer ct
join customer_user ctu on ct.customer_id = ctu.customer_id
left join business_info bi on (bi.customer_id = ct.customer_id and bi.status = 2)
where ctu.status = 0 and ctu.user_id = #{userId}
group by ct.customer_id
order by totalAmount desc
limit 10
</select>
</mapper>
</mapper>
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