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
c5425d26
Commit
c5425d26
authored
Apr 25, 2021
by
梁光意
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/develop' into develop-fix
# Conflicts: # src/main/resources/application-dev.yml # src/main/resources/application-local.yml
parents
05c8e84e
b0407853
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
32 deletions
+28
-32
BusinessConfigController.java
...om/syc/slm/slmbi/controller/BusinessConfigController.java
+3
-3
BusinessDTO.java
src/main/java/com/syc/slm/slmbi/dto/BusinessDTO.java
+2
-0
BusinessConfigService.java
...java/com/syc/slm/slmbi/service/BusinessConfigService.java
+1
-1
BusinessConfigServiceImpl.java
...syc/slm/slmbi/service/impl/BusinessConfigServiceImpl.java
+3
-3
application-dev.yml
src/main/resources/application-dev.yml
+2
-10
application-local.yml
src/main/resources/application-local.yml
+3
-13
application.yml
src/main/resources/application.yml
+14
-2
No files found.
src/main/java/com/syc/slm/slmbi/controller/BusinessConfigController.java
View file @
c5425d26
...
...
@@ -39,7 +39,7 @@ public class BusinessConfigController extends BaseRestController{
@GetMapping
(
"{/{id}"
)
@ApiOperation
(
"数据表查询"
)
@ApiOperation
(
"
根据id进行
数据表查询"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键id"
,
dataTypeClass
=
String
.
class
)
...
...
@@ -49,9 +49,9 @@ public class BusinessConfigController extends BaseRestController{
}
@PostMapping
(
"/filed"
)
@ApiOperation
(
"根据配置字段获取
字段
数据"
)
@ApiOperation
(
"根据配置字段获取
业务
数据"
)
@ApiImplicitParam
(
name
=
"appId"
,
value
=
"租户id"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
public
R
<
Map
<
String
,
Object
>>
getBusinessData
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestBody
BusinessDTO
dto
)
{
public
R
<
List
<
Map
<
String
,
Object
>
>>
getBusinessData
(
HttpServletRequest
request
,
@PathVariable
String
appId
,
@RequestBody
BusinessDTO
dto
)
{
return
call
(()->{
CurrentUser
currentUser
=
getCurrentUser
(
request
);
return
businessConfigService
.
getBusinessData
(
dto
,
dcClientHost
+
businessFiledData
,
currentUser
);
...
...
src/main/java/com/syc/slm/slmbi/dto/BusinessDTO.java
View file @
c5425d26
...
...
@@ -22,6 +22,8 @@ public class BusinessDTO {
private
String
y
;
@ApiModelProperty
(
value
=
"横轴纬度"
,
required
=
true
)
private
String
x
;
@ApiModelProperty
(
value
=
"横轴格式"
)
private
String
format
;
@ApiModelProperty
(
value
=
"查询配置(如果为空不要调用后台)"
,
required
=
true
)
List
<
Map
<
String
,
List
<
BusinessConditionDTO
>>>
where
;
@ApiModelProperty
(
value
=
"统计类型(平均值 avg ,合计值 sum, 最大值 max ,最小值 min,中位数 middle ,原值 original)"
,
required
=
true
)
...
...
src/main/java/com/syc/slm/slmbi/service/BusinessConfigService.java
View file @
c5425d26
...
...
@@ -36,5 +36,5 @@ public interface BusinessConfigService extends IService<BusinessConfig> {
* @param user
* @return
*/
Map
<
String
,
Object
>
getBusinessData
(
BusinessDTO
dto
,
String
uri
,
CurrentUser
user
);
List
<
Map
<
String
,
Object
>
>
getBusinessData
(
BusinessDTO
dto
,
String
uri
,
CurrentUser
user
);
}
src/main/java/com/syc/slm/slmbi/service/impl/BusinessConfigServiceImpl.java
View file @
c5425d26
...
...
@@ -75,7 +75,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
@Override
@Transactional
(
readOnly
=
true
)
public
Map
<
String
,
Object
>
getBusinessData
(
BusinessDTO
dto
,
String
uri
,
CurrentUser
user
)
{
public
List
<
Map
<
String
,
Object
>
>
getBusinessData
(
BusinessDTO
dto
,
String
uri
,
CurrentUser
user
)
{
if
(
StringUtils
.
isBlank
(
dto
.
getTable
())){
throw
new
SysException
(
"请传入对应的表名"
);
}
...
...
@@ -97,7 +97,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
}
x
.
forEach
((
k
,
v
)->{
if
(
v
.
stream
().
anyMatch
(
y
->
StringUtils
.
isBlank
(
y
.
getKey
()))
||
v
.
stream
().
anyMatch
(
y
->
ObjectUtils
.
is
Not
Empty
(
y
.
getValue
()))
||
v
.
stream
().
anyMatch
(
y
->
ObjectUtils
.
isEmpty
(
y
.
getValue
()))
||
v
.
stream
().
anyMatch
(
y
->
StringUtils
.
isBlank
(
y
.
getQueryType
())))
{
throw
new
SysException
(
"where 条件不能key value queryType 都不能为空"
);
}
...
...
@@ -107,7 +107,7 @@ public class BusinessConfigServiceImpl extends ServiceImpl<BusinessConfigMapper,
heads
.
put
(
"X-Token"
,
user
.
getToken
());
Map
<
String
,
String
>
uriVariables
=
Maps
.
newHashMap
();
uriVariables
.
put
(
"appId"
,
user
.
getAppId
());
R
<
Map
<
String
,
Object
>>
result
=
RestTemplateUtils
.
post
(
uri
,
heads
,
dto
,
new
TypeToken
<
R
<
Map
<
String
,
Object
>>>()
{}.
getType
(),
uriVariables
);
R
<
List
<
Map
<
String
,
Object
>>>
result
=
RestTemplateUtils
.
post
(
uri
,
heads
,
dto
,
new
TypeToken
<
R
<
List
<
Map
<
String
,
Object
>
>>>()
{}.
getType
(),
uriVariables
);
return
result
.
detach
();
}
}
src/main/resources/application-dev.yml
View file @
c5425d26
...
...
@@ -4,12 +4,4 @@ spring:
password
:
Test123!
url
:
jdbc:mysql://${MYSQL_HOST:116.63.67.122}:${MYSQL_PORT:3306}/${MYSQL_DB:slm_bi}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
dc_client
:
host
:
http://apidev.sycdev.com/dc
interfaces
:
positionListUrl
:
/{appId}/positions?positionName={positionName}
deptListUrl
:
/{appId}/departments?deptName={deptName}
userTree
:
/{appId}/users/list?userName={userName}
variableList
:
/{appId}/variables/slm/tag/list?token={token}&from={from}&varType={varType}&type={type}&equipmentId={equipmentId}&customerId={customerId}&name={name}&desc={desc}&unit={unit}&keyword={keyword}&isCustomer={isCustomer}¤t={current}&size={size}
deviceList
:
/{appId}/variables/device?token={token}&equipment_info_id={equipment_info_id}&q_name={q_name}&search_code={search_code}&warranty_status={warranty_status}&page_num={page_num}&page_size={page_size}
deptsRoles
:
/{appId}/users/depts-roles
businessFiledData
:
/{appId}/business/filed
\ No newline at end of file
host
:
http://139.9.194.252:2400/dc
# http://192.168.0.3:2400/dc # http://apidev.sycdev.com/dc
\ No newline at end of file
src/main/resources/application-local.yml
View file @
c5425d26
spring
:
datasource
:
username
:
root
password
:
123456
password
:
root
url
:
jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DB:slm_bi}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true
dc_client
:
host
:
http://apidev.sycdev.com/dc
interfaces
:
positionListUrl
:
/{appId}/positions?positionName={positionName}
deptListUrl
:
/{appId}/departments?deptName={deptName}
userTree
:
/{appId}/users/list?userName={userName}
variableList
:
/{appId}/variables/slm/tag/list?token={token}&from={from}&varType={varType}&type={type}&equipmentId={equipmentId}&customerId={customerId}&name={name}&desc={desc}&unit={unit}&keyword={keyword}&isCustomer={isCustomer}¤t={current}&size={size}
deviceList
:
/{appId}/variables/device?token={token}&equipment_info_id={equipment_info_id}&q_name={q_name}&search_code={search_code}&warranty_status={warranty_status}&page_num={page_num}&page_size={page_size}
deptsRoles
:
/{appId}/users/depts-roles
businessFiledData
:
/{appId}/business/filed
variableHistoryDataList
:
/{appId}/variables/history?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&statisticsType={statisticsType}&variableCode={variableCode}&variableId={variableId}&x={x}&format={format}
variableRealTimeDataList
:
/{appId}/variables/real-time?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&variableCode={variableCode}&variableId={variableId}&format={format}
\ No newline at end of file
host
:
http://localhost:2400/dc
\ No newline at end of file
src/main/resources/application.yml
View file @
c5425d26
...
...
@@ -47,4 +47,16 @@ server:
port
:
2022
logging
:
level
:
com.syc.slm.slmbi.mapper
:
debug
\ No newline at end of file
com.syc.slm.slmbi.mapper
:
debug
dc_client
:
interfaces
:
positionListUrl
:
/{appId}/positions?positionName={positionName}
deptListUrl
:
/{appId}/departments?deptName={deptName}
userTree
:
/{appId}/users/list?userName={userName}
variableList
:
/{appId}/variables/slm/tag/list?token={token}&from={from}&varType={varType}&type={type}&equipmentId={equipmentId}&customerId={customerId}&name={name}&desc={desc}&unit={unit}&keyword={keyword}&isCustomer={isCustomer}¤t={current}&size={size}
deviceList
:
/{appId}/variables/device?token={token}&equipment_info_id={equipment_info_id}&q_name={q_name}&search_code={search_code}&warranty_status={warranty_status}&page_num={page_num}&page_size={page_size}
deptsRoles
:
/{appId}/users/depts-roles
businessFiledData
:
/{appId}/business/filed
variableHistoryDataList
:
/{appId}/variables/history?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&statisticsType={statisticsType}&variableCode={variableCode}&variableId={variableId}&x={x}&format={format}
variableRealTimeDataList
:
/{appId}/variables/real-time?deviceId={deviceId}&endTime={endTime}&startTime={startTime}&variableCode={variableCode}&variableId={variableId}&format={format}
\ No newline at end of file
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