nodeParams = new ArrayList<>();
+ SignPatientManageRouteNode signPatientManageRouteNode = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(manageNodeId);
+ if (StringUtils.isNotBlank(signPatientManageRouteNode.getNodeContent()) && signPatientManageRouteNode.getNodeContent().contains("data-fieldMark")) {
+ JSONObject paramValues = getParamsValue(signPatientManageRouteNode.getTaskSubdivision(), patientId);
+ Document document = Jsoup.parse(signPatientManageRouteNode.getNodeContent());
+ // 需要提取的span
+ Elements spanlist = document.getElementsByClass("attachment");
+ for (Element span : spanlist) {
+ PatientNodeParamsCurrent nodeParam = new PatientNodeParamsCurrent();
+ String paramKey = span.attr("data-fieldMark");
+ String paramName = span.attr("data-fileSpan");
+ nodeParam.setParamName(paramName);
+ nodeParam.setParamKey(paramKey);
+ nodeParam.setParamValue(paramValues.getOrDefault(paramKey, "").toString());
+ nodeParams.add(nodeParam);
+ }
+ }
+ return nodeParams;
+ }
+
+ /**
+ * 根据任务细分类型获取患者的真实信息
+ * @param taskSubdivision 任务细分类型code
+ * @param patientId 患者主键
+ * @return 实际信息
+ */
+ private JSONObject getParamsValue(String taskSubdivision, Long patientId) {
+ JSONObject retObj = new JSONObject();
+ PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientId);
+ switch (taskSubdivision) {
+ // 健康档案
+ case "TPC202405200001":
+ retObj = JSONObject.parseObject(JSONObject.toJSONString(patientInfo));
+ break;
+ default:
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+ retObj.fluentPut("patientName", patientInfo.getPatientName())
+ .fluentPut("dischargeTime", patientInfo.getDischargeTime().format(df))
+ .fluentPut("visitDate", patientInfo.getVisitDate().format(df));
+ break;
+ }
+ return retObj;
+ }
+
+ // nodeContent标签提取替换
+ public static void main(String[] args) {
+ // json为数据库中的对象
+ JSONObject json = new JSONObject();
+ json.fluentPut("name", "张三");
+ // html为前端传入后端的数据
+ String s = "患者信息姓名:请按时使用药物治疗。"
+ + "患者信息姓名:请按时吃饭。
";
+ Document document = Jsoup.parse(s);
+ //Elements spanlist = document.getElementsByClass("attachment");
+ //for (Element span : spanlist) {
+ // span.text(json.getString(span.id()))
+ // .removeAttr("id")
+ // .removeAttr("class")
+ // .removeAttr("data-w-e-type")
+ // .removeAttr("data-link")
+ // .removeAttr("data-w-e-is-void")
+ // .removeAttr("data-w-e-is-inline")
+ // .removeAttr("data-filespan")
+ // .removeAttr("data-filename");
+ //}
+ //Elements element = document.getElementsByTag("p");
+ //System.out.println("---------------------\n"+element.get(0).html());
+
+ Elements spanlist = document.getElementsByClass("attachment");
+ for (Element span : spanlist) {
+ String customAttribute = span.attr("data-fileSpan");
+ System.out.println("属性==========" + customAttribute);
+ }
+ }
}
diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamscurrent/PatientNodeParamsCurrentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamscurrent/PatientNodeParamsCurrentMapper.xml
new file mode 100644
index 00000000..cc86b779
--- /dev/null
+++ b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamscurrent/PatientNodeParamsCurrentMapper.xml
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select id, patient_id, patient_name, task_partition_dict_id, task_partition_dict_name, task_type_id, task_type_name, route_id, route_name, route_node_id, route_node_name, sn, param_name, param_key, param_value, create_time, update_by, update_time, create_by from patient_node_params_current
+
+
+
+
+
+
+
+ insert into patient_node_params_current
+
+ patient_id,
+
+ patient_name,
+
+ task_partition_dict_id,
+
+ task_partition_dict_name,
+
+ task_type_id,
+
+ task_type_name,
+
+ route_id,
+
+ route_name,
+
+ route_node_id,
+
+ route_node_name,
+
+ sn,
+
+ param_name,
+
+ param_key,
+
+ param_value,
+
+ create_time,
+
+ update_by,
+
+ update_time,
+
+ create_by,
+
+
+
+ #{patientId},
+
+ #{patientName},
+
+ #{taskPartitionDictId},
+
+ #{taskPartitionDictName},
+
+ #{taskTypeId},
+
+ #{taskTypeName},
+
+ #{routeId},
+
+ #{routeName},
+
+ #{routeNodeId},
+
+ #{routeNodeName},
+
+ #{sn},
+
+ #{paramName},
+
+ #{paramKey},
+
+ #{paramValue},
+
+ #{createTime},
+
+ #{updateBy},
+
+ #{updateTime},
+
+ #{createBy},
+
+
+
+
+
+ update patient_node_params_current
+
+ patient_id =
+ #{patientId},
+
+ patient_name =
+ #{patientName},
+
+ task_partition_dict_id =
+ #{taskPartitionDictId},
+
+ task_partition_dict_name =
+ #{taskPartitionDictName},
+
+ task_type_id =
+ #{taskTypeId},
+
+ task_type_name =
+ #{taskTypeName},
+
+ route_id =
+ #{routeId},
+
+ route_name =
+ #{routeName},
+
+ route_node_id =
+ #{routeNodeId},
+
+ route_node_name =
+ #{routeNodeName},
+
+ sn =
+ #{sn},
+
+ param_name =
+ #{paramName},
+
+ param_key =
+ #{paramKey},
+
+ param_value =
+ #{paramValue},
+
+ create_time =
+ #{createTime},
+
+ update_by =
+ #{updateBy},
+
+ update_time =
+ #{updateTime},
+
+ create_by =
+ #{createBy},
+
+
+ where id = #{id}
+
+
+
+ delete from patient_node_params_current where id = #{id}
+
+
+
+ delete from patient_node_params_current where id in
+
+ #{id}
+
+
+
\ No newline at end of file
diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml
new file mode 100644
index 00000000..a9b6846c
--- /dev/null
+++ b/postdischarge-manage/src/main/resources/mapper/manage/patientnodeparamslog/PatientNodeParamsLogMapper.xml
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select id, patient_id, patient_name, task_partition_dict_id, task_partition_dict_name, task_type_id, task_type_name, route_id, route_name, route_node_id, route_node_name, sn, param_name, param_key, param_value, create_time, create_by, update_by, update_time from patient_node_params_log
+
+
+
+
+
+
+
+ insert into patient_node_params_log
+
+ patient_id,
+
+ patient_name,
+
+ task_partition_dict_id,
+
+ task_partition_dict_name,
+
+ task_type_id,
+
+ task_type_name,
+
+ route_id,
+
+ route_name,
+
+ route_node_id,
+
+ route_node_name,
+
+ sn,
+
+ param_name,
+
+ param_key,
+
+ param_value,
+
+ create_time,
+
+ create_by,
+
+ update_by,
+
+ update_time,
+
+
+
+ #{patientId},
+
+ #{patientName},
+
+ #{taskPartitionDictId},
+
+ #{taskPartitionDictName},
+
+ #{taskTypeId},
+
+ #{taskTypeName},
+
+ #{routeId},
+
+ #{routeName},
+
+ #{routeNodeId},
+
+ #{routeNodeName},
+
+ #{sn},
+
+ #{paramName},
+
+ #{paramKey},
+
+ #{paramValue},
+
+ #{createTime},
+
+ #{createBy},
+
+ #{updateBy},
+
+ #{updateTime},
+
+
+
+
+
+ update patient_node_params_log
+
+ patient_id =
+ #{patientId},
+
+ patient_name =
+ #{patientName},
+
+ task_partition_dict_id =
+ #{taskPartitionDictId},
+
+ task_partition_dict_name =
+ #{taskPartitionDictName},
+
+ task_type_id =
+ #{taskTypeId},
+
+ task_type_name =
+ #{taskTypeName},
+
+ route_id =
+ #{routeId},
+
+ route_name =
+ #{routeName},
+
+ route_node_id =
+ #{routeNodeId},
+
+ route_node_name =
+ #{routeNodeName},
+
+ sn =
+ #{sn},
+
+ param_name =
+ #{paramName},
+
+ param_key =
+ #{paramKey},
+
+ param_value =
+ #{paramValue},
+
+ create_time =
+ #{createTime},
+
+ create_by =
+ #{createBy},
+
+ update_by =
+ #{updateBy},
+
+ update_time =
+ #{updateTime},
+
+
+ where id = #{id}
+
+
+
+ delete from patient_node_params_log where id = #{id}
+
+
+
+ delete from patient_node_params_log where id in
+
+ #{id}
+
+
+
\ No newline at end of file