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
c04e306b
Commit
c04e306b
authored
Apr 26, 2021
by
linruibiao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
9f89f026
c5425d26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
48 additions
and
50 deletions
+48
-50
SlmConstants.java
...n/java/com/syc/slm/common/core/constant/SlmConstants.java
+5
-0
R.java
src/main/java/com/syc/slm/common/core/util/R.java
+0
-2
RestTemplateUtils.java
.../java/com/syc/slm/common/core/util/RestTemplateUtils.java
+0
-0
SysMetaObjectHandler.java
...n/java/com/syc/slm/slmbi/config/SysMetaObjectHandler.java
+2
-4
BaseRestController.java
...java/com/syc/slm/slmbi/controller/BaseRestController.java
+6
-10
InstrumentPanelConfigController.java
...slm/slmbi/controller/InstrumentPanelConfigController.java
+1
-1
SysExceptionHandler.java
...n/java/com/syc/slm/slmbi/handler/SysExceptionHandler.java
+13
-0
DeptServiceImpl.java
.../java/com/syc/slm/slmbi/service/impl/DeptServiceImpl.java
+2
-3
InstrumentPanelGroupServiceImpl.java
...m/slmbi/service/impl/InstrumentPanelGroupServiceImpl.java
+4
-0
InstrumentPanelTreeServiceImpl.java
...lm/slmbi/service/impl/InstrumentPanelTreeServiceImpl.java
+1
-3
PositionServiceImpl.java
...a/com/syc/slm/slmbi/service/impl/PositionServiceImpl.java
+1
-3
UserServiceImpl.java
.../java/com/syc/slm/slmbi/service/impl/UserServiceImpl.java
+1
-3
VariableServiceImpl.java
...a/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
+6
-15
application.yml
src/main/resources/application.yml
+1
-1
InstrumentPanelGroupMapper.xml
...sources/mapper/mysql/panel/InstrumentPanelGroupMapper.xml
+2
-2
InstrumentPanelMapper.xml
...in/resources/mapper/mysql/panel/InstrumentPanelMapper.xml
+2
-2
InstrumentPanelTreeMapper.xml
...esources/mapper/mysql/panel/InstrumentPanelTreeMapper.xml
+1
-1
No files found.
src/main/java/com/syc/slm/common/core/constant/SlmConstants.java
View file @
c04e306b
...
@@ -30,4 +30,9 @@ public final class SlmConstants {
...
@@ -30,4 +30,9 @@ public final class SlmConstants {
*/
*/
public
static
final
Integer
DATA_DELETED
=
-
1
;
public
static
final
Integer
DATA_DELETED
=
-
1
;
/**
* 请求头token的key名称
*/
public
static
final
String
TOKEN_PREFIX
=
"X-Token"
;
}
}
src/main/java/com/syc/slm/common/core/util/R.java
View file @
c04e306b
...
@@ -20,14 +20,12 @@
...
@@ -20,14 +20,12 @@
package
com
.
syc
.
slm
.
common
.
core
.
util
;
package
com
.
syc
.
slm
.
common
.
core
.
util
;
import
com.syc.slm.common.core.constant.CommonConstants
;
import
com.syc.slm.common.core.constant.CommonConstants
;
import
com.syc.slm.common.core.constant.SlmConstants
;
import
com.syc.slm.slmbi.exception.SysException
;
import
com.syc.slm.slmbi.exception.SysException
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
javax.sound.midi.SysexMessage
;
import
java.io.Serializable
;
import
java.io.Serializable
;
/**
/**
...
...
src/main/java/com/syc/slm/common/core/util/RestTemplateUtils.java
View file @
c04e306b
This diff is collapsed.
Click to expand it.
src/main/java/com/syc/slm/slmbi/config/SysMetaObjectHandler.java
View file @
c04e306b
...
@@ -14,8 +14,6 @@ import org.apache.ibatis.reflection.MetaObject;
...
@@ -14,8 +14,6 @@ import org.apache.ibatis.reflection.MetaObject;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.nio.channels.SelectableChannel
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.function.Supplier
;
import
java.util.function.Supplier
;
...
@@ -44,11 +42,11 @@ public class SysMetaObjectHandler implements MetaObjectHandler {
...
@@ -44,11 +42,11 @@ public class SysMetaObjectHandler implements MetaObjectHandler {
if
(
CollectionUtils
.
isEmpty
(
headerMap
)){
if
(
CollectionUtils
.
isEmpty
(
headerMap
)){
throw
new
SysException
(
"头部不能为空"
);
throw
new
SysException
(
"头部不能为空"
);
}
}
String
token
=
request
.
getHeader
(
"X-Token"
);
String
token
=
request
.
getHeader
(
SlmConstants
.
TOKEN_PREFIX
);
if
(
StringUtils
.
isBlank
(
token
)){
if
(
StringUtils
.
isBlank
(
token
)){
throw
new
SysException
(
"token不能为空"
);
throw
new
SysException
(
"token不能为空"
);
}
}
Object
currentUser
=
request
.
get
Session
().
get
Attribute
(
token
);
Object
currentUser
=
request
.
getAttribute
(
token
);
CurrentUser
user
=
null
;
CurrentUser
user
=
null
;
if
(
ObjectUtils
.
isNotEmpty
(
currentUser
)){
if
(
ObjectUtils
.
isNotEmpty
(
currentUser
)){
user
=
SlmConstants
.
gson
.
fromJson
(
currentUser
.
toString
(),
CurrentUser
.
class
);
user
=
SlmConstants
.
gson
.
fromJson
(
currentUser
.
toString
(),
CurrentUser
.
class
);
...
...
src/main/java/com/syc/slm/slmbi/controller/BaseRestController.java
View file @
c04e306b
...
@@ -31,7 +31,6 @@ import java.util.function.Supplier;
...
@@ -31,7 +31,6 @@ import java.util.function.Supplier;
* @date : 2021-04-06 09:09
* @date : 2021-04-06 09:09
**/
**/
@Slf4j
@Slf4j
public
class
BaseRestController
{
public
class
BaseRestController
{
@Value
(
"${dc_client.host}"
)
@Value
(
"${dc_client.host}"
)
...
@@ -80,7 +79,7 @@ public class BaseRestController {
...
@@ -80,7 +79,7 @@ public class BaseRestController {
}
}
}
}
log
.
info
(
"请求头参数--->>>>"
+
SlmConstants
.
gson
.
toJson
(
headers
));
log
.
info
(
"请求头参数--->>>>"
+
SlmConstants
.
gson
.
toJson
(
headers
));
String
token
=
request
.
getHeader
(
"X-Token"
);
String
token
=
request
.
getHeader
(
SlmConstants
.
TOKEN_PREFIX
);
if
(!
uri
.
contains
(
"tokens"
))
{
if
(!
uri
.
contains
(
"tokens"
))
{
if
(
StringUtils
.
isEmpty
(
token
))
{
if
(
StringUtils
.
isEmpty
(
token
))
{
throw
new
SysException
(
"token不能为空"
);
throw
new
SysException
(
"token不能为空"
);
...
@@ -88,15 +87,12 @@ public class BaseRestController {
...
@@ -88,15 +87,12 @@ public class BaseRestController {
log
.
info
(
"获取用户信息"
);
log
.
info
(
"获取用户信息"
);
NativeWebRequest
webRequest
=
new
ServletWebRequest
(
request
);
NativeWebRequest
webRequest
=
new
ServletWebRequest
(
request
);
Map
<
String
,
String
>
map
=
(
Map
<
String
,
String
>)
webRequest
.
getAttribute
(
HandlerMapping
.
URI_TEMPLATE_VARIABLES_ATTRIBUTE
,
RequestAttributes
.
SCOPE_REQUEST
);
Map
<
String
,
String
>
map
=
(
Map
<
String
,
String
>)
webRequest
.
getAttribute
(
HandlerMapping
.
URI_TEMPLATE_VARIABLES_ATTRIBUTE
,
RequestAttributes
.
SCOPE_REQUEST
);
// Map<String, Object> map = (Map<String, Object>) webRequest.getAttribute(View.PATH_VARIABLES, RequestAttributes.SCOPE_REQUEST);
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
token
);
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
map
.
get
(
"appId"
)+
""
);
uriVariables
.
put
(
"appId"
,
map
.
get
(
"appId"
)+
""
);
String
getUrl
=
dcClientHost
+
"/{appId}/users/user-info"
;
String
getUrl
=
dcClientHost
+
"/{appId}/users/user-info"
;
R
<
CurrentUser
>
result
=
RestTemplateUtils
.
get
(
getUrl
,
heads
,
new
TypeToken
<
R
<
CurrentUser
>>()
{
R
<
CurrentUser
>
result
=
RestTemplateUtils
.
get
(
getUrl
,
new
TypeToken
<
R
<
CurrentUser
>>()
{
}.
getType
(),
uriVariables
);
}.
getType
(),
uriVariables
);
request
.
getSession
().
setAttribute
(
token
,
SlmConstants
.
gson
.
toJson
(
result
.
detach
()));
request
.
setAttribute
(
token
,
SlmConstants
.
gson
.
toJson
(
result
.
detach
()));
}
}
...
@@ -109,8 +105,8 @@ public class BaseRestController {
...
@@ -109,8 +105,8 @@ public class BaseRestController {
return
NetResponseUtils
.
call
(
supplier
);
return
NetResponseUtils
.
call
(
supplier
);
}
}
CurrentUser
getCurrentUser
(
HttpServletRequest
request
){
protected
CurrentUser
getCurrentUser
(
HttpServletRequest
request
){
String
token
=
request
.
getHeader
(
"X-Token"
);
String
token
=
request
.
getHeader
(
SlmConstants
.
TOKEN_PREFIX
);
return
SlmConstants
.
gson
.
fromJson
(
request
.
get
Session
().
get
Attribute
(
token
).
toString
(),
CurrentUser
.
class
);
return
SlmConstants
.
gson
.
fromJson
(
request
.
getAttribute
(
token
).
toString
(),
CurrentUser
.
class
);
}
}
}
}
src/main/java/com/syc/slm/slmbi/controller/InstrumentPanelConfigController.java
View file @
c04e306b
...
@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping
(
"/{appId}/panel-configs"
)
@RequestMapping
(
"/{appId}/panel-configs"
)
@RestController
@RestController
@Api
(
value
=
"仪表板样式以及数据配置"
,
tags
=
"仪表板样式以及数据配置"
)
@Api
(
value
=
"仪表板样式以及数据配置"
,
tags
=
"仪表板样式以及数据配置"
)
public
class
InstrumentPanelConfigController
{
public
class
InstrumentPanelConfigController
extends
BaseRestController
{
@Autowired
@Autowired
private
InstrumentPanelConfigService
instrumentPanelConfigService
;
private
InstrumentPanelConfigService
instrumentPanelConfigService
;
...
...
src/main/java/com/syc/slm/slmbi/handler/SysExceptionHandler.java
View file @
c04e306b
...
@@ -3,6 +3,7 @@ package com.syc.slm.slmbi.handler;
...
@@ -3,6 +3,7 @@ package com.syc.slm.slmbi.handler;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.slmbi.exception.SysException
;
import
com.syc.slm.slmbi.exception.SysException
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.mybatis.spring.MyBatisSystemException
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
...
@@ -32,4 +33,16 @@ public class SysExceptionHandler {
...
@@ -32,4 +33,16 @@ public class SysExceptionHandler {
return
R
.
bad
(
e
.
getMsg
(),
e
.
getDebugMsg
());
return
R
.
bad
(
e
.
getMsg
(),
e
.
getDebugMsg
());
}
}
/**
* mybaits抛出的异常,以及SysMetaObjectHandler自定义抛出的异常
* @param e
* @return
*/
@ExceptionHandler
(
MyBatisSystemException
.
class
)
@ResponseBody
public
R
<
Object
>
handleMyBatisSystemException
(
MyBatisSystemException
e
)
{
log
.
info
(
e
.
getMessage
());
return
R
.
bad
(
e
.
getCause
().
getCause
().
getMessage
(),
e
.
getMessage
());
}
}
}
src/main/java/com/syc/slm/slmbi/service/impl/DeptServiceImpl.java
View file @
c04e306b
...
@@ -2,6 +2,7 @@ package com.syc.slm.slmbi.service.impl;
...
@@ -2,6 +2,7 @@ package com.syc.slm.slmbi.service.impl;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.reflect.TypeToken
;
import
com.google.gson.reflect.TypeToken
;
import
com.syc.slm.common.core.constant.SlmConstants
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.R
;
import
com.syc.slm.common.core.util.RestTemplateUtils
;
import
com.syc.slm.common.core.util.RestTemplateUtils
;
import
com.syc.slm.slmbi.service.DeptService
;
import
com.syc.slm.slmbi.service.DeptService
;
...
@@ -28,13 +29,11 @@ public class DeptServiceImpl implements DeptService {
...
@@ -28,13 +29,11 @@ public class DeptServiceImpl implements DeptService {
public
List
<
DeptVo
>
selectPositionList
(
String
uri
,
String
token
,
String
appId
,
String
deptName
)
{
public
List
<
DeptVo
>
selectPositionList
(
String
uri
,
String
token
,
String
appId
,
String
deptName
)
{
log
.
info
(
"部门查询uri:---------------->"
+
uri
);
log
.
info
(
"部门查询uri:---------------->"
+
uri
);
log
.
info
(
"部门查询token:---------------->"
+
token
);
log
.
info
(
"部门查询token:---------------->"
+
token
);
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
token
);
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"deptName"
,
deptName
);
uriVariables
.
put
(
"deptName"
,
deptName
);
uriVariables
.
put
(
"appId"
,
appId
);
uriVariables
.
put
(
"appId"
,
appId
);
R
<
List
<
DeptVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
heads
,
new
TypeToken
<
R
<
List
<
DeptVo
>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
DeptVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
DeptVo
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
}
}
src/main/java/com/syc/slm/slmbi/service/impl/InstrumentPanelGroupServiceImpl.java
View file @
c04e306b
...
@@ -3,6 +3,7 @@ package com.syc.slm.slmbi.service.impl;
...
@@ -3,6 +3,7 @@ package com.syc.slm.slmbi.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.syc.slm.common.core.constant.SlmConstants
;
import
com.syc.slm.common.core.constant.SlmConstants
;
...
@@ -165,6 +166,9 @@ public class InstrumentPanelGroupServiceImpl extends ServiceImpl<InstrumentPanel
...
@@ -165,6 +166,9 @@ public class InstrumentPanelGroupServiceImpl extends ServiceImpl<InstrumentPanel
tree
.
setId
(
entity
.
getId
());
tree
.
setId
(
entity
.
getId
());
if
(
StringUtils
.
isNotEmpty
(
group
.
getParentId
()))
{
if
(
StringUtils
.
isNotEmpty
(
group
.
getParentId
()))
{
InstrumentPanelTree
panelTree
=
treeService
.
getById
(
group
.
getParentId
());
InstrumentPanelTree
panelTree
=
treeService
.
getById
(
group
.
getParentId
());
if
(
ObjectUtils
.
isEmpty
(
panelTree
)){
throw
new
SysException
(
group
.
getParentId
()
+
",上级不存在"
);
}
if
(
SlmConstants
.
DATA_DELETED
.
equals
(
panelTree
.
getRecordStatus
()))
{
if
(
SlmConstants
.
DATA_DELETED
.
equals
(
panelTree
.
getRecordStatus
()))
{
throw
new
SysException
(
panelTree
.
getName
()
+
",已不存在,请刷新页面"
);
throw
new
SysException
(
panelTree
.
getName
()
+
",已不存在,请刷新页面"
);
}
}
...
...
src/main/java/com/syc/slm/slmbi/service/impl/InstrumentPanelTreeServiceImpl.java
View file @
c04e306b
...
@@ -415,11 +415,9 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
...
@@ -415,11 +415,9 @@ public class InstrumentPanelTreeServiceImpl extends ServiceImpl<InstrumentPanelT
private
R
<
Map
<
String
,
String
>>
setDeptAndRole
(
CurrentUser
user
,
String
uri
){
private
R
<
Map
<
String
,
String
>>
setDeptAndRole
(
CurrentUser
user
,
String
uri
){
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
user
.
getToken
());
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
return
RestTemplateUtils
.
get
(
uri
,
heads
,
new
TypeToken
<
R
<
Map
<
String
,
String
>>>()
{}.
getType
(),
uriVariables
);
return
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
String
>>>()
{}.
getType
(),
uriVariables
);
}
}
}
}
src/main/java/com/syc/slm/slmbi/service/impl/PositionServiceImpl.java
View file @
c04e306b
...
@@ -27,13 +27,11 @@ public class PositionServiceImpl implements PositionService {
...
@@ -27,13 +27,11 @@ public class PositionServiceImpl implements PositionService {
@Override
@Override
public
List
<
PositionVo
>
selectPositionList
(
String
uri
,
String
token
,
String
appId
,
String
name
)
{
public
List
<
PositionVo
>
selectPositionList
(
String
uri
,
String
token
,
String
appId
,
String
name
)
{
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
token
);
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"positionName"
,
name
);
uriVariables
.
put
(
"positionName"
,
name
);
uriVariables
.
put
(
"appId"
,
appId
);
uriVariables
.
put
(
"appId"
,
appId
);
R
<
List
<
PositionVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
heads
,
new
TypeToken
<
R
<
List
<
PositionVo
>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
PositionVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
PositionVo
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
}
}
src/main/java/com/syc/slm/slmbi/service/impl/UserServiceImpl.java
View file @
c04e306b
...
@@ -26,12 +26,10 @@ import java.util.Map;
...
@@ -26,12 +26,10 @@ import java.util.Map;
public
class
UserServiceImpl
implements
UserService
{
public
class
UserServiceImpl
implements
UserService
{
@Override
@Override
public
List
<
UserTreeVo
>
selectUserList
(
String
appId
,
String
uri
,
String
token
,
String
userName
)
{
public
List
<
UserTreeVo
>
selectUserList
(
String
appId
,
String
uri
,
String
token
,
String
userName
)
{
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
token
);
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"userName"
,
userName
);
uriVariables
.
put
(
"userName"
,
userName
);
uriVariables
.
put
(
"appId"
,
appId
);
uriVariables
.
put
(
"appId"
,
appId
);
R
<
List
<
UserTreeVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
heads
,
new
TypeToken
<
R
<
List
<
UserTreeVo
>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
UserTreeVo
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
UserTreeVo
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
}
}
src/main/java/com/syc/slm/slmbi/service/impl/VariableServiceImpl.java
View file @
c04e306b
...
@@ -53,10 +53,8 @@ public class VariableServiceImpl implements VariableService {
...
@@ -53,10 +53,8 @@ public class VariableServiceImpl implements VariableService {
p
.
put
(
"isCustomer"
,
null
);
p
.
put
(
"isCustomer"
,
null
);
p
.
put
(
"current"
,
variableDTO
.
getCurrent
()+
""
);
p
.
put
(
"current"
,
variableDTO
.
getCurrent
()+
""
);
p
.
put
(
"size"
,
variableDTO
.
getSize
()+
""
);
p
.
put
(
"size"
,
variableDTO
.
getSize
()+
""
);
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
token
);
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
heads
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{
}.
getType
(),
p
);
}.
getType
(),
p
);
Map
<
String
,
Object
>
detach
=
result
.
detach
();
Map
<
String
,
Object
>
detach
=
result
.
detach
();
if
(
CollectionUtils
.
isNotEmpty
(
detach
))
{
if
(
CollectionUtils
.
isNotEmpty
(
detach
))
{
...
@@ -104,9 +102,7 @@ public class VariableServiceImpl implements VariableService {
...
@@ -104,9 +102,7 @@ public class VariableServiceImpl implements VariableService {
p
.
put
(
"warranty_status"
,
null
);
p
.
put
(
"warranty_status"
,
null
);
p
.
put
(
"page_num"
,
queryPageDTO
.
getCurrent
()
+
""
);
p
.
put
(
"page_num"
,
queryPageDTO
.
getCurrent
()
+
""
);
p
.
put
(
"page_size"
,
queryPageDTO
.
getSize
()
+
""
);
p
.
put
(
"page_size"
,
queryPageDTO
.
getSize
()
+
""
);
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{
heads
.
put
(
"X-Token"
,
token
);
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
get
(
uri
,
heads
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{
}.
getType
(),
p
);
}.
getType
(),
p
);
Map
<
String
,
Object
>
detach
=
result
.
detach
();
Map
<
String
,
Object
>
detach
=
result
.
detach
();
if
(
CollectionUtils
.
isNotEmpty
(
detach
))
{
if
(
CollectionUtils
.
isNotEmpty
(
detach
))
{
...
@@ -140,11 +136,9 @@ public class VariableServiceImpl implements VariableService {
...
@@ -140,11 +136,9 @@ public class VariableServiceImpl implements VariableService {
if
(
StringUtils
.
isBlank
(
variableDTO
.
getFormat
()))
{
if
(
StringUtils
.
isBlank
(
variableDTO
.
getFormat
()))
{
throw
new
SysException
(
" 请填入时间格式"
);
throw
new
SysException
(
" 请填入时间格式"
);
}
}
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
user
.
getToken
());
Map
<
String
,
String
>
uriVariables
=
SlmConstants
.
gson
.
fromJson
(
SlmConstants
.
gson
.
toJson
(
variableDTO
),
new
TypeToken
<
Map
<
String
,
String
>>(){}.
getType
());
Map
<
String
,
String
>
uriVariables
=
SlmConstants
.
gson
.
fromJson
(
SlmConstants
.
gson
.
toJson
(
variableDTO
),
new
TypeToken
<
Map
<
String
,
String
>>(){}.
getType
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
R
<
Map
<
String
,
List
<
Map
<
String
,
Object
>>>>
result
=
RestTemplateUtils
.
get
(
uri
,
heads
,
new
TypeToken
<
R
<
Map
<
String
,
List
<
Map
<
String
,
Object
>>>>>()
{}.
getType
(),
uriVariables
);
R
<
Map
<
String
,
List
<
Map
<
String
,
Object
>>>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
List
<
Map
<
String
,
Object
>>>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
...
@@ -187,12 +181,10 @@ public class VariableServiceImpl implements VariableService {
...
@@ -187,12 +181,10 @@ public class VariableServiceImpl implements VariableService {
throw
new
SysException
(
"统计维度为时间,请填入时间格式"
);
throw
new
SysException
(
"统计维度为时间,请填入时间格式"
);
}
}
}
}
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
user
.
getToken
());
Map
<
String
,
String
>
uriVariables
=
SlmConstants
.
gson
.
fromJson
(
SlmConstants
.
gson
.
toJson
(
variableDTO
),
new
TypeToken
<
Map
<
String
,
String
>>(){}.
getType
());
Map
<
String
,
String
>
uriVariables
=
SlmConstants
.
gson
.
fromJson
(
SlmConstants
.
gson
.
toJson
(
variableDTO
),
new
TypeToken
<
Map
<
String
,
String
>>(){}.
getType
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
R
<
List
<
Map
<
String
,
Object
>>>
result
=
RestTemplateUtils
.
get
(
uri
,
heads
,
new
TypeToken
<
R
<
List
<
Map
<
String
,
Object
>>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
Map
<
String
,
Object
>>>
result
=
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
List
<
Map
<
String
,
Object
>>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
return
result
.
detach
();
}
}
...
@@ -260,11 +252,10 @@ public class VariableServiceImpl implements VariableService {
...
@@ -260,11 +252,10 @@ public class VariableServiceImpl implements VariableService {
}
}
private
R
<
Map
<
String
,
String
>>
setDeptAndRole
(
CurrentUser
user
,
String
uri
){
private
R
<
Map
<
String
,
String
>>
setDeptAndRole
(
CurrentUser
user
,
String
uri
){
Map
<
String
,
String
>
heads
=
Maps
.
newHashMap
();
heads
.
put
(
"X-Token"
,
user
.
getToken
());
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
return
RestTemplateUtils
.
get
(
uri
,
heads
,
new
TypeToken
<
R
<
Map
<
String
,
String
>>>()
{}.
getType
(),
uriVariables
);
return
RestTemplateUtils
.
get
(
uri
,
new
TypeToken
<
R
<
Map
<
String
,
String
>>>()
{}.
getType
(),
uriVariables
);
}
}
}
}
src/main/resources/application.yml
View file @
c04e306b
...
@@ -3,7 +3,7 @@ spring:
...
@@ -3,7 +3,7 @@ spring:
name
:
slm-bi
name
:
slm-bi
profiles
:
profiles
:
active
:
active
:
-
local
-
dev
freemarker
:
freemarker
:
cache
:
false
cache
:
false
template-loader-path
:
classpath:/templates/ftl/
template-loader-path
:
classpath:/templates/ftl/
...
...
src/main/resources/mapper/mysql/panel/InstrumentPanelGroupMapper.xml
View file @
c04e306b
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
</resultMap>
</resultMap>
<delete
id=
"batchUpdateGroupByIds"
>
<delete
id=
"batchUpdateGroupByIds"
>
update instrument_panel_group set record_status =#{recordStatus}
update instrument_panel_group set record_status =#{recordStatus}
<if
test=
"groupIds!=null"
>
<if
test=
"groupIds!=null
and groupIds.size() > 0
"
>
where id IN (
where id IN (
<foreach
collection=
"groupIds"
item=
"id"
separator=
","
>
<foreach
collection=
"groupIds"
item=
"id"
separator=
","
>
#{id}
#{id}
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
</select>
</select>
<select
id=
"selectGroupByIds"
resultType=
"com.syc.slm.slmbi.vo.PanelTreeNodeVo"
>
<select
id=
"selectGroupByIds"
resultType=
"com.syc.slm.slmbi.vo.PanelTreeNodeVo"
>
select id,`name`,parent_id,'group' node_type from instrument_panel_group
select id,`name`,parent_id,'group' node_type from instrument_panel_group
<if
test=
"finalPanelIds!=null"
>
<if
test=
"finalPanelIds!=null
and finalPanelIds.size() > 0
"
>
where id IN (
where id IN (
<foreach
collection=
"finalPanelIds"
item=
"id"
separator=
","
>
<foreach
collection=
"finalPanelIds"
item=
"id"
separator=
","
>
#{id}
#{id}
...
...
src/main/resources/mapper/mysql/panel/InstrumentPanelMapper.xml
View file @
c04e306b
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</resultMap>
</resultMap>
<update
id=
"batchUpdatePanelByIds"
>
<update
id=
"batchUpdatePanelByIds"
>
update instrument_panel set record_status =#{recordStatus}
update instrument_panel set record_status =#{recordStatus}
<if
test=
"panelIds!=null"
>
<if
test=
"panelIds!=null
and panelIds.size() > 0
"
>
where id IN (
where id IN (
<foreach
collection=
"panelIds"
item=
"id"
separator=
","
>
<foreach
collection=
"panelIds"
item=
"id"
separator=
","
>
#{id}
#{id}
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
group_id parent_id,
group_id parent_id,
'panel' node_type
'panel' node_type
from instrument_panel
from instrument_panel
<if
test=
"finalPanelIds!=null"
>
<if
test=
"finalPanelIds!=null
and finalPanelIds.size() > 0
"
>
where id IN (
where id IN (
<foreach
collection=
"finalPanelIds"
item=
"id"
separator=
","
>
<foreach
collection=
"finalPanelIds"
item=
"id"
separator=
","
>
#{id}
#{id}
...
...
src/main/resources/mapper/mysql/panel/InstrumentPanelTreeMapper.xml
View file @
c04e306b
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
</resultMap>
</resultMap>
<update
id=
"batchUpdateTreeByIds"
>
<update
id=
"batchUpdateTreeByIds"
>
update instrument_panel_tree set record_status =#{recordStatus}
update instrument_panel_tree set record_status =#{recordStatus}
<if
test=
"treeIds!=null"
>
<if
test=
"treeIds!=null
and treeIds.size() > 0
"
>
where id IN (
where id IN (
<foreach
collection=
"treeIds"
item=
"id"
separator=
","
>
<foreach
collection=
"treeIds"
item=
"id"
separator=
","
>
#{id}
#{id}
...
...
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