Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-data-cloud
Overview
Overview
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
base_platform_enterprise
gic-data-cloud
Commits
67b25290
Commit
67b25290
authored
Jul 10, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改模块
parent
4242e9b8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
33 deletions
+77
-33
IndexTypeEnum.java
.../src/main/java/com/gic/cloud/constants/IndexTypeEnum.java
+37
-0
DataExplainDTO.java
...d-api/src/main/java/com/gic/cloud/dto/DataExplainDTO.java
+3
-3
IndexController.java
...m/gic/cloud/operation/web/controller/IndexController.java
+2
-0
TabDataExplain.java
...ce/src/main/java/com/gic/cloud/entity/TabDataExplain.java
+4
-3
IndexModuleRelServiceImpl.java
...com/gic/cloud/service/impl/IndexModuleRelServiceImpl.java
+16
-13
IndexServiceImpl.java
...ain/java/com/gic/cloud/service/impl/IndexServiceImpl.java
+4
-0
TabDataExplainMapper.xml
...ervice/src/main/resources/mapper/TabDataExplainMapper.xml
+9
-12
TabIndexModuleRelMapper.xml
...ice/src/main/resources/mapper/TabIndexModuleRelMapper.xml
+2
-2
No files found.
gic-data-cloud-api/src/main/java/com/gic/cloud/constants/IndexTypeEnum.java
0 → 100644
View file @
67b25290
package
com
.
gic
.
cloud
.
constants
;
/**
* @author zhiwj
* @Description:
* @date 2020-07-10 17:02
*/
public
enum
IndexTypeEnum
{
INDEX
(
1
,
"指标"
),
DIMENSION
(
2
,
"维度"
),
NOTE
(
3
,
"说明"
);
private
Integer
code
;
private
String
msg
;
IndexTypeEnum
(
Integer
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
static
String
parse
(
Integer
code
)
{
for
(
IndexTypeEnum
value
:
values
())
{
if
(
value
.
code
.
equals
(
code
))
{
return
value
.
msg
;
}
}
return
null
;
}
}
gic-data-cloud-api/src/main/java/com/gic/cloud/dto/DataExplainDTO.java
View file @
67b25290
...
...
@@ -54,7 +54,7 @@ public class DataExplainDTO implements Serializable {
/**
* 模块id
*/
private
Integer
moduleId
;
private
String
moduleId
;
private
Integer
optUserId
;
private
String
optUserName
;
...
...
@@ -122,11 +122,11 @@ public class DataExplainDTO implements Serializable {
this
.
status
=
status
;
}
public
Integer
getModuleId
()
{
public
String
getModuleId
()
{
return
moduleId
;
}
public
void
setModuleId
(
Integer
moduleId
)
{
public
void
setModuleId
(
String
moduleId
)
{
this
.
moduleId
=
moduleId
;
}
...
...
gic-data-cloud-operation-web/src/main/java/com/gic/cloud/operation/web/controller/IndexController.java
View file @
67b25290
...
...
@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.authcenter.security.core.dto.UserDetailsVO
;
import
com.gic.authcenter.security.core.util.UserUtils
;
import
com.gic.cloud.constants.IndexTypeEnum
;
import
com.gic.cloud.dto.IndexDTO
;
import
com.gic.cloud.dto.IndexLogDTO
;
import
com.gic.cloud.qo.IndexQO
;
...
...
@@ -43,6 +44,7 @@ public class IndexController {
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
ErrorCode
.
PARAMETER_ERROR
.
getMsg
());
}
UserDetailsVO
user
=
UserUtils
.
getUser
();
indexDTO
.
setClassifyName
(
IndexTypeEnum
.
parse
(
indexDTO
.
getClassifyType
()));
indexDTO
.
setOptUserId
(
user
.
getId
());
indexDTO
.
setOptUserName
(
user
.
getRealName
());
if
(
StringUtils
.
isNotBlank
(
relModuleIds
))
{
...
...
gic-data-cloud-service/src/main/java/com/gic/cloud/entity/TabDataExplain.java
View file @
67b25290
...
...
@@ -49,7 +49,7 @@ public class TabDataExplain {
/**
* 模块id
*/
private
Integer
moduleId
;
private
String
moduleId
;
public
Integer
getDataExplainId
()
{
return
dataExplainId
;
...
...
@@ -115,11 +115,11 @@ public class TabDataExplain {
this
.
status
=
status
;
}
public
Integer
getModuleId
()
{
public
String
getModuleId
()
{
return
moduleId
;
}
public
void
setModuleId
(
Integer
moduleId
)
{
public
void
setModuleId
(
String
moduleId
)
{
this
.
moduleId
=
moduleId
;
}
}
\ No newline at end of file
gic-data-cloud-service/src/main/java/com/gic/cloud/service/impl/IndexModuleRelServiceImpl.java
View file @
67b25290
...
...
@@ -3,6 +3,7 @@ package com.gic.cloud.service.impl;
import
com.gic.cloud.dao.mapper.TabIndexModuleRelMapper
;
import
com.gic.cloud.entity.TabIndexModuleRel
;
import
com.gic.cloud.service.IndexModuleRelService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -23,20 +24,22 @@ public class IndexModuleRelServiceImpl implements IndexModuleRelService {
@Override
public
void
save
(
Integer
businessId
,
List
<
String
>
moduleIdList
,
Integer
type
)
{
// 把所有关联status设置为0
tabIndexModuleRelMapper
.
delByBusinessId
(
businessId
,
type
);
// 插入不存在的关联
for
(
String
moduleId
:
moduleIdList
)
{
TabIndexModuleRel
rel
=
new
TabIndexModuleRel
();
rel
.
setType
(
type
);
rel
.
setBusinessId
(
businessId
);
rel
.
setModuleId
(
moduleId
);
rel
.
setCreateTime
(
new
Date
());
rel
.
setStatus
(
1
);
tabIndexModuleRelMapper
.
insertSelectiveByNotExist
(
rel
);
if
(
CollectionUtils
.
isNotEmpty
(
moduleIdList
))
{
// 把所有关联status设置为0
tabIndexModuleRelMapper
.
delByBusinessId
(
businessId
,
type
);
// 插入不存在的关联
for
(
String
moduleId
:
moduleIdList
)
{
TabIndexModuleRel
rel
=
new
TabIndexModuleRel
();
rel
.
setType
(
type
);
rel
.
setBusinessId
(
businessId
);
rel
.
setModuleId
(
moduleId
);
rel
.
setCreateTime
(
new
Date
());
rel
.
setStatus
(
1
);
tabIndexModuleRelMapper
.
insertSelectiveByNotExist
(
rel
);
}
// 把所有userId关联status都设置为1
tabIndexModuleRelMapper
.
updateStatusByBusinessIds
(
businessId
,
moduleIdList
,
type
);
}
// 把所有userId关联status都设置为1
tabIndexModuleRelMapper
.
updateStatusByBusinessIds
(
businessId
,
moduleIdList
,
type
);
}
@Override
...
...
gic-data-cloud-service/src/main/java/com/gic/cloud/service/impl/IndexServiceImpl.java
View file @
67b25290
...
...
@@ -11,6 +11,7 @@ import com.github.pagehelper.PageHelper;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -43,6 +44,9 @@ public class IndexServiceImpl implements IndexService {
@Override
public
Integer
save
(
IndexDTO
indexDTO
)
{
TabIndex
tabIndex
=
EntityUtil
.
changeEntityByJSON
(
TabIndex
.
class
,
indexDTO
);
tabIndex
.
setStatus
(
1
);
tabIndex
.
setCreateTime
(
new
Date
());
tabIndex
.
setUpdateTime
(
new
Date
());
tabIndexMapper
.
insertSelective
(
tabIndex
);
return
tabIndex
.
getIndexId
();
}
...
...
gic-data-cloud-service/src/main/resources/mapper/TabDataExplainMapper.xml
View file @
67b25290
...
...
@@ -10,7 +10,7 @@
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"module_id"
jdbcType=
"
INTEGE
R"
property=
"moduleId"
/>
<result
column=
"module_id"
jdbcType=
"
VARCHA
R"
property=
"moduleId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
data_explain_id, data_name, data_classify, index_remark, complement, create_time,
...
...
@@ -33,7 +33,7 @@
)
values (#{dataExplainId,jdbcType=INTEGER}, #{dataName,jdbcType=VARCHAR}, #{dataClassify,jdbcType=VARCHAR},
#{indexRemark,jdbcType=VARCHAR}, #{complement,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{moduleId,jdbcType=
INTEGE
R}
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{moduleId,jdbcType=
VARCHA
R}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.cloud.entity.TabDataExplain"
>
...
...
@@ -96,7 +96,7 @@
#{status,jdbcType=INTEGER},
</if>
<if
test=
"moduleId != null"
>
#{moduleId,jdbcType=
INTEGE
R},
#{moduleId,jdbcType=
VARCHA
R},
</if>
</trim>
</insert>
...
...
@@ -125,7 +125,7 @@
status = #{status,jdbcType=INTEGER},
</if>
<if
test=
"moduleId != null"
>
module_id = #{moduleId,jdbcType=
INTEGE
R},
module_id = #{moduleId,jdbcType=
VARCHA
R},
</if>
</set>
where data_explain_id = #{dataExplainId,jdbcType=INTEGER}
...
...
@@ -139,7 +139,7 @@
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER},
module_id = #{moduleId,jdbcType=
INTEGE
R}
module_id = #{moduleId,jdbcType=
VARCHA
R}
where data_explain_id = #{dataExplainId,jdbcType=INTEGER}
</update>
<!-- getBySelective-->
...
...
@@ -147,14 +147,11 @@
select
<include
refid=
"Base_Column_List"
/>
from tab_data_explain where status = 1
<if
test=
"data
_n
ame != null "
>
and data_name = #{data
_n
ame}
<if
test=
"data
N
ame != null "
>
and data_name = #{data
N
ame}
</if>
<if
test=
"null != ids and ids.size > 0"
>
and data_explain_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
<if
test=
"dataExplainId != null "
>
and data_explain_id
<>
#{dataExplainId}
</if>
</select>
<select
id=
"listDataExplain"
resultMap=
"BaseResultMap"
>
...
...
gic-data-cloud-service/src/main/resources/mapper/TabIndexModuleRelMapper.xml
View file @
67b25290
...
...
@@ -127,7 +127,7 @@
status
) SELECT
#{type},
#{busi
s
essId},
#{busi
n
essId},
#{moduleId},
#{createTime},
#{updateTime},
...
...
@@ -150,7 +150,7 @@
<update
id=
"updateStatusByBusinessIds"
>
update tab_index_module_rel set status = 1 where business_id = #{businessId} and `type` = #{type}
<if
test=
"null != ids and ids.size > 0"
>
and
business
_id in
and
module
_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
...
...
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