Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
relation
Commits
bc7e75ba
Commit
bc7e75ba
authored
Aug 06, 2025
by
zhuxiang
Browse files
增加查看商户关联的用户接口
parent
f2662ffb
Changes
12
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/controller/AnalysisController.java
View file @
bc7e75ba
...
...
@@ -28,7 +28,7 @@ public class AnalysisController {
@ApiOperation
(
"解析画布边文件上传excel内容"
)
@PostMapping
(
"/canvas"
)
public
Result
<?>
canvas
(
@RequestParam
(
value
=
"files"
)
List
<
MultipartFile
>
files
,
@RequestParam
(
value
=
"caseId"
)
Str
in
g
caseId
,
@RequestParam
(
value
=
"caseId"
)
in
t
caseId
,
@RequestParam
(
value
=
"folderName"
,
required
=
false
)
String
folderName
)
{
return
analysisService
.
canvas
(
files
,
caseId
,
folderName
);
}
...
...
src/main/java/com/platform/controller/NodeController.java
0 → 100644
View file @
bc7e75ba
package
com.platform.controller
;
import
com.platform.model.dto.NodeDTO
;
import
com.platform.page.TableDataInfo
;
import
com.platform.service.NodeService
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
@RestController
@RequestMapping
(
"/node"
)
public
class
NodeController
extends
BaseController
{
@Resource
private
NodeService
nodeService
;
@PostMapping
(
"/mchRelationUser"
)
public
TableDataInfo
mchRelationUser
(
@RequestBody
NodeDTO
nodeDTO
)
{
startPage
(
nodeDTO
.
getPageNum
(),
nodeDTO
.
getPageSize
());
return
getDataTable
(
nodeService
.
mchRelationUser
(
nodeDTO
));
}
}
src/main/java/com/platform/model/dto/NodeDTO.java
0 → 100644
View file @
bc7e75ba
package
com.platform.model.dto
;
import
lombok.Data
;
@Data
public
class
NodeDTO
{
private
String
payeeName
;
private
int
caseId
;
private
int
pageNum
;
private
int
pageSize
;
}
src/main/java/com/platform/model/entity/ExcelDataEntity.java
View file @
bc7e75ba
...
...
@@ -27,7 +27,7 @@ public class ExcelDataEntity {
@TableField
(
"case_id"
)
@ApiModelProperty
(
"案件id"
)
private
Str
in
g
caseId
;
private
in
t
caseId
;
@TableField
(
"directory_id"
)
@ApiModelProperty
(
"目录id"
)
...
...
src/main/java/com/platform/model/entity/UserAccountEntity.java
View file @
bc7e75ba
...
...
@@ -22,7 +22,7 @@ public class UserAccountEntity {
@TableField
(
"case_id"
)
@ApiModelProperty
(
"案件id"
)
private
Str
in
g
caseId
;
private
in
t
caseId
;
private
String
userName
;
...
...
src/main/java/com/platform/model/entity/UserEntity.java
View file @
bc7e75ba
...
...
@@ -24,7 +24,7 @@ public class UserEntity {
@TableField
(
"case_id"
)
@ApiModelProperty
(
"案件id"
)
private
Str
in
g
caseId
;
private
in
t
caseId
;
private
String
userName
;
...
...
src/main/java/com/platform/service/AnalysisService.java
View file @
bc7e75ba
...
...
@@ -19,7 +19,7 @@ public interface AnalysisService {
* @param files
* @return
*/
Result
<?>
canvas
(
List
<
MultipartFile
>
files
,
Str
in
g
caseId
,
String
folderName
);
Result
<?>
canvas
(
List
<
MultipartFile
>
files
,
in
t
caseId
,
String
folderName
);
/**
* 读取模板文件
...
...
src/main/java/com/platform/service/ExcelDataService.java
View file @
bc7e75ba
...
...
@@ -23,7 +23,7 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
* @param fileId
* @return
*/
List
<
ExcelDataEntity
>
queryListByFileId
(
String
fileId
,
Str
in
g
caseId
);
List
<
ExcelDataEntity
>
queryListByFileId
(
String
fileId
,
in
t
caseId
);
/**
* @param fileId
...
...
@@ -35,7 +35,7 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
* @param
* @return
*/
List
<
ExcelDataEntity
>
queryListByCaseIdAndPayUserName
(
Str
in
g
caseId
,
String
payUserName
);
List
<
ExcelDataEntity
>
queryListByCaseIdAndPayUserName
(
in
t
caseId
,
String
payUserName
);
/**
* 查看案件所有的人员
...
...
@@ -59,5 +59,5 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List
<
ExcelDataEntity
>
queryListByPayUserName
(
ExcelDataDTO
excelDataDTO
);
List
<
ExcelDataEntity
>
queryListByPayeeName
(
String
oldName
,
Str
in
g
caseId
);
List
<
ExcelDataEntity
>
queryListByPayeeName
(
String
oldName
,
in
t
caseId
);
}
src/main/java/com/platform/service/NodeService.java
View file @
bc7e75ba
package
com.platform.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.platform.model.dto.NodeDTO
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.NodeEntity
;
import
com.platform.model.vo.ExcelDataVO
;
import
com.platform.model.vo.NodeVO
;
import
java.util.List
;
...
...
@@ -10,4 +13,6 @@ public interface NodeService extends IService<NodeEntity> {
void
saveData
(
Integer
id
,
List
<
NodeVO
>
nodes
);
List
<
NodeVO
>
queryByCaseId
(
Integer
id
);
List
<
NodeVO
>
mchRelationUser
(
NodeDTO
nodeDTO
);
}
src/main/java/com/platform/service/impl/AnalysisServiceImpl.java
View file @
bc7e75ba
...
...
@@ -58,7 +58,7 @@ public class AnalysisServiceImpl implements AnalysisService {
@Override
@Transactional
public
Result
<?>
canvas
(
List
<
MultipartFile
>
files
,
Str
in
g
caseId
,
String
folderName
)
{
public
Result
<?>
canvas
(
List
<
MultipartFile
>
files
,
in
t
caseId
,
String
folderName
)
{
//查询模板
// CasesEntity caseEntity = caseService.getById(caseId);
// String templateId = caseEntity.getTemplateId();
...
...
@@ -166,7 +166,7 @@ public class AnalysisServiceImpl implements AnalysisService {
}
}
private
ExcelDataEntity
handleExcelData
(
List
<
TableHeaderVO
>
tableHeaderList
,
Row
row
,
String
folderName
,
String
fileId
,
Str
in
g
caseId
)
{
private
ExcelDataEntity
handleExcelData
(
List
<
TableHeaderVO
>
tableHeaderList
,
Row
row
,
String
folderName
,
String
fileId
,
in
t
caseId
)
{
ExcelDataEntity
excelDataEntity
=
new
ExcelDataEntity
();
trySetValue
(()
->
excelDataEntity
.
setType
(
getCellValueAsString
(
row
.
getCell
(
tableHeaderList
.
get
(
0
).
getIndex
()))));
...
...
@@ -268,7 +268,7 @@ public class AnalysisServiceImpl implements AnalysisService {
return
false
;
}
private
void
processSingleExcelFile
(
File
excelFile
,
List
<
TableHeaderVO
>
tableHeaderList
,
String
folderName
,
String
fileId
,
Str
in
g
caseId
,
List
<
UserAccountEntity
>
userAccountList
,
Map
<
String
,
String
>
groupedMap
)
throws
IOException
{
private
void
processSingleExcelFile
(
File
excelFile
,
List
<
TableHeaderVO
>
tableHeaderList
,
String
folderName
,
String
fileId
,
in
t
caseId
,
List
<
UserAccountEntity
>
userAccountList
,
Map
<
String
,
String
>
groupedMap
)
throws
IOException
{
//读取第一个sheet
Sheet
sheet
=
getWorkbook
(
excelFile
).
getSheetAt
(
0
);
//获取sheet长度
...
...
src/main/java/com/platform/service/impl/ExcelDataServiceImpl.java
View file @
bc7e75ba
...
...
@@ -30,7 +30,7 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
}
@Override
public
List
<
ExcelDataEntity
>
queryListByFileId
(
String
fileId
,
Str
in
g
caseId
)
{
public
List
<
ExcelDataEntity
>
queryListByFileId
(
String
fileId
,
in
t
caseId
)
{
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
ExcelDataEntity
>()
.
eq
(
ExcelDataEntity:
:
getFileId
,
fileId
)
.
eq
(
ExcelDataEntity:
:
getCaseId
,
caseId
));
...
...
@@ -47,7 +47,7 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
}
@Override
public
List
<
ExcelDataEntity
>
queryListByCaseIdAndPayUserName
(
Str
in
g
caseId
,
String
payUserName
)
{
public
List
<
ExcelDataEntity
>
queryListByCaseIdAndPayUserName
(
in
t
caseId
,
String
payUserName
)
{
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
ExcelDataEntity
>()
.
eq
(
ExcelDataEntity:
:
getCaseId
,
caseId
)
.
eq
(
ExcelDataEntity:
:
getPayUserName
,
payUserName
));
...
...
@@ -101,7 +101,7 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
}
@Override
public
List
<
ExcelDataEntity
>
queryListByPayeeName
(
String
oldName
,
Str
in
g
caseId
)
{
public
List
<
ExcelDataEntity
>
queryListByPayeeName
(
String
oldName
,
in
t
caseId
)
{
return
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
ExcelDataEntity
>()
.
eq
(
ExcelDataEntity:
:
getCaseId
,
caseId
)
.
eq
(
ExcelDataEntity:
:
getPayeeName
,
oldName
));
...
...
src/main/java/com/platform/service/impl/NodeServiceImpl.java
View file @
bc7e75ba
...
...
@@ -2,17 +2,31 @@ package com.platform.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Maps
;
import
com.platform.mapper.NodeMapper
;
import
com.platform.model.dto.NodeDTO
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.NodeEntity
;
import
com.platform.model.vo.ExcelDataVO
;
import
com.platform.model.vo.NodeVO
;
import
com.platform.service.ExcelDataService
;
import
com.platform.service.NodeService
;
import
com.platform.service.UserService
;
import
com.platform.utils.DozerUtils
;
import
org.apache.commons.compress.utils.Lists
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
java.util.*
;
@Service
public
class
NodeServiceImpl
extends
ServiceImpl
<
NodeMapper
,
NodeEntity
>
implements
NodeService
{
@Resource
private
UserService
userService
;
@Resource
private
ExcelDataService
excelDataService
;
@Override
public
void
saveData
(
Integer
id
,
List
<
NodeVO
>
nodes
)
{
List
<
NodeEntity
>
nodeEntityList
=
DozerUtils
.
convertList
(
nodes
,
NodeEntity
.
class
);
...
...
@@ -25,4 +39,55 @@ public class NodeServiceImpl extends ServiceImpl<NodeMapper, NodeEntity> impleme
return
DozerUtils
.
convertList
(
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
NodeEntity
>()
.
eq
(
NodeEntity:
:
getCaseId
,
id
)),
NodeVO
.
class
);
}
@Override
public
List
<
NodeVO
>
mchRelationUser
(
NodeDTO
nodeDTO
)
{
// 使用Set去重
Set
<
String
>
uniqueNodes
=
new
HashSet
<>();
List
<
ExcelDataEntity
>
excelDataEntityList
=
excelDataService
.
queryListByPayeeName
(
nodeDTO
.
getPayeeName
(),
nodeDTO
.
getCaseId
());
Map
<
String
,
Integer
>
nodeDegreeMap
=
Maps
.
newHashMap
();
excelDataEntityList
.
forEach
(
excelDataEntity
->
{
String
payer
=
excelDataEntity
.
getPayUserName
();
// 添加节点
uniqueNodes
.
add
(
payer
);
nodeDegreeMap
.
put
(
payer
,
nodeDegreeMap
.
getOrDefault
(
payer
,
0
)
+
1
);
});
//查看每个人的账号类型
List
<
String
>
userNameList
=
new
ArrayList
<>(
uniqueNodes
);
//查看每个人的账号标签
List
<
ExcelDataVO
>
excelDataEntityListNew
=
userService
.
queryUserLabel
(
userNameList
,
nodeDTO
.
getCaseId
());
for
(
ExcelDataVO
dataVO
:
excelDataEntityListNew
)
{
for
(
Map
.
Entry
<
String
,
Integer
>
entry
:
nodeDegreeMap
.
entrySet
())
{
String
key
=
entry
.
getKey
();
Integer
value
=
entry
.
getValue
();
if
(
dataVO
.
getPayUserName
().
equals
(
key
))
{
dataVO
.
setNodeNum
(
value
);
}
}
}
List
<
NodeVO
>
result
=
Lists
.
newArrayList
();
excelDataEntityListNew
.
forEach
(
excelDataVO
->
{
NodeVO
org
=
new
NodeVO
();
if
(
excelDataVO
.
getAccountType
().
equals
(
"银联"
))
{
org
.
setNode
(
excelDataVO
.
getPayUserName
());
org
.
setNodeNum
(
excelDataVO
.
getNodeNum
());
org
.
setBankCode
(
excelDataVO
.
getPayeeBankCard
());
org
.
setNodeType
(
"银联"
);
result
.
add
(
org
);
}
else
{
NodeVO
person
=
new
NodeVO
();
person
.
setNode
(
excelDataVO
.
getPayUserName
());
person
.
setNodeNum
(
excelDataVO
.
getNodeNum
());
person
.
setLabel
(
excelDataVO
.
getLabel
());
person
.
setNodeType
(
"个人"
);
result
.
add
(
person
);
}
});
return
result
;
}
}
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