fuliqi
2024-09-18 e34234a332da0663c6207a383becb39b253a8d05
积分接口
6个文件已修改
57 ■■■■■ 已修改文件
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/controller/DashboardController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java
@@ -35,7 +35,8 @@
    /** deptid */
    @Excel(name = "区县")
    private Long deptId;
    @TableField(exist = false)
    private String deptName;
    /** 考核模板id */
    @Excel(name = "考核模板id")
    private Integer templateId;
ycl-server/src/main/java/com/ycl/platform/controller/DashboardController.java
@@ -27,6 +27,7 @@
    private final ICheckIndexFaceService checkIndexFaceService;
    private final ICheckIndexCarService checkIndexCarService;
    private final ICheckIndexVideoService checkIndexVideoService;
    private final ICheckScoreService checkScoreService;
    @GetMapping("/department")
    public AjaxResult department() {
@@ -68,4 +69,8 @@
        return AjaxResult.success(checkIndexVideoService.dashboard(dashboardQuery));
    }
    @GetMapping("/check/score")
    public AjaxResult checkScore(DashboardQuery dashboardQuery) {
        return AjaxResult.success(checkScoreService.dashboard(dashboardQuery));
    }
}
ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java
@@ -5,6 +5,7 @@
import com.ycl.platform.domain.dto.CheckScoreDTO;
import com.ycl.platform.domain.dto.ScoreIndexDTO;
import com.ycl.platform.domain.entity.CheckScore;
import com.ycl.platform.domain.query.DashboardQuery;
import enumeration.OperationType;
import java.util.Date;
@@ -92,4 +93,6 @@
    List<Map<String, Object>> calculate(Date startDate, Date endDate, String category);
    CheckScore getLast(CheckScore checkScore);
    List<CheckScore> dashboard(DashboardQuery dashboardQuery);
}
ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java
@@ -5,6 +5,7 @@
import com.ycl.platform.domain.dto.CheckScoreDTO;
import com.ycl.platform.domain.dto.CheckScoreIndexDTO;
import com.ycl.platform.domain.entity.CheckScore;
import com.ycl.platform.domain.query.DashboardQuery;
import com.ycl.platform.domain.vo.CheckScoreDetailVO;
import jakarta.servlet.http.HttpServletResponse;
@@ -63,6 +64,8 @@
     * @return 核算
     */
    List<Map<String, Object>> calculate(String category);
    Map<String, List<Map<String, Object>>> dashboard(DashboardQuery dashboardQuery);
//    /**
//     * 新增考核积分明细
//     *
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -10,6 +10,7 @@
import com.ycl.platform.domain.dto.CheckScoreIndexDTO;
import com.ycl.platform.domain.dto.ScoreIndexDTO;
import com.ycl.platform.domain.entity.*;
import com.ycl.platform.domain.query.DashboardQuery;
import com.ycl.platform.domain.vo.*;
import com.ycl.platform.mapper.CheckRuleMapper;
import com.ycl.platform.mapper.CheckScoreMapper;
@@ -174,8 +175,8 @@
            }
        }
        //分数保留一位小数
        checkScores.stream().forEach(item ->item.setScore(item.getScore().setScale(1,RoundingMode.HALF_UP)));
        return  checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
        checkScores.stream().forEach(item -> item.setScore(item.getScore().setScale(1, RoundingMode.HALF_UP)));
        return checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
    }
    private void getCheckScore(CheckScore checkScore, Calendar calendar) {
@@ -220,7 +221,7 @@
        }
        List<CheckScore> checkScores = scoreMapper.selectCheckScoreList(checkScore);
        //分数保留一位小数
        checkScores.stream().forEach(item ->item.setScore(item.getScore().setScale(1,RoundingMode.HALF_UP)));
        checkScores.stream().forEach(item -> item.setScore(item.getScore().setScale(1, RoundingMode.HALF_UP)));
        return checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
    }
@@ -236,7 +237,7 @@
        //区县只能看已发布
        roleControl(checkScore);
        List<CheckScore> scoreList = scoreMapper.selectCheckScoreList(checkScore);
        scoreList.stream().forEach(item ->item.setScore(item.getScore().setScale(1,RoundingMode.HALF_UP)));
        scoreList.stream().forEach(item -> item.setScore(item.getScore().setScale(1, RoundingMode.HALF_UP)));
        return scoreList;
    }
@@ -506,6 +507,28 @@
        return scoreMapper.calculate(startDate, endDate, category);
    }
    //大屏展示考核得分
    @Override
    //TODO:考虑limit bug
    public Map<String, List<Map<String, Object>>> dashboard(DashboardQuery dashboardQuery) {
        List<CheckScore> dashboard = scoreMapper.dashboard(dashboardQuery);
        Map<String, List<Map<String, Object>>> resultMap = new HashMap<>();
        for (CheckScore checkScore : dashboard) {
            List<Map<String, Object>> list = new ArrayList<>();
            Map<String, Object> map = new HashMap<>();
            map.put("value",checkScore.getScore());
            if(dashboardQuery.getDataScope() ==1) {
                map.put("name", "省厅得分");
            }else {
                map.put("name", "区县得分");
            }
            list.add(map);
            resultMap.put(checkScore.getDeptName(),list );
        }
        return resultMap;
    }
    //    /**
//     * 新增考核积分
//     *
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
@@ -206,4 +206,16 @@
        ORDER BY score DESC, tcs.dept_id
    </select>
    <select id="dashboard" resultType="com.ycl.platform.domain.entity.CheckScore">
        select s.*,d.area as deptName from t_check_score s
        left join sys_dept d on s.dept_id = d.dept_id
        <where>
            <if test="dataScope == 1">
                AND s.examine_tag = 1
            </if>
        </where>
        ORDER BY
        s.create_time DESC
        LIMIT 7
    </select>
</mapper>