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
895f62a9
Commit
895f62a9
authored
Nov 07, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MVP1.7.17-模板优化
parent
fb48a769
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
92 deletions
+100
-92
FascServiceImpl.java
...d/plus/v1/yifu/archives/service/impl/FascServiceImpl.java
+100
-92
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FascServiceImpl.java
View file @
895f62a9
...
...
@@ -79,106 +79,114 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
}
List
<
TFascCompany
>
companyList
=
tFascCompanyService
.
getTFascCompanyAllList
();
if
(
companyList
!=
null
&&
!
companyList
.
isEmpty
())
{
// templateName 签署任务模板名称
List
<
TFascTemplate
>
tList
=
new
ArrayList
<>();
List
<
SignTemplateListInfo
>
listSubList
;
List
<
TFascTemplate
>
tempList
=
new
ArrayList
<>();
List
<
TFascTemplateDetail
>
detailList
=
new
ArrayList
<>();
List
<
TFascTemplateDetail
>
detailSubList
;
for
(
TFascCompany
company
:
companyList
)
{
listSubList
=
fascUtil
.
getTemplateList
(
templateName
,
tFascPushLogService
,
company
);
if
(
listSubList
!=
null
&&
!
listSubList
.
isEmpty
())
{
detailSubList
=
new
ArrayList
<>();
fascUtil
.
getTemplateDetailList
(
listSubList
,
tempList
,
detailSubList
,
tFascPushLogService
,
company
);
if
(!
tempList
.
isEmpty
()
&&
!
detailSubList
.
isEmpty
())
{
tList
.
addAll
(
tempList
);
detailList
.
addAll
(
detailSubList
);
}
}
}
// templateName 签署任务模板名称
List
<
SignTemplateListInfo
>
list
=
fascUtil
.
getTemplateList
(
templateName
,
tFascPushLogService
,
company
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
List
<
TFascTemplate
>
tList
=
new
ArrayList
<>();
List
<
TFascTemplateDetail
>
detailList
=
new
ArrayList
<>();
fascUtil
.
getTemplateDetailList
(
list
,
tList
,
detailList
,
tFascPushLogService
,
company
);
// 拉取到数据再更新:
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
<>();
// 拉取到数据再更新:
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
<>();
List
<
TFascTemplate
>
allMain
=
tFascTemplateService
.
getTFascTemplateListAll
(
null
);
List
<
TFascTemplateDetail
>
allDetail
=
tFascTemplateDetailService
.
getTFascTemplateDetailList
(
null
);
List
<
TFascEditLog
>
logList
=
new
ArrayList
<>();
if
(
allMain
==
null
||
allMain
.
isEmpty
())
{
// 都是新的:
tFascTemplateService
.
saveBatch
(
tList
);
tFascTemplateDetailService
.
saveOrUpdateBatch
(
detailList
);
for
(
TFascTemplate
t
:
tList
)
{
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
ONE_STRING
,
editContent1
,
logList
,
userId
,
userName
);
}
for
(
TFascTemplateDetail
t
:
detailList
)
{
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
TWO_STRING
,
editContent1
,
logList
,
userId
,
userName
);
}
List
<
TFascTemplate
>
allMain
=
tFascTemplateService
.
getTFascTemplateListAll
(
null
);
List
<
TFascTemplateDetail
>
allDetail
=
tFascTemplateDetailService
.
getTFascTemplateDetailList
(
null
);
List
<
TFascEditLog
>
logList
=
new
ArrayList
<>();
if
(
allMain
==
null
||
allMain
.
isEmpty
())
{
// 都是新的:
tFascTemplateService
.
saveBatch
(
tList
);
tFascTemplateDetailService
.
saveOrUpdateBatch
(
detailList
);
for
(
TFascTemplate
t
:
tList
)
{
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
ONE_STRING
,
editContent1
,
logList
,
userId
,
userName
);
}
for
(
TFascTemplateDetail
t
:
detailList
)
{
this
.
addFascLogToList
(
t
.
getId
(),
CommonConstants
.
TWO_STRING
,
editContent1
,
logList
,
userId
,
userName
);
}
}
else
{
// 混合老新数据
Map
<
String
,
TFascTemplate
>
oldMainMap
=
new
HashMap
<>();
Map
<
String
,
TFascTemplateDetail
>
oldDetailMap
=
new
HashMap
<>();
for
(
TFascTemplate
t
:
allMain
)
{
oldMainMap
.
put
(
t
.
getSignTemplateId
(),
t
);
}
for
(
TFascTemplateDetail
t
:
allDetail
)
{
oldDetailMap
.
put
(
t
.
getSignTemplateId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
t
.
getFascFieldId
(),
t
);
}
// 主表:
TFascTemplate
oldMain
;
String
logId
;
for
(
TFascTemplate
t
:
tList
)
{
oldMain
=
oldMainMap
.
get
(
t
.
getSignTemplateId
());
if
(
oldMain
!=
null
)
{
t
.
setId
(
oldMain
.
getId
());
}
else
{
// 混合老新数据
Map
<
String
,
TFascTemplate
>
oldMainMap
=
new
HashMap
<>();
Map
<
String
,
TFascTemplateDetail
>
oldDetailMap
=
new
HashMap
<>();
for
(
TFascTemplate
t
:
allMain
)
{
oldMainMap
.
put
(
t
.
getSignTemplateId
(),
t
);
}
for
(
TFascTemplateDetail
t
:
allDetail
)
{
oldDetailMap
.
put
(
t
.
getSignTemplateId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
t
.
getFascFieldId
(),
t
);
}
// 主表:
TFascTemplate
oldMain
;
String
logId
;
for
(
TFascTemplate
t
:
tList
)
{
oldMain
=
oldMainMap
.
get
(
t
.
getSignTemplateId
());
if
(
oldMain
!=
null
)
{
t
.
setId
(
oldMain
.
getId
());
}
else
{
logId
=
String
.
valueOf
(
UUID
.
randomUUID
()).
replaceAll
(
"-"
,
""
);
t
.
setId
(
logId
);
}
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
,
userId
,
userName
);
t
.
setDeleteFlag
(
CommonConstants
.
DELETE_FLAG
);
updateMain
.
add
(
t
);
}
// 映射表:
TFascTemplateDetail
oldDetail
;
for
(
TFascTemplateDetail
t
:
detailList
)
{
oldDetail
=
oldDetailMap
.
get
(
t
.
getSignTemplateId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
t
.
getFascFieldId
());
if
(
oldDetail
!=
null
)
{
t
.
setId
(
oldDetail
.
getId
());
t
.
setHrField
(
oldDetail
.
getHrField
());
t
.
setHrFieldId
(
oldDetail
.
getHrFieldId
());
}
else
{
logId
=
String
.
valueOf
(
UUID
.
randomUUID
()).
replaceAll
(
"-"
,
""
);
t
.
setId
(
logId
);
}
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
,
userId
,
userName
);
t
.
setDeleteFlag
(
CommonConstants
.
DELETE_FLAG
);
updateDetail
.
add
(
t
);
}
logId
=
String
.
valueOf
(
UUID
.
randomUUID
()).
replaceAll
(
"-"
,
""
);
t
.
setId
(
logId
);
}
// 更新日志
if
(!
logList
.
isEmpty
())
{
tFascEditLogService
.
saveBatch
(
logList
);
}
// 更新模板
if
(!
updateMain
.
isEmpty
())
{
tFascTemplateService
.
saveOrUpdateBatch
(
updateMain
);
}
// 更新模板映射
if
(!
updateDetail
.
isEmpty
())
{
tFascTemplateDetailService
.
saveOrUpdateBatch
(
updateDetail
);
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
,
userId
,
userName
);
t
.
setDeleteFlag
(
CommonConstants
.
DELETE_FLAG
);
updateMain
.
add
(
t
);
}
// 映射表:
TFascTemplateDetail
oldDetail
;
for
(
TFascTemplateDetail
t
:
detailList
)
{
oldDetail
=
oldDetailMap
.
get
(
t
.
getSignTemplateId
()
+
CommonConstants
.
DOWN_LINE_STRING
+
t
.
getFascFieldId
());
if
(
oldDetail
!=
null
)
{
t
.
setId
(
oldDetail
.
getId
());
t
.
setHrField
(
oldDetail
.
getHrField
());
t
.
setHrFieldId
(
oldDetail
.
getHrFieldId
());
}
else
{
logId
=
String
.
valueOf
(
UUID
.
randomUUID
()).
replaceAll
(
"-"
,
""
);
t
.
setId
(
logId
);
}
// 重新刷新主模板表的必填是否已填
tFascTemplateDetailService
.
initFascTemplateIsMust
(
null
);
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
,
userId
,
userName
);
t
.
setDeleteFlag
(
CommonConstants
.
DELETE_FLAG
);
updateDetail
.
add
(
t
);
}
}
// 更新日志
if
(!
logList
.
isEmpty
())
{
tFascEditLogService
.
saveBatch
(
logList
);
}
// 更新模板
if
(!
updateMain
.
isEmpty
())
{
tFascTemplateService
.
saveOrUpdateBatch
(
updateMain
);
}
// 更新模板映射
if
(!
updateDetail
.
isEmpty
())
{
tFascTemplateDetailService
.
saveOrUpdateBatch
(
updateDetail
);
}
// 重新刷新主模板表的必填是否已填
tFascTemplateDetailService
.
initFascTemplateIsMust
(
null
);
}
}
return
R
.
ok
();
...
...
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