Compare commits

...

2 Commits
main ... dev

10 changed files with 101 additions and 8 deletions

View File

@ -62,6 +62,12 @@ public class EvaluationConfigController {
return SingleResponse.buildSuccess();
}
@ApiOperation("查询考评结束状态")
@GetMapping("/getEvalClosedStatus")
public SingleResponse<Integer> getEvalClosedStatus() {
return SingleResponse.of(evaluationConfigService.getEvalClosedStatus());
}

View File

@ -41,5 +41,9 @@ public class EvaluationCorpUpdateExe {
throw new BizException("配置失败");
}
}
public Integer getEvalClosedStatus() {
return evaluationCorpGateway.getEvalClosedStatus();
}
}

View File

@ -74,5 +74,10 @@ public class EvaluationConfigServiceImpl implements EvaluationConfigServiceI {
public void toggleEvalClosed(ToggleEvalClosedCmd cmd) {
evaluationCorpUpdateExe.toggleEvalClosed(cmd);
}
@Override
public Integer getEvalClosedStatus() {
return evaluationCorpUpdateExe.getEvalClosedStatus();
}
}

View File

@ -31,5 +31,7 @@ public interface EvaluationConfigServiceI {
void editBath(EvaluationConfigBathUpdateCmd evaluationConfigBathUpdateCmd);
void toggleEvalClosed(ToggleEvalClosedCmd cmd);
Integer getEvalClosedStatus();
}

View File

