Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
56a84b52
Commit
56a84b52
authored
Jun 07, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
6df47e10
501f18da
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
158 additions
and
59 deletions
+158
-59
TestController.java
...amos/boot/module/jxiop/biz/controller/TestController.java
+109
-42
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+1
-1
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+2
-2
application-dev.properties
...analyse-biz/src/main/resources/application-dev.properties
+2
-1
application-dev1.properties
...nalyse-biz/src/main/resources/application-dev1.properties
+2
-1
McbWarningMapper.xml
...pi/src/main/resources/mapper/warning/McbWarningMapper.xml
+27
-3
McbWarningMapper.java
...t/module/jxiop/biz/mcbwarningmapper/McbWarningMapper.java
+11
-3
McbWarningServiceImpl.java
.../module/jxiop/biz/service/impl/McbWarningServiceImpl.java
+4
-6
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TestController.java
View file @
56a84b52
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TdengineTimeServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.List
;
@RestController
@RequestMapping
(
value
=
"/test"
)
@Api
(
tags
=
"测试Api"
)
public
class
TestController
extends
BaseController
{
@Autowired
IndicatorDataMapper
indicatorDataMapper
;
@Autowired
CommonServiceImpl
commonService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"test1"
,
notes
=
"test1"
)
@GetMapping
(
"/test1"
)
public
List
<
IndicatorData
>
test1
(
@RequestParam
(
value
=
"startTime"
)
String
startTime
,
@RequestParam
(
value
=
"endTime"
)
String
endTime
,
@RequestParam
(
value
=
"address"
)
String
address
,
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
)
{
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectDataByAddressAndtime
(
address
,
startTime
,
endTime
,
gatewayId
);
return
indicatorData
;
}
@Autowired
IndicatorDataMapper
indicatorDataMapper
;
@Autowired
CommonServiceImpl
commonService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"test1"
,
notes
=
"test1"
)
@GetMapping
(
"/test1"
)
public
List
<
IndicatorData
>
test1
(
@RequestParam
(
value
=
"startTime"
)
String
startTime
,
@RequestParam
(
value
=
"endTime"
)
String
endTime
,
@RequestParam
(
value
=
"address"
)
String
address
,
@RequestParam
(
value
=
"gatewayId"
)
String
gatewayId
)
{
List
<
IndicatorData
>
indicatorData
=
indicatorDataMapper
.
selectDataByAddressAndtime
(
address
,
startTime
,
endTime
,
gatewayId
);
return
indicatorData
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"test2"
,
notes
=
"test1"
)
@GetMapping
(
"/test2"
)
public
void
test2
(
@RequestParam
(
value
=
"startTime"
)
String
startTime
,
@Param
(
"recDate"
)
String
recDate
)
{
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"test2"
,
notes
=
"test1"
)
@GetMapping
(
"/test2"
)
public
void
test2
(
@RequestParam
(
value
=
"startTime"
)
String
startTime
,
@Param
(
"recDate"
)
String
recDate
)
{
// List<FanHealthIndex> infoListByGroupByCD = fanHealthIndexMapper.getInfoListByGroupByCdFan(startTime, recDate);
// commonService.healthWarningMinuteByFJ();
// commonService.healthWarningMinuteByPv();
// return infoListByGroupByCD;
}
}
@Autowired
FanHealthIndexMapper
fanHealthIndexMapper
;
@Autowired
FanHealthIndexMapper
fanHealthIndexMapper
;
@Autowired
TdengineTimeServiceImpl
tdengineTimeService
;
@Autowired
TdengineTimeServiceImpl
tdengineTimeService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"saveTest"
,
notes
=
"saveTest"
)
@PostMapping
(
"/saveTest"
)
public
void
saveTest
()
{
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"saveTest"
,
notes
=
"saveTest"
)
@PostMapping
(
"/saveTest"
)
public
void
saveTest
()
{
// QueryWrapper<FanHealthIndex> fanHealthIndexQueryWrapper = new QueryWrapper<>();
// List<FanHealthIndex> fanHealthIndices = fanHealthIndexMapper.selectList(fanHealthIndexQueryWrapper);
...
...
@@ -107,6 +113,67 @@ public class TestController extends BaseController {
// list.add(fanHealthIndex);
//// commonService.healthWarningMinuteByFJ();
// fanHealthIndexMapper.saveBatchHealthIndexList(fanHealthIndices1, "fan_health_index_moment");
}
}
@Autowired
private
FanWaringRecordMapper
fanWaringRecordMapper
;
@Autowired
private
PvWaringRecordMapper
pvWaringRecordMapper
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"test2"
,
notes
=
"test1"
)
@GetMapping
(
"/clear-record"
)
public
void
clearRecord
(
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
String
startTime
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
d
=
sdf
.
format
(
new
Date
());
LambdaQueryWrapper
<
FanWarningRecord
>
wf
=
new
LambdaQueryWrapper
<>();
wf
.
ne
(
FanWarningRecord:
:
getDisposotionState
,
"已确认"
);
List
<
FanWarningRecord
>
list
=
fanWaringRecordMapper
.
selectList
(
wf
);
if
(!
list
.
isEmpty
())
{
list
.
forEach
(
i
->
{
i
.
setDisposotionState
(
"已确认"
);
i
.
setDisposotionDate
(
d
);
});
fanWaringRecordMapper
.
saveBatchWarningRecords
(
list
);
}
LambdaQueryWrapper
<
PvWarningRecord
>
pf
=
new
LambdaQueryWrapper
<>();
pf
.
ne
(
PvWarningRecord:
:
getDisposotionState
,
"已确认"
);
List
<
PvWarningRecord
>
list1
=
pvWaringRecordMapper
.
selectList
(
pf
);
if
(!
list1
.
isEmpty
())
{
list1
.
forEach
(
i
->
{
i
.
setDisposotionState
(
"已确认"
);
i
.
setDisposotionDate
(
d
);
});
pvWaringRecordMapper
.
saveBatchWarningRecords
(
list1
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"test2"
,
notes
=
"test1"
)
@GetMapping
(
"/set-date"
)
public
void
clearRecord
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
d
=
sdf
.
format
(
new
Date
());
LambdaQueryWrapper
<
FanWarningRecord
>
wf
=
new
LambdaQueryWrapper
<>();
wf
.
isNull
(
FanWarningRecord:
:
getDisposotionDate
);
List
<
FanWarningRecord
>
list
=
fanWaringRecordMapper
.
selectList
(
wf
);
if
(!
list
.
isEmpty
())
{
list
.
forEach
(
i
->
{
i
.
setDisposotionDate
(
d
);
});
fanWaringRecordMapper
.
saveBatchWarningRecords
(
list
);
}
LambdaQueryWrapper
<
PvWarningRecord
>
pf
=
new
LambdaQueryWrapper
<>();
pf
.
isNull
(
PvWarningRecord:
:
getDisposotionDate
);
List
<
PvWarningRecord
>
list1
=
pvWaringRecordMapper
.
selectList
(
pf
);
if
(!
list1
.
isEmpty
())
{
list1
.
forEach
(
i
->
{
i
.
setDisposotionDate
(
d
);
});
pvWaringRecordMapper
.
saveBatchWarningRecords
(
list1
);
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
56a84b52
...
...
@@ -2094,7 +2094,7 @@ public class CommonServiceImpl {
fanHealthIndex
.
setAnomaly
(
idxBizFanHealthIndex
.
getANOMALY
());
fanHealthIndex
.
setRecDate
(
DateUtil
.
now
());
fanHealthIndex
.
setArea
(
idxBizFanHealthIndex
.
getArae
());
fanHealthIndex
.
setAnalysisTime
(
DateUtil
.
now
()
);
fanHealthIndex
.
setAnalysisTime
(
format
);
fanHealthIndex
.
setHealthLevel
(
fanHealthIndex
.
getHealthLevel
());
fanHealthIndex
.
setKks
(
idxBizFanHealthIndex
.
getKks
());
fanHealthIndex
.
setRecDate
(
format
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HealthStatusIndicatorServiceImpl.java
View file @
56a84b52
...
...
@@ -2715,7 +2715,7 @@ public class HealthStatusIndicatorServiceImpl {
riskBizInfoVo
.
setSourceAttribution
(
stationMap
.
get
(
idxBizPvWarningRecord
.
getGatewayId
()).
getProjectOrgCode
());
riskBizInfoVo
.
setSourceAttributionDesc
(
idxBizPvWarningRecord
.
getStation
());
riskBizInfoVo
.
setWarningObjectType
(
"equip"
);
riskBizInfoVo
.
setWarningTime
(
DateUtil
.
now
());
riskBizInfoVo
.
setWarningTime
(
idxBizPvWarningRecord
.
getRecDate
());
riskBizInfoVo
.
setBussId
(
String
.
valueOf
(
idxBizPvWarningRecord
.
getTs
()));
riskBizInfoVo
.
setWarningObjectLinkUrl
(
getJumpUrlByInfo
(
idxBizPvWarningRecord
.
getKks
(),
jumpConfigs
));
List
<
RiskDynamicDetailsVo
>
detailsVos
=
new
ArrayList
<>();
...
...
@@ -2781,7 +2781,7 @@ public class HealthStatusIndicatorServiceImpl {
riskBizInfoVo
.
setSourceAttribution
(
stationMap
.
get
(
idxBizFanWarningRecord
.
getGatewayId
()).
getProjectOrgCode
());
riskBizInfoVo
.
setSourceAttributionDesc
(
idxBizFanWarningRecord
.
getStation
());
riskBizInfoVo
.
setWarningObjectType
(
"equip"
);
riskBizInfoVo
.
setWarningTime
(
DateUtil
.
now
());
riskBizInfoVo
.
setWarningTime
(
idxBizFanWarningRecord
.
getRecDate
());
riskBizInfoVo
.
setWarningObjectLinkUrl
(
getJumpUrlByInfo
(
idxBizFanWarningRecord
.
getKks
(),
jumpConfigs
));
List
<
RiskDynamicDetailsVo
>
detailsVos
=
new
ArrayList
<>();
RiskDynamicDetailsVo
dynamicDetailsVo
=
new
RiskDynamicDetailsVo
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/application-dev.properties
View file @
56a84b52
...
...
@@ -74,7 +74,8 @@ mqtt.client.product.id=mqtt
mqtt.topic
=
topic_mqtt
spring.mqtt.completionTimeout
=
3000
emqx.max-inflight
=
1000
emqx.client-user-name
=
admin
emqx.client-password
=
public
tdengine-server
:
driver-class-name
:
com.taosdata.jdbc.rs.RestfulDriver
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/application-dev1.properties
View file @
56a84b52
...
...
@@ -74,7 +74,8 @@ mqtt.client.product.id=mqtt
mqtt.topic
=
topic_mqtt
spring.mqtt.completionTimeout
=
3000
emqx.max-inflight
=
1000
emqx.client-user-name
=
admin
emqx.client-password
=
public
tdengine-server
:
driver-class-name
:
com.taosdata.jdbc.rs.RestfulDriver
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/warning/McbWarningMapper.xml
View file @
56a84b52
...
...
@@ -205,7 +205,7 @@
FROM
mcb_warning_question_info question,
mcb_warning_warning_info warning
<where>
where
question.NUM IS NOT NULL
AND question.NUM = warning.QUESTION_NUM
AND question.COMPLETION_STATUS != '1'
...
...
@@ -222,8 +222,32 @@
#{item}
</foreach>
</if>
</where>
ORDER BY question.CREATE_DATE DESC
ORDER BY question.CREATE_DATE DESC Limit #{offset}, #{size}
</select>
<select
id=
"overviewQuestionListTotal"
resultType=
"int"
>
SELECT
count(1)
FROM
mcb_warning_question_info question,
mcb_warning_warning_info warning
where
question.NUM IS NOT NULL
AND question.NUM = warning.QUESTION_NUM
AND question.COMPLETION_STATUS != '1'
AND warning.WARNING_SOURCE_TYPE in (select mcb_data_dictionary.name from mcb_data_dictionary WHERE mcb_data_dictionary.remark = 'OVERVIEW' )
<if
test=
"startTime != null and startTime != ''"
>
AND question.CREATE_DATE >= #{startTime}
</if>
<if
test=
"endTime != null and endTime != ''"
>
AND question.CREATE_DATE
<
= #{endTime}
</if>
<if
test=
"projectOrgCodes != null and projectOrgCodes.size() > 0"
>
AND question.SOURCE_ATTRIBUTION IN
<foreach
collection=
"projectOrgCodes"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</select>
<select
id=
"queryQuestionList"
resultType=
"java.util.Map"
>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mcbwarningmapper/McbWarningMapper.java
View file @
56a84b52
...
...
@@ -49,9 +49,17 @@ public interface McbWarningMapper extends BaseMapper {
List
<
OverviewQuestionDto
>
overviewQuestionList
(
@Param
(
"projectOrgCodes"
)
List
<
String
>
projectOrgCodes
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
Integer
offset
,
Integer
size
,
List
<
String
>
projectOrgCodes
,
String
startTime
,
String
endTime
);
Integer
overviewQuestionListTotal
(
List
<
String
>
projectOrgCodes
,
String
startTime
,
String
endTime
);
/**
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/McbWarningServiceImpl.java
View file @
56a84b52
...
...
@@ -104,15 +104,13 @@ public class McbWarningServiceImpl implements IMcbWarningService {
endTime
+=
" 23:59:59"
;
}
PageHelper
.
startPage
(
current
,
size
);
List
<
OverviewQuestionDto
>
list
=
mcbWarningMapper
.
overviewQuestionList
(
projectOrgCodes
,
startTime
,
endTime
);
PageInfo
<
OverviewQuestionDto
>
page
=
new
PageInfo
(
list
);
List
<
OverviewQuestionDto
>
list
=
mcbWarningMapper
.
overviewQuestionList
(
(
current
-
1
)
*
size
,
size
,
projectOrgCodes
,
startTime
,
endTime
);
Integer
total
=
mcbWarningMapper
.
overviewQuestionListTotal
(
projectOrgCodes
,
startTime
,
endTime
);
Page
<
OverviewQuestionDto
>
pagenew
=
new
Page
<>();
pagenew
.
setCurrent
(
current
);
pagenew
.
setTotal
(
page
.
getTotal
()
);
pagenew
.
setTotal
(
total
);
pagenew
.
setSize
(
size
);
pagenew
.
setRecords
(
page
.
getList
()
);
pagenew
.
setRecords
(
list
);
return
pagenew
;
}
...
...
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