大屏评分bug修改
This commit is contained in:
parent
410e2be414
commit
7136eddf32
@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
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.worker.service.IEnterpriseInfoService;
|
||||||
import com.zhgd.xmgl.modules.xz.entity.vo.SafetyDetailTotalScoreVo;
|
import com.zhgd.xmgl.modules.xz.entity.vo.SafetyDetailTotalScoreVo;
|
||||||
import com.zhgd.xmgl.modules.xz.entity.vo.SafetyScoreDetail;
|
import com.zhgd.xmgl.modules.xz.entity.vo.SafetyScoreDetail;
|
||||||
@ -141,7 +140,7 @@ public class SafetyInspectionStandardBigScreenController {
|
|||||||
List<XzSecurityDangerTypeRecord> allTopTypes = xzSecurityDangerTypeRecordService.getTopTypes(topCodes);
|
List<XzSecurityDangerTypeRecord> allTopTypes = xzSecurityDangerTypeRecordService.getTopTypes(topCodes);
|
||||||
List<XzSecurityDangerTypeRecord> allTypeRecords = xzSecurityDangerTypeRecordService.list();
|
List<XzSecurityDangerTypeRecord> allTypeRecords = xzSecurityDangerTypeRecordService.list();
|
||||||
List<XzSecurityDangerItemRecord> allItemRecords = xzSecurityDangerItemRecordService.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));
|
Map<Integer, List<XzSecurityDangerTypeRecord>> tenTopTypes = allTopTypes.stream().collect(Collectors.groupingBy(XzSecurityDangerTypeRecord::getTenType));
|
||||||
for (Map.Entry<Integer, List<XzSecurityDangerTypeRecord>> tenEntry : tenTopTypes.entrySet()) {
|
for (Map.Entry<Integer, List<XzSecurityDangerTypeRecord>> tenEntry : tenTopTypes.entrySet()) {
|
||||||
Integer tenType = tenEntry.getKey();
|
Integer tenType = tenEntry.getKey();
|
||||||
@ -172,7 +171,7 @@ public class SafetyInspectionStandardBigScreenController {
|
|||||||
}
|
}
|
||||||
BigDecimal tScore;
|
BigDecimal tScore;
|
||||||
BigDecimal mustReduce = safetyScoreDetails.stream().filter(s -> Objects.equals(s.getProjectType(), 1)).map(s -> s.getScore()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
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) {
|
|| mustReduce.compareTo(new BigDecimal(40)) < 0) {
|
||||||
//保证项目中有一项未得分或保证项目小计得分不足40分,此分项检查评分表不应得分
|
//保证项目中有一项未得分或保证项目小计得分不足40分,此分项检查评分表不应得分
|
||||||
tScore = new BigDecimal(0);
|
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<XzSecurityDangerTypeRecord> typeRecords = xzSecurityDangerTypeRecordService.list(new LambdaQueryWrapper<XzSecurityDangerTypeRecord>().eq(XzSecurityDangerTypeRecord::getParentId, topType.getId()));
|
||||||
List<Long> typeIds = typeRecords.stream().map(XzSecurityDangerTypeRecord::getId).collect(Collectors.toList());
|
List<Long> typeIds = typeRecords.stream().map(XzSecurityDangerTypeRecord::getId).collect(Collectors.toList());
|
||||||
List<XzSecurityDangerItemRecord> itemRecords = xzSecurityDangerItemRecordService.list(new LambdaQueryWrapper<XzSecurityDangerItemRecord>().in(XzSecurityDangerItemRecord::getDangerTypeId, typeIds));
|
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<>();
|
List<SafetyScoreDetail> safetyScoreDetails = new ArrayList<>();
|
||||||
for (XzSecurityDangerTypeRecord typeRecord : typeRecords) {
|
for (XzSecurityDangerTypeRecord typeRecord : typeRecords) {
|
||||||
Long typeId = typeRecord.getId();
|
Long typeId = typeRecord.getId();
|
||||||
@ -250,7 +249,7 @@ public class SafetyInspectionStandardBigScreenController {
|
|||||||
}
|
}
|
||||||
BigDecimal tScore;
|
BigDecimal tScore;
|
||||||
BigDecimal mustReduce = safetyScoreDetails.stream().filter(s -> Objects.equals(s.getProjectType(), 1)).map(s -> s.getScore()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
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) {
|
|| mustReduce.compareTo(new BigDecimal(40)) < 0) {
|
||||||
//保证项目中有一项未得分或保证项目小计得分不足40分,此分项检查评分表不应得分
|
//保证项目中有一项未得分或保证项目小计得分不足40分,此分项检查评分表不应得分
|
||||||
tScore = BigDecimal.ZERO;
|
tScore = BigDecimal.ZERO;
|
||||||
|
|||||||
@ -273,9 +273,8 @@
|
|||||||
LEFT JOIN (SELECT quality_id,MAX(rectify_time) as rectify_time FROM xz_security_quality_rectify_record GROUP BY
|
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
|
quality_id) r ON r.quality_id = t.id
|
||||||
WHERE t.project_sn = #{param.projectSn}
|
WHERE t.project_sn = #{param.projectSn}
|
||||||
<if test="param.month != null and param.month != '' ">
|
<if test="param.endMonth != null and param.endMonth != '' ">
|
||||||
and t.inspect_time >= #{param.month}
|
and t.inspect_time <= concat(#{param.endMonth},'-31 23:59:59')
|
||||||
and t.inspect_time <= concat(#{param.month},'-31 23:59:59')
|
|
||||||
</if>
|
</if>
|
||||||
<if test="param.recordStatus == '8'.toString() ">
|
<if test="param.recordStatus == '8'.toString() ">
|
||||||
and t.status != 6
|
and t.status != 6
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user