话术修改

This commit is contained in:
zhangheng 2024-07-02 14:31:42 +08:00
parent a9238baa3f
commit 8db78cbba8
5 changed files with 49 additions and 6 deletions

View File

@ -64,4 +64,12 @@ public interface TermBankMapper {
* @return 结果
*/
int deleteTermBankByIds(Long[] ids);
/**
* 查询父级信息
*
* @param parentTermCode 父级编号
* @return TermBank
*/
TermBank selectTermBankByParentTermCode(String parentTermCode);
}

View File

@ -12,16 +12,23 @@ import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent;
import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
import com.xinelu.manage.domain.patientinfo.PatientAllInfoView;
import com.xinelu.manage.domain.patientinfo.PatientAllInfoViewUppercase;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO;
import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentDTO;
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
import com.xinelu.manage.mapper.labelfieldinfo.LabelFieldInfoMapper;
import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper;
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService;
import com.xinelu.manage.vo.labelfieldcontent.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -50,6 +57,8 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
private LabelFieldInfoMapper labelFieldInfoMapper;
@Resource
private PatientAllInfoViewMapper patientAllInfoViewMapper;
@Resource
private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper;
/**
* 查询标签字段内容信息
@ -193,6 +202,19 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
if (ObjectUtils.isEmpty(patientId)) {
throw new ServiceException("请选择患者!");
}
PatientTaskDto patientTaskDto = new PatientTaskDto();
patientTaskDto.setPatientId(patientId);
List<SignPatientManageRouteNode> nodeList = signPatientManageRouteNodeMapper.getNodeList(patientTaskDto);
List<String> nodeContentList = nodeList.stream().filter(Objects::nonNull).map(SignPatientManageRouteNode::getNodeContent).filter(Objects::nonNull).collect(Collectors.toList());
String nodeContentListJoin = String.join(",", nodeContentList);
Document document = Jsoup.parse(nodeContentListJoin);
// 需要提取的span
List<String> string = new ArrayList<>();
Elements spanList = document.select("span[data-w-e-type]");
for (Element span : spanList) {
String paramKey = span.attr("data-fieldMark");
string.add(paramKey);
}
//根据patientId查询是否有已经维护的参数
List<LabelFieldAndPartitionDict> labelFieldContents = labelFieldContentMapper.labelFieldAndPartitionDict(taskPartitionDictId, patientId, null);
if (CollectionUtils.isNotEmpty(labelFieldContents)) {

View File

@ -92,13 +92,17 @@ public class TermBankServiceImpl implements ITermBankService {
*/
@Override
public AjaxResult updateTermBank(TermBank termBank) {
if (Objects.nonNull(termBank) && Objects.nonNull(termBank.getTermLevel()) && termBank.getTermLevel() < Constants.TERM_MAX_LEVEL) {
termBank.setTermLevel(termBank.getTermLevel() + 1);
termBank.setTermLevel(1L);
if (StringUtils.isNotBlank(termBank.getParentTermCode())) {
TermBank parentTermCode = termBankMapper.selectTermBankByParentTermCode(termBank.getParentTermCode());
if (Objects.nonNull(parentTermCode) && Objects.nonNull(parentTermCode.getTermLevel())) {
termBank.setTermLevel(parentTermCode.getTermLevel() + 1);
}
}
if (Objects.nonNull(termBank) && Objects.nonNull(termBank.getTermLevel()) && termBank.getTermLevel() > (Constants.TERM_MAX_LEVEL)) {
if (Objects.nonNull(termBank.getTermLevel()) && termBank.getTermLevel() > (Constants.TERM_MAX_LEVEL)) {
return AjaxResult.error("常用话术层数最大值为" + Constants.TERM_MAX_LEVEL + "");
}
if (Objects.nonNull(termBank) && StringUtils.isBlank(termBank.getParentTermCode())) {
if (StringUtils.isBlank(termBank.getParentTermCode())) {
termBank.setTermLevel(Constants.TERM_MIN_LEVEL);
}
termBank.setUpdateTime(LocalDateTime.now());

View File

@ -331,12 +331,12 @@
spmrn.route_node_name AS 'routeNodeName',
spmrn.task_type,
CASE
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN COALESCE(spmrn.phone_template_name, spmrn.follow_template_name)
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_name
END AS 'templateName',
CASE
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN COALESCE(spmrn.phone_id, spmrn.follow_template_id)
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_id
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.question_info_id
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id
END AS 'templateId',

View File

@ -185,4 +185,13 @@
#{id}
</foreach>
</delete>
<select id="selectTermBankByParentTermCode" resultType="com.xinelu.manage.domain.termbank.TermBank">
<include refid="selectTermBankVo"/>
<where>
<if test="parentTermCode != null and parentTermCode != ''">
and term_code = #{parentTermCode}
</if>
</where>
</select>
</mapper>