| | |
| | | import com.vci.corba.omd.lcm.LifeCycle; |
| | | import com.vci.corba.omd.lcm.TransitionVO; |
| | | import com.vci.corba.omd.lcm.TransitionVOEvent; |
| | | import com.vci.corba.omd.vrm.VersionRule; |
| | | import com.vci.dto.OsLifeCycleDTO; |
| | | import com.vci.dto.OsLifeCycleLineDTO; |
| | | import com.vci.dto.OsLifeCycleLineEventDTO; |
| | | import com.vci.dto.OsRevisionRuleDTO; |
| | | import com.vci.dto.*; |
| | | import com.vci.pagemodel.*; |
| | | import com.vci.po.OsLifeCyclePO; |
| | | import com.vci.starter.poi.bo.ReadExcelOption; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | | import com.vci.starter.poi.bo.WriteExcelOption; |
| | | import com.vci.starter.poi.constant.ExcelLangCodeConstant; |
| | | import com.vci.starter.poi.util.ExcelUtil; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.starter.web.util.*; |
| | | import com.vci.model.OsLifeCycleDO; |
| | | import com.vci.starter.web.util.WebThreadLocalUtil; |
| | | import com.vci.web.service.OsLifeCycleServiceI; |
| | | import com.vci.web.service.OsStatusServiceI; |
| | | import com.vci.web.service.WebBoServiceI; |
| | |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.hssf.util.HSSFColor; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | */ |
| | | @Autowired |
| | | private WebBoServiceI boService; |
| | | |
| | | /** |
| | | * å¿
å¡«å |
| | | */ |
| | | private List<Integer> ColumnNameisRed = new ArrayList<Integer>(); |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | life.setOid(lifeCycle.oid); |
| | | Bound[] bounds = lifeCycle.bounds; |
| | | if(bounds != null && bounds.length>0){ |
| | | List<OsLifeCycleLineBoundVO> boundVOList = new ArrayList<>(); |
| | | Arrays.stream(bounds).forEach(bound->{ |
| | | OsLifeCycleLineBoundVO boundVO = new OsLifeCycleLineBoundVO(); |
| | | boundVO.setId(bound.id); |
| | | boundVO.setCellx(bound.cellx); |
| | | boundVO.setCelly(bound.celly); |
| | | boundVO.setCellh(bound.cellh); |
| | | boundVO.setCellw(bound.cellw); |
| | | boundVO.setCellicon(bound.cellicon); |
| | | boundVOList.add(boundVO); |
| | | }); |
| | | life.setBounds(boundVOList.toArray(new OsLifeCycleLineBoundVO[boundVOList.size()])); |
| | | }else{ |
| | | life.setBounds(new OsLifeCycleLineBoundVO[0]); |
| | | } |
| | | List<OsLifeCycleLineVO> lineVOS = new ArrayList<>(); |
| | | if(lifeCycle.routes!=null&& lifeCycle.routes.length>0){ |
| | | if(lifeCycle.routes!=null && lifeCycle.routes.length>0){ |
| | | Arrays.stream(lifeCycle.routes).forEach(route->{ |
| | | OsLifeCycleLineVO lineVO = new OsLifeCycleLineVO(); |
| | | lineVO.setSourceLifeStatus(route.source); |
| | |
| | | * @return æ°æ®å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public LifeCycle lifeCycleVO2DO(OsLifeCycleVO lifeCycleVO){ |
| | | public LifeCycle lifeCycleVO2DO(OsLifeCycleVO lifeCycleVO) throws PLException { |
| | | LifeCycle lifeCyle = new LifeCycle(); |
| | | lifeCyle.name = lifeCycleVO.getId(); |
| | | lifeCyle.tag = lifeCycleVO.getName(); |
| | | lifeCyle.oid = lifeCycleVO.getOid(); |
| | | String userId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(); |
| | | String userId = "developer";//WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(); |
| | | lifeCyle.creator = Func.isBlank(lifeCycleVO.getCreator()) ? userId:lifeCycleVO.getCreator(); |
| | | lifeCyle.description = lifeCycleVO.getDescription(); |
| | | lifeCyle.modifier = Func.isBlank(lifeCycleVO.getLastModifier()) ? userId:lifeCycleVO.getLastModifier(); |
| | | lifeCyle.modifyTime = System.currentTimeMillis(); |
| | | lifeCyle.createTime = lifeCycleVO.getCreateTime() != null ? lifeCycleVO.getCreateTime().getTime():null; |
| | | lifeCyle.createTime = lifeCycleVO.getCreateTime() != null ? lifeCycleVO.getCreateTime().getTime():System.currentTimeMillis(); |
| | | lifeCyle.startState =lifeCycleVO.getStartStatus(); |
| | | lifeCyle.ts = VciDateUtil.date2Str(lifeCycleVO.getTs(),VciDateUtil.DateTimeMillFormat); |
| | | if(lifeCycleVO.getBounds() !=null && lifeCycleVO.getBounds().length>0) { |
| | |
| | | }else{ |
| | | lifeCyle.bounds = new Bound[0]; |
| | | } |
| | | //å 龿¥çº¿ |
| | | //å è¿æ¥çº¿ |
| | | List<TransitionVO> lines = new ArrayList<>(); |
| | | for (int i = 0; i < lifeCycleVO.getLines().size(); i++) { |
| | | OsLifeCycleLineVO lineVO = lifeCycleVO.getLines().get(i); |
| | |
| | | * @param lineVO è¿æ¥çº¿å¯¹è±¡ |
| | | * @return å¹³å°çè¿æ¥çº¿å¯¹è±¡ |
| | | */ |
| | | private TransitionVO lifeCycleLineVO2DO(OsLifeCycleLineVO lineVO){ |
| | | private TransitionVO lifeCycleLineVO2DO(OsLifeCycleLineVO lineVO) throws PLException { |
| | | com.vci.corba.omd.lcm.TransitionVO transitionVO = new com.vci.corba.omd.lcm.TransitionVO(); |
| | | transitionVO.id = lineVO.getOid(); |
| | | transitionVO.source = lineVO.getSourceLifeStatus(); |
| | |
| | | OsLifeCycleLineEventVO eventVO = lineVO.getEvents()[j]; |
| | | TransitionVOEvent event = new TransitionVOEvent(); |
| | | event.id = eventVO.getOid(); |
| | | event.name = eventVO.getEventFullName(); |
| | | event.name = Func.isBlank(eventVO.getEventFullName()) ? |
| | | platformClientUtil.getLifeCycleService().getLCEventValueByKey(eventVO.getOid()):eventVO.getEventFullName(); |
| | | events[j] = event; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨çå½å¨æçç¼å·åå»å
å«çç¶ææ¾ç¤ºå¯¹è±¡ |
| | | * 使ç¨çå½å¨æçç¼å·è·åå
å«çç¶ææ¾ç¤ºå¯¹è±¡ |
| | | * |
| | | * @param lifeCycleId çå½å¨æçç¼å· |
| | | * @return ç¶æçæ¾ç¤ºå¯¹è±¡ |
| | |
| | | statusVOList.add(statusVOMap.getOrDefault(statusId,new OsStatusVO())); |
| | | }); |
| | | return statusVOList; |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨å¤ä¸ªç¼å·è·åçå½å¨æç对象 |
| | | * @param lcIdList ç¼å· |
| | | * @return æ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public List<OsLifeCycleVO> getLifeCycleByIds(Collection<String> lcIdList) { |
| | | if(Func.isEmpty(lcIdList)){ |
| | | return null; |
| | | } |
| | | Map<String, OsLifeCycleVO> lifeCycleVOMap = self.selectAllLifeCycleMap(); |
| | | List<OsLifeCycleVO> lifeCycleVOList = new ArrayList<>(); |
| | | lcIdList.stream().forEach(vrId->{ |
| | | OsLifeCycleVO lifeCycleVO = lifeCycleVOMap.getOrDefault(vrId,null); |
| | | if(lifeCycleVO != null){ |
| | | lifeCycleVOList.add(lifeCycleVO); |
| | | } |
| | | }); |
| | | return lifeCycleVOList; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public String exportLifeCycles(String exportFileName, String lcNames, boolean flag) throws PLException { |
| | | if(Func.isBlank(lcNames)){ |
| | | throw new PLException("500",new String[]{"请å¾éè¦å¯¼åºççå½å¨ææ¨¡æ¿!"}); |
| | | } |
| | | //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° |
| | | exportFileName = Func.isBlank(exportFileName) ? "çæ¬è§å导åº_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; |
| | | //设置åå |
| | | List<String> columns = this.getCloumns(flag); |
| | | |
| | | //åexcel |
| | | String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; |
| | | try { |
| | | new File(excelPath).createNewFile(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e); |
| | | } |
| | | //设置å |
| | | List<WriteExcelData> excelDataList = new ArrayList<>(); |
| | | //设置å头 |
| | | for (int index = 0; index < columns.size(); index++) { |
| | | excelDataList.add(new WriteExcelData(0,index, columns.get(index))); |
| | | } |
| | | //æç
§çæ¬è§ååæ¥è¯¢ï¼ç¶åå¤ççæ¬è§åå¯¼åº |
| | | List<String> lcIdList = Func.toStrList(lcNames); |
| | | List<OsLifeCycleVO> lifeCycleVOList = this.getLifeCycleByIds(lcIdList); |
| | | if(Func.isEmpty(lifeCycleVOList)){ |
| | | excelDataList.add(new WriteExcelData(1,1, "æ ¹æ®åç§°æªæ¥è¯¢å°çå½å¨æä¿¡æ¯ï¼è¯·å·æ°åå°è¯éæ°å¯¼åºï¼")); |
| | | }else{ |
| | | int row = 1; |
| | | for (int i = 0; i < lifeCycleVOList.size(); i++) { |
| | | OsLifeCycleVO lifeCycleVO = lifeCycleVOList.get(i); |
| | | List<OsLifeCycleLineVO> lines = lifeCycleVO.getLines(); |
| | | if(Func.isNotEmpty(lines)){ |
| | | for (int j = 0; j < lines.size(); j++) { |
| | | int start = row + j; |
| | | excelDataList.add(new WriteExcelData(start,0, lifeCycleVO.getId())); |
| | | excelDataList.add(new WriteExcelData(start,1, lifeCycleVO.getName())); |
| | | excelDataList.add(new WriteExcelData(start,2, lifeCycleVO.getStartStatus())); |
| | | excelDataList.add(new WriteExcelData(start,3, lifeCycleVO.getDescription())); |
| | | OsLifeCycleLineVO osLifeCycleLineVO = lines.get(j); |
| | | //æç
§å¯¼åºæ¨¡æ¿åå¡«æ°æ® |
| | | if(!flag){ |
| | | excelDataList.add(new WriteExcelData(start,4, osLifeCycleLineVO.getName())); |
| | | excelDataList.add(new WriteExcelData(start,5, osLifeCycleLineVO.getSourceLifeStatus())); |
| | | excelDataList.add(new WriteExcelData(start,6, osLifeCycleLineVO.getSourceLifeStatusName())); |
| | | excelDataList.add(new WriteExcelData(start,7, osLifeCycleLineVO.getTargetLifeStatus())); |
| | | excelDataList.add(new WriteExcelData(start,8, osLifeCycleLineVO.getTargetLifeStatusName())); |
| | | //å¤çè¿æ¥çº¿å
å«çäºä»¶ |
| | | OsLifeCycleLineEventVO[] events = osLifeCycleLineVO.getEvents(); |
| | | if(events != null && events.length > 0){ |
| | | String collect = Arrays.stream(events).map(OsLifeCycleLineEventVO::getOid).collect(Collectors.joining(";")); |
| | | excelDataList.add(new WriteExcelData(start,9, collect)); |
| | | } |
| | | excelDataList.add(new WriteExcelData(start,10, Func.format(lifeCycleVO.getCreateTime(),"yyyyå¹´MMæddæ¥ hh:mm:ss"))); |
| | | }else{ |
| | | excelDataList.add(new WriteExcelData(start,4, osLifeCycleLineVO.getSourceLifeStatus())); |
| | | excelDataList.add(new WriteExcelData(start,5, osLifeCycleLineVO.getTargetLifeStatus())); |
| | | } |
| | | } |
| | | row = row+lines.size(); |
| | | }else{ |
| | | excelDataList.add(new WriteExcelData(row,0, lifeCycleVO.getId())); |
| | | excelDataList.add(new WriteExcelData(row,1, lifeCycleVO.getName())); |
| | | excelDataList.add(new WriteExcelData(row,2, lifeCycleVO.getStartStatus())); |
| | | excelDataList.add(new WriteExcelData(row,3, lifeCycleVO.getDescription())); |
| | | if(!flag){ |
| | | excelDataList.add(new WriteExcelData(row,10, Func.format(lifeCycleVO.getCreateTime(),"yyyyå¹´MMæddæ¥ hh:mm:ss"))); |
| | | } |
| | | row++; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | | WriteExcelOption excelOption = new WriteExcelOption(excelDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | return excelPath; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public String downloadLifeCycleTemplate(String exportFileName) throws Exception { |
| | | return null; |
| | | //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° |
| | | exportFileName = Func.isBlank(exportFileName) ? "çå½å¨æå¯¼å
¥æ¨¡æ¿_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; |
| | | //设置åå |
| | | List<String> columns = this.getCloumns(true); |
| | | //设置å¿
å¡«å |
| | | ColumnNameisRed.clear(); |
| | | ColumnNameisRed.add(0); |
| | | ColumnNameisRed.add(2); |
| | | |
| | | //åexcel |
| | | String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName + ".xls"; |
| | | try { |
| | | new File(excelPath).createNewFile(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e); |
| | | } |
| | | //设置å |
| | | List<WriteExcelData> excelDataList = new ArrayList<>(); |
| | | //设置å头 |
| | | for (int index = 0; index < columns.size(); index++) { |
| | | //夿æ¯å¦ä¸ºå¿
å¡«åï¼ç»å¿
å¡«å设置é¢è² |
| | | if(ColumnNameisRed.contains(index)){ |
| | | WriteExcelData excelData = new WriteExcelData(0, index, columns.get(index)); |
| | | excelData.setFontColor(String.valueOf(HSSFColor.HSSFColorPredefined.RED.getIndex())); |
| | | excelDataList.add(excelData); |
| | | }else{ |
| | | excelDataList.add(new WriteExcelData(0,index, columns.get(index))); |
| | | } |
| | | } |
| | | WriteExcelOption excelOption = new WriteExcelOption(excelDataList); |
| | | ExcelUtil.writeDataToFile(excelPath, excelOption); |
| | | return excelPath; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public BaseResult importLifeCycles(File file) throws Exception { |
| | | VciBaseUtil.alertNotNull(file,"excelæä»¶"); |
| | | if(!file.exists()){ |
| | | throw new VciBaseException("导å
¥çexcelæä»¶ä¸åå¨,{0}",new String[]{file.getPath()}); |
| | | } |
| | | try{ |
| | | //1ã读åexcelä¸çæ°æ®ï¼ç»æå¯¹è±¡ |
| | | ReadExcelOption excelOption = new ReadExcelOption(); |
| | | List<OsLifeCyclePO> poList = ExcelUtil.readDataObjectFromExcel(file, OsLifeCyclePO.class,excelOption,(value, po, fieldName)->{}); |
| | | //å»é¤é½æ¯ç©ºçæ
åµ |
| | | if(CollectionUtils.isEmpty(poList)){ |
| | | return BaseResult.fail(ExcelLangCodeConstant.IMPORT_CONTENT_NULL,new String[]{}); |
| | | } |
| | | //尿䏾åæä¸¾é¡¹å¤çæä¸å¯¹å¤å
³ç³»ç对象 |
| | | Map<String, OsLifeCyclePO> groupPOMap = new HashMap<>(); |
| | | //é»è®¤ççå½å¨æå¾æ çåæ å宽度çä¿¡æ¯ |
| | | List<OsLifeCycleLineBoundVO> defaultBoundList = new ArrayList<>(); |
| | | for (OsLifeCyclePO po : poList) { |
| | | //æ¼æ¥ç¨æ¥ä½ä¸ºåç»çkey |
| | | String key = po.getId() + "_" + po.getName() + "_" + po.getStartStatus(); |
| | | OsLifeCyclePO group = groupPOMap.get(key); |
| | | if (group == null) { |
| | | group = new OsLifeCyclePO(); |
| | | //æ¿åºç°çé¦è¡ååç»çæç¤ºè¡ |
| | | group.setRowIndex(po.getRowIndex()); |
| | | group.setId(po.getId()); |
| | | group.setName(po.getName()); |
| | | group.setStartStatus(po.getStartStatus()); |
| | | group.setDescription(po.getDescription()); |
| | | groupPOMap.put(key, group); |
| | | |
| | | //å¤ççå½å¨æå¾æ çé»è®¤çåæ ä¿¡æ¯ |
| | | OsLifeCycleLineBoundVO boundVO = new OsLifeCycleLineBoundVO(); |
| | | boundVO.setCellh("30.0"); |
| | | boundVO.setCellw("80.0"); |
| | | boundVO.setCellx(String.valueOf(200+(Integer.parseInt(po.getRowIndex())*60))); |
| | | boundVO.setCelly(String.valueOf(300+(Integer.parseInt(po.getRowIndex())*60))); |
| | | boundVO.setCellicon(""); |
| | | defaultBoundList.add(boundVO); |
| | | } |
| | | |
| | | return null; |
| | | OsLifeCycleLineVO lineItemVO = new OsLifeCycleLineVO(); |
| | | lineItemVO.setName("line"+po.getRowIndex()); |
| | | lineItemVO.setSourceLifeStatus(po.getSourceLifeStatus()); |
| | | lineItemVO.setTargetLifeStatus(po.getTargetLifeStatus()); |
| | | |
| | | //å¤çè¿æ¥çº¿å
å«çäºä»¶ |
| | | String[] eventArr = po.getEvents().split(";"); |
| | | if(eventArr != null & eventArr.length > 0){ |
| | | List<OsLifeCycleLineEventVO> eventVOList = new ArrayList<>(); |
| | | for (int i = 0; i < eventArr.length; i++) { |
| | | OsLifeCycleLineEventVO osLCLineEventVO = new OsLifeCycleLineEventVO(); |
| | | osLCLineEventVO.setOid(eventArr[i]); |
| | | String lcEventValueByKey = platformClientUtil.getLifeCycleService().getLCEventValueByKey(eventArr[i]); |
| | | osLCLineEventVO.setEventFullName(lcEventValueByKey); |
| | | eventVOList.add(osLCLineEventVO); |
| | | } |
| | | lineItemVO.setEvents(eventVOList.toArray(new OsLifeCycleLineEventVO[eventVOList.size()])); |
| | | } |
| | | group.getLineItems().add(lineItemVO); |
| | | } |
| | | Collection<OsLifeCyclePO> newPOList = groupPOMap.values(); |
| | | //æ°æ®åºæ¥è¯¢æ¯å¦æå·²åå¨ççå½å¨æåï¼æ¹ä¾¿åç»åå¤éå¤ç |
| | | List<OsLifeCycleVO> lifeCycleVOList = this.getLifeCycleByIds(poList.stream().map(OsLifeCyclePO::getId).collect(Collectors.toSet())); |
| | | List<String> repeatLCId = new ArrayList<>(); |
| | | if(Func.isNotEmpty(lifeCycleVOList)){ |
| | | repeatLCId = lifeCycleVOList.stream().map(OsLifeCycleVO::getId).collect(Collectors.toList()); |
| | | } |
| | | //å½åexcel䏿¯å¦éå¤ç¨çå¤éMap:ï¼keyï¼å¤é屿§ï¼valueï¼è¡å·ï¼ |
| | | Map<String, String> excelReapeat = new HashMap<>(); |
| | | //夿å¿
填屿§æ¯å¦ä¸ºç©ºçç |
| | | List<String> finalRepeatLCId = repeatLCId; |
| | | newPOList.stream().forEach(lcPO -> { |
| | | if(Func.isBlank(lcPO.getId())){ |
| | | throw new VciBaseException("第ã"+lcPO.getRowIndex()+"ãè¡ï¼lcnameerror"); |
| | | }else if(Func.isEmpty(lcPO.getStartStatus())){ |
| | | throw new VciBaseException("第ã"+lcPO.getRowIndex()+"ãè¡ï¼startstatuserror"); |
| | | }else if(!lcPO.getId().matches("^[A-Za-z]+$")){ |
| | | throw new VciBaseException("第ã"+lcPO.getRowIndex()+"ãè¡æ°æ®ï¼åç§°åªè½ä¸ºè±æåæ¯"); |
| | | }else if(excelReapeat.containsKey(lcPO.getId())){//åç§°è¡¨æ ¼ä¸å¤é |
| | | throw new VciBaseException("第ã"+excelReapeat.get(lcPO.getId())+"ãè¡å第ã"+lcPO.getRowIndex()+"ãè¡æ°æ®ï¼åç§°éå¤"); |
| | | }else if (Func.isNotEmpty(finalRepeatLCId) && finalRepeatLCId.contains(lcPO.getId())){//2ã夿åç§°æ¯å¦ä¸ç³»ç»ä¸éå¤ |
| | | throw new VciBaseException("第ã"+lcPO.getRowIndex()+"ãè¡ï¼åç§°å¨ç³»ç»ä¸å·²ç»åå¨,请修æ¹!"); |
| | | } |
| | | //å
对æä¸¾åexcelä¸éè¦å¤éå¤ç |
| | | excelReapeat.put(lcPO.getId(),lcPO.getRowIndex()); |
| | | }); |
| | | //ä¿åé»è¾ |
| | | for (OsLifeCyclePO osLifeCyclePO : newPOList) { |
| | | OsLifeCycleVO osLifeCycleVO = new OsLifeCycleVO(); |
| | | //çæåå¨çDTO对象 |
| | | osLifeCycleVO.setId(osLifeCyclePO.getId()); |
| | | osLifeCycleVO.setName(osLifeCyclePO.getName()); |
| | | osLifeCycleVO.setDescription(osLifeCyclePO.getDescription()); |
| | | osLifeCycleVO.setStartStatus(osLifeCyclePO.getStartStatus()); |
| | | osLifeCycleVO.setLines(osLifeCyclePO.getLineItems()); |
| | | osLifeCycleVO.setBounds(defaultBoundList.toArray(new OsLifeCycleLineBoundVO[defaultBoundList.size()])); |
| | | //è°ç¨æ°å¢æä¸¾æ¹æ³ |
| | | boolean addBoolean = platformClientUtil.getLifeCycleService().addLifeCycle(lifeCycleVO2DO(osLifeCycleVO)); |
| | | if(!addBoolean){ |
| | | throw new PLException("500",new String[]{"ä¿åçå½å¨æåï¼ä¸ºã" + osLifeCycleVO.getId() + "ãçæ°æ®æ¶åºç°é误!"}); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("读åexcelå
å®¹æ¶æä¿åçå½å¨æä¿¡æ¯æ¶åºç°äºé误ï¼å
·ä½åå ï¼",VciBaseUtil.getExceptionMessage(e)); |
| | | } |
| | | e.printStackTrace(); |
| | | return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e); |
| | | } |
| | | return BaseResult.success("çå½å¨æå¯¼å
¥æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * è·åå¯¼åºæå¯¼å
¥æ¨¡æ¿çåå |
| | | * @param flag æ¯å¦è·å导å
¥æ¨¡æ¿åå |
| | | * @return |
| | | */ |
| | | private List<String> getCloumns(boolean flag){ |
| | | if(flag){ |
| | | return new ArrayList<>( |
| | | Arrays.asList( |
| | | "åç§°", "æ ç¾", "èµ·å§ç¶æ", "æè¿°", |
| | | "è¿æ¥çº¿èµ·å§ç¶æ", "è¿æ¥çº¿ç®æ ç¶æ", "äºä»¶(;é´é)" |
| | | ) |
| | | ); |
| | | } |
| | | return new ArrayList<>( |
| | | Arrays.asList( |
| | | "åç§°", "æ ç¾", "èµ·å§ç¶æ", "æè¿°", |
| | | "è¿æ¥çº¿åç§°", "è¿æ¥çº¿èµ·å§ç¶æè±æåç§°","è¿æ¥çº¿èµ·å§ç¶æä¸æåç§°", |
| | | "è¿æ¥çº¿ç®æ ç¶æè±æåç§°","è¿æ¥çº¿ç®æ ç¶æä¸æåç§°", "äºä»¶", "å建æ¶é´" |
| | | ) |
| | | ); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææè·è¿äºä»¶key |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> getLCEventKeys() throws PLException { |
| | | return Arrays.asList(platformClientUtil.getLifeCycleService().getLCEventKeys()); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ§è¡è·è¿æä½ï¼è¦æ±å¿
é¡»æ¯åä¸ä¸ªä¸å¡ç±»åä¸ç |
| | | * @param bos ä¸å¡ç±»åæ°æ®å¯¹è±¡ |
| | | * @param lineVOs è·è¿å¯¹è±¡ |