| | |
| | | import com.zt.common.utils.UUIDUtil; |
| | | import com.zt.life.modules.mainPart.basicInfo.dao.ParamDataDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.dao.XhProductModelDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamData; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ProductImg; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel; |
| | | import com.zt.life.modules.mainPart.taskReliability.dao.*; |
| | | import com.zt.life.modules.mainPart.taskReliability.dto.ModelLinePair; |
| | | import com.zt.life.modules.mainPart.taskReliability.dto.ModelLinePairDto; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.dom4j.DocumentHelper; |
| | | import org.dom4j.Document; |
| | | import org.dom4j.Element; |
| | | import org.dom4j.io.OutputFormat; |
| | | import org.dom4j.io.XMLWriter; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.StringWriter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | // 6. 转换为算法库接口XML |
| | | if (result) { |
| | | // result = createIfXmlFromRbd(modelRbd, algorithmList, modelNodeAndVnodeList); |
| | | // result = createIfXmlFromRbd(modelRbd, algorithmList, modelNodeAndVnodeList); |
| | | } |
| | | |
| | | // 7. 保存模型 |
| | |
| | | List<ModelLine> lines = modelLineList.stream().filter(item -> |
| | | item.getEndCell().equals(startNode.getPicId())).collect(Collectors.toList()); |
| | | if (lines.size()<2) continue; |
| | | List<ModelLinePair> linePairs = getLinePairs(lines); |
| | | for (ModelLinePair linePair : linePairs) { |
| | | List<ModelLinePairDto> linePairs = getLinePairs(lines); |
| | | for (ModelLinePairDto linePair : linePairs) { |
| | | hasSimplifiedMe = simplifyBridgeOneLinePair(modelId, modelNodeList, modelLineList, |
| | | algorithmList, modelNodeAndVnodeList, startNode, linePair); |
| | | if (hasSimplifiedMe) { |
| | |
| | | List<Algorithm> algorithmList, |
| | | List<ModelNode> modelNodeAndVnodeList, |
| | | ModelNode startNode, |
| | | ModelLinePair linePair) { |
| | | ModelLinePairDto linePair) { |
| | | ModelNode node1 = null; |
| | | ModelNode node2 = null; |
| | | ModelNode node3 = null; |
| | |
| | | } |
| | | |
| | | // 找出所有2根线的组合 |
| | | private List<ModelLinePair> getLinePairs(List<ModelLine> lines) { |
| | | List<ModelLinePair> linePairs = new ArrayList<>(); |
| | | private List<ModelLinePairDto> getLinePairs(List<ModelLine> lines) { |
| | | List<ModelLinePairDto> linePairs = new ArrayList<>(); |
| | | for (int i=0; i<lines.size()-1; i++) { |
| | | for (int j=i+1; j<lines.size(); j++) { |
| | | ModelLinePair linePair = new ModelLinePair(); |
| | | ModelLinePairDto linePair = new ModelLinePairDto(); |
| | | linePair.setLine1(lines.get(i)); |
| | | linePair.setLine2(lines.get(j)); |
| | | linePairs.add(linePair); |
| | |
| | | jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/reliabDistribType".split("/")); |
| | | if (jsonValue != null && StringUtils.isNotBlank(jsonValue.toString())) { |
| | | productImg.setReliabDistribType(Integer.valueOf(jsonValue.toString())); |
| | | if (3==productImg.getReliabDistribType()) { |
| | | // 二项分布 |
| | | jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/simulatTimes".split("/")); |
| | | if (jsonValue != null && StringUtils.isNotBlank(jsonValue.toString())) { |
| | | productImg.setBinomialTotalNum(Integer.valueOf(jsonValue.toString())); |
| | | modelNode.setBinomialTotalNum(Integer.valueOf(jsonValue.toString())); |
| | | } |
| | | jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/successTimes".split("/")); |
| | | if (jsonValue != null && StringUtils.isNotBlank(jsonValue.toString())) { |
| | | productImg.setBinomialSuccessNum(Integer.valueOf(jsonValue.toString())); |
| | | modelNode.setBinomialSuccessNum(Integer.valueOf(jsonValue.toString())); |
| | | } |
| | | } |
| | | } |
| | | jsonValue = JsonUtils2.getJsonValueByPath(jsonObject, "data/taskMtbcf".split("/")); |
| | | if (null != jsonValue) productImg.setTaskMtbcf(jsonValue.toString()); |