feat(): 添加考评结束开关功能
parent
38711db39a
commit
e91eff9247
|
|
@ -0,0 +1,2 @@
|
|||
-- 考评组配置增加考评是否结束开关
|
||||
ALTER TABLE evaluation_corp ADD COLUMN evaluation_closed TINYINT DEFAULT 0 COMMENT '考评是否结束 0=未结束 1=已结束';
|
||||
|
|
@ -55,6 +55,13 @@ public class EvaluationConfigController {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("考评结束开关")
|
||||
@PostMapping("/toggleEvalClosed")
|
||||
public SingleResponse toggleEvalClosed(@RequestBody ToggleEvalClosedCmd cmd) {
|
||||
evaluationConfigService.toggleEvalClosed(cmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.alibaba.cola.exception.BizException;
|
|||
import com.zcloud.hidden.evaluation.domain.gateway.EvaluationCorpGateway;
|
||||
import com.zcloud.hidden.evaluation.domain.model.EvaluationCorpE;
|
||||
import com.zcloud.hidden.evaluation.dto.EvaluationCorpUpdateCmd;
|
||||
import com.zcloud.hidden.evaluation.dto.ToggleEvalClosedCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -30,5 +31,15 @@ public class EvaluationCorpUpdateExe {
|
|||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void toggleEvalClosed(ToggleEvalClosedCmd cmd) {
|
||||
EvaluationCorpE evaluationCorpE = new EvaluationCorpE();
|
||||
BeanUtils.copyProperties(cmd, evaluationCorpE);
|
||||
boolean res = evaluationCorpGateway.toggleEvalClosed(evaluationCorpE);
|
||||
if (!res) {
|
||||
throw new BizException("配置失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.zcloud.hidden.evaluation.api.EvaluationConfigServiceI;
|
|||
import com.zcloud.hidden.evaluation.command.EvaluationConfigAddExe;
|
||||
import com.zcloud.hidden.evaluation.command.EvaluationConfigRemoveExe;
|
||||
import com.zcloud.hidden.evaluation.command.EvaluationConfigUpdateExe;
|
||||
import com.zcloud.hidden.evaluation.command.EvaluationCorpUpdateExe;
|
||||
import com.zcloud.hidden.evaluation.command.query.EvaluationConfigQueryExe;
|
||||
import com.zcloud.hidden.evaluation.dto.*;
|
||||
import com.zcloud.hidden.evaluation.dto.clientobject.CorpEvaluationConfigCO;
|
||||
|
|
@ -29,6 +30,7 @@ public class EvaluationConfigServiceImpl implements EvaluationConfigServiceI {
|
|||
private final EvaluationConfigUpdateExe evaluationConfigUpdateExe;
|
||||
private final EvaluationConfigRemoveExe evaluationConfigRemoveExe;
|
||||
private final EvaluationConfigQueryExe evaluationConfigQueryExe;
|
||||
private final EvaluationCorpUpdateExe evaluationCorpUpdateExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<CorpEvaluationConfigCO> listPage(EvaluationConfigPageQry qry) {
|
||||
|
|
@ -67,5 +69,10 @@ public class EvaluationConfigServiceImpl implements EvaluationConfigServiceI {
|
|||
public void editBath(EvaluationConfigBathUpdateCmd evaluationConfigBathUpdateCmd) {
|
||||
evaluationConfigUpdateExe.editBath(evaluationConfigBathUpdateCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleEvalClosed(ToggleEvalClosedCmd cmd) {
|
||||
evaluationCorpUpdateExe.toggleEvalClosed(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,5 +29,7 @@ public interface EvaluationConfigServiceI {
|
|||
List<EvaluationConfigCO> listAll(EvaluationConfigQry qry);
|
||||
|
||||
void editBath(EvaluationConfigBathUpdateCmd evaluationConfigBathUpdateCmd);
|
||||
|
||||
void toggleEvalClosed(ToggleEvalClosedCmd cmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.zcloud.hidden.evaluation.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 考评结束开关命令
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2026-06-09
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ToggleEvalClosedCmd implements Serializable {
|
||||
@ApiModelProperty(value = "企业id", required = true)
|
||||
private Long corpinfoId;
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束(开始考评) 1=已结束(结束考评)", required = true)
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
|
@ -35,6 +35,9 @@ public class CorpEvalCO implements Serializable {
|
|||
private Integer exchangeScoreCount;
|
||||
@ApiModelProperty(value = "待兑换积分数")
|
||||
private Integer unExchangeScoreCount;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -34,5 +34,8 @@ public class CorpEvalStatisticsCO implements Serializable {
|
|||
private String safeEvaluationMember;
|
||||
@ApiModelProperty(value = "环保类考评组成员")
|
||||
private String envEvaluationMember;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ public class CorpEvaluationConfigCO implements Serializable {
|
|||
private String envEvaluationConfigStatus;
|
||||
@ApiModelProperty(value = "环保类考评组成员")
|
||||
private String envEvaluationMember;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,5 +67,8 @@ public class CorpHiddenStatisticsCO implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "考评组成员")
|
||||
private String evaluationMembers;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,11 @@ public interface EvaluationCorpGateway {
|
|||
*/
|
||||
Boolean update(EvaluationCorpE evaluationCorpE);
|
||||
|
||||
/**
|
||||
* 开关配置
|
||||
*/
|
||||
Boolean toggleEvalClosed(EvaluationCorpE evaluationCorpE);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -43,5 +43,7 @@ public class EvaluationCorpE extends BaseE {
|
|||
private Long orgId;
|
||||
//环境
|
||||
private String env;
|
||||
//考评是否结束 0=未结束(开始考评) 1=已结束(结束考评)
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,15 @@ public class EvaluationCorpGatewayImpl implements EvaluationCorpGateway {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean toggleEvalClosed(EvaluationCorpE evaluationCorpE) {
|
||||
evaluationCorpRepository.list().forEach(corp -> {
|
||||
corp.setEvaluationClosed(evaluationCorpE.getEvaluationClosed());
|
||||
evaluationCorpRepository.updateById(corp);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedEvaluationCorpById(Long id) {
|
||||
return evaluationCorpRepository.removeById(id);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ public class CorpEvalDO implements Serializable {
|
|||
private Integer exchangeScoreCount;
|
||||
@ApiModelProperty(value = "待兑换积分数")
|
||||
private Integer unExchangeScoreCount;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,5 +32,8 @@ public class CorpEvalStatisticsDO implements Serializable {
|
|||
private String safeEvaluationMember;
|
||||
@ApiModelProperty(value = "环保类考评组成员")
|
||||
private String envEvaluationMember;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ public class CorpEvaluationConfigDO implements Serializable {
|
|||
private String envEvaluationConfigStatus;
|
||||
@ApiModelProperty(value = "环保类考评组成员")
|
||||
private String envEvaluationMember;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,5 +64,8 @@ public class CorpHiddenStatisticsDO implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "考评组成员")
|
||||
private String evaluationMembers;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ public class EvaluationCorpDO extends BaseDO {
|
|||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
//考评是否结束 0=未结束 1=已结束
|
||||
@ApiModelProperty(value = "考评是否结束 0=未结束 1=已结束")
|
||||
private Integer evaluationClosed;
|
||||
|
||||
public EvaluationCorpDO(String evaluationCorpId) {
|
||||
this.evaluationCorpId = evaluationCorpId;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@
|
|||
CASE WHEN ec_safe.id IS NOT NULL THEN '已分配' ELSE '未分配' END AS safeEvaluationConfigStatus,
|
||||
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
|
||||
COALESCE(ec_env.members, '') AS envEvaluationMember,
|
||||
(SELECT e.evaluation_closed FROM evaluation_corp e WHERE e.delete_enum = 'FALSE' LIMIT 1) 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue