Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
be297d37
Commit
be297d37
authored
Jan 23, 2025
by
邢磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改故障管理列表接口
parent
c303ac6d
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
247 additions
and
36 deletions
+247
-36
AnalysisResultServiceImpl.java
...join/amos/kgd/service/impl/AnalysisResultServiceImpl.java
+34
-7
EquipmentFaultController.java
...join/equipmanage/controller/EquipmentFaultController.java
+18
-16
KgdFeignClient.java
...in/java/com/yeejoin/equipmanage/fegin/KgdFeignClient.java
+23
-0
EquipmentDetailMapper.java
...com/yeejoin/equipmanage/mapper/EquipmentDetailMapper.java
+2
-0
IEquipmentCategoryService.java
...eejoin/equipmanage/service/IEquipmentCategoryService.java
+2
-0
IEquipmentDetailService.java
.../yeejoin/equipmanage/service/IEquipmentDetailService.java
+2
-0
IEquipmentFaultService.java
...m/yeejoin/equipmanage/service/IEquipmentFaultService.java
+7
-4
EquipmentCategoryServiceImpl.java
...quipmanage/service/impl/EquipmentCategoryServiceImpl.java
+26
-1
EquipmentDetailServiceImpl.java
.../equipmanage/service/impl/EquipmentDetailServiceImpl.java
+5
-0
EquipmentFaultServiceImpl.java
...n/equipmanage/service/impl/EquipmentFaultServiceImpl.java
+94
-5
AnalysisResultController.java
...yeejoin/amos/kgd/controller/AnalysisResultController.java
+11
-0
application.properties
...ot-system-equip/src/main/resources/application.properties
+1
-1
EquipmentDetailMapper.xml
...equip/src/main/resources/mapper/EquipmentDetailMapper.xml
+20
-0
pom.xml
pom.xml
+2
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-kgd-api/src/main/java/com/yeejoin/amos/kgd/service/impl/AnalysisResultServiceImpl.java
View file @
be297d37
...
@@ -3,12 +3,16 @@ package com.yeejoin.amos.kgd.service.impl;
...
@@ -3,12 +3,16 @@ package com.yeejoin.amos.kgd.service.impl;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.kgd.mapper.AnalysisResultMapper
;
import
com.yeejoin.amos.kgd.mapper.AnalysisResultMapper
;
import
com.yeejoin.amos.kgd.model.AnalysisResult
;
import
com.yeejoin.amos.kgd.model.AnalysisResult
;
import
com.yeejoin.amos.kgd.service.AnalysisResultService
;
import
com.yeejoin.amos.kgd.service.AnalysisResultService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
...
@@ -59,10 +63,10 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
...
@@ -59,10 +63,10 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
public
JSONObject
getAnalysisDataByDeviceId
(
String
deviceId
)
{
public
JSONObject
getAnalysisDataByDeviceId
(
String
deviceId
)
{
int
highFrequencyNumber
=
analysisResultMapper
.
queryHighFrequencyNumber
(
deviceId
);
int
highFrequencyNumber
=
analysisResultMapper
.
queryHighFrequencyNumber
(
deviceId
);
List
<
AnalysisResult
>
analysisResultList
=
analysisResultMapper
.
queryHighFrequencyAnalysisData
(
deviceId
,
highFrequencyNumber
);
List
<
AnalysisResult
>
analysisResultList
=
analysisResultMapper
.
queryHighFrequencyAnalysisData
(
deviceId
,
highFrequencyNumber
);
JSONObject
result
=
new
JSONObject
();
if
(
analysisResultList
==
null
||
analysisResultList
.
isEmpty
()){
if
(
analysisResultList
==
null
||
analysisResultList
.
isEmpty
()){
return
null
;
return
result
;
}
}
JSONObject
result
=
new
JSONObject
();
JSONArray
jsonArray
=
new
JSONArray
();
JSONArray
jsonArray
=
new
JSONArray
();
for
(
AnalysisResult
analysisResult
:
analysisResultList
)
{
for
(
AnalysisResult
analysisResult
:
analysisResultList
)
{
JSONObject
jsonAnalysisData
=
JSONObject
.
parseObject
(
analysisResult
.
getAnalysisData
());
JSONObject
jsonAnalysisData
=
JSONObject
.
parseObject
(
analysisResult
.
getAnalysisData
());
...
@@ -80,10 +84,10 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
...
@@ -80,10 +84,10 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
public
JSONArray
getVarNameByDeviceId
(
String
deviceId
){
public
JSONArray
getVarNameByDeviceId
(
String
deviceId
){
List
<
String
>
varNameList
=
analysisResultMapper
.
queryVarName
(
deviceId
);
List
<
String
>
varNameList
=
analysisResultMapper
.
queryVarName
(
deviceId
);
JSONArray
jsonArray
=
new
JSONArray
();
if
(
varNameList
==
null
||
varNameList
.
isEmpty
()){
if
(
varNameList
==
null
||
varNameList
.
isEmpty
()){
return
null
;
return
jsonArray
;
}
}
JSONArray
jsonArray
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
varNameList
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
varNameList
.
size
();
i
++){
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"text"
,
varNameList
.
get
(
i
));
jsonObject
.
put
(
"text"
,
varNameList
.
get
(
i
));
...
@@ -97,7 +101,7 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
...
@@ -97,7 +101,7 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
public
JSONObject
getAnalysisDataByDeviceIdAndVarName
(
String
deviceId
,
String
varName
)
{
public
JSONObject
getAnalysisDataByDeviceIdAndVarName
(
String
deviceId
,
String
varName
)
{
AnalysisResult
analysisResult
=
analysisResultMapper
.
queryAnalysisData
(
deviceId
,
varName
);
AnalysisResult
analysisResult
=
analysisResultMapper
.
queryAnalysisData
(
deviceId
,
varName
);
if
(
analysisResult
==
null
)
{
if
(
analysisResult
==
null
)
{
return
n
ull
;
return
n
ew
JSONObject
()
;
}
}
String
data
=
analysisResult
.
getData
();
String
data
=
analysisResult
.
getData
();
JSONObject
jsonData
=
JSONObject
.
parseObject
(
data
);
JSONObject
jsonData
=
JSONObject
.
parseObject
(
data
);
...
@@ -118,8 +122,9 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
...
@@ -118,8 +122,9 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
public
JSONObject
getFaultRateByDeviceIdAndStatus
(
String
deviceId
,
String
varName
)
{
public
JSONObject
getFaultRateByDeviceIdAndStatus
(
String
deviceId
,
String
varName
)
{
AnalysisResult
analysisResult
=
analysisResultMapper
.
queryAnalysisResultRate
(
deviceId
,
varName
);
AnalysisResult
analysisResult
=
analysisResultMapper
.
queryAnalysisResultRate
(
deviceId
,
varName
);
JSONObject
jsonData
=
new
JSONObject
();
if
(
analysisResult
.
getAnalysisResultRate
()
==
null
)
{
if
(
analysisResult
.
getAnalysisResultRate
()
==
null
)
{
return
null
;
return
jsonData
;
}
}
String
analysisResultRate
=
analysisResult
.
getAnalysisResultRate
();
String
analysisResultRate
=
analysisResult
.
getAnalysisResultRate
();
JSONObject
jsonAnalysisResultRate
=
JSONObject
.
parseObject
(
analysisResultRate
);
// {"正常":0.97,"内圈2":0.01,"滚动体2":0.01,"外圈2":0.0}
JSONObject
jsonAnalysisResultRate
=
JSONObject
.
parseObject
(
analysisResultRate
);
// {"正常":0.97,"内圈2":0.01,"滚动体2":0.01,"外圈2":0.0}
...
@@ -130,7 +135,6 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
...
@@ -130,7 +135,6 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
axisData
.
add
(
key
);
axisData
.
add
(
key
);
seriesData
.
add
(
jsonAnalysisResultRate
.
get
(
key
));
seriesData
.
add
(
jsonAnalysisResultRate
.
get
(
key
));
}
}
JSONObject
jsonData
=
new
JSONObject
();
jsonData
.
put
(
"seriesData"
,
seriesData
);
jsonData
.
put
(
"seriesData"
,
seriesData
);
jsonData
.
put
(
"axisData"
,
axisData
);
jsonData
.
put
(
"axisData"
,
axisData
);
return
jsonData
;
return
jsonData
;
...
@@ -217,6 +221,29 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
...
@@ -217,6 +221,29 @@ public class AnalysisResultServiceImpl extends ServiceImpl<AnalysisResultMapper,
return
jsonPrediction
;
return
jsonPrediction
;
}
}
public
IPage
<
AnalysisResult
>
getPredictionResultForPage
(
int
current
,
int
size
,
JSONObject
map
){
JSONArray
deviceIds
=
map
.
getJSONArray
(
"deviceIds"
);
String
samplingTime
=
map
.
getString
(
"samplingTime"
);
String
analysisResult
=
map
.
getString
(
"analysisResult"
);
if
(
ValidationUtil
.
isEmpty
(
deviceIds
)){
throw
new
BadRequest
(
"部件编码不能为空."
);
}
Page
<
AnalysisResult
>
page
=
new
Page
<>(
size
,
size
);
LambdaQueryWrapper
<
AnalysisResult
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
AnalysisResult:
:
getDeviceId
,
deviceIds
);
wrapper
.
isNotNull
(
AnalysisResult:
:
getAnalysisResult
);
wrapper
.
ne
(
AnalysisResult:
:
getAnalysisResult
,
""
);
wrapper
.
ne
(
AnalysisResult:
:
getAnalysisResult
,
"正常"
);
if
(!
ValidationUtil
.
isEmpty
(
samplingTime
)){
wrapper
.
ge
(
AnalysisResult:
:
getSamplingtime
,
samplingTime
);
}
if
(!
ValidationUtil
.
isEmpty
(
analysisResult
)){
wrapper
.
eq
(
AnalysisResult:
:
getAnalysisResult
,
analysisResult
);
}
return
this
.
baseMapper
.
selectPage
(
page
,
wrapper
);
}
// public JSONArray getTemperatureByDeviceId(String deviceId) {
// public JSONArray getTemperatureByDeviceId(String deviceId) {
// int temperatureNumber = analysisResultMapper.queryTemperatureNumber(deviceId);
// int temperatureNumber = analysisResultMapper.queryTemperatureNumber(deviceId);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentFaultController.java
View file @
be297d37
package
com
.
yeejoin
.
equipmanage
.
controller
;
package
com
.
yeejoin
.
equipmanage
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentFaultVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentFaultVO
;
...
@@ -33,23 +34,24 @@ public class EquipmentFaultController {
...
@@ -33,23 +34,24 @@ public class EquipmentFaultController {
IEquipmentFaultService
iEquipmentFaultService
;
IEquipmentFaultService
iEquipmentFaultService
;
@RequestMapping
(
value
=
"/listDate"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/listDate"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
IPage
<
EquipmentFaultVO
>
listPage
(
@RequestParam
(
value
=
"current"
)
int
pageNum
,
public
JSONObject
listPage
(
@RequestParam
(
value
=
"current"
)
int
pageNum
,
@RequestParam
(
value
=
"size"
)
int
pageSize
,
@RequestParam
(
value
=
"size"
)
int
pageSize
,
@RequestParam
(
required
=
false
)
String
code
,
@RequestParam
(
required
=
false
)
String
code
,
@RequestParam
(
required
=
false
)
String
eqCode
,
@RequestParam
(
required
=
false
)
String
eqCode
,
@RequestParam
(
required
=
false
)
String
name
,
@RequestParam
(
required
=
false
)
String
eqName
,
@RequestParam
(
required
=
false
)
String
faultOccurTime
,
@RequestParam
(
required
=
false
)
String
name
,
@RequestParam
(
required
=
false
)
String
type
,
@RequestParam
(
required
=
false
)
String
faultOccurTime
,
@RequestParam
(
required
=
false
)
String
agencyName
)
{
@RequestParam
(
required
=
false
)
String
type
,
int
start
=
(
pageNum
-
1
)
*
pageSize
;
@RequestParam
(
required
=
false
)
String
agencyName
)
{
List
<
EquipmentFaultVO
>
list
=
iEquipmentFaultService
.
selectEquipmentFaultList
(
start
,
pageSize
,
code
,
eqCode
,
name
,
faultOccurTime
,
type
,
agencyName
);
// int start = (pageNum - 1) * pageSize;
int
count
=
iEquipmentFaultService
.
selectEquipmentFaultListCount
(
code
,
eqCode
,
name
,
faultOccurTime
,
type
,
agencyName
);
// List<EquipmentFaultVO> list = iEquipmentFaultService.selectEquipmentFaultList(start, pageSize, code, eqCode, name, faultOccurTime, type, agencyName);
// int count = iEquipmentFaultService.selectEquipmentFaultListCount(code, eqCode, name, faultOccurTime, type, agencyName);
Page
psge
=
new
Page
(
pageNum
,
pageSize
,
count
);
//
psge
.
setRecords
(
list
);
// Page psge = new Page(pageNum, pageSize, count);
return
psge
;
// psge.setRecords(list);
return
iEquipmentFaultService
.
selectEquipmentFaultListByCode
(
pageNum
,
pageSize
,
code
,
eqCode
,
eqName
,
name
,
faultOccurTime
,
type
,
agencyName
);
}
}
// @ApiOperation(value = "导出故障清单", notes = "导出故障清单", produces = "application/octet-stream")
// @ApiOperation(value = "导出故障清单", notes = "导出故障清单", produces = "application/octet-stream")
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/KgdFeignClient.java
0 → 100644
View file @
be297d37
package
com
.
yeejoin
.
equipmanage
.
fegin
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
/**
* @description:
* @author: tw
* @createDate: 2021/10/20
*/
@FeignClient
(
name
=
"${kgd.fegin.name}"
,
path
=
"kgd"
,
configuration
=
{
MultipartSupportConfig
.
class
})
public
interface
KgdFeignClient
{
@RequestMapping
(
value
=
"/data/select/equipment-fault"
,
method
=
RequestMethod
.
POST
)
ResponseModel
<
Object
>
getPredictionResultForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestBody
JSONObject
map
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentDetailMapper.java
View file @
be297d37
...
@@ -47,4 +47,6 @@ public interface EquipmentDetailMapper extends BaseMapper<EquipmentDetail> {
...
@@ -47,4 +47,6 @@ public interface EquipmentDetailMapper extends BaseMapper<EquipmentDetail> {
boolean
save
(
EquipmentDetail
equipmentDetail
);
boolean
save
(
EquipmentDetail
equipmentDetail
);
List
<
EquipmentDetail
>
queryListByCode
(
String
code
);
List
<
EquipmentDetail
>
queryListByCode
(
String
code
);
List
<
EquipmentDetail
>
queryListByCodes
(
List
<
String
>
codes
,
String
eqCode
,
String
name
,
String
agencyName
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentCategoryService.java
View file @
be297d37
...
@@ -64,4 +64,6 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> {
...
@@ -64,4 +64,6 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> {
List
<
EquipmentCategory
>
getEquipmentCategoryEquipmentList
();
List
<
EquipmentCategory
>
getEquipmentCategoryEquipmentList
();
List
<
EquipmentCategory
>
getEquipmentCategoryCarList
();
List
<
EquipmentCategory
>
getEquipmentCategoryCarList
();
List
<
EquipmentCategory
>
getEquipmentCategoryById
(
String
id
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentDetailService.java
View file @
be297d37
...
@@ -36,4 +36,6 @@ public interface IEquipmentDetailService extends IService<EquipmentDetail> {
...
@@ -36,4 +36,6 @@ public interface IEquipmentDetailService extends IService<EquipmentDetail> {
String
checkDelete
(
List
<
Long
>
ids
);
String
checkDelete
(
List
<
Long
>
ids
);
List
<
DetailssAmountVO
>
getall
();
List
<
DetailssAmountVO
>
getall
();
List
<
EquipmentDetail
>
getListByCodes
(
List
<
String
>
codes
,
String
eqCode
,
String
eqName
,
String
agencyName
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentFaultService.java
View file @
be297d37
package
com
.
yeejoin
.
equipmanage
.
service
;
package
com
.
yeejoin
.
equipmanage
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentFaultVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentFaultVO
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -10,9 +11,11 @@ import java.util.List;
...
@@ -10,9 +11,11 @@ import java.util.List;
*/
*/
public
interface
IEquipmentFaultService
{
public
interface
IEquipmentFaultService
{
List
<
EquipmentFaultVO
>
selectEquipmentFaultList
(
int
pageNum
,
int
pageSize
,
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
);
JSONObject
selectEquipmentFaultListByCode
(
int
pageNum
,
int
pageSize
,
String
code
,
String
eqCode
,
String
eqName
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
);
int
selectEquipmentFaultListCount
(
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
);
List
<
EquipmentFaultVO
>
selectEquipmentFaultList
(
int
pageNum
,
int
pageSize
,
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
);
List
<
EquipmentFaultVO
>
getAll
(
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
);
int
selectEquipmentFaultListCount
(
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
);
List
<
EquipmentFaultVO
>
getAll
(
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentCategoryServiceImpl.java
View file @
be297d37
...
@@ -7,6 +7,8 @@ import java.util.List;
...
@@ -7,6 +7,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.equipmanage.common.entity.EquipmentDetail
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -35,6 +37,7 @@ import com.yeejoin.equipmanage.mapper.EquipmentCategoryMapper;
...
@@ -35,6 +37,7 @@ import com.yeejoin.equipmanage.mapper.EquipmentCategoryMapper;
import
com.yeejoin.equipmanage.service.IEquipmentCategoryService
;
import
com.yeejoin.equipmanage.service.IEquipmentCategoryService
;
import
com.yeejoin.equipmanage.service.IIndustryService
;
import
com.yeejoin.equipmanage.service.IIndustryService
;
import
com.yeejoin.equipmanage.service.IStockBillDetailService
;
import
com.yeejoin.equipmanage.service.IStockBillDetailService
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
/**
/**
* 装备分类 服务实现类
* 装备分类 服务实现类
...
@@ -236,6 +239,17 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM
...
@@ -236,6 +239,17 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM
}
}
@Override
@Override
public
List
<
EquipmentCategory
>
getEquipmentCategoryById
(
String
id
)
{
List
<
EquipmentCategory
>
list
=
new
ArrayList
<>();
LambdaQueryWrapper
<
EquipmentCategory
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
EquipmentCategory:
:
getId
,
id
);
EquipmentCategory
equipmentCategory
=
this
.
baseMapper
.
selectOne
(
wrapper
);
list
.
add
(
equipmentCategory
);
this
.
buildByRecursive
(
id
,
list
);
return
list
;
}
@Override
public
List
<
EquipmentCategoryCountVO
>
typeCount
()
{
public
List
<
EquipmentCategoryCountVO
>
typeCount
()
{
//父类型所有数据
//父类型所有数据
QueryWrapper
<
EquipmentCategory
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
EquipmentCategory
>
wrapper
=
new
QueryWrapper
<>();
...
@@ -525,5 +539,16 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM
...
@@ -525,5 +539,16 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM
return
list
;
return
list
;
}
}
private
List
<
EquipmentCategory
>
buildByRecursive
(
String
id
,
List
<
EquipmentCategory
>
list
){
LambdaQueryWrapper
<
EquipmentCategory
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
in
(
EquipmentCategory:
:
getParentId
,
id
);
List
<
EquipmentCategory
>
equipmentCategorieList
=
this
.
baseMapper
.
selectList
(
wrapper
);
if
(!
ValidationUtil
.
isEmpty
(
equipmentCategorieList
)){
equipmentCategorieList
.
stream
().
forEach
(
x
->
{
list
.
add
(
x
);
this
.
buildByRecursive
(
x
.
getId
().
toString
(),
list
);
});
}
return
list
;
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentDetailServiceImpl.java
View file @
be297d37
...
@@ -311,4 +311,9 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
...
@@ -311,4 +311,9 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
return
equipmentDetailMapper
.
getall
();
return
equipmentDetailMapper
.
getall
();
}
}
@Override
public
List
<
EquipmentDetail
>
getListByCodes
(
List
<
String
>
codes
,
String
eqCode
,
String
name
,
String
agencyName
)
{
return
equipmentDetailMapper
.
queryListByCodes
(
codes
,
eqCode
,
name
,
agencyName
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentFaultServiceImpl.java
View file @
be297d37
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.equipmanage.common.entity.EquipmentCategory
;
import
com.yeejoin.equipmanage.common.entity.EquipmentDetail
;
import
com.yeejoin.equipmanage.common.entity.EquipmentFaultKnowledge
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentFaultVO
;
import
com.yeejoin.equipmanage.common.entity.vo.EquipmentFaultVO
;
import
com.yeejoin.equipmanage.fegin.KgdFeignClient
;
import
com.yeejoin.equipmanage.mapper.EquipmentFaultMapper
;
import
com.yeejoin.equipmanage.mapper.EquipmentFaultMapper
;
import
com.yeejoin.equipmanage.service.IEquipmentCategoryService
;
import
com.yeejoin.equipmanage.service.IEquipmentDetailService
;
import
com.yeejoin.equipmanage.service.IEquipmentFaultKnowledgeService
;
import
com.yeejoin.equipmanage.service.IEquipmentFaultService
;
import
com.yeejoin.equipmanage.service.IEquipmentFaultService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -15,10 +30,84 @@ public class EquipmentFaultServiceImpl implements IEquipmentFaultService {
...
@@ -15,10 +30,84 @@ public class EquipmentFaultServiceImpl implements IEquipmentFaultService {
@Autowired
@Autowired
EquipmentFaultMapper
equipmentFaultMapper
;
EquipmentFaultMapper
equipmentFaultMapper
;
@Autowired
IEquipmentCategoryService
equipmentCategoryService
;
@Autowired
IEquipmentDetailService
equipmentDetailService
;
@Autowired
private
KgdFeignClient
kgdFeignClient
;
@Autowired
private
IEquipmentFaultKnowledgeService
iEquipmentFaultKnowledgeService
;
@Override
public
JSONObject
selectEquipmentFaultListByCode
(
int
pageNum
,
int
pageSize
,
String
code
,
String
eqCode
,
String
eqName
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
)
{
List
<
EquipmentCategory
>
equipmentCategoryList
=
equipmentCategoryService
.
getEquipmentCategoryById
(
code
);
if
(!
ValidationUtil
.
isEmpty
(
eqName
))
{
equipmentCategoryList
=
equipmentCategoryList
.
stream
().
filter
(
x
->
x
.
getName
().
equals
(
eqName
)).
collect
(
Collectors
.
toList
());
}
List
<
String
>
codes
=
equipmentCategoryList
.
stream
().
map
(
EquipmentCategory:
:
getCode
).
collect
(
Collectors
.
toList
());
List
<
EquipmentDetail
>
equipmentDetails
=
equipmentDetailService
.
getListByCodes
(
codes
,
eqCode
,
name
,
agencyName
);
List
<
EquipmentFaultKnowledge
>
equipmentFaultKnowledgeList
=
iEquipmentFaultKnowledgeService
.
list
();
Map
<
String
,
EquipmentCategory
>
equipmentCategoryMap
=
equipmentCategoryList
.
stream
().
collect
(
Collectors
.
toMap
(
EquipmentCategory:
:
getCode
,
entity
->
entity
));
Map
<
String
,
EquipmentDetail
>
equipmentDetailMap
=
equipmentDetails
.
stream
().
collect
(
Collectors
.
toMap
(
EquipmentDetail:
:
getEqcode
,
entity
->
entity
));
Map
<
String
,
EquipmentFaultKnowledge
>
equipmentFaultKnowledgeMap
=
equipmentFaultKnowledgeList
.
stream
().
collect
(
Collectors
.
toMap
(
EquipmentFaultKnowledge:
:
getType
,
entity
->
entity
));
JSONObject
map
=
new
JSONObject
();
map
.
put
(
"samplingTime"
,
faultOccurTime
);
codes
=
equipmentDetails
.
stream
().
map
(
EquipmentDetail:
:
getEqcode
).
collect
(
Collectors
.
toList
());
map
.
put
(
"deviceIds"
,
codes
);
if
(!
ValidationUtil
.
isEmpty
(
type
))
{
List
<
EquipmentFaultKnowledge
>
collect
=
equipmentFaultKnowledgeList
.
stream
().
filter
(
x
->
x
.
getId
().
equals
(
Long
.
valueOf
(
type
))).
collect
(
Collectors
.
toList
());
if
(!
ValidationUtil
.
isEmpty
(
collect
))
{
map
.
put
(
"analysisResult"
,
collect
.
get
(
0
).
getType
());
}
}
ResponseModel
<
Object
>
result
=
kgdFeignClient
.
getPredictionResultForPage
((
pageNum
-
1
)
*
pageSize
,
pageSize
,
map
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
result
.
getResult
()));
JSONArray
records
=
jsonObject
.
getJSONArray
(
"records"
);
List
<
EquipmentFaultVO
>
equipmentFaultVOList
=
records
.
stream
().
map
(
x
->
{
JSONObject
xObj
=
(
JSONObject
)
x
;
EquipmentFaultVO
equipmentFaultVO
=
new
EquipmentFaultVO
();
equipmentFaultVO
.
setEqCode
(
xObj
.
getString
(
"deviceId"
));
equipmentFaultVO
.
setId
(
xObj
.
getLong
(
"id"
));
try
{
equipmentFaultVO
.
setFaultOccurTime
(
DateUtil
.
formatStringToDate
(
xObj
.
getString
(
"samplingtime"
),
DateUtil
.
Y_M_D_HMS
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
EquipmentDetail
equipmentDetail
=
equipmentDetailMap
.
get
(
xObj
.
getString
(
"deviceId"
));
EquipmentFaultKnowledge
equipmentFaultKnowledge
=
equipmentFaultKnowledgeMap
.
get
(
xObj
.
getString
(
"analysisResult"
));
if
(!
ValidationUtil
.
isEmpty
(
equipmentDetail
))
{
equipmentFaultVO
.
setName
(
equipmentDetail
.
getName
());
equipmentFaultVO
.
setAgencyName
(
equipmentDetail
.
getCompanyName
());
EquipmentCategory
equipmentCategory
=
equipmentCategoryMap
.
get
(
equipmentDetail
.
getCode
());
if
(!
ValidationUtil
.
isEmpty
(
equipmentCategory
))
{
equipmentFaultVO
.
setEqName
(
equipmentCategory
.
getName
());
}
}
if
(!
ValidationUtil
.
isEmpty
(
equipmentFaultKnowledge
))
{
equipmentFaultVO
.
setType
(
equipmentFaultKnowledge
.
getType
());
equipmentFaultVO
.
setReason
(
equipmentFaultKnowledge
.
getReason
());
equipmentFaultVO
.
setMeasure
(
equipmentFaultKnowledge
.
getMeasure
());
equipmentFaultVO
.
setRemark
(
equipmentFaultKnowledge
.
getRemark
());
}
return
equipmentFaultVO
;
}).
collect
(
Collectors
.
toList
());
jsonObject
.
put
(
"records"
,
equipmentFaultVOList
);
return
jsonObject
;
}
@Override
@Override
public
List
<
EquipmentFaultVO
>
selectEquipmentFaultList
(
int
pageNum
,
int
pageSize
,
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
)
{
public
List
<
EquipmentFaultVO
>
selectEquipmentFaultList
(
int
pageNum
,
int
pageSize
,
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
)
{
String
newCode
=
""
;
String
newCode
=
""
;
if
(
code
!=
null
){
if
(
code
!=
null
)
{
char
[]
chars
=
code
.
toCharArray
();
char
[]
chars
=
code
.
toCharArray
();
for
(
int
i
=
chars
.
length
-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
chars
.
length
-
1
;
i
>=
0
;
i
--)
{
if
(
"0"
.
equals
(
String
.
valueOf
(
chars
[
i
])))
{
if
(
"0"
.
equals
(
String
.
valueOf
(
chars
[
i
])))
{
...
@@ -32,9 +121,9 @@ public class EquipmentFaultServiceImpl implements IEquipmentFaultService {
...
@@ -32,9 +121,9 @@ public class EquipmentFaultServiceImpl implements IEquipmentFaultService {
}
}
@Override
@Override
public
int
selectEquipmentFaultListCount
(
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
)
{
public
int
selectEquipmentFaultListCount
(
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
)
{
String
newCode
=
""
;
String
newCode
=
""
;
if
(
code
!=
null
){
if
(
code
!=
null
)
{
char
[]
chars
=
code
.
toCharArray
();
char
[]
chars
=
code
.
toCharArray
();
for
(
int
i
=
chars
.
length
-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
chars
.
length
-
1
;
i
>=
0
;
i
--)
{
if
(
"0"
.
equals
(
String
.
valueOf
(
chars
[
i
])))
{
if
(
"0"
.
equals
(
String
.
valueOf
(
chars
[
i
])))
{
...
@@ -48,7 +137,7 @@ public class EquipmentFaultServiceImpl implements IEquipmentFaultService {
...
@@ -48,7 +137,7 @@ public class EquipmentFaultServiceImpl implements IEquipmentFaultService {
}
}
@Override
@Override
public
List
<
EquipmentFaultVO
>
getAll
(
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
)
{
public
List
<
EquipmentFaultVO
>
getAll
(
String
code
,
String
eqCode
,
String
name
,
String
faultOccurTime
,
String
type
,
String
agencyName
)
{
return
equipmentFaultMapper
.
getAll
(
code
,
eqCode
,
name
,
faultOccurTime
,
type
,
agencyName
);
return
equipmentFaultMapper
.
getAll
(
code
,
eqCode
,
name
,
faultOccurTime
,
type
,
agencyName
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-kgd-biz/src/main/java/com/yeejoin/amos/kgd/controller/AnalysisResultController.java
View file @
be297d37
...
@@ -14,6 +14,8 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...
@@ -14,6 +14,8 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Map
;
@RestController
@RestController
@Api
(
tags
=
"数据Api"
)
@Api
(
tags
=
"数据Api"
)
...
@@ -120,4 +122,13 @@ public class AnalysisResultController {
...
@@ -120,4 +122,13 @@ public class AnalysisResultController {
return
ResponseHelper
.
buildResponse
(
jsonData
);
return
ResponseHelper
.
buildResponse
(
jsonData
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"故障管理"
)
@RequestMapping
(
value
=
"/equipment-fault"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
getPredictionResultForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestBody
JSONObject
map
){
return
ResponseHelper
.
buildResponse
(
analysisResultService
.
getPredictionResultForPage
(
current
,
size
,
map
));
}
}
}
amos-boot-system-equip/src/main/resources/application.properties
View file @
be297d37
...
@@ -51,8 +51,8 @@ equipManage.name=AMOS-EQUIPMANAGE
...
@@ -51,8 +51,8 @@ equipManage.name=AMOS-EQUIPMANAGE
iot.vehicle.track
=
AMOS-API-IOT
iot.vehicle.track
=
AMOS-API-IOT
jcs.fegin.name
=
JCS
jcs.fegin.name
=
JCS
video.fegin.name
=
VIDEO
video.fegin.name
=
VIDEO
kgd.fegin.name
=
AMOS-BIZ-KGD-API
#项目初始化画布id
#项目初始化画布id
morphic.projectSeq
=
1390314016458514433
morphic.projectSeq
=
1390314016458514433
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentDetailMapper.xml
View file @
be297d37
...
@@ -257,4 +257,24 @@
...
@@ -257,4 +257,24 @@
<select
id=
"queryListByCode"
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentDetail"
>
<select
id=
"queryListByCode"
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentDetail"
>
select * from wl_equipment_detail wled where wled.code = #{code}
select * from wl_equipment_detail wled where wled.code = #{code}
</select>
</select>
<select
id=
"queryListByCodes"
resultType=
"com.yeejoin.equipmanage.common.entity.EquipmentDetail"
>
select
wled.id id,
wled.name name,
wled.code code,
wled.equipment_name equipmentName,
wled.equipment_id equipmentId,
wled.eq_code eqCode,
wles.agency_name as companyName
from wl_equipment_detail wled
LEFT JOIN wl_equipment_specific wles ON wles.equipment_detail_id = wled.id
where wled.code in
<foreach
item=
"code"
collection=
"codes"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{code}
</foreach>
<if
test=
"eqCode != null and eqCode != ''"
>
AND wled.eq_code LIKE CONCAT('%',#{eqCode},'%' )
</if>
<if
test=
"name != null and name != ''"
>
AND wled.name LIKE CONCAT('%',#{name},'%' )
</if>
<if
test=
"agencyName != null and agencyName != ''"
>
AND wles.agency_name LIKE CONCAT('%',#{agencyName},'%' )
</if>
</select>
</mapper>
</mapper>
pom.xml
View file @
be297d37
...
@@ -274,12 +274,12 @@
...
@@ -274,12 +274,12 @@
<repository>
<repository>
<id>
Releases
</id>
<id>
Releases
</id>
<name>
Releases
</name>
<name>
Releases
</name>
<url>
http://
113.142.68.105
:8081/nexus/content/repositories/releases/
</url>
<url>
http://
47.92.103.240
:8081/nexus/content/repositories/releases/
</url>
</repository>
</repository>
<repository>
<repository>
<id>
Snapshots
</id>
<id>
Snapshots
</id>
<name>
Snapshots
</name>
<name>
Snapshots
</name>
<url>
http://
113.142.68.105
:8081/nexus/content/repositories/snapshots/
</url>
<url>
http://
47.92.103.240
:8081/nexus/content/repositories/snapshots/
</url>
</repository>
</repository>
<repository>
<repository>
<id>
com.e-iceblue
</id>
<id>
com.e-iceblue
</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