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
6ccef271
Commit
6ccef271
authored
Jun 19, 2025
by
鲁鸿波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
教育培训学时数报错问题修改
parent
7d53a617
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
+21
-10
WeatherServiceImpl.java
...com/testor/module/mq/service/impl/WeatherServiceImpl.java
+5
-5
TrainProjectStatisticsAllServiceImpl.java
...ct/service/impl/TrainProjectStatisticsAllServiceImpl.java
+15
-4
TTrainProject.xml
...src/main/resources/mapper/train/project/TTrainProject.xml
+1
-1
No files found.
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/mq/service/impl/WeatherServiceImpl.java
View file @
6ccef271
...
...
@@ -70,9 +70,9 @@ public class WeatherServiceImpl extends SuperServiceImpl<WeatherDao, WeatherDoma
}
//
List<WeatherWarnInfoVO> warnInfoVOList = this.baseMapper.getInfoByList(cityCodeList);
List
<
WeatherWarnInfoVO
>
warnInfoVOList
=
this
.
baseMapper
.
getInfoByList
(
cityCodeList
);
//临时修改,培训使用
List
<
WeatherWarnInfoVO
>
warnInfoVOList
=
this
.
baseMapper
.
getInfoByListTemp
(
cityCodeList
);
//
List<WeatherWarnInfoVO> warnInfoVOList = this.baseMapper.getInfoByListTemp(cityCodeList);
if
(
CollectionUtils
.
isEmpty
(
warnInfoVOList
))
{
return
new
ArrayList
<>();
}
...
...
@@ -83,11 +83,11 @@ public class WeatherServiceImpl extends SuperServiceImpl<WeatherDao, WeatherDoma
//根据编码查询预警内容
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
;
//
String resultMessage =randomCity.getRandomCity()+ "发布" + info;
weatherWarnInfoVO
.
setWarnMessage
(
resultMessage
);
}
}
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/project/service/impl/TrainProjectStatisticsAllServiceImpl.java
View file @
6ccef271
...
...
@@ -200,7 +200,11 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist
AtomicInteger
sort
=
new
AtomicInteger
(
1
);
String
finalTrainTimeTotal
=
trainTimeTotal
;
sortList
.
forEach
(
item
->
{
String
ratio
=
getRatio
(
Integer
.
valueOf
(
item
.
getFanChartValue
()),
Integer
.
valueOf
(
finalTrainTimeTotal
));
//String ratio = getRatio(Integer.valueOf(item.getFanChartValue()), Integer.valueOf(finalTrainTimeTotal));
String
ratio
=
getRatio
(
Double
.
parseDouble
(
item
.
getFanChartValue
()),
Double
.
parseDouble
(
finalTrainTimeTotal
)
);
item
.
setFanChartRatio
(
ratio
);
item
.
setFanChartSort
(
sort
.
getAndIncrement
());
});
...
...
@@ -240,7 +244,8 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist
String
name
=
TrainTypeEnum
.
getName
(
fanChartKey
);
item
.
setFanChartKey
(
name
);
}
String
ratio
=
getRatio
(
Integer
.
valueOf
(
item
.
getFanChartValue
()),
total
);
//String ratio = getRatio(Integer.valueOf(item.getFanChartValue()), total);
String
ratio
=
getRatio
(
Double
.
valueOf
(
item
.
getFanChartValue
()),
Double
.
valueOf
(
total
));
item
.
setFanChartRatio
(
ratio
);
item
.
setFanChartTotal
(
String
.
valueOf
(
total
));
});
...
...
@@ -283,7 +288,8 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist
statTotalVo
.
setProjectPersonCompleted
(
projectPersonCompleted
.
toString
());
// 完成率
int
projectPersonTotal
=
Integer
.
parseInt
(
String
.
valueOf
(
total
));
String
chapterProgress
=
getRatio
(
projectPersonCompleted
.
get
(),
projectPersonTotal
);
//String chapterProgress = getRatio(projectPersonCompleted.get(), projectPersonTotal);
String
chapterProgress
=
getRatio
(
Double
.
valueOf
(
projectPersonCompleted
.
get
()),
Double
.
valueOf
(
projectPersonTotal
));
statTotalVo
.
setProjectPersonCompletedRatio
(
chapterProgress
);
}
...
...
@@ -363,9 +369,14 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist
* @param divisor 除数
* @return
*/
public
String
getRatio
(
Integer
dividend
,
Integer
divisor
)
{
/*
public String getRatio(Integer dividend, Integer divisor) {
int percentage = (int) Math.round((double) dividend / divisor * 100);
return percentage + "%";
}*/
public
String
getRatio
(
Double
dividend
,
Double
divisor
)
{
int
percentage
=
(
int
)
Math
.
round
(
dividend
/
divisor
*
100
);
return
percentage
+
"%"
;
}
...
...
zlmy-modules/zlmy-boot/src/main/resources/mapper/train/project/TTrainProject.xml
View file @
6ccef271
...
...
@@ -631,7 +631,7 @@
</select>
<select
id=
"findTrainTimeSumByOrgId"
resultType=
"java.lang.String"
databaseId=
"kingbase"
>
SELECT
SUM(EXTRACT(EPOCH FROM AGE(p.visit_end_time, p.visit_start_time)) / 3600
) AS fanChartValue
ROUND(SUM(EXTRACT(EPOCH FROM AGE(p.visit_end_time, p.visit_start_time)) / 3600)
) AS fanChartValue
FROM
t_train_project p
LEFT JOIN
...
...
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