Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-link-report
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-link-report
Commits
0b4301eb
提交
0b4301eb
authored
3月 20, 2025
作者:
吕本才
提交者:
Coding
3月 20, 2025
浏览文件
操作
浏览文件
下载
差异文件
Accept Merge Request #107: (qa -> main)
Merge Request: 修改优化供应链报表显示,增加财务报表 Created By: @吕本才 Accepted By: @吕本才 URL:
https://g-pkkp8204.coding.net/p/wangxiaolu-sfa/d/wangxiaolu-link-report/git/merge/107?initial=true
上级
e12ea7c9
27610fa1
显示空白字符变更
内嵌
并排
正在显示
44 个修改的文件
包含
965 行增加
和
18 行删除
+965
-18
pom.xml
pom.xml
+9
-1
MybatisPlusConfig.java
.../java/com/link/report/config/mysql/MybatisPlusConfig.java
+22
-0
CustomerReportCoreController.java
.../report/controller/core/CustomerReportCoreController.java
+31
-0
CustomerReportGroupCoreController.java
...rt/controller/core/CustomerReportGroupCoreController.java
+33
-0
CustomerReportGroupQueryController.java
.../controller/query/CustomerReportGroupQueryController.java
+33
-0
CustomerReportQueryController.java
...eport/controller/query/CustomerReportQueryController.java
+32
-0
ReportShareQueryController.java
...k/report/controller/query/ReportShareQueryController.java
+4
-2
CustomerGroupDao.java
...ain/java/com/link/report/domain/dao/CustomerGroupDao.java
+10
-0
CustomerReportDao.java
...in/java/com/link/report/domain/dao/CustomerReportDao.java
+15
-0
CustomerReportGroupDao.java
...va/com/link/report/domain/dao/CustomerReportGroupDao.java
+16
-0
CustomerGroupDaoImpl.java
...com/link/report/domain/dao/impl/CustomerGroupDaoImpl.java
+42
-0
CustomerReportDaoImpl.java
...om/link/report/domain/dao/impl/CustomerReportDaoImpl.java
+56
-0
CustomerReportGroupDaoImpl.java
...nk/report/domain/dao/impl/CustomerReportGroupDaoImpl.java
+41
-0
ReportShareDaoImpl.java
...a/com/link/report/domain/dao/impl/ReportShareDaoImpl.java
+0
-1
CustomerGroup.java
...ain/java/com/link/report/domain/entity/CustomerGroup.java
+57
-0
CustomerReport.java
...in/java/com/link/report/domain/entity/CustomerReport.java
+25
-0
CustomerReportGroup.java
...va/com/link/report/domain/entity/CustomerReportGroup.java
+21
-0
CustomerGroupMapper.java
...va/com/link/report/domain/mapper/CustomerGroupMapper.java
+9
-0
CustomerReportGroupMapper.java
.../link/report/domain/mapper/CustomerReportGroupMapper.java
+16
-0
CustomerReportMapper.java
...a/com/link/report/domain/mapper/CustomerReportMapper.java
+10
-0
CustomerGroupQueryWq.java
.../java/com/link/report/domain/wq/CustomerGroupQueryWq.java
+9
-0
CustomerReportAddWq.java
...n/java/com/link/report/domain/wq/CustomerReportAddWq.java
+10
-0
CustomerReportGroupWq.java
...java/com/link/report/domain/wq/CustomerReportGroupWq.java
+10
-0
CustomerReportQueryWq.java
...java/com/link/report/domain/wq/CustomerReportQueryWq.java
+10
-0
ReportShareListWq.java
...ain/java/com/link/report/domain/wq/ReportShareListWq.java
+3
-0
CustomerReportAddVo.java
...ava/com/link/report/pojo/request/CustomerReportAddVo.java
+15
-0
CustomerReportGroupVo.java
...a/com/link/report/pojo/request/CustomerReportGroupVo.java
+13
-0
CustomerReportQueryListVo.java
...m/link/report/pojo/request/CustomerReportQueryListVo.java
+13
-0
ReportShareListVo.java
.../java/com/link/report/pojo/request/ReportShareListVo.java
+7
-0
CustomerGroupDto.java
.../java/com/link/report/pojo/response/CustomerGroupDto.java
+11
-0
CustomerReportGroupListDto.java
...link/report/pojo/response/CustomerReportGroupListDto.java
+13
-0
CustomerReportGroupQueryListDto.java
...report/pojo/response/CustomerReportGroupQueryListDto.java
+13
-0
CustomerReportGroupResDto.java
.../link/report/pojo/response/CustomerReportGroupResDto.java
+17
-0
CustomerReportListDto.java
.../com/link/report/pojo/response/CustomerReportListDto.java
+15
-0
ReportItemsDto.java
...in/java/com/link/report/pojo/response/ReportItemsDto.java
+17
-0
ReportShareBiListDto.java
...a/com/link/report/pojo/response/ReportShareBiListDto.java
+7
-9
CustomerReportGroupService.java
...a/com/link/report/service/CustomerReportGroupService.java
+13
-0
CustomerReportService.java
...n/java/com/link/report/service/CustomerReportService.java
+13
-0
CustomerReportGroupServiceImpl.java
...k/report/service/impl/CustomerReportGroupServiceImpl.java
+104
-0
CustomerReportServiceImpl.java
...m/link/report/service/impl/CustomerReportServiceImpl.java
+42
-0
JimuReportTokenServiceImpl.java
.../link/report/service/impl/JimuReportTokenServiceImpl.java
+2
-1
CustomerReportGroupMapper.xml
...ain/resources/mapper/report/CustomerReportGroupMapper.xml
+81
-0
CustomerReportMapper.xml
src/main/resources/mapper/report/CustomerReportMapper.xml
+27
-0
ReportShareBiMapper.xml
src/main/resources/mapper/report/ReportShareBiMapper.xml
+18
-4
没有找到文件。
pom.xml
浏览文件 @
0b4301eb
...
...
@@ -62,6 +62,7 @@
<artifactId>
wangxiaolu-sfa-common-datasource
</artifactId>
</dependency>
<!-- RuoYi Common DataScope -->
<dependency>
<groupId>
com.wangxiaolu.sfa
</groupId>
...
...
@@ -74,7 +75,14 @@
<artifactId>
wangxiaolu-sfa-common-log
</artifactId>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>
com.mysql
</groupId>
...
...
src/main/java/com/link/report/config/mysql/MybatisPlusConfig.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
config
.
mysql
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
/**
* @author : liqiulin
* @date : 2024-04-25 13
* @describe :
*/
@Configuration
public
class
MybatisPlusConfig
{
@Bean
public
MybatisPlusInterceptor
mybatisPlusInterceptor
(){
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
interceptor
.
addInnerInterceptor
(
new
PaginationInnerInterceptor
());
return
interceptor
;
}
}
src/main/java/com/link/report/controller/core/CustomerReportCoreController.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
controller
.
core
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
import
com.link.report.service.CustomerReportService
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author : liqiulin
* @date : 2024-12-04 15
* @describe : 自定义报表管理
*/
@RestController
@RequestMapping
(
"/customer/core"
)
public
class
CustomerReportCoreController
{
@Autowired
CustomerReportService
customerReportService
;
@RequiresPermissions
(
"bi:supply:list"
)
@PostMapping
(
"/save"
)
public
R
save
(
@RequestBody
CustomerReportAddVo
customerReportAddVo
)
{
customerReportService
.
save
(
customerReportAddVo
);
return
R
.
ok
();
}
}
src/main/java/com/link/report/controller/core/CustomerReportGroupCoreController.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
controller
.
core
;
import
com.link.report.pojo.request.CustomerReportGroupVo
;
import
com.link.report.service.CustomerReportGroupService
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* @author : liqiulin
* @date : 2024-12-04 15
* @describe : 自定义报表管理
*/
@RestController
@RequestMapping
(
"/customer/core"
)
public
class
CustomerReportGroupCoreController
{
@Autowired
CustomerReportGroupService
customerReportGroupService
;
@RequiresPermissions
(
"bi:supply:list"
)
@PostMapping
(
"/group/save"
)
public
R
insertOrUpdate
(
@RequestBody
List
<
CustomerReportGroupVo
>
vos
)
{
customerReportGroupService
.
save
(
vos
);
return
R
.
ok
();
}
}
src/main/java/com/link/report/controller/query/CustomerReportGroupQueryController.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
controller
.
query
;
import
com.link.report.pojo.request.CustomerReportQueryListVo
;
import
com.link.report.pojo.response.CustomerReportGroupResDto
;
import
com.link.report.service.CustomerReportGroupService
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* @author : liqiulin
* @date : 2024-12-04 15
* @describe : 自定义报表管理
*/
@RestController
@RequestMapping
(
"/customer/query"
)
public
class
CustomerReportGroupQueryController
{
@Autowired
CustomerReportGroupService
customerReportGroupService
;
@RequiresPermissions
(
"bi:supply:list"
)
@GetMapping
(
"/group/list"
)
public
R
<
List
<
CustomerReportGroupResDto
>>
queryList
(
CustomerReportQueryListVo
vo
)
{
List
<
CustomerReportGroupResDto
>
dtos
=
customerReportGroupService
.
queryList
(
vo
);
return
R
.
ok
(
dtos
);
}
}
src/main/java/com/link/report/controller/query/CustomerReportQueryController.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
controller
.
query
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
com.link.report.service.CustomerReportService
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* @author : liqiulin
* @date : 2024-12-04 15
* @describe : 自定义报表管理
*/
@RestController
@RequestMapping
(
"/customer/query"
)
public
class
CustomerReportQueryController
{
@Autowired
CustomerReportService
customerReportService
;
@RequiresPermissions
(
"bi:supply:list"
)
@GetMapping
(
"/list"
)
public
R
<
List
<
CustomerReportListDto
>>
queryList
()
{
List
<
CustomerReportListDto
>
customerReportListDtos
=
customerReportService
.
queryCustomerReportList
();
return
R
.
ok
(
customerReportListDtos
);
}
}
src/main/java/com/link/report/controller/query/ReportShareQueryController.java
浏览文件 @
0b4301eb
...
...
@@ -6,6 +6,7 @@ import com.link.report.service.ReportShareService;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.core.web.controller.BaseController
;
import
com.sfa.common.datascope.annotation.DataScope
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -20,7 +21,7 @@ import java.util.List;
* @date 2024-12-19
*/
@RestController
@RequestMapping
(
"/share"
)
@RequestMapping
(
"/
customer/
share"
)
public
class
ReportShareQueryController
extends
BaseController
{
@Autowired
...
...
@@ -28,12 +29,13 @@ public class ReportShareQueryController extends BaseController {
/**
* 直播间分类的页面查询
*
* @param reportShareListVo
* @return
*/
// @RequiresPermissions("report:jimu:list")
@DataScope
(
deptAlias
=
"d"
,
userAlias
=
"u"
)
@GetMapping
(
"/list"
)
@RequiresPermissions
(
"bi:supply:list"
)
public
R
<
List
<
ReportShareBiListDto
>>
selectList
(
ReportShareListVo
reportShareListVo
)
{
List
<
ReportShareBiListDto
>
reportShareBiListDtos
=
reportShareService
.
selectList
(
reportShareListVo
);
return
R
.
ok
(
reportShareBiListDtos
);
...
...
src/main/java/com/link/report/domain/dao/CustomerGroupDao.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
dao
;
import
com.link.report.domain.wq.CustomerGroupQueryWq
;
import
com.link.report.pojo.response.CustomerGroupDto
;
import
java.util.List
;
public
interface
CustomerGroupDao
{
List
<
CustomerGroupDto
>
queryList
(
CustomerGroupQueryWq
wq
);
}
src/main/java/com/link/report/domain/dao/CustomerReportDao.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
dao
;
import
com.link.report.domain.wq.CustomerReportAddWq
;
import
com.link.report.domain.wq.CustomerReportQueryWq
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
java.util.List
;
public
interface
CustomerReportDao
{
void
insert
(
CustomerReportAddWq
wq
);
void
update
(
CustomerReportAddWq
wq
);
List
<
CustomerReportListDto
>
queryCustomerReportList
(
CustomerReportQueryWq
wq
);
}
src/main/java/com/link/report/domain/dao/CustomerReportGroupDao.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
dao
;
import
com.link.report.domain.entity.CustomerReportGroup
;
import
com.link.report.pojo.response.CustomerReportGroupQueryListDto
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
CustomerReportGroupDao
{
List
<
CustomerReportGroupQueryListDto
>
queryList
();
void
deleteByCreatorId
(
Long
userId
);
void
batchInsert
(
List
<
CustomerReportGroup
>
items
);
}
src/main/java/com/link/report/domain/dao/impl/CustomerGroupDaoImpl.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
dao
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.link.report.domain.dao.CustomerGroupDao
;
import
com.link.report.domain.entity.CustomerGroup
;
import
com.link.report.domain.mapper.CustomerGroupMapper
;
import
com.link.report.domain.wq.CustomerGroupQueryWq
;
import
com.link.report.pojo.response.CustomerGroupDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 报表分享数据
*/
@Component
public
class
CustomerGroupDaoImpl
implements
CustomerGroupDao
{
@Autowired
private
CustomerGroupMapper
groupMapper
;
@Override
public
List
<
CustomerGroupDto
>
queryList
(
CustomerGroupQueryWq
wq
)
{
Wrapper
<
CustomerGroup
>
wraper
=
new
LambdaQueryWrapper
<
CustomerGroup
>()
.
eq
(
ObjectUtil
.
isNotEmpty
(
wq
.
getCategoryName
()),
CustomerGroup:
:
getCategoryName
,
wq
.
getCategoryName
());
List
<
CustomerGroup
>
customerGroups
=
groupMapper
.
selectList
(
wraper
);
List
<
CustomerGroupDto
>
result
=
new
ArrayList
<>();
for
(
CustomerGroup
customerGroup
:
customerGroups
)
{
CustomerGroupDto
dto
=
new
CustomerGroupDto
();
dto
.
setGroupId
(
customerGroup
.
getId
());
dto
.
setGroupName
(
customerGroup
.
getName
());
dto
.
setCatalogName
(
customerGroup
.
getCategoryName
());
result
.
add
(
dto
);
}
return
result
;
}
}
src/main/java/com/link/report/domain/dao/impl/CustomerReportDaoImpl.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
dao
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.link.report.domain.dao.CustomerReportDao
;
import
com.link.report.domain.entity.CustomerReport
;
import
com.link.report.domain.mapper.CustomerReportMapper
;
import
com.link.report.domain.wq.CustomerReportAddWq
;
import
com.link.report.domain.wq.CustomerReportQueryWq
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
com.sfa.common.core.utils.bean.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 报表分享数据
*/
@Component
public
class
CustomerReportDaoImpl
implements
CustomerReportDao
{
@Autowired
private
CustomerReportMapper
customerReportMapper
;
@Override
public
void
insert
(
CustomerReportAddWq
wq
)
{
CustomerReport
entity
=
BeanUtils
.
transitionDto
(
wq
,
CustomerReport
.
class
);
customerReportMapper
.
insert
(
entity
);
}
@Override
public
void
update
(
CustomerReportAddWq
wq
)
{
CustomerReport
entity
=
BeanUtils
.
transitionDto
(
wq
,
CustomerReport
.
class
);
customerReportMapper
.
updateById
(
entity
);
}
@Override
public
List
<
CustomerReportListDto
>
queryCustomerReportList
(
CustomerReportQueryWq
wq
)
{
Wrapper
<
CustomerReport
>
qw
=
new
LambdaQueryWrapper
<>();
// 按照条件查询
List
<
CustomerReport
>
customerReports
=
customerReportMapper
.
selectList
(
qw
);
List
<
CustomerReportListDto
>
list
=
new
ArrayList
<>();
for
(
CustomerReport
customerReport
:
customerReports
)
{
CustomerReportListDto
dto
=
new
CustomerReportListDto
();
dto
.
setReportId
(
customerReport
.
getId
());
dto
.
setReportName
(
customerReport
.
getName
());
dto
.
setReportType
(
customerReport
.
getReportType
());
dto
.
setPreviewUrl
(
customerReport
.
getPreviewUrl
());
list
.
add
(
dto
);
}
return
list
;
}
}
src/main/java/com/link/report/domain/dao/impl/CustomerReportGroupDaoImpl.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
dao
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.link.report.domain.dao.CustomerReportGroupDao
;
import
com.link.report.domain.entity.CustomerReportGroup
;
import
com.link.report.domain.mapper.CustomerReportGroupMapper
;
import
com.link.report.pojo.response.CustomerReportGroupQueryListDto
;
import
com.sfa.common.security.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
/**
* 报表分享数据
*/
@Component
public
class
CustomerReportGroupDaoImpl
implements
CustomerReportGroupDao
{
@Autowired
private
CustomerReportGroupMapper
reportGroupMapper
;
@Override
public
List
<
CustomerReportGroupQueryListDto
>
queryList
()
{
// 更加登录人id查询
Long
userId
=
SecurityUtils
.
getLoginUser
().
getUserid
();
List
<
CustomerReportGroupQueryListDto
>
list
=
reportGroupMapper
.
queryReportGroupList
(
String
.
valueOf
(
userId
));
return
list
;
}
@Override
public
void
deleteByCreatorId
(
Long
userId
)
{
reportGroupMapper
.
delete
(
new
LambdaQueryWrapper
<
CustomerReportGroup
>()
.
eq
(
CustomerReportGroup:
:
getCreateBy
,
userId
));
}
@Override
public
void
batchInsert
(
List
<
CustomerReportGroup
>
items
)
{
reportGroupMapper
.
batchInsert
(
items
);
}
}
src/main/java/com/link/report/domain/dao/impl/ReportShareDaoImpl.java
浏览文件 @
0b4301eb
...
...
@@ -20,7 +20,6 @@ public class ReportShareDaoImpl implements ReportShareDao {
public
List
<
ReportShareBiListDto
>
selectList
(
ReportShareListWq
reportShareListWq
)
{
// 查询数据
List
<
ReportShareBiListDto
>
jimuReportShares
=
reportShareMapper
.
selectShareList
(
reportShareListWq
);
// List<ReportShareBiListDto> dtos = BeanUtils.transitionDtos(jimuReportShares, ReportShareBiListDto.class);
return
jimuReportShares
;
}
}
src/main/java/com/link/report/domain/entity/CustomerGroup.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 对应数据库自定义分组表 customer_group 的 Java Bean 类
*/
@TableName
(
value
=
"customer_group"
)
@Data
public
class
CustomerGroup
{
/**
* 主键
*/
private
String
id
;
/**
* 分组名称
*/
private
String
name
;
/**
* 说明
*/
private
String
remark
;
/**
* 分类名称
*/
private
String
categoryName
;
/**
* 创建人
*/
private
String
createBy
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 修改人
*/
private
String
updateBy
;
/**
* 修改时间
*/
private
Date
updateTime
;
/**
* 删除标识,0 表示正常,1 表示已删除
*/
private
Integer
delFlag
;
/**
* 多租户标识
*/
private
String
tenantId
;
/**
* 乐观锁版本
*/
private
Integer
updateCount
;
}
src/main/java/com/link/report/domain/entity/CustomerReport.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.util.Date
;
@TableName
(
value
=
"customer_report"
)
@Data
public
class
CustomerReport
{
private
String
id
;
private
String
code
;
private
String
name
;
private
String
previewUrl
;
private
String
remark
;
private
Integer
status
;
// 报表类型,0自定义报表 1 积木报表
private
Integer
reportType
;
private
String
createBy
;
private
Date
createTime
;
private
String
updateBy
;
private
Date
updateTime
;
private
Integer
delFlag
;
private
String
tenantId
;
private
Integer
updateCount
;
}
src/main/java/com/link/report/domain/entity/CustomerReportGroup.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.util.Date
;
@TableName
(
value
=
"customer_report_group"
)
@Data
public
class
CustomerReportGroup
{
private
String
id
;
private
String
reportId
;
private
Integer
reportType
;
private
String
groupId
;
private
String
createBy
;
private
Date
createTime
;
private
String
updateBy
;
private
Date
updateTime
;
private
Integer
delFlag
;
private
String
tenantId
;
private
Integer
updateCount
;
}
src/main/java/com/link/report/domain/mapper/CustomerGroupMapper.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.link.report.domain.entity.CustomerGroup
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
CustomerGroupMapper
extends
BaseMapper
<
CustomerGroup
>
{
}
src/main/java/com/link/report/domain/mapper/CustomerReportGroupMapper.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.link.report.domain.entity.CustomerReportGroup
;
import
com.link.report.pojo.response.CustomerReportGroupQueryListDto
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
CustomerReportGroupMapper
extends
BaseMapper
<
CustomerReportGroup
>
{
void
batchInsert
(
List
<
CustomerReportGroup
>
items
);
List
<
CustomerReportGroupQueryListDto
>
queryReportGroupList
(
String
userId
);
}
src/main/java/com/link/report/domain/mapper/CustomerReportMapper.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.link.report.domain.entity.CustomerReport
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
CustomerReportMapper
extends
BaseMapper
<
CustomerReport
>
{
}
src/main/java/com/link/report/domain/wq/CustomerGroupQueryWq.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
wq
;
import
lombok.Data
;
@Data
public
class
CustomerGroupQueryWq
{
private
String
categoryName
;
}
src/main/java/com/link/report/domain/wq/CustomerReportAddWq.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
wq
;
import
lombok.Data
;
@Data
public
class
CustomerReportAddWq
{
private
String
id
;
private
String
name
;
private
String
previewUrl
;
}
src/main/java/com/link/report/domain/wq/CustomerReportGroupWq.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
wq
;
import
lombok.Data
;
@Data
public
class
CustomerReportGroupWq
{
private
String
reportId
;
private
String
groupId
;
}
src/main/java/com/link/report/domain/wq/CustomerReportQueryWq.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
domain
.
wq
;
import
lombok.Data
;
@Data
public
class
CustomerReportQueryWq
{
private
String
id
;
private
String
name
;
private
String
previewUrl
;
}
src/main/java/com/link/report/domain/wq/ReportShareListWq.java
浏览文件 @
0b4301eb
...
...
@@ -13,6 +13,9 @@ import java.util.Map;
@Data
public
class
ReportShareListWq
{
private
String
reportId
;
private
String
categoryName
;
@JsonInclude
(
JsonInclude
.
Include
.
NON_EMPTY
)
private
Map
<
String
,
Object
>
params
;
}
src/main/java/com/link/report/pojo/request/CustomerReportAddVo.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
request
;
import
lombok.Data
;
/**
* @author : lvbencai
* @date : 2025年03月19日12:09:19
* @describe : 自定义报表查询条件
*/
@Data
public
class
CustomerReportAddVo
{
private
String
id
;
private
String
name
;
private
String
previewUrl
;
}
src/main/java/com/link/report/pojo/request/CustomerReportGroupVo.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
request
;
import
com.link.report.pojo.response.ReportItemsDto
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
CustomerReportGroupVo
{
private
String
groupId
;
private
String
groupName
;
private
List
<
ReportItemsDto
>
items
;
}
src/main/java/com/link/report/pojo/request/CustomerReportQueryListVo.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
request
;
import
lombok.Data
;
/**
* @author : lvbencai
* @date : 2025年03月19日12:09:19
* @describe : 自定义报表查询条件
*/
@Data
public
class
CustomerReportQueryListVo
{
private
String
categoryName
=
"供应链报表"
;
}
src/main/java/com/link/report/pojo/request/ReportShareListVo.java
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
request
;
import
com.sfa.common.core.web.domain.BaseEntity
;
import
lombok.Data
;
/**
* @author : lvbencai
* @date : 2025年02月14日15:17:07
* @describe :
*/
@Data
public
class
ReportShareListVo
extends
BaseEntity
{
/**
* 文件夹名称
*/
private
String
categoryName
;
}
src/main/java/com/link/report/pojo/response/CustomerGroupDto.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
response
;
import
lombok.Data
;
@Data
public
class
CustomerGroupDto
{
private
String
groupId
;
private
String
groupName
;
private
String
catalogName
;
}
src/main/java/com/link/report/pojo/response/CustomerReportGroupListDto.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
response
;
import
lombok.Data
;
@Data
public
class
CustomerReportGroupListDto
{
private
String
id
;
private
String
reportId
;
private
String
groupId
;
private
String
groupName
;
private
String
reportName
;
private
Integer
reportType
;
}
src/main/java/com/link/report/pojo/response/CustomerReportGroupQueryListDto.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
response
;
import
lombok.Data
;
@Data
public
class
CustomerReportGroupQueryListDto
{
private
String
groupId
;
private
String
groupName
;
private
String
reportId
;
private
String
reportName
;
private
Integer
reportType
;
private
String
previewUrl
;
}
src/main/java/com/link/report/pojo/response/CustomerReportGroupResDto.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
response
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author : liqiulin
* @date : 2024-12-04 15
* @describe : 首页-自定义报表+积木报表分组管理
*/
@Data
public
class
CustomerReportGroupResDto
{
private
String
groupId
;
private
String
groupName
;
private
List
<
ReportItemsDto
>
items
;
}
src/main/java/com/link/report/pojo/response/CustomerReportListDto.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
response
;
import
lombok.Data
;
@Data
public
class
CustomerReportListDto
{
private
String
reportId
;
private
String
reportName
;
private
String
previewUrl
;
// 报表类型,0自定义报表 1 积木报表
private
Integer
reportType
;
}
src/main/java/com/link/report/pojo/response/ReportItemsDto.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
response
;
import
lombok.Data
;
/**
* @author : lvbencai
* @date : 2025年02月14日15:17:07
* @describe :自定义报表+积木报表
*/
@Data
public
class
ReportItemsDto
{
private
String
reportId
;
private
String
previewUrl
;
private
String
reportName
;
// 报表类型,0自定义报表 1 积木报表
private
Integer
reportType
;
}
src/main/java/com/link/report/pojo/response/ReportShareBiListDto.java
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
pojo
.
response
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author : lvbencai
* @date : 2025年02月14日15:17:07
...
...
@@ -11,15 +10,14 @@ import java.util.Date;
*/
@Data
public
class
ReportShareBiListDto
{
// 报表分享的id
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
private
String
id
;
private
String
reportId
;
private
String
previewUrl
;
private
String
previewLock
;
private
Date
lastUpdateTime
;
private
String
termOfValidity
;
private
String
status
;
private
String
previewLockStatus
;
private
String
shareToken
;
private
String
name
;
private
String
reportName
;
// 报表类型,0自定义报表 1 积木报表
private
Integer
reportType
=
1
;
}
src/main/java/com/link/report/service/CustomerReportGroupService.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
service
;
import
com.link.report.pojo.request.CustomerReportGroupVo
;
import
com.link.report.pojo.request.CustomerReportQueryListVo
;
import
com.link.report.pojo.response.CustomerReportGroupResDto
;
import
java.util.List
;
public
interface
CustomerReportGroupService
{
List
<
CustomerReportGroupResDto
>
queryList
(
CustomerReportQueryListVo
vo
);
void
save
(
List
<
CustomerReportGroupVo
>
customerReportAddVo
);
}
src/main/java/com/link/report/service/CustomerReportService.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
service
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
java.util.List
;
public
interface
CustomerReportService
{
void
save
(
CustomerReportAddVo
customerReportAddVo
);
List
<
CustomerReportListDto
>
queryCustomerReportList
();
}
src/main/java/com/link/report/service/impl/CustomerReportGroupServiceImpl.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
service
.
impl
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.link.report.domain.dao.CustomerGroupDao
;
import
com.link.report.domain.dao.CustomerReportGroupDao
;
import
com.link.report.domain.entity.CustomerReportGroup
;
import
com.link.report.domain.wq.CustomerGroupQueryWq
;
import
com.link.report.pojo.request.CustomerReportGroupVo
;
import
com.link.report.pojo.request.CustomerReportQueryListVo
;
import
com.link.report.pojo.response.CustomerGroupDto
;
import
com.link.report.pojo.response.CustomerReportGroupQueryListDto
;
import
com.link.report.pojo.response.CustomerReportGroupResDto
;
import
com.link.report.pojo.response.ReportItemsDto
;
import
com.link.report.service.CustomerReportGroupService
;
import
com.sfa.common.security.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 报表分享数据
*/
@Service
public
class
CustomerReportGroupServiceImpl
implements
CustomerReportGroupService
{
@Autowired
private
CustomerReportGroupDao
customerReportGroupDao
;
@Autowired
private
CustomerGroupDao
customerGroupDao
;
@Override
public
List
<
CustomerReportGroupResDto
>
queryList
(
CustomerReportQueryListVo
vo
)
{
CustomerGroupQueryWq
wq
=
new
CustomerGroupQueryWq
();
wq
.
setCategoryName
(
vo
.
getCategoryName
());
// 先查询分组
List
<
CustomerGroupDto
>
groupDtos
=
customerGroupDao
.
queryList
(
wq
);
List
<
CustomerReportGroupQueryListDto
>
list
=
customerReportGroupDao
.
queryList
();
// 转换成list结构
List
<
CustomerReportGroupResDto
>
result
=
new
ArrayList
<>();
for
(
CustomerGroupDto
dto
:
groupDtos
)
{
// 先看分组
CustomerReportGroupResDto
resDto
=
new
CustomerReportGroupResDto
();
resDto
.
setGroupId
(
dto
.
getGroupId
());
resDto
.
setGroupName
(
dto
.
getGroupName
());
List
<
ReportItemsDto
>
itemsDtos
=
new
ArrayList
<>();
// 在看报表
for
(
CustomerReportGroupQueryListDto
reportGroupQueryListDto
:
list
)
{
if
(
reportGroupQueryListDto
.
getGroupId
().
equals
(
dto
.
getGroupId
()))
{
// 转换成ReportShareBiListDto
ReportItemsDto
itemsDto
=
new
ReportItemsDto
();
itemsDto
.
setReportId
(
reportGroupQueryListDto
.
getReportId
());
itemsDto
.
setReportName
(
reportGroupQueryListDto
.
getReportName
());
itemsDto
.
setPreviewUrl
(
reportGroupQueryListDto
.
getPreviewUrl
());
itemsDto
.
setReportType
(
reportGroupQueryListDto
.
getReportType
());
itemsDtos
.
add
(
itemsDto
);
}
}
resDto
.
setItems
(
itemsDtos
);
result
.
add
(
resDto
);
}
return
result
;
}
/**
* 新增或者修改
*
* @param customerReportGroupVo
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
save
(
List
<
CustomerReportGroupVo
>
customerReportGroupVo
)
{
// 新增或者修改 先删除后新增
Long
userId
=
SecurityUtils
.
getLoginUser
().
getUserid
();
customerReportGroupDao
.
deleteByCreatorId
(
userId
);
// 新增
List
<
CustomerReportGroup
>
items
=
new
ArrayList
<>();
for
(
CustomerReportGroupVo
vo
:
customerReportGroupVo
)
{
List
<
ReportItemsDto
>
itemsDtos
=
vo
.
getItems
();
for
(
ReportItemsDto
item
:
itemsDtos
)
{
CustomerReportGroup
dto
=
new
CustomerReportGroup
();
// 雪花算法生成id
dto
.
setId
(
IdUtil
.
getSnowflakeNextIdStr
());
dto
.
setGroupId
(
vo
.
getGroupId
());
dto
.
setReportId
(
item
.
getReportId
());
dto
.
setReportType
(
item
.
getReportType
());
dto
.
setCreateBy
(
String
.
valueOf
(
userId
));
dto
.
setTenantId
(
String
.
valueOf
(
userId
));
items
.
add
(
dto
);
}
}
if
(
ObjectUtil
.
isNotEmpty
(
items
)){
customerReportGroupDao
.
batchInsert
(
items
);
}
}
}
src/main/java/com/link/report/service/impl/CustomerReportServiceImpl.java
0 → 100644
浏览文件 @
0b4301eb
package
com
.
link
.
report
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.link.report.domain.dao.CustomerReportDao
;
import
com.link.report.domain.wq.CustomerReportAddWq
;
import
com.link.report.domain.wq.CustomerReportQueryWq
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
com.link.report.service.CustomerReportService
;
import
com.sfa.common.core.utils.bean.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 报表分享数据
*/
@Service
public
class
CustomerReportServiceImpl
implements
CustomerReportService
{
@Autowired
private
CustomerReportDao
customerReportDao
;
@Override
public
void
save
(
CustomerReportAddVo
customerReportAddVo
)
{
CustomerReportAddWq
wq
=
new
CustomerReportAddWq
();
BeanUtils
.
copyProperties
(
customerReportAddVo
,
wq
);
if
(
ObjectUtil
.
isNotEmpty
(
wq
.
getId
()))
{
customerReportDao
.
update
(
wq
);
}
else
{
customerReportDao
.
insert
(
wq
);
}
}
@Override
public
List
<
CustomerReportListDto
>
queryCustomerReportList
(
)
{
CustomerReportQueryWq
wq
=
new
CustomerReportQueryWq
();
List
<
CustomerReportListDto
>
list
=
customerReportDao
.
queryCustomerReportList
(
wq
);
return
list
;
}
}
src/main/java/com/link/report/service/impl/JimuReportTokenServiceImpl.java
浏览文件 @
0b4301eb
...
...
@@ -123,7 +123,8 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
||
loginUser
.
getSysUser
().
getDept
().
getDeptName
().
contains
(
"信息技术中心"
))
{
return
"1"
;
}
return
loginUser
.
getSysUser
().
getDept
().
getDeptName
();
Long
deptId
=
loginUser
.
getSysUser
().
getDept
().
getDeptId
();
return
String
.
valueOf
(
deptId
);
}
@Override
...
...
src/main/resources/mapper/report/CustomerReportGroupMapper.xml
0 → 100644
浏览文件 @
0b4301eb
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.link.report.domain.mapper.CustomerReportGroupMapper"
>
<insert
id=
"batchInsert"
parameterType=
"java.util.List"
>
INSERT INTO customer_report_group (
id,
report_id,
report_type,
group_id,
create_by,
create_time,
update_by,
update_time,
del_flag,
tenant_id,
update_count
) VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(
#{item.id},
#{item.reportId},
#{item.reportType},
#{item.groupId},
#{item.createBy},
#{item.createTime},
#{item.updateBy},
#{item.updateTime},
#{item.delFlag},
#{item.tenantId},
#{item.updateCount}
)
</foreach>
</insert>
<select
id=
"queryReportGroupList"
resultType=
"com.link.report.pojo.response.CustomerReportGroupQueryListDto"
>
<!-- 自定义报表关联 -->
select distinct groupId ,groupName,reportId,reportName,previewUrl,reportType from (
SELECT
cg.id as groupId,
cg.name as groupName,
crg.report_type as reportType,
crg.report_id as reportId,
cr.name as reportName,
cr.preview_url as previewUrl
FROM
customer_group cg
join customer_report_group crg on crg.group_id = cg.id and crg.report_type = 0
join customer_report cr on crg.report_id = cr.id and crg.report_type = cr.report_type
<where>
<if
test=
"userId != null and userId != ''"
>
AND crg.create_by = #{userId}
</if>
</where>
<!-- 积木报表关联 -->
union
SELECT
cg.id as groupId,
cg.name as groupName,
crg.report_type as reportType,
jr.id as reportId,
jr.name as reportName,
jrs.preview_url as previewUrl
FROM
customer_group cg
join customer_report_group crg on crg.group_id = cg.id and crg.report_type = 1
join jimu_report jr on crg.report_id = jr.id
join jimu_report_share jrs on jr.id = jrs.report_id
<where>
<if
test=
"userId!= null and userId!= ''"
>
AND crg.create_by = #{userId}
</if>
</where>
) tmp
</select>
</mapper>
src/main/resources/mapper/report/CustomerReportMapper.xml
0 → 100644
浏览文件 @
0b4301eb
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.link.report.domain.mapper.CustomerReportMapper"
>
<select
id=
"selectById"
resultType=
"com.link.report.domain.entity.CustomerReport"
>
SELECT
id,
code,
name,
preview_url,
remark,
status,
report_type,
create_by,
create_time,
update_by,
update_time,
del_flag,
tenant_id,
update_count
FROM
customer_report
WHERE
id = #{id}
</select>
</mapper>
src/main/resources/mapper/report/ReportShareBiMapper.xml
浏览文件 @
0b4301eb
...
...
@@ -19,16 +19,30 @@
<select
id=
"selectShareList"
resultType=
"com.link.report.pojo.response.ReportShareBiListDto"
>
select jrs.id,jrs.report_id as reportId ,
jrs.preview_url as previewUrl,
jrs.preview_lock as previewLock,
<!--
jrs.preview_lock as previewLock,
jrs.last_update_time as lastUpdateTime,
jrs.term_of_validity as termOfValidity,
jrs.status as status,
jrs.preview_lock_status as previewLockStatus,
jrs.share_token as shareToken,
jr.name from jimu_report_share jrs
jrs.share_token as shareToken,-->
jr.name as reportName,
1 as reportType
from jimu_report_share jrs
inner join jimu_report jr on jr.id = jrs.report_id and jr.del_flag =0
<if
test=
"categoryName != null and categoryName != ''"
>
JOIN
jimu_report_category c1 ON jr.type = c1.id
LEFT JOIN
jimu_report_category c2 ON c1.parent_id = c2.id
LEFT JOIN
jimu_report_category c3 ON c2.parent_id = c3.id
</if>
<where>
<if
test=
"categoryName != null and categoryName != ''"
>
c1.name = #{categoryName}
OR c2.name = #{categoryName}
OR c3.name = #{categoryName};
</if>
<if
test=
"reportId != null and reportId != ''"
>
and report_id = #{reportId}
</if>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论