大屏评分bug修改

This commit is contained in:
guoshengxiong 2024-08-01 17:32:12 +08:00
parent 410e2be414
commit 7136eddf32
2 changed files with 6 additions and 8 deletions

View File

@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Lists;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService;
import com.zhgd.xmgl.modules.xz.entity.vo.SafetyDetailTotalScoreVo;
import com.zhgd.xmgl.modules.xz.entity.vo.SafetyScoreDetail;
@ -141,7 +140,7 @@ public class SafetyInspectionStandardBigScreenController {
List<XzSecurityDangerTypeRecord> allTopTypes = xzSecurityDangerTypeRecordService.getTopTypes(topCodes);
List<XzSecurityDangerTypeRecord> allTypeRecords = xzSecurityDangerTypeRecordService.list();
List<XzSecurityDangerItemRecord> allItemRecords = xzSecurityDangerItemRecordService.list();
List<XzSecurityQualityInspectionRecordVo> inspectionRecords = xzSecurityQualityInspectionRecordService.selectQualityInspectionRecordPage(new MapBuilder<String, Object>().put("month", month).put("status", 60).put("projectSn", projectSn).put("pageSize",-1).build()).getPage().getRecords();
List<XzSecurityQualityInspectionRecordVo> inspectionRecords = xzSecurityQualityInspectionRecordService.selectQualityInspectionRecordPage(new MapBuilder<String, Object>().put("endMonth", month).put("status", 60).put("projectSn", projectSn).put("pageSize", -1).build()).getPage().getRecords();
Map<Integer, List<XzSecurityDangerTypeRecord>> tenTopTypes = allTopTypes.stream().collect(Collectors.groupingBy(XzSecurityDangerTypeRecord::getTenType));
for (Map.Entry<Integer, List<XzSecurityDangerTypeRecord>> tenEntry : tenTopTypes.entrySet()) {
Integer tenType = tenEntry.getKey();
@ -172,7 +171,7 @@ public class SafetyInspectionStandardBigScreenController {
}
BigDecimal tScore;
BigDecimal mustReduce = safetyScoreDetails.stream().filter(s -> Objects.equals(s.getProjectType(), 1)).map(s -> s.getScore()).reduce(BigDecimal.ZERO, BigDecimal::add);
if (safetyScoreDetails.stream().anyMatch(s -> s.getShouldScore().equals(new BigDecimal(0)))
if (safetyScoreDetails.stream().anyMatch(s -> s.getScore().compareTo(BigDecimal.ZERO) == 0)
|| mustReduce.compareTo(new BigDecimal(40)) < 0) {
//保证项目中有一项未得分或保证项目小计得分不足40分此分项检查评分表不应得分
tScore = new BigDecimal(0);
@ -228,7 +227,7 @@ public class SafetyInspectionStandardBigScreenController {
List<XzSecurityDangerTypeRecord> typeRecords = xzSecurityDangerTypeRecordService.list(new LambdaQueryWrapper<XzSecurityDangerTypeRecord>().eq(XzSecurityDangerTypeRecord::getParentId, topType.getId()));
List<Long> typeIds = typeRecords.stream().map(XzSecurityDangerTypeRecord::getId).collect(Collectors.toList());
List<XzSecurityDangerItemRecord> itemRecords = xzSecurityDangerItemRecordService.list(new LambdaQueryWrapper<XzSecurityDangerItemRecord>().in(XzSecurityDangerItemRecord::getDangerTypeId, typeIds));
List<XzSecurityQualityInspectionRecordVo> inspectionRecords = xzSecurityQualityInspectionRecordService.selectQualityInspectionRecordPage(new MapBuilder<String, Object>().put("month", month).put("status", 60).put("projectSn", projectSn).put("pageSize",-1).build()).getPage().getRecords();
List<XzSecurityQualityInspectionRecordVo> inspectionRecords = xzSecurityQualityInspectionRecordService.selectQualityInspectionRecordPage(new MapBuilder<String, Object>().put("endMonth", month).put("status", 60).put("projectSn", projectSn).put("pageSize", -1).build()).getPage().getRecords();
List<SafetyScoreDetail> safetyScoreDetails = new ArrayList<>();
for (XzSecurityDangerTypeRecord typeRecord : typeRecords) {
Long typeId = typeRecord.getId();
@ -250,7 +249,7 @@ public class SafetyInspectionStandardBigScreenController {
}
BigDecimal tScore;
BigDecimal mustReduce = safetyScoreDetails.stream().filter(s -> Objects.equals(s.getProjectType(), 1)).map(s -> s.getScore()).reduce(BigDecimal.ZERO, BigDecimal::add);
if (safetyScoreDetails.stream().anyMatch(s -> s.getShouldScore().equals(new BigDecimal(0)))
if (safetyScoreDetails.stream().anyMatch(s -> s.getScore().compareTo(BigDecimal.ZERO) == 0)
|| mustReduce.compareTo(new BigDecimal(40)) < 0) {
//保证项目中有一项未得分或保证项目小计得分不足40分此分项检查评分表不应得分
tScore = BigDecimal.ZERO;

View File

@ -273,9 +273,8 @@
LEFT JOIN (SELECT quality_id,MAX(rectify_time) as rectify_time FROM xz_security_quality_rectify_record GROUP BY
quality_id) r ON r.quality_id = t.id
WHERE t.project_sn = #{param.projectSn}
<if test="param.month != null and param.month != '' ">
and t.inspect_time >= #{param.month}
and t.inspect_time &lt;= concat(#{param.month},'-31 23:59:59')
<if test="param.endMonth != null and param.endMonth != '' ">
and t.inspect_time &lt;= concat(#{param.endMonth},'-31 23:59:59')
</if>
<if test="param.recordStatus == '8'.toString() ">
and t.status != 6