@ -25,6 +25,11 @@ public interface EvaluationCorpGateway {
*/
Boolean toggleEvalClosed(EvaluationCorpE evaluationCorpE);
/**
*
*/
Integer getEvalClosedStatus();
/**
*
*/

View File

@ -11,6 +11,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* web-infrastructure
@ -51,6 +52,16 @@ public class EvaluationCorpGatewayImpl implements EvaluationCorpGateway {
return true;
}
@Override
public Integer getEvalClosedStatus() {
List<EvaluationCorpDO> list = evaluationCorpRepository.list();
if (list.isEmpty()) {
return 0;
}
Integer closed = list.get(0).getEvaluationClosed();
return closed != null ? closed : 0;
}
@Override
public Boolean deletedEvaluationCorpById(Long id) {
return evaluationCorpRepository.removeById(id);

View File

@ -19,7 +19,6 @@ import java.util.Map;
@DataScopes({
@DataScope(method = "corpHidddenPage", menuPerms = ""),
@DataScope(method = "corpEvalStatisticsPage", menuPerms = ""),
@DataScope(method = "userEvalStatisticsPage", menuPerms = ""),
@DataScope(method = "corpEvalPage", menuPerms = ""),
})
public interface HiddenEvaluationRecordMapper extends BaseMapper<HiddenEvaluationRecordDO> {
@ -32,6 +31,8 @@ public interface HiddenEvaluationRecordMapper extends BaseMapper<HiddenEvaluatio
IPage<UserEvalStatisticsDO> userEvalStatisticsPage(IPage<UserEvalStatisticsDO> iPage, Map<String, Object> params, String menuPerms);
Long userEvalStatisticsPageCount(Map<String, Object> params, String menuPerms);
IPage<HiddenEvalDO> hiddenEvalPage(IPage<HiddenEvalDO> iPage, Map<String, Object> params);
IPage<CorpEvalDO> corpEvalPage(IPage<CorpEvalDO> iPage, Map<String, Object> params, String menuPerms);

View File

@ -80,13 +80,14 @@ public class HiddenEvaluationRecordRepositoryImpl extends BaseRepositoryImpl<Hid
@Override
public PageResponse<UserEvalStatisticsDO> userEvalStatisticsPage(Map<String, Object> params) {
IPage<UserEvalStatisticsDO> iPage = new Query<UserEvalStatisticsDO>().getPage(params);
((com.baomidou.mybatisplus.extension.plugins.pagination.Page<?>) iPage).setSearchCount(false);
String menuPerms = "";
if (!org.springframework.util.ObjectUtils.isEmpty(params.get("menuPath"))){
menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString());
}
// 关闭 count SQL 优化,因为该查询包含派生表子查询 + CROSS JOIN 等复杂结构JSQLParser 无法解析
((com.baomidou.mybatisplus.extension.plugins.pagination.Page<?>) iPage).setOptimizeCountSql(false);
IPage<UserEvalStatisticsDO> result = hiddenEvaluationRecordMapper.userEvalStatisticsPage(iPage, params,menuPerms);
IPage<UserEvalStatisticsDO> result = hiddenEvaluationRecordMapper.userEvalStatisticsPage(iPage, params, menuPerms);
Long total = hiddenEvaluationRecordMapper.userEvalStatisticsPageCount(params, menuPerms);
result.setTotal(total != null ? total : 0);
return PageHelper.pageToResponse(result, result.getRecords());
}

View File

@ -11,7 +11,7 @@
COALESCE(ec_safe.members, '') AS safeEvaluationMember,
CASE WHEN ec_env.id IS NOT NULL THEN '已分配' ELSE '未分配' END AS envEvaluationConfigStatus,
COALESCE(ec_env.members, '') AS envEvaluationMember,
(SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1) AS evaluationClosed
COALESCE((SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1), 0) AS evaluationClosed
FROM evaluation_corp ec left join corp_info ci on ec.corpinfo_id = ci.id
LEFT JOIN (SELECT ec.id,ec.corpinfo_id,
GROUP_CONCAT(CONCAT(d.name, '-', u.name) SEPARATOR ',') AS members

View File

@ -62,7 +62,7 @@
COUNT(DISTINCT CASE WHEN h.source = 7 AND her.evaluation_result != 1 THEN h.hidden_id END) as videoPatrolEvalCount,
COUNT(DISTINCT CASE WHEN h.source = 7 THEN h.hidden_id END) as videoPatrolTotalCount,
IFNULL(ec_all.evaluationMembers, '') AS evaluationMembers,
(SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1) AS evaluationClosed
COALESCE((SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1), 0) AS evaluationClosed
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'
@ -303,7 +303,7 @@
WHERE ec.corpinfo_id = ci.id
AND ec.delete_enum = 'FALSE'
AND ec.evaluation_type = 2) AS envEvaluationMember,
(SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1) AS evaluationClosed
COALESCE((SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1), 0) AS evaluationClosed
FROM corp_info ci
LEFT JOIN user hu ON hu.corpinfo_id = ci.id
LEFT JOIN hidden h ON hu.id = h.creator_id AND h.delete_enum = 'FALSE' AND h.state = 301 AND
@ -437,6 +437,64 @@
ORDER BY userId ASC
</select>
<select id="userEvalStatisticsPageCount" resultType="java.lang.Long">
SELECT COUNT(*) FROM (
SELECT u.id
FROM user u
LEFT JOIN hidden h ON h.creator_id = u.id
AND h.delete_enum = 'FALSE'
AND h.state = 301
AND ((h.source IN (4,5) AND h.final_check = 1) OR h.source NOT IN (4,5))
AND h.hidden_type IN ('aqyh','rdbaqys','wzcz','wzzh','grfhyp','wdbaqzt','jxsb','hcl','dqsb','gsj','aqbhzz','ss','xf','tzsb','hjdbaqys','zmjdgyxbj','aqbzbs','gkkd','zykjxzzl','eltq','gldqx','wzdhzdlsbdw','wfacs','jypx','aqyh-qt')
WHERE u.delete_enum = 'FALSE'
AND h.id IS NOT NULL
<if test="params.corpinfoId != null">
AND u.corpinfo_id = #{params.corpinfoId}
</if>
<if test="params.departmentId != null ">
AND u.department_id = #{params.departmentId}
</if>
<if test="params.userName != null and params.userName != ''">
AND u.name LIKE CONCAT('%', #{params.userName}, '%')
</if>
<if test="params.userIdList != null and params.userIdList.size() > 0">
AND u.id IN
<foreach collection="params.userIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY u.id
UNION ALL
SELECT u.id
FROM user u
LEFT JOIN hidden h ON h.creator_id = u.id
AND h.delete_enum = 'FALSE'
AND h.state = 301
AND ((h.source IN (4,5) AND h.final_check = 1) OR h.source NOT IN (4,5))
AND h.hidden_type IN ('wshb','hjwr','ws','dq','zs','gf','hjwsjlh','yqfk','wshb-qt')
WHERE u.delete_enum = 'FALSE'
AND h.id IS NOT NULL
<if test="params.corpinfoId != null">
AND u.corpinfo_id = #{params.corpinfoId}
</if>
<if test="params.departmentId != null ">
AND u.department_id = #{params.departmentId}
</if>
<if test="params.userName != null and params.userName != ''">
AND u.name LIKE CONCAT('%', #{params.userName}, '%')
</if>
<if test="params.userIdList != null and params.userIdList.size() > 0">
AND u.id IN
<foreach collection="params.userIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY u.id
) total_count
</select>
<select id="hiddenEvalPage" resultType="com.zcloud.hidden.evaluation.persistence.dataobject.HiddenEvalDO">
select h.source,
h.hidden_id AS hiddenId,
@ -534,7 +592,7 @@
COUNT(DISTINCT CASE
WHEN her.evaluation_result = 2 AND her.exchange_flag = 0 AND u.corpinfo_id = ecorp.corpinfo_id
THEN h.id END) AS unExchangeScoreCount,
(SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1) AS evaluationClosed
COALESCE((SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1), 0) AS evaluationClosed
FROM evaluation_corp ecorp
LEFT JOIN evaluation_config ec on ecorp.corpinfo_id = ec.corpinfo_id AND ecorp.delete_enum = 'FALSE'
LEFT JOIN corp_info ci