Merge branch '0418_小程序开发' of http:///192.168.16.64:3000/zhuangyuanke/PostDischargePatientManage into 0418_小程序开发

This commit is contained in:
youxilong 2024-07-09 17:44:42 +08:00
commit c893d60981
15 changed files with 202 additions and 59 deletions

View File

@ -19,4 +19,8 @@ public class KnowledgeBaseConstants {
* 微信库
*/
public static final String WECHAT = "WECHAT";
/**
* 短信库
*/
public static final String MESSAGE = "MESSAGE";
}

View File

@ -1,13 +1,17 @@
package com.xinelu.manage.controller.knowledgebase;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.dto.knowledgebase.KnowledgeBaseSaveDto;
import com.xinelu.manage.dto.operationinfo.BaseInfoQueryDto;
import com.xinelu.manage.service.knowlagebase.IKnowlageBaseService;
import com.xinelu.manage.service.knowledgebase.IKnowledgeBaseService;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -22,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
public class KnowledgeBaseController {
@Resource
private IKnowlageBaseService knowlageBaseService;
private IKnowledgeBaseService knowlageBaseService;
/**
* 知识库复制查询虚拟机构列表
@ -33,4 +37,15 @@ public class KnowledgeBaseController {
public TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto) {
return knowlageBaseService.getBaseInfoList(baseInfoQueryDto);
}
/**
* 新增知识库信息
*/
@ApiOperation("新增知识库信息")
@PreAuthorize("@ss.hasPermi('operationInfo:operationInfo:add')")
@PostMapping(value = "/copyBaseInfo")
public R<String> copyBaseInfo(@RequestBody KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
knowlageBaseService.copyBaseInfo(knowledgeBaseSaveDto);
return R.ok();
}
}

View File

@ -116,6 +116,9 @@ public class LabelFieldInfoController extends BaseController {
return toAjax(labelFieldInfoService.deleteLabelFieldInfoByIds(ids));
}
/**
* 任务类型分组
*/
@GetMapping("/taskTypeGrouping")
public AjaxResult taskTypeGrouping() {
return labelFieldInfoService.taskTypeGrouping();

View File

@ -4,14 +4,11 @@ import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
/**
* 手术信息对象 operation_info
@ -83,22 +80,8 @@ public class OperationInfo extends BaseEntity {
@Excel(name = "排序")
private Integer sort;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("departmentId", getDepartmentId())
.append("departmentName", getDepartmentName())
.append("operationName", getOperationName())
.append("operationCode", getOperationCode())
.append("operationInfo", getOperationInfo())
.append("operationRemark", getOperationRemark())
.append("sort", getSort())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
/**
* 公共库模板id
*/
private Long sourceTemplateId;
}

View File

@ -0,0 +1,36 @@
package com.xinelu.manage.dto.knowledgebase;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description: 知识库保存传输对象
* @author: haown
* @create: 2024-07-09 09:34
**/
@Data
public class KnowledgeBaseSaveDto {
/**
* 模板id
*/
@ApiModelProperty(value = "公共库模板id")
private Long sourceTemplateId;
/**
* 知识库类型
*/
@ApiModelProperty(value = "知识库类型,OPERATOR:手术SCRIPT话术WECHAT微信")
private String type;
/**
* 所属科室id
*/
@ApiModelProperty(value = "所属科室id")
private Long departmentId;
/**
* 所属科室名称
*/
@ApiModelProperty(value = "所属科室名称")
private String departmentName;
}

View File

@ -32,4 +32,28 @@ public class BaseInfoQueryDto {
*/
@ApiModelProperty(value = "手术名称")
private String operationName;
/**
* 通用话术名称
*/
@ApiModelProperty(value = "通用话术名称")
private String commonScriptName;
/**
* 话术名称
*/
@ApiModelProperty(value = "话术名称")
private String scriptName;
/**
* 话术状态正常NORMAL下架OFF_SHELF暂停SUSPEND
*/
@ApiModelProperty(value = "话术状态正常NORMAL下架OFF_SHELF暂停SUSPEND")
private String scriptStatus;
/**
* 微信模板名称
*/
@ApiModelProperty(value = "微信模板名称")
private String wechatTemplateName;
}

