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
07fe980f
Commit
07fe980f
authored
Mar 10, 2026
by
wujipeng
Browse files
优化
parent
a4b39a84
Changes
4
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
07fe980f
...
@@ -43,6 +43,11 @@
...
@@ -43,6 +43,11 @@
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
1.4.6
</version>
<version>
1.4.6
</version>
</dependency>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
5.8.38
</version>
</dependency>
</dependencies>
</dependencies>
<dependencyManagement>
<dependencyManagement>
<dependencies>
<dependencies>
...
...
src/main/java/com/ruzhoukj/integration/pojo/entity/ReportDetailBasicEntity.java
View file @
07fe980f
...
@@ -40,7 +40,7 @@ public class ReportDetailBasicEntity {
...
@@ -40,7 +40,7 @@ public class ReportDetailBasicEntity {
@ApiModelProperty
(
value
=
"值"
)
@ApiModelProperty
(
value
=
"值"
)
private
String
value
;
private
String
value
;
@ApiModelProperty
(
value
=
"数据类型"
)
@ApiModelProperty
(
value
=
"数据类型
(静态值、元数据、公式、引用报表)
"
)
private
String
type
;
private
String
type
;
@ApiModelProperty
(
value
=
"静态值"
)
@ApiModelProperty
(
value
=
"静态值"
)
...
...
src/main/java/com/ruzhoukj/integration/pojo/entity/TemplateDetailBasicEntity.java
View file @
07fe980f
...
@@ -36,7 +36,7 @@ public class TemplateDetailBasicEntity {
...
@@ -36,7 +36,7 @@ public class TemplateDetailBasicEntity {
@ApiModelProperty
(
value
=
"值"
)
@ApiModelProperty
(
value
=
"值"
)
private
String
value
;
private
String
value
;
@ApiModelProperty
(
value
=
"数据类型"
)
@ApiModelProperty
(
value
=
"数据类型
(静态值、元数据、公式、引用报表)
"
)
private
String
type
;
private
String
type
;
@ApiModelProperty
(
value
=
"静态值"
)
@ApiModelProperty
(
value
=
"静态值"
)
...
...
src/main/java/com/ruzhoukj/integration/service/impl/TemplateServiceImpl.java
View file @
07fe980f
package
com.ruzhoukj.integration.service.impl
;
package
com.ruzhoukj.integration.service.impl
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
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.ruzhoukj.integration.mapper.TemplateMapper
;
import
com.ruzhoukj.integration.mapper.TemplateMapper
;
import
com.ruzhoukj.integration.pojo.dto.TemplateDTO
;
import
com.ruzhoukj.integration.pojo.dto.TemplateDTO
;
import
com.ruzhoukj.integration.pojo.entity.*
;
import
com.ruzhoukj.integration.pojo.entity.TemplateConfigEntity
;
import
com.ruzhoukj.integration.pojo.entity.TemplateDetailBasicEntity
;
import
com.ruzhoukj.integration.pojo.entity.TemplateDetailMergeEntity
;
import
com.ruzhoukj.integration.pojo.entity.TemplateEntity
;
import
com.ruzhoukj.integration.pojo.vo.TemplateVO
;
import
com.ruzhoukj.integration.pojo.vo.TemplateVO
;
import
com.ruzhoukj.integration.result.PageResult
;
import
com.ruzhoukj.integration.result.PageResult
;
import
com.ruzhoukj.integration.service.*
;
import
com.ruzhoukj.integration.service.TemplateConfigService
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.ruzhoukj.integration.service.TemplateDetailBasicService
;
import
com.ruzhoukj.integration.service.TemplateDetailMergeService
;
import
com.ruzhoukj.integration.service.TemplateService
;
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
org.springframework.util.ObjectUtils
;
...
@@ -30,7 +34,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, TemplateEnt
...
@@ -30,7 +34,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, TemplateEnt
@Resource
@Resource
private
TemplateDetailBasicService
templateDetailBasicService
;
private
TemplateDetailBasicService
templateDetailBasicService
;
// @Resource
// @Resource
// private TemplateExpansionService templateExpansionService;
// private TemplateExpansionService templateExpansionService;
@Resource
@Resource
private
TemplateDetailMergeService
templateDetailMergeService
;
private
TemplateDetailMergeService
templateDetailMergeService
;
...
@@ -43,31 +47,33 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, TemplateEnt
...
@@ -43,31 +47,33 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, TemplateEnt
//判断是新增还是编辑
//判断是新增还是编辑
if
(
templateDTO
.
getId
()
==
null
)
{
if
(
templateDTO
.
getId
()
==
null
)
{
//新增模板
//新增模板
templateDTO
.
set
Id
(
"1.0"
);
templateDTO
.
set
Version
(
"1.0"
);
save
(
templateDTO
);
save
(
templateDTO
);
//初始化模板所有单元格位置
//初始化模板所有单元格位置
List
<
String
>
locations
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
templateDTO
.
getLineNumber
())
&&
!
ObjectUtils
.
isEmpty
(
templateDTO
.
getColumnNumber
()))
{
for
(
int
row
=
1
;
row
<=
templateDTO
.
getLineNumber
();
row
++)
{
List
<
String
>
locations
=
new
ArrayList
<>();
for
(
int
col
=
0
;
col
<
templateDTO
.
getColumnNumber
();
col
++)
{
for
(
int
row
=
1
;
row
<=
templateDTO
.
getLineNumber
();
row
++)
{
String
columnLabel
=
getExcelColumnLabel
(
col
);
for
(
int
col
=
0
;
col
<
templateDTO
.
getColumnNumber
();
col
++)
{
locations
.
add
(
columnLabel
+
row
);
String
columnLabel
=
getExcelColumnLabel
(
col
);
locations
.
add
(
columnLabel
+
row
);
}
}
}
}
//初始化模板详情和模板拓展
//初始化模板详情和模板拓展
List
<
TemplateDetailBasicEntity
>
templateDetailList
=
new
ArrayList
<>();
List
<
TemplateDetailBasicEntity
>
templateDetailList
=
new
ArrayList
<>();
// List<TemplateExpansionEntity> templateExpansionList = new ArrayList<>();
// List<TemplateExpansionEntity> templateExpansionList = new ArrayList<>();
for
(
String
location
:
locations
)
{
for
(
String
location
:
locations
)
{
templateDetailList
.
add
(
TemplateDetailBasicEntity
.
builder
()
templateDetailList
.
add
(
TemplateDetailBasicEntity
.
builder
()
.
templateId
(
templateDTO
.
getId
())
.
templateId
(
templateDTO
.
getId
())
.
location
(
location
)
.
location
(
location
)
.
build
());
.
build
());
// templateExpansionList.add(TemplateExpansionEntity.builder()
// templateExpansionList.add(TemplateExpansionEntity.builder()
// .templateId(templateDTO.getId())
// .templateId(templateDTO.getId())
// .location(location)
// .location(location)
// .build());
// .build());
}
}
templateDetailBasicService
.
saveBatch
(
templateDetailList
);
templateDetailBasicService
.
saveBatch
(
templateDetailList
);
// templateExpansionService.saveBatch(templateExpansionList);
// templateExpansionService.saveBatch(templateExpansionList);
}
}
else
{
}
else
{
//编辑模板
//编辑模板
updateById
(
templateDTO
);
updateById
(
templateDTO
);
...
@@ -89,10 +95,10 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, TemplateEnt
...
@@ -89,10 +95,10 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, TemplateEnt
Map
<
String
,
TemplateConfigEntity
>
rows
=
templateDTO
.
getRows
();
Map
<
String
,
TemplateConfigEntity
>
rows
=
templateDTO
.
getRows
();
Map
<
String
,
TemplateConfigEntity
>
columns
=
templateDTO
.
getColumns
();
Map
<
String
,
TemplateConfigEntity
>
columns
=
templateDTO
.
getColumns
();
List
<
TemplateConfigEntity
>
templateConfigList
=
new
ArrayList
<>();
List
<
TemplateConfigEntity
>
templateConfigList
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
rows
)){
if
(!
ObjectUtils
.
isEmpty
(
rows
))
{
templateConfigList
.
addAll
(
rows
.
values
());
templateConfigList
.
addAll
(
rows
.
values
());
}
}
if
(!
ObjectUtils
.
isEmpty
(
columns
)){
if
(!
ObjectUtils
.
isEmpty
(
columns
))
{
templateConfigList
.
addAll
(
columns
.
values
());
templateConfigList
.
addAll
(
columns
.
values
());
}
}
templateConfigService
.
saveOrUpdateBatch
(
templateConfigList
);
templateConfigService
.
saveOrUpdateBatch
(
templateConfigList
);
...
@@ -219,7 +225,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, TemplateEnt
...
@@ -219,7 +225,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, TemplateEnt
Map
<
String
,
TemplateConfigEntity
>
rows
=
new
HashMap
<>();
Map
<
String
,
TemplateConfigEntity
>
rows
=
new
HashMap
<>();
Map
<
String
,
TemplateConfigEntity
>
columns
=
new
HashMap
<>();
Map
<
String
,
TemplateConfigEntity
>
columns
=
new
HashMap
<>();
for
(
TemplateConfigEntity
templateConfigEntity
:
templateConfigList
)
{
for
(
TemplateConfigEntity
templateConfigEntity
:
templateConfigList
)
{
if
(
"row"
.
equals
(
templateConfigEntity
.
getType
())){
if
(
"row"
.
equals
(
templateConfigEntity
.
getType
()))
{
rows
.
put
(
templateConfigEntity
.
getNum
(),
templateConfigEntity
);
rows
.
put
(
templateConfigEntity
.
getNum
(),
templateConfigEntity
);
}
else
{
}
else
{
columns
.
put
(
templateConfigEntity
.
getNum
(),
templateConfigEntity
);
columns
.
put
(
templateConfigEntity
.
getNum
(),
templateConfigEntity
);
...
...
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