人工交互分析gamma部分新增加G气体相关MDC计算信息

自动处理增加G气体相关MDC计算信息
This commit is contained in:
qiaoqinzheng 2023-12-25 09:24:12 +08:00
parent 5e9642de91
commit 66ba744b79
2 changed files with 103 additions and 44 deletions

View File

@ -230,26 +230,36 @@ public class Sample_G_Analysis {
for (int i=0; i<docChildNodes.getLength(); i++) { for (int i=0; i<docChildNodes.getLength(); i++) {
//获取节点信息 //获取节点信息
Node node = docChildNodes.item(i); Node node = docChildNodes.item(i);
//判断节点名称是否是item if (node.getNodeName().equalsIgnoreCase(phd.getHeader().getSystem_type())) {
if (node.getNodeName().equalsIgnoreCase("item")) { NodeList childNodes = node.getChildNodes();
//获取节点属性信息 if (Objects.nonNull(childNodes) && childNodes.getLength() > 0) {
NamedNodeMap attributes = node.getAttributes(); //遍历子节点信息
//判断节点属性信息是否为空 for (int j=0; j< childNodes.getLength(); j++) {
if (Objects.nonNull(attributes)) { //获取子节点信息
CalMDCInfo info = new CalMDCInfo(); Node childNode = childNodes.item(j);
//遍历属性信息 //判断节点名称是否是item
for (int j=0; j<attributes.getLength(); j++) { if (childNode.getNodeName().equalsIgnoreCase("item")) {
//根据顺序读取属性 //获取节点属性信息
Node attribute = attributes.item(j); NamedNodeMap attributes = childNode.getAttributes();
if (attribute.getNodeName().equalsIgnoreCase("nuclide_name")) { //判断节点属性信息是否为空
info.setNuclideName(attribute.getNodeValue()); if (Objects.nonNull(attributes)) {
} else if (attribute.getNodeName().equalsIgnoreCase("halflife")) { CalMDCInfo info = new CalMDCInfo();
info.setHalflife(Double.valueOf(attribute.getNodeValue())); //遍历属性信息
for (int k=0; k<attributes.getLength(); k++) {
//根据顺序读取属性
Node attribute = attributes.item(k);
if (attribute.getNodeName().equalsIgnoreCase("nuclide_name")) {
info.setNuclideName(attribute.getNodeValue());
} else if (attribute.getNodeName().equalsIgnoreCase("halflife")) {
info.setHalflife(Double.valueOf(attribute.getNodeValue()));
}
}
if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(info.getNuclideName()) && Objects.nonNull(info.getHalflife())) {
mdcInfoMap.put(info.getNuclideName(), info);
}
}
} }
} }
if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(info.getNuclideName()) && Objects.nonNull(info.getHalflife())) {
mdcInfoMap.put(info.getNuclideName(), info);
}
} }
} }
} }

View File

