mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
新增系统基础配置修改状态后操作方法
This commit is contained in:
+6
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.system.controller.admin.systemconfig.vo;
|
||||
|
||||
import com.cf.imes.module.system.validation.common.CommonStatus;
|
||||
import com.cf.imes.module.system.validation.config.SystemConfigTypeEnumValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -23,4 +24,9 @@ public class ConfigUpdateStatusReqVO {
|
||||
@NotNull(message = "状态不能为空")
|
||||
@CommonStatus
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "配置类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "配置类型不能为空")
|
||||
@SystemConfigTypeEnumValid
|
||||
private Integer type;
|
||||
}
|
||||
|
||||
+5
-1
@@ -97,11 +97,15 @@ public class SystemConfigServiceImpl implements SystemConfigService {
|
||||
|
||||
@Override
|
||||
public void updateStatus(ConfigUpdateStatusReqVO reqVO) {
|
||||
// 根据配置类型选择对应的service
|
||||
AbstractSystemConfigGenerateService configService = configServiceFactory.getConfigService(reqVO.getType());
|
||||
Long id = reqVO.getId();
|
||||
// 校验存在
|
||||
validateSystemConfigExists(id);
|
||||
SystemConfigDO systemConfigDO = validateSystemConfigExists(id);
|
||||
// 更新状态
|
||||
systemConfigMapper.update(new LambdaUpdateWrapper<SystemConfigDO>().eq(SystemConfigDO::getId, id).set(SystemConfigDO::getStatus, reqVO.getStatus()));
|
||||
// 更新状态后操作
|
||||
configService.afterUpdateStatus(systemConfigDO, reqVO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+10
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.system.service.config.factory.service;
|
||||
|
||||
import com.cf.imes.module.system.controller.admin.systemconfig.vo.ConfigSaveReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.systemconfig.vo.ConfigUpdateStatusReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.systemconfig.SystemConfigDO;
|
||||
|
||||
/**
|
||||
@@ -29,7 +30,16 @@ public abstract class AbstractSystemConfigGenerateService {
|
||||
/**
|
||||
* 系统配置入库后操作
|
||||
*
|
||||
* @param systemConfigDO
|
||||
* @param reqVO
|
||||
*/
|
||||
public abstract void afterSaveConfig(SystemConfigDO systemConfigDO, ConfigSaveReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 修改系统配置状态后操作
|
||||
*
|
||||
* @param systemConfigDO
|
||||
* @param reqVO
|
||||
*/
|
||||
public abstract void afterUpdateStatus(SystemConfigDO systemConfigDO, ConfigUpdateStatusReqVO reqVO);
|
||||
}
|
||||
|
||||
+6
@@ -10,6 +10,7 @@ import com.cf.imes.framework.common.exception.ErrorCode;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.module.system.controller.admin.systemconfig.vo.ConfigSaveReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.systemconfig.vo.ConfigUpdateStatusReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.customplateno.CustomPlateNoSeqDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.systemconfig.SystemConfigDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.dict.DictDataDO;
|
||||
@@ -210,4 +211,9 @@ public class CustomPlateNoGenerateService extends AbstractSystemConfigGenerateSe
|
||||
customPlateNoSeqMapper.insert(CustomPlateNoSeqDO.builder().configId(configId).build());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterUpdateStatus(SystemConfigDO systemConfigDO, ConfigUpdateStatusReqVO reqVO) {
|
||||
// todo afterUpdateStatus
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user