| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.btm.BizType; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.dto.OsBtmTypeDTO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.annotation.log.VciBusinessLog; |
| | | import com.vci.starter.web.enumpck.BooleanEnum; |
| | |
| | | import com.vci.pagemodel.OsERVO; |
| | | import com.vci.web.service.OsAttributeServiceI; |
| | | import com.vci.web.service.OsBtmServiceI; |
| | | import com.vci.web.service.OsLinkTypeServiceI; |
| | | import com.vci.web.service.WebBtmIOServiceI; |
| | | import feign.Param; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | @RequestMapping("/btmTypeController") |
| | | @VciBusinessLog(modelName="业务类型") |
| | | @RestController |
| | | @VciUnCheckRight |
| | | public class WebBtmTypeController { |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Autowired |
| | | private OsBtmServiceI btmService; |
| | | |
| | | /** |
| | | * 连接类型的服务 |
| | | */ |
| | | @Autowired |
| | | private OsLinkTypeServiceI linkTypeService; |
| | | |
| | | /** |
| | | * 业务类型导入导出服务 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取所有业务类型(树形结构) |
| | | * @return 查询结果 |
| | | */ |
| | | @GetMapping( "/getTreeBizTypes") |
| | | @VciBusinessLog(operateName = "获取所有业务类型(树形结构)") |
| | | @VciUnCheckRight |
| | | public BaseResult<List<Tree>> getTreeBizTypes(){ |
| | | try { |
| | | return btmService.getTreeBizTypes(); |
| | | return BaseResult.dataList(btmService.getTreeBizTypes()); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "获取业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | String exceptionMessage = "查询业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取业务类型使用范围 |
| | | * @param btmName |
| | | * @return 查询结果 |
| | | */ |
| | | @GetMapping( "/getUsedBtmLinkList") |
| | | @VciBusinessLog(operateName = "获取业务类型使用范围") |
| | | public BaseResult<List<String>> getUsedBtmLinkList(String btmName){ |
| | | try { |
| | | return BaseResult.dataList(linkTypeService.getUsedBtmLinkList(btmName)); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "获取业务类型使用范围时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建业务类型 |
| | | * btmTypeDTO 链接类型的保存对象 |
| | | * @return 保存结果 |
| | | */ |
| | | @PostMapping("/addBtmType") |
| | | public BaseResult addBtmType(@RequestBody OsBtmTypeDTO btmTypeDTO){ |
| | | try { |
| | | return btmService.addBtmType(btmTypeDTO) ? BaseResult.success("业务类型创建成功!"):BaseResult.fail("业务类型创建失败!"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "创建业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 批量创建业务类型 |
| | | * btmTypeDTO 链接类型的保存对象 |
| | | * @return 保存结果 |
| | | */ |
| | | @PostMapping("/addBtmTypes") |
| | | public BaseResult addBtmTypes(@RequestBody List<BizType> bizTypes){ |
| | | try { |
| | | return btmService.addBtmTypes(bizTypes) ? BaseResult.success("业务类型批量创建成功!"):BaseResult.fail("业务类型批量创建失败!"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "批量创建业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改业务类型 |
| | | * btmTypeDTO 链接类型修改的对象 |
| | | * @return 保存结果 |
| | | */ |
| | | @PostMapping("/updateBtmType") |
| | | public BaseResult updateBtmType(@RequestBody OsBtmTypeDTO btmTypeDTO){ |
| | | try { |
| | | return btmService.updateBtmType(btmTypeDTO) ? BaseResult.success("业务类型修改成功!"):BaseResult.fail("业务类型修改失败!"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "修改业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 业务类型删除 |
| | | * btmTypeDTO 业务类型对象 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping("/deleteBtmType") |
| | | public BaseResult deleteLink(@RequestBody OsBtmTypeDTO btmTypeDTO){ |
| | | try { |
| | | return btmService.deleteBtmType(btmTypeDTO) ? BaseResult.success("删除业务类型成功!"):BaseResult.fail("删除业务类型失败!"); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "删除业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 一致性检查 |
| | | * @return 检查结果 |
| | | */ |
| | | @GetMapping("/checkBtmConsistency") |
| | | public BaseResult checkBtmConsistency(){ |
| | | try { |
| | | return btmService.checkBtmConsistency(); |
| | | } catch (PLException e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "业务类型一致性检查时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 一致性检查,业务类型修复 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/executeRepair") |
| | | public BaseResult executeRepair(@RequestBody String repairData){ |
| | | try { |
| | | return btmService.executeRepair(repairData); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "业务类型修复时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建视图 |
| | | * @return |
| | | */ |
| | | @PostMapping("/createView") |
| | | public BaseResult createView(){ |
| | | try { |
| | | return btmService.createView() ? BaseResult.success("创建视图成功!"):BaseResult.fail("创建视图失败!"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "创建视图时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除数据界面的数据查询 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getObjectData") |
| | | public BaseResult getObjectData(){ |
| | | try { |
| | | return btmService.getObjectData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "数据对象查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * @param btmNames 业务类型名 |
| | | * @param linkNames 链接类型名 |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @DeleteMapping("/truncateTable") |
| | | public BaseResult truncateTable(String[] btmNames,String[] linkNames){ |
| | | try { |
| | | return BaseResult.dataList(btmService.truncateTable(btmNames,linkNames)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "删除数据时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除全部类型 |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @DeleteMapping("/deleteAllType") |
| | | public BaseResult deleteAllType(){ |
| | | try { |
| | | return BaseResult.dataList(btmService.deleteAllType()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "删除全部类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | |
| | | @GetMapping(value = "/getBizTypeQTDs") |
| | | @VciBusinessLog(operateName = "查看业务类型的属性") |
| | | public BaseResult<List<OsBtmTypeAttributeVO>> getBizTypeQTDs(String btmName){ |
| | | |
| | | try { |
| | | List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = btmService.getBizTypeQTDs(btmName); |
| | | return BaseResult.dataList(osBtmTypeAttributeVOS); |
| | |
| | | return dataGrid; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 使用主键获取业务类型包含的属性,不分页 |
| | | * @param baseQueryObject 查询对象 |
| | |
| | | return dataGrid; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 使用主键获取业务类型的对象 |
| | | * @param oid 主键 |
| | |
| | | } |
| | | return BaseResult.success(btmTypeVO); |
| | | } |
| | | |
| | | /** |
| | | * 导出业务类型的信息到word中 |
| | | * @param btmTypeIds 业务类型的编号,用逗号分割 |
| | |
| | | public BaseResult createERUsed(String id){ |
| | | return BaseResult.success(btmService.createERUsed(id)); |
| | | } |
| | | |
| | | } |