Commit 6ccef271 authored by 鲁鸿波's avatar 鲁鸿波

教育培训学时数报错问题修改

parent 7d53a617
...@@ -70,9 +70,9 @@ public class WeatherServiceImpl extends SuperServiceImpl<WeatherDao, WeatherDoma ...@@ -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)) { if (CollectionUtils.isEmpty(warnInfoVOList)) {
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -83,11 +83,11 @@ public class WeatherServiceImpl extends SuperServiceImpl<WeatherDao, WeatherDoma ...@@ -83,11 +83,11 @@ public class WeatherServiceImpl extends SuperServiceImpl<WeatherDao, WeatherDoma
//根据编码查询预警内容 //根据编码查询预警内容
String info = this.baseMapper.selectDirct(weatherWarnInfoVO.getCode()); String info = this.baseMapper.selectDirct(weatherWarnInfoVO.getCode());
//查询当前区县所在的市 //查询当前区县所在的市
/*String araInfo = getMessageInfo(weatherWarnInfoVO.getAreaCode()); String araInfo = getMessageInfo(weatherWarnInfoVO.getAreaCode());
String resultMessage = araInfo + "发布" + info;*/ String resultMessage = araInfo + "发布" + info;
//临时修改,培训使用 //临时修改,培训使用
String resultMessage =randomCity.getRandomCity()+ "发布" + info; //String resultMessage =randomCity.getRandomCity()+ "发布" + info;
weatherWarnInfoVO.setWarnMessage(resultMessage); weatherWarnInfoVO.setWarnMessage(resultMessage);
} }
} }
......
...@@ -200,7 +200,11 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist ...@@ -200,7 +200,11 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist
AtomicInteger sort = new AtomicInteger(1); AtomicInteger sort = new AtomicInteger(1);
String finalTrainTimeTotal = trainTimeTotal; String finalTrainTimeTotal = trainTimeTotal;
sortList.forEach(item -> { 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.setFanChartRatio(ratio);
item.setFanChartSort(sort.getAndIncrement()); item.setFanChartSort(sort.getAndIncrement());
}); });
...@@ -240,7 +244,8 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist ...@@ -240,7 +244,8 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist
String name = TrainTypeEnum.getName(fanChartKey); String name = TrainTypeEnum.getName(fanChartKey);
item.setFanChartKey(name); 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.setFanChartRatio(ratio);
item.setFanChartTotal(String.valueOf(total)); item.setFanChartTotal(String.valueOf(total));
}); });
...@@ -283,7 +288,8 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist ...@@ -283,7 +288,8 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist
statTotalVo.setProjectPersonCompleted(projectPersonCompleted.toString()); statTotalVo.setProjectPersonCompleted(projectPersonCompleted.toString());
// 完成率 // 完成率
int projectPersonTotal = Integer.parseInt(String.valueOf(total)); 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); statTotalVo.setProjectPersonCompletedRatio(chapterProgress);
} }
...@@ -363,9 +369,14 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist ...@@ -363,9 +369,14 @@ public class TrainProjectStatisticsAllServiceImpl implements TrainProjectStatist
* @param divisor 除数 * @param divisor 除数
* @return * @return
*/ */
public String getRatio(Integer dividend, Integer divisor) { /*public String getRatio(Integer dividend, Integer divisor) {
int percentage = (int) Math.round((double) dividend / divisor * 100); int percentage = (int) Math.round((double) dividend / divisor * 100);
return percentage + "%"; return percentage + "%";
}*/
public String getRatio(Double dividend, Double divisor) {
int percentage = (int) Math.round(dividend / divisor * 100);
return percentage + "%";
} }
......
...@@ -631,7 +631,7 @@ ...@@ -631,7 +631,7 @@
</select> </select>
<select id="findTrainTimeSumByOrgId" resultType="java.lang.String" databaseId="kingbase"> <select id="findTrainTimeSumByOrgId" resultType="java.lang.String" databaseId="kingbase">
SELECT 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 FROM
t_train_project p t_train_project p
LEFT JOIN LEFT JOIN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment