属性池、状态池、枚举导出列名调整,可通过变量控制导出的列名是否和导入模板的一致;版本管理查询、查看应用范围接口上传。
| | |
| | | /** |
| | | * 屿§ç±»å |
| | | */ |
| | | @ExcelColumn(value="屿§ç±»å(请åç
§æ°å¢çé¢ç屿§ç±»åå¡«å)",nullable = false) |
| | | @ExcelColumn(value="屿§ç±»å(åç
§æ°å¢çé¢ç屿§ç±»åå¦VTString)",nullable = false) |
| | | private String attributeDataType; |
| | | |
| | | /** |
| | |
| | | @VciBusinessLog(operateName = "导åºå±æ§") |
| | | public void exportAttributes(String exportFileName,String attrNames, HttpServletResponse response){ |
| | | try { |
| | | String excelPath = attributeService.exportAttributes(exportFileName,attrNames); |
| | | String excelPath = attributeService.exportAttributes(exportFileName,attrNames,false); |
| | | ControllerUtil.writeFileToResponse(response,excelPath); |
| | | } catch (Exception e) { |
| | | String msg = "å¯¼åºæä¸¾æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.web.controller; |
| | | |
| | | import com.vci.dto.OsRevisionRuleDTO; |
| | | import com.vci.pagemodel.OsRevisionRuleVO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.service.OsRevisionRuleServiceI; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * çæ¬è§åæ§å¶å¨ |
| | | * @author ludc |
| | | * @date 2024/7/30 16:02 |
| | | */ |
| | | @RequestMapping("/revisionRuleController") |
| | | @RestController |
| | | public class OsRevisionRuleController { |
| | | |
| | | @Autowired |
| | | private OsRevisionRuleServiceI revisionRuleServiceI; |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | | */ |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * çæ¬è§åå表(å
¨æ¥è¯¢) |
| | | * @return |
| | | */ |
| | | @GetMapping("/getVersionRuleAllList") |
| | | @VciUnCheckRight |
| | | public BaseResult getVersionRuleAllList(){ |
| | | try { |
| | | return BaseResult.dataList(revisionRuleServiceI.selectAllRevision()); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "çæ¬è§å管çå表æ¥è¯¢æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åºç¨èå´ |
| | | * @param vrName çæ¬è§åè±æåç§° |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUsedVersionRuleList") |
| | | @VciUnCheckRight |
| | | public BaseResult getUsedVersionRuleList(String vrName){ |
| | | try { |
| | | return BaseResult.dataList(revisionRuleServiceI.getUsedVersionRuleList(vrName)); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "çæ¬è§ååºç¨èå´æ¥è¯¢æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå»ºçæ¬è§å |
| | | * @param osRevisionRuleDTO çæ¬è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | @PostMapping("/addVersionRule") |
| | | @VciUnCheckRight |
| | | public BaseResult addVersionRule(@RequestBody OsRevisionRuleDTO osRevisionRuleDTO){ |
| | | try { |
| | | return revisionRuleServiceI.addVersionRule(osRevisionRuleDTO) ? BaseResult.success("çæ¬è§åæ·»å æåï¼"):BaseResult.fail("çæ¬è§åæ·»å 失败ï¼"); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å¢å 屿§æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹çæ¬è§å |
| | | * @param osRevisionRuleDTO çæ¬è§åæ°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateVersionRule") |
| | | @VciUnCheckRight |
| | | public BaseResult updateVersionRule(@RequestBody OsRevisionRuleDTO osRevisionRuleDTO){ |
| | | try { |
| | | return revisionRuleServiceI.updateVersionRule(osRevisionRuleDTO) ? BaseResult.success("çæ¬è§åæ·»å æåï¼"):BaseResult.fail("çæ¬è§åæ·»å 失败ï¼"); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "å¢å 屿§æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @VciBusinessLog(operateName = "导åºç¶æ") |
| | | public void exportStatus(String exportFileName,String statusOids, HttpServletResponse response){ |
| | | try { |
| | | String excelPath = statusService.exportStatus(exportFileName,statusOids); |
| | | String excelPath = statusService.exportStatus(exportFileName,statusOids,true); |
| | | ControllerUtil.writeFileToResponse(response,excelPath); |
| | | } catch (Exception e) { |
| | | String msg = "导åºç¶ææ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | |
| | | @VciBusinessLog(operateName = "å¯¼åºæä¸¾ç±»å") |
| | | public void exportEnumTypes(String exportFileName,String enumNames, HttpServletResponse response){ |
| | | try { |
| | | String excelPath = enumService.exportEnumTypes(exportFileName,enumNames); |
| | | String excelPath = enumService.exportEnumTypes(exportFileName,enumNames,false); |
| | | ControllerUtil.writeFileToResponse(response,excelPath); |
| | | } catch (Exception e) { |
| | | String msg = "å¯¼åºæä¸¾æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); |
| | |
| | | * 导åºéä¸ç屿§ |
| | | * @param exportFileName 导åºçæä»¶å |
| | | * @param attrNames éè¦å¯¼åºç屿§åç§° |
| | | * @param flag æ§å¶å¯¼åºçå忝å¦å导å
¥æ¨¡æ¿ä¸è´ |
| | | * @return |
| | | */ |
| | | String exportAttributes(String exportFileName,String attrNames) throws PLException; |
| | | String exportAttributes(String exportFileName,String attrNames,boolean flag/*æ§å¶å¯¼åºçå忝å¦å导å
¥æ¨¡æ¿ä¸è´*/) throws PLException; |
| | | |
| | | /** |
| | | * ä¸è½½å±æ§å¯¼å
¥æ¨¡æ¿ |
| | |
| | | * å¯¼åºæä¸¾ç±»å |
| | | * @param exportFileName 导åºçæä»¶å |
| | | * @param enumNames éè¦å¯¼åºçæä¸¾åç§° |
| | | * @param flag æ§å¶å¯¼åºçå忝å¦å导å
¥æ¨¡æ¿ä¸è´ |
| | | * @return |
| | | */ |
| | | String exportEnumTypes(String exportFileName,String enumNames) throws PLException; |
| | | String exportEnumTypes(String exportFileName,String enumNames,boolean flag/*æ§å¶å¯¼åºçå忝å¦å导å
¥æ¨¡æ¿ä¸è´*/) throws PLException; |
| | | |
| | | /** |
| | | * 导å
¥æä¸¾ |
| | |
| | | package com.vci.web.service; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.vrm.VersionRule; |
| | | import com.vci.dto.OsRevisionRuleDTO; |
| | | import com.vci.pagemodel.OsRevisionRuleVO; |
| | | |
| | | import java.util.Collection; |
| | |
| | | Map<String,OsRevisionRuleVO> selectAllRevisionMap(); |
| | | |
| | | /** |
| | | * åå»ºçæ¬è§å |
| | | * @param osRevisionRuleDTO |
| | | * @return |
| | | */ |
| | | boolean addVersionRule(OsRevisionRuleDTO osRevisionRuleDTO) throws PLException; |
| | | |
| | | /** |
| | | * ä¿®æ¹çæ¬è§å |
| | | * @param osRevisionRuleDTO |
| | | * @return |
| | | */ |
| | | boolean updateVersionRule(OsRevisionRuleDTO osRevisionRuleDTO); |
| | | |
| | | /** |
| | | * æ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ |
| | | * @param versionRules æ°æ®å¯¹è±¡ |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | OsRevisionRuleVO getRevisionRuleById(String id); |
| | | |
| | | /** |
| | | * æ¥è¯¢åºç¨èå´ |
| | | * @param vrName çæ¬è§åè±æåç§° |
| | | * @return |
| | | */ |
| | | List<Map<String, String>> getUsedVersionRuleList(String vrName) throws PLException; |
| | | |
| | | } |
| | |
| | | * @param statusOids éè¦å¯¼åºç屿§åç§° |
| | | * @return |
| | | */ |
| | | String exportStatus(String exportFileName,String statusOids) throws PLException; |
| | | String exportStatus(String exportFileName,String statusOids,boolean flag/*æ§å¶å¯¼åºçå忝å¦å导å
¥æ¨¡æ¿ä¸è´*/) throws PLException; |
| | | |
| | | /** |
| | | * ä¸è½½ç¶æå¯¼å
¥æ¨¡æ¿ |
| | |
| | | import com.vci.client.mw.ClientSessionUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.atm.AttributeDef; |
| | | import com.vci.corba.omd.vrm.VersionRule; |
| | | import com.vci.dto.OsAttributeDTO; |
| | | import com.vci.dto.OsEnumDTO; |
| | | import com.vci.dto.OsEnumItemDTO; |
| | |
| | | * 导åºéä¸ç屿§ |
| | | * @param exportFileName 导åºçæä»¶å |
| | | * @param attrNames éè¦å¯¼åºç屿§åç§° |
| | | * @param flag æ§å¶å¯¼åºçå忝å¦å导å
¥æ¨¡æ¿ä¸è´ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String exportAttributes(String exportFileName, String attrNames) throws PLException { |
| | | public String exportAttributes(String exportFileName, String attrNames,boolean flag/*æ§å¶å¯¼åºçå忝å¦å导å
¥æ¨¡æ¿ä¸è´*/) throws PLException { |
| | | if(Func.isBlank(attrNames)){ |
| | | throw new PLException("500",new String[]{"请å¾éè¦å¯¼åºç屿§!"}); |
| | | } |
| | | //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° |
| | | exportFileName = Func.isBlank(exportFileName) ? "屿§æ± ä¸å±æ§å¯¼åº_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; |
| | | //设置åå |
| | | List<String> columns = new ArrayList<>( |
| | | Arrays.asList("屿§å", "æ ç¾", "æè¿°", |
| | | "屿§ç±»å", "å
许为空", "é»è®¤å¼", "使ç¨çæä¸¾è±æåç§°(æä¸¾å)", |
| | | "使ç¨çæä¸¾ä¸æåç§°(æ ç¾)", "åç
§çä¸å¡ç±»åç¼å·", "åç
§çä¸å¡ç±»ååç§°", |
| | | "åç
§ç龿¥ç±»ååç§°","çæ¬çæ¬¡","屿§é¿åº¦", "å°æ°ç²¾åº¦ä½æ°","å°æ°å»åº¦ä½æ°","åå¼èå´","å建æ¶é´") |
| | | ); |
| | | List<String> columns = this.getCloumns(flag); |
| | | |
| | | //åexcel |
| | | String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; |
| | |
| | | excelDataList.add(new WriteExcelData(i+1,4, osAttributeVO.isNullableFlag())); |
| | | excelDataList.add(new WriteExcelData(i+1,5, osAttributeVO.getDefaultValue())); |
| | | excelDataList.add(new WriteExcelData(i+1,6, osAttributeVO.getEnumId())); |
| | | excelDataList.add(new WriteExcelData(i+1,7, osAttributeVO.getEnumName())); |
| | | excelDataList.add(new WriteExcelData(i+1,8, osAttributeVO.getBtmTypeId())); |
| | | excelDataList.add(new WriteExcelData(i+1,9, osAttributeVO.getBtmTypeName())); |
| | | excelDataList.add(new WriteExcelData(i+1,10, osAttributeVO.getAttrLength())); |
| | | excelDataList.add(new WriteExcelData(i+1,11, osAttributeVO.getLinkTypeName())); |
| | | excelDataList.add(new WriteExcelData(i+1,12, osAttributeVO.getVersion())); |
| | | excelDataList.add(new WriteExcelData(i+1,13, osAttributeVO.getPrecisionLength())); |
| | | excelDataList.add(new WriteExcelData(i+1,14, osAttributeVO.getScaleLength())); |
| | | excelDataList.add(new WriteExcelData(i+1,15, osAttributeVO.getRange())); |
| | | excelDataList.add(new WriteExcelData(i+1,16, osAttributeVO.getCreateTime())); |
| | | //excelDataList.add(new WriteExcelData(i+1,7, osAttributeVO.getEnumName())); |
| | | excelDataList.add(new WriteExcelData(i+1,7, osAttributeVO.getBtmTypeId())); |
| | | //excelDataList.add(new WriteExcelData(i+1,9, osAttributeVO.getBtmTypeName())); |
| | | excelDataList.add(new WriteExcelData(i+1,8, osAttributeVO.getAttrLength())); |
| | | excelDataList.add(new WriteExcelData(i+1,9, osAttributeVO.getLinkTypeName())); |
| | | excelDataList.add(new WriteExcelData(i+1,10, osAttributeVO.getVersion())); |
| | | excelDataList.add(new WriteExcelData(i+1,11, osAttributeVO.getPrecisionLength())); |
| | | excelDataList.add(new WriteExcelData(i+1,12, osAttributeVO.getScaleLength())); |
| | | excelDataList.add(new WriteExcelData(i+1,13, osAttributeVO.getRange())); |
| | | if(!flag){ |
| | | excelDataList.add(new WriteExcelData(i+1,14, Func.format(osAttributeVO.getCreateTime(),"yyyyå¹´MMæddæ¥ hh:mm:ss"))); |
| | | } |
| | | } |
| | | } |
| | | WriteExcelOption excelOption = new WriteExcelOption(excelDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | return excelPath; |
| | | } |
| | | |
| | | /** |
| | | * è·åå¯¼åºæå¯¼å
¥æ¨¡æ¿çåå |
| | | * @param flag æ¯å¦è·å导å
¥æ¨¡æ¿åå |
| | | * @return |
| | | */ |
| | | private List<String> getCloumns(boolean flag){ |
| | | if(flag){ |
| | | return new ArrayList<>( |
| | | Arrays.asList("屿§å", "æ ç¾", "æè¿°", |
| | | "屿§ç±»å(åç
§æ°å¢çé¢ç屿§ç±»åå¦VTString)", "å
许为空(æ¯/å¦)", "é»è®¤å¼", "使ç¨çæä¸¾è±æåç§°" |
| | | , "åç
§çä¸å¡ç±»åç¼å·","åç
§ç龿¥ç±»åç¼å·","çæ¬çæ¬¡","屿§é¿åº¦", "å°æ°ç²¾åº¦ä½æ°","å°æ°å»åº¦ä½æ°" |
| | | ,"åå¼èå´" |
| | | ) |
| | | ); |
| | | } |
| | | return new ArrayList<>( |
| | | Arrays.asList("屿§å", "æ ç¾", "æè¿°", |
| | | "屿§ç±»å", "å
许为空", "é»è®¤å¼", "使ç¨çæä¸¾è±æåç§°(æä¸¾å)", |
| | | "åç
§çä¸å¡ç±»åç¼å·", "åç
§ç龿¥ç±»åç¼å·","çæ¬çæ¬¡","屿§é¿åº¦", |
| | | "å°æ°ç²¾åº¦ä½æ°","å°æ°å»åº¦ä½æ°","åå¼èå´","å建æ¶é´") |
| | | ); |
| | | } |
| | | |
| | | /** |
| | |
| | | //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° |
| | | exportFileName = Func.isBlank(exportFileName) ? "屿§æ± 导å
¥æ¨¡æ¿_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; |
| | | //设置åå |
| | | List<String> columns = new ArrayList<>( |
| | | Arrays.asList("屿§å", "æ ç¾", "æè¿°", |
| | | "屿§ç±»å(请åç
§æ°å¢çé¢ç屿§ç±»åå¡«å)", "å
许为空(æ¯/å¦)", "é»è®¤å¼", "使ç¨çæä¸¾è±æåç§°", "åç
§çä¸å¡ç±»åç¼å·", |
| | | "åç
§ç龿¥ç±»åç¼å·","çæ¬çæ¬¡","屿§é¿åº¦", "å°æ°ç²¾åº¦ä½æ°","å°æ°å»åº¦ä½æ°","åå¼èå´") |
| | | ); |
| | | List<String> columns = this.getCloumns(true); |
| | | //设置å¿
å¡«å |
| | | ColumnNameisRed.clear(); |
| | | ColumnNameisRed.add(0); |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String exportEnumTypes(String exportFileName,String enumNames) throws PLException { |
| | | public String exportEnumTypes(String exportFileName,String enumNames,boolean flag/*æ§å¶å¯¼åºçå忝å¦å导å
¥æ¨¡æ¿ä¸è´*/) throws PLException { |
| | | if(Func.isBlank(enumNames)){ |
| | | throw new PLException("500",new String[]{"请å¾éè¦å¯¼åºçæä¸¾!"}); |
| | | } |
| | | //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° |
| | | exportFileName = Func.isBlank(exportFileName) ? "æä¸¾ç±»å导åº_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; |
| | | //设置åå |
| | | List<String> columns = new ArrayList<>(Arrays.asList("æä¸¾åç§°", "æ ç¾", "è¿åç±»å", "é¿åº¦","å建æ¶é´", "æä¸¾é¡¹åç§°", "æä¸¾å¼", "æè¿°")); |
| | | List<String> columns = this.getCloumns(flag); |
| | | |
| | | //åexcel |
| | | String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; |
| | |
| | | if(Func.isEmpty(osEnumVO) && Func.isBlank(osEnumVO.getOid())){ |
| | | throw new PLException("500",new String[]{"æªæ¥è¯¢å°æä¸¾å为ã" + enumNameList.get(i) + "ãçæä¸¾ï¼è¯·å·æ°å鿰坼åº!"}); |
| | | } |
| | | //æä¸¾é¡¹ä¸ä¸ºç©ºæ¶éè¦èèåå¹¶è¡é®é¢ |
| | | //æç
§å¯¼åºååæ§å¶åéåæä¸¾é¡¹ä¸ä¸ºç©ºæ¶å³å®æ¯å¦éè¦èèåå¹¶è¡é®é¢ |
| | | List<OsEnumItemVO> enumVOItems = osEnumVO.getItems(); |
| | | //æä¸¾é¡¹ä¸ä¸ºç©ºæ¶éè¦è¿è¡åå¹¶è¡å¤ç |
| | | if(Func.isNotEmpty(enumVOItems) || enumVOItems.size() > 1){ |
| | | //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getOid())); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getId())); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,1, osEnumVO.getName())); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,2, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")")); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,3, osEnumVO.getLength())); |
| | | //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,5, osEnumVO.getCreator())); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,4, Func.format(osEnumVO.getCreateTime(),"yyyyå¹´MMæddæ¥ hh:mm:ss"))); |
| | | |
| | | //å¤çæä¸¾é¡¹åå
¥ |
| | | //å¤ææ¯æç
§ä»ä¹ååå¯¼åº |
| | | if(flag){ |
| | | for (int j = 0; j < enumVOItems.size(); j++) { |
| | | OsEnumItemVO osEnumItemVO = enumVOItems.get(j); |
| | | excelDataList.add(new WriteExcelData(startRow+j,5, true,osEnumItemVO.getName())); |
| | | excelDataList.add(new WriteExcelData(startRow+j,6, true, osEnumItemVO.getValue())); |
| | | excelDataList.add(new WriteExcelData(startRow+j,7, true, osEnumItemVO.getDescription())); |
| | | } |
| | | excelDataList.add(new WriteExcelData(i+j+1,0, osEnumVO.getId())); |
| | | excelDataList.add(new WriteExcelData(i+j+1,1, osEnumVO.getName())); |
| | | excelDataList.add(new WriteExcelData(i+j+1,2, osEnumVO.getEnumValueDataType())); |
| | | excelDataList.add(new WriteExcelData(i+j+1,3, osEnumVO.getLength())); |
| | | |
| | | startRow += enumVOItems.size(); |
| | | excelDataList.add(new WriteExcelData(i+j+1,4,osEnumItemVO.getName())); |
| | | excelDataList.add(new WriteExcelData(i+j+1,5, osEnumItemVO.getValue())); |
| | | excelDataList.add(new WriteExcelData(i+j+1,6, osEnumItemVO.getDescription())); |
| | | } |
| | | }else{ |
| | | //æä¸¾é¡¹ä¸ºç©ºæ¶å°±ä¸éè¦åå¹¶è¡ |
| | | //excelDataList.add(new WriteExcelData(startRow,0, true,osEnumVO.getOid())); |
| | | excelDataList.add(new WriteExcelData(startRow,0, true, osEnumVO.getId())); |
| | | excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getName())); |
| | | excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")")); |
| | | excelDataList.add(new WriteExcelData(startRow,3, true, osEnumVO.getLength())); |
| | | //excelDataList.add(new WriteExcelData(startRow,5, true, osEnumVO.getCreator())); |
| | | excelDataList.add(new WriteExcelData(startRow,4, true, Func.format(osEnumVO.getCreateTime(),"yyyyå¹´MMæddæ¥ hh:mm:ss"))); |
| | | //æä¸¾é¡¹ä¸ä¸ºç©ºæ¶éè¦è¿è¡åå¹¶è¡å¤ç |
| | | if(Func.isNotEmpty(enumVOItems) || enumVOItems.size() > 1){ |
| | | //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getOid())); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getId())); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,1, osEnumVO.getName())); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,2, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")")); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,3, osEnumVO.getLength())); |
| | | //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,5, osEnumVO.getCreator())); |
| | | excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,4, Func.format(osEnumVO.getCreateTime(),"yyyyå¹´MMæddæ¥ hh:mm:ss"))); |
| | | |
| | | //å¤çæä¸¾é¡¹åå
¥ |
| | | for (int j = 0; j < enumVOItems.size(); j++) { |
| | | OsEnumItemVO osEnumItemVO = enumVOItems.get(j); |
| | | excelDataList.add(new WriteExcelData(startRow+j,5, true,osEnumItemVO.getName())); |
| | | excelDataList.add(new WriteExcelData(startRow+j,6, true, osEnumItemVO.getValue())); |
| | | excelDataList.add(new WriteExcelData(startRow+j,7, true, osEnumItemVO.getDescription())); |
| | | } |
| | | |
| | | startRow += enumVOItems.size(); |
| | | }else{ |
| | | //æä¸¾é¡¹ä¸ºç©ºæ¶å°±ä¸éè¦åå¹¶è¡ |
| | | //excelDataList.add(new WriteExcelData(startRow,0, true,osEnumVO.getOid())); |
| | | excelDataList.add(new WriteExcelData(startRow,0, true, osEnumVO.getId())); |
| | | excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getName())); |
| | | excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")")); |
| | | excelDataList.add(new WriteExcelData(startRow,3, true, osEnumVO.getLength())); |
| | | //excelDataList.add(new WriteExcelData(startRow,5, true, osEnumVO.getCreator())); |
| | | excelDataList.add(new WriteExcelData(startRow,4, true, Func.format(osEnumVO.getCreateTime(),"yyyyå¹´MMæddæ¥ hh:mm:ss"))); |
| | | } |
| | | //è®°å½ä¸ä¸ä¸ç»æ°æ®ç»ææ¶çè¡å·ï¼æ¹ä¾¿ç¨ååå¹¶è¡çèµ·å§è¡ |
| | | startRow += 1; |
| | | } |
| | | //è®°å½ä¸ä¸ä¸ç»æ°æ®ç»ææ¶çè¡å·ï¼æ¹ä¾¿ç¨ååå¹¶è¡çèµ·å§è¡ |
| | | startRow += 1; |
| | | } |
| | | WriteExcelOption excelOption = new WriteExcelOption(excelDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | |
| | | //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° |
| | | exportFileName = Func.isBlank(exportFileName) ? "æä¸¾å¯¼å
¥æ¨¡æ¿_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; |
| | | //设置åå |
| | | List<String> columns = new ArrayList<>(Arrays.asList("æä¸¾åç§°", "æ ç¾", "è¿åç±»å", "é¿åº¦", "æä¸¾é¡¹åç§°(å½åæä¸¾ä¸ææä¸¾é¡¹æ¶å¿
å¡«)", "æä¸¾å¼(å½åæä¸¾ä¸ææä¸¾é¡¹æ¶å¿
å¡«)", "æè¿°","*注æ*:第äºè¡å¼å§çæ°æ®ä¸ºç¤ºä¾æ°æ®ï¼å¯¼å
¥å请å°å
¶å é¤ï¼å½å¯¼å
¥çæä¸¾ä¸å
·å¤å¤ä¸ªæä¸¾é¡¹æ¶ï¼åºæç
§ç¤ºä¾enum2çåæ³")); |
| | | List<String> columns = this.getCloumns(true); |
| | | //åexcel |
| | | String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; |
| | | //设置å¿
å¡«å |
| | |
| | | WriteExcelOption excelOption = new WriteExcelOption(excelDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | return excelPath; |
| | | } |
| | | |
| | | /** |
| | | * è·åå¯¼åºæå¯¼å
¥æ¨¡æ¿çåå |
| | | * @param flag æ¯å¦è·å导å
¥æ¨¡æ¿åå |
| | | * @return |
| | | */ |
| | | private List<String> getCloumns(boolean flag){ |
| | | if(flag){ |
| | | return new ArrayList<>( |
| | | Arrays.asList("æä¸¾åç§°", "æ ç¾", "è¿åç±»å", "é¿åº¦", "æä¸¾é¡¹åç§°(å½åæä¸¾ä¸ææä¸¾é¡¹æ¶å¿
å¡«)", |
| | | "æä¸¾å¼(å½åæä¸¾ä¸ææä¸¾é¡¹æ¶å¿
å¡«)", "æè¿°","*注æ*:第äºè¡å¼å§çæ°æ®ä¸ºç¤ºä¾æ°æ®ï¼å¯¼å
¥å请å°å
¶å é¤ï¼" + |
| | | "å½å¯¼å
¥çæä¸¾ä¸å
·å¤å¤ä¸ªæä¸¾é¡¹æ¶ï¼åºæç
§ç¤ºä¾enumbçåæ³" |
| | | ) |
| | | ); |
| | | } |
| | | return new ArrayList<>( |
| | | Arrays.asList("æä¸¾åç§°", "æ ç¾", "è¿åç±»å", "é¿åº¦", |
| | | "å建æ¶é´", "æä¸¾é¡¹åç§°", "æä¸¾å¼", "æè¿°" |
| | | ) |
| | | ); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | private List<OsEnumVO> getExportEnumTempExample(){ |
| | | String testJosn = "[{\"enumValueDataType\":\"String\",\"id\":\"enum1\",\"items\":[{\"description\":\"enumitem1.1\",\"name\":\"enumitem1.1\",\"value\":\"1\"},{\"description\":\"enumitem1.2\",\"name\":\"enumitem1.2\",\"value\":\"2\"}],\"length\":2,\"name\":\"enum1\"},{\"enumValueDataType\":\"String\",\"id\":\"enum2\",\"items\":[{\"description\":\"enumitem2.1\",\"name\":\"enumitem2.1\",\"value\":\"1\"},{\"description\":\"enumitem2.2\",\"name\":\"enumitem2.2\",\"value\":\"2\"},{\"description\":\"enumitem2.3\",\"name\":\"enumitem2.3\",\"value\":\"3\"}],\"length\":6,\"name\":\"enum2\"}]"; |
| | | String testJosn = "[{\"enumValueDataType\":\"String\",\"id\":\"enuma\",\"items\":[{\"description\":\"enumitem1.1\",\"name\":\"enumitem1.1\",\"value\":\"1\"},{\"description\":\"enumitem1.2\",\"name\":\"enumitem1.2\",\"value\":\"2\"}],\"length\":2,\"name\":\"enuma\"},{\"enumValueDataType\":\"String\",\"id\":\"enumb\",\"items\":[{\"description\":\"enumitem2.1\",\"name\":\"enumitem2.1\",\"value\":\"1\"},{\"description\":\"enumitem2.2\",\"name\":\"enumitem2.2\",\"value\":\"2\"},{\"description\":\"enumitem2.3\",\"name\":\"enumitem2.3\",\"value\":\"3\"}],\"length\":6,\"name\":\"enumb\"}]"; |
| | | List<OsEnumVO> OsEnumVOs = JSON.parseArray(testJosn,OsEnumVO.class); |
| | | return OsEnumVOs; |
| | | } |
| | |
| | | for(int k = 0; k < emChildren.length; k++){ |
| | | EnumItem emChild = emChildren[k]; |
| | | String value = emChild.value; |
| | | valueList.add(value); |
| | | String symbol = ""; |
| | | //å½ä¸ºIntegeræ¶éè¦å°æä¸¾é¡¹å¼æ¼æ¥ä¸= |
| | | if("Integer".equals(enumType)){ |
| | | symbol = "="; |
| | | } |
| | | valueList.add(symbol + value); |
| | | } |
| | | Map<String, List<String>> enumMap = new HashMap<>(); |
| | | enumMap.put(emItem.name, valueList); |
| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.client.mw.ClientSessionUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.vrm.VersionRule; |
| | | import com.vci.dto.OsRevisionRuleDTO; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.pagemodel.OsRevisionRuleVO; |
| | | import com.vci.web.service.OsRevisionRuleServiceI; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Autowired(required = false) |
| | | @Lazy |
| | | private OsRevisionRuleServiceI self; |
| | | |
| | | /** |
| | | * æ¥è¯¢ææççæ¬è§å |
| | | * |
| | |
| | | @VciUnLog |
| | | public Map<String, OsRevisionRuleVO> selectAllRevisionMap() { |
| | | return Optional.ofNullable(self.selectAllRevision()).orElseGet(()->new ArrayList<>()).stream().collect(Collectors.toMap(s->s.getId().toLowerCase(),t->t,(o1,o2)->o1)); |
| | | } |
| | | |
| | | /** |
| | | * åå»ºçæ¬è§å |
| | | * @param osRevisionRuleDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addVersionRule(OsRevisionRuleDTO osRevisionRuleDTO) throws PLException { |
| | | VersionRule vr = platformClientUtil.getVersionService().getVersionRule(osRevisionRuleDTO.getName()); |
| | | //nameä¸ä¸ºç©º |
| | | if(Func.isNotEmpty(vr) && !"".equals(vr.name)){ |
| | | throw new PLException("500",new String[]{"åç§°éå¤è¯·æ´æ¢åç§°!"}); |
| | | } |
| | | |
| | | platformClientUtil.getVersionService().addVersionRule(this.dto2VersionRule(osRevisionRuleDTO)); |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateVersionRule(OsRevisionRuleDTO osRevisionRuleDTO) { |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * dto对象转æ¢ä¸ºVersionRule对象 |
| | | * @return |
| | | */ |
| | | private VersionRule dto2VersionRule(OsRevisionRuleDTO osRevisionRuleDTO){ |
| | | VersionRule newVR = new VersionRule(); |
| | | newVR.name = osRevisionRuleDTO.getId(); |
| | | newVR.tag = osRevisionRuleDTO.getName(); |
| | | newVR.jumpCharacter = osRevisionRuleDTO.getPrefixCode(); |
| | | /*newVR.initialValue = jtf3.getText(); |
| | | newVR.stepLength = jtf4.getText(); |
| | | newVR.prefixion = jtf5.getText(); |
| | | newVR.suffix = jtf6.getText(); |
| | | newVR.description = jta.getText();*/ |
| | | String userName = ClientSessionUtility.getCurUserName(); |
| | | newVR.creator = userName; |
| | | newVR.modifier = userName; |
| | | return newVR; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åºç¨èå´ |
| | | * @param vrName çæ¬è§åè±æåç§° |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, String>> getUsedVersionRuleList(String vrName) throws PLException { |
| | | if(Func.isBlank(vrName)){ |
| | | throw new PLException("500",new String[]{"è¯·éæ©è¦æ¥è¯¢åºç¨èå´ç屿§!"}); |
| | | } |
| | | String[] btNames = platformClientUtil.getBtmService().getBTNamesByVerName(vrName); |
| | | if(Func.isEmpty(btNames)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<Map<String,String>> btmNameMapList = new ArrayList<>(); |
| | | Arrays.stream(btNames).forEach(btName->{ |
| | | Map<String, String> itemMap = new HashMap<>(); |
| | | itemMap.put("versionRuleName",vrName); |
| | | itemMap.put("source",btName); |
| | | btmNameMapList.add(itemMap); |
| | | }); |
| | | return btmNameMapList; |
| | | } |
| | | |
| | | /** |
| | | * æ¸
é¤ç¼å |
| | | */ |
| | | @Override |
| | | public void clearCache() { |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String exportStatus(String exportFileName, String statusOids) throws PLException { |
| | | public String exportStatus(String exportFileName, String statusOids,boolean flag/*æ§å¶å¯¼åºçå忝å¦å导å
¥æ¨¡æ¿ä¸è´*/) throws PLException { |
| | | if(Func.isBlank(statusOids)){ |
| | | throw new PLException("500",new String[]{"请å¾éè¦å¯¼åºç屿§!"}); |
| | | } |
| | | //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° |
| | | exportFileName = Func.isBlank(exportFileName) ? "ç¶ææ± ç¶æå¯¼åº_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; |
| | | //设置åå |
| | | List<String> columns = new ArrayList<>(Arrays.asList("åç§°", "æ ç¾", "å¾ç", "æè¿°")); |
| | | List<String> columns = this.getCloumns(flag); |
| | | |
| | | //åexcel |
| | | String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; |
| | |
| | | //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° |
| | | exportFileName = Func.isBlank(exportFileName) ? "ç¶ææ± å¯¼å
¥æ¨¡æ¿_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; |
| | | //设置åå |
| | | List<String> columns = new ArrayList<>( |
| | | Arrays.asList("åç§°(ä¸è½ä¸ºç©º)", "æ ç¾(对åç§°çè§£é)","å¾ç(è·¯å¾)", "æè¿°(å¯ä»¥ä¸ºç©º)") |
| | | ); |
| | | List<String> columns = this.getCloumns(true); |
| | | //设置å¿
å¡«å |
| | | ColumnNameisRed.clear(); |
| | | ColumnNameisRed.add(0); |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åå¯¼åºæå¯¼å
¥æ¨¡æ¿çåå |
| | | * @param flag æ¯å¦è·å导å
¥æ¨¡æ¿åå |
| | | * @return |
| | | */ |
| | | private List<String> getCloumns(boolean flag){ |
| | | if(flag){ |
| | | return new ArrayList<>( |
| | | Arrays.asList("åç§°(ä¸è½ä¸ºç©º)", "æ ç¾(对åç§°çè§£é)","å¾ç(è·¯å¾)", "æè¿°(å¯ä»¥ä¸ºç©º)") |
| | | ); |
| | | } |
| | | return new ArrayList<>(Arrays.asList("åç§°", "æ ç¾", "å¾ç", "æè¿°")); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥ç¶æ |
| | | * @param file |
| | | * @return |