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
34bea269
Commit
34bea269
authored
Aug 11, 2025
by
wujipeng
Browse files
优化
parent
66820605
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/platform/model/vo/AssociationVO.java
View file @
34bea269
...
...
@@ -30,15 +30,19 @@ public class AssociationVO {
@ApiModelProperty
(
"总金额"
)
private
String
totalAmount
;
@ApiModelProperty
(
"收款方"
)
private
String
payee
;
@ApiModelProperty
(
"付款方"
)
private
String
payment
;
//
@ApiModelProperty("收款方")
//
private String payee;
//
//
@ApiModelProperty("付款方")
//
private String payment;
@ApiModelProperty
(
"数量"
)
private
Integer
num
;
@ApiModelProperty
(
"方向"
)
private
String
direction
;
private
String
payeeName
;
private
String
payUserName
;
}
src/main/java/com/platform/service/impl/UserServiceImpl.java
View file @
34bea269
...
...
@@ -64,33 +64,33 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
List
<
AssociationVO
>
financialTransactions
=
excelDataService
.
queryAccountTemporary
(
userDTO
);
Map
<
String
,
List
<
AssociationVO
>>
detailsFunds
=
Maps
.
newHashMap
();
for
(
AssociationVO
financialTransaction
:
financialTransactions
)
{
if
(
financialTransaction
.
getDirection
()
.
equals
(
"出账"
))
{
if
(
detailsFunds
.
containsKey
(
financialTransaction
.
getPayee
()))
{
financialTransaction
.
setRelationDesc
(
detailsFunds
.
get
(
financialTransaction
.
getPayee
()).
size
()
+
"、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
()
+
"->"
+
financialTransaction
.
getPayme
nt
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
detailsFunds
.
get
(
financialTransaction
.
getPayee
()).
add
(
financialTransaction
);
account
.
add
(
financialTransaction
.
getPayme
nt
());
if
(
"出账"
.
equals
(
financialTransaction
.
getDirection
()))
{
if
(
detailsFunds
.
containsKey
(
financialTransaction
.
getPayee
Name
()))
{
financialTransaction
.
setRelationDesc
(
detailsFunds
.
get
(
financialTransaction
.
getPayee
Name
()).
size
()
+
"、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
Name
()
+
"->"
+
financialTransaction
.
getPay
UserNa
me
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
detailsFunds
.
get
(
financialTransaction
.
getPayee
Name
()).
add
(
financialTransaction
);
account
.
add
(
financialTransaction
.
getPay
UserNa
me
());
}
else
{
List
<
AssociationVO
>
list
=
new
ArrayList
<>();
financialTransaction
.
setRelationDesc
(
"1、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
()
+
"->"
+
financialTransaction
.
getPayme
nt
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
+
financialTransaction
.
getPayee
Name
()
+
"->"
+
financialTransaction
.
getPay
UserNa
me
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
list
.
add
(
financialTransaction
);
detailsFunds
.
put
(
financialTransaction
.
getPayee
(),
list
);
account
.
add
(
financialTransaction
.
getPayme
nt
());
detailsFunds
.
put
(
financialTransaction
.
getPayee
Name
(),
list
);
account
.
add
(
financialTransaction
.
getPay
UserNa
me
());
}
}
else
if
(
financialTransaction
.
getDirection
()
.
equals
(
"入账"
))
{
if
(
detailsFunds
.
containsKey
(
financialTransaction
.
getPayme
nt
()))
{
financialTransaction
.
setRelationDesc
(
detailsFunds
.
get
(
financialTransaction
.
getPayme
nt
()).
size
()
+
"、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
()
+
"->"
+
financialTransaction
.
getPayme
nt
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
detailsFunds
.
get
(
financialTransaction
.
getPayme
nt
()).
add
(
financialTransaction
);
account
.
add
(
financialTransaction
.
getPayee
());
}
else
if
(
"入账"
.
equals
(
financialTransaction
.
getDirection
()))
{
if
(
detailsFunds
.
containsKey
(
financialTransaction
.
getPay
UserNa
me
()))
{
financialTransaction
.
setRelationDesc
(
detailsFunds
.
get
(
financialTransaction
.
getPay
UserNa
me
()).
size
()
+
"、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
Name
()
+
"->"
+
financialTransaction
.
getPay
UserNa
me
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
detailsFunds
.
get
(
financialTransaction
.
getPay
UserNa
me
()).
add
(
financialTransaction
);
account
.
add
(
financialTransaction
.
getPayee
Name
());
}
else
{
List
<
AssociationVO
>
list
=
new
ArrayList
<>();
financialTransaction
.
setRelationDesc
(
"1、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
()
+
"->"
+
financialTransaction
.
getPayme
nt
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
+
financialTransaction
.
getPayee
Name
()
+
"->"
+
financialTransaction
.
getPay
UserNa
me
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
list
.
add
(
financialTransaction
);
detailsFunds
.
put
(
financialTransaction
.
getPayme
nt
(),
list
);
account
.
add
(
financialTransaction
.
getPayee
());
detailsFunds
.
put
(
financialTransaction
.
getPay
eeNa
me
(),
list
);
account
.
add
(
financialTransaction
.
getPayee
Name
());
}
}
}
...
...
@@ -128,33 +128,33 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
List
<
AssociationVO
>
financialTransactions
=
excelDataService
.
selectFinancialTransactions
(
userDTO
);
Map
<
String
,
List
<
AssociationVO
>>
detailsFunds
=
Maps
.
newHashMap
();
for
(
AssociationVO
financialTransaction
:
financialTransactions
)
{
if
(
financialTransaction
.
getDirection
()
.
equals
(
"出账"
))
{
if
(
detailsFunds
.
containsKey
(
financialTransaction
.
getPayee
()))
{
financialTransaction
.
setRelationDesc
(
detailsFunds
.
get
(
financialTransaction
.
getPayee
()).
size
()
+
"、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
()
+
"->"
+
financialTransaction
.
getPayme
nt
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
detailsFunds
.
get
(
financialTransaction
.
getPayee
()).
add
(
financialTransaction
);
account
.
add
(
financialTransaction
.
getPayme
nt
());
if
(
"出账"
.
equals
(
financialTransaction
.
getDirection
()))
{
if
(
detailsFunds
.
containsKey
(
financialTransaction
.
getPayee
Name
()))
{
financialTransaction
.
setRelationDesc
(
detailsFunds
.
get
(
financialTransaction
.
getPayee
Name
()).
size
()
+
"、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
Name
()
+
"->"
+
financialTransaction
.
getPay
UserNa
me
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
detailsFunds
.
get
(
financialTransaction
.
getPayee
Name
()).
add
(
financialTransaction
);
account
.
add
(
financialTransaction
.
getPay
UserNa
me
());
}
else
{
List
<
AssociationVO
>
list
=
new
ArrayList
<>();
financialTransaction
.
setRelationDesc
(
"1、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
()
+
"->"
+
financialTransaction
.
getPayme
nt
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
+
financialTransaction
.
getPayee
Name
()
+
"->"
+
financialTransaction
.
getPay
UserNa
me
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
list
.
add
(
financialTransaction
);
detailsFunds
.
put
(
financialTransaction
.
getPayee
(),
list
);
account
.
add
(
financialTransaction
.
getPayme
nt
());
detailsFunds
.
put
(
financialTransaction
.
getPayee
Name
(),
list
);
account
.
add
(
financialTransaction
.
getPay
UserNa
me
());
}
}
else
if
(
financialTransaction
.
getDirection
()
.
equals
(
"入账"
))
{
if
(
detailsFunds
.
containsKey
(
financialTransaction
.
getPayme
nt
()))
{
financialTransaction
.
setRelationDesc
(
detailsFunds
.
get
(
financialTransaction
.
getPayme
nt
()).
size
()
+
"、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
()
+
"->"
+
financialTransaction
.
getPayme
nt
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
detailsFunds
.
get
(
financialTransaction
.
getPayme
nt
()).
add
(
financialTransaction
);
account
.
add
(
financialTransaction
.
getPayee
());
}
else
if
(
"入账"
.
equals
(
financialTransaction
.
getDirection
()))
{
if
(
detailsFunds
.
containsKey
(
financialTransaction
.
getPay
UserNa
me
()))
{
financialTransaction
.
setRelationDesc
(
detailsFunds
.
get
(
financialTransaction
.
getPay
UserNa
me
()).
size
()
+
"、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
Name
()
+
"->"
+
financialTransaction
.
getPay
UserNa
me
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
detailsFunds
.
get
(
financialTransaction
.
getPay
UserNa
me
()).
add
(
financialTransaction
);
account
.
add
(
financialTransaction
.
getPayee
Name
());
}
else
{
List
<
AssociationVO
>
list
=
new
ArrayList
<>();
financialTransaction
.
setRelationDesc
(
"1、"
+
financialTransaction
.
getStartTime
()
+
"-"
+
financialTransaction
.
getEndTime
()
+
financialTransaction
.
getPayee
()
+
"->"
+
financialTransaction
.
getPayme
nt
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
+
financialTransaction
.
getPayee
Name
()
+
"->"
+
financialTransaction
.
getPay
UserNa
me
()
+
","
+
financialTransaction
.
getTotalAmount
()
+
",交易"
+
financialTransaction
.
getNum
()
+
"次"
);
list
.
add
(
financialTransaction
);
detailsFunds
.
put
(
financialTransaction
.
getPayme
nt
(),
list
);
account
.
add
(
financialTransaction
.
getPayee
());
detailsFunds
.
put
(
financialTransaction
.
getPay
eeNa
me
(),
list
);
account
.
add
(
financialTransaction
.
getPayee
Name
());
}
}
}
...
...
@@ -204,7 +204,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
userDTO
.
setUserName
(
userDTO
.
getUserName
()
+
idCardInfo
.
get
(
"idCard"
));
userDTO
.
setIdType
(
"身份证"
);
excelDataEntity
.
setPayUserName
(
userDTO
.
getUserName
()
+
idCardInfo
.
get
(
"idCard"
));
}
else
{
}
else
{
excelDataEntity
.
setPayUserName
(
userDTO
.
getUserName
());
}
excelDataEntity
.
setCaseId
(
userDTO
.
getCaseId
());
...
...
@@ -216,14 +216,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override
public
List
<
ExcelDataEntity
>
cashFlow
(
UserDTO
userDTO
)
{
// List<ExcelDataEntity> excelDataList = null;
// if ("1".equals(userDTO.getIdentifier())) {
// excelDataList = excelDataService.cashFlow(userDTO);
// } else if ("2".equals(userDTO.getIdentifier())) {
// excelDataList = excelDataService.accountCashFlow(userDTO);
// } else {
// return null;
// }
List
<
ExcelDataEntity
>
excelDataList
=
excelDataService
.
cashFlow
(
userDTO
);
for
(
ExcelDataEntity
excelDataEntity
:
excelDataList
)
{
if
(
"出账"
.
equals
(
excelDataEntity
.
getDirection
()))
{
...
...
@@ -242,13 +234,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
EveryoneVO
everyoneVO
=
new
EveryoneVO
();
UserEntity
oneself
=
getOne
(
new
LambdaQueryWrapper
<
UserEntity
>()
.
eq
(
UserEntity:
:
getUserName
,
userDTO
.
getUserName
()).
eq
(
UserEntity:
:
getCaseId
,
userDTO
.
getCaseId
()),
false
);
UserEntity
other
=
getOne
(
new
LambdaQueryWrapper
<
UserEntity
>()
.
eq
(
UserEntity:
:
getUserName
,
userDTO
.
getOtherName
()).
eq
(
UserEntity:
:
getCaseId
,
userDTO
.
getCaseId
()),
false
);
if
(
ObjectUtils
.
isEmpty
(
oneself
)
||
ObjectUtils
.
isEmpty
(
other
))
{
throw
new
BusinessException
(
"用户不存在"
);
}
//
UserEntity other = getOne(new LambdaQueryWrapper<UserEntity>()
//
.eq(UserEntity::getUserName, userDTO.getOtherName()).eq(UserEntity::getCaseId, userDTO.getCaseId()), false);
//
if (ObjectUtils.isEmpty(oneself) || ObjectUtils.isEmpty(other)) {
//
throw new BusinessException("用户不存在");
//
}
//标题
everyoneVO
.
setTitle
(
oneself
.
getUserName
()
+
","
+
other
.
get
Us
erName
());
everyoneVO
.
setTitle
(
userDTO
.
getUserName
()
+
","
+
userDTO
.
get
Oth
erName
());
//查询关系
List
<
UserRelationEntity
>
userRelation
=
userRelationService
.
bothSides
(
userDTO
.
getUserName
(),
userDTO
.
getOtherName
());
//指认关系
...
...
src/main/resources/com/platform/mapper/ExcelDataMapper.xml
View file @
34bea269
...
...
@@ -57,9 +57,9 @@
min(time) as startTime,
max(time) as endTime,
sum(amount) as totalAmount,
payee_account as payee,
payment_account as payment,
count(*) as num,
payee_name as payeeName,
pay_user_name as payUserName,
direction
from excel_data
where case_id = #{caseId}
...
...
@@ -71,9 +71,7 @@
and time
<
= #{endTime}
</if>
group by
payee_account,
payment_account,
direction
direction,payee_name,pay_user_name
HAVING 1=1
<if
test=
"minAmount != null"
>
and sum(amount) >= #{minAmount}
...
...
@@ -140,8 +138,20 @@
file_id
from excel_data
where case_id = #{caseId}
and (pay_user_name = #{userName} or payee_name = #{userName})
and (payee_account = #{otherUserName} or payment_account = #{otherUserName})
and pay_user_name = #{userName}
and payee_name = #{otherUserName}
<if
test=
"startTime != null"
>
and time >= #{startTime}
</if>
<if
test=
"endTime != null"
>
and time
<
= #{endTime}
</if>
<if
test=
"minAmount != null"
>
and amount >= #{minAmount}
</if>
<if
test=
"maxAmount != null"
>
and amount
<
= #{maxAmount}
</if>
</select>
<select
id=
"relationPage"
resultType=
"com.platform.model.entity.ExcelDataEntity"
>
SELECT amount, time, payee_account, payment_account
...
...
@@ -205,8 +215,8 @@
min(time) as startTime,
max(time) as endTime,
sum(amount) as totalAmount,
payee_
account
as payee,
pay
ment_account as payment
,
payee_
name
as payee
Name
,
pay
_user_name as payUserName
,
count(*) as num,
direction
from excel_data
...
...
@@ -219,8 +229,8 @@
and time
<
= #{endTime}
</if>
group by
payee_
account
,
pay
ment_account
,
payee_
name
,
pay
_user_name
,
direction
HAVING 1=1
<if
test=
"minAmount != null"
>
...
...
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