zxl
10 小时以前 d3e36feef46d4b5d381333698977a5a913f18284
新问题
4个文件已修改
53 ■■■■ 已修改文件
ycl-common/src/main/java/enumeration/ConstructionTypeEnum.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/enumeration/ConstructionTypeEnum.java
@@ -11,11 +11,12 @@
 **/
@Getter
public enum ConstructionTypeEnum {
    PHASE_ONE_TWO("一二期"),
    PHASE_THREE("三期"),
    PHASE_FOURTH("四期"),
    CHECK_ENTER_SICHUAN("入川即检");
    PHASE_ONE_TWO("一二期"),//DX_
    PHASE_THREE("三期"),//LT
    PHASE_FOURTH("四期"),//DX_R\DX_RS
    CHECK_ENTER_SICHUAN("入川即检"),
    EASTERN_NEW_CITY("东部新城"),//DX_RD
    YAN_TAN_PHASE_TWO_FACE("沿滩二期人脸");//DX_R2
    private String desc;
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -42,6 +42,7 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.InetAddress;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
@@ -570,24 +571,33 @@
        dashboardQuery.setStartTime(format.format(DateUtils.getDayStart(now)));
        dashboardQuery.setEndTime(format.format(DateUtils.getDayEnd(now)));
        List<CheckScore> dashboard = scoreMapper.dashboard(dashboardQuery);
        DecimalFormat decimalFormat = new DecimalFormat("0.00%");
        // 设置四舍五入模式
        decimalFormat.setRoundingMode(RoundingMode.HALF_UP);
        //初始化各个区县数据
        Map<String, Map<String, Object>> resultMap = new HashMap<>();
        for (AreaDeptEnum value : AreaDeptEnum.values()) {
            Map<String, Object> map = new HashMap<>();
            map.put("video", 0);
            map.put("car", 0);
            map.put("face", 0);
            map.put("video", "0.00%");
            map.put("car","0.00%");
            map.put("face", "0.00%");
            resultMap.put(value.getName(), map);
        }
        //填充各个区县数据
        for (CheckScore checkScore : dashboard) {
            Map<String, Object> map = resultMap.get(checkScore.getDeptName());
            BigDecimal score = checkScore.getScore();
            // 核心逻辑:原始score ×10 → 保留两位小数 → 拼接百分号
            BigDecimal scoreMultiplied = score.multiply(new BigDecimal("10")); // 4.6160 ×10 = 46.160
            BigDecimal scoreWithTwoDecimals = scoreMultiplied.setScale(2, RoundingMode.HALF_UP); // 保留两位小数:46.16
            String formattedScore = scoreWithTwoDecimals + "%"; // 拼接百分号:46.16%
            if (CheckConstants.Rule_Category_Video.equals(checkScore.getExamineCategory())) {
                map.put("video", checkScore.getScore().setScale(1, RoundingMode.HALF_UP));
                map.put("video", formattedScore);
            } else if (CheckConstants.Rule_Category_Car.equals(checkScore.getExamineCategory())) {
                map.put("car", checkScore.getScore().setScale(1, RoundingMode.HALF_UP));
                map.put("car", formattedScore);
            } else if (CheckConstants.Rule_Category_Face.equals(checkScore.getExamineCategory())) {
                map.put("face", checkScore.getScore().setScale(1, RoundingMode.HALF_UP));
                map.put("face",formattedScore);
            }
            resultMap.put(checkScore.getDeptName(), map);
        }
ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java
@@ -258,6 +258,14 @@
    public Result page(ReportQuery query) {
        IPage<ReportVO> page = PageUtil.getPage(query, ReportVO.class);
        query.setUnitId(SecurityUtils.getUnitId());
        if (query.getReportTimeEnd() != null) {
            query.setReportTimeEnd(DateUtils.getDayEnd(query.getReportTimeEnd()));
        }
        if (query.getEffectTimeEnd() != null) {
            query.setEffectTimeEnd(DateUtils.getDayEnd(query.getEffectTimeEnd()));
        }
        baseMapper.page(page, query);
        List<SysDictData> errorTypeList = dictTypeService.selectDictDataByType("report_error_type");
        Map<String, String> dictMap = errorTypeList.stream().collect(Collectors.toMap(SysDictData::getDictValue, SysDictData::getDictLabel));
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -182,6 +182,12 @@
                        m.name LIKE 'DX_RS%'
                        )
                    </when>
                    <when test="constructionType == 'EASTERN_NEW_CITY'">
                        and m.name LIKE 'DX_RD%'
                    </when>
                    <when test="constructionType == 'YAN_TAN_PHASE_TWO_FACE'">
                        and m.name LIKE 'DX_R2%'
                    </when>
                </choose>
            </if>
@@ -450,6 +456,12 @@
                        m.name LIKE 'DX_RS%'
                        )
                    </when>
                    <when test="constructionType == 'EASTERN_NEW_CITY'">
                        and m.name LIKE 'DX_RD%'
                    </when>
                    <when test="constructionType == 'YAN_TAN_PHASE_TWO_FACE'">
                        and m.name LIKE 'DX_R2%'
                    </when>
                </choose>
            </if>
            ${params.dataScope}