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
33bdb548
Commit
33bdb548
authored
Aug 16, 2023
by
danfuman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev20230707' of
http://192.168.60.201/root/dsk-operate-sys
into dev20230707
parents
40df17e3
bcdaa7ac
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
336 additions
and
16 deletions
+336
-16
CustomerOverviewController.java
...k/web/controller/customer/CustomerOverviewController.java
+48
-0
JskCombineInfoController.java
.../com/dsk/web/controller/dsk/JskCombineInfoController.java
+24
-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
+26
-0
CustomerMapper.java
...m/src/main/java/com/dsk/system/mapper/CustomerMapper.java
+8
-2
ICustomerOverviewService.java
...java/com/dsk/system/service/ICustomerOverviewService.java
+21
-0
CustomerOverviewServiceImpl.java
.../dsk/system/service/impl/CustomerOverviewServiceImpl.java
+59
-0
CustomerMapper.xml
.../main/resources/mapper/system/customer/CustomerMapper.xml
+64
-12
No files found.
dsk-admin/src/main/java/com/dsk/web/controller/customer/CustomerOverviewController.java
0 → 100644
View file @
33bdb548
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
.
creditLevel
(
new
CustomerSearchDto
()));
}
}
dsk-admin/src/main/java/com/dsk/web/controller/dsk/JskCombineInfoController.java
View file @
33bdb548
...
...
@@ -99,6 +99,14 @@ public class JskCombineInfoController extends BaseController {
return
baseService
.
centralEnterprseChild
();
}
/**
* 查央企子公司
*/
@PostMapping
(
"/centralEnterprse/child/page"
)
public
AjaxResult
centralEnterprseChildPage
(
@RequestBody
JSONObject
object
)
{
return
baseService
.
centralEnterprseChildPage
(
object
);
}
/**
* 查地方国企
*/
...
...
@@ -106,4 +114,20 @@ public class JskCombineInfoController extends BaseController {
public
AjaxResult
centralEnterprseLocal
(
@RequestBody
JSONObject
object
)
{
return
baseService
.
centralEnterprseLocal
(
object
);
}
/**
* 民营企业
*/
@PostMapping
(
"/centralEnterprse/social"
)
public
AjaxResult
centralEnterprseSocial
()
{
return
baseService
.
centralEnterprseSocial
();
}
/**
* 民营企业
*/
@PostMapping
(
"/centralEnterprse/social/page"
)
public
AjaxResult
centralEnterprseSocialPage
(
@RequestBody
JSONObject
object
)
{
return
baseService
.
centralEnterprseSocialPage
(
object
);
}
}
dsk-system/src/main/java/com/dsk/system/domain/customer/dto/CustomerSearchDto.java
View file @
33bdb548
package
com
.
dsk
.
system
.
domain
.
customer
.
dto
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author lcl
* @create 2023/5/16
*/
@Data
@NoArgsConstructor
public
class
CustomerSearchDto
implements
Serializable
{
/**
* 企业id
...
...
@@ -22,6 +27,10 @@ public class CustomerSearchDto implements Serializable {
* 企业名称
*/
private
String
companyName
;
/**
* 企业性质
*/
private
String
companyNature
;
/**
* 客户id
*/
...
...
@@ -34,5 +43,41 @@ public class CustomerSearchDto implements Serializable {
* 客户状态 0:正常 1:历史
*/
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 @
33bdb548
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 @
33bdb548
...
...
@@ -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 @
33bdb548
...
...
@@ -37,6 +37,17 @@ public class JskCombineInfoService {
public
TableDataInfo
memberList
(
JskCombineSearchDto
dto
)
throws
Exception
{
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
);
}
...
...
@@ -106,8 +117,23 @@ public class JskCombineInfoService {
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
centralEnterprseChildPage
(
JSONObject
object
)
{
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/enterprice/centralEnterprse/child/page"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
centralEnterprseLocal
(
JSONObject
object
)
{
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/enterprice/centralEnterprse/local"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
centralEnterprseSocial
()
{
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/enterprice/centralEnterprse/social"
,
null
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
public
AjaxResult
centralEnterprseSocialPage
(
JSONObject
object
)
{
Map
<
String
,
Object
>
map
=
dskOpenApiUtil
.
requestBody
(
"/nationzj/enterprice/centralEnterprse/social/page"
,
object
);
return
BeanUtil
.
toBean
(
map
,
AjaxResult
.
class
);
}
}
dsk-system/src/main/java/com/dsk/system/mapper/CustomerMapper.java
View file @
33bdb548
...
...
@@ -3,12 +3,14 @@ package com.dsk.system.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
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.domain.customer.vo.CustomerListVo
;
import
com.dsk.system.domain.customer.vo.CustomerStatusListVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -20,7 +22,7 @@ import java.util.List;
@Mapper
public
interface
CustomerMapper
extends
BaseMapper
<
Customer
>
{
List
<
CustomerListVo
>
selectList
(
@Param
(
"dto"
)
CustomerSearchDto
dto
);
List
<
CustomerListVo
>
selectList
(
CustomerSearchDto
dto
);
List
<
Customer
>
selectUserList
(
Long
userId
);
...
...
@@ -30,7 +32,11 @@ public interface CustomerMapper extends BaseMapper<Customer> {
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
);
List
<
Map
<
String
,
Object
>>
selectCreditLevelGroup
(
CustomerSearchDto
dto
);
}
dsk-system/src/main/java/com/dsk/system/service/ICustomerOverviewService.java
0 → 100644
View file @
33bdb548
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
);
List
<
Map
<
String
,
Object
>>
creditLevel
(
CustomerSearchDto
dto
);
}
dsk-system/src/main/java/com/dsk/system/service/impl/CustomerOverviewServiceImpl.java
0 → 100644
View file @
33bdb548
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
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
creditLevel
(
CustomerSearchDto
dto
)
{
dto
.
setUserId
(
SecurityUtils
.
getUserId
());
return
customerMapper
.
selectCreditLevelGroup
(
dto
);
}
}
dsk-system/src/main/resources/mapper/system/customer/CustomerMapper.xml
View file @
33bdb548
...
...
@@ -26,8 +26,39 @@
left join (
select count(status) num,customer_id from business_info where `status` = 2 group by customer_id
) bi3 on bi3.customer_id = ct.customer_id
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>
where ctu.user_id = #{userId} and ctu.status = #{status}
<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
</select>
...
...
@@ -69,16 +100,37 @@
</foreach>
</select>
<!-- <select id="selectUipIdList" resultType="java.lang.String">-->
<!-- select-->
<!-- ct.uip_id-->
<!-- from customer ct-->
<!-- 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-->
<!-- <foreach collection="uipIds" item="uipId" open="(" separator="," close=")">-->
<!-- #{uipId}-->
<!-- </foreach>-->
<!-- </select>-->
<select
id=
"selectCustomerCount"
resultType=
"java.lang.Integer"
>
select
count(ct.customer_id)
from customer ct
join customer_user ctu on ct.customer_id = ctu.customer_id
where ctu.status = 0 and ctu.user_id = #{userId}
<if
test=
"companyNature != null and companyNature != ''"
>
and ct.company_nature = #{companyNature}
</if>
</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>
<select
id=
"selectCreditLevelGroup"
resultType=
"java.util.Map"
>
select
ct.credit_level creditLevel, count(ct.credit_level) customerCount
from customer ct
join customer_user ctu on ct.customer_id = ctu.customer_id
where ctu.user_id = #{userId}
group by ct.credit_level
order by ct.credit_level desc
</select>
</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