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.model.IndexObject;
|
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.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.pagemodel.Tree;
|
import com.vci.starter.web.util.BeanUtil;
|
import com.vci.starter.web.util.ControllerUtil;
|
import com.vci.starter.web.util.LangBaseUtil;
|
import com.vci.starter.web.util.VciBaseUtil;
|
import com.vci.pagemodel.OsBtmTypeAttributeVO;
|
import com.vci.pagemodel.OsBtmTypeVO;
|
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;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.context.annotation.Lazy;
|
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.io.FileNotFoundException;
|
import java.io.IOException;
|
import java.nio.charset.StandardCharsets;
|
import java.text.ParseException;
|
import java.util.ArrayList;
|
import java.util.Arrays;
|
import java.util.List;
|
import java.util.Map;
|
import java.util.stream.Collectors;
|
|
import static com.vci.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST;
|
|
/**
|
* 业务类型的控制器
|
* @author weidy
|
* @date 2021/8/23
|
*/
|
@RequestMapping("/btmTypeController")
|
@VciBusinessLog(modelName="业务类型")
|
@RestController
|
public class WebBtmTypeController {
|
|
/**
|
* 日志
|
*/
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
/**
|
* 业务类型的服务
|
*/
|
@Autowired
|
private OsBtmServiceI btmService;
|
|
/**
|
* 连接类型的服务
|
*/
|
@Autowired
|
private OsLinkTypeServiceI linkTypeService;
|
|
/**
|
* 业务类型导入导出服务
|
*/
|
@Autowired
|
private WebBtmIOServiceI btmIOService;
|
|
/**
|
* 属性的服务
|
*/
|
@Lazy
|
@Autowired(required = false)
|
private OsAttributeServiceI attributeService;
|
|
/**
|
* 业务类型列表
|
* @param baseQueryObject 查询条件
|
* @return 列表的内容
|
*/
|
@GetMapping( "/gridBtmType")
|
@VciBusinessLog(operateName = "业务类型列表")
|
public DataGrid<OsBtmTypeVO> gridBtmType(BaseQueryObject baseQueryObject){
|
return btmService.referDataGrid(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
|
}
|
|
/**
|
* 获取名字以filter开始的业务类型(for 查询),主要用于属性池的业务类型选择对话框
|
* @param btmName 查询条件
|
* @return 列表的内容
|
*/
|
@GetMapping( "/getBizTypes")
|
@VciBusinessLog(operateName = "业务类型列表(主要用于对话框使用)")
|
public BaseResult getBizTypes(String btmName){
|
try {
|
return BaseResult.dataList(Arrays.asList(btmService.getBizTypes(btmName)));
|
}catch (Exception e) {
|
e.printStackTrace();
|
String exceptionMessage = "获取业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
|
logger.error(exceptionMessage);
|
return BaseResult.fail(exceptionMessage);
|
}
|
}
|
|
/**
|
* 获取所有业务类型(树形结构)
|
* @return 查询结果
|
*/
|
@GetMapping( "/getTreeBizTypes")
|
@VciBusinessLog(operateName = "获取所有业务类型(树形结构)")
|
public BaseResult<List<Tree>> getTreeBizTypes(){
|
try {
|
return BaseResult.dataList(btmService.getTreeBizTypes());
|
}catch (Exception e) {
|
e.printStackTrace();
|
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 保存结果
|
*/
|
@PutMapping("/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);
|
}
|
}
|
|
/**
|
* 获取当前业务类型下的索引
|
* @return
|
* @throws PLException
|
*/
|
@GetMapping("/getIndexByCondition")
|
public BaseResult getIndexByCondition(BaseQueryObject baseQueryObject){
|
try {
|
return BaseResult.dataList(btmService.getIndexByCondition(baseQueryObject.getConditionMap()));
|
} catch (Exception e) {
|
e.printStackTrace();
|
String exceptionMessage = "查询当前业务类型下的索引时时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
|
logger.error(exceptionMessage);
|
return BaseResult.fail(exceptionMessage);
|
}
|
}
|
|
/**
|
* 创建索引
|
* @param indexObjectList
|
* @return
|
*/
|
@PostMapping("/addIndex")
|
public BaseResult addIndex(@RequestBody List<IndexObject> indexObjectList){
|
try {
|
return btmService.addIndex(indexObjectList) ? BaseResult.success("创建索引成功!"):BaseResult.fail("创建索引失败!");
|
} catch (Exception e) {
|
e.printStackTrace();
|
String exceptionMessage = "创建索引时时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
|
logger.error(exceptionMessage);
|
return BaseResult.fail(exceptionMessage);
|
}
|
}
|
|
/**
|
* 删除索引
|
* @param btmName
|
* @param indexName
|
* @return
|
*/
|
@DeleteMapping("/delIndex")
|
public BaseResult delIndex(String btmName,String indexName){
|
try {
|
return btmService.delIndex(btmName,indexName) ? BaseResult.success("删除索引成功!"):BaseResult.fail("删除索引失败!");
|
} catch (Exception e) {
|
e.printStackTrace();
|
String exceptionMessage = "删除索引时时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
|
logger.error(exceptionMessage);
|
return BaseResult.fail(exceptionMessage);
|
}
|
}
|
|
/**
|
* 导出业务类型
|
* name 链接类型名称
|
* @return
|
*/
|
@GetMapping("/expData")
|
public void expData(String name,HttpServletResponse response) throws PLException, IOException {
|
btmService.expData(name, response);
|
}
|
|
/**
|
* 导入业务类型
|
* @param file 上传的文件
|
* @return
|
*/
|
@PostMapping("/impData")
|
public BaseResult impData(MultipartFile file){try {
|
return btmService.impData(file);
|
}catch (Throwable e) {
|
throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
|
}
|
}
|
|
/**
|
* 获取业务类型包含的属性全部为小写
|
* @param btmId 业务类型名称
|
* @return 属性的信息
|
*/
|
@GetMapping(value = "/getAllAttributesByBtmId")
|
@VciBusinessLog(operateName = "查看业务类型的属性")
|
public BaseResult<List<OsBtmTypeAttributeVO>> getAllAttributesByBtmId(String btmId){
|
List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = null;
|
try {
|
osBtmTypeAttributeVOS = btmService.listAttributeByBtmIdHasDefault(btmId);
|
} catch (PLException e) {
|
e.printStackTrace();
|
String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
|
logger.error(exceptionMessage);
|
throw new VciBaseException(exceptionMessage);
|
}
|
return BaseResult.dataList(osBtmTypeAttributeVOS);
|
}
|
|
/**
|
* 获取业务全部属性类型
|
* @param btmName 业务类型名称
|
* @return 属性的信息
|
*/
|
@GetMapping(value = "/getBizTypeQTDs")
|
@VciBusinessLog(operateName = "查看业务类型的属性")
|
public BaseResult<List<OsBtmTypeAttributeVO>> getBizTypeQTDs(String btmName){
|
try {
|
List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = btmService.getBizTypeQTDs(btmName);
|
return BaseResult.dataList(osBtmTypeAttributeVOS);
|
} catch (PLException e) {
|
BaseResult objectBaseResult = new BaseResult<>();
|
objectBaseResult.setCode(Integer.parseInt(e.code));
|
objectBaseResult.setMsg(Arrays.toString(e.messages));
|
return objectBaseResult;
|
} catch (ParseException e) {
|
BaseResult objectBaseResult = new BaseResult<>();
|
objectBaseResult.setCode(500);
|
objectBaseResult.setMsg(e.getMessage());
|
return objectBaseResult;
|
}
|
}
|
|
/**
|
* 参照的业务类型
|
* @param baseQueryObject 查询条件
|
* @return 列表的内容
|
*/
|
@GetMapping( "/referDataGrid")
|
@VciBusinessLog(operateName = "参照业务类型")
|
public DataGrid<OsBtmTypeVO> referDataGrid(BaseQueryObject baseQueryObject){
|
return btmService.referDataGrid(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper());
|
}
|
|
/**
|
* 获取业务类型包含的属性,不分页
|
* @param baseQueryObject 查询对象
|
* @return 属性的信息
|
*/
|
@GetMapping(value = "/gridAttributesByBtmId")
|
@VciBusinessLog(operateName = "查看业务类型的属性")
|
public DataGrid<OsBtmTypeAttributeVO> gridAttributesByBtmId(BaseQueryObject baseQueryObject){
|
String btmTypeId = baseQueryObject.getConditionMap().containsKey("btmTypeId")?baseQueryObject.getConditionMap().get("btmTypeId"):"";
|
if(StringUtils.isBlank(btmTypeId)){
|
return new DataGrid<OsBtmTypeAttributeVO>();
|
}
|
String hasDefaultAttr = baseQueryObject.getConditionMap().getOrDefault("hasDefaultAttr","false");
|
String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):"";
|
String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : "";
|
List<OsBtmTypeAttributeVO> boAttrs = null;
|
try {
|
boAttrs = btmService.listAttributeByBtmId(btmTypeId);
|
} catch (PLException e) {
|
e.printStackTrace();
|
String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
|
logger.error(exceptionMessage);
|
throw new VciBaseException(exceptionMessage);
|
}
|
if(boAttrs == null){
|
boAttrs = new ArrayList<>();
|
}
|
if(BooleanEnum.TRUE.getValue().equalsIgnoreCase(hasDefaultAttr)){
|
//加默认的属性
|
List<OsBtmTypeAttributeVO> finalBoAttrs = boAttrs;
|
attributeService.getDefaultAttributeVOs().stream().forEach(attr->{
|
OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO();
|
BeanUtil.convert(attr,attributeVO);
|
attributeVO.setAttributeLength(attr.getAttrLength());
|
attributeVO.setAttributeDataType(attr.getAttributeDataType());
|
attributeVO.setReferBtmTypeId(attr.getBtmTypeId());
|
attributeVO.setReferBtmTypeName(attr.getBtmTypeName());
|
finalBoAttrs.add(attributeVO);
|
});
|
boAttrs = finalBoAttrs;
|
}
|
List<OsBtmTypeAttributeVO> attrList = boAttrs.stream().filter(s->{
|
boolean usedFlag = true;
|
if(StringUtils.isNotBlank(attrId) && !s.getId().contains(attrId.replace("*",""))){
|
usedFlag = false;
|
}
|
if(StringUtils.isNotBlank(attrName) && !s.getName().contains(attrName.replace("*",""))){
|
usedFlag = false;
|
}
|
return usedFlag;
|
}).collect(Collectors.toList());
|
DataGrid<OsBtmTypeAttributeVO> dataGrid = new DataGrid<OsBtmTypeAttributeVO>();
|
dataGrid.setTotal(attrList.size());;
|
dataGrid.setData(attrList);
|
return dataGrid;
|
}
|
|
/**
|
* 使用主键获取业务类型包含的属性,不分页
|
* @param baseQueryObject 查询对象
|
* @return 属性的信息
|
*/
|
@GetMapping(value = "/gridAttributeByBtmTypeOid")
|
@VciBusinessLog(operateName = "使用业务类型主键查看包含的属性")
|
public DataGrid<OsBtmTypeAttributeVO> gridAttributesByBtmTypeOid(String btmTypeOid,BaseQueryObject baseQueryObject){
|
if(StringUtils.isBlank(btmTypeOid)){
|
return new DataGrid<OsBtmTypeAttributeVO>();
|
}
|
String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):"";
|
String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : "";
|
OsBtmTypeVO btmTypeVO = btmService.selectByOid(btmTypeOid);
|
List<OsBtmTypeAttributeVO> boAttrs = null;
|
try {
|
boAttrs = btmService.listAttributeByBtmId(btmTypeVO.getId());
|
} catch (PLException e) {
|
e.printStackTrace();
|
String exceptionMessage = VciBaseUtil.getExceptionMessage(e);
|
logger.error(exceptionMessage);
|
throw new VciBaseException(exceptionMessage);
|
}
|
List<OsBtmTypeAttributeVO> attrList = boAttrs.stream().filter(s->{
|
boolean usedFlag = true;
|
if(StringUtils.isNotBlank(attrId) && !s.getId().contains(attrId)){
|
usedFlag = false;
|
}
|
if(StringUtils.isNotBlank(attrName) && !s.getName().contains(attrName)){
|
usedFlag = false;
|
}
|
return usedFlag;
|
}).collect(Collectors.toList());
|
DataGrid<OsBtmTypeAttributeVO> dataGrid = new DataGrid<OsBtmTypeAttributeVO>();
|
dataGrid.setTotal(attrList.size());;
|
dataGrid.setData(attrList);
|
return dataGrid;
|
}
|
|
/**
|
* 使用主键获取业务类型的对象
|
* @param oid 主键
|
* @return 业务类型的对象
|
*/
|
@GetMapping("/getBtmTypeByOid")
|
public BaseResult<OsBtmTypeVO> getBtmTypeByOid(String oid){
|
OsBtmTypeVO btmTypeVO = btmService.selectByOid(oid);
|
if(btmTypeVO == null){
|
return BaseResult.fail(DATA_OID_NOT_EXIST);
|
}
|
return BaseResult.success(btmTypeVO);
|
}
|
|
/**
|
* 导出业务类型的信息到word中
|
* @param btmTypeIds 业务类型的编号,用逗号分割
|
* @param response 响应对象
|
* @return 执行结果
|
*/
|
@PostMapping("/exportBtmType2Word")
|
@VciBusinessLog(operateName = "导出业务类型到word中")
|
public void exportDataBaseToWord(String btmTypeIds, HttpServletResponse response) throws FileNotFoundException, VciBaseException {
|
String exportWordFileName = btmIOService.exportBtmTypesToWord(VciBaseUtil.str2List(btmTypeIds));
|
if(StringUtils.isNotBlank(exportWordFileName)){
|
try {
|
ControllerUtil.writeFileToResponse(response, exportWordFileName);
|
}catch (FileNotFoundException e){
|
try {
|
ControllerUtil.writeDataToResponse(response,LangBaseUtil.getErrorMsg(e).getBytes(StandardCharsets.UTF_8),null);
|
} catch (IOException ex) {
|
ex.printStackTrace();
|
}
|
} catch (IOException e) {
|
try {
|
ControllerUtil.writeDataToResponse(response,LangBaseUtil.getErrorMsg(e).getBytes(StandardCharsets.UTF_8),null);
|
} catch (IOException ex) {
|
ex.printStackTrace();
|
}
|
}
|
}
|
}
|
|
/**
|
* 导出数据库的表信息到excel
|
* @param response 响应对象
|
* @param btmTypeIds 业务类型的编号,用逗号分割
|
*/
|
@PostMapping("/exportBtmType2Excel")
|
@VciBusinessLog(operateName = "导出业务类型到excel中")
|
public void exportAllTableToExcel(String btmTypeIds,HttpServletResponse response){
|
String excelFileName = btmIOService.exportBtmTypesToExcel(VciBaseUtil.str2List(btmTypeIds));
|
try {
|
ControllerUtil.writeFileToResponse(response,excelFileName);
|
} catch (IOException e) {
|
try {
|
ControllerUtil.writeDataToResponse(response,LangBaseUtil.getErrorMsg(e).getBytes(StandardCharsets.UTF_8),null);
|
} catch (IOException ex) {
|
ex.printStackTrace();
|
}
|
}
|
}
|
|
/**
|
* 根据业务类型生成业务类型使用的ER图
|
* @param id 业务类型ID
|
* @return 执行结果
|
*/
|
@GetMapping("/createERDiagram")
|
public BaseResult createERDiagram(String id){
|
OsERVO osERVO = btmService.createERDiagram(id);
|
return BaseResult.success(osERVO);
|
}
|
|
/**
|
* 获取使用这个业务类型的E-R图
|
* @param id 业务类型编号
|
* @return 执行结果
|
*/
|
@GetMapping("/createERUsed")
|
public BaseResult createERUsed(String id){
|
return BaseResult.success(btmService.createERUsed(id));
|
}
|
|
}
|