| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.annotation.log.VciBusinessLog; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | |
| | | import com.vci.dto.OsStatusDTO; |
| | | import com.vci.pagemodel.OsLifeCycleVO; |
| | | import com.vci.pagemodel.OsStatusVO; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.OsLifeCycleServiceI; |
| | | import com.vci.web.service.OsStatusServiceI; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | private OsLifeCycleServiceI lifeCycleService; |
| | | |
| | | /** |
| | | * 日志 |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * 状态的列表 |
| | | * @param queryObject 查询对象 |
| | | * @return 显示对象 |
| | | */ |
| | | @GetMapping("/gridStatus") |
| | | @VciBusinessLog(operateName = "查看状态列表") |
| | | public DataGrid<OsStatusVO> gridStatus(BaseQueryObject queryObject){ |
| | | return statusService.gridStatus(queryObject.getConditionMap(),queryObject.getPageHelper()); |
| | | @VciUnCheckRight |
| | | public BaseResult<OsStatusVO> gridStatus(BaseQueryObject queryObject){ |
| | | try { |
| | | return BaseResult.dataGrid(statusService.gridStatus(queryObject.getConditionMap(),queryObject.getPageHelper())); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "属性管理列表查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 使用的生命周期的对象 |
| | | */ |
| | | @GetMapping("/listUsed") |
| | | public DataGrid<OsLifeCycleVO> listUsed(String oid){ |
| | | return lifeCycleService.listStatusUsed(oid); |
| | | @VciBusinessLog(operateName = "查询状态池的应用范围") |
| | | @VciUnCheckRight |
| | | public BaseResult<OsLifeCycleVO> listUsed(String oid){ |
| | | try { |
| | | return BaseResult.dataGrid(lifeCycleService.listStatusUsed(oid)); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "属性管理列表查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 执行结果 |
| | | */ |
| | | @PostMapping("/addSave") |
| | | public BaseResult addSave(OsStatusDTO statusDTO){ |
| | | statusService.addSave(statusDTO); |
| | | return BaseResult.success(); |
| | | @VciUnCheckRight |
| | | public BaseResult addSave(@RequestBody OsStatusDTO statusDTO){ |
| | | try { |
| | | return statusService.addSave(statusDTO) ? BaseResult.success("添加状态成功!"):BaseResult.fail("添加状态失败!"); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "添加状态时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 执行结果 |
| | | */ |
| | | @PutMapping("/editSave") |
| | | public BaseResult editSave(OsStatusDTO statusDTO){ |
| | | statusService.editSave(statusDTO); |
| | | return BaseResult.success(); |
| | | public BaseResult editSave(@RequestBody OsStatusDTO statusDTO){ |
| | | try { |
| | | return statusService.editSave(statusDTO) ? BaseResult.success("修改状态成功!"):BaseResult.fail("修改状态失败!"); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "修改状态时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |