|
|
|
@ -1,18 +1,21 @@
|
|
|
|
|
package cn.estsh.i3plus.core.apiservice.controller.busi;
|
|
|
|
|
package cn.estsh.i3plus.core.apiservice.controller.busi;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.busi.ISysMenuService;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.busi.ResultBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysUser;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.busi.ISysMenuService;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysUser;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description : 系统功能对外接口
|
|
|
|
@ -23,20 +26,27 @@ import java.util.List;
|
|
|
|
|
**/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/sys-menu")
|
|
|
|
|
@Api(description = "系统功能")
|
|
|
|
|
@Api(description = "系统功能服务")
|
|
|
|
|
public class SysMenuController {
|
|
|
|
|
|
|
|
|
|
public static final Logger LOGGER = LoggerFactory.getLogger(SysMenuController.class);
|
|
|
|
|
|
|
|
|
|
public static final SysUser USER = new SysUser(10086L, "中国移动");
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISysMenuService sysMenuService;
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/insert")
|
|
|
|
|
@ApiOperation(value = "新增系统功能", notes = "系统功能")
|
|
|
|
|
public ResultBean insertSysMenu(SysMenu sysMenu) {
|
|
|
|
|
return sysMenuService.insertSysMenu(sysMenu);
|
|
|
|
|
try {
|
|
|
|
|
SysMenu menu = sysMenuService.insertSysMenu(sysMenu);
|
|
|
|
|
return new ResultBean(true,menu);
|
|
|
|
|
} catch(ImppBusiException busExcep){
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}",busExcep.getErrorDetail(),busExcep);
|
|
|
|
|
return ResultBean.fail(busExcep.getErrorShow());
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
LOGGER.error(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getDescription() + ":{}",e.getMessage(),e);
|
|
|
|
|
return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping(value = "/update")
|
|
|
|
@ -52,8 +62,16 @@ public class SysMenuController {
|
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
|
@ApiOperation(value = "删除系统功能", notes = "删除系统功能")
|
|
|
|
|
public ResultBean deleteSysMenu(long id) {
|
|
|
|
|
return sysMenuService.deleteSysMenuById(id, USER.getOrganizationNameRdd());
|
|
|
|
|
// return new ResultBean(true, "操作成功");
|
|
|
|
|
try {
|
|
|
|
|
sysMenuService.deleteSysMenuById(id);
|
|
|
|
|
return new ResultBean(true);
|
|
|
|
|
} catch(ImppBusiException busExcep){
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}",busExcep.getErrorDetail(),busExcep);
|
|
|
|
|
return ResultBean.fail(busExcep.getErrorShow());
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
LOGGER.error(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getDescription() + ":{}",e.getMessage(),e);
|
|
|
|
|
return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/findSysMenuAll")
|
|
|
|
@ -73,7 +91,16 @@ public class SysMenuController {
|
|
|
|
|
@PutMapping(value = "/updateStatus")
|
|
|
|
|
@ApiOperation(value = "修改权限状态", notes = "根据ID修改权限状态")
|
|
|
|
|
public ResultBean updateStatus(long id,int status) {
|
|
|
|
|
return sysMenuService.updateSysMenuStatus(id,status,USER.getEmployeeNameRdd());
|
|
|
|
|
try {
|
|
|
|
|
sysMenuService.updateSysMenuStatus(id,status,AuthUtil.getSessionUser());
|
|
|
|
|
return new ResultBean(true);
|
|
|
|
|
} catch(ImppBusiException busExcep){
|
|
|
|
|
LOGGER.error(busExcep.getErrorMsg() + ":{}",busExcep.getErrorDetail(),busExcep);
|
|
|
|
|
return ResultBean.fail(busExcep.getErrorShow());
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
LOGGER.error(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getDescription() + ":{}",e.getMessage(),e);
|
|
|
|
|
return ResultBean.fail().setCode(ImppExceptionEnum.BUSINESS_EXCEPTION_DATA_ERROR.getCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|