ludc
2024-11-15 600c2ebb55b18d687ff848cb6c9d9a61b8bfa307
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
@@ -92,7 +92,15 @@
        String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):"";
        String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : "";
        OsLinkTypeVO linkTypeVO = linkTypeService.selectByOid(linkTypeOid);
        List<OsLinkTypeAttributeVO> boAttrs = linkTypeService.listAttributeByLinkId(linkTypeVO.getId());
        List<OsLinkTypeAttributeVO> boAttrs = null;
        try {
            boAttrs = linkTypeService.listAttributeByLinkId(linkTypeVO.getId());
        }catch (Exception e){
            e.printStackTrace();
            String errorLog = "查询链接类型关联的属性时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e);
            logger.error(errorLog);
            throw new VciBaseException(errorLog);
        }
        List<OsLinkTypeAttributeVO> attrList = boAttrs.stream().filter(s->{
            boolean usedFlag = true;
            if(StringUtils.isNotBlank(attrId) && !s.getId().contains(attrId)){
@@ -272,11 +280,35 @@
     * @return
     */
    @PostMapping("/impData")
    @VciUnCheckRight
    public BaseResult impData(MultipartFile file){try {
    public BaseResult impData(MultipartFile file){
        try {
             return linkTypeService.impData(file);
        }catch (Throwable e) {
            throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }
    }
    /**
     * 获取设置排序字段的排序字段
     * @param linkType 链接类型的编号
     * @param btmType 业务类型的编号
     * @param direction 正/反向
     * @return 属性的信息
     */
    @GetMapping("/getAllOrderbyAttributeByLink")
    public BaseResult<List<String>> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction){
        try {
            List<String> osLinkTypeAttributes = linkTypeService.getAllOrderbyAttributeByLink(linkType, btmType, direction);
            return BaseResult.dataList(osLinkTypeAttributes);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }
}