Bin/lib/service/BOFService.jarBinary files differ
Bin/lib/service/WFService.jarBinary files differ
Bin/web/lib/accessors-smart-1.2.jarBinary files differ
Bin/web/lib/android-json-0.0.20131108.vaadin1.jarBinary files differ
Bin/web/lib/asm-5.0.4.jarBinary files differ
Bin/web/lib/assertj-core-3.11.1.jarBinary files differ
Bin/web/lib/byte-buddy-1.9.3.jarBinary files differ
Bin/web/lib/byte-buddy-agent-1.9.3.jarBinary files differ
Bin/web/lib/filters-2.0.235.jarBinary files differ
Bin/web/lib/flatlaf-2.3.jarBinary files differ
Bin/web/lib/hamcrest-core-1.3.jarBinary files differ
Bin/web/lib/hamcrest-library-1.3.jarBinary files differ
Bin/web/lib/ice-3.7.10.jarBinary files differ
Bin/web/lib/icebox-3.7.10.jarBinary files differ
Bin/web/lib/jackson-databind-2.9.6.jarBinary files differ
Bin/web/lib/jgoodies-common-1.8.1.jarBinary files differ
Bin/web/lib/jgoodies-looks-2.5.3.jarBinary files differ
Bin/web/lib/jgraph-3.1.0.0.jarBinary files differ
Bin/web/lib/jgraphx-3.1.0.0.jarBinary files differ
Bin/web/lib/json-path-2.4.0.jarBinary files differ
Bin/web/lib/json-smart-2.3.jarBinary files differ
Bin/web/lib/jsonassert-1.5.0.jarBinary files differ
Bin/web/lib/junit-4.8.jarBinary files differ
Bin/web/lib/mockito-core-2.23.4.jarBinary files differ
Bin/web/lib/nativeskin-1.0.jarBinary files differ
Bin/web/lib/objenesis-2.6.jarBinary files differ
Bin/web/lib/pinyin4j-2.5.0.jarBinary files differ
Bin/web/lib/plt-clientbase-1.0.RELEASE.jarBinary files differ
Bin/web/lib/plt-common-1.0.RELEASE.jarBinary files differ
Bin/web/lib/plt-poi-2024.1-SNAPSHOT.jarBinary files differ
Bin/web/lib/plt-slice-1.0.RELEASE.jarBinary files differ
Bin/web/lib/plt-starter-2024.1-SNAPSHOT.jarBinary files differ
Bin/web/lib/plt-web-base-2024.1-SNAPSHOT.jarBinary files differ
Bin/web/lib/poi-scratchpad-3.9.jarBinary files differ
Bin/web/lib/protege35-1.0.jarBinary files differ
Bin/web/lib/skinlf-6.7.jarBinary files differ
Bin/web/lib/spring-boot-configuration-processor-2.1.3.RELEASE.jarBinary files differ
Bin/web/lib/spring-boot-starter-test-2.1.3.RELEASE.jarBinary files differ
Bin/web/lib/spring-boot-test-2.1.3.RELEASE.jarBinary files differ
Bin/web/lib/spring-boot-test-autoconfigure-2.1.3.RELEASE.jarBinary files differ
Bin/web/lib/spring-test-5.1.5.RELEASE.jarBinary files differ
Bin/web/lib/swing-worker-1.1.jarBinary files differ
Bin/web/lib/swingx-1.6.1.jarBinary files differ
Bin/web/lib/swixml-2.0.jarBinary files differ
Bin/web/lib/transmittable-thread-local-2.12.6.jarBinary files differ
Bin/web/lib/uitheme-1.3.1.jarBinary files differ
Bin/web/lib/xmlunit-core-2.6.2.jarBinary 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(); } }