| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | 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.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.web.pageModel.OsBtmTypeAttributeVO; |
| | | import com.vci.web.pageModel.OsBtmTypeVO; |
| | | import com.vci.web.pageModel.OsERVO; |
| | | 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.WebBtmIOServiceI; |
| | | import com.vci.web.service.impl.OsAttributeServiceImpl; |
| | | 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.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST; |
| | | import static com.vci.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST; |
| | | |
| | | /** |
| | | * 业务类型的控制器 |
| | |
| | | @VciBusinessLog(modelName="业务类型") |
| | | @RestController |
| | | public class WebBtmTypeController { |
| | | |
| | | /** |
| | | * 日志 |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * 业务类型的服务 |
| | |
| | | return btmService.referDataGrid(baseQueryObject.getConditionMap(),baseQueryObject.getPageHelper()); |
| | | } |
| | | |
| | | /** |
| | | * 获取名字以filter开始的业务类型(for 查询),主要用于属性池的业务类型选择对话框 |
| | | * @param btmName 查询条件 |
| | | * @return 列表的内容 |
| | | */ |
| | | @GetMapping( "/getBizTypes") |
| | | @VciBusinessLog(operateName = "业务类型列表(主要用于对话框使用)") |
| | | @VciUnCheckRight |
| | | 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 = "获取所有业务类型(树形结构)") |
| | | @VciUnCheckRight |
| | | public BaseResult<List<Tree>> getTreeBizTypes(){ |
| | | try { |
| | | return btmService.getTreeBizTypes(); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "获取业务类型时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取业务类型包含的属性 |
| | | * @param btmId 业务类型名称 |
| | | * @return 属性的信息 |
| | | */ |
| | | @GetMapping(value = "/getAllAttributesByBtmId") |
| | | @VciBusinessLog(operateName = "查看业务类型的属性") |
| | | public BaseResult<List<OsBtmTypeAttributeVO>> getAllAttributesByBtmId(String btmId){ |
| | | List<OsBtmTypeAttributeVO> osBtmTypeAttributeVOS = btmService.listAttributeByBtmIdHasDefault(btmId); |
| | | return BaseResult.dataList(osBtmTypeAttributeVOS); |
| | | } |
| | | |
| | | /** |
| | | * 参照的业务类型 |