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
21ab75ef
Commit
21ab75ef
authored
Sep 02, 2025
by
wujipeng
Browse files
人与人关系弹框分页-优化
parent
fe9324cc
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/com/platform/service/impl/UserServiceImpl.java
View file @
21ab75ef
...
@@ -12,18 +12,12 @@ import com.platform.exception.BusinessException;
...
@@ -12,18 +12,12 @@ import com.platform.exception.BusinessException;
import
com.platform.mapper.UserMapper
;
import
com.platform.mapper.UserMapper
;
import
com.platform.model.dto.CaseDTO
;
import
com.platform.model.dto.CaseDTO
;
import
com.platform.model.dto.UserDTO
;
import
com.platform.model.dto.UserDTO
;
import
com.platform.model.entity.ExcelDataEntity
;
import
com.platform.model.entity.*
;
import
com.platform.model.entity.UserAccountEntity
;
import
com.platform.model.entity.UserEntity
;
import
com.platform.model.entity.UserRelationEntity
;
import
com.platform.model.vo.AssociationVO
;
import
com.platform.model.vo.AssociationVO
;
import
com.platform.model.vo.EveryoneVO
;
import
com.platform.model.vo.EveryoneVO
;
import
com.platform.model.vo.ExcelDataVO
;
import
com.platform.model.vo.ExcelDataVO
;
import
com.platform.model.vo.UserVO
;
import
com.platform.model.vo.UserVO
;
import
com.platform.service.ExcelDataService
;
import
com.platform.service.*
;
import
com.platform.service.UserAccountService
;
import
com.platform.service.UserRelationService
;
import
com.platform.service.UserService
;
import
com.platform.utils.DozerUtils
;
import
com.platform.utils.DozerUtils
;
import
com.platform.utils.IdCardUtils
;
import
com.platform.utils.IdCardUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.NotNull
;
...
@@ -33,6 +27,8 @@ import org.springframework.util.ObjectUtils;
...
@@ -33,6 +27,8 @@ import org.springframework.util.ObjectUtils;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
@Service
@Service
public
class
UserServiceImpl
extends
ServiceImpl
<
UserMapper
,
UserEntity
>
implements
UserService
{
public
class
UserServiceImpl
extends
ServiceImpl
<
UserMapper
,
UserEntity
>
implements
UserService
{
...
@@ -43,6 +39,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
...
@@ -43,6 +39,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
private
UserRelationService
userRelationService
;
private
UserRelationService
userRelationService
;
@Resource
@Resource
private
ExcelDataService
excelDataService
;
private
ExcelDataService
excelDataService
;
@Resource
private
CaseRuleConfigService
caseRuleConfigService
;
@Override
@Override
public
UserVO
getDetail
(
UserDTO
userDTO
)
{
public
UserVO
getDetail
(
UserDTO
userDTO
)
{
...
@@ -218,12 +216,27 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
...
@@ -218,12 +216,27 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
return
save
(
userDTO
);
return
save
(
userDTO
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 匹配开头的一个或多个中文字符
Pattern
pattern
=
Pattern
.
compile
(
"^[\\u4E00-\\u9FA5]+"
);
Matcher
matcher
=
pattern
.
matcher
(
userDTO
.
getUserName
());
if
(
matcher
.
find
())
{
String
chinesePart
=
matcher
.
group
();
throw
new
BusinessException
(
"用户"
+
chinesePart
+
"已经存在"
);
}
else
{
throw
new
BusinessException
(
"用户"
+
userDTO
.
getUserName
()
+
"已经存在"
);
throw
new
BusinessException
(
"用户"
+
userDTO
.
getUserName
()
+
"已经存在"
);
}
}
}
}
}
@Override
@Override
public
List
<
ExcelDataEntity
>
cashFlow
(
UserDTO
userDTO
)
{
public
List
<
ExcelDataEntity
>
cashFlow
(
UserDTO
userDTO
)
{
CaseRuleConfigEntity
byCaseId
=
caseRuleConfigService
.
getByCaseId
(
userDTO
.
getCaseId
());
userDTO
.
setMinAmount
(
byCaseId
.
getMinAmount
());
userDTO
.
setMaxAmount
(
byCaseId
.
getMaxAmount
());
userDTO
.
setMinTransaction
(
byCaseId
.
getMinTransaction
());
userDTO
.
setMaxTransaction
(
byCaseId
.
getMaxTransaction
());
userDTO
.
setStartTime
(
byCaseId
.
getStartTime
());
userDTO
.
setEndTime
(
byCaseId
.
getEndTime
());
List
<
ExcelDataEntity
>
excelDataList
=
excelDataService
.
cashFlow
(
userDTO
);
List
<
ExcelDataEntity
>
excelDataList
=
excelDataService
.
cashFlow
(
userDTO
);
for
(
ExcelDataEntity
excelDataEntity
:
excelDataList
)
{
for
(
ExcelDataEntity
excelDataEntity
:
excelDataList
)
{
if
(
"出账"
.
equals
(
excelDataEntity
.
getDirection
()))
{
if
(
"出账"
.
equals
(
excelDataEntity
.
getDirection
()))
{
...
@@ -239,6 +252,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
...
@@ -239,6 +252,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override
@Override
public
EveryoneVO
relationPage
(
UserDTO
userDTO
)
{
public
EveryoneVO
relationPage
(
UserDTO
userDTO
)
{
CaseRuleConfigEntity
byCaseId
=
caseRuleConfigService
.
getByCaseId
(
userDTO
.
getCaseId
());
userDTO
.
setMinAmount
(
byCaseId
.
getMinAmount
());
userDTO
.
setMaxAmount
(
byCaseId
.
getMaxAmount
());
userDTO
.
setMinTransaction
(
byCaseId
.
getMinTransaction
());
userDTO
.
setMaxTransaction
(
byCaseId
.
getMaxTransaction
());
userDTO
.
setStartTime
(
byCaseId
.
getStartTime
());
userDTO
.
setEndTime
(
byCaseId
.
getEndTime
());
EveryoneVO
everyoneVO
=
new
EveryoneVO
();
EveryoneVO
everyoneVO
=
new
EveryoneVO
();
//标题
//标题
everyoneVO
.
setTitle
(
userDTO
.
getUserName
()
+
","
+
userDTO
.
getOtherName
());
everyoneVO
.
setTitle
(
userDTO
.
getUserName
()
+
","
+
userDTO
.
getOtherName
());
...
@@ -248,21 +268,18 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
...
@@ -248,21 +268,18 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
if
(!
ObjectUtils
.
isEmpty
(
userRelation
))
{
if
(!
ObjectUtils
.
isEmpty
(
userRelation
))
{
everyoneVO
.
setRelation
(
userRelation
);
everyoneVO
.
setRelation
(
userRelation
);
}
}
//查询账户
userDTO
.
setOtherUserName
(
userDTO
.
getOtherName
());
List
<
String
>
oneselfAccountList
=
userAccountService
.
queryUserAccountList
(
userDTO
.
getUserName
());
List
<
ExcelDataEntity
>
excelDataList
=
excelDataService
.
cashFlow
(
userDTO
);
List
<
ExcelDataVO
>
ExcelDataList
=
excelDataService
.
queryOtherAccountList
(
userDTO
.
getOtherName
(),
userDTO
.
getCaseId
());
for
(
ExcelDataEntity
excelDataEntity
:
excelDataList
)
{
Set
<
String
>
otherAccountSet
=
new
HashSet
<>();
if
(
"出账"
.
equals
(
excelDataEntity
.
getDirection
()))
{
for
(
ExcelDataVO
excelDataVO
:
ExcelDataList
)
{
excelDataEntity
.
setSelfAccount
(
excelDataEntity
.
getPayAccount
());
otherAccountSet
.
add
(
excelDataVO
.
getPayAccount
());
excelDataEntity
.
setAssociationAccount
(
excelDataEntity
.
getPayeeAccount
());
otherAccountSet
.
add
(
excelDataVO
.
getPaymentAccount
());
}
else
if
(
"入账"
.
equals
(
excelDataEntity
.
getDirection
()))
{
excelDataEntity
.
setSelfAccount
(
excelDataEntity
.
getPayeeAccount
());
excelDataEntity
.
setAssociationAccount
(
excelDataEntity
.
getPayAccount
());
}
}
List
<
String
>
otherAccountList
=
Lists
.
newArrayList
(
otherAccountSet
);
List
<
ExcelDataEntity
>
details
=
Lists
.
newArrayList
();
if
(!
ObjectUtils
.
isEmpty
(
oneselfAccountList
)
&&
!
ObjectUtils
.
isEmpty
(
otherAccountList
))
{
details
=
excelDataService
.
relationPage
(
oneselfAccountList
,
otherAccountList
,
userDTO
);
everyoneVO
.
setDetails
(
details
);
}
}
everyoneVO
.
setDetails
(
excelDataList
);
//汇总文字
//汇总文字
List
<
String
>
totalDescription
=
Lists
.
newArrayList
();
List
<
String
>
totalDescription
=
Lists
.
newArrayList
();
//入账次数
//入账次数
...
@@ -273,8 +290,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
...
@@ -273,8 +290,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
int
outCount
=
0
;
int
outCount
=
0
;
//出账合计
//出账合计
double
outTotal
=
0
;
double
outTotal
=
0
;
if
(!
details
.
isEmpty
())
{
if
(!
excelDataList
.
isEmpty
())
{
for
(
ExcelDataEntity
detail
:
details
)
{
for
(
ExcelDataEntity
detail
:
excelDataList
)
{
if
(
"入账"
.
equals
(
detail
.
getDirection
()))
{
if
(
"入账"
.
equals
(
detail
.
getDirection
()))
{
inCount
++;
inCount
++;
inTotal
+=
detail
.
getAmount
();
inTotal
+=
detail
.
getAmount
();
...
...
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