Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
030b1b0a
Commit
030b1b0a
authored
Oct 28, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.16-优化代码
parent
8e0e23ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
FascServiceImpl.java
...d/plus/v1/yifu/archives/service/impl/FascServiceImpl.java
+24
-7
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FascServiceImpl.java
View file @
030b1b0a
...
...
@@ -31,10 +31,13 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.*
;
/**
...
...
@@ -67,6 +70,13 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
@Override
public
R
<
String
>
getTemplate
(
String
templateName
)
throws
ApiException
{
String
userId
=
"-1"
;
String
userName
=
"系统"
;
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
!=
null
&&
Common
.
isNotNull
(
user
.
getId
()))
{
userId
=
user
.
getId
();
userName
=
user
.
getNickname
();
}
List
<
TFascCompany
>
companyList
=
tFascCompanyService
.
getTFascCompanyAllList
();
if
(
companyList
!=
null
&&
!
companyList
.
isEmpty
())
{
for
(
TFascCompany
company
:
companyList
)
{
...
...
@@ -81,6 +91,10 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
if
(!
tList
.
isEmpty
()
&&
!
detailList
.
isEmpty
())
{
String
editContent1
=
"定时任务同步,拉取到数据"
;
String
editContent2
=
"定时任务同步,法大大无该数据"
;
if
(!
"-1"
.
equals
(
userId
))
{
editContent1
=
"手动拉取任务同步,拉取到数据"
;
editContent2
=
"手动拉取任务同步,法大大无该数据"
;
}
List
<
TFascTemplate
>
updateMain
=
new
ArrayList
<>();
List
<
TFascTemplateDetail
>
updateDetail
=
new
ArrayList
<>();
...
...
@@ -92,10 +106,10 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
tFascTemplateService
.
saveBatch
(
tList
);
tFascTemplateDetailService
.
saveOrUpdateBatch
(
detailList
);
for
(
TFascTemplate
t
:
tList
)
{
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
ONE_STRING
,
editContent1
,
logList
);
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
ONE_STRING
,
editContent1
,
logList
,
userId
,
userName
);
}
for
(
TFascTemplateDetail
t
:
detailList
)
{
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
TWO_STRING
,
editContent1
,
logList
);
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
TWO_STRING
,
editContent1
,
logList
,
userId
,
userName
);
}
}
else
{
// 混合老新数据
...
...
@@ -118,12 +132,12 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
logId
=
String
.
valueOf
(
UUID
.
randomUUID
()).
replaceAll
(
"-"
,
""
);
t
.
setId
(
logId
);
}
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
ONE_STRING
,
editContent1
,
logList
);
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
ONE_STRING
,
editContent1
,
logList
,
userId
,
userName
);
updateMain
.
add
(
t
);
oldMainMap
.
remove
(
t
.
getSignTemplateId
());
}
for
(
TFascTemplate
t
:
oldMainMap
.
values
())
{
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
ONE_STRING
,
editContent2
,
logList
);
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
ONE_STRING
,
editContent2
,
logList
,
userId
,
userName
);
t
.
setDeleteFlag
(
CommonConstants
.
DELETE_FLAG
);
updateMain
.
add
(
t
);
}
...
...
@@ -139,12 +153,12 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
logId
=
String
.
valueOf
(
UUID
.
randomUUID
()).
replaceAll
(
"-"
,
""
);
t
.
setId
(
logId
);
}
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
TWO_STRING
,
editContent1
,
logList
);
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
TWO_STRING
,
editContent1
,
logList
,
userId
,
userName
);
updateDetail
.
add
(
t
);
oldDetailMap
.
remove
(
t
.
getSignTemplateId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
t
.
getFascFieldId
());
}
for
(
TFascTemplateDetail
t
:
oldDetailMap
.
values
())
{
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
TWO_STRING
,
editContent2
,
logList
);
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
TWO_STRING
,
editContent2
,
logList
,
userId
,
userName
);
t
.
setDeleteFlag
(
CommonConstants
.
DELETE_FLAG
);
updateDetail
.
add
(
t
);
}
...
...
@@ -190,11 +204,14 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
/**
* 向list里添加新日志
*/
private
void
addFascLogToList
(
String
mainId
,
String
mainType
,
String
editContent
,
List
<
TFascEditLog
>
logList
)
{
private
void
addFascLogToList
(
String
mainId
,
String
mainType
,
String
editContent
,
List
<
TFascEditLog
>
logList
,
String
userId
,
String
userName
)
{
TFascEditLog
log
=
new
TFascEditLog
();
log
.
setMainId
(
mainId
);
log
.
setMainType
(
mainType
);
log
.
setEditContent
(
editContent
);
log
.
setCreateBy
(
userId
);
log
.
setCreateName
(
userName
);
log
.
setCreateTime
(
LocalDateTime
.
now
());
logList
.
add
(
log
);
}
...
...
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