Commit 2f2818845ac355585f6b55f05fb1ae1eee79e959
1 parent
9018197b
feature(bug): 条件阶梯百分数处理
条件阶梯百分数处理
Showing
3 changed files
with
23 additions
and
5 deletions
fw-morax-dao/src/main/java/cn/fw/morax/dao/kpi/KpiGroupIndicatorPreconditionDao.java
... | ... | @@ -22,6 +22,8 @@ import java.util.List; |
22 | 22 | public interface KpiGroupIndicatorPreconditionDao extends BaseMapper<KpiGroupIndicatorPrecondition> { |
23 | 23 | |
24 | 24 | |
25 | + List<KpiGroupIndicatorPreconditionVO> getVos(@Param("kpiGroupId") Long kpiGroupId); | |
26 | + | |
25 | 27 | List<KpiGroupIndicatorPreconditionVO> getHitVos(@Param("kpiGroupIndicatorId") Long kpiGroupIndicatorId, |
26 | 28 | @Param("userId") Long userId, |
27 | 29 | @Param("dataDate") LocalDate dataDate); | ... | ... |
fw-morax-dao/src/main/resources/mapper/kpi/KpiGroupIndicatorPreconditionDao.xml
... | ... | @@ -18,6 +18,26 @@ |
18 | 18 | <result column="update_time" property="updateTime"/> |
19 | 19 | </resultMap> |
20 | 20 | |
21 | + <select id="getVos" resultType="cn.fw.morax.domain.vo.kpi.KpiGroupIndicatorPreconditionVO"> | |
22 | + SELECT | |
23 | + t1.`id` AS `id`, | |
24 | + t1.`kpi_group_id` AS `kpiGroupId`, | |
25 | + t1.`kpi_group_indicator_id` AS `kpiGroupIndicatorId`, | |
26 | + t1.`indicator_code` AS `indicatorCode`, | |
27 | + t1.`indicator_name` AS `indicatorName`, | |
28 | + t1.`target_calc_type` AS `targetCalcType`, | |
29 | + t1.`target_type` AS `targetType`, | |
30 | + t1.`target_value` AS `targetValue`, | |
31 | + t1.`sort` AS `sort`, | |
32 | + t3.`data_type` AS `dataType` | |
33 | + FROM | |
34 | + kpi_group_indicator_precondition t1 | |
35 | + LEFT JOIN indicators t3 ON t3.indicator_code = t1.indicator_code AND t3.yn = 1 | |
36 | + WHERE | |
37 | + t1.yn = 1 | |
38 | + AND t1.kpi_group_id = #{kpiGroupId} | |
39 | + </select> | |
40 | + | |
21 | 41 | <select id="getHitVos" resultType="cn.fw.morax.domain.vo.kpi.KpiGroupIndicatorPreconditionVO"> |
22 | 42 | SELECT |
23 | 43 | t1.`id` AS `id`, | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/data/kpi/impl/KpiGroupIndicatorPreconditionServiceImpl.java
... | ... | @@ -30,12 +30,8 @@ public class KpiGroupIndicatorPreconditionServiceImpl extends ServiceImpl<KpiGro |
30 | 30 | |
31 | 31 | @Override |
32 | 32 | public Map<Long, List<KpiGroupIndicatorPreconditionVO>> getKpiGroupIndicatorCondVO(Long kpiGroupId) { |
33 | - List<KpiGroupIndicatorPrecondition> preconditions = this.list(Wrappers.<KpiGroupIndicatorPrecondition>lambdaQuery() | |
34 | - .eq(KpiGroupIndicatorPrecondition::getKpiGroupId, kpiGroupId) | |
35 | - .eq(KpiGroupIndicatorPrecondition::getYn, Boolean.TRUE) | |
36 | - ); | |
33 | + List<KpiGroupIndicatorPreconditionVO> preconditionVOS = this.baseMapper.getVos(kpiGroupId); | |
37 | 34 | |
38 | - List<KpiGroupIndicatorPreconditionVO> preconditionVOS = PublicUtil.copyList(preconditions, KpiGroupIndicatorPreconditionVO.class); | |
39 | 35 | preconditionVOS.stream().forEach(KpiGroupIndicatorPreconditionVO::processPercent); |
40 | 36 | |
41 | 37 | Map<Long, List<KpiGroupIndicatorPreconditionVO>> indicatorCondMap = preconditionVOS.stream() | ... | ... |