|
|
|
@ -6,6 +6,7 @@ import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
|
|
|
|
@ -14,6 +15,7 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
@ -71,9 +73,20 @@ public class SysConfigController extends CoreBaseController {
|
|
|
|
|
|
|
|
|
|
@DeleteMapping(value = "/delete/{id}")
|
|
|
|
|
@ApiOperation(value = "根据id删除系统参数", notes = "根据id删除系统参数")
|
|
|
|
|
public ResultBean deleteSysConfig(@PathVariable("id") String id) {
|
|
|
|
|
public ResultBean deleteSysConfig(@PathVariable("id") String idStr) {
|
|
|
|
|
try {
|
|
|
|
|
sysConfigService.deleteSysConfigById(Long.parseLong(id));
|
|
|
|
|
// 条件验证
|
|
|
|
|
ValidatorBean.checkNotNull(idStr,"id不能为空");
|
|
|
|
|
if(sysConfigService.getSysConfigById(Long.parseLong(idStr)) == null){
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
|
|
|
|
|
.setErrorDetail("字典不存在")
|
|
|
|
|
.setErrorSolution("请重新输入字典id")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sysConfigService.deleteSysConfigById(Long.parseLong(idStr));
|
|
|
|
|
return ResultBean.success("删除成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
@ -100,7 +113,7 @@ public class SysConfigController extends CoreBaseController {
|
|
|
|
|
ConvertBean.modelUpdate(sysConfig,user);
|
|
|
|
|
|
|
|
|
|
sysConfigService.updateSysConfig(sysConfig);
|
|
|
|
|
return ResultBean.success("删除成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
return ResultBean.success("修改成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
}catch(ImppBusiException busExcep){
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|