Commit cca07abf by guojuxing

平台规则编辑修复

parent 0cf3ba55
......@@ -62,7 +62,7 @@ public class ConfigRuleApiServiceImpl implements ConfigRuleApiService {
@Override
public ServiceResponse<Integer> editRule(RuleDTO dto) {
TabConfigRule record = configRuleService.getByRuleId(dto.getParentRuleId());
TabConfigRule record = configRuleService.getByRuleId(dto.getRuleId());
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "规则ID错误,规则不存在");
}
......
......@@ -114,7 +114,7 @@
</select>
<select id="listRule" resultType="com.gic.enterprise.dto.rule.RuleEnterpriseDTO">
select t1.rule_name ruleName, count(DISTINCT t2.enterprise_id) countEnterpriseId
select t1.enterprise_rule_id enterpriseRuleId, t1.rule_name ruleName, count(DISTINCT t2.enterprise_id) countEnterpriseId
from tab_config_rule_enterprise t1
left join tab_config_rule_enterprise_rel t2 on t1.enterprise_rule_id = t2.enterprise_rule_id
<if test="search != null and search != '' ">
......
......@@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.gic.enterprise.error.ErrorCode;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -150,11 +151,17 @@ public class ConfigRuleController {
*/
@RequestMapping("/saveEnterpriseRule")
public RestResponse saveEnterpriseRule(RuleEnterpriseDTO dto) {
if (dto.getEnterpriseRuleId() != null) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "规则ID有值");
}
return ResultControllerUtils.commonResult(configRuleEnterpriseApiService.save(dto));
}
@RequestMapping("/editEnterpriseRule")
public RestResponse editEnterpriseRule(RuleEnterpriseDTO dto) {
if (dto.getEnterpriseRuleId() == null) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "规则ID不能为空");
}
return ResultControllerUtils.commonResult(configRuleEnterpriseApiService.edit(dto));
}
......
......@@ -16,4 +16,9 @@ public class EnterpriseRuleVO implements Serializable{
* 规则名称
*/
private String ruleName;
/**
*
*/
private Integer enterpriseRuleId;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment