1、增加链接类型查询模板设置排序的下拉框数据接口。
2、保存Action参数数据接口。
3、修改Action参数数据接口。
4、删除Action参数数据接口。
已修改6个文件
已添加1个文件
246 ■■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionParamDTO.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionParamDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,37 @@
package com.vci.dto;
import lombok.Data;
/**
 * Action参数列表传输对象
 * @author yuxc
 * @date 2024/8/28 16:40
 */
@Data
public class PLActionParamDTO implements java.io.Serializable{
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2009350578651813260L;
    /**
     * ä¸»é”®
     */
    public String oid;
    /**
     * å‚数名称
     */
    public String name;
    /**
     * é»˜è®¤å€¼
     */
    public String defaultValue;
    /**
     * æç¤ºä¿¡æ¯
     */
    public String description;
    /**
     * çˆ¶action的ID
     */
    public String action;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java
@@ -1,10 +1,7 @@
package com.vci.web.controller;
import com.vci.corba.common.PLException;
import com.vci.dto.PLActionClsDTO;
import com.vci.dto.PLActionDTO;
import com.vci.dto.PLActionExpDTO;
import com.vci.dto.PLActionQueryDTO;
import com.vci.dto.*;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.VciBaseUtil;
@@ -185,6 +182,56 @@
            osActionServiceI.exportAction(plActionExpDTO, response);
        }catch (Throwable e) {
        throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }
    }
    /**
     * ä¿å­˜Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    @PostMapping("/savePLActionParam")
    public BaseResult savePLActionParam(@RequestBody PLActionParamDTO dto){
        try {
            return osActionServiceI.savePLActionParam(dto);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * ä¿®æ”¹Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    @PostMapping("/updatePLActionParam")
    public BaseResult updatePLActionParam(@RequestBody PLActionParamDTO dto){
        try {
            return osActionServiceI.updatePLActionParam(dto);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * åˆ é™¤Action参数数据
     * oid å‚数主键
     * @return ä¿å­˜ç»“æžœ
     */
    @DeleteMapping("/deletePLActionParam")
    public BaseResult deletePLActionParam(String oid){
        try {
            return osActionServiceI.deletePLActionParam(oid);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
@@ -279,4 +279,28 @@
            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);
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java
@@ -1,10 +1,7 @@
package com.vci.web.service;
import com.vci.corba.common.PLException;
import com.vci.dto.PLActionClsDTO;
import com.vci.dto.PLActionDTO;
import com.vci.dto.PLActionExpDTO;
import com.vci.dto.PLActionQueryDTO;
import com.vci.dto.*;
import com.vci.starter.web.pagemodel.BaseResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;
@@ -78,4 +75,22 @@
     * @param plActionExpDTO å¯¼å‡ºå±žæ€§è®¾ç½®å¯¹è±¡
     */
    void exportAction(PLActionExpDTO plActionExpDTO, HttpServletResponse response) throws PLException, IOException;
    /**
     * ä¿å­˜Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult savePLActionParam(PLActionParamDTO dto) throws PLException;
    /**
     * ä¿®æ”¹Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult updatePLActionParam(PLActionParamDTO dto) throws PLException;
    /**
     * åˆ é™¤Action参数数据
     * oid å‚数主键
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult deletePLActionParam(String oid) throws PLException;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
@@ -173,4 +173,13 @@
     * @return å±žæ€§çš„信息
     */
    List<OsLinkTypeAttributeVO> getAllAttributeByLink(String name) throws PLException, ParseException;
    /**
     * èŽ·å–è®¾ç½®æŽ’åºå­—æ®µçš„æŽ’åºå­—æ®µ
     * @param linkType é“¾æŽ¥ç±»åž‹çš„编号
     * @param btmType ä¸šåŠ¡ç±»åž‹çš„ç¼–å·
     * @param direction æ­£/反向
     * @return å±žæ€§çš„信息
     */
    List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java
@@ -6,11 +6,7 @@
import com.vci.corba.portal.data.PLAction;
import com.vci.corba.portal.data.PLActionCls;
import com.vci.corba.portal.data.PLActionParam;
import com.vci.dto.PLActionClsDTO;
import com.vci.dto.PLActionDTO;
import com.vci.dto.PLActionExpDTO;
import com.vci.dto.PLActionQueryDTO;
import com.vci.pagemodel.OsAttributeVO;
import com.vci.dto.*;
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.util.ExcelUtil;
@@ -503,6 +499,72 @@
        ControllerUtil.writeFileToResponse(response,excelPath);
        FileUtil.del(defaultTempFolder + File.separator);
    }
    /**
     * ä¿å­˜Action参数数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    @Override
    public BaseResult savePLActionParam(PLActionParamDTO dto) throws PLException {
        if(dto.getName() == null || dto.getName().equals("")) {
            throw new PLException("500",new String[]{"参数名称不能为空"});
        }
        PLActionParam param = new PLActionParam();
        param.oid = "";
        param.name = dto.getName();
        param.defaultValue = dto.getDefaultValue();
        param.description = dto.getDescription();
        param.action = dto.getAction();
        String message = platformClientUtil.getUIService().createPLActionParam(param);
        if(message.startsWith("0")) {
            if(message.equals("01")) {
                throw new PLException("500",new String[]{"参数名已经存在!"});
            } else {
                throw new PLException("500",new String[]{"添加按钮参数时发生异常:" + message.substring(1)});
            }
        }
        return BaseResult.success();
    }
    @Override
    public BaseResult updatePLActionParam(PLActionParamDTO dto) throws PLException {
        if(dto.getName() == null || dto.getName().equals("")) {
            throw new PLException("500",new String[]{"参数名称不能为空"});
        }
        PLActionParam param = new PLActionParam();
        param.oid = dto.getOid();
        param.name = dto.getName();
        param.defaultValue = dto.getDefaultValue();
        param.description = dto.getDescription();
        param.action = dto.getAction();
        String message = platformClientUtil.getUIService().editPLActionParam(param);
        if(message.startsWith("0")) {
            if(message.equals("01")) {
                throw new PLException("500",new String[]{"参数名已经存在!"});
            } else {
                throw new PLException("500",new String[]{"添加按钮参数时发生异常:" + message.substring(1)});
            }
        }
        return BaseResult.success();
    }
    /**
     * åˆ é™¤Action参数数据
     * oid å‚数主键
     * @return ä¿å­˜ç»“æžœ
     */
    @Override
    public BaseResult deletePLActionParam(String oid) throws PLException {
        if(StringUtils.isBlank(oid)){
            throw new PLException("500", new String[]{"参数主键不能为空"});
        }
        String message = platformClientUtil.getUIService().deletePLActionParam(oid);
        if (message.startsWith("0")) {
            throw new PLException("500", new String[]{"删除按钮参数时发生异常:" + message.substring(1)});
        }
        return BaseResult.success();
    }
    public boolean isValidPageForamt(PLActionExpDTO plActionExpDTO) throws PLException {
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
@@ -4,6 +4,7 @@
import cn.hutool.core.util.ZipUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.vci.common.qt.object.QTConstants;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
@@ -752,6 +753,31 @@
        }
        return links;
    }
    /**
     * èŽ·å–è®¾ç½®æŽ’åºå­—æ®µçš„æŽ’åºå­—æ®µ
     * @param linkType é“¾æŽ¥ç±»åž‹çš„编号
     * @param btmType ä¸šåŠ¡ç±»åž‹çš„ç¼–å·
     * @param direction æ­£/反向
     * @return å±žæ€§çš„信息
     */
    @Override
    public List<String> getAllOrderbyAttributeByLink(String linkType, String btmType, String direction) throws PLException, ParseException {
        List<String> abNames = new ArrayList<>(Arrays.asList("OID", "Creator", "CreateTime", "LastModifier", "LASTMODIFYTIME", "F_OID",
                "F_REVISIONOID", "F_NAMEOID", "F_BtwName", "T_OID", "T_REVISIONOID", "T_NAMEOID", "T_BtwName", "TS" ));
        AttributeDef[] attributes = platformClientUtil.getLinkTypeService().getAttributes(linkType);
        for (AttributeDef attribute : attributes) {
            abNames.add(String.valueOf(attribute.name));
        }
        String wrapper = "T_OID.";
        if(direction.equals(QTConstants.DIRECTION_OPPOSITE)){
            wrapper = "F_OID.";
        }
        List<OsBtmTypeAttributeVO> bizTypeQTDs = btmService.getBizTypeQTDs(btmType);
        for (OsBtmTypeAttributeVO bizTypeQTD : bizTypeQTDs) {
            abNames.add(wrapper + bizTypeQTD.getId());
        }
        return abNames;
    }
    /**
     * ä¿®å¤é“¾æŽ¥ç±»åž‹çš„xml文件