添加功能
This commit is contained in:
@@ -189,21 +189,14 @@ public class ModelUnemploymentWarningDiffusionServiceImpl implements ModelUnempl
|
||||
.map(ModelWarningIndicatorData::getDataValue).orElse(null))
|
||||
.build());
|
||||
}
|
||||
ModelResultIndicatorDataVo unemploymentRateData = ModelResultIndicatorDataVo.builder()
|
||||
.indicatorName("城镇调查失业率")
|
||||
.indicatorCode("syzb000")
|
||||
.indicatorType(1)
|
||||
.leadPeriod(1)
|
||||
.dataList(dataList)
|
||||
.build();
|
||||
|
||||
List<BigDecimal> unemploymentRateList = new ArrayList<>();
|
||||
for (ModelResultDataVo dataVo : unemploymentRateData.getDataList()) {
|
||||
for (ModelResultDataVo dataVo : dataList) {
|
||||
unemploymentRateList.add(dataVo.getValue());
|
||||
}
|
||||
vo.setUnemploymentRateList(unemploymentRateList);
|
||||
|
||||
List<BigDecimal> diffusionList = ModelIndicatorUtil.calculateDiffusion(result, null);
|
||||
List<BigDecimal> diffusionList = ModelIndicatorUtil.calculateDiffusion(result);
|
||||
vo.setDiffusionValueList(diffusionList);
|
||||
vo.setCurrentValue(diffusionList.get(diffusionList.size() - 1));
|
||||
|
||||
|
||||
@@ -171,16 +171,11 @@ public class ModelIndicatorUtil {
|
||||
* 失业预警扩散指数
|
||||
*
|
||||
* @param resultList 指标结果数据
|
||||
* @param unemploymentRateData 失业率数据
|
||||
* @return 计算结果
|
||||
*/
|
||||
public static List<BigDecimal> calculateDiffusion(Tuple2<List<String>, List<ModelResultIndicatorDataVo>> resultList,
|
||||
ModelResultIndicatorDataVo unemploymentRateData) {
|
||||
public static List<BigDecimal> calculateDiffusion(Tuple2<List<String>, List<ModelResultIndicatorDataVo>> resultList) {
|
||||
|
||||
List<ModelResultIndicatorDataVo> indicatorDataList = resultList.getT2();
|
||||
if (Objects.nonNull(unemploymentRateData)) {
|
||||
indicatorDataList.add(unemploymentRateData);
|
||||
}
|
||||
|
||||
int maxLeadPeriod = 0;
|
||||
// 计算各个警兆指标的景气值
|
||||
|
||||
Reference in New Issue
Block a user