隐患考评调整
parent
35f8dcc70c
commit
503a107d9b
|
|
@ -12,6 +12,7 @@ import com.zcloud.hidden.evaluation.dto.*;
|
|||
import com.zcloud.hidden.evaluation.dto.clientobject.*;
|
||||
import com.zcloud.hidden.evaluation.persistence.dataobject.*;
|
||||
import com.zcloud.hidden.evaluation.persistence.repository.CorpInfoRepository;
|
||||
import com.zcloud.hidden.evaluation.persistence.repository.EvaluationConfigRepository;
|
||||
import com.zcloud.hidden.evaluation.persistence.repository.HiddenEvaluationRecordRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -35,7 +36,7 @@ import java.util.Map;
|
|||
public class HiddenEvaluationRecordQueryExe {
|
||||
private final HiddenEvaluationRecordRepository hiddenEvaluationRecordRepository;
|
||||
private final HiddenEvaluationRecordCoConvertor hiddenEvaluationRecordCoConvertor;
|
||||
private final CorpInfoRepository corpInfoRepository;
|
||||
private final EvaluationConfigRepository evaluationConfigRepository;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
|
|
@ -56,6 +57,14 @@ public class HiddenEvaluationRecordQueryExe {
|
|||
PageResponse<CorpHiddenStatisticsDO> pageResponse = hiddenEvaluationRecordRepository.corpHidddenPage(params);
|
||||
|
||||
List<CorpHiddenStatisticsCO> examCenterCOS =hiddenEvaluationRecordCoConvertor.converStatisticDOsToCOs(pageResponse.getData());
|
||||
//查找企业考评组成员数
|
||||
|
||||
/*
|
||||
//TODO 补充考评组成员
|
||||
examCenterCOS.forEach(co -> {
|
||||
co.setEvaluationMembers();
|
||||
});*/
|
||||
|
||||
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
WHERE ec.evaluation_type = 2
|
||||
GROUP BY ec.corpinfo_id) ec_env ON ci.id = ec_env.corpinfo_id
|
||||
WHERE ec.delete_enum = 'FALSE' and ci.delete_enum = 'FALSE'
|
||||
AND ci.type IN (0, 1, 6)
|
||||
AND ci.type IN (0, 1, 2, 6)
|
||||
AND ci.use_flag = 1
|
||||
<if test="params.corpinfoName != null and params.corpinfoName!='' ">
|
||||
AND ci.corp_name LIKE CONCAT('%', #{params.corpinfoName}, '%')
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
COUNT(DISTINCT CASE WHEN h.source = 1 THEN h.hidden_id END) as hazardReportTotalCount,
|
||||
COUNT(DISTINCT CASE WHEN h.source = 6 AND her.evaluation_result != 1 THEN h.hidden_id END) as fireCheckEvalCount,
|
||||
COUNT(DISTINCT CASE WHEN h.source = 6 THEN h.hidden_id END) as fireCheckTotalCount,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT CONCAT(d.name, '-', u.name)), '') AS evaluationMembers
|
||||
IFNULL(ec_all.evaluationMembers, '') AS evaluationMembers
|
||||
FROM evaluation_config ec
|
||||
left join evaluation_corp ecorp ON ecorp.corpinfo_id = ec.corpinfo_id AND ecorp.delete_enum = 'FALSE'
|
||||
LEFT JOIN corp_info ci ON ci.id = ec.corpinfo_id AND ci.delete_enum = 'FALSE'
|
||||
|
|
@ -52,7 +52,17 @@
|
|||
h.source NOT IN (4, 5)
|
||||
)
|
||||
LEFT JOIN hidden_evaluation_record her ON her.hidden_id = h.hidden_id AND her.delete_enum = 'FALSE'
|
||||
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
ec_all.corpinfo_id,
|
||||
ec_all.evaluation_type,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT CONCAT(d.name, '-', u.name)), '') AS evaluationMembers
|
||||
FROM evaluation_config ec_all
|
||||
LEFT JOIN department d ON d.id = ec_all.department_id AND d.delete_enum = 'FALSE'
|
||||
LEFT JOIN user u ON u.id = ec_all.user_id AND u.delete_enum = 'FALSE'
|
||||
WHERE ec_all.delete_enum = 'FALSE'
|
||||
GROUP BY ec_all.corpinfo_id, ec_all.evaluation_type
|
||||
) ec_all ON ec_all.corpinfo_id = ec.corpinfo_id AND ec_all.evaluation_type = ec.evaluation_type
|
||||
WHERE ec.delete_enum = 'FALSE'
|
||||
AND ci.delete_enum = 'FALSE'
|
||||
AND ci.type IN (0, 1, 6)
|
||||
|
|
@ -173,18 +183,18 @@
|
|||
<if test="params.evaluationResult != null and params.evaluationResult != ''">
|
||||
<choose>
|
||||
<!-- 查询 未完成:包含 her 不存在 或 her结果=1 -->
|
||||
<when test="params.evaluationResult == '1'">
|
||||
<when test="params.evaluationResult == 1">
|
||||
AND (
|
||||
her.id IS NULL
|
||||
OR her.evaluation_result = 1
|
||||
)
|
||||
</when>
|
||||
<!-- 查询 合格 -->
|
||||
<when test="params.evaluationResult == '2'">
|
||||
<when test="params.evaluationResult == 2">
|
||||
AND her.evaluation_result = 2
|
||||
</when>
|
||||
<!-- 查询 不合格 -->
|
||||
<when test="params.evaluationResult == '3'">
|
||||
<when test="params.evaluationResult == 3">
|
||||
AND her.evaluation_result = 3
|
||||
</when>
|
||||
</choose>
|
||||
|
|
@ -282,8 +292,8 @@
|
|||
AND configDept.id = #{params.departmentId}
|
||||
</if>
|
||||
|
||||
<if test="params.userName != null and params.userName != ''">
|
||||
AND configUser.name LIKE CONCAT('%', #{params.userName}, '%')
|
||||
<if test="params.evaluationUserName != null and params.evaluationUserName != ''">
|
||||
AND configUser.name LIKE CONCAT('%', #{params.evaluationUserName}, '%')
|
||||
</if>
|
||||
|
||||
GROUP BY ci.id, ci.corp_name
|
||||
|
|
@ -299,7 +309,7 @@
|
|||
u.department_id as departmentId,
|
||||
d.name AS departmentName,
|
||||
p.post_name AS postName,
|
||||
COUNT(DISTINCT CASE WHEN her.evaluation_result=2 THEN h.id END) AS totalScore,
|
||||
COUNT(DISTINCT CASE WHEN her.evaluation_result = 2 and her.exchange_flag = 1 THEN h.id END) AS totalScore,
|
||||
COUNT(DISTINCT CASE WHEN her.exchange_flag = 1 THEN h.id END) AS exchangedScore,
|
||||
COUNT(DISTINCT CASE WHEN her.exchange_flag = 0 and her.evaluation_result=2 THEN h.id END) AS notExchangedScore
|
||||
FROM evaluation_corp ecorp left join hidden h on ecorp.corpinfo_id = h.corp_id
|
||||
|
|
|
|||
Loading…
Reference in New Issue