fuliqi
2024-07-31 f284c5ef6a1aa6e9ba5d4e94e4b2abe83b6ea18c
Merge remote-tracking branch 'origin/master'
4个文件已修改
54 ■■■■■ 已修改文件
ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java
@@ -8,11 +8,9 @@
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
import com.ycl.system.page.TableDataInfo;
import com.ycl.utils.poi.ExcelUtil;
import enumeration.BusinessType;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
@@ -44,6 +42,17 @@
    }
    /**
     * 查询考核积分折线图
     */
//    @PreAuthorize("@ss.hasPermi('check:score:chart')")
    @GetMapping("/chart")
    public AjaxResult selectCheckScoreChart(CheckScore checkScore)
    {
        Map<Long, List<CheckScore>> deptMap = checkScoreService.selectCheckScoreChart(checkScore);
        return success(deptMap);
    }
    /**
     * 区县详情列表
     */
//    @PreAuthorize("@ss.hasPermi('check:score:list')")
ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java
@@ -35,6 +35,14 @@
     */
    public Map<Long, List<CheckScore>> selectCheckScoreList(CheckScore checkScore);
    /**
     * 查询考核积分折线图数据
     *
     * @param checkScore 考核积分参数
     * @return 考核积分折线图
     */
    Map<Long, List<CheckScore>> selectCheckScoreChart(CheckScore checkScore);
    int publishCheckScore(CheckScoreDTO checkScoreDTO);
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -149,6 +149,34 @@
        return scoreMapper.selectCheckScoreMap(checkScore).stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
    }
    /**
     * 查询考核积分卡片列表
     *
     * @param checkScore 考核积分
     * @return 考核积分
     */
    @Override
    @DataScope(deptAlias = "d",userAlias = "u")
    public Map<Long, List<CheckScore>> selectCheckScoreChart(CheckScore checkScore)
    {
        //区县只能看已发布
        roleControl(checkScore);
        //查询成绩
        String date = checkScore.getDate();
        if(StringUtils.isEmpty(date)){
            //如果为空查本月的数据
            Calendar now = Calendar.getInstance();
            //取昨天
            now.add(Calendar.DATE, -1);
            Date yesterday = now.getTime();
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
            date = simpleDateFormat.format(yesterday);
            checkScore.setDate(date);
        }
        List<CheckScore> checkScores = scoreMapper.selectCheckScoreList(checkScore);
        return checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
    }
    /**
     * 区县详情
ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
@@ -119,9 +119,10 @@
        SELECT
            tcs.dept_id,
            examine_category,
            AVG(score) AS score,
            ROUND(AVG(score), 2) AS score,
            #{startDate} AS startDate,
            #{endDate} AS endDate
            #{endDate} AS endDate,
            ANY_VALUE(tcs.create_time) AS createTime
        FROM
            t_check_score tcs
                LEFT JOIN sys_dept d ON tcs.dept_id = d.dept_id