Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
zlmy-cloud
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
zlmy
zlmy-cloud
Commits
7d53a617
Commit
7d53a617
authored
Jun 09, 2025
by
鲁鸿波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页天气修改(用户线下培训使用)
parent
126046a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
3 deletions
+46
-3
WeatherDao.java
...ot/src/main/java/com/testor/module/mq/dao/WeatherDao.java
+2
-0
WeatherServiceImpl.java
...com/testor/module/mq/service/impl/WeatherServiceImpl.java
+12
-3
RandomCity.java
...t/src/main/java/com/testor/module/mq/util/RandomCity.java
+25
-0
WeatherDao.xml
...les/zlmy-boot/src/main/resources/mapper/mq/WeatherDao.xml
+7
-0
No files found.
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/mq/dao/WeatherDao.java
View file @
7d53a617
...
...
@@ -11,6 +11,8 @@ import java.util.List;
public
interface
WeatherDao
extends
SuperDao
<
WeatherDomain
>
{
List
<
WeatherWarnInfoVO
>
getInfoByList
(
@Param
(
"list"
)
List
<
String
>
codeList
);
List
<
WeatherWarnInfoVO
>
getInfoByListTemp
(
@Param
(
"list"
)
List
<
String
>
codeList
);
String
selectDirct
(
@Param
(
"code"
)
String
code
);
/**
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/mq/service/impl/WeatherServiceImpl.java
View file @
7d53a617
...
...
@@ -17,6 +17,7 @@ import com.testor.module.mq.dao.WeatherDao;
import
com.testor.module.mq.domain.OrganizationEntity
;
import
com.testor.module.mq.domain.WeatherDomain
;
import
com.testor.module.mq.service.WeatherService
;
import
com.testor.module.mq.util.RandomCity
;
import
com.testor.module.mq.vo.WeatherDetailInfoVO
;
import
com.testor.module.mq.vo.WeatherWarnInfoVO
;
import
com.testor.module.sys.model.domian.NewSysOrg
;
...
...
@@ -68,17 +69,25 @@ public class WeatherServiceImpl extends SuperServiceImpl<WeatherDao, WeatherDoma
return
new
ArrayList
<>();
}
List
<
WeatherWarnInfoVO
>
warnInfoVOList
=
this
.
baseMapper
.
getInfoByList
(
cityCodeList
);
//List<WeatherWarnInfoVO> warnInfoVOList = this.baseMapper.getInfoByList(cityCodeList);
//临时修改,培训使用
List
<
WeatherWarnInfoVO
>
warnInfoVOList
=
this
.
baseMapper
.
getInfoByListTemp
(
cityCodeList
);
if
(
CollectionUtils
.
isEmpty
(
warnInfoVOList
))
{
return
new
ArrayList
<>();
}
RandomCity
randomCity
=
new
RandomCity
();
for
(
WeatherWarnInfoVO
weatherWarnInfoVO
:
warnInfoVOList
)
{
if
(
weatherWarnInfoVO
!=
null
){
//根据编码查询预警内容
String
info
=
this
.
baseMapper
.
selectDirct
(
weatherWarnInfoVO
.
getCode
());
//查询当前区县所在的市
String
araInfo
=
getMessageInfo
(
weatherWarnInfoVO
.
getAreaCode
());
String
resultMessage
=
araInfo
+
"发布"
+
info
;
/*String araInfo = getMessageInfo(weatherWarnInfoVO.getAreaCode());
String resultMessage = araInfo + "发布" + info;*/
//临时修改,培训使用
String
resultMessage
=
randomCity
.
getRandomCity
()+
"发布"
+
info
;
weatherWarnInfoVO
.
setWarnMessage
(
resultMessage
);
}
}
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/mq/util/RandomCity.java
0 → 100644
View file @
7d53a617
package
com
.
testor
.
module
.
mq
.
util
;
import
com.testor.module.mq.vo.WeatherWarnInfoVO
;
import
java.util.Random
;
public
class
RandomCity
{
// 在类中添加市名数组
private
static
final
String
[]
CITIES
=
{
"北京"
,
"上海"
,
"天津"
,
"重庆"
,
"石家庄"
,
"太原"
,
"呼和浩特"
,
"沈阳"
,
"长春"
,
"哈尔滨"
,
"南京"
,
"杭州"
,
"合肥"
,
"福州"
,
"南昌"
,
"济南"
,
"郑州"
,
"武汉"
,
"长沙"
,
"广州"
,
"南宁"
,
"海口"
,
"成都"
,
"贵阳"
,
"昆明"
,
"拉萨"
,
"西安"
,
"兰州"
,
"西宁"
,
"银川"
,
"乌鲁木齐"
};
// 添加随机市名生成方法
public
String
getRandomCity
()
{
Random
random
=
new
Random
();
return
CITIES
[
random
.
nextInt
(
CITIES
.
length
)];
}
}
zlmy-modules/zlmy-boot/src/main/resources/mapper/mq/WeatherDao.xml
View file @
7d53a617
...
...
@@ -18,6 +18,13 @@
order by record_time desc
</select>
<select
id=
"getInfoByListTemp"
parameterType=
"java.lang.String"
resultType=
"com.testor.module.mq.vo.WeatherWarnInfoVO"
>
select id, signal_type_code as code,record_time as warnTime,sender,signal_level_code as colorMsg,sender_area_code as
areaCode from t_weather_notice
order by record_time desc
limit 50
</select>
<select
id=
"selectDirct"
resultType=
"java.lang.String"
>
select message
...
...
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