From 58566970404520f7939f1c7b1c601de85af80971 Mon Sep 17 00:00:00 2001
From: zhangfeng <1603559716@qq.com>
Date: 星期一, 24 七月 2023 11:42:16 +0800
Subject: [PATCH] bug修改
---
src/main/java/com/gk/hotwork/Mapper/mybatis/InspectionHiddenDangerMapper.xml | 2 +-
src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java | 43 +++++++++++++++++++++----------------------
2 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/InspectionHiddenDangerMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/InspectionHiddenDangerMapper.xml
index a2eb5b0..cfbc11c 100644
--- a/src/main/java/com/gk/hotwork/Mapper/mybatis/InspectionHiddenDangerMapper.xml
+++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/InspectionHiddenDangerMapper.xml
@@ -31,7 +31,7 @@
and s.inspection_name like concat("%",#{params.inspectionName},"%")
</if>
<if test="params.checkedCompanyName != null and params.checkedCompanyName != ''">
- and h.checked_company_name like concat("%",#{params.checkedCompanyName},"%")
+ and s.checked_company_name like concat("%",#{params.checkedCompanyName},"%")
</if>
<if test="params.flag != null and params.flag != '' ">
and s.flag = #{params.flag}
diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java
index d6664fa..b8e40f0 100644
--- a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java
+++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java
@@ -79,17 +79,15 @@
if (CollectionUtils.isNotEmpty(records)){
DecimalFormat df = new DecimalFormat("0.00%");
records = records.stream().map((safetySelfInspection) -> {
- if (safetySelfInspection.getStatus() == 2) {
- Long id = safetySelfInspection.getId();
- SafetySelfInspectionItemQualifiedCountDO countDO = safetySelfInspectionItemMapper.countQualifiedDataById(id);
- safetySelfInspection.setUnqualifiedItem(countDO.getItemSum() - countDO.getQualifiedItem());
- if (countDO != null && countDO.getItemSum() != 0 && countDO.getItemSum() != null) {
- BigDecimal rate = new BigDecimal(countDO.getQualifiedItem())
- .divide(new BigDecimal(countDO.getItemSum()), 4, BigDecimal.ROUND_HALF_UP);
- String qualifiedRate = df.format(rate);
- safetySelfInspection.setQualifiedRate(qualifiedRate);
- safetySelfInspection.setItemSum(countDO.getItemSum());
- }
+ Long id = safetySelfInspection.getId();
+ SafetySelfInspectionItemQualifiedCountDO countDO = safetySelfInspectionItemMapper.countQualifiedDataById(id);
+ safetySelfInspection.setUnqualifiedItem(countDO.getItemSum() - countDO.getQualifiedItem());
+ if (countDO != null && countDO.getItemSum() != 0 && countDO.getItemSum() != null) {
+ BigDecimal rate = new BigDecimal(countDO.getQualifiedItem())
+ .divide(new BigDecimal(countDO.getItemSum()), 4, BigDecimal.ROUND_HALF_UP);
+ String qualifiedRate = df.format(rate);
+ safetySelfInspection.setQualifiedRate(qualifiedRate);
+ safetySelfInspection.setItemSum(countDO.getItemSum());
}
return safetySelfInspection;
}).collect(Collectors.toList());
@@ -123,17 +121,15 @@
if (CollectionUtils.isNotEmpty(records)){
DecimalFormat df = new DecimalFormat("0.00%");
records = records.stream().map((safetySelfInspection) -> {
- if (safetySelfInspection.getStatus() == 2) {
- Long id = safetySelfInspection.getId();
- SafetySelfInspectionItemQualifiedCountDO countDO = safetySelfInspectionItemMapper.countQualifiedDataById(id);
- safetySelfInspection.setUnqualifiedItem(countDO.getItemSum() - countDO.getQualifiedItem());
- if (countDO != null && countDO.getItemSum() != 0 && countDO.getItemSum() != null) {
- BigDecimal rate = new BigDecimal(countDO.getQualifiedItem())
- .divide(new BigDecimal(countDO.getItemSum()), 4, BigDecimal.ROUND_HALF_UP);
- String qualifiedRate = df.format(rate);
- safetySelfInspection.setQualifiedRate(qualifiedRate);
- safetySelfInspection.setItemSum(countDO.getItemSum());
- }
+ Long id = safetySelfInspection.getId();
+ SafetySelfInspectionItemQualifiedCountDO countDO = safetySelfInspectionItemMapper.countQualifiedDataById(id);
+ safetySelfInspection.setUnqualifiedItem(countDO.getItemSum() - countDO.getQualifiedItem());
+ if (countDO != null && countDO.getItemSum() != 0 && countDO.getItemSum() != null) {
+ BigDecimal rate = new BigDecimal(countDO.getQualifiedItem())
+ .divide(new BigDecimal(countDO.getItemSum()), 4, BigDecimal.ROUND_HALF_UP);
+ String qualifiedRate = df.format(rate);
+ safetySelfInspection.setQualifiedRate(qualifiedRate);
+ safetySelfInspection.setItemSum(countDO.getItemSum());
}
return safetySelfInspection;
}).collect(Collectors.toList());
@@ -324,6 +320,7 @@
* @param param
* @param user
*/
+ @Transactional
@Override
public void addSupervise(SafetySelfInspection param, UserInfo user) {
requiredSuperviseVerification(param);
@@ -459,6 +456,7 @@
/**
* @Description: 删除
*/
+ @Transactional
@Override
public void delOne(Long id, UserInfo user) {
selectVerification(id);
@@ -695,6 +693,7 @@
return safetySelfInspectionItem;
}
+ @Transactional
@Override
public void modItemInfo(SafetySelfInspectionItem param, UserInfo user) {
--
Gitblit v1.9.2