| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.client.mw.ClientSessionUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.omd.stm.StatePool; |
| | | import com.vci.corba.omd.vrm.VersionRule; |
| | | import com.vci.dto.OsAttributeDTO; |
| | | import com.vci.dto.OsRevisionRuleDTO; |
| | | import com.vci.dto.OsStatusDTO; |
| | | import com.vci.pagemodel.OsAttributeVO; |
| | | import com.vci.pagemodel.OsEnumVO; |
| | | import com.vci.pagemodel.OsStatusVO; |
| | | import com.vci.po.OsAttributePO; |
| | | import com.vci.po.OsEnumPO; |
| | | import com.vci.pagemodel.OsRevisionRuleVO; |
| | | import com.vci.po.OsRevisionRulePO; |
| | | import com.vci.starter.poi.bo.ReadExcelOption; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseResult; |
| | | import com.vci.starter.web.util.*; |
| | | import com.vci.pagemodel.OsRevisionRuleVO; |
| | | import com.vci.web.service.OsRevisionRuleServiceI; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.starter.web.util.Lcm.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.swing.*; |
| | | import java.awt.*; |
| | | import java.io.File; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | osRevisionRuleDTOS.stream().forEach(item->{ |
| | | String vrName = item.getId(); |
| | | try { |
| | | String[] btNamesByVerName = platformClientUtil.getBtmService().getBTNamesByVerName(vrName); |
| | | if(btNamesByVerName != null && btNamesByVerName.length > 0){ |
| | | List<Map<String, String>> usedVersionRuleList = this.getUsedVersionRuleList(vrName); |
| | | if(Func.isNotEmpty(usedVersionRuleList)){ |
| | | throw new VciBaseException("该版本已被使用不允许删除"); |
| | | } |
| | | } catch (PLException e) { |
| | |
| | | //后台会用ts进行数据一致性校验 |
| | | Date ts = vrDTO.getTs(); |
| | | if(Func.isBlank(oid) || Func.isBlank(id) || Func.isEmpty(ts)){ |
| | | throw new PLException("500",new String[]{"待删除的状态列表中主键【oid】、调整时间【ts】、状态名称【name】不能为空!"}); |
| | | throw new PLException("500",new String[]{"待删除的版本规则列表中主键【oid】、调整时间【ts】、状态名称【name】不能为空!"}); |
| | | } |
| | | VersionRule vr = new VersionRule(); |
| | | vr.oid = oid; |
| | |
| | | throw new PLException("500",new String[]{"名称只能为英文!"}); |
| | | } |
| | | //跳跃字符只能为数字或者字母 |
| | | if(Func.isNotBlank(dto.getJumpCharacter()) && (!(dto.getJumpCharacter().matches(regex)))){ |
| | | String regex0 = "^[a-zA-Z0-9,]+$"; |
| | | if(Func.isNotBlank(dto.getJumpCharacter()) && (!(dto.getJumpCharacter().matches(regex0)))){ |
| | | throw new PLException("500",new String[]{"跳跃字符只能为数字或者字母!"}); |
| | | } |
| | | //初始值不能为空且只能为数字或者字母或英文状态下的符号 |
| | |
| | | VersionRule newVR = new VersionRule(); |
| | | newVR.oid = osRevisionRuleDTO.getOid(); |
| | | newVR.name = osRevisionRuleDTO.getId(); |
| | | newVR.tag = osRevisionRuleDTO.getName(); |
| | | newVR.label = osRevisionRuleDTO.getName(); |
| | | newVR.description = osRevisionRuleDTO.getDescription(); |
| | | newVR.jumpCharacter = osRevisionRuleDTO.getJumpCharacter(); |
| | | newVR.initialValue = osRevisionRuleDTO.getInitialValue(); |
| | |
| | | } |
| | | ruleVO.setDescription(versionRule.description); |
| | | ruleVO.setId(versionRule.name); |
| | | ruleVO.setName(versionRule.tag); |
| | | ruleVO.setName(versionRule.label); |
| | | ruleVO.setStepLength(WebUtil.getInt(versionRule.stepLength)); |
| | | ruleVO.setJumpCharacter(versionRule.jumpCharacter); |
| | | ruleVO.setPrefixion(versionRule.prefixion); |
| | |
| | | }); |
| | | }catch (Exception e){ |
| | | if(logger.isErrorEnabled()){ |
| | | logger.error("读取excel内容时或保存用户信息时出现了错误,具体原因:",VciBaseUtil.getExceptionMessage(e)); |
| | | logger.error("读取excel内容时或保存版本规则时出现了错误,具体原因:",VciBaseUtil.getExceptionMessage(e)); |
| | | } |
| | | e.printStackTrace(); |
| | | return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e); |