View File

@ -50,4 +50,10 @@ public class OperationInfoDto extends BaseEntity {
*/
@ApiModelProperty(value = "术式信息")
private String operationInfo;
/**
* 公共库模板id
*/
@ApiModelProperty(value = "公共库模板id")
private Long sourceTemplateId;
}

View File

@ -1,15 +0,0 @@
package com.xinelu.manage.service.knowlagebase;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.dto.operationinfo.BaseInfoQueryDto;
/**
* 知识库公共Service接口
*
* @author haown
* @date 2024-07-08
*/
public interface IKnowlageBaseService {
TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto);
}

View File

@ -0,0 +1,22 @@
package com.xinelu.manage.service.knowledgebase;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.manage.dto.knowledgebase.KnowledgeBaseSaveDto;
import com.xinelu.manage.dto.operationinfo.BaseInfoQueryDto;
/**
* 知识库公共Service接口
*
* @author haown
* @date 2024-07-08
*/
public interface IKnowledgeBaseService {
TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto);
/**
* 知识库复制
* @param knowladgeBaseSaveDto 知识库保存传输对象
*/
void copyBaseInfo(KnowledgeBaseSaveDto knowladgeBaseSaveDto);
}

View File

@ -1,24 +1,32 @@
package com.xinelu.manage.service.knowlagebase.impl;
package com.xinelu.manage.service.knowledgebase.impl;
import com.github.pagehelper.PageInfo;
import com.xinelu.common.constant.HttpStatus;
import com.xinelu.common.constant.KnowledgeBaseConstants;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.PageUtils;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.manage.domain.operationInfo.OperationInfo;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
import com.xinelu.manage.dto.knowledgebase.KnowledgeBaseSaveDto;
import com.xinelu.manage.dto.operationinfo.BaseInfoQueryDto;
import com.xinelu.manage.dto.operationinfo.OperationInfoDto;
import com.xinelu.manage.dto.script.ScriptInfoDto;
import com.xinelu.manage.dto.textmessage.TextMessageDTO;
import com.xinelu.manage.dto.wechattemplate.WechatTemplateDTO;
import com.xinelu.manage.mapper.operationInfo.OperationInfoMapper;
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
import com.xinelu.manage.mapper.textmessage.TextMessageMapper;
import com.xinelu.manage.mapper.wechattemplate.WechatTemplateMapper;
import com.xinelu.manage.service.knowlagebase.IKnowlageBaseService;
import com.xinelu.manage.service.knowledgebase.IKnowledgeBaseService;
import com.xinelu.manage.service.operationInfo.IOperationInfoService;
import com.xinelu.manage.vo.textmessage.TextMessageVO;
import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
/**
@ -27,14 +35,18 @@ import org.springframework.stereotype.Service;
* @create: 2024-07-08 16:25
**/
@Service
public class KnowlageBaseServiceImpl implements IKnowlageBaseService {
public class KnowledgeBaseServiceImpl implements IKnowledgeBaseService {
@Resource
private OperationInfoMapper operationInfoMapper;
@Resource
private IOperationInfoService operationInfoService;
@Resource
private ScriptInfoMapper scriptInfoMapper;
@Resource
private WechatTemplateMapper wechatTemplateMapper;
@Resource
private TextMessageMapper textMessageMapper;
@Override
public TableDataInfo getBaseInfoList(BaseInfoQueryDto baseInfoQueryDto) {
@ -76,7 +88,39 @@ public class KnowlageBaseServiceImpl implements IKnowlageBaseService {
rspData.setPageNum(new PageInfo(wechatTemplateList).getPageNum());
rspData.setTotal(new PageInfo(wechatTemplateList).getTotal());
break;
case KnowledgeBaseConstants.MESSAGE:
TextMessageDTO textMessageDTO = new TextMessageDTO();
BeanUtils.copyBeanProp(textMessageDTO, baseInfoQueryDto);
PageUtils.startPage();
List<TextMessageVO> messageList = textMessageMapper.selectTextMessageList(textMessageDTO);
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(messageList);
// 返回 页码
rspData.setPageNum(new PageInfo(messageList).getPageNum());
rspData.setTotal(new PageInfo(messageList).getTotal());
break;
}
return rspData;
}
@Override
public void copyBaseInfo(KnowledgeBaseSaveDto knowledgeBaseSaveDto) {
if (StringUtils.isBlank(knowledgeBaseSaveDto.getType())) {
throw new ServiceException("请输入知识库类型");
}
if (ObjectUtils.isEmpty(knowledgeBaseSaveDto.getDepartmentId())) {
throw new ServiceException("请选择科室");
}
switch(knowledgeBaseSaveDto.getType()) {
case KnowledgeBaseConstants.OPERATOR:
OperationInfo operationInfo = operationInfoMapper.selectOperationInfoById(knowledgeBaseSaveDto.getSourceTemplateId());
operationInfo.setId(null);
operationInfo.setDepartmentId(knowledgeBaseSaveDto.getDepartmentId());
operationInfo.setDepartmentName(knowledgeBaseSaveDto.getDepartmentName());
operationInfo.setSourceTemplateId(knowledgeBaseSaveDto.getSourceTemplateId());
operationInfoService.insertOperationInfo(operationInfo);
break;
}
}
}

View File

@ -181,14 +181,25 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
return 1;
}
/**
* 查询字段信息
*
* @return AjaxResult
*/
@Override
public AjaxResult taskTypeGrouping() {
//查询任务类型
List<TaskTypeDictVO> taskTypeDictList = taskTypeDictMapper.selectTaskTypeDicts();
List<Long> ids = taskTypeDictList.stream().filter(Objects::nonNull).map(TaskTypeDictVO::getTaskTypeId).filter(Objects::nonNull).collect(Collectors.toList());
//查询细分类型
if (CollectionUtils.isEmpty(taskTypeDictList)) {
return AjaxResult.success(taskTypeDictList);
}
List<TaskPartitionDict> taskPartitionDicts = taskPartitionDictMapper.selectTaskPartitionList(ids);
if (CollectionUtils.isEmpty(taskPartitionDicts)) {
return AjaxResult.success(taskPartitionDicts);
}
//组装
for (TaskTypeDictVO taskTypeDictVO : taskTypeDictList) {
List<TaskPartitionDict> collect = taskPartitionDicts.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getTaskTypeId()) && taskTypeDictVO.getTaskTypeId().equals(item.getTaskTypeId())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {

View File

@ -13,6 +13,7 @@
<result property="operationInfo" column="operation_info"/>
<result property="operationRemark" column="operation_remark"/>
<result property="sort" column="sort"/>
<result property="sourceTemplateId" column="source_template_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
@ -28,6 +29,7 @@
operation_info,
operation_remark,
sort,
source_template_id,
create_by,
create_time,
update_by,
@ -43,16 +45,10 @@
#{departmentId}
</if>
<if test="departmentName != null and departmentName != ''">
and department_name like concat('%',
#{departmentName},
'%'
)
and department_name like concat('%',#{departmentName},'%')
</if>
<if test="operationName != null and operationName != ''">
and operation_name like concat('%',
#{operationName},
'%'
)
and operation_name like concat('%',#{operationName},'%')
</if>
<if test="operationCode != null and operationCode != ''">
and operation_code = #{operationCode}
@ -66,6 +62,9 @@
<if test="sort != null ">
and sort = #{sort}
</if>
<if test="sourceTemplateId != null ">
and source_template_id = #{sourceTemplateId}
</if>
</where>
order by create_time DESC
</select>
@ -104,6 +103,9 @@
<if test="operationInfo != null and operationInfo != ''">
and oi.operation_info = #{operationInfo}
</if>
<if test="sourceTemplateId != null ">
and source_template_id = #{sourceTemplateId}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
@ -150,6 +152,8 @@
</if>
<if test="sort != null">sort,
</if>
<if test="sourceTemplateId != null ">source_template_id,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
@ -174,6 +178,8 @@
</if>
<if test="sort != null">#{sort},
</if>
<if test="sourceTemplateId != null ">#{sourceTemplateId},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
@ -209,6 +215,9 @@
<if test="sort != null">sort =
#{sort},
</if>
<if test="sourceTemplateId != null ">
source_template_id = #{sourceTemplateId},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>

View File

@ -821,6 +821,5 @@
<foreach item="manageRouteId" collection="manageRouteIds" open="(" separator="," close=")">
#{manageRouteId}
</foreach>
and dic.dict_type ='task_content'
</select>
</mapper>

View File

@ -125,14 +125,14 @@
wt.template_sort,
wt.template_remark,
wtst.id AS taskId,
GROUP_CONCAT(wtst.suit_task_type_name SEPARATOR ',') as suitTaskTypeName
GROUP_CONCAT(wtst.suit_task_type_name SEPARATOR ',') as suitTaskTypeName
from wechat_template wt
left join wechat_template_suit_task wtst on wt.id = wtst.wechat_template_id
left join department d on d.id = wt.department_id
<where>
<if test="hospitalAgencyId != null">
and d.hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="hospitalAgencyId != null">
and d.hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="departmentId != null ">
and wt.department_id =
#{departmentId}
@ -156,7 +156,7 @@
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
group by wt.id order by wt.create_time DESC,wtst.create_time DESC
group by wt.id,wtst.id order by wt.create_time DESC,wtst.create_time DESC
</select>
<select id="selectWechatTemplateDtoById" resultMap="WechatTemplateVOResultMap">
select wt.id,

View File

@ -312,8 +312,9 @@ public class HomePageServiceImpl implements HomePageService {
//查询问卷
QuestionInfo questionInfo = questionInfoMapper.selectQuestionInfoById(signPatientManageRouteNode.getQuestionInfoId());
// 查询题目表
QuestionVO questionVO = new QuestionVO();
if (Objects.nonNull(questionInfo)) {
BeanUtils.copyBeanProp(messageContentVO.getQuestion(), questionInfo);
BeanUtils.copyBeanProp(questionVO, questionInfo);
List<QuestionSubjectVO> questionSubjects = questionSubjectMapper.selectQuestionSubjectBy(signPatientManageRouteNode.getQuestionInfoId());
if (CollectionUtils.isNotEmpty(questionSubjects)) {
List<Long> questionSubjectIds = questionSubjects.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getId())).map(QuestionSubject::getId).collect(Collectors.toList());
@ -323,7 +324,8 @@ public class HomePageServiceImpl implements HomePageService {
List<QuestionSubjectOptionVO> collect = questionSubjectOptions.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getQuestionnaireSubjectId()) && questionSubject.getId().equals(item.getQuestionnaireSubjectId())).collect(Collectors.toList());
questionSubject.setQuestionSubjectOptionList(collect);
}
messageContentVO.getQuestion().setQuestionSubjectList(questionSubjects);
questionVO.setQuestionSubjectList(questionSubjects);
messageContentVO.setQuestion(questionVO);
}
}
}
@ -335,7 +337,7 @@ public class HomePageServiceImpl implements HomePageService {
messageContentVO.setPropagandaContent(JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)));
}
//副文本塞值
if (!TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(signPatientManageRouteNode.getTaskType()) || !TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo().equals(signPatientManageRouteNode.getTaskType()) || !TaskContentEnum.ARTIFICIAL_FOLLOW_UP.getInfo().equals(signPatientManageRouteNode.getTaskType())) {
if (!TaskContentEnum.PROPAGANDA_ARTICLE.getInfo().equals(signPatientManageRouteNode.getTaskType()) && !TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo().equals(signPatientManageRouteNode.getTaskType()) && !TaskContentEnum.ARTIFICIAL_FOLLOW_UP.getInfo().equals(signPatientManageRouteNode.getTaskType())) {
messageContentVO.setTaskType(TaskContentEnum.TEXT_REMIND.getInfo());
messageContentVO.setNodeContent(signPatientManageRouteNode.getNodeContent());
}