Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-bi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林锐标
slm-bi
Commits
4ecf468b
Commit
4ecf468b
authored
May 28, 2021
by
梁光意
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
7b93fc88
57b7b747
Pipeline
#9341
passed with stages
in 1 minute 9 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
5 deletions
+78
-5
InstrumentPanelGroupController.java
.../slm/slmbi/controller/InstrumentPanelGroupController.java
+1
-1
TenantController.java
...n/java/com/syc/slm/slmbi/controller/TenantController.java
+63
-0
InstrumentPanelGroupService.java
...om/syc/slm/slmbi/service/InstrumentPanelGroupService.java
+1
-1
InstrumentPanelGroupServiceImpl.java
...m/slmbi/service/impl/InstrumentPanelGroupServiceImpl.java
+5
-3
BusinessConfigMapper.xml
...rces/mapper/mysql/businessconfig/BusinessConfigMapper.xml
+8
-0
No files found.
src/main/java/com/syc/slm/slmbi/controller/InstrumentPanelGroupController.java
View file @
4ecf468b
...
...
@@ -58,7 +58,7 @@ public class InstrumentPanelGroupController extends BaseRestController{
@ApiOperation
(
"删除仪表板分组"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
String
>
delGroup
(
@PathVariable
String
appId
,
@PathVariable
String
groupId
)
{
return
call
(()->
instrumentPanelGroupService
.
delGroup
(
groupId
));
return
call
(()->
instrumentPanelGroupService
.
delGroup
(
groupId
,
false
));
}
}
src/main/java/com/syc/slm/slmbi/controller/TenantController.java
0 → 100644
View file @
4ecf468b
package
com
.
syc
.
slm
.
slmbi
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.syc.slm.common.core.constant.SlmConstants
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.slmbi.dto.InstrumentPanelGroupDTO
;
import
com.syc.slm.slmbi.entity.BaseEntity
;
import
com.syc.slm.slmbi.entity.CurrentUser
;
import
com.syc.slm.slmbi.entity.InstrumentPanelGroup
;
import
com.syc.slm.slmbi.service.InstrumentPanelGroupService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
/**
* slm-bi
* 提供给dc调用
* @author : lin
* @date : 2021-05-28 14:22
**/
@RestController
@RequestMapping
(
"/{appId}/tenant"
)
@Api
(
value
=
"租户"
,
tags
=
"租户"
)
public
class
TenantController
extends
BaseRestController
{
@Autowired
private
InstrumentPanelGroupService
groupService
;
@PostMapping
@ApiOperation
(
"新增租户初始化分组"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
String
>
initGroup
(
@PathVariable
String
appId
)
{
return
call
(()
->
{
InstrumentPanelGroupDTO
groupDTO
=
new
InstrumentPanelGroupDTO
();
groupDTO
.
setParentId
(
null
);
groupDTO
.
setName
(
"全部分组"
);
return
groupService
.
saveGroup
(
groupDTO
,
appId
);
});
}
@DeleteMapping
@ApiOperation
(
"删除租户初始化分组数据"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
String
>
delGroup
(
HttpServletRequest
request
,
@PathVariable
String
appId
)
{
return
call
(()
->
{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
LambdaQueryWrapper
<
InstrumentPanelGroup
>
where
=
new
LambdaQueryWrapper
<>();
where
.
eq
(
BaseEntity:
:
getAppId
,
currentUser
.
getAppId
());
where
.
eq
(
InstrumentPanelGroup:
:
getName
,
"全部分组"
);
where
.
eq
(
BaseEntity:
:
getRecordStatus
,
SlmConstants
.
DATA_VALID
);
InstrumentPanelGroup
one
=
groupService
.
getOne
(
where
);
if
(
ObjectUtils
.
isNotEmpty
(
one
))
{
return
groupService
.
delGroup
(
one
.
getId
(),
true
);
}
else
{
return
null
;
}
});
}
}
src/main/java/com/syc/slm/slmbi/service/InstrumentPanelGroupService.java
View file @
4ecf468b
...
...
@@ -33,7 +33,7 @@ public interface InstrumentPanelGroupService extends IService<InstrumentPanelGro
* @param groupId
* @return
*/
String
delGroup
(
@NonNull
String
groupId
);
String
delGroup
(
@NonNull
String
groupId
,
boolean
isDelTenant
);
/**
* 修改仪表板分组
...
...
src/main/java/com/syc/slm/slmbi/service/impl/InstrumentPanelGroupServiceImpl.java
View file @
4ecf468b
...
...
@@ -84,13 +84,15 @@ public class InstrumentPanelGroupServiceImpl extends ServiceImpl<InstrumentPanel
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
delGroup
(
@NonNull
String
groupId
)
{
public
String
delGroup
(
@NonNull
String
groupId
,
boolean
isDelTenant
)
{
InstrumentPanelGroup
group
=
baseMapper
.
selectById
(
groupId
);
if
(
group
.
getRecordStatus
().
equals
(
SlmConstants
.
DATA_DELETED
))
{
throw
new
SysException
(
"该分组已经被删除,请重新刷新页面进行操作!"
);
}
if
(
StringUtils
.
isEmpty
(
group
.
getParentId
())){
throw
new
SysException
(
"顶级分组不可删除"
);
if
(!
isDelTenant
)
{
if
(
StringUtils
.
isEmpty
(
group
.
getParentId
()))
{
throw
new
SysException
(
"顶级分组不可删除"
);
}
}
group
.
setRecordStatus
(
SlmConstants
.
DATA_DELETED
);
baseMapper
.
updateById
(
group
);
...
...
src/main/resources/mapper/mysql/businessconfig/BusinessConfigMapper.xml
0 → 100644
View file @
4ecf468b
<?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.syc.slm.slmbi.dao.BusinessConfigMapper"
>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment