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
邬吉朋
integration
Commits
97341016
Commit
97341016
authored
Mar 10, 2026
by
wujipeng
Browse files
生成报表优化
parent
07fe980f
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/integration/service/impl/ReportServiceImpl.java
View file @
97341016
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.util.StringUtil
;
import
com.ruzhoukj.integration.mapper.ReportMapper
;
import
com.ruzhoukj.integration.mapper.ReportMapper
;
import
com.ruzhoukj.integration.pojo.dto.ReportDTO
;
import
com.ruzhoukj.integration.pojo.dto.ReportDTO
;
import
com.ruzhoukj.integration.pojo.entity.*
;
import
com.ruzhoukj.integration.pojo.entity.*
;
...
@@ -12,6 +13,7 @@ import com.ruzhoukj.integration.result.PageResult;
...
@@ -12,6 +13,7 @@ import com.ruzhoukj.integration.result.PageResult;
import
com.ruzhoukj.integration.service.*
;
import
com.ruzhoukj.integration.service.*
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -40,6 +42,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i
...
@@ -40,6 +42,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i
private
TemplateDetailBasicService
templateDetailBasicService
;
private
TemplateDetailBasicService
templateDetailBasicService
;
@Resource
@Resource
private
TemplateService
templateService
;
private
TemplateService
templateService
;
@Resource
private
MetaDataService
metaDataService
;
@Override
@Override
public
PageResult
<
ReportVO
>
getPageData
(
ReportDTO
reportDTO
)
{
public
PageResult
<
ReportVO
>
getPageData
(
ReportDTO
reportDTO
)
{
...
@@ -104,6 +108,17 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i
...
@@ -104,6 +108,17 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i
.
build
()
.
build
()
);
);
}
}
//查询具体值
for
(
ReportDetailBasicEntity
reportDetailBasic
:
reportDetailBasicList
)
{
if
(
"元数据"
.
equals
(
reportDetailBasic
.
getType
()))
{
MetaDataEntity
metaData
=
metaDataService
.
getById
(
reportDetailBasic
.
getMetaId
());
reportDetailBasic
.
setValue
(
String
.
valueOf
(
metaData
.
getValue
()));
}
else
if
(
"引用报表"
.
equals
(
reportDetailBasic
.
getType
()))
{
handleUseReport
(
reportDetailBasic
,
reportDTO
);
}
else
if
(
"静态值"
.
equals
(
reportDetailBasic
.
getType
()))
{
reportDetailBasic
.
setValue
(
reportDetailBasic
.
getStaticValue
());
}
}
reportDetailBasicService
.
saveBatch
(
reportDetailBasicList
);
reportDetailBasicService
.
saveBatch
(
reportDetailBasicList
);
//处理报表详情-复合
//处理报表详情-复合
List
<
ReportDetailMergeEntity
>
reportDetailMergeList
=
new
ArrayList
<>();
List
<
ReportDetailMergeEntity
>
reportDetailMergeList
=
new
ArrayList
<>();
...
@@ -136,4 +151,38 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i
...
@@ -136,4 +151,38 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i
reportConfigService
.
saveBatch
(
reportConfigList
);
reportConfigService
.
saveBatch
(
reportConfigList
);
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
}
}
private
void
handleUseReport
(
ReportDetailBasicEntity
reportDetailBasic
,
ReportDTO
reportDTO
)
{
if
(
ObjectUtils
.
isEmpty
(
reportDetailBasic
.
getUseReportId
()))
{
String
year
=
reportDTO
.
getYear
();
String
month
=
reportDTO
.
getMonth
();
String
day
=
reportDTO
.
getDay
();
if
(
"年"
.
equals
(
reportDetailBasic
.
getOffset
()))
{
year
=
String
.
valueOf
(
Integer
.
parseInt
(
year
)
+
reportDetailBasic
.
getOffsetNumber
());
}
else
if
(
"月"
.
equals
(
reportDetailBasic
.
getOffset
()))
{
month
=
String
.
valueOf
(
Integer
.
parseInt
(
month
)
+
reportDetailBasic
.
getOffsetNumber
());
}
else
if
(
"日"
.
equals
(
reportDetailBasic
.
getOffset
()))
{
day
=
String
.
valueOf
(
Integer
.
parseInt
(
day
)
+
reportDetailBasic
.
getOffsetNumber
());
}
ReportEntity
report
=
getOne
(
new
LambdaQueryWrapper
<
ReportEntity
>()
.
eq
(
ReportEntity:
:
getTemplateId
,
reportDetailBasic
.
getTemplateId
())
.
eq
(
ReportEntity:
:
getYear
,
year
)
.
eq
(
ReportEntity:
:
getMonth
,
month
)
.
eq
(
ReportEntity:
:
getDay
,
day
)
);
ReportDetailBasicEntity
reportDetailBasic1
=
reportDetailBasicService
.
getOne
(
new
LambdaQueryWrapper
<
ReportDetailBasicEntity
>()
.
eq
(
ReportDetailBasicEntity:
:
getTemplateId
,
reportDetailBasic
.
getTemplateId
())
.
eq
(
ReportDetailBasicEntity:
:
getLocation
,
reportDetailBasic
.
getLocation
())
.
eq
(
ReportDetailBasicEntity:
:
getReportId
,
report
.
getId
())
);
reportDetailBasic
.
setValue
(
reportDetailBasic1
.
getValue
());
}
else
{
ReportDetailBasicEntity
reportDetailBasic1
=
reportDetailBasicService
.
getOne
(
new
LambdaQueryWrapper
<
ReportDetailBasicEntity
>()
.
eq
(
ReportDetailBasicEntity:
:
getTemplateId
,
reportDetailBasic
.
getTemplateId
())
.
eq
(
ReportDetailBasicEntity:
:
getLocation
,
reportDetailBasic
.
getUseReportLocation
())
.
eq
(
ReportDetailBasicEntity:
:
getUseReportId
,
reportDetailBasic
.
getUseReportId
())
);
reportDetailBasic
.
setValue
(
reportDetailBasic1
.
getValue
());
}
}
}
}
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