| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.ltm.LinkType; |
| | | import com.vci.corba.omd.qtm.QTD; |
| | | import com.vci.dto.QTInfoDTO; |
| | | import com.vci.pagemodel.OsBtmTypeAttributeVO; |
| | | import com.vci.pagemodel.OsBtmTypeVO; |
| | | import com.vci.pagemodel.OsLinkTypeAttributeVO; |
| | | import com.vci.pagemodel.OsLinkTypeVO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.annotation.log.VciBusinessLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | 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.OsLinkTypeServiceI; |
| | | import com.vci.web.service.OsQuereyTemplateServiceI; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.dom4j.DocumentException; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 查询模板的控制器 |
| | |
| | | public BaseResult queryTemplateList(String btmName,Boolean linkFlag){ |
| | | try { |
| | | return quereyTemplateServiceI.queryTemplateList(btmName,linkFlag); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询模板的列表添加了字段的相关属性 |
| | | * @param btmName 类型 |
| | | * @param linkFlag 是否链接类型 :true 链接类型 ,false 业务类型 |
| | | * @param direction 正反方向 |
| | | * @return 查询模板的列表 |
| | | */ |
| | | @GetMapping("/queryTemplateListByAttr") |
| | | public BaseResult queryTemplateListByAttr(String btmName,Boolean linkFlag, String direction){ |
| | | try { |
| | | return quereyTemplateServiceI.queryTemplateListByAttr(btmName,linkFlag,direction); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | |
| | | |
| | | /** |
| | | * 查询条件的查询按钮查询lis列表 |
| | | * @param dataMap 传输的数据对象: |
| | | * @param qtInfoDTO 传输的数据对象: |
| | | * linkTypeName 链接类型名称、 |
| | | * rdPositive 方向,true正向,false反向 |
| | | * btmName 业务类型名称 |
| | |
| | | * level 子节点层数 |
| | | * @return 查询结果 |
| | | */ |
| | | @GetMapping("/getCriteria") |
| | | public BaseResult getCriteria(@RequestBody HashMap<String,Object> dataMap){ |
| | | @PostMapping("/getCriteria") |
| | | public BaseResult getCriteria(@RequestBody QTInfoDTO qtInfoDTO){ |
| | | try { |
| | | return quereyTemplateServiceI.getCriteria(dataMap); |
| | | return quereyTemplateServiceI.getCriteria(qtInfoDTO); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 业务类型查询模板下的查询条件的查询按钮查询list列表 |
| | | * @param qtInfoDTO |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/getCriteriaBtm") |
| | | public BaseResult getCriteriaBtm(@RequestBody QTInfoDTO qtInfoDTO){ |
| | | try { |
| | | return quereyTemplateServiceI.getCriteriaBtm(qtInfoDTO); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询条件下的选择查询模板对话框(查询全部模板和所对应的业务类型或链接类型名) |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAllQTs") |
| | | public BaseResult getAllQTs(){ |
| | | try { |
| | | return quereyTemplateServiceI.getAllQTs(); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 链接类型查询模板树查询,用于界面的导出功能 |
| | | * @return 查询结果 |
| | | */ |
| | | @GetMapping("/getLinkTree") |
| | | public BaseResult getLinkTree(){ |
| | | try { |
| | | return quereyTemplateServiceI.getLinkTree(); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | /** |
| | | * 导出链接类型查询模板 |
| | | * names 查询模板名 |
| | | * @return |
| | | */ |
| | | @PostMapping("/expLinkTemplate") |
| | | public void expLinkTemplate(@RequestBody List<String> names,HttpServletResponse response) throws PLException, IOException { |
| | | quereyTemplateServiceI.expLinkTemplate(names, response); |
| | | } |
| | | |
| | | /** |
| | | * 导入链接类型查询模板 |
| | | * @param file 上传的文件 |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/impLinkTemplate") |
| | | public BaseResult impLinkTemplate(MultipartFile file){ |
| | | try { |
| | | return quereyTemplateServiceI.impLinkTemplate(file); |
| | | }catch (Throwable e) { |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询方案删除 |
| | | * @param names 查询方案名 |
| | | * @return 操作结果 |
| | | */ |
| | | @DeleteMapping("/deleteLinkTemplate") |
| | | public BaseResult deleteLinkTemplate(String names){ |
| | | try { |
| | | return quereyTemplateServiceI.deleteLinkTemplate(names); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 业务类型查询模板保存 |
| | | * @param qtInfoDTO 保存传输对象 |
| | | * @return 保存结果 |
| | | */ |
| | | @PostMapping("/btmSave") |
| | | public BaseResult btmSave(@RequestBody QTInfoDTO qtInfoDTO){ |
| | | try { |
| | | return quereyTemplateServiceI.btmSave(qtInfoDTO); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 更新数据库结构 |
| | | * @return 更新结果 |
| | | */ |
| | | @PostMapping("/updateDBStructure") |
| | | public BaseResult btmSave(){ |
| | | try { |
| | | return quereyTemplateServiceI.updateDBStructure(); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 业务类型查询模板树查询,用于界面的导出功能 |
| | | * @return 查询结果 |
| | | */ |
| | | @GetMapping("/getBtmQtTree") |
| | | public BaseResult getBtmQtTree(){ |
| | | try { |
| | | return quereyTemplateServiceI.getBtmQtTree(); |
| | | } catch (PLException e) { |
| | | BaseResult objectBaseResult = new BaseResult<>(); |
| | | objectBaseResult.setCode(Integer.parseInt(e.code)); |
| | | objectBaseResult.setMsg(Arrays.toString(e.messages)); |
| | | return objectBaseResult; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出业务类型查询模板 |
| | | * names 查询模板名 |
| | | * @return |
| | | */ |
| | | @PostMapping("/expBtmQTTemplate") |
| | | public void expBtmQTTemplate(List<String> qtNames,HttpServletResponse response) throws PLException, IOException { |
| | | quereyTemplateServiceI.expBtmQTTemplate(qtNames, response); |
| | | } |
| | | |
| | | /** |
| | | * 导入业务类型查询模板 |
| | | * @param file 上传的文件 |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/impBtmTemplate") |
| | | public BaseResult impBtmTemplate(MultipartFile file){ |
| | | try { |
| | | return quereyTemplateServiceI.impBtmTemplate(file); |
| | | }catch (Throwable e) { |
| | | throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); |
| | | } |
| | | } |
| | | |
| | | } |