@ -207,7 +207,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
return result; return result;
} }
//读取redis缓存的计算mdc信息 //读取redis缓存的计算mdc信息
Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap"); Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap-"+phd.getHeader().getSystem_type());
if (CollectionUtils.isNotEmpty(mdcInfoMap)) { if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
phd.setMdcInfoMap(mdcInfoMap); phd.setMdcInfoMap(mdcInfoMap);
} }
@ -235,7 +235,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
redisUtil.set(userName+StringPool.DASH+phd.getHeader().getSystem_type(), nuclideMap); redisUtil.set(userName+StringPool.DASH+phd.getHeader().getSystem_type(), nuclideMap);
} }
//读取redis缓存的计算mdc信息 //读取redis缓存的计算mdc信息
Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap"); Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap-"+phd.getHeader().getSystem_type());
if (CollectionUtils.isNotEmpty(mdcInfoMap)) { if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
phd.setMdcInfoMap(mdcInfoMap); phd.setMdcInfoMap(mdcInfoMap);
} }
@ -517,7 +517,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
return result; return result;
} }
//读取redis缓存的计算mdc信息 //读取redis缓存的计算mdc信息
Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap"); Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap-"+phd.getHeader().getSystem_type());
if (CollectionUtils.isNotEmpty(mdcInfoMap)) { if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
phd.setMdcInfoMap(mdcInfoMap); phd.setMdcInfoMap(mdcInfoMap);
} }
@ -893,7 +893,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
redisUtil.set(userName+StringPool.DASH+phd.getHeader().getSystem_type(), nuclideMap); redisUtil.set(userName+StringPool.DASH+phd.getHeader().getSystem_type(), nuclideMap);
} }
//读取redis缓存的计算mdc信息 //读取redis缓存的计算mdc信息
Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap"); Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap-"+phd.getHeader().getSystem_type());
if (CollectionUtils.isNotEmpty(mdcInfoMap)) { if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
phd.setMdcInfoMap(mdcInfoMap); phd.setMdcInfoMap(mdcInfoMap);
} }
@ -5792,8 +5792,6 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
* 读取计算MDC参数文件方法 * 读取计算MDC参数文件方法
*/ */
public void readMDCParameter() { public void readMDCParameter() {
//存储文件结果用的map
Map<String, CalMDCInfo> mdcInfoMap = new TreeMap<>();
//配置文件路径 //配置文件路径
String filePath = parameterProperties.getFilePath()+ File.separator + "MDCParameter.xml"; String filePath = parameterProperties.getFilePath()+ File.separator + "MDCParameter.xml";
try { try {
@ -5814,34 +5812,85 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
for (int i=0; i<docChildNodes.getLength(); i++) { for (int i=0; i<docChildNodes.getLength(); i++) {
//获取节点信息 //获取节点信息
Node node = docChildNodes.item(i); Node node = docChildNodes.item(i);
//判断节点名称是否是item //判断节点名称是否是 P
if (node.getNodeName().equalsIgnoreCase("item")) { if (node.getNodeName().equalsIgnoreCase("P")) {
//获取节点属性信息 //存储文件结果用的map
NamedNodeMap attributes = node.getAttributes(); Map<String, CalMDCInfo> mdcInfoMap = new TreeMap<>();
//判断节点属性信息是否为空 //获取节点下的子节点信息
if (Objects.nonNull(attributes)) { NodeList childNodes = node.getChildNodes();
CalMDCInfo info = new CalMDCInfo(); //如果子节点不为空
//遍历属性信息 if (Objects.nonNull(childNodes) && childNodes.getLength() > 0) {
for (int j=0; j<attributes.getLength(); j++) { //遍历子节点信息 将核素信息封存到缓存中
//根据顺序读取属性 for (int j=0; j<childNodes.getLength(); j++) {
Node attribute = attributes.item(j); Node childNode = childNodes.item(j);
if (attribute.getNodeName().equalsIgnoreCase("nuclide_name")) { //判断节点名称是否是item
info.setNuclideName(attribute.getNodeValue()); if (childNode.getNodeName().equalsIgnoreCase("item")) {
} else if (attribute.getNodeName().equalsIgnoreCase("halflife")) { //获取节点属性信息
info.setHalflife(Double.valueOf(attribute.getNodeValue())); NamedNodeMap attributes = childNode.getAttributes();
//判断节点属性信息是否为空
if (Objects.nonNull(attributes)) {
CalMDCInfo info = new CalMDCInfo();
//遍历属性信息
for (int k=0; k<attributes.getLength(); k++) {
//根据顺序读取属性
Node attribute = attributes.item(k);
if (attribute.getNodeName().equalsIgnoreCase("nuclide_name")) {
info.setNuclideName(attribute.getNodeValue());
} else if (attribute.getNodeName().equalsIgnoreCase("halflife")) {
info.setHalflife(Double.valueOf(attribute.getNodeValue()));
}
}
if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(info.getNuclideName()) && Objects.nonNull(info.getHalflife())) {
mdcInfoMap.put(info.getNuclideName(), info);
}
}
} }
} }
if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(info.getNuclideName()) && Objects.nonNull(info.getHalflife())) { if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
mdcInfoMap.put(info.getNuclideName(), info); redisUtil.set("mdcInfoMap-P", mdcInfoMap);
}
}
} else if (node.getNodeName().equalsIgnoreCase("G")) {//判断节点名称是否是 G
//存储文件结果用的map
Map<String, CalMDCInfo> mdcInfoMap = new TreeMap<>();
//获取节点的子节点
NodeList childNodes = node.getChildNodes();
//判断子节点是否为空
if (Objects.nonNull(childNodes) && childNodes.getLength() > 0) {
//遍历子节点信息
for (int j=0; j<childNodes.getLength(); j++) {
Node childNode = childNodes.item(j);
//判断节点名称是否是item
if (childNode.getNodeName().equalsIgnoreCase("item")) {
//获取节点属性信息
NamedNodeMap attributes = childNode.getAttributes();
//判断节点属性信息是否为空
if (Objects.nonNull(attributes)) {
CalMDCInfo info = new CalMDCInfo();
//遍历属性信息
for (int k=0; k<attributes.getLength(); k++) {
//根据顺序读取属性
Node attribute = attributes.item(k);
if (attribute.getNodeName().equalsIgnoreCase("nuclide_name")) {
info.setNuclideName(attribute.getNodeValue());
} else if (attribute.getNodeName().equalsIgnoreCase("halflife")) {
info.setHalflife(Double.valueOf(attribute.getNodeValue()));
}
}
if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(info.getNuclideName()) && Objects.nonNull(info.getHalflife())) {
mdcInfoMap.put(info.getNuclideName(), info);
}
}
}
}
if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
redisUtil.set("mdcInfoMap-G", mdcInfoMap);
} }
} }
} }
} }
} }
} }
if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
redisUtil.set("mdcInfoMap", mdcInfoMap);
}
} catch (ParserConfigurationException e) { } catch (ParserConfigurationException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} catch (IOException e) { } catch (IOException e) {