¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.portal.data.PLUILayout; |
| | | import com.vci.dto.OsBtmTypeDTO; |
| | | import com.vci.pagemodel.PLUILayoutCloneVO; |
| | | 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.Tree; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.OsBtmServiceI; |
| | | import com.vci.web.service.UIManagerServiceI; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * UIå®ä¹æ§å¶å± |
| | | * @author ludc |
| | | * @date 2024/8/28 17:09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/uiManagerController") |
| | | public class UIManagerController { |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åçæå¡ |
| | | */ |
| | | @Autowired |
| | | private OsBtmServiceI btmService; |
| | | |
| | | /** |
| | | * UIå®ä¹æå¡ |
| | | */ |
| | | @Autowired |
| | | private UIManagerServiceI uiManagerService; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»åå表æ¥è¯¢ï¼éæ ç»æï¼ç¨äºUIå®ä¹å·¦ä¾§ä¸å¡ç±»åæ¥è¯¢ |
| | | * @param btmName |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @GetMapping( "/getBizTree") |
| | | @VciBusinessLog(operateName = "ä¸å¡ç±»åå表(主è¦ç¨äºUIå®ä¹ä¸å¡ç±»åæ æ¥è¯¢ä½¿ç¨)") |
| | | public BaseResult getBizTree(String btmName){ |
| | | try { |
| | | return BaseResult.success(btmService.getBizTree(btmName)); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "è·åUIå®ä¹ä¸å¡ç±»åå表æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä¸å¡ç±»ånameæ¥è¯¢uiä¸ä¸æï¼æ¯æå页 |
| | | * @param baseQueryObject |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @GetMapping( "/gridUIContextData") |
| | | @VciBusinessLog(operateName = "éè¿ä¸å¡ç±»ånameæ¥è¯¢åºuiä¸ä¸æ") |
| | | public BaseResult gridUIContextData(BaseQueryObject baseQueryObject){ |
| | | try { |
| | | return BaseResult.dataGrid(uiManagerService.gridUIContextData(baseQueryObject)); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "éè¿ä¸å¡ç±»ånameæ¥è¯¢åºuiä¸ä¸ææ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å建UIä¸ä¸æ |
| | | * btmTypeDTO 龿¥ç±»åçä¿å对象 |
| | | * @return ä¿åç»æ |
| | | */ |
| | | @PostMapping("/saveUIContextData") |
| | | public BaseResult saveUIContextData(@RequestBody PLUILayout pluiLayout){ |
| | | try { |
| | | return uiManagerService.saveUIContextData(pluiLayout) ? BaseResult.success("UIä¸ä¸æå建æåï¼"):BaseResult.fail("UIä¸ä¸æå建失败ï¼"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å建UIä¸ä¸ææ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹UIä¸ä¸æ |
| | | * btmTypeDTO |
| | | * @return ä¿®æ¹ç»æ |
| | | */ |
| | | @PutMapping("/updateUIContextData") |
| | | public BaseResult updateUIContextData(@RequestBody PLUILayout pluiLayout){ |
| | | try { |
| | | return uiManagerService.updateUIContextData(pluiLayout) ? BaseResult.success("UIä¸ä¸æä¿®æ¹æåï¼"):BaseResult.fail("UIä¸ä¸æä¿®æ¹å¤±è´¥ï¼"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "ä¿®æ¹UIä¸ä¸ææ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤UIä¸ä¸ææ°æ® |
| | | * oids å é¤çoidä¿¡æ¯ |
| | | * @return å é¤ç»æ |
| | | */ |
| | | @DeleteMapping("/delUIContextData") |
| | | public BaseResult delUIContextData(String[] oids){ |
| | | try { |
| | | return uiManagerService.delUIContextData(oids) ? BaseResult.success("UIä¸ä¸æå 餿åï¼"):BaseResult.fail("UIä¸ä¸æå é¤å¤±è´¥ï¼"); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å é¤UIä¸ä¸ææ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * UIä¸ä¸æå
é |
| | | * pluiLayoutCloneVO å
éåæ°å¯¹è±¡ |
| | | * @return å
éç»æ |
| | | */ |
| | | @PostMapping("/cloneUiContextData") |
| | | public BaseResult cloneUiContextData(@RequestBody PLUILayoutCloneVO pluiLayoutCloneVO){ |
| | | try { |
| | | return uiManagerService.cloneUiContextData(pluiLayoutCloneVO) ? BaseResult.success("UIä¸ä¸æå
éæåï¼"):BaseResult.fail("UIä¸ä¸æå
é失败ï¼"); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "UIä¸ä¸æå
éæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²è·åUI/表å/æé®çæé. |
| | | * @param baseQueryObject |
| | | * @return |
| | | */ |
| | | @GetMapping( "/getUIAuthor") |
| | | @VciBusinessLog(operateName = "UIææï¼æ å½¢ç»æï¼") |
| | | public BaseResult getUIAuthor(BaseQueryObject baseQueryObject){ |
| | | try { |
| | | return BaseResult.dataList( uiManagerService.getUIAuthor(baseQueryObject)); |
| | | }catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "UIææå è½½åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | } |