¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.wf.data.ProcessCategoryInfo; |
| | | 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.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.WebFlowServiceI; |
| | | 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; |
| | | |
| | | /** |
| | | * æµç¨æå¡æ§å¶å¨ |
| | | * @author ludc |
| | | * @date 2025/1/14 21:37 |
| | | */ |
| | | @VciBusinessLog(modelName="æµç¨æå¡") |
| | | @RestController |
| | | @RequestMapping("/WebFlowController") |
| | | public class WebFlowController { |
| | | |
| | | /** |
| | | * 注å
¥æµç¨æå¡ |
| | | */ |
| | | @Autowired |
| | | private WebFlowServiceI webFlowServiceI; |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * æµç¨åç±»å
¨æ¥è¯¢ |
| | | * @param parentId ç¶id |
| | | * @return å表çå
容 |
| | | */ |
| | | @GetMapping( "/getProcessCategories") |
| | | @VciBusinessLog(operateName = "æµç¨åç±»å
¨æ¥è¯¢") |
| | | public BaseResult<List<ProcessCategoryInfo>> getProcessCategories(String parentId){ |
| | | try { |
| | | return BaseResult.dataList(webFlowServiceI.getProcessCategories(parentId)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æµç¨åç±»æ¥è¯¢æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æµç¨åç±»å页æ¥è¯¢ |
| | | * @param baseQueryObject |
| | | * @return å表çå
容 |
| | | */ |
| | | @GetMapping( "/getProcessCategoriesByPage") |
| | | @VciBusinessLog(operateName = "æµç¨åç±»å页æ¥è¯¢") |
| | | public BaseResult getProcessCategoriesByPage(BaseQueryObject baseQueryObject){ |
| | | try { |
| | | return BaseResult.dataGrid(webFlowServiceI.getProcessCategoriesByPage(baseQueryObject)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æµç¨åç±»å页æ¥è¯¢æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æµç¨åç±» |
| | | * @param processCategoryInfo |
| | | * @return |
| | | */ |
| | | @PostMapping( "/saveProcessCategory") |
| | | @VciBusinessLog(operateName = "æ·»å æµç¨åç±»") |
| | | public BaseResult saveProcessCategory(@RequestBody ProcessCategoryInfo processCategoryInfo) { |
| | | try { |
| | | return BaseResult.success(webFlowServiceI.saveProcessCategory(processCategoryInfo)); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "æ·»å æµç¨åç±»æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æµç¨åç±» |
| | | * @param processCategoryInfo |
| | | * @return |
| | | */ |
| | | @PutMapping( "/updateProcessCategory") |
| | | @VciBusinessLog(operateName = "ä¿®æ¹æµç¨åç±»") |
| | | public BaseResult updateProcessCategory(@RequestBody ProcessCategoryInfo processCategoryInfo) { |
| | | try { |
| | | return webFlowServiceI.updateProcessCategory(processCategoryInfo) ? BaseResult.success("æµç¨åç±»ä¿®æ¹æåï¼"):BaseResult.fail("æµç¨å类修æ¹å¤±è´¥ï¼"); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "ä¿®æ¹æµç¨åç±»æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å 餿µç¨åç±» |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @DeleteMapping( "/deleteProcessCategory") |
| | | @VciBusinessLog(operateName = "å 餿µç¨åç±»") |
| | | public BaseResult deleteProcessCategory(String id) { |
| | | try { |
| | | return webFlowServiceI.deleteProcessCategory(id) ? BaseResult.success("æµç¨åç±»å 餿åï¼"):BaseResult.fail("æµç¨åç±»å é¤å¤±è´¥ï¼"); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å 餿µç¨åç±»æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | } |