yuxc
2024-08-23 2ce9e4a8509a571745933801f4cb9bda7245c8a1
1、对Action管理相关功能上传。
2、对打的包进行上传
已修改5个文件
已添加52个文件
1222 ■■■■■ 文件已修改
Bin/lib/service/BOFService.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/lib/service/WFService.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/accessors-smart-1.2.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/android-json-0.0.20131108.vaadin1.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/asm-5.0.4.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/assertj-core-3.11.1.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/byte-buddy-1.9.3.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/byte-buddy-agent-1.9.3.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/filters-2.0.235.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/flatlaf-2.3.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/hamcrest-core-1.3.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/hamcrest-library-1.3.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/ice-3.7.10.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/icebox-3.7.10.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/jackson-databind-2.9.6.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/jgoodies-common-1.8.1.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/jgoodies-looks-2.5.3.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/jgraph-3.1.0.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/jgraphx-3.1.0.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/json-path-2.4.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/json-smart-2.3.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/jsonassert-1.5.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/junit-4.8.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/mockito-core-2.23.4.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/nativeskin-1.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/objenesis-2.6.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/pinyin4j-2.5.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/plt-clientbase-1.0.RELEASE.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/plt-common-1.0.RELEASE.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/plt-poi-2024.1-SNAPSHOT.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/plt-slice-1.0.RELEASE.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/plt-starter-2024.1-SNAPSHOT.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/plt-web-base-2024.1-SNAPSHOT.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/poi-scratchpad-3.9.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/protege35-1.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/skinlf-6.7.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/spring-boot-configuration-processor-2.1.3.RELEASE.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/spring-boot-starter-test-2.1.3.RELEASE.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/spring-boot-test-2.1.3.RELEASE.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/spring-boot-test-autoconfigure-2.1.3.RELEASE.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/spring-test-5.1.5.RELEASE.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/swing-worker-1.1.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/swingx-1.6.1.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/swixml-2.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/transmittable-thread-local-2.12.6.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/uitheme-1.3.1.jar 补丁 | 查看 | 原始文档 | blame | 历史
Bin/web/lib/xmlunit-core-2.6.2.jar 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionClsDTO.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionDTO.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionQueryDTO.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/ExportActionLogBean.java 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/ExportBeans.java 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/IExportLogBean.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java 405 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/PinyinCommon.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Bin/lib/service/BOFService.jar
Binary files differ
Bin/lib/service/WFService.jar
Binary files differ
Bin/web/lib/accessors-smart-1.2.jar
Binary files differ
Bin/web/lib/android-json-0.0.20131108.vaadin1.jar
Binary files differ
Bin/web/lib/asm-5.0.4.jar
Binary files differ
Bin/web/lib/assertj-core-3.11.1.jar
Binary files differ
Bin/web/lib/byte-buddy-1.9.3.jar
Binary files differ
Bin/web/lib/byte-buddy-agent-1.9.3.jar
Binary files differ
Bin/web/lib/filters-2.0.235.jar
Binary files differ
Bin/web/lib/flatlaf-2.3.jar
Binary files differ
Bin/web/lib/hamcrest-core-1.3.jar
Binary files differ
Bin/web/lib/hamcrest-library-1.3.jar
Binary files differ
Bin/web/lib/ice-3.7.10.jar
Binary files differ
Bin/web/lib/icebox-3.7.10.jar
Binary files differ
Bin/web/lib/jackson-databind-2.9.6.jar
Binary files differ
Bin/web/lib/jgoodies-common-1.8.1.jar
Binary files differ
Bin/web/lib/jgoodies-looks-2.5.3.jar
Binary files differ
Bin/web/lib/jgraph-3.1.0.0.jar
Binary files differ
Bin/web/lib/jgraphx-3.1.0.0.jar
Binary files differ
Bin/web/lib/json-path-2.4.0.jar
Binary files differ
Bin/web/lib/json-smart-2.3.jar
Binary files differ
Bin/web/lib/jsonassert-1.5.0.jar
Binary files differ
Bin/web/lib/junit-4.8.jar
Binary files differ
Bin/web/lib/mockito-core-2.23.4.jar
Binary files differ
Bin/web/lib/nativeskin-1.0.jar
Binary files differ
Bin/web/lib/objenesis-2.6.jar
Binary files differ
Bin/web/lib/pinyin4j-2.5.0.jar
Binary files differ
Bin/web/lib/plt-clientbase-1.0.RELEASE.jar
Binary files differ
Bin/web/lib/plt-common-1.0.RELEASE.jar
Binary files differ
Bin/web/lib/plt-poi-2024.1-SNAPSHOT.jar
Binary files differ
Bin/web/lib/plt-slice-1.0.RELEASE.jar
Binary files differ
Bin/web/lib/plt-starter-2024.1-SNAPSHOT.jar
Binary files differ
Bin/web/lib/plt-web-base-2024.1-SNAPSHOT.jar
Binary files differ
Bin/web/lib/poi-scratchpad-3.9.jar
Binary files differ
Bin/web/lib/protege35-1.0.jar
Binary files differ
Bin/web/lib/skinlf-6.7.jar
Binary files differ
Bin/web/lib/spring-boot-configuration-processor-2.1.3.RELEASE.jar
Binary files differ
Bin/web/lib/spring-boot-starter-test-2.1.3.RELEASE.jar
Binary files differ
Bin/web/lib/spring-boot-test-2.1.3.RELEASE.jar
Binary files differ
Bin/web/lib/spring-boot-test-autoconfigure-2.1.3.RELEASE.jar
Binary files differ
Bin/web/lib/spring-test-5.1.5.RELEASE.jar
Binary files differ
Bin/web/lib/swing-worker-1.1.jar
Binary files differ
Bin/web/lib/swingx-1.6.1.jar
Binary files differ
Bin/web/lib/swixml-2.0.jar
Binary files differ
Bin/web/lib/transmittable-thread-local-2.12.6.jar
Binary files differ
Bin/web/lib/uitheme-1.3.1.jar
Binary files differ
Bin/web/lib/xmlunit-core-2.6.2.jar
Binary files differ
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionClsDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
package com.vci.dto;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
 * Action分类传输对象
 * @author yuxc
 * @date 2024/8/16 15:50
 */
