Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-link-report
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-link-report
Commits
c221861a
提交
c221861a
authored
4月 01, 2025
作者:
吕本才
提交者:
Coding
4月 01, 2025
浏览文件
操作
浏览文件
下载
差异文件
Accept Merge Request #114: (qa -> main)
Merge Request: 自定义分组功能修改 Created By: @吕本才 Accepted By: @吕本才 URL:
https://g-pkkp8204.coding.net/p/wangxiaolu-sfa/d/wangxiaolu-link-report/git/merge/114?initial=true
上级
7aa3f89b
be000ad0
隐藏空白字符变更
内嵌
并排
正在显示
44 个修改的文件
包含
563 行增加
和
81 行删除
+563
-81
pom.xml
pom.xml
+5
-1
CustomerGroupCoreController.java
...k/report/controller/core/CustomerGroupCoreController.java
+43
-0
CustomerReportCoreController.java
.../report/controller/core/CustomerReportCoreController.java
+1
-1
CustomerReportGroupCoreController.java
...rt/controller/core/CustomerReportGroupCoreController.java
+2
-1
CustomerReportGroupQueryController.java
.../controller/query/CustomerReportGroupQueryController.java
+2
-1
CustomerReportQueryController.java
...eport/controller/query/CustomerReportQueryController.java
+5
-3
ReportShareQueryController.java
...k/report/controller/query/ReportShareQueryController.java
+9
-1
CustomerGroupDao.java
...ain/java/com/link/report/domain/dao/CustomerGroupDao.java
+7
-0
CustomerJimuReportDao.java
...ava/com/link/report/domain/dao/CustomerJimuReportDao.java
+9
-0
CustomerReportDao.java
...in/java/com/link/report/domain/dao/CustomerReportDao.java
+3
-3
CustomerReportGroupDao.java
...va/com/link/report/domain/dao/CustomerReportGroupDao.java
+5
-2
CustomerGroupDaoImpl.java
...com/link/report/domain/dao/impl/CustomerGroupDaoImpl.java
+31
-2
CustomerJimuReportDaoImpl.java
...ink/report/domain/dao/impl/CustomerJimuReportDaoImpl.java
+33
-0
CustomerReportDaoImpl.java
...om/link/report/domain/dao/impl/CustomerReportDaoImpl.java
+7
-11
CustomerReportGroupDaoImpl.java
...nk/report/domain/dao/impl/CustomerReportGroupDaoImpl.java
+15
-6
CustomerGroup.java
...ain/java/com/link/report/domain/entity/CustomerGroup.java
+4
-0
CustomerJimuReport.java
...ava/com/link/report/domain/entity/CustomerJimuReport.java
+64
-0
CustomerReport.java
...in/java/com/link/report/domain/entity/CustomerReport.java
+4
-0
CustomerReportGroup.java
...va/com/link/report/domain/entity/CustomerReportGroup.java
+3
-0
CustomerJimuReportMapper.java
...m/link/report/domain/mapper/CustomerJimuReportMapper.java
+9
-0
CustomerReportGroupMapper.java
.../link/report/domain/mapper/CustomerReportGroupMapper.java
+2
-1
CustomerGroupQueryWq.java
.../java/com/link/report/domain/wq/CustomerGroupQueryWq.java
+5
-0
CustomerReportAddWq.java
...n/java/com/link/report/domain/wq/CustomerReportAddWq.java
+7
-0
CustomerReportQueryWq.java
...java/com/link/report/domain/wq/CustomerReportQueryWq.java
+1
-0
CustomerGroupAddVo.java
...java/com/link/report/pojo/request/CustomerGroupAddVo.java
+23
-0
CustomerReportAddVo.java
...ava/com/link/report/pojo/request/CustomerReportAddVo.java
+8
-0
CustomerReportQueryListVo.java
...m/link/report/pojo/request/CustomerReportQueryListVo.java
+1
-1
CustomerReportTransferVo.java
...om/link/report/pojo/request/CustomerReportTransferVo.java
+15
-0
CustomerGroupDto.java
.../java/com/link/report/pojo/response/CustomerGroupDto.java
+1
-2
CustomerJimuReportDto.java
.../com/link/report/pojo/response/CustomerJimuReportDto.java
+22
-0
CustomerReportGroupQueryListDto.java
...report/pojo/response/CustomerReportGroupQueryListDto.java
+1
-0
CustomerReportGroupResDto.java
.../link/report/pojo/response/CustomerReportGroupResDto.java
+1
-0
ReportItemsDto.java
...in/java/com/link/report/pojo/response/ReportItemsDto.java
+1
-0
CustomerGroupService.java
...in/java/com/link/report/service/CustomerGroupService.java
+10
-0
CustomerReportService.java
...n/java/com/link/report/service/CustomerReportService.java
+2
-2
ReportShareService.java
...main/java/com/link/report/service/ReportShareService.java
+3
-0
CustomerGroupServiceImpl.java
...om/link/report/service/impl/CustomerGroupServiceImpl.java
+118
-0
CustomerReportGroupServiceImpl.java
...k/report/service/impl/CustomerReportGroupServiceImpl.java
+6
-5
CustomerReportServiceImpl.java
...m/link/report/service/impl/CustomerReportServiceImpl.java
+17
-7
JimuReportTokenServiceImpl.java
.../link/report/service/impl/JimuReportTokenServiceImpl.java
+8
-16
ReportShareServiceImpl.java
.../com/link/report/service/impl/ReportShareServiceImpl.java
+25
-0
bootstrap.yml
src/main/resources/bootstrap.yml
+2
-0
CustomerReportGroupMapper.xml
...ain/resources/mapper/report/CustomerReportGroupMapper.xml
+23
-9
ReportShareBiMapper.xml
src/main/resources/mapper/report/ReportShareBiMapper.xml
+0
-6
没有找到文件。
pom.xml
浏览文件 @
c221861a
...
...
@@ -74,7 +74,11 @@
<groupId>
com.wangxiaolu.sfa
</groupId>
<artifactId>
wangxiaolu-sfa-common-log
</artifactId>
</dependency>
<!-- RuoYi Api System -->
<dependency>
<groupId>
com.wangxiaolu.sfa
</groupId>
<artifactId>
wangxiaolu-sfa-api-system
</artifactId>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
...
...
src/main/java/com/link/report/controller/core/CustomerGroupCoreController.java
0 → 100644
浏览文件 @
c221861a
package
com
.
link
.
report
.
controller
.
core
;
import
com.link.report.pojo.request.CustomerGroupAddVo
;
import
com.link.report.service.CustomerGroupService
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.security.annotation.Logical
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author : liqiulin
* @date : 2024-12-04 15
* @describe : 自定义报表管理
*/
@RestController
@RequestMapping
(
"/customer/core"
)
public
class
CustomerGroupCoreController
{
@Autowired
CustomerGroupService
groupService
;
@RequiresPermissions
(
logical
=
Logical
.
OR
,
value
=
{
"bi:supply:list"
,
"bi:finance_report:list"
})
@PostMapping
(
"/group/insertOrUpdate"
)
public
R
save
(
@RequestBody
CustomerGroupAddVo
customerGroupAddVo
)
{
groupService
.
save
(
customerGroupAddVo
);
return
R
.
ok
();
}
@RequiresPermissions
(
logical
=
Logical
.
OR
,
value
=
{
"bi:supply:list"
,
"bi:finance_report:list"
})
@DeleteMapping
(
"/group/delete"
)
public
R
delete
(
CustomerGroupAddVo
customerGroupAddVo
)
{
groupService
.
delete
(
customerGroupAddVo
);
return
R
.
ok
();
}
@RequiresPermissions
(
logical
=
Logical
.
OR
,
value
=
{
"bi:supply:list"
,
"bi:finance_report:list"
})
@GetMapping
(
"/group/convert"
)
public
R
convert
()
{
groupService
.
convert
();
return
R
.
ok
();
}
}
src/main/java/com/link/report/controller/core/CustomerReportCoreController.java
浏览文件 @
c221861a
...
...
@@ -22,7 +22,7 @@ public class CustomerReportCoreController {
@Autowired
CustomerReportService
customerReportService
;
@RequiresPermissions
(
"
bi:supply
:list"
)
@RequiresPermissions
(
"
jimureport:ext
:list"
)
@PostMapping
(
"/save"
)
public
R
save
(
@RequestBody
CustomerReportAddVo
customerReportAddVo
)
{
customerReportService
.
save
(
customerReportAddVo
);
...
...
src/main/java/com/link/report/controller/core/CustomerReportGroupCoreController.java
浏览文件 @
c221861a
...
...
@@ -3,6 +3,7 @@ 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.Logical
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -24,7 +25,7 @@ public class CustomerReportGroupCoreController {
@Autowired
CustomerReportGroupService
customerReportGroupService
;
@RequiresPermissions
(
"bi:supply:list"
)
@RequiresPermissions
(
logical
=
Logical
.
OR
,
value
=
{
"bi:supply:list"
,
"bi:finance_report:list"
}
)
@PostMapping
(
"/group/save"
)
public
R
insertOrUpdate
(
@RequestBody
List
<
CustomerReportGroupVo
>
vos
)
{
customerReportGroupService
.
save
(
vos
);
...
...
src/main/java/com/link/report/controller/query/CustomerReportGroupQueryController.java
浏览文件 @
c221861a
...
...
@@ -4,6 +4,7 @@ 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.Logical
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -24,7 +25,7 @@ public class CustomerReportGroupQueryController {
@Autowired
CustomerReportGroupService
customerReportGroupService
;
@RequiresPermissions
(
"bi:supply:list"
)
@RequiresPermissions
(
logical
=
Logical
.
OR
,
value
=
{
"bi:supply:list"
,
"bi:finance_report:list"
}
)
@GetMapping
(
"/group/list"
)
public
R
<
List
<
CustomerReportGroupResDto
>>
queryList
(
CustomerReportQueryListVo
vo
)
{
List
<
CustomerReportGroupResDto
>
dtos
=
customerReportGroupService
.
queryList
(
vo
);
...
...
src/main/java/com/link/report/controller/query/CustomerReportQueryController.java
浏览文件 @
c221861a
package
com
.
link
.
report
.
controller
.
query
;
import
com.link.report.pojo.request.ReportShareListVo
;
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.Logical
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -23,10 +25,10 @@ public class CustomerReportQueryController {
@Autowired
CustomerReportService
customerReportService
;
@RequiresPermissions
(
"bi:supply:list"
)
@RequiresPermissions
(
logical
=
Logical
.
OR
,
value
=
{
"bi:supply:list"
,
"bi:finance_report:list"
}
)
@GetMapping
(
"/list"
)
public
R
<
List
<
CustomerReportListDto
>>
queryList
()
{
List
<
CustomerReportListDto
>
customerReportListDtos
=
customerReportService
.
queryCustomerReportList
();
public
R
<
List
<
CustomerReportListDto
>>
queryList
(
ReportShareListVo
reportShareListVo
)
{
List
<
CustomerReportListDto
>
customerReportListDtos
=
customerReportService
.
queryCustomerReportList
(
reportShareListVo
);
return
R
.
ok
(
customerReportListDtos
);
}
}
src/main/java/com/link/report/controller/query/ReportShareQueryController.java
浏览文件 @
c221861a
package
com
.
link
.
report
.
controller
.
query
;
import
com.link.report.pojo.request.CustomerReportTransferVo
;
import
com.link.report.pojo.request.ReportShareListVo
;
import
com.link.report.pojo.response.ReportShareBiListDto
;
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.Logical
;
import
com.sfa.common.security.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -35,10 +37,16 @@ public class ReportShareQueryController extends BaseController {
*/
@DataScope
(
deptAlias
=
"d"
,
userAlias
=
"u"
)
@GetMapping
(
"/list"
)
@RequiresPermissions
(
"bi:supply:list"
)
@RequiresPermissions
(
logical
=
Logical
.
OR
,
value
=
{
"bi:supply:list"
,
"bi:finance_report:list"
}
)
public
R
<
List
<
ReportShareBiListDto
>>
selectList
(
ReportShareListVo
reportShareListVo
)
{
List
<
ReportShareBiListDto
>
reportShareBiListDtos
=
reportShareService
.
selectList
(
reportShareListVo
);
return
R
.
ok
(
reportShareBiListDtos
);
}
// 转让接口权限
@GetMapping
(
"/transfer"
)
public
R
transfer
(
CustomerReportTransferVo
customerReportTransferVo
)
{
reportShareService
.
transfer
(
customerReportTransferVo
);
return
R
.
ok
();
}
}
src/main/java/com/link/report/domain/dao/CustomerGroupDao.java
浏览文件 @
c221861a
package
com
.
link
.
report
.
domain
.
dao
;
import
com.link.report.domain.wq.CustomerGroupQueryWq
;
import
com.link.report.pojo.request.CustomerGroupAddVo
;
import
com.link.report.pojo.response.CustomerGroupDto
;
import
java.util.List
;
public
interface
CustomerGroupDao
{
List
<
CustomerGroupDto
>
queryList
(
CustomerGroupQueryWq
wq
);
void
insert
(
CustomerGroupAddVo
customerGroupAddVo
);
void
update
(
CustomerGroupAddVo
customerGroupAddVo
);
void
delete
(
String
groupId
);
}
src/main/java/com/link/report/domain/dao/CustomerJimuReportDao.java
0 → 100644
浏览文件 @
c221861a
package
com
.
link
.
report
.
domain
.
dao
;
import
com.link.report.pojo.response.CustomerJimuReportDto
;
public
interface
CustomerJimuReportDao
{
CustomerJimuReportDto
queryByName
(
String
reportName
);
void
updateTenentId
(
CustomerJimuReportDto
customerJimuReportDto
);
}
src/main/java/com/link/report/domain/dao/CustomerReportDao.java
浏览文件 @
c221861a
package
com
.
link
.
report
.
domain
.
dao
;
import
com.link.report.domain.
wq.CustomerReportAddWq
;
import
com.link.report.domain.
entity.CustomerReport
;
import
com.link.report.domain.wq.CustomerReportQueryWq
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
java.util.List
;
public
interface
CustomerReportDao
{
void
insert
(
CustomerReport
AddWq
wq
);
void
insert
(
CustomerReport
report
);
void
update
(
CustomerReport
AddWq
wq
);
void
update
(
CustomerReport
report
);
List
<
CustomerReportListDto
>
queryCustomerReportList
(
CustomerReportQueryWq
wq
);
}
src/main/java/com/link/report/domain/dao/CustomerReportGroupDao.java
浏览文件 @
c221861a
...
...
@@ -2,15 +2,18 @@ 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
<
CustomerReportGroup
>
list
();
List
<
CustomerReportGroupQueryListDto
>
queryList
();
void
deleteByCreatorId
(
Long
userId
);
void
batchInsert
(
List
<
CustomerReportGroup
>
items
);
void
update
(
CustomerReportGroup
customerReportGroup
);
}
src/main/java/com/link/report/domain/dao/impl/CustomerGroupDaoImpl.java
浏览文件 @
c221861a
...
...
@@ -7,7 +7,9 @@ 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.request.CustomerGroupAddVo
;
import
com.link.report.pojo.response.CustomerGroupDto
;
import
com.sfa.common.core.utils.bean.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -27,16 +29,43 @@ public class CustomerGroupDaoImpl implements CustomerGroupDao {
public
List
<
CustomerGroupDto
>
queryList
(
CustomerGroupQueryWq
wq
)
{
Wrapper
<
CustomerGroup
>
wraper
=
new
LambdaQueryWrapper
<
CustomerGroup
>()
.
eq
(
ObjectUtil
.
isNotEmpty
(
wq
.
getCategoryName
()),
CustomerGroup:
:
getCategoryName
,
wq
.
getCategoryName
());
.
eq
(
ObjectUtil
.
isNotEmpty
(
wq
.
getCreateUserId
()),
CustomerGroup:
:
getCreateUserId
,
wq
.
getCreateUserId
())
.
eq
(
ObjectUtil
.
isNotEmpty
(
wq
.
getCategoryName
()),
CustomerGroup:
:
getCategoryName
,
wq
.
getCategoryName
())
.
in
(
ObjectUtil
.
isNotEmpty
(
wq
.
getGroupIds
()),
CustomerGroup:
:
getId
,
wq
.
getGroupIds
())
.
orderBy
(
true
,
true
,
CustomerGroup:
:
getCreateTime
)
.
orderBy
(
true
,
true
,
CustomerGroup:
:
getId
)
;
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
.
setCat
alog
Name
(
customerGroup
.
getCategoryName
());
dto
.
setCat
egory
Name
(
customerGroup
.
getCategoryName
());
result
.
add
(
dto
);
}
return
result
;
}
@Override
public
void
insert
(
CustomerGroupAddVo
customerGroupAddVo
)
{
CustomerGroup
customerGroup
=
BeanUtils
.
transitionDto
(
customerGroupAddVo
,
CustomerGroup
.
class
);
customerGroup
.
setName
(
customerGroupAddVo
.
getGroupName
());
customerGroup
.
setCategoryName
(
customerGroupAddVo
.
getCategoryName
());
groupMapper
.
insert
(
customerGroup
);
}
@Override
public
void
update
(
CustomerGroupAddVo
customerGroupAddVo
)
{
CustomerGroup
customerGroup
=
BeanUtils
.
transitionDto
(
customerGroupAddVo
,
CustomerGroup
.
class
);
customerGroup
.
setId
(
customerGroupAddVo
.
getGroupId
());
customerGroup
.
setName
(
customerGroupAddVo
.
getGroupName
());
customerGroup
.
setCategoryName
(
customerGroupAddVo
.
getCategoryName
());
groupMapper
.
updateById
(
customerGroup
);
}
@Override
public
void
delete
(
String
groupId
)
{
groupMapper
.
deleteById
(
groupId
);
}
}
src/main/java/com/link/report/domain/dao/impl/CustomerJimuReportDaoImpl.java
0 → 100644
浏览文件 @
c221861a
package
com
.
link
.
report
.
domain
.
dao
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.link.report.domain.dao.CustomerJimuReportDao
;
import
com.link.report.domain.entity.CustomerJimuReport
;
import
com.link.report.domain.mapper.CustomerJimuReportMapper
;
import
com.link.report.pojo.response.CustomerJimuReportDto
;
import
com.sfa.common.core.utils.bean.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
* 报表分享数据
*/
@Component
public
class
CustomerJimuReportDaoImpl
implements
CustomerJimuReportDao
{
@Autowired
private
CustomerJimuReportMapper
customerJimuReportMapper
;
@Override
public
CustomerJimuReportDto
queryByName
(
String
reportName
)
{
CustomerJimuReport
jimuReport
=
customerJimuReportMapper
.
selectOne
(
new
LambdaQueryWrapper
<
CustomerJimuReport
>()
.
eq
(
CustomerJimuReport:
:
getName
,
reportName
));
return
BeanUtils
.
transitionDto
(
jimuReport
,
CustomerJimuReportDto
.
class
);
}
@Override
public
void
updateTenentId
(
CustomerJimuReportDto
customerJimuReportDto
)
{
CustomerJimuReport
report
=
BeanUtils
.
transitionDto
(
customerJimuReportDto
,
CustomerJimuReport
.
class
);
customerJimuReportMapper
.
updateById
(
report
);
}
}
src/main/java/com/link/report/domain/dao/impl/CustomerReportDaoImpl.java
浏览文件 @
c221861a
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.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
;
...
...
@@ -24,22 +23,19 @@ public class CustomerReportDaoImpl implements CustomerReportDao {
private
CustomerReportMapper
customerReportMapper
;
@Override
public
void
insert
(
CustomerReportAddWq
wq
)
{
CustomerReport
entity
=
BeanUtils
.
transitionDto
(
wq
,
CustomerReport
.
class
);
customerReportMapper
.
insert
(
entity
);
public
void
insert
(
CustomerReport
report
)
{
customerReportMapper
.
insert
(
report
);
}
@Override
public
void
update
(
CustomerReportAddWq
wq
)
{
CustomerReport
entity
=
BeanUtils
.
transitionDto
(
wq
,
CustomerReport
.
class
);
customerReportMapper
.
updateById
(
entity
);
public
void
update
(
CustomerReport
report
)
{
customerReportMapper
.
updateById
(
report
);
}
@Override
public
List
<
CustomerReportListDto
>
queryCustomerReportList
(
CustomerReportQueryWq
wq
)
{
Wrapper
<
CustomerReport
>
qw
=
new
LambdaQueryWrapper
<>();
Wrapper
<
CustomerReport
>
qw
=
new
LambdaQueryWrapper
<
CustomerReport
>()
.
eq
(
ObjectUtil
.
isNotEmpty
(
wq
.
getCategoryName
()),
CustomerReport:
:
getCategoryName
,
wq
.
getCategoryName
());
// 按照条件查询
List
<
CustomerReport
>
customerReports
=
customerReportMapper
.
selectList
(
qw
);
List
<
CustomerReportListDto
>
list
=
new
ArrayList
<>();
...
...
src/main/java/com/link/report/domain/dao/impl/CustomerReportGroupDaoImpl.java
浏览文件 @
c221861a
...
...
@@ -18,24 +18,33 @@ import java.util.List;
public
class
CustomerReportGroupDaoImpl
implements
CustomerReportGroupDao
{
@Autowired
private
CustomerReportGroupMapper
reportGroupMapper
;
@Override
public
List
<
CustomerReportGroup
QueryListDto
>
queryL
ist
()
{
public
List
<
CustomerReportGroup
>
l
ist
()
{
// 更加登录人id查询
Long
userId
=
SecurityUtils
.
getLoginUser
().
getUserid
();
List
<
CustomerReportGroupQueryListDto
>
list
=
reportGroupMapper
.
queryReportGroupList
(
String
.
valueOf
(
userId
));
List
<
CustomerReportGroup
>
list
=
reportGroupMapper
.
selectList
(
new
LambdaQueryWrapper
<>());
return
list
;
}
@Override
public
List
<
CustomerReportGroupQueryListDto
>
queryList
()
{
Long
userId
=
SecurityUtils
.
getUserId
();
// 更加登录人id查询
List
<
CustomerReportGroupQueryListDto
>
list
=
reportGroupMapper
.
queryReportGroupList
(
userId
);
return
list
;
}
@Override
public
void
deleteByCreatorId
(
Long
userId
)
{
reportGroupMapper
.
delete
(
new
LambdaQueryWrapper
<
CustomerReportGroup
>()
.
eq
(
CustomerReportGroup:
:
getCreate
By
,
userId
));
.
eq
(
CustomerReportGroup:
:
getCreate
UserId
,
userId
));
}
@Override
public
void
batchInsert
(
List
<
CustomerReportGroup
>
items
)
{
reportGroupMapper
.
batchInsert
(
items
);
}
@Override
public
void
update
(
CustomerReportGroup
customerReportGroup
)
{
reportGroupMapper
.
updateById
(
customerReportGroup
);
}
}
src/main/java/com/link/report/domain/entity/CustomerGroup.java
浏览文件 @
c221861a
package
com
.
link
.
report
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.util.Date
;
...
...
@@ -45,6 +46,7 @@ public class CustomerGroup {
/**
* 删除标识,0 表示正常,1 表示已删除
*/
@TableLogic
private
Integer
delFlag
;
/**
* 多租户标识
...
...
@@ -54,4 +56,6 @@ public class CustomerGroup {
* 乐观锁版本
*/
private
Integer
updateCount
;
private
Long
createUserId
;
private
Long
updateUserId
;
}
src/main/java/com/link/report/domain/entity/CustomerJimuReport.java
0 → 100644
浏览文件 @
c221861a
package
com
.
link
.
report
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@TableName
(
"jimu_report"
)
public
class
CustomerJimuReport
{
private
String
id
;
private
String
code
;
private
String
name
;
private
String
note
;
private
String
status
;
private
String
type
;
private
String
jsonStr
;
private
String
apiUrl
;
private
String
apiMethod
;
private
String
apiCode
;
private
String
thumb
;
private
Integer
template
;
private
String
createBy
;
private
Date
createTime
;
private
String
updateBy
;
private
Date
updateTime
;
// private Map<String, Object> dataList;
private
Integer
delFlag
;
private
Long
viewCount
;
private
String
cssStr
;
private
String
jsStr
;
private
String
pyStr
;
private
String
tenantId
;
private
Integer
updateCount
;
// private Boolean isRefresh;
// private String shareViewUrl;
// private Integer submitForm;
//
// /** @deprecated */
// @Deprecated
// public String getJsonStr() {
// return this.getJsonStrJson() != null && !this.getJsonStrJson().isEmpty() ? this.getJsonStrJson().toJSONString() : null;
// }
//
// public void setJsonStr(String jsonStr) {
// this.jsonStr = jsonStr;
// }
//
// public JSONObject getJsonStrJson() {
// if ((this.jsonStrJson == null || this.jsonStrJson.isEmpty()) && OkConvertUtils.isNotEmpty(this.jsonStr)) {
// this.jsonStrJson = JSONObject.parseObject(this.jsonStr, new Feature[]{Feature.OrderedField});
// this.jsonStr = this.jsonStr.replaceAll(".*", "");
// }
//
// return this.jsonStrJson;
// }
}
src/main/java/com/link/report/domain/entity/CustomerReport.java
浏览文件 @
c221861a
...
...
@@ -9,6 +9,8 @@ import java.util.Date;
public
class
CustomerReport
{
private
String
id
;
private
String
code
;
private
String
categoryName
;
private
String
name
;
private
String
previewUrl
;
private
String
remark
;
...
...
@@ -22,4 +24,6 @@ public class CustomerReport {
private
Integer
delFlag
;
private
String
tenantId
;
private
Integer
updateCount
;
private
Long
createUserId
;
private
Long
updateUserId
;
}
src/main/java/com/link/report/domain/entity/CustomerReportGroup.java
浏览文件 @
c221861a
...
...
@@ -9,6 +9,7 @@ import java.util.Date;
public
class
CustomerReportGroup
{
private
String
id
;
private
String
reportId
;
// private String categoryName;
private
Integer
reportType
;
private
String
groupId
;
private
String
createBy
;
...
...
@@ -18,4 +19,6 @@ public class CustomerReportGroup {
private
Integer
delFlag
;
private
String
tenantId
;
private
Integer
updateCount
;
private
Long
createUserId
;
private
Long
updateUserId
;
}
src/main/java/com/link/report/domain/mapper/CustomerJimuReportMapper.java
0 → 100644
浏览文件 @
c221861a
package
com
.
link
.
report
.
domain
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.link.report.domain.entity.CustomerJimuReport
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
CustomerJimuReportMapper
extends
BaseMapper
<
CustomerJimuReport
>
{
}
src/main/java/com/link/report/domain/mapper/CustomerReportGroupMapper.java
浏览文件 @
c221861a
...
...
@@ -4,6 +4,7 @@ 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
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -12,5 +13,5 @@ public interface CustomerReportGroupMapper extends BaseMapper<CustomerReportGrou
void
batchInsert
(
List
<
CustomerReportGroup
>
items
);
List
<
CustomerReportGroupQueryListDto
>
queryReportGroupList
(
Stri
ng
userId
);
List
<
CustomerReportGroupQueryListDto
>
queryReportGroupList
(
@Param
(
"userId"
)
Lo
ng
userId
);
}
src/main/java/com/link/report/domain/wq/CustomerGroupQueryWq.java
浏览文件 @
c221861a
...
...
@@ -2,8 +2,13 @@ package com.link.report.domain.wq;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
CustomerGroupQueryWq
{
private
String
categoryName
;
private
List
<
String
>
groupIds
;
private
Long
createUserId
;
private
String
name
;
}
src/main/java/com/link/report/domain/wq/CustomerReportAddWq.java
浏览文件 @
c221861a
...
...
@@ -7,4 +7,11 @@ public class CustomerReportAddWq {
private
String
id
;
private
String
name
;
private
String
previewUrl
;
private
String
categoryName
;
private
Long
createUserId
;
private
Long
updateUserId
;
private
String
createBy
;
private
String
updateBy
;
}
src/main/java/com/link/report/domain/wq/CustomerReportQueryWq.java
浏览文件 @
c221861a
...
...
@@ -7,4 +7,5 @@ public class CustomerReportQueryWq {
private
String
id
;
private
String
name
;
private
String
previewUrl
;
private
String
categoryName
;
}
src/main/java/com/link/report/pojo/request/CustomerGroupAddVo.java
0 → 100644
浏览文件 @
c221861a
package
com
.
link
.
report
.
pojo
.
request
;
import
lombok.Data
;
/**
* @author : lvbencai
* @date : 2025年03月19日12:09:19
* @describe : 自定义报表查询条件
*/
@Data
public
class
CustomerGroupAddVo
{
private
String
id
;
private
String
groupId
;
private
String
groupName
;
private
String
previewUrl
;
private
String
categoryName
;
private
Long
createUserId
;
private
Long
updateUserId
;
private
String
createBy
;
private
String
updateBy
;
}
src/main/java/com/link/report/pojo/request/CustomerReportAddVo.java
浏览文件 @
c221861a
...
...
@@ -12,4 +12,12 @@ public class CustomerReportAddVo {
private
String
id
;
private
String
name
;
private
String
previewUrl
;
private
String
categoryName
;
private
Long
createUserId
;
private
Long
updateUserId
;
private
String
createBy
;
private
String
updateBy
;
}
src/main/java/com/link/report/pojo/request/CustomerReportQueryListVo.java
浏览文件 @
c221861a
...
...
@@ -9,5 +9,5 @@ import lombok.Data;
*/
@Data
public
class
CustomerReportQueryListVo
{
private
String
categoryName
=
"供应链报表"
;
private
String
categoryName
;
}
src/main/java/com/link/report/pojo/request/CustomerReportTransferVo.java
0 → 100644
浏览文件 @
c221861a
package
com
.
link
.
report
.
pojo
.
request
;
import
lombok.Data
;
/**
* @author : lvbencai
* @date : 2025年03月19日12:09:19
* @describe : 自定义报表查询条件
*/
@Data
public
class
CustomerReportTransferVo
{
private
String
reportName
;
private
String
fromId
;
private
String
toId
;
}
src/main/java/com/link/report/pojo/response/CustomerGroupDto.java
浏览文件 @
c221861a
...
...
@@ -6,6 +6,5 @@ import lombok.Data;
public
class
CustomerGroupDto
{
private
String
groupId
;
private
String
groupName
;
private
String
catalogName
;
private
String
categoryName
;
}
src/main/java/com/link/report/pojo/response/CustomerJimuReportDto.java
0 → 100644
浏览文件 @
c221861a
package
com
.
link
.
report
.
pojo
.
response
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
CustomerJimuReportDto
{
private
String
id
;
private
String
code
;
private
String
name
;
private
String
note
;
private
String
status
;
private
String
type
;
private
String
createBy
;
private
Date
createTime
;
private
String
updateBy
;
private
Date
updateTime
;
private
String
tenantId
;
private
Integer
updateCount
;
}
src/main/java/com/link/report/pojo/response/CustomerReportGroupQueryListDto.java
浏览文件 @
c221861a
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
public
class
CustomerReportGroupQueryListDto
{
private
String
groupId
;
private
String
groupName
;
private
String
categoryName
;
private
String
reportId
;
private
String
reportName
;
private
Integer
reportType
;
...
...
src/main/java/com/link/report/pojo/response/CustomerReportGroupResDto.java
浏览文件 @
c221861a
...
...
@@ -13,5 +13,6 @@ import java.util.List;
public
class
CustomerReportGroupResDto
{
private
String
groupId
;
private
String
groupName
;
private
String
categoryName
;
private
List
<
ReportItemsDto
>
items
;
}
src/main/java/com/link/report/pojo/response/ReportItemsDto.java
浏览文件 @
c221861a
...
...
@@ -14,4 +14,5 @@ public class ReportItemsDto {
private
String
reportName
;
// 报表类型,0自定义报表 1 积木报表
private
Integer
reportType
;
}
src/main/java/com/link/report/service/CustomerGroupService.java
0 → 100644
浏览文件 @
c221861a
package
com
.
link
.
report
.
service
;
import
com.link.report.pojo.request.CustomerGroupAddVo
;
public
interface
CustomerGroupService
{
void
save
(
CustomerGroupAddVo
customerGroupAddVo
);
void
delete
(
CustomerGroupAddVo
customerGroupAddVo
);
void
convert
();
}
src/main/java/com/link/report/service/CustomerReportService.java
浏览文件 @
c221861a
package
com
.
link
.
report
.
service
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
import
com.link.report.pojo.request.ReportShareListVo
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
java.util.List
;
...
...
@@ -8,6 +9,5 @@ import java.util.List;
public
interface
CustomerReportService
{
void
save
(
CustomerReportAddVo
customerReportAddVo
);
List
<
CustomerReportListDto
>
queryCustomerReportList
();
List
<
CustomerReportListDto
>
queryCustomerReportList
(
ReportShareListVo
reportShareListVo
);
}
src/main/java/com/link/report/service/ReportShareService.java
浏览文件 @
c221861a
package
com
.
link
.
report
.
service
;
import
com.link.report.pojo.request.CustomerReportTransferVo
;
import
com.link.report.pojo.request.ReportShareListVo
;
import
com.link.report.pojo.response.ReportShareBiListDto
;
...
...
@@ -7,4 +8,6 @@ import java.util.List;
public
interface
ReportShareService
{
List
<
ReportShareBiListDto
>
selectList
(
ReportShareListVo
reportShareListVo
);
void
transfer
(
CustomerReportTransferVo
customerReportTransferVo
);
}
src/main/java/com/link/report/service/impl/CustomerGroupServiceImpl.java
0 → 100644
浏览文件 @
c221861a
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.CustomerGroupAddVo
;
import
com.link.report.pojo.response.CustomerGroupDto
;
import
com.link.report.service.CustomerGroupService
;
import
com.sfa.common.core.constant.SecurityConstants
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.security.utils.SecurityUtils
;
import
com.sfa.system.api.RemoteUserService
;
import
com.sfa.system.api.domain.SysUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 报表分享数据
*/
@Service
public
class
CustomerGroupServiceImpl
implements
CustomerGroupService
{
@Autowired
private
CustomerGroupDao
groupDao
;
@Autowired
private
CustomerReportGroupDao
reportGroupDao
;
@Autowired
private
RemoteUserService
remoteUserService
;
@Override
public
void
save
(
CustomerGroupAddVo
customerReportAddVo
)
{
Long
userId
=
SecurityUtils
.
getUserId
();
String
userName
=
SecurityUtils
.
getUsername
();
customerReportAddVo
.
setCreateBy
(
userName
);
customerReportAddVo
.
setCreateUserId
(
userId
);
customerReportAddVo
.
setUpdateBy
(
userName
);
customerReportAddVo
.
setUpdateUserId
(
userId
);
if
(
ObjectUtil
.
isNotEmpty
(
customerReportAddVo
.
getGroupId
()))
{
groupDao
.
update
(
customerReportAddVo
);
}
else
{
groupDao
.
insert
(
customerReportAddVo
);
}
}
@Override
public
void
delete
(
CustomerGroupAddVo
customerReportAddVo
)
{
groupDao
.
delete
(
customerReportAddVo
.
getGroupId
());
}
@Override
public
void
convert
()
{
// 查询出当前有多少关联分组的
List
<
CustomerReportGroup
>
list
=
reportGroupDao
.
list
();
List
<
String
>
groupIds
=
list
.
stream
().
map
(
CustomerReportGroup:
:
getGroupId
).
collect
(
Collectors
.
toList
());
// 根据groupIds
CustomerGroupQueryWq
wq
=
new
CustomerGroupQueryWq
();
wq
.
setGroupIds
(
groupIds
);
List
<
CustomerGroupDto
>
groupDtos
=
groupDao
.
queryList
(
wq
);
// 转成map key 为groupid value 为CustomerGroupDto对象
Map
<
String
,
CustomerGroupDto
>
dtoMap
=
groupDtos
.
stream
().
collect
(
Collectors
.
toMap
(
CustomerGroupDto:
:
getGroupId
,
item
->
item
));
// 创建 不同人的分组信息
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
//获取组id
CustomerReportGroup
customerReportGroup
=
list
.
get
(
i
);
String
groupId
=
customerReportGroup
.
getGroupId
();
// groupDtos中找到匹配的数据
CustomerGroupDto
customerGroupDto
=
dtoMap
.
get
(
groupId
);
if
(
ObjectUtil
.
isNotEmpty
(
customerGroupDto
))
{
// 匹配到了
CustomerGroupAddVo
groupAddVo
=
new
CustomerGroupAddVo
();
// 分组
groupAddVo
.
setCategoryName
(
customerGroupDto
.
getCategoryName
());
groupAddVo
.
setGroupName
(
customerGroupDto
.
getGroupName
());
R
<
SysUser
>
userResult
=
remoteUserService
.
getUserInfoById
(
Long
.
valueOf
(
customerReportGroup
.
getCreateBy
()),
SecurityConstants
.
INNER
)
;
Long
userid
=
userResult
.
getData
().
getUserId
();
String
userName
=
userResult
.
getData
().
getUserName
();
CustomerGroupQueryWq
groupQueryWq
=
new
CustomerGroupQueryWq
();
groupQueryWq
.
setCreateUserId
(
userid
);
groupQueryWq
.
setName
(
customerGroupDto
.
getGroupName
());
List
<
CustomerGroupDto
>
existGroupDtos
=
groupDao
.
queryList
(
groupQueryWq
);
if
(
ObjectUtil
.
isEmpty
(
existGroupDtos
))
{
groupAddVo
.
setGroupId
(
IdUtil
.
getSnowflakeNextIdStr
());
groupAddVo
.
setCreateUserId
(
userid
);
groupAddVo
.
setUpdateUserId
(
userid
);
groupAddVo
.
setCreateBy
(
userName
);
groupAddVo
.
setUpdateBy
(
userName
);
groupDao
.
insert
(
groupAddVo
);
customerReportGroup
.
setGroupId
(
groupAddVo
.
getGroupId
());
}
else
{
CustomerGroupDto
existGroupDto
=
existGroupDtos
.
get
(
0
);
customerReportGroup
.
setGroupId
(
existGroupDto
.
getGroupId
());
}
// 修改数据
customerReportGroup
.
setCreateBy
(
userName
);
customerReportGroup
.
setUpdateBy
(
userName
);
customerReportGroup
.
setCreateUserId
(
userid
);
customerReportGroup
.
setUpdateUserId
(
userid
);
customerReportGroup
.
setUpdateTime
(
new
Date
());
// 更新 分组id
reportGroupDao
.
update
(
customerReportGroup
);
}
}
}
}
src/main/java/com/link/report/service/impl/CustomerReportGroupServiceImpl.java
浏览文件 @
c221861a
...
...
@@ -37,6 +37,7 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
public
List
<
CustomerReportGroupResDto
>
queryList
(
CustomerReportQueryListVo
vo
)
{
CustomerGroupQueryWq
wq
=
new
CustomerGroupQueryWq
();
wq
.
setCategoryName
(
vo
.
getCategoryName
());
wq
.
setCreateUserId
(
SecurityUtils
.
getLoginUser
().
getUserid
());
// 先查询分组
List
<
CustomerGroupDto
>
groupDtos
=
customerGroupDao
.
queryList
(
wq
);
List
<
CustomerReportGroupQueryListDto
>
list
=
customerReportGroupDao
.
queryList
();
...
...
@@ -63,8 +64,6 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
resDto
.
setItems
(
itemsDtos
);
result
.
add
(
resDto
);
}
return
result
;
}
...
...
@@ -77,7 +76,6 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
@Override
public
void
save
(
List
<
CustomerReportGroupVo
>
customerReportGroupVo
)
{
// 新增或者修改 先删除后新增
Long
userId
=
SecurityUtils
.
getLoginUser
().
getUserid
();
customerReportGroupDao
.
deleteByCreatorId
(
userId
);
...
...
@@ -92,12 +90,15 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
dto
.
setGroupId
(
vo
.
getGroupId
());
dto
.
setReportId
(
item
.
getReportId
());
dto
.
setReportType
(
item
.
getReportType
());
dto
.
setCreateBy
(
String
.
valueOf
(
userId
));
dto
.
setCreateBy
(
SecurityUtils
.
getUsername
());
dto
.
setCreateUserId
(
userId
);
dto
.
setUpdateBy
(
SecurityUtils
.
getUsername
());
dto
.
setUpdateUserId
(
userId
);
dto
.
setTenantId
(
String
.
valueOf
(
userId
));
items
.
add
(
dto
);
}
}
if
(
ObjectUtil
.
isNotEmpty
(
items
))
{
if
(
ObjectUtil
.
isNotEmpty
(
items
))
{
customerReportGroupDao
.
batchInsert
(
items
);
}
}
...
...
src/main/java/com/link/report/service/impl/CustomerReportServiceImpl.java
浏览文件 @
c221861a
...
...
@@ -2,12 +2,14 @@ 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.
entity.CustomerReport
;
import
com.link.report.domain.wq.CustomerReportQueryWq
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
import
com.link.report.pojo.request.ReportShareListVo
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
com.link.report.service.CustomerReportService
;
import
com.sfa.common.core.utils.bean.BeanUtils
;
import
com.sfa.common.security.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -24,18 +26,26 @@ public class CustomerReportServiceImpl implements CustomerReportService {
@Override
public
void
save
(
CustomerReportAddVo
customerReportAddVo
)
{
CustomerReportAddWq
wq
=
new
CustomerReportAddWq
();
BeanUtils
.
copyProperties
(
customerReportAddVo
,
wq
);
if
(
ObjectUtil
.
isNotEmpty
(
wq
.
getId
()))
{
customerReportDao
.
update
(
wq
);
CustomerReport
customerReport
=
new
CustomerReport
();
BeanUtils
.
copyProperties
(
customerReportAddVo
,
customerReport
);
customerReport
.
setName
(
customerReportAddVo
.
getName
());
customerReport
.
setPreviewUrl
(
customerReportAddVo
.
getPreviewUrl
());
customerReport
.
setCreateBy
(
SecurityUtils
.
getUsername
());
customerReport
.
setUpdateBy
(
SecurityUtils
.
getUsername
());
customerReport
.
setCreateUserId
(
SecurityUtils
.
getUserId
());
customerReport
.
setUpdateUserId
(
SecurityUtils
.
getUserId
());
if
(
ObjectUtil
.
isNotEmpty
(
customerReport
.
getId
()))
{
customerReportDao
.
update
(
customerReport
);
}
else
{
customerReportDao
.
insert
(
wq
);
customerReportDao
.
insert
(
customerReport
);
}
}
@Override
public
List
<
CustomerReportListDto
>
queryCustomerReportList
(
)
{
public
List
<
CustomerReportListDto
>
queryCustomerReportList
(
ReportShareListVo
reportShareListVo
)
{
CustomerReportQueryWq
wq
=
new
CustomerReportQueryWq
();
wq
.
setCategoryName
(
reportShareListVo
.
getCategoryName
());
List
<
CustomerReportListDto
>
list
=
customerReportDao
.
queryCustomerReportList
(
wq
);
return
list
;
}
...
...
src/main/java/com/link/report/service/impl/JimuReportTokenServiceImpl.java
浏览文件 @
c221861a
...
...
@@ -34,7 +34,7 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
*/
@Override
public
String
getToken
(
HttpServletRequest
request
)
{
String
token
=
""
;
String
token
=
""
;
if
(
request
!=
null
)
{
token
=
request
.
getParameter
(
"token"
);
if
(
ObjectUtil
.
isEmpty
(
token
))
{
...
...
@@ -66,10 +66,10 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
s
);
Set
<
String
>
roles
=
loginUser
.
getRoles
();
// it可以设计任何报表
if
(!
ObjectUtil
.
isAllNotEmpty
(
loginUser
.
getSysUser
(),
loginUser
.
getSysUser
().
getDept
()
,
loginUser
.
getSysUser
().
getDept
().
getDeptName
())
&&
if
(!
ObjectUtil
.
isAllNotEmpty
(
loginUser
.
getSysUser
(),
loginUser
.
getSysUser
().
getDept
()
,
loginUser
.
getSysUser
().
getDept
().
getDeptName
())
&&
// 信息中心可以编辑所有报表
loginUser
.
getSysUser
().
getDept
().
getDeptName
().
contains
(
"信息技术中心"
))
{
loginUser
.
getSysUser
().
getDept
().
getDeptName
().
contains
(
"信息技术中心"
))
{
roles
.
add
(
"admin"
);
}
return
roles
.
toArray
(
new
String
[
0
]);
...
...
@@ -88,7 +88,6 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
}
/**
* 自定义请求头
*/
...
...
@@ -117,16 +116,9 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
//都不具备则不能访问
return
"NO"
;
}
//具备admin或者管理员权限才可访问所有报表
// if (SecurityUtils.isAdmin(loginUser.getUserid())
// || loginUser.getRoles().contains("it")
// // 信息中心可以编辑所有报表
// || loginUser.getSysUser().getDept().getDeptName().contains("信息技术中心")) {
// return "1";
// }
Long
deptId
=
loginUser
.
getSysUser
().
getDept
().
getDeptId
();
return
String
.
valueOf
(
deptId
);
}
}
@Override
public
Map
<
String
,
Object
>
getUserInfo
(
String
token
)
{
...
...
@@ -154,12 +146,12 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
return
new
String
[
0
];
}
Set
<
String
>
permissions
=
loginUser
.
getPermissions
();
if
(
ObjectUtil
.
isNotEmpty
(
permissions
))
{
permissions
.
add
(
"drag:datasource:testConnection"
);
if
(
ObjectUtil
.
isNotEmpty
(
permissions
))
{
permissions
.
add
(
"drag:datasource:testConnection"
);
permissions
.
add
(
"onl:drag:clear:recoverry"
);
permissions
.
add
(
"drag:analysis:sql"
);
permissions
.
add
(
"drag:design:getTotalData"
);
return
permissions
.
toArray
(
new
String
[
0
]);
return
permissions
.
toArray
(
new
String
[
0
]);
}
return
new
String
[
0
];
...
...
src/main/java/com/link/report/service/impl/ReportShareServiceImpl.java
浏览文件 @
c221861a
package
com
.
link
.
report
.
service
.
impl
;
import
com.link.report.domain.dao.CustomerJimuReportDao
;
import
com.link.report.domain.dao.ReportShareDao
;
import
com.link.report.domain.wq.ReportShareListWq
;
import
com.link.report.pojo.request.CustomerReportTransferVo
;
import
com.link.report.pojo.request.ReportShareListVo
;
import
com.link.report.pojo.response.CustomerJimuReportDto
;
import
com.link.report.pojo.response.ReportShareBiListDto
;
import
com.link.report.service.ReportShareService
;
import
com.sfa.common.core.constant.SecurityConstants
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.core.utils.bean.BeanUtils
;
import
com.sfa.system.api.RemoteUserService
;
import
com.sfa.system.api.model.LoginUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -18,6 +25,10 @@ import java.util.List;
public
class
ReportShareServiceImpl
implements
ReportShareService
{
@Autowired
private
ReportShareDao
reportShareDao
;
@Autowired
private
CustomerJimuReportDao
customerJimuReportDao
;
@Autowired
private
RemoteUserService
remoteUserService
;
@Override
public
List
<
ReportShareBiListDto
>
selectList
(
ReportShareListVo
reportShareListVo
)
{
...
...
@@ -25,4 +36,18 @@ public class ReportShareServiceImpl implements ReportShareService {
BeanUtils
.
copyProperties
(
reportShareListVo
,
wq
);
return
reportShareDao
.
selectList
(
wq
);
}
@Override
public
void
transfer
(
CustomerReportTransferVo
customerReportTransferVo
)
{
// 查询当前的报表
CustomerJimuReportDto
customerJimuReportDto
=
customerJimuReportDao
.
queryByName
(
customerReportTransferVo
.
getReportName
());
R
<
LoginUser
>
userResult
=
remoteUserService
.
getUserInfo
(
customerReportTransferVo
.
getToId
(),
SecurityConstants
.
INNER
)
;
// 获取新用户的租户id
Long
deptId
=
userResult
.
getData
().
getSysUser
().
getDeptId
();
customerJimuReportDto
.
setTenantId
(
deptId
.
toString
());
// 修改报表
customerJimuReportDao
.
updateTenentId
(
customerJimuReportDto
);
}
}
src/main/resources/bootstrap.yml
浏览文件 @
c221861a
spring
:
profiles
:
active
:
dev
src/main/resources/mapper/report/CustomerReportGroupMapper.xml
浏览文件 @
c221861a
...
...
@@ -10,9 +10,11 @@
report_type,
group_id,
create_by,
create_time,
create_user_id,
update_by,
update_time,
update_user_id,
del_flag,
tenant_id,
update_count
...
...
@@ -24,9 +26,11 @@
#{item.reportType},
#{item.groupId},
#{item.createBy},
#{item.createTime},
#{item.createUserId},
#{item.updateBy},
#{item.updateTime},
#{item.updateUserId},
#{item.delFlag},
#{item.tenantId},
#{item.updateCount}
...
...
@@ -37,22 +41,27 @@
<select
id=
"queryReportGroupList"
resultType=
"com.link.report.pojo.response.CustomerReportGroupQueryListDto"
>
<!-- 自定义报表关联 -->
select
distinct groupId ,groupName,reportId,reportName,previewUrl,reportType
from (
select
groupId ,groupName,reportId,reportName,previewUrl,reportType,categoryName,createTime,crgId
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
cr.preview_url as previewUrl,
cg.category_name as categoryName,
crg.create_time as createTime,
crg.id as crgId
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>
cg.del_flag = 0
<if
test=
"userId != null and userId != ''"
>
AND c
rg.create_by
= #{userId}
AND c
g.create_user_id
= #{userId}
</if>
</where>
<!-- 积木报表关联 -->
...
...
@@ -63,7 +72,10 @@
crg.report_type as reportType,
jr.id as reportId,
jr.name as reportName,
jrs.preview_url as previewUrl
jrs.preview_url as previewUrl,
cg.category_name as categoryName,
crg.create_time as createTime,
crg.id as crgId
FROM
customer_group cg
...
...
@@ -73,9 +85,11 @@
join jimu_report_share jrs on jr.id = jrs.report_id
<where>
<if
test=
"userId!= null and userId!= ''"
>
AND crg.create_
by
= #{userId}
AND crg.create_
user_id
= #{userId}
</if>
</where>
) tmp
order by crgId, createTime
</select>
</mapper>
src/main/resources/mapper/report/ReportShareBiMapper.xml
浏览文件 @
c221861a
...
...
@@ -19,12 +19,6 @@
<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.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 as reportName,
1 as reportType
from jimu_report_share jrs
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论