Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-link-report
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-link-report
Commits
751376de
提交
751376de
authored
3月 28, 2025
作者:
吕本才
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、增加分组保存、删除接口,2、优化之前的接口 3、
上级
db376f16
显示空白字符变更
内嵌
并排
正在显示
27 个修改的文件
包含
276 行增加
和
47 行删除
+276
-47
pom.xml
pom.xml
+5
-1
CustomerGroupCoreController.java
...k/report/controller/core/CustomerGroupCoreController.java
+42
-0
CustomerReportQueryController.java
...eport/controller/query/CustomerReportQueryController.java
+3
-2
CustomerGroupDao.java
...ain/java/com/link/report/domain/dao/CustomerGroupDao.java
+7
-0
CustomerReportGroupDao.java
...va/com/link/report/domain/dao/CustomerReportGroupDao.java
+5
-2
CustomerGroupDaoImpl.java
...com/link/report/domain/dao/impl/CustomerGroupDaoImpl.java
+28
-1
CustomerReportDaoImpl.java
...om/link/report/domain/dao/impl/CustomerReportDaoImpl.java
+3
-2
CustomerReportGroupDaoImpl.java
...nk/report/domain/dao/impl/CustomerReportGroupDaoImpl.java
+14
-5
CustomerGroup.java
...ain/java/com/link/report/domain/entity/CustomerGroup.java
+4
-0
CustomerReport.java
...in/java/com/link/report/domain/entity/CustomerReport.java
+4
-0
CustomerReportGroup.java
...va/com/link/report/domain/entity/CustomerReportGroup.java
+2
-0
CustomerReportGroupMapper.java
.../link/report/domain/mapper/CustomerReportGroupMapper.java
+2
-1
CustomerGroupQueryWq.java
.../java/com/link/report/domain/wq/CustomerGroupQueryWq.java
+4
-0
CustomerReportQueryWq.java
...java/com/link/report/domain/wq/CustomerReportQueryWq.java
+1
-0
CustomerGroupAddVo.java
...java/com/link/report/pojo/request/CustomerGroupAddVo.java
+14
-0
CustomerReportAddVo.java
...ava/com/link/report/pojo/request/CustomerReportAddVo.java
+8
-3
CustomerReportQueryListVo.java
...m/link/report/pojo/request/CustomerReportQueryListVo.java
+1
-1
CustomerGroupDto.java
.../java/com/link/report/pojo/response/CustomerGroupDto.java
+0
-1
CustomerGroupService.java
...in/java/com/link/report/service/CustomerGroupService.java
+11
-0
CustomerReportService.java
...n/java/com/link/report/service/CustomerReportService.java
+2
-2
CustomerGroupServiceImpl.java
...om/link/report/service/impl/CustomerGroupServiceImpl.java
+94
-0
CustomerReportGroupServiceImpl.java
...k/report/service/impl/CustomerReportGroupServiceImpl.java
+6
-5
CustomerReportServiceImpl.java
...m/link/report/service/impl/CustomerReportServiceImpl.java
+3
-1
JimuReportTokenServiceImpl.java
.../link/report/service/impl/JimuReportTokenServiceImpl.java
+4
-12
bootstrap.yml
src/main/resources/bootstrap.yml
+2
-0
CustomerReportGroupMapper.xml
...ain/resources/mapper/report/CustomerReportGroupMapper.xml
+7
-2
ReportShareBiMapper.xml
src/main/resources/mapper/report/ReportShareBiMapper.xml
+0
-6
没有找到文件。
pom.xml
浏览文件 @
751376de
...
@@ -74,7 +74,11 @@
...
@@ -74,7 +74,11 @@
<groupId>
com.wangxiaolu.sfa
</groupId>
<groupId>
com.wangxiaolu.sfa
</groupId>
<artifactId>
wangxiaolu-sfa-common-log
</artifactId>
<artifactId>
wangxiaolu-sfa-common-log
</artifactId>
</dependency>
</dependency>
<!-- RuoYi Api System -->
<dependency>
<groupId>
com.wangxiaolu.sfa
</groupId>
<artifactId>
wangxiaolu-sfa-api-system
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
...
...
src/main/java/com/link/report/controller/core/CustomerGroupCoreController.java
0 → 100644
浏览文件 @
751376de
package
com
.
link
.
report
.
controller
.
core
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
import
com.link.report.service.CustomerGroupService
;
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.*
;
/**
* @author : liqiulin
* @date : 2024-12-04 15
* @describe : 自定义报表管理
*/
@RestController
@RequestMapping
(
"/customer/core"
)
public
class
CustomerGroupCoreController
{
@Autowired
CustomerGroupService
groupService
;
@RequiresPermissions
(
"bi:supply:list"
)
@PostMapping
(
"/group/insertOrUpdate"
)
public
R
save
(
@RequestBody
CustomerReportAddVo
customerReportAddVo
)
{
groupService
.
save
(
customerReportAddVo
);
return
R
.
ok
();
}
@RequiresPermissions
(
"bi:supply:list"
)
@DeleteMapping
(
"/group/delete"
)
public
R
delete
(
CustomerReportAddVo
customerReportAddVo
)
{
groupService
.
delete
(
customerReportAddVo
);
return
R
.
ok
();
}
@RequiresPermissions
(
"bi:supply:list"
)
@GetMapping
(
"/group/convert"
)
public
R
convert
()
{
groupService
.
convert
();
return
R
.
ok
();
}
}
src/main/java/com/link/report/controller/query/CustomerReportQueryController.java
浏览文件 @
751376de
package
com
.
link
.
report
.
controller
.
query
;
package
com
.
link
.
report
.
controller
.
query
;
import
com.link.report.pojo.request.ReportShareListVo
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
com.link.report.pojo.response.CustomerReportListDto
;
import
com.link.report.service.CustomerReportService
;
import
com.link.report.service.CustomerReportService
;
import
com.sfa.common.core.domain.R
;
import
com.sfa.common.core.domain.R
;
...
@@ -25,8 +26,8 @@ public class CustomerReportQueryController {
...
@@ -25,8 +26,8 @@ public class CustomerReportQueryController {
@RequiresPermissions
(
"bi:supply:list"
)
@RequiresPermissions
(
"bi:supply:list"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
R
<
List
<
CustomerReportListDto
>>
queryList
()
{
public
R
<
List
<
CustomerReportListDto
>>
queryList
(
ReportShareListVo
reportShareListVo
)
{
List
<
CustomerReportListDto
>
customerReportListDtos
=
customerReportService
.
queryCustomerReportList
();
List
<
CustomerReportListDto
>
customerReportListDtos
=
customerReportService
.
queryCustomerReportList
(
reportShareListVo
);
return
R
.
ok
(
customerReportListDtos
);
return
R
.
ok
(
customerReportListDtos
);
}
}
}
}
src/main/java/com/link/report/domain/dao/CustomerGroupDao.java
浏览文件 @
751376de
package
com
.
link
.
report
.
domain
.
dao
;
package
com
.
link
.
report
.
domain
.
dao
;
import
com.link.report.domain.wq.CustomerGroupQueryWq
;
import
com.link.report.domain.wq.CustomerGroupQueryWq
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
import
com.link.report.pojo.response.CustomerGroupDto
;
import
com.link.report.pojo.response.CustomerGroupDto
;
import
java.util.List
;
import
java.util.List
;
public
interface
CustomerGroupDao
{
public
interface
CustomerGroupDao
{
List
<
CustomerGroupDto
>
queryList
(
CustomerGroupQueryWq
wq
);
List
<
CustomerGroupDto
>
queryList
(
CustomerGroupQueryWq
wq
);
void
insert
(
CustomerReportAddVo
customerReportAddVo
);
void
update
(
CustomerReportAddVo
customerReportAddVo
);
void
delete
(
String
groupId
);
}
}
src/main/java/com/link/report/domain/dao/CustomerReportGroupDao.java
浏览文件 @
751376de
...
@@ -2,15 +2,18 @@ package com.link.report.domain.dao;
...
@@ -2,15 +2,18 @@ package com.link.report.domain.dao;
import
com.link.report.domain.entity.CustomerReportGroup
;
import
com.link.report.domain.entity.CustomerReportGroup
;
import
com.link.report.pojo.response.CustomerReportGroupQueryListDto
;
import
com.link.report.pojo.response.CustomerReportGroupQueryListDto
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
import
java.util.List
;
@Mapper
public
interface
CustomerReportGroupDao
{
public
interface
CustomerReportGroupDao
{
List
<
CustomerReportGroup
>
list
();
List
<
CustomerReportGroupQueryListDto
>
queryList
();
List
<
CustomerReportGroupQueryListDto
>
queryList
();
void
deleteByCreatorId
(
Long
userId
);
void
deleteByCreatorId
(
Long
userId
);
void
batchInsert
(
List
<
CustomerReportGroup
>
items
);
void
batchInsert
(
List
<
CustomerReportGroup
>
items
);
void
update
(
CustomerReportGroup
customerReportGroup
);
}
}
src/main/java/com/link/report/domain/dao/impl/CustomerGroupDaoImpl.java
浏览文件 @
751376de
...
@@ -7,7 +7,9 @@ import com.link.report.domain.dao.CustomerGroupDao;
...
@@ -7,7 +7,9 @@ import com.link.report.domain.dao.CustomerGroupDao;
import
com.link.report.domain.entity.CustomerGroup
;
import
com.link.report.domain.entity.CustomerGroup
;
import
com.link.report.domain.mapper.CustomerGroupMapper
;
import
com.link.report.domain.mapper.CustomerGroupMapper
;
import
com.link.report.domain.wq.CustomerGroupQueryWq
;
import
com.link.report.domain.wq.CustomerGroupQueryWq
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
import
com.link.report.pojo.response.CustomerGroupDto
;
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.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -27,7 +29,9 @@ public class CustomerGroupDaoImpl implements CustomerGroupDao {
...
@@ -27,7 +29,9 @@ public class CustomerGroupDaoImpl implements CustomerGroupDao {
public
List
<
CustomerGroupDto
>
queryList
(
CustomerGroupQueryWq
wq
)
{
public
List
<
CustomerGroupDto
>
queryList
(
CustomerGroupQueryWq
wq
)
{
Wrapper
<
CustomerGroup
>
wraper
=
new
LambdaQueryWrapper
<
CustomerGroup
>()
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
());
List
<
CustomerGroup
>
customerGroups
=
groupMapper
.
selectList
(
wraper
);
List
<
CustomerGroup
>
customerGroups
=
groupMapper
.
selectList
(
wraper
);
List
<
CustomerGroupDto
>
result
=
new
ArrayList
<>();
List
<
CustomerGroupDto
>
result
=
new
ArrayList
<>();
for
(
CustomerGroup
customerGroup
:
customerGroups
)
{
for
(
CustomerGroup
customerGroup
:
customerGroups
)
{
...
@@ -39,4 +43,27 @@ public class CustomerGroupDaoImpl implements CustomerGroupDao {
...
@@ -39,4 +43,27 @@ public class CustomerGroupDaoImpl implements CustomerGroupDao {
}
}
return
result
;
return
result
;
}
}
@Override
public
void
insert
(
CustomerReportAddVo
customerReportAddVo
)
{
CustomerGroup
customerGroup
=
BeanUtils
.
transitionDto
(
customerReportAddVo
,
CustomerGroup
.
class
);
customerGroup
.
setName
(
customerReportAddVo
.
getGroupName
());
customerGroup
.
setCategoryName
(
customerReportAddVo
.
getCategoryName
());
groupMapper
.
insert
(
customerGroup
);
}
@Override
public
void
update
(
CustomerReportAddVo
customerReportAddVo
)
{
CustomerGroup
customerGroup
=
BeanUtils
.
transitionDto
(
customerReportAddVo
,
CustomerGroup
.
class
);
customerGroup
.
setId
(
customerReportAddVo
.
getGroupId
());
customerGroup
.
setName
(
customerReportAddVo
.
getGroupName
());
customerGroup
.
setCategoryName
(
customerReportAddVo
.
getCategoryName
());
groupMapper
.
updateById
(
customerGroup
);
}
@Override
public
void
delete
(
String
groupId
)
{
groupMapper
.
deleteById
(
groupId
);
}
}
}
src/main/java/com/link/report/domain/dao/impl/CustomerReportDaoImpl.java
浏览文件 @
751376de
package
com
.
link
.
report
.
domain
.
dao
.
impl
;
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.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.link.report.domain.dao.CustomerReportDao
;
import
com.link.report.domain.dao.CustomerReportDao
;
...
@@ -26,7 +27,6 @@ public class CustomerReportDaoImpl implements CustomerReportDao {
...
@@ -26,7 +27,6 @@ public class CustomerReportDaoImpl implements CustomerReportDao {
@Override
@Override
public
void
insert
(
CustomerReportAddWq
wq
)
{
public
void
insert
(
CustomerReportAddWq
wq
)
{
CustomerReport
entity
=
BeanUtils
.
transitionDto
(
wq
,
CustomerReport
.
class
);
CustomerReport
entity
=
BeanUtils
.
transitionDto
(
wq
,
CustomerReport
.
class
);
customerReportMapper
.
insert
(
entity
);
customerReportMapper
.
insert
(
entity
);
}
}
...
@@ -39,7 +39,8 @@ public class CustomerReportDaoImpl implements CustomerReportDao {
...
@@ -39,7 +39,8 @@ public class CustomerReportDaoImpl implements CustomerReportDao {
@Override
@Override
public
List
<
CustomerReportListDto
>
queryCustomerReportList
(
CustomerReportQueryWq
wq
)
{
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
<
CustomerReport
>
customerReports
=
customerReportMapper
.
selectList
(
qw
);
List
<
CustomerReportListDto
>
list
=
new
ArrayList
<>();
List
<
CustomerReportListDto
>
list
=
new
ArrayList
<>();
...
...
src/main/java/com/link/report/domain/dao/impl/CustomerReportGroupDaoImpl.java
浏览文件 @
751376de
...
@@ -18,24 +18,33 @@ import java.util.List;
...
@@ -18,24 +18,33 @@ import java.util.List;
public
class
CustomerReportGroupDaoImpl
implements
CustomerReportGroupDao
{
public
class
CustomerReportGroupDaoImpl
implements
CustomerReportGroupDao
{
@Autowired
@Autowired
private
CustomerReportGroupMapper
reportGroupMapper
;
private
CustomerReportGroupMapper
reportGroupMapper
;
@Override
public
List
<
CustomerReportGroup
>
list
()
{
// 更加登录人id查询
List
<
CustomerReportGroup
>
list
=
reportGroupMapper
.
selectList
(
new
LambdaQueryWrapper
<>());
return
list
;
}
@Override
@Override
public
List
<
CustomerReportGroupQueryListDto
>
queryList
()
{
public
List
<
CustomerReportGroupQueryListDto
>
queryList
()
{
Long
userId
=
SecurityUtils
.
getUserId
();
// 更加登录人id查询
// 更加登录人id查询
Long
userId
=
SecurityUtils
.
getLoginUser
().
getUserid
();
List
<
CustomerReportGroupQueryListDto
>
list
=
reportGroupMapper
.
queryReportGroupList
(
userId
);
List
<
CustomerReportGroupQueryListDto
>
list
=
reportGroupMapper
.
queryReportGroupList
(
String
.
valueOf
(
userId
));
return
list
;
return
list
;
}
}
@Override
@Override
public
void
deleteByCreatorId
(
Long
userId
)
{
public
void
deleteByCreatorId
(
Long
userId
)
{
reportGroupMapper
.
delete
(
new
LambdaQueryWrapper
<
CustomerReportGroup
>()
reportGroupMapper
.
delete
(
new
LambdaQueryWrapper
<
CustomerReportGroup
>()
.
eq
(
CustomerReportGroup:
:
getCreate
By
,
userId
));
.
eq
(
CustomerReportGroup:
:
getCreate
UserId
,
userId
));
}
}
@Override
@Override
public
void
batchInsert
(
List
<
CustomerReportGroup
>
items
)
{
public
void
batchInsert
(
List
<
CustomerReportGroup
>
items
)
{
reportGroupMapper
.
batchInsert
(
items
);
reportGroupMapper
.
batchInsert
(
items
);
}
}
@Override
public
void
update
(
CustomerReportGroup
customerReportGroup
)
{
reportGroupMapper
.
updateById
(
customerReportGroup
);
}
}
}
src/main/java/com/link/report/domain/entity/CustomerGroup.java
浏览文件 @
751376de
package
com
.
link
.
report
.
domain
.
entity
;
package
com
.
link
.
report
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -45,6 +46,7 @@ public class CustomerGroup {
...
@@ -45,6 +46,7 @@ public class CustomerGroup {
/**
/**
* 删除标识,0 表示正常,1 表示已删除
* 删除标识,0 表示正常,1 表示已删除
*/
*/
@TableLogic
private
Integer
delFlag
;
private
Integer
delFlag
;
/**
/**
* 多租户标识
* 多租户标识
...
@@ -54,4 +56,6 @@ public class CustomerGroup {
...
@@ -54,4 +56,6 @@ public class CustomerGroup {
* 乐观锁版本
* 乐观锁版本
*/
*/
private
Integer
updateCount
;
private
Integer
updateCount
;
private
Long
createUserId
;
private
Long
updateUserId
;
}
}
src/main/java/com/link/report/domain/entity/CustomerReport.java
浏览文件 @
751376de
...
@@ -9,6 +9,8 @@ import java.util.Date;
...
@@ -9,6 +9,8 @@ import java.util.Date;
public
class
CustomerReport
{
public
class
CustomerReport
{
private
String
id
;
private
String
id
;
private
String
code
;
private
String
code
;
private
String
categoryName
;
private
String
name
;
private
String
name
;
private
String
previewUrl
;
private
String
previewUrl
;
private
String
remark
;
private
String
remark
;
...
@@ -22,4 +24,6 @@ public class CustomerReport {
...
@@ -22,4 +24,6 @@ public class CustomerReport {
private
Integer
delFlag
;
private
Integer
delFlag
;
private
String
tenantId
;
private
String
tenantId
;
private
Integer
updateCount
;
private
Integer
updateCount
;
private
Long
createUserId
;
private
Long
updateUserId
;
}
}
src/main/java/com/link/report/domain/entity/CustomerReportGroup.java
浏览文件 @
751376de
...
@@ -18,4 +18,6 @@ public class CustomerReportGroup {
...
@@ -18,4 +18,6 @@ public class CustomerReportGroup {
private
Integer
delFlag
;
private
Integer
delFlag
;
private
String
tenantId
;
private
String
tenantId
;
private
Integer
updateCount
;
private
Integer
updateCount
;
private
Long
createUserId
;
private
Long
updateUserId
;
}
}
src/main/java/com/link/report/domain/mapper/CustomerReportGroupMapper.java
浏览文件 @
751376de
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.link.report.domain.entity.CustomerReportGroup
;
import
com.link.report.domain.entity.CustomerReportGroup
;
import
com.link.report.pojo.response.CustomerReportGroupQueryListDto
;
import
com.link.report.pojo.response.CustomerReportGroupQueryListDto
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -12,5 +13,5 @@ public interface CustomerReportGroupMapper extends BaseMapper<CustomerReportGrou
...
@@ -12,5 +13,5 @@ public interface CustomerReportGroupMapper extends BaseMapper<CustomerReportGrou
void
batchInsert
(
List
<
CustomerReportGroup
>
items
);
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
浏览文件 @
751376de
...
@@ -2,8 +2,12 @@ package com.link.report.domain.wq;
...
@@ -2,8 +2,12 @@ package com.link.report.domain.wq;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@Data
@Data
public
class
CustomerGroupQueryWq
{
public
class
CustomerGroupQueryWq
{
private
String
categoryName
;
private
String
categoryName
;
private
List
<
String
>
groupIds
;
private
Long
createUserId
;
}
}
src/main/java/com/link/report/domain/wq/CustomerReportQueryWq.java
浏览文件 @
751376de
...
@@ -7,4 +7,5 @@ public class CustomerReportQueryWq {
...
@@ -7,4 +7,5 @@ public class CustomerReportQueryWq {
private
String
id
;
private
String
id
;
private
String
name
;
private
String
name
;
private
String
previewUrl
;
private
String
previewUrl
;
private
String
categoryName
;
}
}
src/main/java/com/link/report/pojo/request/CustomerGroupAddVo.java
0 → 100644
浏览文件 @
751376de
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
name
;
}
src/main/java/com/link/report/pojo/request/CustomerReportAddVo.java
浏览文件 @
751376de
...
@@ -9,7 +9,12 @@ import lombok.Data;
...
@@ -9,7 +9,12 @@ import lombok.Data;
*/
*/
@Data
@Data
public
class
CustomerReportAddVo
{
public
class
CustomerReportAddVo
{
private
String
id
;
private
String
groupId
;
private
String
name
;
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/CustomerReportQueryListVo.java
浏览文件 @
751376de
...
@@ -9,5 +9,5 @@ import lombok.Data;
...
@@ -9,5 +9,5 @@ import lombok.Data;
*/
*/
@Data
@Data
public
class
CustomerReportQueryListVo
{
public
class
CustomerReportQueryListVo
{
private
String
categoryName
=
"供应链报表"
;
private
String
categoryName
;
}
}
src/main/java/com/link/report/pojo/response/CustomerGroupDto.java
浏览文件 @
751376de
...
@@ -7,5 +7,4 @@ public class CustomerGroupDto {
...
@@ -7,5 +7,4 @@ public class CustomerGroupDto {
private
String
groupId
;
private
String
groupId
;
private
String
groupName
;
private
String
groupName
;
private
String
catalogName
;
private
String
catalogName
;
}
}
src/main/java/com/link/report/service/CustomerGroupService.java
0 → 100644
浏览文件 @
751376de
package
com
.
link
.
report
.
service
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
public
interface
CustomerGroupService
{
void
save
(
CustomerReportAddVo
customerReportAddVo
);
void
delete
(
CustomerReportAddVo
customerReportAddVo
);
void
convert
();
}
src/main/java/com/link/report/service/CustomerReportService.java
浏览文件 @
751376de
package
com
.
link
.
report
.
service
;
package
com
.
link
.
report
.
service
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
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.pojo.response.CustomerReportListDto
;
import
java.util.List
;
import
java.util.List
;
...
@@ -8,6 +9,5 @@ import java.util.List;
...
@@ -8,6 +9,5 @@ import java.util.List;
public
interface
CustomerReportService
{
public
interface
CustomerReportService
{
void
save
(
CustomerReportAddVo
customerReportAddVo
);
void
save
(
CustomerReportAddVo
customerReportAddVo
);
List
<
CustomerReportListDto
>
queryCustomerReportList
(
ReportShareListVo
reportShareListVo
);
List
<
CustomerReportListDto
>
queryCustomerReportList
();
}
}
src/main/java/com/link/report/service/impl/CustomerGroupServiceImpl.java
0 → 100644
浏览文件 @
751376de
package
com
.
link
.
report
.
service
.
impl
;
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.CustomerReportAddVo
;
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.model.LoginUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
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
(
CustomerReportAddVo
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
(
CustomerReportAddVo
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
))
{
// 匹配到了
CustomerReportAddVo
customerReportAddVo
=
new
CustomerReportAddVo
();
customerReportAddVo
.
setCategoryName
(
customerGroupDto
.
getCatalogName
());
customerReportAddVo
.
setGroupName
(
customerGroupDto
.
getGroupName
());
customerReportAddVo
.
setCreateBy
(
customerReportGroup
.
getCreateBy
());
customerReportAddVo
.
setUpdateBy
(
customerReportGroup
.
getUpdateBy
());
R
<
LoginUser
>
userResult
=
remoteUserService
.
getUserInfo
(
customerReportGroup
.
getCreateBy
(),
SecurityConstants
.
INNER
)
;
Long
userid
=
userResult
.
getData
().
getSysUser
().
getUserId
();
customerReportAddVo
.
setCreateUserId
(
userid
);
customerReportAddVo
.
setUpdateUserId
(
userid
);
groupDao
.
insert
(
customerReportAddVo
);
// 修改数据
customerReportGroup
.
setGroupId
(
customerReportAddVo
.
getGroupId
());
// 更新 分组id
reportGroupDao
.
update
(
customerReportGroup
);
}
}
}
}
src/main/java/com/link/report/service/impl/CustomerReportGroupServiceImpl.java
浏览文件 @
751376de
...
@@ -36,7 +36,8 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
...
@@ -36,7 +36,8 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
@Override
@Override
public
List
<
CustomerReportGroupResDto
>
queryList
(
CustomerReportQueryListVo
vo
)
{
public
List
<
CustomerReportGroupResDto
>
queryList
(
CustomerReportQueryListVo
vo
)
{
CustomerGroupQueryWq
wq
=
new
CustomerGroupQueryWq
();
CustomerGroupQueryWq
wq
=
new
CustomerGroupQueryWq
();
wq
.
setCategoryName
(
vo
.
getCategoryName
());
// wq.setCategoryName(vo.getCategoryName());
wq
.
setCreateUserId
(
SecurityUtils
.
getLoginUser
().
getUserid
());
// 先查询分组
// 先查询分组
List
<
CustomerGroupDto
>
groupDtos
=
customerGroupDao
.
queryList
(
wq
);
List
<
CustomerGroupDto
>
groupDtos
=
customerGroupDao
.
queryList
(
wq
);
List
<
CustomerReportGroupQueryListDto
>
list
=
customerReportGroupDao
.
queryList
();
List
<
CustomerReportGroupQueryListDto
>
list
=
customerReportGroupDao
.
queryList
();
...
@@ -63,8 +64,6 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
...
@@ -63,8 +64,6 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
resDto
.
setItems
(
itemsDtos
);
resDto
.
setItems
(
itemsDtos
);
result
.
add
(
resDto
);
result
.
add
(
resDto
);
}
}
return
result
;
return
result
;
}
}
...
@@ -77,7 +76,6 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
...
@@ -77,7 +76,6 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
@Override
@Override
public
void
save
(
List
<
CustomerReportGroupVo
>
customerReportGroupVo
)
{
public
void
save
(
List
<
CustomerReportGroupVo
>
customerReportGroupVo
)
{
// 新增或者修改 先删除后新增
// 新增或者修改 先删除后新增
Long
userId
=
SecurityUtils
.
getLoginUser
().
getUserid
();
Long
userId
=
SecurityUtils
.
getLoginUser
().
getUserid
();
customerReportGroupDao
.
deleteByCreatorId
(
userId
);
customerReportGroupDao
.
deleteByCreatorId
(
userId
);
...
@@ -92,7 +90,10 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
...
@@ -92,7 +90,10 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
dto
.
setGroupId
(
vo
.
getGroupId
());
dto
.
setGroupId
(
vo
.
getGroupId
());
dto
.
setReportId
(
item
.
getReportId
());
dto
.
setReportId
(
item
.
getReportId
());
dto
.
setReportType
(
item
.
getReportType
());
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
));
dto
.
setTenantId
(
String
.
valueOf
(
userId
));
items
.
add
(
dto
);
items
.
add
(
dto
);
}
}
...
...
src/main/java/com/link/report/service/impl/CustomerReportServiceImpl.java
浏览文件 @
751376de
...
@@ -5,6 +5,7 @@ import com.link.report.domain.dao.CustomerReportDao;
...
@@ -5,6 +5,7 @@ import com.link.report.domain.dao.CustomerReportDao;
import
com.link.report.domain.wq.CustomerReportAddWq
;
import
com.link.report.domain.wq.CustomerReportAddWq
;
import
com.link.report.domain.wq.CustomerReportQueryWq
;
import
com.link.report.domain.wq.CustomerReportQueryWq
;
import
com.link.report.pojo.request.CustomerReportAddVo
;
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.pojo.response.CustomerReportListDto
;
import
com.link.report.service.CustomerReportService
;
import
com.link.report.service.CustomerReportService
;
import
com.sfa.common.core.utils.bean.BeanUtils
;
import
com.sfa.common.core.utils.bean.BeanUtils
;
...
@@ -34,8 +35,9 @@ public class CustomerReportServiceImpl implements CustomerReportService {
...
@@ -34,8 +35,9 @@ public class CustomerReportServiceImpl implements CustomerReportService {
}
}
@Override
@Override
public
List
<
CustomerReportListDto
>
queryCustomerReportList
(
)
{
public
List
<
CustomerReportListDto
>
queryCustomerReportList
(
ReportShareListVo
reportShareListVo
)
{
CustomerReportQueryWq
wq
=
new
CustomerReportQueryWq
();
CustomerReportQueryWq
wq
=
new
CustomerReportQueryWq
();
wq
.
setCategoryName
(
reportShareListVo
.
getCategoryName
());
List
<
CustomerReportListDto
>
list
=
customerReportDao
.
queryCustomerReportList
(
wq
);
List
<
CustomerReportListDto
>
list
=
customerReportDao
.
queryCustomerReportList
(
wq
);
return
list
;
return
list
;
}
}
...
...
src/main/java/com/link/report/service/impl/JimuReportTokenServiceImpl.java
浏览文件 @
751376de
...
@@ -66,8 +66,8 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
...
@@ -66,8 +66,8 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
s
);
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
s
);
Set
<
String
>
roles
=
loginUser
.
getRoles
();
Set
<
String
>
roles
=
loginUser
.
getRoles
();
// it可以设计任何报表
// it可以设计任何报表
if
(!
ObjectUtil
.
isAllNotEmpty
(
loginUser
.
getSysUser
(),
loginUser
.
getSysUser
().
getDept
()
if
(!
ObjectUtil
.
isAllNotEmpty
(
loginUser
.
getSysUser
(),
loginUser
.
getSysUser
().
getDept
()
,
loginUser
.
getSysUser
().
getDept
().
getDeptName
())
&&
,
loginUser
.
getSysUser
().
getDept
().
getDeptName
())
&&
// 信息中心可以编辑所有报表
// 信息中心可以编辑所有报表
loginUser
.
getSysUser
().
getDept
().
getDeptName
().
contains
(
"信息技术中心"
))
{
loginUser
.
getSysUser
().
getDept
().
getDeptName
().
contains
(
"信息技术中心"
))
{
roles
.
add
(
"admin"
);
roles
.
add
(
"admin"
);
...
@@ -88,7 +88,6 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
...
@@ -88,7 +88,6 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
}
}
/**
/**
* 自定义请求头
* 自定义请求头
*/
*/
...
@@ -117,13 +116,6 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
...
@@ -117,13 +116,6 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
//都不具备则不能访问
//都不具备则不能访问
return
"NO"
;
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
();
Long
deptId
=
loginUser
.
getSysUser
().
getDept
().
getDeptId
();
return
String
.
valueOf
(
deptId
);
return
String
.
valueOf
(
deptId
);
}
}
...
@@ -154,12 +146,12 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
...
@@ -154,12 +146,12 @@ public class JimuReportTokenServiceImpl implements JmReportTokenServiceI {
return
new
String
[
0
];
return
new
String
[
0
];
}
}
Set
<
String
>
permissions
=
loginUser
.
getPermissions
();
Set
<
String
>
permissions
=
loginUser
.
getPermissions
();
if
(
ObjectUtil
.
isNotEmpty
(
permissions
))
{
if
(
ObjectUtil
.
isNotEmpty
(
permissions
))
{
permissions
.
add
(
"drag:datasource:testConnection"
);
permissions
.
add
(
"drag:datasource:testConnection"
);
permissions
.
add
(
"onl:drag:clear:recoverry"
);
permissions
.
add
(
"onl:drag:clear:recoverry"
);
permissions
.
add
(
"drag:analysis:sql"
);
permissions
.
add
(
"drag:analysis:sql"
);
permissions
.
add
(
"drag:design:getTotalData"
);
permissions
.
add
(
"drag:design:getTotalData"
);
return
permissions
.
toArray
(
new
String
[
0
]);
return
permissions
.
toArray
(
new
String
[
0
]);
}
}
return
new
String
[
0
];
return
new
String
[
0
];
...
...
src/main/resources/bootstrap.yml
浏览文件 @
751376de
spring
:
spring
:
profiles
:
profiles
:
active
:
dev
active
:
dev
src/main/resources/mapper/report/CustomerReportGroupMapper.xml
浏览文件 @
751376de
...
@@ -10,8 +10,10 @@
...
@@ -10,8 +10,10 @@
report_type,
report_type,
group_id,
group_id,
create_by,
create_by,
create_user_id,
create_time,
create_time,
update_by,
update_by,
update_user_id,
update_time,
update_time,
del_flag,
del_flag,
tenant_id,
tenant_id,
...
@@ -24,8 +26,10 @@
...
@@ -24,8 +26,10 @@
#{item.reportType},
#{item.reportType},
#{item.groupId},
#{item.groupId},
#{item.createBy},
#{item.createBy},
#{item.createUserId},
#{item.createTime},
#{item.createTime},
#{item.updateBy},
#{item.updateBy},
#{item.updateUserId},
#{item.updateTime},
#{item.updateTime},
#{item.delFlag},
#{item.delFlag},
#{item.tenantId},
#{item.tenantId},
...
@@ -51,8 +55,9 @@
...
@@ -51,8 +55,9 @@
join customer_report cr on crg.report_id = cr.id and crg.report_type = cr.report_type
join customer_report cr on crg.report_id = cr.id and crg.report_type = cr.report_type
<where>
<where>
cg.del_flag = 0
<if
test=
"userId != null and userId != ''"
>
<if
test=
"userId != null and userId != ''"
>
AND c
rg.create_by
= #{userId}
AND c
g.create_user_id
= #{userId}
</if>
</if>
</where>
</where>
<!-- 积木报表关联 -->
<!-- 积木报表关联 -->
...
@@ -73,7 +78,7 @@
...
@@ -73,7 +78,7 @@
join jimu_report_share jrs on jr.id = jrs.report_id
join jimu_report_share jrs on jr.id = jrs.report_id
<where>
<where>
<if
test=
"userId!= null and userId!= ''"
>
<if
test=
"userId!= null and userId!= ''"
>
AND crg.create_
by
= #{userId}
AND crg.create_
user_id
= #{userId}
</if>
</if>
</where>
</where>
) tmp
) tmp
...
...
src/main/resources/mapper/report/ReportShareBiMapper.xml
浏览文件 @
751376de
...
@@ -19,12 +19,6 @@
...
@@ -19,12 +19,6 @@
<select
id=
"selectShareList"
resultType=
"com.link.report.pojo.response.ReportShareBiListDto"
>
<select
id=
"selectShareList"
resultType=
"com.link.report.pojo.response.ReportShareBiListDto"
>
select jrs.id,jrs.report_id as reportId ,
select jrs.id,jrs.report_id as reportId ,
jrs.preview_url as previewUrl,
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,
jr.name as reportName,
1 as reportType
1 as reportType
from jimu_report_share jrs
from jimu_report_share jrs
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论