@Data
public class PLActionClsDTO implements java.io.Serializable{
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2009350578651813260L;
    /**
     *主键
     */
    public String id;
    /**
     *分类名称
     */
    public String name;
    /**
     *父主键
     */
    public String pid;
    /**
     *备注
     */
    public String description;
    /**
     *创建人
     */
    public String creator;
    /**
     *创建时间
     */
    public long createTime;
    /**
     *分类序号
     */
    public short serialno;
    /**
     * å­èŠ‚ç‚¹
     */
    public List<PLActionClsDTO> childs = new ArrayList<>();
    /**
     * å½“前分类下的所有action
     */
    public List<PLActionDTO> actionChilds = new ArrayList<>();
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,70 @@
package com.vci.dto;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
 * Action传输对象
 * @author yuxc
 * @date 2024/8/20 16:47
 */
@Data
public class PLActionDTO implements java.io.Serializable{
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2009350578651813260L;
    /**
     * ä¸»é”®
     */
    private String plOId;
    /**
     * ç¼–号
     */
    private String plCode;
    /**
     * åç§°
     */
    private String plName;
    /**
     * B/S地址,界面类路径
     */
    private String plBSUrl;
    /**
     * c/s类路径 ç•Œé¢é“¾æŽ¥åœ°å€
     */
    private String plCSClass;
    /**
     * æè¿°
     */
    private String plDesc;
    /**
     * ç±»åž‹
     */
    private String plTypeType;
    /**
     * åˆ›å»ºæ—¶é—´
     */
    private long plCreateTime;
    /**
     * åˆ›å»ºäºº
     */
    private String plCreateUser;
    /**
     * ä¿®æ”¹æ—¶é—´
     */
    private long plModifyTime;
    /**
     * ä¿®æ”¹äºº
     */
    private String plModifyUser;
    private String plLicensOrs;
    /**
     * çˆ¶èŠ‚ç‚¹id
     */
    private String plActionCls;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/PLActionQueryDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
package com.vci.dto;
import lombok.Data;
/**
 * Action查询传输对象
 * @author yuxc
 * @date 2024/8/20 14:45
 */
@Data
public class PLActionQueryDTO implements java.io.Serializable{
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = 2009350578651813260L;
    /**
     *编号
     */
    private String plcode;
    /**
     *名称
     */
    private String plname;
    /**
     *B/S类路径
     */
    private String plbsurl;
    /**
     *C/S类路径
     */
    private String plcsclass;
    /**
     *业务类型
     */
    private String pltypetype;
    /**
     *描述
     */
    private String pldesc;
    /**
     *分类ID
     */
    private String plactioncls;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsActionController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,160 @@
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.PLActionQueryDTO;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.web.service.OsActionServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
/**
 * Action管理的控制器
 * @author yuxc
 * @date 2024-8-16
 */
@RequestMapping("/actionController")
@RestController
public class OsActionController {
    /**
     * Action服务
     */
    @Autowired
    private OsActionServiceI osActionServiceI;
    /**
     * ä¿å­˜Action分类信息
     * @param pLActionCls Action分类信息
     * @return ä¿å­˜ç»“æžœ
     */
    @PostMapping("/saveActionCls")
    public BaseResult saveActionCls(@RequestBody PLActionClsDTO pLActionCls){
        try {
            return osActionServiceI.saveActionCls(pLActionCls);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * ä¿®æ”¹Action分类信息
     * @param pLActionCls Action分类信息
     * @return ä¿®æ”¹ç»“æžœ
     */
    @PostMapping("/updateActionCls")
    public BaseResult updateActionCls(@RequestBody PLActionClsDTO pLActionCls){
        try {
            return osActionServiceI.updateActionCls(pLActionCls);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * èŽ·å–Action分类树
     * isExp æ˜¯å¦ç”¨æˆ·å¯¼å‡º true是,false否
     * @return æŸ¥è¯¢ç»“æžœ
     */
    @GetMapping("/getActionTree")
    public BaseResult getActionTree(boolean isExp){
        try {
            return osActionServiceI.getActionTree(isExp);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * èŽ·å–Action表格数据
     * dto æŸ¥è¯¢æ¡ä»¶
     * @return æŸ¥è¯¢ç»“æžœ
     */
    @PostMapping("/getActionTableData")
    public BaseResult getActionTableData(@RequestBody PLActionQueryDTO dto){
        try {
            return osActionServiceI.getActionTableData(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("/saveAction")
    public BaseResult saveAction(@RequestBody PLActionDTO dto){
        try {
            return osActionServiceI.saveAction(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("/updateAction")
    public BaseResult updateAction(@RequestBody PLActionDTO dto){
        try {
            return osActionServiceI.updateAction(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 åˆ é™¤ç»“æžœ
     */
    @DeleteMapping("/deleteAction")
    public BaseResult deleteAction(@RequestBody PLActionDTO dto){
        try {
            return osActionServiceI.deleteAction(dto);
        } catch (PLException e) {
            BaseResult objectBaseResult = new BaseResult<>();
            objectBaseResult.setCode(Integer.parseInt(e.code));
            objectBaseResult.setMsg(Arrays.toString(e.messages));
            return objectBaseResult;
        }
    }
    /**
     * å¯¼å‡ºAction
     * @return
     */
    @PostMapping("/exportBeans")
    public void exportBeans(@RequestBody List<String> actionOid, HttpServletResponse response) throws PLException, IOException {
        osActionServiceI.exportBeans(actionOid, response);
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/ExportActionLogBean.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,156 @@
package com.vci.web.other;
import java.text.SimpleDateFormat;
import java.util.Date;
public class ExportActionLogBean implements IExportLogBean {
    /**
     *
     */
    private static final long serialVersionUID = 10086L;
    private String no = "1";
    private static int index = 1;
    private String exportState = "正常";
    private String coding = "";
    private String name ="";
    private String CSRegister = "";
    private String BSRegister = "";
    private String type = "";
    private String description = "";
    private String category = "";
    private Date date = null;
    private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
    public ExportActionLogBean() {
           this( "-1", "ExportActionLogBean å¯¹è±¡æž„建 ä½†æœªè®¾ç½®å€¼", "null",
                     "null", "null",  "null",  "null",
                     "null",  "null" );
           index = 1;
    }
    public ExportActionLogBean(String exportState, String coding,
            String name, String cSRegister, String bSRegister, String type,
            String description, String category) {
          this( ""+index++, exportState, coding,
                  name, cSRegister, bSRegister,type,
                  description,category);
    }
    public ExportActionLogBean(String no, String exportState, String coding,
            String name, String cSRegister, String bSRegister, String type,
            String description, String category) {
        super();
        this.no = no;
        if( exportState!=null || !no.equals("-1")){//默认状态为正常
            this.exportState = exportState;
        }
        this.coding = coding;
        this.name = name;
        CSRegister = cSRegister;
        BSRegister = bSRegister;
        this.type = type;
        this.description = description;
        this.category = category;
    }
    @Override
    public Object[] getLogRowObjcets() {
        Object obj []=  {no,exportState,coding,name,CSRegister,BSRegister,type,description,category};
        return obj;
    }
    public Object[] getInportLogRowObjcets() {
        Object obj []=  {no,exportState,coding,name,CSRegister,BSRegister,type,description};
        return obj;
    }
    public String getNo() {
        return no;
    }
    public String getExportState() {
        return exportState;
    }
    public String getName() {
        return name;
    }
    public String getCSRegister() {
        return CSRegister;
    }
    public String getBSRegister() {
        return BSRegister;
    }
    public String getType() {
        return type;
    }
    public String getDescription() {
        return description;
    }
    public String getCategory() {
        return category;
    }
    public void setNo(String no) {
        this.no = no;
    }
    public void setExportState(String exportState) {
        this.exportState = exportState;
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setCSRegister(String cSRegister) {
        CSRegister = cSRegister;
    }
    public void setBSRegister(String bSRegister) {
        BSRegister = bSRegister;
    }
    public void setType(String type) {
        this.type = type;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public void setCategory(String category) {
        this.category = category;
    }
    @Override
    public String getLogRowContent() {
        date = new Date();
        String info =format.format(date)+"---------";
        return info+" [序号=" + no + ", å¯¼å‡ºçŠ¶æ€=" + exportState
                + ", ç¼–号=" + coding + ", åç§°=" + name + ", CS注册="
                + CSRegister + ", BS注册=" + BSRegister + ", ç±»åž‹=" + type
                + ", æè¿°=" + description + ", æ‰€å±žåˆ†ç±»=" + category
                + "]";
    }
    public String getCoding() {
        return coding;
    }
    public void setCoding(String coding) {
        this.coding = coding;
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/ExportBeans.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,153 @@
package com.vci.web.other;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import com.vci.corba.portal.data.PLAction;
import com.vci.corba.portal.data.PLActionCls;
import com.vci.corba.portal.data.PLActionParam;
public class ExportBeans implements Serializable{
    private static final long serialVersionUID = 10086L;
    private HashMap<String/*ActionId*/,PLAction>   PLActionBeans = new  HashMap<String,PLAction>();
    private HashMap<String/*分类名称*/,String/*id*/> PLActionClsExt = new  HashMap<String,String>();
    private HashMap<String/*id*/,PLActionCls>   PLActionClsBeans = new  HashMap<String,PLActionCls>();
    private HashMap<String/*Action编码*/, ArrayList<PLActionParam> >   PLActionParamBeans = new  HashMap<String, ArrayList<PLActionParam> >();
    private HashMap<String/*ActionCls编码*/, ArrayList<PLAction> >   PLActionListsMap = null;
    private ExportActionLogBean logBean = null;//日志文件
    public ExportBeans() {
        logBean = new ExportActionLogBean();
    }
    public HashMap<String, PLActionCls> getPLActionClsBeans() {
        return PLActionClsBeans;
    }
    public HashMap<String, PLAction> getPLActions() {
        return PLActionBeans;
    }
    public void addPLActionClsBean(PLActionCls pLActionCls){
        PLActionClsBeans.put(pLActionCls.id, pLActionCls);
        PLActionClsExt.put(pLActionCls.name,pLActionCls.id);
    }
    public PLActionCls getPLActionClsBeanById(String  id){
        return PLActionClsBeans.get(id);
    }
    public PLActionCls getPLActionClsBeanByName(String  name){
        if(PLActionClsExt.get(name) == null){
            return null;
        }
        return PLActionClsBeans.get(PLActionClsExt.get(name));
    }
    /**
     * æ·»åŠ PLActionBean并同时添加PLActionBean对应参数进行记录
     * @param pLAction
     */
//    public void addPLActionBean(PLAction pLAction){
//        this.addPLActionBean(pLAction,null);
//    }
    /**
     * æ·»åŠ PLActionBean后 logBean存入值
     *
     */
    public void setLogBean(ExportActionLogBean logBean) {
        this.logBean =  logBean;
    }
    /**
     * æ·»åŠ PLActionBean后 logBean存入值
     *
     */
    public ExportActionLogBean getLogBean() {
        return logBean;
    }
    public PLAction getPLActionById(String pLActionId){
        return PLActionBeans.get(pLActionId);
    }
    public ArrayList<PLAction> getPLActionByPlActionClsId(String plActionClsId){
        if( PLActionListsMap == null){
            PLActionListsMap = new HashMap<String/*ActionCls编码*/,ArrayList<PLAction>>();
            for (Entry<String, PLAction> PLActionEntry : PLActionBeans.entrySet()) {
                String PLActionListsMapKey = PLActionEntry.getValue().plActionCls ;
                if(PLActionListsMapKey.equals("")){
                    PLActionListsMapKey = "when key is null ,change the key to this";
                }
                ArrayList<PLAction> actionList = PLActionListsMap.get(PLActionListsMapKey);
                if( actionList == null){
                     actionList =     new ArrayList<PLAction>();
                    actionList.add(PLActionEntry.getValue());
                    PLActionListsMap.put(PLActionListsMapKey,actionList);
                }else{
                    actionList.add(PLActionEntry.getValue());
                }
            }
        };
        if(plActionClsId.equals("")){
            plActionClsId = "when key is null ,change the key to this";
        }
        return     PLActionListsMap.get(plActionClsId);
    }
    public void addPLActionParamBean(PLActionParam pLActionParam){
        if(pLActionParam.action!=null && pLActionParam.action!=""){
            if(PLActionParamBeans.get(pLActionParam.action) == null){
                ArrayList<PLActionParam> arraylist = new ArrayList<PLActionParam>();
                PLActionParamBeans.put(pLActionParam.action, arraylist);
            }
            PLActionParamBeans.get(pLActionParam.action).add(pLActionParam);
        }
    }
     public  PLActionParam[] getPLActionParamArrayByActionId(String paramString){
         ArrayList<PLActionParam> pLActionParams = PLActionParamBeans.get(paramString);
         if(pLActionParams != null && pLActionParams.size() > 0 ){
            PLActionParam[] actionParams = new PLActionParam[pLActionParams.size()];
            for (int i = 0; i < pLActionParams.size(); i++) {
                actionParams[i] = pLActionParams.get(i);
            }
             return  actionParams;
         }
        return null;
     }
//        /**
//         * æ·»åŠ PLActionBean并同时添加PLActionBean对应参数进行记录
//         * èƒ½è¿‡æ–¹ä¾¿èŽ·å¾—category时用此方法. å¯ä»¥é™ä½Žç³»ç»Ÿæ¶ˆè€—
//         * @param pLAction
//         */
//    public void addPLActionBean(PLAction plAction, String category) {
//        PLActionBeans.put(plAction.plOId, plAction);
//        PLActionCls[] plActionCls = null;
//
//        try {
//              if(category == null ){
//                  plActionCls = UITools.getService().getPLActionClsArray();
//                    for (PLActionCls plActionCls2 : plActionCls) {//获得分类名称
//                        if(plActionCls2.id.equals(plAction.plActionCls)){
//                            category = plActionCls2.name ;
//                        }
//                    }
//                }
//            PLActionParam[] params = UITools.getService().getPLActionParamArrayByActionId(plAction.plOId);
//            if(params != null && params.length > 0){//如果参数存在
//                for (PLActionParam plActionParam : params) {//添加action参数
//                    this.addPLActionParamBean(plActionParam);
//                }
//            }
//             logBean = new ExportActionLogBean(ExportActionLogBean.RIGHT_STATE,
//                        plAction.plCode,plAction.plName,plAction.plCSClass,plAction.plBSUrl,
//                        plAction.plTypeType,plAction.plDesc,category);
//
//        } catch (PLException e) {
//             logBean = new ExportActionLogBean(e.getMessage(),
//                        plAction.plCode,plAction.plName,plAction.plCSClass,plAction.plBSUrl,
//                        plAction.plTypeType,plAction.plDesc,category);            e.printStackTrace();
//        }
//    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/other/IExportLogBean.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
package com.vci.web.other;
import java.io.Serializable;
public interface IExportLogBean extends Serializable{
    static final long serialVersionUID = 1L;
     static String RIGHT_STATE = "正常";
    /**
     * è¿”回字符串数组将内容写入到JTable文件中
     * @return
     */
    public abstract Object[] getLogRowObjcets();
    /**
     * è¿”回字符串将内容写入到log文件中
     * @return
     */
    public abstract String getLogRowContent();
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsActionServiceI.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
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.PLActionQueryDTO;
import com.vci.starter.web.pagemodel.BaseResult;
import org.springframework.web.bind.annotation.RequestBody;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
/**
 * Action管理的服务
 * @author yuxc
 * @date 2024-8-16
 */
public interface OsActionServiceI {
    /**
     * ä¿å­˜Action分类信息
     * @param pLActionCls Action分类信息
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult saveActionCls(PLActionClsDTO pLActionCls) throws PLException;
    /**
     * ä¿®æ”¹Action分类信息
     * @param pLActionCls Action分类信息
     * @return ä¿®æ”¹ç»“æžœ
     */
    BaseResult updateActionCls(PLActionClsDTO pLActionCls) throws PLException;
    /**
     * èŽ·å–Action分类树
     * isExp æ˜¯å¦ç”¨æˆ·å¯¼å‡º true是,false否
     * @return æŸ¥è¯¢ç»“æžœ
     */
    BaseResult getActionTree(boolean isExp) throws PLException;
    /**
     * èŽ·å–Action表格数据
     * dto æŸ¥è¯¢æ¡ä»¶
     * @return æŸ¥è¯¢ç»“æžœ
     */
    BaseResult getActionTableData(PLActionQueryDTO dto) throws PLException;
    /**
     * ä¿å­˜Action数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    BaseResult saveAction(PLActionDTO dto) throws PLException;
    /**
     * ä¿®æ”¹Action数据
     * dto action传输对象
     * @return ä¿®æ”¹ç»“æžœ
     */
    BaseResult updateAction(PLActionDTO dto) throws PLException;
    /**
     * åˆ é™¤Action数据
     * dto action传输对象
     * @return åˆ é™¤ç»“æžœ
     */
    BaseResult deleteAction(PLActionDTO dto) throws PLException;
    /**
     * å¯¼å‡ºAction
     * @return
     */
    void exportBeans(List<String> actionOid, HttpServletResponse response) throws PLException, IOException;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsActionServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,405 @@
package com.vci.web.service.impl;
import cn.hutool.core.io.FileUtil;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.ltm.LinkType;
import com.vci.corba.omd.qtm.QTInfo;
import com.vci.corba.portal.data.Constraint;
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.PLActionQueryDTO;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.web.other.ExportActionLogBean;
import com.vci.web.other.ExportBeans;
import com.vci.web.other.LinkQTExportData;
import com.vci.web.service.*;
import com.vci.web.util.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
/**
 * Action管理的服务实现类
 * @author yuxc
 * @date 2024-8-16
 */
@Service
public class OsActionServiceImpl implements OsActionServiceI {
    @Autowired
    private PlatformClientUtil platformClientUtil;
    /**
     * ä¿å­˜Action分类信息
     * @param pLActionCls Action分类信息
     * @return ä¿å­˜ç»“æžœ
     */
    @Override
    public BaseResult saveActionCls(PLActionClsDTO pLActionCls) throws PLException {
        if (pLActionCls.getName() == null || pLActionCls.getName().trim().equals("")) {
            throw new PLException("500", new String[]{"分类名称不能为空!"});
        }
        if (pLActionCls.getName().equals("未分类")) {
            throw new PLException("500", new String[]{"未分类节点已经存在!"});
        }
        PLActionCls pac = new PLActionCls();
        pac.id = WebUtil.getSnowflakePk();
        pac.name = pLActionCls.getName();
        pac.pid = pLActionCls.getPid();
        pac.description = pLActionCls.getDescription() == null ? "" : pLActionCls.getDescription();
        pac.creator = WebUtil.getCurrentUserId();
        pac.createTime = System.currentTimeMillis();
        pac.serialno = pLActionCls.getSerialno();
        // ä¿å­˜åˆ†ç±»ä¿¡æ¯
        String message = platformClientUtil.getUIService().creaetePLActionCls(pac);
        if (message.startsWith("0")) {
            if (message.equals("01")) {
                message = "分类" + pac.name + "已经存在!";
            } else if (message.equals("02")) {
                message = "同一分类下序号不能重复!";
            } else {
                message = "保存分类时发生异常!" + message.substring(1);
            }
            throw new PLException("500", new String[]{message});
        }
        return BaseResult.success("分类创建成功!");
    }
    /**
     * ä¿®æ”¹Action分类信息
     * @param pLActionCls Action分类信息
     * @return ä¿å­˜ç»“æžœ
     */
    @Override
    public BaseResult updateActionCls(PLActionClsDTO pLActionCls) throws PLException {
        if (pLActionCls.getName() == null || pLActionCls.getName().trim().equals("")) {
            throw new PLException("500", new String[]{"分类名称不能为空!"});
        }
        if (pLActionCls.getName().equals("未分类")) {
            throw new PLException("500", new String[]{"未分类节点已经存在!"});
        }
        if (pLActionCls.getId() == null || pLActionCls.getId().trim().equals("")) {
            throw new PLException("500", new String[]{"主键不能为空!"});
        }
        PLActionCls pac = new PLActionCls();
        pac.name = pLActionCls.getName();
        pac.pid = pLActionCls.getPid();
        pac.description = pLActionCls.getDescription() == null ? "" : pLActionCls.getDescription();
        pac.creator = WebUtil.getCurrentUserId();
        pac.createTime = System.currentTimeMillis();
        pac.serialno = pLActionCls.getSerialno();
        // ä¿®æ”¹åˆ†ç±»ä¿¡æ¯
        String message = platformClientUtil.getUIService().editPLActionCls(pac);
        if (message.startsWith("0")) {
            if (message.equals("01")) {
                message = "分类" + pac.name + "已经存在!";
            } else if (message.equals("02")) {
                message = "同一分类下序号不能重复!";
            } else {
                message = "修改分类时发生异常!" + message.substring(1);
            }
            throw new PLException("500", new String[]{message});
        }
        return BaseResult.success("分类修改成功!");
    }
    /**
     * èŽ·å–Action分类树
     * isExp æ˜¯å¦ç”¨æˆ·å¯¼å‡º true是,false否
     * @return æŸ¥è¯¢ç»“æžœ
     */
    @Override
    public BaseResult getActionTree(boolean isExp) throws PLException {
        PLActionCls[] clses = platformClientUtil.getUIService().getPLActionClsArray();
        PLActionClsDTO treDto = new PLActionClsDTO();
        treDto.setName("Action分类");
        Map<String, List<PLActionCls>> allDataMap = Arrays.stream(clses).collect(Collectors.groupingBy(pl -> pl.pid));
        for (PLActionCls cls : clses) {
            if (StringUtils.isBlank(cls.pid)) {
                PLActionClsDTO parentDto = new PLActionClsDTO();
                parentDto.setId(cls.id);
                parentDto.setName(cls.name);
                parentDto.setPid(cls.pid);
                parentDto.setDescription(cls.description);
                parentDto.setCreator(cls.creator);
                parentDto.setCreateTime(cls.createTime);
                parentDto.setSerialno(cls.serialno);
                //这里处理导出树的逻辑
                if(isExp){
                    Constraint[] consArray = new Constraint[1];
                    consArray[0] =  new Constraint("plactioncls", cls.id);
                    PLAction[] plActionsByConsArray = platformClientUtil.getUIService().getPLActionsByConsArray(consArray);
                    if(parentDto.getChilds().isEmpty() && plActionsByConsArray.length == 0){
                        continue;
                    }
                    for (PLAction plAction : plActionsByConsArray) {
                        PLActionDTO plActionDTO = new PLActionDTO();
                        plActionDTO.setPlName(plAction.plCode + "/" + plAction.plName);
                        plActionDTO.setPlCode(plAction.plCode);
                        plActionDTO.setPlOId(plAction.plOId);
                        parentDto.getActionChilds().add(plActionDTO);
                    }
                }
                addClsTreeNode(parentDto, allDataMap, isExp);
                treDto.getChilds().add(parentDto);
            }
        }
        PLActionClsDTO plac = new PLActionClsDTO();
        plac.setName("未分类");
        if(isExp){
            Constraint[] consArray = new Constraint[1];
            consArray[0] =  new Constraint("plactioncls", "");
            PLAction[] plActionsByConsArray = platformClientUtil.getUIService().getPLActionsByConsArray(consArray);
            for (PLAction plAction : plActionsByConsArray) {
                PLActionDTO plActionDTO = new PLActionDTO();
                plActionDTO.setPlName(plAction.plCode + "/" + plAction.plName);
                plActionDTO.setPlCode(plAction.plCode);
                plActionDTO.setPlOId(plAction.plOId);
                plac.getActionChilds().add(plActionDTO);
            }
        }
        treDto.getChilds().add(plac);
        return BaseResult.success(treDto);
    }
    /**
     * èŽ·å–Action表格数据
     * dto æŸ¥è¯¢æ¡ä»¶
     * @return æŸ¥è¯¢ç»“æžœ
     */
    @Override
    public BaseResult getActionTableData(PLActionQueryDTO dto) throws PLException {
        Constraint[] consArray ;
        if(StringUtils.isNotBlank(dto.getPlactioncls())){
            consArray = new Constraint[7];
            consArray[6] = new Constraint("plactioncls", dto.getPlactioncls());
        }else {
            consArray = new Constraint[6];
        }
        consArray[0] = new Constraint("plcode", dto.getPlcode());
        consArray[1] = new Constraint("plname", dto.getPlname());
        consArray[2] = new Constraint("plbsurl", dto.getPlbsurl());
        consArray[3] = new Constraint("plcsclass", dto.getPlcsclass());
        consArray[4] = new Constraint("pltypetype", dto.getPltypetype());
        consArray[5] = new Constraint("pldesc", dto.getPldesc());
        PLAction[] plActionsByConsArray = platformClientUtil.getUIService().getPLActionsByConsArray(consArray);
        Arrays.sort(plActionsByConsArray, new Comparator<PLAction>() {
            @Override
            public int compare(PLAction o1, PLAction o2) {
                String py1 = PinyinCommon.getPingYin(o1.plCode);
                String py2 = PinyinCommon.getPingYin(o2.plCode);
                return py1.compareTo(py2);
            }
        });
        return BaseResult.dataList(Arrays.asList(plActionsByConsArray));
    }
    /**
     * ä¿å­˜Action数据
     * dto action传输对象
     * @return ä¿å­˜ç»“æžœ
     */
    @Override
    public BaseResult saveAction(PLActionDTO dto) throws PLException {
        if(StringUtils.isBlank(dto.getPlCode())){
            throw new PLException("500", new String[]{"请输入编号"});
        }
        PLAction[] actionsInDB= platformClientUtil.getUIService().getAllPLAction();
        for(int i =0;i<actionsInDB.length;i++){
            if (dto.getPlCode().equals(actionsInDB[i].plCode)) {
                throw new PLException("500", new String[]{"新建Action编号重复,请重新输入编号"});
            }
        }
        PLAction plAction = new PLAction();
        plAction.plOId = WebUtil.getSnowflakePk();
        plAction.plCode = StringUtils.defaultString(dto.getPlCode());
        plAction.plName = StringUtils.defaultString(dto.getPlName());
        plAction.plCSClass = StringUtils.defaultString(dto.getPlCSClass());
        plAction.plBSUrl = StringUtils.defaultString(dto.getPlBSUrl());
        plAction.plDesc = StringUtils.defaultString(dto.getPlDesc());
        plAction.plCreateUser = WebUtil.getCurrentUserId();
        plAction.plModifyUser = WebUtil.getCurrentUserId();
        plAction.plActionCls = StringUtils.defaultString(dto.getPlActionCls());
        plAction.plTypeType = StringUtils.defaultString(dto.getPlTypeType());
        boolean b = platformClientUtil.getUIService().savePLAction(plAction);
        if(!b){
            throw new PLException("500", new String[]{"保存失败!!"});
        }
        return BaseResult.success("操作成功!");
    }
    /**
     * ä¿®æ”¹Action数据
     * dto action传输对象
     * @return ä¿®æ”¹ç»“æžœ
     */
    @Override
    public BaseResult updateAction(PLActionDTO dto) throws PLException {
        if(StringUtils.isBlank(dto.getPlCode())){
            throw new PLException("500", new String[]{"编号不能为空"});
        }
        PLAction[] actionsInDB= platformClientUtil.getUIService().getAllPLAction();
        for(int i =0;i<actionsInDB.length;i++){
            if (dto.getPlCode().equals(actionsInDB[i].plCode) && !dto.getPlOId().equals(actionsInDB[i].plOId)) {
                throw new PLException("500", new String[]{"修改Action编号重复,请确认编号"});
            }
        }
        PLAction plAction = new PLAction();
        plAction.plOId = StringUtils.defaultString(dto.getPlOId());
        plAction.plCode = StringUtils.defaultString(dto.getPlCode());
        plAction.plName = StringUtils.defaultString(dto.getPlName());
        plAction.plCSClass = StringUtils.defaultString(dto.getPlCSClass());
        plAction.plBSUrl = StringUtils.defaultString(dto.getPlBSUrl());
        plAction.plDesc = StringUtils.defaultString(dto.getPlDesc());
        plAction.plCreateUser = dto.getPlCreateUser();
        plAction.plModifyUser = WebUtil.getCurrentUserId();
        plAction.plActionCls = StringUtils.defaultString(dto.getPlActionCls());
        plAction.plTypeType = StringUtils.defaultString(dto.getPlTypeType());
        boolean b = platformClientUtil.getUIService().updatePLAction(plAction);
        if(!b){
            throw new PLException("500", new String[]{"修改失败!!"});
        }
        return BaseResult.success("修改成功!");
    }
    /**
     * åˆ é™¤Action数据
     * dto action传输对象
     * @return åˆ é™¤ç»“æžœ
     */
    @Override
    public BaseResult deleteAction(PLActionDTO dto) throws PLException {
        PLAction plAction = new PLAction();
        plAction.plOId = StringUtils.defaultString(dto.getPlOId());
        plAction.plCode = StringUtils.defaultString(dto.getPlCode());
        plAction.plName = StringUtils.defaultString(dto.getPlName());
        plAction.plCSClass = StringUtils.defaultString(dto.getPlCSClass());
        plAction.plBSUrl = StringUtils.defaultString(dto.getPlBSUrl());
        plAction.plDesc = StringUtils.defaultString(dto.getPlDesc());
        plAction.plCreateUser = dto.getPlCreateUser();
        plAction.plModifyUser = WebUtil.getCurrentUserId();
        plAction.plActionCls = StringUtils.defaultString(dto.getPlActionCls());
        plAction.plTypeType = StringUtils.defaultString(dto.getPlTypeType());
        boolean b = platformClientUtil.getUIService().deletePLAction(plAction);
        if(!b){
            throw new PLException("500", new String[]{"删除失败!!"});
        }
        return BaseResult.success("删除成功!");
    }
    /**
     * å¯¼å‡ºAction
     * @return
     */
    @Override
    public void exportBeans(List<String> actionOid, HttpServletResponse response) throws PLException, IOException {
        String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
        String vciqtmfFileName = defaultTempFolder + File.separator + "actionTemplateExp" + new Date().getTime() + ".vciamf";
        HashMap exportBeans = new HashMap<String, Object>();
        getExportBeans(actionOid, exportBeans);// èŽ·å¾—å¯¼å‡ºBean同时,记录log
        ObjectOutputStream vciamfFileStream = null;
        try {
            File vciqtmfFile = new File(vciqtmfFileName);
            vciamfFileStream = new ObjectOutputStream(new FileOutputStream(vciqtmfFile));
            vciamfFileStream.writeObject(exportBeans);
        }finally {
            try {
                if (vciamfFileStream != null) {
                    vciamfFileStream.flush();
                    vciamfFileStream.close();
                }
            } catch (Exception e) {
                throw new PLException("500",new String[]{"导出流关闭异常!"});
            }
        }
        ControllerUtil.writeFileToResponse(response,vciqtmfFileName);
        FileUtil.del(defaultTempFolder + File.separator);
    }
    /**
     * å¤„理导出的对象
     * @param actionOid ç•Œé¢é€‰æ‹©çš„action列表数据
     * @param exportBeansMap å¯¼å‡ºå¯¹è±¡
     * @return
     * @throws PLException
     */
    private void getExportBeans(List<String> actionOid, HashMap exportBeansMap) throws PLException {
        PLActionCls[] plActionClsArray = platformClientUtil.getUIService().getPLActionClsArray();
        Map<String, PLActionCls> clsMap = Arrays.stream(plActionClsArray).collect(Collectors.toMap(e -> e.id, e -> e));
        ExportBeans exportBeans = new ExportBeans();
        for (String oid : actionOid) {
            PLAction plAction = platformClientUtil.getUIService().getPLActionById(oid);
            //有父节点则进行处理
            if(StringUtils.isNotBlank(plAction.plActionCls)){
                allPLActionClsParent(exportBeans, clsMap.get(plAction.plActionCls), clsMap);
            }
            exportBeans.getPLActions().put(plAction.plOId, plAction);
            PLActionParam[] params = platformClientUtil.getUIService().getPLActionParamArrayByActionId(plAction.plOId);
            if(params != null && params.length > 0){//如果参数存在
                for (PLActionParam plActionParam : params) {//添加action参数
                    exportBeans.addPLActionParamBean(plActionParam);
                }
            }
            String category = clsMap.containsKey(plAction.plActionCls) ? clsMap.get(plAction.plActionCls).name : "";
            exportBeans.setLogBean(new ExportActionLogBean(ExportActionLogBean.RIGHT_STATE,
                    plAction.plCode,plAction.plName,plAction.plCSClass,plAction.plBSUrl,
                    plAction.plTypeType,plAction.plDesc,category));
        }
        exportBeansMap.put("exportBeans", exportBeans);
    }
    //增加父类数据
    private void allPLActionClsParent(ExportBeans exportBeans, PLActionCls cls, Map<String, PLActionCls> clsMap) {
        if(cls.pid != ""){
            allPLActionClsParent(exportBeans, clsMap.get(cls.pid), clsMap);
        }
        exportBeans.addPLActionClsBean(cls);
    }
    /**
     * æ·»åŠ å­èŠ‚ç‚¹
     * @param parentDto çˆ¶èŠ‚ç‚¹å¯¹è±¡
     * @param allDataMap æ‰€æœ‰åˆ†ç»„对象
     * @param isExp true为导出功能的树,false为界面分类树
     */
    private void addClsTreeNode(PLActionClsDTO parentDto, Map<String, List<PLActionCls>> allDataMap, Boolean isExp) throws PLException {
        if(allDataMap.containsKey(parentDto.id)){
            for (PLActionCls cls : allDataMap.get(parentDto.id)) {
                PLActionClsDTO childDto = new PLActionClsDTO();
                childDto.setId(cls.id);
                childDto.setName(cls.name);
                childDto.setPid(cls.pid);
                childDto.setDescription(cls.description);
                childDto.setCreator(cls.creator);
                childDto.setCreateTime(cls.createTime);
                childDto.setSerialno(cls.serialno);
                if(isExp){
                    Constraint[] consArray = new Constraint[1];
                    consArray[0] =  new Constraint("plactioncls", cls.id);
                    PLAction[] plActionsByConsArray = platformClientUtil.getUIService().getPLActionsByConsArray(consArray);
                    if(parentDto.getChilds().isEmpty() && plActionsByConsArray.length == 0){
                        continue;
                    }
                    for (PLAction plAction : plActionsByConsArray) {
                        PLActionDTO plActionDTO = new PLActionDTO();
                        plActionDTO.setPlName(plAction.plCode + "/" + plAction.plName);
                        plActionDTO.setPlCode(plAction.plCode);
                        plActionDTO.setPlOId(plAction.plOId);
                        parentDto.getActionChilds().add(plActionDTO);
                    }
                }
                addClsTreeNode(childDto, allDataMap, isExp);
                parentDto.getChilds().add(childDto);
            }
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/PinyinCommon.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,89 @@
package com.vci.web.util;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
/**
 *
 * @author: ligang
 * @createtime: 2012-12-26
 * @version:
 */
    public class PinyinCommon {
    /**
     * å¾—到 å…¨æ‹¼
     * @param src
     * @return
     */
    public static String getPingYin(String src){
        char[] t1 = null;
        t1=src.toCharArray();
        String[] t2 = new String[t1.length];
        HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat();
        t3.setCaseType(HanyuPinyinCaseType.LOWERCASE);
        t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
        t3.setVCharType(HanyuPinyinVCharType.WITH_V);
        String t4="";
        int t0=t1.length;
        try {
          for (int i=0;i<t0;i++) {
          //判断是否为汉字字符
             if(Character.toString(t1[i]).matches("[\\u4E00-\\u9FA5]+")) {
                  t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], t3);
                  t4+=t2[0];
             } else {
                  t4+= Character.toString(t1[i]);
             }
          }
          return t4;
        }
        catch (BadHanyuPinyinOutputFormatCombination e1) {
          e1.printStackTrace();
        }
        return t4;
    }
    /**
     * å¾—到中文首字母
     * @param str
     * @return
     */
    public static String getPinYinHeadChar(String str) {
        String convert = "";
        for (int j = 0; j < str.length(); j++) {
            char word = str.charAt(j);
            String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word);
            if (pinyinArray != null) {
                convert += pinyinArray[0].charAt(0);
            }else {
                convert += word;
            }
        }
        return convert;
    }
    /**
     * å°†å­—符串转移为ASCII码
     * @param cnStr
     * @return
     */
    public static String getCnASCII(String cnStr) {
        StringBuffer   strBuf   =   new   StringBuffer();
        byte[]   bGBK   =   cnStr.getBytes();
        for(int   i=0;i <bGBK.length;i++){
            //System.out.println(Integer.toHexString(bGBK[i]&0xff));
            strBuf.append(Integer.toHexString(bGBK[i]&0xff));
        }
        return strBuf.toString();
    }
}